Fix Custom Tool File Upload: Resolve Multiple Files Recognition and Multipart Boundary Issues (#14014)

Co-authored-by: crazywoola <427733928@qq.com>
This commit is contained in:
JimintheBox
2025-03-27 11:47:35 +09:00
committed by GitHub
parent 8047d08b3b
commit 8b89447549
3 changed files with 19 additions and 1 deletions

View File

@@ -186,6 +186,9 @@ class ApiBasedToolSchemaParser:
return ToolParameter.ToolParameterType.BOOLEAN
elif typ == "string":
return ToolParameter.ToolParameterType.STRING
elif typ == "array":
items = parameter.get("items") or parameter.get("schema", {}).get("items")
return ToolParameter.ToolParameterType.FILES if items and items.get("format") == "binary" else None
else:
return None