Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The App checking Open AI Key instead of Gemini #160

Open
krizslash opened this issue Sep 27, 2024 · 1 comment
Open

The App checking Open AI Key instead of Gemini #160

krizslash opened this issue Sep 27, 2024 · 1 comment

Comments

@krizslash
Copy link

krizslash commented Sep 27, 2024

I plan to use gemini instead of open AI but somehow when I run the app, it checking open AI keys. I already export (or SET in windows) the 'GOOGLE_API_KEY' key btw. In the setting I also had autogen framework and gemini model. I'am using Windows 10:

framework: crewai
topic: create movie script about cat in mars
roles:
researcher:
backstory: Skilled in finding and organizing information, with a focus on research
efficiency.
goal: Gather information about Mars and cats
role: Researcher
llm:
model: "google/gemini-1.5-flash-001"
tasks:
gather_research:
description: Research and gather information about Mars, its environment,
and cats, including their behavior and characteristics.
expected_output: Document with research findings, including interesting facts
and information.
tools:
- ''

This is the error that I got:

File "C:\Users\p\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\crewai_tools\tools\rag\rag_tool.py", line 47, in _set_default_adapter
app = App.from_config(config=self.config) if self.config else App()
^^^^^
File "C:\Users\p\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\embedchain\app.py", line 114, in init
self.embedding_model = embedding_model or OpenAIEmbedder()
^^^^^^^^^^^^^^^^
File "C:\Users\p\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\embedchain\embedder\openai.py", line 19, in init
api_key = self.config.api_key or os.environ["OPENAI_API_KEY"]
~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "", line 714, in getitem
KeyError: 'OPENAI_API_KEY'

Is there a way to config the setting so that it ignore open AI key?

Thanks in advance.

@MervinPraison
Copy link
Owner

Please try this if you are using AI Agents https://docs.praison.ai/models/google/
If you are using Chat or Code , then try using this https://litellm.vercel.app/docs/providers/gemini

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants