fix(bedrock): accept any tool choice

This commit is contained in:
daleselaji-dev 2026-08-23 10:13:05 +08:00
parent d447be15b9
commit 1cfe030ec6
2 changed files with 2 additions and 1 deletions

View file

@ -591,7 +591,7 @@ class AmazonConverseConfig(BaseConfig):
message=f"Bedrock doesn't support tool_choice={tool_choice}. To drop it from the call, set `litellm.drop_params = True.",
status_code=400,
)
elif tool_choice == "required":
elif tool_choice == "required" or tool_choice == "any":
return ToolChoiceValuesBlock(any={})
elif tool_choice == "auto":
return ToolChoiceValuesBlock(auto={})

View file

@ -4323,6 +4323,7 @@ def test_parallel_tool_calls_emits_typed_auto_tool_choice(parallel_tool_calls, e
[
("auto", {"auto": {}}),
("required", {"any": {}}),
("any", {"any": {}}),
({"type": "function", "function": {"name": "get_current_weather"}}, {"tool": {"name": "get_current_weather"}}),
],
)