[Frontend] Support CustomToolCall in the non-Harmony Responses API (#57322)
Signed-off-by: Shijin Zhang <75300765+Dovis01@users.noreply.github.com> Co-authored-by: Chauncey <chaunceyjiang@gmail.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
|
||||
from openai.types.responses import ToolChoiceFunction
|
||||
from openai.types.responses import ToolChoiceCustom, ToolChoiceFunction
|
||||
|
||||
from vllm.entrypoints.openai.chat_completion.protocol import (
|
||||
ChatCompletionNamedToolChoiceParam,
|
||||
@@ -29,7 +29,12 @@ class Gemma4EngineToolParser(Gemma4ParserToolAdapter): # type: ignore[valid-typ
|
||||
if request.tools:
|
||||
tc = request.tool_choice
|
||||
if tc == "required" or isinstance(
|
||||
tc, (ChatCompletionNamedToolChoiceParam, ToolChoiceFunction)
|
||||
tc,
|
||||
(
|
||||
ChatCompletionNamedToolChoiceParam,
|
||||
ToolChoiceFunction,
|
||||
ToolChoiceCustom,
|
||||
),
|
||||
):
|
||||
request.skip_special_tokens = False
|
||||
return request
|
||||
|
||||
Reference in New Issue
Block a user