不要将纯文本包装成 ResponseSet 格式!
This commit is contained in:
@@ -219,8 +219,8 @@ class ProactiveThinker:
|
|||||||
)
|
)
|
||||||
|
|
||||||
if response_text:
|
if response_text:
|
||||||
# 将纯文本包装成 ResponseSet 格式
|
# 不要将纯文本包装成 ResponseSet 格式!
|
||||||
response_set = [{"type": "text", "data": {"text": response_text}}]
|
response_set = [response_text]
|
||||||
await self.cycle_processor.response_handler.send_response(
|
await self.cycle_processor.response_handler.send_response(
|
||||||
response_set, time.time(), action_result.get("action_message")
|
response_set, time.time(), action_result.get("action_message")
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import time
|
import time
|
||||||
|
import orjson
|
||||||
import random
|
import random
|
||||||
from typing import Dict, Any, Tuple
|
from typing import Dict, Any, Tuple
|
||||||
|
|
||||||
@@ -154,7 +155,7 @@ class ResponseHandler:
|
|||||||
|
|
||||||
if isinstance(data, list):
|
if isinstance(data, list):
|
||||||
data = "".join(map(str, data))
|
data = "".join(map(str, data))
|
||||||
reply_text += data.get("data",{}).get("text","")
|
reply_text += data
|
||||||
|
|
||||||
# 如果是主动思考且内容为“沉默”,则不发送
|
# 如果是主动思考且内容为“沉默”,则不发送
|
||||||
if is_proactive_thinking and data.strip() == "沉默":
|
if is_proactive_thinking and data.strip() == "沉默":
|
||||||
|
|||||||
Reference in New Issue
Block a user