From a34217b1827cd29e21d9b87dd456517914d79c9d Mon Sep 17 00:00:00 2001 From: eric Date: Thu, 2 Apr 2026 05:30:18 -0500 Subject: [PATCH] 's' --- app/routers/chatbot.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/routers/chatbot.py b/app/routers/chatbot.py index b01e495..b493164 100644 --- a/app/routers/chatbot.py +++ b/app/routers/chatbot.py @@ -154,11 +154,10 @@ def shared_build_h5_keyword_message(query: str, user_id: str, profile_key: str) """关键词命中时返回文档约定的 H5 msg(再经 _normalize 输出)。 命中规则:对用户 Query 首尾 trim 后,**包含**配置词作为连续子串即命中(子串匹配), - 不要求用户整句与关键词全等。异度(/hackrobot) 群卡片仅认「群」;Eric(/chatbot) 另认「加群」。 + 不要求用户整句与关键词全等。群卡片统一按「群」子串命中。 """ q = (query or "").strip() uid = (user_id or "").strip() - prof = _resolve_profile_key(profile_key) if "电子书" in q: return { "news": { @@ -173,11 +172,7 @@ def shared_build_h5_keyword_message(query: str, user_id: str, profile_key: str) ] } } - if prof == HACKROBOT_PROFILE: - # 「加群」含「群」子串,异度仅按「群」触发时需排除「加群」整词 - group_hit = ("群" in q) and ("加群" not in q) - else: - group_hit = ("群" in q) or ("加群" in q) + group_hit = "群" in q if group_hit: return { "news": {