[Bugfix] Avoid JSON constraints for native tool parsers (#47512)

Signed-off-by: Flora Feng <4florafeng@gmail.com>
Co-authored-by: Flora Feng <4florafeng@gmail.com>
This commit is contained in:
hubunt
2026-09-29 19:37:12 +00:00
committed by GitHub
co-authored by Flora Feng
parent 7aa8372ef7
commit 19a4d66a0b
2 changed files with 104 additions and 0 deletions
@@ -133,6 +133,13 @@ class ToolParser:
):
return request
# Parsers that extract required/named tool calls from their native
# format (supports_required_and_named=False) must not be forced into
# the JSON tool-call format below: they would never find a call in
# the JSON output and would return it as content instead.
if not self.supports_required_and_named:
return request
json_schema_from_tool = get_json_schema_from_tools(
tool_choice=request.tool_choice, tools=request.tools
)