Skip to content

Commit 3731773

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

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
@@ -355,8 +355,6 @@ def _get_guided_json_from_tool(
355355
raise ValueError(
356356
f"Tool '{tool_name}' has not been passed in `tools`.")
357357
tool = tools[tool_name]
358-
print(f"Using tool '{tool_name}' for guided json decoding.")
359-
print(f"Tool parameters: {tool.parameters}")
360358
return tool.parameters
361359

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

0 commit comments

Comments
 (0)