From bd2c20d92745187b4fa62be20febd777ca88ab06 Mon Sep 17 00:00:00 2001 From: root <953994191@qq.com> Date: Sat, 2 May 2026 08:00:32 +0800 Subject: [PATCH] =?UTF-8?q?debug:=20=E6=B7=BB=E5=8A=A0=E6=9B=B4=E5=A4=9A?= =?UTF-8?q?=E8=B0=83=E8=AF=95=E6=97=A5=E5=BF=97=E6=9D=A5=E8=AF=8A=E6=96=AD?= =?UTF-8?q?=20llm=5Ftoken=20=E4=B8=8D=E8=BE=93=E5=87=BA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/agent/agent_service.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/app/agent/agent_service.py b/backend/app/agent/agent_service.py index 18543cc..3ecf125 100644 --- a/backend/app/agent/agent_service.py +++ b/backend/app/agent/agent_service.py @@ -218,6 +218,8 @@ class AIAgentService: reasoning_token = "" if hasattr(message_chunk, 'additional_kwargs'): reasoning_token = message_chunk.additional_kwargs.get("reasoning_content", "") + + info(f"💬 消息token: token_content='{repr(token_content[:50])}', reasoning_token='{repr(reasoning_token[:50])}', node_name='{node_name}'") # 处理思考过程 if reasoning_token: @@ -226,6 +228,7 @@ class AIAgentService: "node": node_name, "reasoning_token": reasoning_token } + info(f"✅ 生成 reasoning_token 事件: {processed_event}") # 处理工具调用 elif hasattr(message_chunk, 'tool_calls') and message_chunk.tool_calls: for tool_call in message_chunk.tool_calls: @@ -253,6 +256,9 @@ class AIAgentService: "token": token_content, "reasoning_token": reasoning_token } + info(f"✅ 生成 llm_token 事件: {processed_event}") + else: + info(f"⚠️ 没有生成任何事件,token_content='{repr(token_content)}', reasoning_token='{repr(reasoning_token)}'") elif chunk_type == "updates": info(f"🔄 处理updates chunk")