From c780d4be149a65e68e7ae0d3b662fdd89bf4079a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E4=BF=8A=E7=94=B7?= Date: Tue, 13 Jan 2026 17:41:03 +0800 Subject: [PATCH] feat(workflow tool node): add a string type output variable --- api/app/core/workflow/nodes/tool/node.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/app/core/workflow/nodes/tool/node.py b/api/app/core/workflow/nodes/tool/node.py index 6084dbe3..883df01a 100644 --- a/api/app/core/workflow/nodes/tool/node.py +++ b/api/app/core/workflow/nodes/tool/node.py @@ -1,3 +1,4 @@ +import json import logging import re import uuid @@ -70,14 +71,15 @@ class ToolNode(BaseNode): if result.success: logger.info(f"节点 {self.node_id} 工具执行成功") return { - "success": True, + "text": json.dumps(result.data, ensure_ascii=False), "data": result.data, + "error_code": "", "execution_time": result.execution_time } else: logger.error(f"节点 {self.node_id} 工具执行失败: {result.error}") return { - "success": False, + "text": json.dumps(result.error, ensure_ascii=False), "data": result.error, "error_code": result.error_code, "execution_time": result.execution_time