From 91532ef429799f9ef3dedbde851ba5bc25437db5 Mon Sep 17 00:00:00 2001 From: fenglin <790872612@qq.com> Date: Thu, 29 Jan 2026 10:49:29 +0800 Subject: [PATCH] fix: add list type support for ToolInput constant value in tool node (#31276) Co-authored-by: qiaofenglin Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- api/core/workflow/nodes/tool/entities.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/core/workflow/nodes/tool/entities.py b/api/core/workflow/nodes/tool/entities.py index c1cfbb1edc..8fe33c240a 100644 --- a/api/core/workflow/nodes/tool/entities.py +++ b/api/core/workflow/nodes/tool/entities.py @@ -54,8 +54,8 @@ class ToolNodeData(BaseNodeData, ToolEntity): for val in value: if not isinstance(val, str): raise ValueError("value must be a list of strings") - elif typ == "constant" and not isinstance(value, str | int | float | bool | dict): - raise ValueError("value must be a string, int, float, bool or dict") + elif typ == "constant" and not isinstance(value, (allowed_types := (str, int, float, bool, dict, list))): + raise ValueError(f"value must be one of: {', '.join(t.__name__ for t in allowed_types)}") return typ tool_parameters: dict[str, ToolInput]