From 95d70df13a8b897bccda0427182cc40de2382815 Mon Sep 17 00:00:00 2001 From: minecraft1024a Date: Sat, 6 Sep 2025 16:03:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(chat):=20=E5=A4=84=E7=90=86=E5=93=8D?= =?UTF-8?q?=E5=BA=94=E6=95=B0=E6=8D=AE=E4=B8=BA=E5=88=97=E8=A1=A8=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当响应内容`data`是一个列表时,将其所有元素连接成一个字符串,以避免在后续处理中因类型不匹配而引发的错误。 --- .gitignore | 1 + src/chat/chat_loop/response_handler.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 8b38e34c8..1e23a40f1 100644 --- a/.gitignore +++ b/.gitignore @@ -337,3 +337,4 @@ MaiBot.code-workspace /tests /tests .kilocode/rules/MoFox.md +src/chat/planner_actions/planner (2).py diff --git a/src/chat/chat_loop/response_handler.py b/src/chat/chat_loop/response_handler.py index 8b56127e0..61608ccb9 100644 --- a/src/chat/chat_loop/response_handler.py +++ b/src/chat/chat_loop/response_handler.py @@ -155,6 +155,8 @@ class ResponseHandler: else: data = reply_seg["content"] + if isinstance(data, list): + data = "".join(map(str, data)) reply_text += data # 如果是主动思考且内容为“沉默”,则不发送