feat: workflow variable aggregator support group (#4811)
Co-authored-by: Yeuoly <admin@srmxy.cn>
This commit is contained in:
@@ -7,7 +7,7 @@ from pydantic import BaseModel
|
||||
from core.workflow.entities.base_node_data_entities import BaseNodeData
|
||||
|
||||
|
||||
class AdvancedSetting(BaseModel):
|
||||
class AdvancedSettings(BaseModel):
|
||||
"""
|
||||
Advanced setting.
|
||||
"""
|
||||
@@ -30,4 +30,4 @@ class VariableAssignerNodeData(BaseNodeData):
|
||||
type: str = 'variable-assigner'
|
||||
output_type: str
|
||||
variables: list[list[str]]
|
||||
advanced_setting: Optional[AdvancedSetting]
|
||||
advanced_settings: Optional[AdvancedSettings]
|
@@ -18,7 +18,7 @@ class VariableAggregatorNode(BaseNode):
|
||||
outputs = {}
|
||||
inputs = {}
|
||||
|
||||
if not node_data.advanced_setting or node_data.advanced_setting.group_enabled:
|
||||
if not node_data.advanced_settings or not node_data.advanced_settings.group_enabled:
|
||||
for variable in node_data.variables:
|
||||
value = variable_pool.get_variable_value(variable)
|
||||
|
||||
@@ -32,12 +32,14 @@ class VariableAggregatorNode(BaseNode):
|
||||
}
|
||||
break
|
||||
else:
|
||||
for group in node_data.advanced_setting.groups:
|
||||
for group in node_data.advanced_settings.groups:
|
||||
for variable in group.variables:
|
||||
value = variable_pool.get_variable_value(variable)
|
||||
|
||||
if value is not None:
|
||||
outputs[f'{group.group_name}_output'] = value
|
||||
outputs[group.group_name] = {
|
||||
'output': value
|
||||
}
|
||||
inputs['.'.join(variable[1:])] = value
|
||||
break
|
||||
|
||||
|
Reference in New Issue
Block a user