From 10a55bd2102c1f482ef8f7a0d6efd2f3776d3cf2 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 06:15:05 +0000 Subject: [PATCH] Fix CLI documentation to reflect actual provider count and two-step process MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- docs/concepts/cli.mdx | 21 ++++++++----- tests/test_cli_documentation_sync.py | 44 ++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 7 deletions(-) create mode 100644 tests/test_cli_documentation_sync.py diff --git a/docs/concepts/cli.mdx b/docs/concepts/cli.mdx index 2a86c7e6e..ebce81d67 100644 --- a/docs/concepts/cli.mdx +++ b/docs/concepts/cli.mdx @@ -285,25 +285,32 @@ Watch this video tutorial for a step-by-step demonstration of deploying your cre ### 11. API Keys -When running ```crewai create crew``` command, the CLI will first show you the top 5 most common LLM providers and ask you to select one. +When running ```crewai create crew``` command, the CLI will show you a list of available LLM providers to choose from, followed by model selection for your chosen provider. -Once you've selected an LLM provider, you will be prompted for API keys. +Once you've selected an LLM provider and model, you will be prompted for API keys. -#### Initial API key providers +#### Available LLM Providers -The CLI will initially prompt for API keys for the following services: +The CLI will show you the following LLM providers to choose from: * OpenAI -* Groq * Anthropic * Google Gemini +* NVIDIA NIM +* Groq +* Hugging Face +* Ollama +* Watson +* AWS Bedrock +* Azure +* Cerebras * SambaNova -When you select a provider, the CLI will prompt you to enter your API key. +When you select a provider, the CLI will then show you available models for that provider and prompt you to enter your API key. #### Other Options -If you select option 6, you will be able to select from a list of LiteLLM supported providers. +If you select "other", you will be able to select from a list of LiteLLM supported providers. When you select a provider, the CLI will prompt you to enter the Key name and the API key. diff --git a/tests/test_cli_documentation_sync.py b/tests/test_cli_documentation_sync.py new file mode 100644 index 000000000..cd274c4f9 --- /dev/null +++ b/tests/test_cli_documentation_sync.py @@ -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)}"