mirror of
https://github.com/langgenius/dify.git
synced 2026-04-28 20:17:29 +08:00
fix: non-auto variable type params of agent node tool are not correctly parsed (#31128)
Co-authored-by: wangzejie <wangzejie@meicai.cn> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
4e7c1f4f44
commit
811e43d0d4
@ -235,7 +235,18 @@ class AgentNode(Node[AgentNodeData]):
|
|||||||
0,
|
0,
|
||||||
):
|
):
|
||||||
value_param = param.get("value", {})
|
value_param = param.get("value", {})
|
||||||
params[key] = value_param.get("value", "") if value_param is not None else None
|
if value_param and value_param.get("type", "") == "variable":
|
||||||
|
variable_selector = value_param.get("value")
|
||||||
|
if not variable_selector:
|
||||||
|
raise ValueError("Variable selector is missing for a variable-type parameter.")
|
||||||
|
|
||||||
|
variable = variable_pool.get(variable_selector)
|
||||||
|
if variable is None:
|
||||||
|
raise AgentVariableNotFoundError(str(variable_selector))
|
||||||
|
|
||||||
|
params[key] = variable.value
|
||||||
|
else:
|
||||||
|
params[key] = value_param.get("value", "") if value_param is not None else None
|
||||||
else:
|
else:
|
||||||
params[key] = None
|
params[key] = None
|
||||||
parameters = params
|
parameters = params
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user