MervinPraison / PraisonAI

PraisonAI application combines AutoGen and CrewAI or similar frameworks into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customisation, and efficient human-agent collaboration.
https://docs.praison.ai
MIT License
1.25k stars 188 forks source link

Struggling with Ollama #10

Closed bamit99 closed 3 months ago

bamit99 commented 3 months ago

Hi, I am running Ollama on my machine and it's working properly. I have multiple tools including CrewAI, PrivateGPT and others that can utilize it. Although, somehow I am not even able to initiate PraisonAI to use Ollama. It keeps giving me error about the OpenAI key. I have updated the .env file as below but the error keeps coming " Did not find openai_api_key, please add an environment variable OPENAI_API_KEY which contains it, or pass openai_api_key as a named parameter. (type=value_error)"

How to fix this?! Also, where should the env file be stored.

OPENAI_API_BASE=http://localhost:11434/v1 OPENAI_MODEL_NAME=Majinbu

bamit99 commented 3 months ago

My mistake. My API was on PC IP rather than loopback. I changed it and it works now.

zsb87 commented 1 month ago

@bamit99 I have tried both loopback and IP address "http://127.0.0.1:11434/v1" but always got error. How did you solve it? File "C:\Users\zhanshib\AppData\Roaming\Python\Python312\site-packages\openai\_base_client.py", line 952, in _request raise APIConnectionError(request=request) from err openai.APIConnectionError: Connection error.