yoheinakajima / babyagi

https://babyagi.org/
20.1k stars 2.63k forks source link

.env file not updating openai api key #296

Closed commonbeing closed 4 days ago

commonbeing commented 1 year ago

I revoked my API key on the openai site and created a new key.

I then changed the API key in the .env file to the new key.

Now when running it errors out on the API key being wrong and I can see it's still referencing the old key.

I find this strange as the .env file updates the task no problem.

So where it storing the openAI API key? if it is not referencing the .env file for the API key when executing babyAGI.py the it must be passing the key to somewhere else when first run, which makes the whole purpose of an .env for securing API keys pointless.

commonbeing commented 1 year ago

oh I see now, it creates a openAI key global environment variable on my system.

Maybe someone maybe could make this update automatically if changed in the .env file.