From 6332e30d2ff687cfef86dc4461933c9b5f90ab6b Mon Sep 17 00:00:00 2001 From: root <953994191@qq.com> Date: Thu, 7 May 2026 01:59:41 +0800 Subject: [PATCH] =?UTF-8?q?revert:=20=E6=92=A4=E9=94=80=E5=81=87=E6=B5=81?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/agent/agent_service.py | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/backend/app/agent/agent_service.py b/backend/app/agent/agent_service.py index 2180909..6c1d2ca 100644 --- a/backend/app/agent/agent_service.py +++ b/backend/app/agent/agent_service.py @@ -189,26 +189,12 @@ class AIAgentService: } # 处理普通 token elif token_content: - # 如果内容较长,拆成单个字符模拟流式效果 - if len(token_content) > 1: - import asyncio - for char in token_content: - yield { - "type": "llm_token", - "node": node_name, - "token": char, - "reasoning_token": reasoning_token - } - # 短暂暂停,模拟打字效果 - await asyncio.sleep(0.01) - else: - # 内容较短,直接发送 - yield { - "type": "llm_token", - "node": node_name, - "token": token_content, - "reasoning_token": reasoning_token - } + yield { + "type": "llm_token", + "node": node_name, + "token": token_content, + "reasoning_token": reasoning_token + } # 返回更新后的 current_node yield {"type": "_update_state", "current_node": new_current_node}