dschandra commited on
Commit
7df1176
·
verified ·
1 Parent(s): e216d81

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -33,14 +33,16 @@ def chatbot(history, query):
33
  else:
34
  response = faq_df.iloc[best_idx]['answer']
35
 
36
- for keyword, suggestion in policy_suggestions.items():
37
- if keyword in query_lower:
38
- response += f"\n\n{suggestion}"
39
- break
 
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>"