Skip to content

Commit 0a6b8d7

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

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
@@ -377,8 +377,6 @@ def _get_guided_json_from_tool(
377377
raise ValueError(
378378
f"Tool '{tool_name}' has not been passed in `tools`.")
379379
tool = tools[tool_name]
380-
print(f"Using tool '{tool_name}' for guided json decoding.")
381-
print(f"Tool parameters: {tool.parameters}")
382380
return tool.parameters
383381

384382
if self.tool_choice == "required":
@@ -448,7 +446,7 @@ def _get_guided_decoding(self) -> Optional[GuidedDecodingParams]:
448446
elif response_format.type == "json_object":
449447
raise NotImplementedError("json_object is not supported")
450448
# Function call
451-
elif self.tool_choice != "none" or self.tools is not None:
449+
elif not (self.tool_choice == "none" or self.tools is None):
452450
guided_decoding = GuidedDecodingParams.from_optional(
453451
json=self._get_guided_json_from_tool())
454452
return guided_decoding

0 commit comments

Comments
 (0)