[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:
@@ -38,7 +38,7 @@ import json
|
||||
from collections.abc import Iterator, Sequence
|
||||
|
||||
import regex as re
|
||||
from openai.types.responses import ToolChoiceFunction
|
||||
from openai.types.responses import ToolChoiceCustom, ToolChoiceFunction
|
||||
from transformers import PreTrainedTokenizerBase
|
||||
|
||||
from vllm.entrypoints.generate.base.protocol import (
|
||||
@@ -228,7 +228,12 @@ class MuseGlimmerToolParser(ToolParser):
|
||||
if request.tools and (
|
||||
tool_choice == "required"
|
||||
or isinstance(
|
||||
tool_choice, (ChatCompletionNamedToolChoiceParam, ToolChoiceFunction)
|
||||
tool_choice,
|
||||
(
|
||||
ChatCompletionNamedToolChoiceParam,
|
||||
ToolChoiceFunction,
|
||||
ToolChoiceCustom,
|
||||
),
|
||||
)
|
||||
):
|
||||
return request
|
||||
|
||||
Reference in New Issue
Block a user