Fix parallel_tool_calls: null treated as false instead of default true (#44955)

Signed-off-by: factnn <166481866+factnn@users.noreply.github.com>
This commit is contained in:
Zang Peiyu
2026-06-15 21:14:10 +00:00
committed by GitHub
parent eacff17c8d
commit 25ee659db0
@@ -19,9 +19,9 @@ _ChatCompletionResponseChoiceT = TypeVar(
def maybe_filter_parallel_tool_calls(
choice: _ChatCompletionResponseChoiceT, request: ChatCompletionRequest
) -> _ChatCompletionResponseChoiceT:
"""Filter to first tool call only when parallel_tool_calls is False."""
"""Filter to first tool call only when parallel_tool_calls is explicitly False."""
if request.parallel_tool_calls:
if request.parallel_tool_calls is not False:
return choice
if isinstance(choice, ChatCompletionResponseChoice) and choice.message.tool_calls: