[BUG] embedder cannot add API key
Closed this issue · 2 comments
Description
I have set os.environ["GOOGLE_API_KEY"] , but when trying to use the embedder, I keep getting error of not having API key
Steps to Reproduce
crew = Crew(
agents=[support_agent, support_quality_assurance_agent],
tasks=[inquiry_resolution, quality_assurance_review],
verbose=True,
memory=True,
embedder={
"provider": "gpt4all"
}
embedder={
"provider": "google",
"config": {
"model": 'models/text-embedding-004',
"task_type": "retrieval_document",
"title": "Embeddings for Embedchain",
}
}
)
inputs = {
"customer": "DeepLearningAI",
"person": "Andrew Ng",
"inquiry": "I need help with setting up a Crew "
"and kicking it off, specifically "
"how can I add memory to my crew? " #Guardrails
"Can you provide guidance?"
}
result = crew.kickoff(inputs=inputs)
Expected behavior
get this error code :
DefaultCredentialsError:
No API_KEY or ADC found. Please either:
- Set the GOOGLE_API_KEY
environment variable.
- Manually pass the key with genai.configure(api_key=my_api_key)
.
- Or set up Application Default Credentials, see https://ai.google.dev/gemini-api/docs/oauth for more information.
Screenshots/Code snippets
Operating System
Ubuntu 20.04
Python Version
3.10
crewAI Version
0.55.2
crewAI Tools Version
0.12.1
Virtual Environment
Conda
Evidence
DefaultCredentialsError:
No API_KEY or ADC found. Please either:
- Set the GOOGLE_API_KEY
environment variable.
- Manually pass the key with genai.configure(api_key=my_api_key)
.
- Or set up Application Default Credentials, see https://ai.google.dev/gemini-api/docs/oauth for more information.
Possible Solution
add option for API key in embedder.
Additional context
the API key in the os.environ is working well but the cew cannot find the API key when using embedder.
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.