mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 23:58:34 +00:00
updated the initialization logic to allow the API key to be passed as env var
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
import secrets
|
||||
from typing import Any, Dict, List, Optional, Text, Type
|
||||
|
||||
@@ -36,7 +37,13 @@ class AIMindTool(BaseTool):
|
||||
"`minds_sdk` package not found, please run `pip install minds-sdk`"
|
||||
)
|
||||
|
||||
minds_client = Client(api_key=api_key)
|
||||
if os.getenv("MINDS_API_KEY"):
|
||||
self.api_key = os.getenv("MINDS_API_KEY")
|
||||
|
||||
if self.api_key is None:
|
||||
raise ValueError("A Minds API key is required to use the AIMind Tool.")
|
||||
|
||||
minds_client = Client(api_key=self.api_key)
|
||||
|
||||
# Convert the datasources to DatabaseConfig objects.
|
||||
datasources = []
|
||||
|
||||
Reference in New Issue
Block a user