Update app.py
Browse files
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 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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:
|