You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
so the .env file is located in the current directory of the Python script.
For instance:
juanan@u033782 /opt/codeinterpreter-api-test tree -a
.
├── .codebox
├── .env
└── get_btc.py
without that change, if we run the get_btc.py script we'll get this error:
File "/Users/juanan/.pyenv/versions/3.10.0/lib/python3.10/site-packages/codeinterpreterapi/session.py", line 54, in _llm
raise ValueError("OpenAI API key missing.")
ValueError: OpenAI API key missing.
With the suggested change, the .env file will be correctly located.
The text was updated successfully, but these errors were encountered:
I am not sure if this is nessesary. I have the .env file in the same location as you and for me it works.
As far as I know dotenv is searching the entire directory tree from the current working directory down the folders for a .env file so by default it should find it.
I suggest to replace this line:
codeinterpreter-api/codeinterpreterapi/config.py
Line 5 in 000213d
with
load_dotenv(dotenv_path="./.env")
so the
.env
file is located in the current directory of the Python script.For instance:
without that change, if we run the
get_btc.py
script we'll get this error:With the suggested change, the
.env
file will be correctly located.The text was updated successfully, but these errors were encountered: