Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
| 43 |
-
"
|
| 44 |
-
"
|
| 45 |
-
"
|
|
|
|
|
|
|
|
|
|
| 46 |
)
|
| 47 |
else:
|
| 48 |
system_prompt = (
|
| 49 |
-
"You are a medical
|
| 50 |
-
"
|
| 51 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 (3–4 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]:
|