fix(providers): preserve tool optionality in Responses requests

This commit is contained in:
chengyongru authored and chengyongru committed 2026-09-27 18:47:48 +08:00
1 parent f62e0da9f6
commit 932b06f0de
8 files changed
+127 -1

No files matched your search

@@ -183,11 +183,14 @@ def convert_tools(tools: list[dict[str, Any]]) -> list[dict[str, Any]]:
if not name:
continue
params: object = fn.get("parameters") or {}
strict = fn.get("strict")
converted.append({
"type": "function",
"name": name,
"description": fn.get("description") or "",
"parameters": params if isinstance(params, dict) else {},
# Responses may make optional fields required when strict is omitted.
"strict": strict if isinstance(strict, bool) else False,
})
return converted