From 653599b7e7f35de10794ab90691fb13543acd7fe Mon Sep 17 00:00:00 2001 From: Windpicker-owo <3431391539@qq.com> Date: Sun, 7 Sep 2025 03:34:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E5=B0=86=E7=BA=AF=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E5=8C=85=E8=A3=85=E6=88=90=20ResponseSet=20=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chat/chat_loop/proactive/proactive_thinker.py | 4 ++-- src/chat/chat_loop/response_handler.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/chat/chat_loop/proactive/proactive_thinker.py b/src/chat/chat_loop/proactive/proactive_thinker.py index 2ee715a4c..6f5f60825 100644 --- a/src/chat/chat_loop/proactive/proactive_thinker.py +++ b/src/chat/chat_loop/proactive/proactive_thinker.py @@ -219,8 +219,8 @@ class ProactiveThinker: ) if response_text: - # 将纯文本包装成 ResponseSet 格式 - response_set = [{"type": "text", "data": {"text": response_text}}] + # 不要将纯文本包装成 ResponseSet 格式! + response_set = [response_text] await self.cycle_processor.response_handler.send_response( response_set, time.time(), action_result.get("action_message") ) diff --git a/src/chat/chat_loop/response_handler.py b/src/chat/chat_loop/response_handler.py index b115abe40..354addc45 100644 --- a/src/chat/chat_loop/response_handler.py +++ b/src/chat/chat_loop/response_handler.py @@ -1,4 +1,5 @@ import time +import orjson import random from typing import Dict, Any, Tuple @@ -154,7 +155,7 @@ class ResponseHandler: if isinstance(data, list): data = "".join(map(str, data)) - reply_text += data.get("data",{}).get("text","") + reply_text += data # 如果是主动思考且内容为“沉默”,则不发送 if is_proactive_thinking and data.strip() == "沉默":