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")