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:
@@ -19,9 +19,9 @@ _ChatCompletionResponseChoiceT = TypeVar(
|
|||||||
def maybe_filter_parallel_tool_calls(
|
def maybe_filter_parallel_tool_calls(
|
||||||
choice: _ChatCompletionResponseChoiceT, request: ChatCompletionRequest
|
choice: _ChatCompletionResponseChoiceT, request: ChatCompletionRequest
|
||||||
) -> _ChatCompletionResponseChoiceT:
|
) -> _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
|
return choice
|
||||||
|
|
||||||
if isinstance(choice, ChatCompletionResponseChoice) and choice.message.tool_calls:
|
if isinstance(choice, ChatCompletionResponseChoice) and choice.message.tool_calls:
|
||||||
|
|||||||
Reference in New Issue
Block a user