From 78bc3f71c014bfa5c00d4f86688ef556efac14fd Mon Sep 17 00:00:00 2001 From: hailin Date: Tue, 7 Apr 2026 03:09:04 -0700 Subject: [PATCH] fix: disable end_prompt, filter more thinking patterns from antaf end_prompt was being sent to antaf as user message, causing LLM to output its thinking process. Disabled end_prompt and added more thinking patterns to filter. Co-Authored-By: Claude Opus 4.6 (1M context) --- config/.config.yaml | 4 +--- modules/antaf/antaf_llm.py | 9 +++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/config/.config.yaml b/config/.config.yaml index 40e4c2c..66758c8 100644 --- a/config/.config.yaml +++ b/config/.config.yaml @@ -13,9 +13,7 @@ prompt: "" system_error_response: "抱歉,小虎现在有点忙,咱们稍后再聊。" end_prompt: - enable: true - prompt: | - 请你以关心对方健康的语气结束对话,提醒注意休息、按时吃药、保持好心情,像一位贴心的家庭医生告别。 + enable: false wakeup_words: - "你好小智" diff --git a/modules/antaf/antaf_llm.py b/modules/antaf/antaf_llm.py index 5d9e332..4c7788e 100644 --- a/modules/antaf/antaf_llm.py +++ b/modules/antaf/antaf_llm.py @@ -26,12 +26,17 @@ class LLMProvider(LLMProviderBase): def _is_thinking(text): """检测蚂蚁阿福的内心思考/推理过程,这些不应该发给用户""" thinking_patterns = [ - "用户问", "用户说", "用户的", "用户可能", "用户真正", - "我得", "我会", "我在想", "我决定", "我要", + "用户问", "用户说", "用户的", "用户可能", "用户真正", "用户让我", + "我得", "我会", "我在想", "我决定", "我要", "我需要确保", "我需要", "语气比较", "感觉他", "让他知道", "让他觉得", "先安抚", "得先", "不想表现", "整体语气", "这样能", "这样他", "所以我", "还带了个", + "首先记录", "是否有其他", "在这种情况下", + "必须遵循", "角色设定", "确保回复", + "避免任何生硬", "技术性的表达", + "提供的日期", "作为测试", "模拟使用", + "需要确认或澄清", "普遍适用性", ] for p in thinking_patterns: if p in text: