PraisonAI icon indicating copy to clipboard operation
PraisonAI copied to clipboard

The App checking Open AI Key instead of Gemini

Open krizslash opened this issue 1 year ago • 1 comments

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.

krizslash avatar Sep 27 '24 09:09 krizslash

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

MervinPraison avatar Oct 03 '24 05:10 MervinPraison