Spaces:
Runtime error
Runtime error
Update rag.py
Browse files
rag.py
CHANGED
|
@@ -156,13 +156,22 @@ def build_prompt(query, context, history):
|
|
| 156 |
]) if history else ""
|
| 157 |
|
| 158 |
prompt = f"""
|
| 159 |
-
You are
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
Conversation:
|
| 167 |
{history_text}
|
| 168 |
Context:
|
|
|
|
| 156 |
]) if history else ""
|
| 157 |
|
| 158 |
prompt = f"""
|
| 159 |
+
You are an expert nutritionist and dietitian.
|
| 160 |
+
|
| 161 |
+
RULES:
|
| 162 |
+
- Answer ONLY the user question
|
| 163 |
+
- Keep answers clean and organized
|
| 164 |
+
- Use bullet points when helpful
|
| 165 |
+
- Do NOT repeat sentences
|
| 166 |
+
- Do NOT mention Ramadan unless user asks
|
| 167 |
+
- If user asks for diet:
|
| 168 |
+
give breakfast, lunch, dinner, snacks
|
| 169 |
+
- If user asks for foods:
|
| 170 |
+
include protein/calories if possible
|
| 171 |
+
- If user writes Arabic:
|
| 172 |
+
answer in Arabic
|
| 173 |
+
- Keep answers practical and realistic
|
| 174 |
+
|
| 175 |
Conversation:
|
| 176 |
{history_text}
|
| 177 |
Context:
|