Skip to content

Commit 65412de

Browse files
committed
[Frontend] OpenAI Responses API supports Tool/Function calling
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
1 parent 2a7dbc3 commit 65412de

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

examples/online_serving/openai_responses_client_with_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
99
For example:
1010
11-
vllm serve Qwen/Qwen3-1.7B --reasoning-parser qwen3\
11+
vllm serve Qwen/Qwen3-1.7B --reasoning-parser qwen3 \
1212
--guided-decoding-backend xgrammar \
1313
--enable-auto-tool-choice --tool-call-parser hermes
1414
"""

vllm/entrypoints/openai/protocol.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,6 @@ def _get_guided_json_from_tool(
354354
raise ValueError(
355355
f"Tool '{tool_name}' has not been passed in `tools`.")
356356
tool = tools[tool_name]
357-
print(f"Using tool '{tool_name}' for guided json decoding.")
358-
print(f"Tool parameters: {tool.parameters}")
359357
return tool.parameters
360358

361359
if self.tool_choice == "required":
@@ -425,7 +423,7 @@ def _get_guided_decoding(self) -> Optional[GuidedDecodingParams]:
425423
elif response_format.type == "json_object":
426424
raise NotImplementedError("json_object is not supported")
427425
# Function call
428-
elif self.tool_choice != "none" or self.tools is not None:
426+
elif not (self.tool_choice == "none" or self.tools is None):
429427
guided_decoding = GuidedDecodingParams.from_optional(
430428
json=self._get_guided_json_from_tool())
431429
return guided_decoding

0 commit comments

Comments
 (0)