Muhammadidrees commited on
Commit
d477b36
·
verified ·
1 Parent(s): 7fdf8f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -7
app.py CHANGED
@@ -39,17 +39,26 @@ def process_message(message, history, question_count):
39
 
40
  if should_analyze:
41
  system_prompt = (
42
- "You are a medical doctor. Based on the patient's responses, provide a comprehensive analysis "
43
- "of potential causes for their symptoms. Start with 'Based on the information provided by the patient, "
44
- "potential causes of [symptoms] could include:' and list 3-4 possible diagnoses with brief explanations. "
45
- "Format as numbered list with diagnosis name and short explanation."
 
 
 
46
  )
47
  else:
48
  system_prompt = (
49
- "You are a medical doctor conducting a patient interview. Ask ONE specific, direct medical question "
50
- "to gather important diagnostic information. Keep it brief - just ask the question without explanations. "
51
- "Focus on key areas like: age, medical history, medications, lifestyle, family history, or symptom details."
 
 
 
 
 
52
  )
 
53
 
54
  dialogue = []
55
  for user_msg, bot_msg in history[:-1]:
 
39
 
40
  if should_analyze:
41
  system_prompt = (
42
+ "You are a highly experienced medical expert who combines the roles of a medical doctor, specialist, "
43
+ "nutritionist, and medical teacher. Based only on the patient's provided information, give a clear and structured analysis:\n\n"
44
+ "1. Possible health issues or conditions the patient might have (34 points).\n"
45
+ "2. Dietary and lifestyle recommendations specific to the patient’s situation.\n"
46
+ "3. Guidance on which type of doctor or specialist the patient should consult.\n\n"
47
+ "Be concise, professional, and easy to understand for a non-medical person. "
48
+ "If you mention complex medical terms, briefly explain them in simple language."
49
  )
50
  else:
51
  system_prompt = (
52
+ "You are a medical expert conducting a patient interview. Follow these rules:\n"
53
+ "1. If the user simply shares symptoms or health info, ask ONE direct and specific medical question "
54
+ "to gather diagnostic details (e.g., age, medical history, medications, lifestyle, family history, or symptoms). "
55
+ "Do not explain, just ask the question.\n"
56
+ "2. If the user explicitly asks for a diet plan, provide a complete, practical diet plan. "
57
+ "Avoid unnecessary disclaimers, but keep it safe and balanced.\n"
58
+ "3. If the user asks about a complex medical term, give a clear and simple explanation.\n\n"
59
+ "Always keep responses brief, clear, and professional."
60
  )
61
+
62
 
63
  dialogue = []
64
  for user_msg, bot_msg in history[:-1]: