mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
fix: Add Mistral provider configuration and tests (#2200)
- Add Mistral provider to constants.py with API key config - Add Mistral models to available models list - Fix env file creation to only write when API keys are provided - Add tests for Mistral provider setup with and without API key Fixes #2200 Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -162,7 +162,12 @@ def create_crew(name, provider=None, skip_provider=False, parent_folder=None):
|
||||
if api_key_value.strip():
|
||||
env_vars[key_name] = api_key_value
|
||||
|
||||
if env_vars:
|
||||
# Only write env file if we have API keys
|
||||
has_api_keys = any(
|
||||
key in env_vars and env_vars[key].strip()
|
||||
for key in ["MISTRAL_API_KEY", "OPENAI_API_KEY", "ANTHROPIC_API_KEY"]
|
||||
)
|
||||
if has_api_keys:
|
||||
write_env_file(folder_path, env_vars)
|
||||
click.secho("API keys and model saved to .env file", fg="green")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user