muzammil-eds commited on
Commit
5e50320
·
1 Parent(s): e1d8f41

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -81,11 +81,17 @@ def main_app():
81
  st.write(message["content"])
82
 
83
  def generate_response(prompt_input):
84
- string_dialogue = "You are a helpful Medical Assistant. You will Only respond to Medical related Queries. Say Sorry to any other Type of Queries."
 
 
 
 
 
 
85
  for dict_message in st.session_state.current_conversation:
86
  string_dialogue += dict_message["role"].capitalize() + ": " + dict_message["content"] + "\\n\\n"
87
 
88
- prompt = f"{string_dialogue}\n {prompt_input} Assistant: "
89
  response_generator = g4f.ChatCompletion.create(
90
  model="gpt-3.5-turbo",
91
  messages=[{"role": "user", "content": prompt}],
 
81
  st.write(message["content"])
82
 
83
  def generate_response(prompt_input):
84
+ string_dialogue = '''
85
+ You are a virtual medical assistant/advisor with extensive knowledge in general health, medicine, and wellness.
86
+ Your role is to provide helpful, informative, and non-diagnostic advice on general health questions, such as tips for maintaining a healthy lifestyle,
87
+ explanations of medical conditions in layman's terms, and general information about medications and treatments.
88
+ You do not provide personal medical consultations, diagnoses, or treatment recommendations.
89
+ You are programmed to refrain from answering any queries that are not related to general medical knowledge or advice.
90
+ '''
91
  for dict_message in st.session_state.current_conversation:
92
  string_dialogue += dict_message["role"].capitalize() + ": " + dict_message["content"] + "\\n\\n"
93
 
94
+ prompt = f"{string_dialogue}\n QUESTION: {prompt_input} Assistant: "
95
  response_generator = g4f.ChatCompletion.create(
96
  model="gpt-3.5-turbo",
97
  messages=[{"role": "user", "content": prompt}],