mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 07:38:29 +00:00
feat: update CLI model lists with latest OpenAI, Anthropic, and Google models
- Add GPT-5, GPT-5 mini, GPT-5 nano, GPT-4.1, and o3-mini for OpenAI - Add Claude 3.7 Sonnet, Claude 4 Sonnet, and Claude 4.1 Opus for Anthropic - Add Gemini 2.5 Pro, 2.5 Flash, and 2.5 Flash-Lite for Google - Add comprehensive tests for updated model constants Fixes #3380 Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user