smol-ai / developer

the first library to let you embed a developer agent in your own app!
https://twitter.com/SmolModels
MIT License
11.76k stars 1.03k forks source link

OpenAI key error #130

Open shaikansari opened 12 months ago

shaikansari commented 12 months ago

I have fixed "NameError: name 'args' is not defined #125 " in my local, but I am getting another error now.

raise openai.error.AuthenticationError( openai.error.AuthenticationError: No API key provided. You can set your API key in code using 'openai.api_key = ', or you can set the environment variable OPENAI_API_KEY=). If your API key is stored in a file, you can point the openai module at it with 'openai.api_key_path = '. You can generate API keys in the OpenAI web interface. See https://platform.openai.com/account/api-keys for details.

sebastianmacias commented 12 months ago

I'm having the same error after setting the .env file and running poetry run python main.py --prompt "a test case"

vital121 commented 11 months ago

got it .env not working have to use export OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxx

Dhruvsahu98 commented 8 months ago

How is it working in windows ?

Below one is not working

image
Dhruvsahu98 commented 8 months ago

It is working in windows via setting the OPENAI_API_KEY in the user environment variable and restart the pc.