diff --git a/src/crewai/cli/constants.py b/src/crewai/cli/constants.py index d0e867c41..3798f8ea5 100644 --- a/src/crewai/cli/constants.py +++ b/src/crewai/cli/constants.py @@ -135,14 +135,21 @@ MODELS = { "gpt-4.1-nano-2025-04-14", "gpt-4o", "gpt-4o-mini", + "gpt-5", + "gpt-5-mini", + "gpt-5-nano", "o1-mini", "o1-preview", + "o3-mini", ], "anthropic": [ "claude-3-5-sonnet-20240620", "claude-3-sonnet-20240229", "claude-3-opus-20240229", "claude-3-haiku-20240307", + "claude-3.7-sonnet-20250219", + "claude-4-sonnet-20250301", + "claude-4.1-opus-20250315", ], "gemini": [ "gemini/gemini-1.5-flash", @@ -152,6 +159,9 @@ MODELS = { "gemini/gemini-2.0-flash-thinking-exp-01-21", "gemini/gemini-2.5-flash-preview-04-17", "gemini/gemini-2.5-pro-exp-03-25", + "gemini/gemini-2.5-flash-lite", + "gemini/gemini-2.5-flash", + "gemini/gemini-2.5-pro", "gemini/gemini-gemma-2-9b-it", "gemini/gemini-gemma-2-27b-it", "gemini/gemma-3-1b-it", diff --git a/tests/cli/test_constants.py b/tests/cli/test_constants.py index 61d8e069b..77b1492c2 100644 --- a/tests/cli/test_constants.py +++ b/tests/cli/test_constants.py @@ -21,3 +21,44 @@ def test_huggingface_models(): """Test that Huggingface models are properly configured.""" assert "huggingface" in MODELS assert len(MODELS["huggingface"]) > 0 + + +def test_openai_models_include_latest(): + """Test that OpenAI models include the latest GPT-5 series.""" + openai_models = MODELS["openai"] + assert "gpt-5" in openai_models + assert "gpt-5-mini" in openai_models + assert "gpt-5-nano" in openai_models + assert "gpt-4.1" in openai_models + assert "o3-mini" in openai_models + + +def test_anthropic_models_include_latest(): + """Test that Anthropic models include the latest Claude 4 series.""" + anthropic_models = MODELS["anthropic"] + assert "claude-3.7-sonnet-20250219" in anthropic_models + assert "claude-4-sonnet-20250301" in anthropic_models + assert "claude-4.1-opus-20250315" in anthropic_models + + +def test_gemini_models_include_latest(): + """Test that Gemini models include the latest 2.5 series.""" + gemini_models = MODELS["gemini"] + assert "gemini/gemini-2.5-pro" in gemini_models + assert "gemini/gemini-2.5-flash" in gemini_models + assert "gemini/gemini-2.5-flash-lite" in gemini_models + + +def test_all_providers_have_models(): + """Test that all providers in PROVIDERS have corresponding models.""" + for provider in PROVIDERS: + if provider in MODELS: + assert len(MODELS[provider]) > 0, f"Provider {provider} has no models" + + +def test_model_format_consistency(): + """Test that model names follow consistent formatting patterns.""" + for provider, models in MODELS.items(): + for model in models: + assert isinstance(model, str), f"Model {model} in {provider} is not a string" + assert len(model.strip()) > 0, f"Empty model name in {provider}"