Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -60,33 +60,44 @@ def handle(self, variable, evaluation):
val = variable['value']
evaluation(variable, val)
result['output_value'] = val
else:
elif variable['source'] == 'referencing':
reference = self.get_reference_content(variable['reference'])
evaluation(variable, reference)
result['output_value'] = reference
else:
val = None
evaluation(variable, val)
result['output_value'] = val

# 获取输入输出值的类型,用于显示在执行详情页面中
result['input_type'] = type(result.get('input_value')).__name__ if result.get('input_value') is not None else 'null'
result['output_type'] = type(result.get('output_value')).__name__ if result.get('output_value') is not None else 'null'

return result

def execute(self, variable_list, **kwargs) -> NodeResult:
#
result_list = []
is_chat = False
contains_chat_variable = False
Comment thread
wangliang181230 marked this conversation as resolved.
for variable in variable_list:
if 'fields' not in variable:
if not variable.get('fields'):
continue
if 'global' == variable['fields'][0]:

field0 = variable['fields'][0]
if 'global' == field0:
result = self.handle(variable, self.global_evaluation)
result_list.append(result)
if 'chat' == variable['fields'][0]:
elif 'chat' == field0:
result = self.handle(variable, self.chat_evaluation)
result_list.append(result)
is_chat = True
if 'loop' == variable['fields'][0]:
contains_chat_variable = True
elif 'loop' == field0:
result = self.handle(variable, self.loop_evaluation)
result_list.append(result)
if 'output' == variable['fields'][0]:
elif 'output' == field0:
result = self.handle(variable, self.out_evaluation)
result_list.append(result)
if is_chat:

if contains_chat_variable:
from application.flow.loop_workflow_manage import LoopWorkflowManage
if isinstance(self.workflow_manage, LoopWorkflowManage):
self.workflow_manage.parentWorkflowManage.get_chat_info().set_chat_variable(
Expand Down
4 changes: 2 additions & 2 deletions ui/src/components/execution-detail-card/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@
</h5>
<div class="p-8-12 border-t-dashed lighter">
<div v-for="(f, i) in data.result_list" :key="i" class="mb-8">
<span class="color-secondary">{{ f.name }}:</span> {{ f.input_value }}
<span class="color-secondary">{{ f.name }} ({{ f.input_type }}):</span> {{ f.input_value }}
</div>
</div>
</div>
Expand All @@ -892,7 +892,7 @@
</h5>
<div class="p-8-12 border-t-dashed lighter">
<div v-for="(f, i) in data.result_list" :key="i" class="mb-8">
<span class="color-secondary">{{ f.name }}:</span> {{ f.output_value }}
<span class="color-secondary">{{ f.name }} ({{ f.output_type }}):</span> {{ f.output_value }}
</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion ui/src/workflow/nodes/variable-assign-node/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<el-select :teleported="false" v-model="item.source" size="small" style="width: 85px">
<el-option :label="$t('workflow.variable.Referencing')" value="referencing" />
<el-option :label="$t('common.custom')" value="custom" />
<el-option label="null" value="null" />
</el-select>
</div>

Expand Down Expand Up @@ -142,7 +143,7 @@
</el-select>
</el-form-item>
</div>
<el-form-item v-else>
<el-form-item v-else-if="item.source === 'referencing'">
<NodeCascader
ref="nodeCascaderRef2"
:nodeModel="nodeModel"
Expand Down
Loading