chore: add comments

This commit is contained in:
Novice 2025-03-21 09:16:30 +08:00
parent c83d45c2c8
commit 45b1f31b94

View File

@ -143,12 +143,14 @@ class AgentNode(ToolNode):
raise ValueError(f"Variable {agent_input.value} does not exist")
parameter_value = variable.value
elif agent_input.type in {"mixed", "constant"}:
# Convert dictionary to string to retrieve the variable's value
try:
parameter_value = json.dumps(agent_input.value, ensure_ascii=False)
except TypeError:
parameter_value = str(agent_input.value)
segment_group = variable_pool.convert_template(parameter_value)
parameter_value = segment_group.log if for_log else segment_group.text
# Convert string to dictionary to handle array[tools] and model-selector type
try:
parameter_value = json.loads(parameter_value)
except json.JSONDecodeError: