davidtran999 commited on
Commit
5d045a6
·
verified ·
1 Parent(s): 7f9eb5f

Upload backend/hue_portal/chatbot/chatbot.py with huggingface_hub

Browse files
backend/hue_portal/chatbot/chatbot.py CHANGED
@@ -130,7 +130,11 @@ class Chatbot(CoreChatbot):
130
  route_decision.forced_intent = "search_legal"
131
 
132
  # Instant exact-match cache lookup
133
- cached_response = EXACT_MATCH_CACHE.get(query, intent)
 
 
 
 
134
  if cached_response:
135
  cached_response["_cache"] = "exact_match"
136
  cached_response["_source"] = cached_response.get("_source", "cache")
 
130
  route_decision.forced_intent = "search_legal"
131
 
132
  # Instant exact-match cache lookup
133
+ # ⚠️ Tắt cache cho intent search_legal để luôn đi qua wizard / Slow Path,
134
+ # tránh trả lại các câu trả lời cũ không có options.
135
+ cached_response = None
136
+ if intent != "search_legal":
137
+ cached_response = EXACT_MATCH_CACHE.get(query, intent)
138
  if cached_response:
139
  cached_response["_cache"] = "exact_match"
140
  cached_response["_source"] = cached_response.get("_source", "cache")