mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 00:58:30 +00:00
Fix CLI documentation to reflect actual provider count and two-step process
- Update docs/concepts/cli.mdx to remove outdated 'top 5 most common LLM providers' reference - Replace with accurate description of 12 available providers plus 'other' option - Document the two-step process: select provider, then select model - Add comprehensive test to prevent documentation drift in the future - Test validates that docs stay in sync with actual CLI implementation Fixes #3054 Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
44
tests/test_cli_documentation_sync.py
Normal file
44
tests/test_cli_documentation_sync.py
Normal file
@@ -0,0 +1,44 @@
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
from crewai.cli.constants import PROVIDERS
|
||||
|
||||
|
||||
def test_cli_documentation_matches_providers():
|
||||
"""Test that CLI documentation accurately reflects the available providers."""
|
||||
docs_path = Path(__file__).parent.parent / "docs" / "concepts" / "cli.mdx"
|
||||
with open(docs_path, 'r') as f:
|
||||
docs_content = f.read()
|
||||
|
||||
assert "top 5" not in docs_content.lower(), "Documentation should not mention 'top 5' providers"
|
||||
assert "5 most common" not in docs_content.lower(), "Documentation should not mention '5 most common' providers"
|
||||
|
||||
assert "list of available LLM providers" in docs_content or "following LLM providers" in docs_content, \
|
||||
"Documentation should mention the availability of multiple LLM providers"
|
||||
|
||||
assert len(PROVIDERS) > 5, f"Expected more than 5 providers, but found {len(PROVIDERS)}"
|
||||
|
||||
key_providers = ["OpenAI", "Anthropic", "Gemini"]
|
||||
for provider in key_providers:
|
||||
assert provider in docs_content, f"Key provider {provider} should be mentioned in documentation"
|
||||
|
||||
|
||||
def test_providers_list_matches_constants():
|
||||
"""Test that the actual PROVIDERS list has the expected providers."""
|
||||
expected_providers = [
|
||||
"openai",
|
||||
"anthropic",
|
||||
"gemini",
|
||||
"nvidia_nim",
|
||||
"groq",
|
||||
"huggingface",
|
||||
"ollama",
|
||||
"watson",
|
||||
"bedrock",
|
||||
"azure",
|
||||
"cerebras",
|
||||
"sambanova",
|
||||
]
|
||||
|
||||
assert PROVIDERS == expected_providers, f"PROVIDERS list has changed. Expected {expected_providers}, got {PROVIDERS}"
|
||||
assert len(PROVIDERS) == 12, f"Expected 12 providers, but found {len(PROVIDERS)}"
|
||||
Reference in New Issue
Block a user