File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -175,9 +175,23 @@ async def create_chat_completion(
175
175
"--enable-auto-tool-choice and --tool-call-parser to be set"
176
176
)
177
177
178
- if (request .tools is None
179
- or (request .tool_choice == "none"
180
- and not self .expand_tools_even_if_tool_choice_none )):
178
+ if request .tools is None :
179
+ tool_dicts = None
180
+ elif (request .tool_choice == "none"
181
+ and not self .expand_tools_even_if_tool_choice_none ):
182
+ assert request .tools is not None
183
+ if len (request .tools ) > 0 :
184
+ logger .warning (
185
+ "Tools are specified but tool_choice is set to 'none' and "
186
+ "--expand-tools-even-if-tool-choice-none is not enabled. "
187
+ "Tool definitions will be excluded from the prompt. "
188
+ "This behavior will change in vLLM v0.10 where tool definitions "
189
+ "will be included by default even with tool_choice='none'. "
190
+ "To adopt the new behavior now, "
191
+ "use --expand-tools-even-if-tool-choice-none. "
192
+ "To suppress this warning, either remove tools from the request "
193
+ "or set tool_choice to a different value."
194
+ )
181
195
tool_dicts = None
182
196
else :
183
197
tool_dicts = [tool .model_dump () for tool in request .tools ]
You can’t perform that action at this time.
0 commit comments