fix: if parameter is not required, continue (#21761)

Co-authored-by: 刘江波 <jiangbo721@163.com>
pull/21776/head
jiangbo721 7 months ago committed by GitHub
parent b9ff716c18
commit 9a4c1fe834
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -167,7 +167,9 @@ class ToolNode(BaseNode[ToolNodeData]):
if tool_input.type == "variable": if tool_input.type == "variable":
variable = variable_pool.get(tool_input.value) variable = variable_pool.get(tool_input.value)
if variable is None: if variable is None:
raise ToolParameterError(f"Variable {tool_input.value} does not exist") if parameter.required:
raise ToolParameterError(f"Variable {tool_input.value} does not exist")
continue
parameter_value = variable.value parameter_value = variable.value
elif tool_input.type in {"mixed", "constant"}: elif tool_input.type in {"mixed", "constant"}:
segment_group = variable_pool.convert_template(str(tool_input.value)) segment_group = variable_pool.convert_template(str(tool_input.value))

Loading…
Cancel
Save