mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-10 22:41:41 +00:00
Merge 1028789b4b into eb0e3f8c18
This commit is contained in:
commit
07f42740dc
2 changed files with 30 additions and 0 deletions
|
|
@ -341,7 +341,9 @@ class AnthropicModelInfo(BaseLLMModelInfo):
|
|||
prefixes: Final = (
|
||||
"bedrock/converse/",
|
||||
"bedrock/invoke/",
|
||||
"bedrock/mantle/",
|
||||
"bedrock/",
|
||||
"mantle/",
|
||||
"vertex_ai/",
|
||||
)
|
||||
deprefixed: Final = tuple(model[len(p) :] for p in prefixes if model.startswith(p))
|
||||
|
|
|
|||
|
|
@ -427,6 +427,34 @@ def test_output_config_forwarded_for_bedrock_chat_invoke_request():
|
|||
assert result["max_tokens"] == 100
|
||||
|
||||
|
||||
def test_output_config_forwarded_for_mantle_routed_model():
|
||||
"""A mantle-routed id must resolve the same capabilities as its us.* twin.
|
||||
|
||||
bedrock/mantle/anthropic.claude-opus-5 and bedrock/us.anthropic.claude-opus-5
|
||||
are the same underlying model, but the mantle route segment was not among the
|
||||
prefixes capability lookups strip, so supports_output_config and the effort
|
||||
check both came back False and this path stripped output_config. The request
|
||||
then went out with the legacy thinking.type=enabled shape, which Bedrock
|
||||
rejects.
|
||||
"""
|
||||
config = AmazonAnthropicClaudeConfig()
|
||||
|
||||
optional_params = {
|
||||
"max_tokens": 100,
|
||||
"output_config": {"effort": "high"},
|
||||
}
|
||||
|
||||
result = config.transform_request(
|
||||
model="mantle/anthropic.claude-opus-5",
|
||||
messages=[{"role": "user", "content": "test"}],
|
||||
optional_params=optional_params,
|
||||
litellm_params={},
|
||||
headers={},
|
||||
)
|
||||
|
||||
assert result.get("output_config") == {"effort": "high"}
|
||||
|
||||
|
||||
def test_output_config_format_converted_for_bedrock_chat_invoke_request():
|
||||
"""Bedrock Invoke chat path consumes ``output_config.format`` before forwarding."""
|
||||
config = AmazonAnthropicClaudeConfig()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue