diff --git a/vllm/entrypoints/anthropic/protocol.py b/vllm/entrypoints/anthropic/protocol.py index 19ca28f1d..c541db513 100644 --- a/vllm/entrypoints/anthropic/protocol.py +++ b/vllm/entrypoints/anthropic/protocol.py @@ -77,7 +77,7 @@ class AnthropicTool(BaseModel): class AnthropicToolChoice(BaseModel): """Tool Choice definition""" - type: Literal["auto", "any", "tool"] + type: Literal["auto", "any", "tool", "none"] name: str | None = None @model_validator(mode="after") diff --git a/vllm/entrypoints/anthropic/serving.py b/vllm/entrypoints/anthropic/serving.py index f0110de38..85232e918 100644 --- a/vllm/entrypoints/anthropic/serving.py +++ b/vllm/entrypoints/anthropic/serving.py @@ -349,6 +349,8 @@ class AnthropicServingMessages(OpenAIServingChat): req.tool_choice = "auto" elif tool_choice_type == "any": req.tool_choice = "required" + elif tool_choice_type == "none": + req.tool_choice = "none" elif tool_choice_type == "tool": req.tool_choice = ChatCompletionNamedToolChoiceParam.model_validate( {