This commit is contained in:
@@ -25,10 +25,10 @@ def log_state_change(node_name: str, state: dict, prefix: str = "进入"):
|
||||
if last_msg:
|
||||
# 兼容 dict 和对象两种格式
|
||||
if isinstance(last_msg, dict):
|
||||
content_preview = str(last_msg.get("content", ""))[:100].replace("\n", " ")
|
||||
content_preview = str(last_msg.get("content", ""))[:10].replace("\n", " ")
|
||||
msg_type = last_msg.get("type", "unknown")
|
||||
else:
|
||||
content_preview = str(last_msg.content)[:100].replace("\n", " ")
|
||||
content_preview = str(last_msg.content)[:10].replace("\n", " ")
|
||||
msg_type = getattr(last_msg, 'type', 'unknown')
|
||||
last_info = f"{msg_type.upper()}: {content_preview}"
|
||||
info(f"🔄 [{node_name}] {prefix} | 消息数:{msg_count} | 最后一条:{last_info}")
|
||||
|
||||
Reference in New Issue
Block a user