[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:
Shijin Zhang
2026-10-12 17:22:55 +08:00
committed by GitHub
co-authored by Chauncey
parent a33d46b471
commit 83773ecdf3
22 changed files with 698 additions and 72 deletions
+3 -2
View File
@@ -9,7 +9,7 @@ import json
from collections.abc import Callable, Iterable, Sequence
from typing import TYPE_CHECKING, Any, cast
from openai.types.responses import ToolChoiceFunction
from openai.types.responses import ToolChoiceCustom, ToolChoiceFunction
from vllm.entrypoints.generate.base.protocol import (
DeltaFunctionCall,
@@ -173,7 +173,8 @@ def _streaming_template(template: dict[str, Any]) -> ResponseTemplate:
def _is_named_tool_choice(request: ChatCompletionRequest | ResponsesRequest) -> bool:
return isinstance(
request.tool_choice, (ToolChoiceFunction, ChatCompletionNamedToolChoiceParam)
request.tool_choice,
(ToolChoiceFunction, ToolChoiceCustom, ChatCompletionNamedToolChoiceParam),
)