|
|
|
|
@ -36,7 +36,6 @@ from core.workflow.enums import SystemVariableKey
|
|
|
|
|
from core.workflow.graph_engine.entities.event import AgentLogEvent
|
|
|
|
|
from core.workflow.nodes.agent.entities import AgentNodeData, AgentOldVersionModelFeatures, ParamsAutoGenerated
|
|
|
|
|
from core.workflow.nodes.base import BaseNode
|
|
|
|
|
from core.workflow.nodes.base.entities import BaseNodeData
|
|
|
|
|
from core.workflow.nodes.enums import NodeType
|
|
|
|
|
from core.workflow.nodes.event import RunCompletedEvent, RunStreamChunkEvent
|
|
|
|
|
from core.workflow.utils.variable_template_parser import VariableTemplateParser
|
|
|
|
|
@ -363,19 +362,14 @@ class AgentNode(BaseNode):
|
|
|
|
|
*,
|
|
|
|
|
graph_config: Mapping[str, Any],
|
|
|
|
|
node_id: str,
|
|
|
|
|
node_data: BaseNodeData,
|
|
|
|
|
node_data: Mapping[str, Any],
|
|
|
|
|
) -> Mapping[str, Sequence[str]]:
|
|
|
|
|
"""
|
|
|
|
|
Extract variable selector to variable mapping
|
|
|
|
|
:param graph_config: graph config
|
|
|
|
|
:param node_id: node id
|
|
|
|
|
:param node_data: node data
|
|
|
|
|
:return:
|
|
|
|
|
"""
|
|
|
|
|
node_data = cast(AgentNodeData, node_data)
|
|
|
|
|
# Create typed NodeData from dict
|
|
|
|
|
typed_node_data = AgentNodeData(**node_data)
|
|
|
|
|
|
|
|
|
|
result: dict[str, Any] = {}
|
|
|
|
|
for parameter_name in node_data.agent_parameters:
|
|
|
|
|
input = node_data.agent_parameters[parameter_name]
|
|
|
|
|
for parameter_name in typed_node_data.agent_parameters:
|
|
|
|
|
input = typed_node_data.agent_parameters[parameter_name]
|
|
|
|
|
if input.type in ["mixed", "constant"]:
|
|
|
|
|
selectors = VariableTemplateParser(str(input.value)).extract_variable_selectors()
|
|
|
|
|
for selector in selectors:
|
|
|
|
|
|