Skip to content

Commit 493140b

Browse files
committed
[Frontend] OpenAI Responses API supports Tool/Function calling
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
1 parent 5cc23f1 commit 493140b

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

vllm/entrypoints/openai/serving_chat.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ def __init__(
8787
tool_parser_name=tool_parser, enable_auto_tools=enable_auto_tools)
8888

8989
self.exclude_tools_when_tool_choice_none = (
90-
exclude_tools_when_tool_choice_none
91-
)
90+
exclude_tools_when_tool_choice_none)
9291

9392
self.enable_prompt_tokens_details = enable_prompt_tokens_details
9493
self.enable_force_include_usage = enable_force_include_usage

vllm/entrypoints/openai/serving_responses.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ def __init__(
8383
self.tool_parser = self._get_tool_parser(
8484
tool_parser_name=tool_parser, enable_auto_tools=enable_auto_tools)
8585
self.exclude_tools_when_tool_choice_none = (
86-
exclude_tools_when_tool_choice_none
87-
)
86+
exclude_tools_when_tool_choice_none)
8887
self.enable_prompt_tokens_details = enable_prompt_tokens_details
8988
self.enable_force_include_usage = enable_force_include_usage
9089
self.default_sampling_params = (
@@ -142,8 +141,8 @@ async def create_responses(
142141
lora_request = self._maybe_get_adapters(request)
143142
model_name = self._get_model_name(request.model, lora_request)
144143
tokenizer = await self.engine_client.get_tokenizer(lora_request)
145-
if (request.tools is None or
146-
(request.tool_choice == "none"
144+
if (request.tools is None
145+
or (request.tool_choice == "none"
147146
and self.exclude_tools_when_tool_choice_none)):
148147
tool_dicts = None
149148
else:

vllm/entrypoints/openai/tool_parsers/glm4_moe_tool_parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from typing import Union
77

88
import regex as re
9+
910
# yapf conflicts with isort for this block
1011
# yapf: disable
1112
from vllm.entrypoints.openai.protocol import (ChatCompletionRequest,

vllm/entrypoints/openai/tool_parsers/hunyuan_a13b_tool_parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from typing import Any, Optional, Union
88

99
import regex as re
10+
1011
# yapf conflicts with isort for this block
1112
# yapf: disable
1213
from vllm.entrypoints.openai.protocol import (ChatCompletionRequest,

vllm/entrypoints/openai/tool_parsers/qwen3coder_tool_parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from typing import Any, Optional, Union
88

99
import regex as re
10+
1011
# yapf conflicts with isort for this block
1112
# yapf: disable
1213
from vllm.entrypoints.openai.protocol import (ChatCompletionRequest,

0 commit comments

Comments
 (0)