From e9893f1518ad1c440ae6dd5b7669774d8065dd48 Mon Sep 17 00:00:00 2001 From: jiangbo721 <365065261@qq.com> Date: Tue, 22 Jul 2025 02:40:40 +0800 Subject: [PATCH] chore: use 'json_list' instead of 'json' to prevent ambiguity (#22739) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 刘江波 --- api/core/workflow/nodes/agent/agent_node.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/core/workflow/nodes/agent/agent_node.py b/api/core/workflow/nodes/agent/agent_node.py index 704eb6a3a..8cf33ac81 100644 --- a/api/core/workflow/nodes/agent/agent_node.py +++ b/api/core/workflow/nodes/agent/agent_node.py @@ -486,7 +486,7 @@ class AgentNode(BaseNode): text = "" files: list[File] = [] - json: list[dict] = [] + json_list: list[dict] = [] agent_logs: list[AgentLogEvent] = [] agent_execution_metadata: Mapping[WorkflowNodeExecutionMetadataKey, Any] = {} @@ -564,7 +564,7 @@ class AgentNode(BaseNode): if key in WorkflowNodeExecutionMetadataKey.__members__.values() } if message.message.json_object is not None: - json.append(message.message.json_object) + json_list.append(message.message.json_object) elif message.type == ToolInvokeMessage.MessageType.LINK: assert isinstance(message.message, ToolInvokeMessage.TextMessage) stream_text = f"Link: {message.message.text}\n" @@ -676,8 +676,8 @@ class AgentNode(BaseNode): } ) # Step 2: normalize JSON into {"data": [...]}.change json to list[dict] - if json: - json_output.extend(json) + if json_list: + json_output.extend(json_list) else: json_output.append({"data": []})