fix: Workflow global variables (#2069)

This commit is contained in:
shaohuzhang1 2025-01-22 16:46:11 +08:00 committed by GitHub
parent 13571ef615
commit cd3d645ece
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -742,8 +742,9 @@ class WorkflowManage:
if global_fields is not None:
for field in global_fields:
globeLabel = f"全局变量.{field.get('value')}"
globeLabelNew = f"global.{field.get('value')}"
globeValue = f"context.get('global').get('{field.get('value', '')}','')"
prompt = prompt.replace(globeLabel, globeValue)
prompt = prompt.replace(globeLabel, globeValue).replace(globeLabelNew, globeLabel)
return prompt
def generate_prompt(self, prompt: str):