debug: 添加更多调试日志来诊断 llm_token 不输出的问题
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 6m2s
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 6m2s
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user