[Bugfix] Preserve Anthropic disable_parallel_tool_use (#52021)
Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com>
This commit is contained in:
@@ -95,6 +95,7 @@ class AnthropicToolChoice(BaseModel):
|
||||
|
||||
type: Literal["auto", "any", "tool", "none"]
|
||||
name: str | None = None
|
||||
disable_parallel_tool_use: bool | None = None
|
||||
|
||||
@model_validator(mode="after")
|
||||
def validate_name_required_for_tool(self) -> "AnthropicToolChoice":
|
||||
|
||||
@@ -539,6 +539,9 @@ class AnthropicServingMessages(OpenAIServingChat):
|
||||
req.tool_choice = None
|
||||
return
|
||||
|
||||
req.parallel_tool_calls = (
|
||||
not anthropic_request.tool_choice.disable_parallel_tool_use
|
||||
)
|
||||
tool_choice_type = anthropic_request.tool_choice.type
|
||||
if tool_choice_type == "auto":
|
||||
req.tool_choice = "auto"
|
||||
|
||||
Reference in New Issue
Block a user