kk20krishna commited on
Commit
0e73a31
·
verified ·
1 Parent(s): 012df3c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -13
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
- "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
- "For each user query, structure your response in clear Markdown format with the following sections:\n\n"
278
 
279
  "**📄 Policy Details:**\n"
280
- "- Summarize the relevant policy clauses directly quoted or paraphrased from the document.\n"
281
- "- Present information factually and clearly.\n\n"
282
 
283
  "**🧠 Simplified Explanation:**\n"
284
- "- Translate the above policy content into simple, user-friendly language.\n"
285
- "- Avoid legal jargon. Use bullet points where helpful.\n\n"
286
 
287
  "**💡 Advisor’s Practical Tip:**\n"
288
- "- Offer personalized, actionable advice based on the user's query and the policy.\n"
289
- "- Show the user how to make the most of their benefits.\n\n"
290
 
291
  "**⚠️ Caveats and Exclusions:**\n"
292
- "- Clearly highlight any limitations, exclusions, waiting periods, or special conditions that apply.\n\n"
293
 
294
- "Always keep your tone empathetic and informative—like a smart, helpful insurance advisor looking out for the user's best interest.\n\n"
295
-
296
- "Always remember to structure the response with the sections specified above. And always remember to use Markdown format for the response."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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