fix(training-chat): 修复员工培训HR统计问答失败并补充后端兜底

This commit is contained in:
runny committed 2026-07-09 16:53:56 +08:00
1 parent 50ccd31b84
commit 39ef8a49c9
5 files changed
+240 -6

No files matched your search

+14
View File
@@ -64,6 +64,7 @@ def try_fast_route(
iter_enabled_chat_intent_routes,
)
from app.services.faq_cache import FaqCacheService
from app.services.chat import training_hr_stats_fallback
ensure_intent_routes_loaded()
@@ -86,6 +87,19 @@ def try_fast_route(
route_name='faq_cache',
)
if not has_files and training_hr_stats_fallback.supports(user=user, agent=agent, query=query):
_log_fast_route('training_hr_stats_fallback', agent_code=agent_code, agent_id=agent_id, session_id=session_id)
return FastRouteResult(
generator=training_hr_stats_fallback.stream_chat(
query,
user,
agent,
external_conversation_id,
session_id=session_id,
),
route_name='training_hr_stats_fallback',
)
ctx = ChatIntentRouteContext(
user=user,
agent=agent,