From d9ee1edf8ad0021300f627ed29cd22e1f67927bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=BD=AE?= Date: Mon, 15 Dec 2025 17:38:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dnone=E5=80=BC=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routes/chat.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/routes/chat.py b/routes/chat.py index b97bd58..5a540ed 100644 --- a/routes/chat.py +++ b/routes/chat.py @@ -152,7 +152,8 @@ async def enhanced_generate_stream_response( for tool_call_chunk in msg.tool_call_chunks: if tool_call_chunk["name"]: new_content = f"[{message_tag}] {tool_call_chunk['name']}\n" - new_content += tool_call_chunk['args'] + if tool_call_chunk['args']: + new_content += tool_call_chunk['args'] # 处理文本内容 elif msg.content: @@ -162,7 +163,8 @@ async def enhanced_generate_stream_response( if meta_message_tag != message_tag: message_tag = meta_message_tag new_content = f"[{meta_message_tag}]\n" - new_content += msg.text + if msg.text: + new_content += msg.text # 处理工具响应 elif isinstance(msg, ToolMessage) and tool_response and msg.content: