Update app.py
Browse files
app.py
CHANGED
|
@@ -33,14 +33,16 @@ def chatbot(history, query):
|
|
| 33 |
else:
|
| 34 |
response = faq_df.iloc[best_idx]['answer']
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
|
|
|
| 40 |
|
| 41 |
history.append((query, response))
|
| 42 |
return history, history
|
| 43 |
|
|
|
|
| 44 |
with gr.Blocks(title="LIC Agent Chatbot") as demo:
|
| 45 |
gr.Markdown(
|
| 46 |
"<h1 style='text-align:center;color:#0D47A1;'>🧑💼 LIC Agent Assistant</h1>"
|
|
|
|
| 33 |
else:
|
| 34 |
response = faq_df.iloc[best_idx]['answer']
|
| 35 |
|
| 36 |
+
# Only suggest policy if it’s a confident answer
|
| 37 |
+
for keyword, suggestion in policy_suggestions.items():
|
| 38 |
+
if keyword in query_lower:
|
| 39 |
+
response += f"\n\n{suggestion}"
|
| 40 |
+
break
|
| 41 |
|
| 42 |
history.append((query, response))
|
| 43 |
return history, history
|
| 44 |
|
| 45 |
+
|
| 46 |
with gr.Blocks(title="LIC Agent Chatbot") as demo:
|
| 47 |
gr.Markdown(
|
| 48 |
"<h1 style='text-align:center;color:#0D47A1;'>🧑💼 LIC Agent Assistant</h1>"
|