diff --git a/apps/application/flow/workflow_manage.py b/apps/application/flow/workflow_manage.py index 403f3a552..f99d9351b 100644 --- a/apps/application/flow/workflow_manage.py +++ b/apps/application/flow/workflow_manage.py @@ -235,15 +235,21 @@ class WorkflowManage: for node in self.node_context: properties = node.node.properties - fields = properties.get('fields') - if fields is not None: - for field in fields: - prompt = prompt.replace(field.get('globeLabel'), field.get('globeValue')) - global_fields = properties.get('globalFields') - if global_fields is not None: - for field in global_fields: - prompt = prompt.replace(field.get('globeLabel'), field.get('globeValue')) - context[node.id] = node.context + node_config = properties.get('config') + if node_config is not None: + fields = node_config.get('fields') + if fields is not None: + for field in fields: + globeLabel = f"{properties.get('stepName')}.{field.get('value')}" + globeValue = f"context['{node.id}'].{field.get('value')}" + prompt = prompt.replace(globeLabel, globeValue) + global_fields = node_config.get('globalFields') + if global_fields is not None: + for field in global_fields: + globeLabel = f"全局变量.{field.get('value')}" + globeValue = f"context['global'].{field.get('value')}" + prompt = prompt.replace(globeLabel, globeValue) + context[node.id] = node.context prompt_template = PromptTemplate.from_template(prompt, template_format='jinja2') value = prompt_template.format(context=context) diff --git a/ui/src/workflow/common/NodeCascader.vue b/ui/src/workflow/common/NodeCascader.vue index feb6ba1f5..dfb50f2f0 100644 --- a/ui/src/workflow/common/NodeCascader.vue +++ b/ui/src/workflow/common/NodeCascader.vue @@ -53,14 +53,14 @@ function _getIncomingNode(id: String, startId: String) { value: item.id, label: item.properties.stepName, type: item.type, - children: item.properties?.fields || [] + children: item.properties?.config?.fields || [] }) if (item.properties?.globalFields && item.type === 'start-node') { firstElement = { value: 'global', label: '全局变量', type: 'global', - children: item.properties?.globalFields || [] + children: item.properties?.config?.globalFields || [] } } } diff --git a/ui/src/workflow/common/NodeContainer.vue b/ui/src/workflow/common/NodeContainer.vue index 01952d249..3ad2a38ac 100644 --- a/ui/src/workflow/common/NodeContainer.vue +++ b/ui/src/workflow/common/NodeContainer.vue @@ -41,11 +41,11 @@ -
+
-