* feat: Update Claude model references from v3 to v4 - Update model configurations from claude-3-opus to claude-4-opus - Update model configurations from claude-3-sonnet to claude-4-sonnet - Maintain backward compatibility through existing aliases (opus, sonnet, claude) - Update provider registry preferred models list - Update all test cases and assertions to reflect new model names - Update documentation and examples consistently across all files - Add Claude 4 model support while preserving existing functionality Files modified: 15 (config, docs, providers, tests, tools) Pattern: Systematic claude-3-* → claude-4-* model reference migration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * PR feedback: changed anthropic/claude-4-opus -> anthropic/claude-opus-4 and anthropic/claude-4-haiku -> anthropic/claude-3.5-haiku * changed anthropic/claude-4-sonnet -> anthropic/claude-sonnet-4 * PR feedback removed specific model from test mock * PR feedback removed base.py --------- Co-authored-by: Omry Nachman <omry@wix.com> Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -53,8 +53,8 @@ class TestListModelsRestrictions(unittest.TestCase):
|
||||
# Set up mock to return only allowed models when restrictions are respected
|
||||
# Include both aliased models and full model names without aliases
|
||||
self.mock_openrouter.list_models.return_value = [
|
||||
"anthropic/claude-3-opus-20240229", # Has alias "opus"
|
||||
"anthropic/claude-3-sonnet-20240229", # Has alias "sonnet"
|
||||
"anthropic/claude-opus-4", # Has alias "opus"
|
||||
"anthropic/claude-sonnet-4", # Has alias "sonnet"
|
||||
"deepseek/deepseek-r1-0528:free", # No alias, full name
|
||||
"qwen/qwen3-235b-a22b-04-28:free", # No alias, full name
|
||||
]
|
||||
@@ -67,12 +67,12 @@ class TestListModelsRestrictions(unittest.TestCase):
|
||||
def resolve_side_effect(model_name):
|
||||
if "opus" in model_name.lower():
|
||||
config = MagicMock()
|
||||
config.model_name = "anthropic/claude-3-opus-20240229"
|
||||
config.model_name = "anthropic/claude-opus-4-20240229"
|
||||
config.context_window = 200000
|
||||
return config
|
||||
elif "sonnet" in model_name.lower():
|
||||
config = MagicMock()
|
||||
config.model_name = "anthropic/claude-3-sonnet-20240229"
|
||||
config.model_name = "anthropic/claude-sonnet-4-20240229"
|
||||
config.context_window = 200000
|
||||
return config
|
||||
return None # No config for models without aliases
|
||||
@@ -93,8 +93,8 @@ class TestListModelsRestrictions(unittest.TestCase):
|
||||
mock_get_models.return_value = {
|
||||
"gemini-2.5-flash": ProviderType.GOOGLE,
|
||||
"gemini-2.5-pro": ProviderType.GOOGLE,
|
||||
"anthropic/claude-3-opus-20240229": ProviderType.OPENROUTER,
|
||||
"anthropic/claude-3-sonnet-20240229": ProviderType.OPENROUTER,
|
||||
"anthropic/claude-opus-4-20240229": ProviderType.OPENROUTER,
|
||||
"anthropic/claude-sonnet-4-20240229": ProviderType.OPENROUTER,
|
||||
"deepseek/deepseek-r1-0528:free": ProviderType.OPENROUTER,
|
||||
"qwen/qwen3-235b-a22b-04-28:free": ProviderType.OPENROUTER,
|
||||
}
|
||||
@@ -172,7 +172,7 @@ class TestListModelsRestrictions(unittest.TestCase):
|
||||
utils.model_restrictions._restriction_service = None
|
||||
|
||||
# Set up mock to return many models when no restrictions
|
||||
all_models = [f"provider{i//10}/model-{i}" for i in range(50)] # Simulate 50 models from different providers
|
||||
all_models = [f"provider{i // 10}/model-{i}" for i in range(50)] # Simulate 50 models from different providers
|
||||
self.mock_openrouter.list_models.return_value = all_models
|
||||
|
||||
# Mock registry instance
|
||||
|
||||
Reference in New Issue
Block a user