@@ -73,8 +73,6 @@ def __init__(
73
73
enable_force_include_usage = enable_force_include_usage ,
74
74
)
75
75
self .enable_auto_tools = enable_auto_tools
76
- self .expand_tools_even_if_tool_choice_none = (
77
- expand_tools_even_if_tool_choice_none )
78
76
self .chat_template = chat_template
79
77
self .chat_template_content_format : Final = chat_template_content_format
80
78
@@ -145,20 +143,6 @@ async def create_responses(
145
143
tokenizer = await self .engine_client .get_tokenizer (lora_request )
146
144
if request .tools is None :
147
145
tool_dicts = None
148
- elif (request .tool_choice == "none"
149
- and not self .expand_tools_even_if_tool_choice_none ):
150
- if len (request .tools ) > 0 :
151
- logger .warning_once (
152
- "Tools are specified but tool_choice is set to 'none' "
153
- "and --expand-tools-even-if-tool-choice-none is not "
154
- "enabled. Tool definitions will be excluded from the "
155
- "prompt. This behavior will change in vLLM v0.10 where "
156
- "tool definitions will be included by default even "
157
- "with tool_choice='none'. To adopt the new behavior "
158
- "now, use --expand-tools-even-if-tool-choice-none. "
159
- "To suppress this warning, either remove tools from "
160
- "the request or set tool_choice to a different value." )
161
- tool_dicts = None
162
146
else :
163
147
tool_dicts = [tool .model_dump () for tool in request .tools ]
164
148
_ , request_prompts , engine_prompts = await self ._preprocess_chat (
@@ -331,15 +315,13 @@ async def responses_full_generator(
331
315
)
332
316
outputs = []
333
317
function_calls : list [FunctionCall ] = []
334
- if ( not self .enable_auto_tools or not self .tool_parser ) :
318
+ if not self .enable_auto_tools or not self .tool_parser :
335
319
# Tools are not enabled
336
320
if reasoning_item :
337
321
outputs .append (reasoning_item )
338
322
if message_item :
339
323
outputs .append (message_item )
340
- elif (request .tool_choice == "none" and \
341
- not self .expand_tools_even_if_tool_choice_none ) or \
342
- request .tool_choice is None :
324
+ elif request .tool_choice is None :
343
325
# No tool calls.
344
326
if reasoning_item :
345
327
outputs .append (reasoning_item )
0 commit comments