From 86ba0d47a78462a89cf45c087cec60da14569345 Mon Sep 17 00:00:00 2001 From: dufei Date: Fri, 25 Oct 2024 09:38:15 +0800 Subject: [PATCH 1/2] [fix]: issue#9443support object type in custom tool's parameters --- api/core/tools/entities/tool_entities.py | 1 + api/core/tools/utils/parser.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/api/core/tools/entities/tool_entities.py b/api/core/tools/entities/tool_entities.py index 9a31e673d3..75b1ca3c68 100644 --- a/api/core/tools/entities/tool_entities.py +++ b/api/core/tools/entities/tool_entities.py @@ -145,6 +145,7 @@ class ToolParameter(BaseModel): SECRET_INPUT = "secret-input" FILE = "file" FILES = "files" + OBJECT = "object" # deprecated, should not use. SYSTEM_FILES = "systme-files" diff --git a/api/core/tools/utils/parser.py b/api/core/tools/utils/parser.py index 5867a11bb3..57282f0013 100644 --- a/api/core/tools/utils/parser.py +++ b/api/core/tools/utils/parser.py @@ -170,6 +170,8 @@ class ApiBasedToolSchemaParser: return ToolParameter.ToolParameterType.NUMBER elif typ == "boolean": return ToolParameter.ToolParameterType.BOOLEAN + elif typ == 'object': + return ToolParameter.ToolParameterType.OBJECT elif typ == "string": return ToolParameter.ToolParameterType.STRING From 05ed7e9999064a0dbb9416e483e383e1e70fa1b1 Mon Sep 17 00:00:00 2001 From: dufei Date: Fri, 25 Oct 2024 09:52:51 +0800 Subject: [PATCH 2/2] [fix]: issue#9443support object type in custom tool's parameters --- api/core/tools/utils/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/core/tools/utils/parser.py b/api/core/tools/utils/parser.py index 57282f0013..aabd0bb9a1 100644 --- a/api/core/tools/utils/parser.py +++ b/api/core/tools/utils/parser.py @@ -170,7 +170,7 @@ class ApiBasedToolSchemaParser: return ToolParameter.ToolParameterType.NUMBER elif typ == "boolean": return ToolParameter.ToolParameterType.BOOLEAN - elif typ == 'object': + elif typ == "object": return ToolParameter.ToolParameterType.OBJECT elif typ == "string": return ToolParameter.ToolParameterType.STRING