feat(common problems fuzzy query): 增加常用问题模糊查询兜底
This commit is contained in:
1 parent
b69c725992
commit
5a269f940d
18 files changed
+411
-58
No files matched your search
@@ -14,6 +14,7 @@ import pytest
|
||||
|
||||
from app.services.chat.intent_route_registry import ensure_intent_routes_loaded
|
||||
from app.services.chat.router import FastRouteResult, try_fast_route
|
||||
from app.services.faq_cache import FaqCacheMatch
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
@@ -42,11 +43,11 @@ def _user(**kwargs):
|
||||
|
||||
def test_try_fast_route_faq_cache(monkeypatch):
|
||||
"""FAQ 命中时应返回 faq_cache 路由。"""
|
||||
faq_entry = object()
|
||||
faq_match = FaqCacheMatch(entry=object(), match_type='exact', match_score=1.0, matched_text='常见问题')
|
||||
|
||||
monkeypatch.setattr(
|
||||
'app.services.faq_cache.FaqCacheService.try_match',
|
||||
staticmethod(lambda query, agent_id: faq_entry),
|
||||
staticmethod(lambda query, agent_id: faq_match),
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
'app.services.faq_cache.FaqCacheService.stream_chat',
|
||||
|
||||
Reference in new issue
Block a user