Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -269,33 +269,48 @@ def ask_question(message, history):
|
|
| 269 |
advisory_prompt = (
|
| 270 |
"Use the PolicyRetrievalRAG tool to extract the most relevant clauses from the policy document. "
|
| 271 |
"Always base your response strictly on the actual policy content—do not fabricate or assume.\n\n"
|
| 272 |
-
|
| 273 |
-
|
| 274 |
"as defined by the IRDAI (Insurance Regulatory and Development Authority of India). "
|
| 275 |
"If the policy appears to deviate from IRDAI norms, flag this clearly.\n\n"
|
| 276 |
|
| 277 |
-
"
|
| 278 |
|
| 279 |
"**📄 Policy Details:**\n"
|
| 280 |
-
"-
|
| 281 |
-
"- Present information factually and clearly.\n\n"
|
| 282 |
|
| 283 |
"**🧠 Simplified Explanation:**\n"
|
| 284 |
-
"- Translate the
|
| 285 |
-
"- Avoid legal jargon. Use bullet points where helpful.\n\n"
|
| 286 |
|
| 287 |
"**💡 Advisor’s Practical Tip:**\n"
|
| 288 |
-
"-
|
| 289 |
-
"- Show the user how to make the most of their benefits.\n\n"
|
| 290 |
|
| 291 |
"**⚠️ Caveats and Exclusions:**\n"
|
| 292 |
-
"-
|
| 293 |
|
| 294 |
-
"
|
| 295 |
-
|
| 296 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 297 |
)
|
| 298 |
|
|
|
|
| 299 |
|
| 300 |
prompt = f"{advisory_prompt}\nQuestion: {message}"
|
| 301 |
|
|
|
|
| 269 |
advisory_prompt = (
|
| 270 |
"Use the PolicyRetrievalRAG tool to extract the most relevant clauses from the policy document. "
|
| 271 |
"Always base your response strictly on the actual policy content—do not fabricate or assume.\n\n"
|
| 272 |
+
|
| 273 |
+
"All advice must be grounded in Indian medical insurance standards and practices, "
|
| 274 |
"as defined by the IRDAI (Insurance Regulatory and Development Authority of India). "
|
| 275 |
"If the policy appears to deviate from IRDAI norms, flag this clearly.\n\n"
|
| 276 |
|
| 277 |
+
"Respond strictly in this structured Markdown format:\n\n"
|
| 278 |
|
| 279 |
"**📄 Policy Details:**\n"
|
| 280 |
+
"- Quote or paraphrase the most relevant clauses from the policy.\n\n"
|
|
|
|
| 281 |
|
| 282 |
"**🧠 Simplified Explanation:**\n"
|
| 283 |
+
"- Translate the policy language into simple, user-friendly language.\n\n"
|
|
|
|
| 284 |
|
| 285 |
"**💡 Advisor’s Practical Tip:**\n"
|
| 286 |
+
"- Give actionable tips to help the user get the most from their policy.\n\n"
|
|
|
|
| 287 |
|
| 288 |
"**⚠️ Caveats and Exclusions:**\n"
|
| 289 |
+
"- Mention any exclusions, limitations, or waiting periods.\n\n"
|
| 290 |
|
| 291 |
+
"Your tone should be empathetic and clear—like a smart, helpful insurance advisor.\n"
|
| 292 |
+
"Format everything using **Markdown**. Always include all four sections in the output.\n\n"
|
| 293 |
+
|
| 294 |
+
"---\n"
|
| 295 |
+
"### Example Response Format:\n"
|
| 296 |
+
"**📄 Policy Details:**\n"
|
| 297 |
+
"- ...\n\n"
|
| 298 |
+
"**🧠 Simplified Explanation:**\n"
|
| 299 |
+
"- ...\n\n"
|
| 300 |
+
"**💡 Advisor’s Practical Tip:**\n"
|
| 301 |
+
"- ...\n\n"
|
| 302 |
+
"**⚠️ Caveats and Exclusions:**\n"
|
| 303 |
+
"- ...\n"
|
| 304 |
+
"---"
|
| 305 |
+
"---\n"
|
| 306 |
+
"### Example Response:\n"
|
| 307 |
+
"**📄 Policy Details:**\n- The policy offers 24-month waiting period for pre-existing conditions.\n\n"
|
| 308 |
+
"**🧠 Simplified Explanation:**\n- You have to wait 2 years before claims related to past illnesses are covered.\n\n"
|
| 309 |
+
"**💡 Advisor’s Practical Tip:**\n- Consider a top-up or rider that waives this waiting period.\n\n"
|
| 310 |
+
"**⚠️ Caveats and Exclusions:**\n- Diabetes and hypertension are included in pre-existing illnesses list.\n\n"
|
| 311 |
)
|
| 312 |
|
| 313 |
+
|
| 314 |
|
| 315 |
prompt = f"{advisory_prompt}\nQuestion: {message}"
|
| 316 |
|