Fix tool_parser_cls type annotation from Callable to type[ToolParser] (#37957)

Signed-off-by: sfeng33 <4florafeng@gmail.com>
This commit is contained in:
Flora Feng
2026-03-23 22:58:27 -07:00
committed by GitHub
parent e3c6c10cad
commit 2e67fa756d
6 changed files with 13 additions and 17 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ import asyncio
import contextlib
import json
import time
from collections.abc import AsyncGenerator, Callable, Mapping
from collections.abc import AsyncGenerator, Mapping
from dataclasses import dataclass, field
from http import HTTPStatus
from typing import Any, ClassVar, Generic, Protocol, TypeAlias, TypeVar
@@ -882,7 +882,7 @@ class OpenAIServing:
request: ResponsesRequest | ChatCompletionRequest,
tokenizer: TokenizerLike | None,
enable_auto_tools: bool,
tool_parser_cls: Callable[[TokenizerLike], ToolParser] | None,
tool_parser_cls: type[ToolParser] | None,
content: str | None = None,
) -> tuple[list[FunctionCall] | None, str | None]:
function_calls = list[FunctionCall]()