From 91688b16868e8e50a1fbaef25163d0e136662155 Mon Sep 17 00:00:00 2001 From: zcr Date: Fri, 13 Mar 2026 17:11:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E5=91=8A=E7=A9=BA=E6=A0=BC=E4=BF=9D?= =?UTF-8?q?=E7=95=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routers/deep_agent_chat.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/routers/deep_agent_chat.py b/src/routers/deep_agent_chat.py index d34e048..6f881e5 100644 --- a/src/routers/deep_agent_chat.py +++ b/src/routers/deep_agent_chat.py @@ -247,14 +247,13 @@ async def chat_stream(request: DeepAgentChatRequest): "content": "", "type": "" } - delta = chunks.get("delta", "").strip() - if delta: - payload_out.update({ - "type": chunks.get("type", ""), - "is_delta": True, - "content": delta, - }) - yield f"data: {json.dumps(payload_out, ensure_ascii=False)}\n\n" + delta = chunks.get("delta", "") + payload_out.update({ + "type": chunks.get("type", ""), + "is_delta": True, + "content": delta, + }) + yield f"data: {json.dumps(payload_out, ensure_ascii=False)}\n\n" # 获取建议消息 if request.need_suggestion > 0 and random.random() < request.need_suggestion: