Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
# this model.'). Matched the same way as the list above.
_MODELS_REJECTING_FORCED_TOOL_CHOICE = (
"claude-opus-5-5",
"claude-sonnet-5-5",
"claude-fable-5-1",
)

Expand Down
7 changes: 5 additions & 2 deletions tests/test_plugin_aws_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,22 +152,25 @@ async def _tool_choice(model: str, tool_choice: ToolChoice) -> dict:


async def test_forced_tool_choice_sent_as_auto_for_opus_5_5() -> None:
# Claude Opus 5.5 and Fable 5.1 reject forced tool use with a ValidationException
# Claude Opus 5.5, Sonnet 5.5 and Fable 5.1 reject forced tool use with a ValidationException
# ('tool_choice: type "tool" and "any" are not supported for this model.').
for model in (
"us.anthropic.claude-opus-5-5",
"global.anthropic.claude-opus-5-5",
"anthropic.claude-opus-5-5",
"us.anthropic.claude-sonnet-5-5",
"global.anthropic.claude-sonnet-5-5",
"us.anthropic.claude-fable-5-1",
):
assert await _tool_choice(model, "required") == {"auto": {}}
assert await _tool_choice(model, _NAMED) == {"auto": {}}


async def test_forced_tool_choice_kept_for_other_models() -> None:
# Opus 5 and Fable 5 still accept any/tool; "claude-fable-5" must not match "-5-1".
# Opus 5, Sonnet 5 and Fable 5 still accept any/tool; "claude-fable-5" must not match "-5-1".
for model in (
"us.anthropic.claude-opus-5",
"us.anthropic.claude-sonnet-5",
"us.anthropic.claude-fable-5",
"us.anthropic.claude-sonnet-4-6",
):
Expand Down
Loading