feat: support custom tool upload file (#10796)

This commit is contained in:
非法操作 authored and GitHub committed 2024-11-20 13:26:42 +08:00
1 parent 25fda7adc5
commit bf4b6e5f80
2 files changed
+13 -3

No files matched your search

+3
View File
@@ -161,6 +161,9 @@ class ApiBasedToolSchemaParser:
def _get_tool_parameter_type(parameter: dict) -> ToolParameter.ToolParameterType:
parameter = parameter or {}
typ = None
if parameter.get("format") == "binary":
return ToolParameter.ToolParameterType.FILE
if "type" in parameter:
typ = parameter["type"]
elif "schema" in parameter and "type" in parameter["schema"]: