fix(chat): 处理响应数据为列表时的情况
当响应内容`data`是一个列表时,将其所有元素连接成一个字符串,以避免在后续处理中因类型不匹配而引发的错误。
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -336,3 +336,4 @@ MaiBot.code-workspace
|
|||||||
/tests
|
/tests
|
||||||
/tests
|
/tests
|
||||||
.kilocode/rules/MoFox.md
|
.kilocode/rules/MoFox.md
|
||||||
|
src/chat/planner_actions/planner (2).py
|
||||||
|
|||||||
@@ -155,6 +155,8 @@ class ResponseHandler:
|
|||||||
else:
|
else:
|
||||||
data = reply_seg["content"]
|
data = reply_seg["content"]
|
||||||
|
|
||||||
|
if isinstance(data, list):
|
||||||
|
data = "".join(map(str, data))
|
||||||
reply_text += data
|
reply_text += data
|
||||||
|
|
||||||
# 如果是主动思考且内容为“沉默”,则不发送
|
# 如果是主动思考且内容为“沉默”,则不发送
|
||||||
|
|||||||
Reference in New Issue
Block a user