From c433c03fc03473fe84a828642c57e73408329d56 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Thu, 27 Feb 2025 12:07:13 +0800 Subject: [PATCH] fix: Fix variable assign num not working MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1052497 --user=刘瑞斌 【变量赋值】-将全局变量赋值为num类型,输出时报错 https://www.tapd.cn/57709429/s/1659733 --- .../variable_assign_node/impl/base_variable_assign_node.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/application/flow/step_node/variable_assign_node/impl/base_variable_assign_node.py b/apps/application/flow/step_node/variable_assign_node/impl/base_variable_assign_node.py index 8200bd2e1..ce2906e62 100644 --- a/apps/application/flow/step_node/variable_assign_node/impl/base_variable_assign_node.py +++ b/apps/application/flow/step_node/variable_assign_node/impl/base_variable_assign_node.py @@ -30,11 +30,15 @@ class BaseVariableAssignNode(IVariableAssignNode): val = json.loads(variable['value']) self.workflow_manage.context[variable['fields'][1]] = val result['output_value'] = variable['value'] = val - else: + elif variable['type'] == 'string': # 变量解析 例如:{{global.xxx}} val = self.workflow_manage.generate_prompt(variable['value']) self.workflow_manage.context[variable['fields'][1]] = val result['output_value'] = val + else: + val = variable['value'] + self.workflow_manage.context[variable['fields'][1]] = val + result['output_value'] = val else: reference = self.get_reference_content(variable['reference']) self.workflow_manage.context[variable['fields'][1]] = reference