Skip to content

Commit c433c03

Browse files
committedFeb 27, 2025
fix: Fix variable assign num not working
--bug=1052497 --user=刘瑞斌 【变量赋值】-将全局变量赋值为num类型,输出时报错 https://www.tapd.cn/57709429/s/1659733
1 parent c92ad06 commit c433c03

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎apps/application/flow/step_node/variable_assign_node/impl/base_variable_assign_node.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@ def execute(self, variable_list, stream, **kwargs) -> NodeResult:
3030
val = json.loads(variable['value'])
3131
self.workflow_manage.context[variable['fields'][1]] = val
3232
result['output_value'] = variable['value'] = val
33-
else:
33+
elif variable['type'] == 'string':
3434
# 变量解析 例如:{{global.xxx}}
3535
val = self.workflow_manage.generate_prompt(variable['value'])
3636
self.workflow_manage.context[variable['fields'][1]] = val
3737
result['output_value'] = val
38+
else:
39+
val = variable['value']
40+
self.workflow_manage.context[variable['fields'][1]] = val
41+
result['output_value'] = val
3842
else:
3943
reference = self.get_reference_content(variable['reference'])
4044
self.workflow_manage.context[variable['fields'][1]] = reference

0 commit comments

Comments
 (0)