Skip to content

Commit 6e170e3

Browse files
committed
fix: ensure tool_choice is popped when tool_choice:null is passed in json payload
Signed-off-by: Guillaume Calmettes <[email protected]>
1 parent f40f763 commit 6e170e3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

vllm/entrypoints/openai/protocol.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,10 @@ def check_guided_decoding_count(cls, data):
670670
@classmethod
671671
def check_tool_usage(cls, data):
672672

673+
# handles case where `"tool_choice":null` is set in json payload
674+
if data.get("tool_choice") is None:
675+
data.pop("tool_choice", None)
676+
673677
# if "tool_choice" is not specified but tools are provided,
674678
# default to "auto" tool_choice
675679
if "tool_choice" not in data and data.get("tools"):

0 commit comments

Comments
 (0)