feat: 添加更详细的chunk日志,分析海量chunk的内容
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 5m39s

This commit is contained in:
2026-05-01 13:13:15 +08:00
parent b59a537f41
commit 4f6b9c096a

View File

@@ -177,6 +177,14 @@ class AIAgentService:
message_chunk, metadata = chunk["data"]
node_name = metadata.get("langgraph_node", "unknown")
info(f"📨 处理消息chunk, node: {node_name}")
# 详细记录消息内容,看看这些 chunk 到底是什么
if hasattr(message_chunk, "content"):
content_preview = str(message_chunk.content)[:200]
info(f"📄 消息内容预览 ({len(content_preview)} chars): {repr(content_preview)}")
if hasattr(message_chunk, "type"):
info(f"📋 消息类型: {message_chunk.type}")
if hasattr(message_chunk, "tool_calls"):
info(f"🔧 包含工具调用: {message_chunk.tool_calls}")
# 检测节点变化,发送节点开始事件
if node_name != current_node: