kk20krishna commited on
Commit
a1982ff
·
verified ·
1 Parent(s): 4b68ae5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -4
app.py CHANGED
@@ -262,12 +262,22 @@ def ask_question(message, history):
262
  if agent_executor is None:
263
  return "❗ Chatbot not ready. Please upload and process a PDF first."
264
 
 
 
 
 
265
  advisory_prompt = (
266
- "Reterive policy information using PolicyRetrievalRAG tool and answer the user questions."
267
- "Always use data returned by the policy. Do not makeup information."
268
- #"In addition to answering the question based on the insurance policy, "
269
- #"give practical advice to the user on how they might use or take advantage of any relevant clause."
 
 
 
 
 
270
  )
 
271
  prompt = f"{advisory_prompt}\nQuestion: {message}"
272
 
273
  try:
 
262
  if agent_executor is None:
263
  return "❗ Chatbot not ready. Please upload and process a PDF first."
264
 
265
+ # advisory_prompt = (
266
+ # "Reterive policy information using PolicyRetrievalRAG tool and answer the user questions."
267
+ # "Always use data returned by the policy. Do not makeup information."
268
+ # )
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
+ "For each user question:\n"
274
+ "1. Identify and summarize the relevant policy clauses.\n"
275
+ "2. Explain these clauses in simple, user-friendly language.\n"
276
+ "3. Offer personalized, practical advice on how the user can best take advantage of these benefits.\n"
277
+ "4. Clearly point out any caveats, conditions, or exclusions that the user should be aware of.\n\n"
278
+ "Keep the tone empathetic and informative. Be helpful like a smart insurance advisor."
279
  )
280
+
281
  prompt = f"{advisory_prompt}\nQuestion: {message}"
282
 
283
  try: