Fix additional tests broken by deprecated model removal from remote cost map

- test_gpt5_azure_temperature_support: remove o1-preview from O-series test
  (model removed from cost map, can't be identified as O-series)
- test_anthropic_chat_transformation: update model names in max_tokens tests
  - claude-3-sonnet-20240229 -> claude-3-opus-20240229 (still in cost map)
  - claude-3-5-sonnet-20241022 -> claude-sonnet-4-5-20250929 (8192 tier no longer exists)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
yuneng-jiang 2026-03-12 14:26:53 -07:00
parent cc81e3c226
commit 7436b732b1
2 changed files with 12 additions and 12 deletions

View file

@ -24,7 +24,7 @@ def test_azure_gpt5_supports_temperature():
def test_azure_o_series_does_not_support_temperature():
"""Test that Azure O-series models still use the correct O-series config."""
test_models = ["o1", "o1-preview", "o3"]
test_models = ["o1", "o3"]
for model in test_models:
config = ProviderConfigManager.get_provider_responses_api_config(

View file

@ -1817,23 +1817,23 @@ def test_get_max_tokens_for_model_claude_3():
"""
config = AnthropicConfig()
# Claude 3 Sonnet should return 4096
max_tokens = config.get_max_tokens_for_model("claude-3-sonnet-20240229")
# Claude 3 Opus should return 4096
max_tokens = config.get_max_tokens_for_model("claude-3-opus-20240229")
assert max_tokens == 4096
def test_get_max_tokens_for_model_claude_35():
"""
Test that get_max_tokens_for_model returns correct value for Claude 3.5 models.
Claude 3.5 models have max_output_tokens of 8192.
Test that get_max_tokens_for_model returns correct value for Claude 4.5 Sonnet models.
Claude 4.5 Sonnet has max_output_tokens of 64000.
Fixes: https://github.com/BerriAI/litellm/issues/8835
"""
config = AnthropicConfig()
# Claude 3.5 Sonnet should return 8192
max_tokens = config.get_max_tokens_for_model("claude-3-5-sonnet-20241022")
assert max_tokens == 8192
# Claude 4.5 Sonnet should return 64000
max_tokens = config.get_max_tokens_for_model("claude-sonnet-4-5-20250929")
assert max_tokens == 64000
def test_get_max_tokens_for_model_claude_37():
@ -1880,12 +1880,12 @@ def test_get_config_with_model_uses_dynamic_max_tokens():
Fixes: https://github.com/BerriAI/litellm/issues/8835
"""
# Claude 3 model should get 4096
config_claude3 = AnthropicConfig.get_config(model="claude-3-sonnet-20240229")
config_claude3 = AnthropicConfig.get_config(model="claude-3-opus-20240229")
assert config_claude3["max_tokens"] == 4096
# Claude 3.5 model should get 8192
config_claude35 = AnthropicConfig.get_config(model="claude-3-5-sonnet-20241022")
assert config_claude35["max_tokens"] == 8192
# Claude 4.5 Sonnet should get 64000
config_claude45 = AnthropicConfig.get_config(model="claude-sonnet-4-5-20250929")
assert config_claude45["max_tokens"] == 64000
# Claude 3.7 model should get 64000 (64K default, 128K requires beta header)
config_claude37 = AnthropicConfig.get_config(model="claude-3-7-sonnet-20250219")