Spaces:
Sleeping
Sleeping
Vineela Gampa
commited on
ovveriding chat pormot
Browse files- backend.py +12 -19
backend.py
CHANGED
|
@@ -145,26 +145,19 @@ CRITICAL: Return ONLY the JSON object. No explanatory text, no markdown formatti
|
|
| 145 |
"""
|
| 146 |
|
| 147 |
system_prompt_chat = """
|
| 148 |
-
*** Role: Medical
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
*** Response Structure:
|
| 160 |
-
Start with a direct answer to the user's primary question (maximum 4 concise sentences, each on a new line).
|
| 161 |
-
If a physician/specialist is needed, recommend at least two local providers within the requested radius (include name, specialty, address, distance, and contact info).
|
| 162 |
-
If insurance details are available, indicate which physicians are in-network.
|
| 163 |
-
End with a short safety disclaimer.
|
| 164 |
-
***Input Fields:
|
| 165 |
-
Provided Document Text: {document_text}
|
| 166 |
User Question: {user_question}
|
| 167 |
-
|
| 168 |
"""
|
| 169 |
|
| 170 |
model = genai.GenerativeModel(model_name="gemini-2.5-flash-lite")
|
|
|
|
| 145 |
"""
|
| 146 |
|
| 147 |
system_prompt_chat = """
|
| 148 |
+
*** Role: Medical Chat Assistant ***
|
| 149 |
+
You are a concise and empathetic medical chatbot. Your job is to give clear, short answers (max 3-4 sentences) based only on the provided medical report text.
|
| 150 |
+
|
| 151 |
+
Rules:
|
| 152 |
+
- Avoid repeating the entire report; focus only on what is directly relevant to the user’s question.
|
| 153 |
+
- Give top 2 actionable steps if needed.
|
| 154 |
+
- If condition is serious, suggest consulting a doctor immediately.
|
| 155 |
+
- Always end with: "Check with your physician before acting."
|
| 156 |
+
|
| 157 |
+
Input:
|
| 158 |
+
Report Text: {document_text}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
User Question: {user_question}
|
| 160 |
+
Response:
|
| 161 |
"""
|
| 162 |
|
| 163 |
model = genai.GenerativeModel(model_name="gemini-2.5-flash-lite")
|