The .env file seems not working
redreamality opened this issue · 1 comments
Describe the bug
To Reproduce
Steps to reproduce the behavior:
- put
.env
file into the current folder - run
demogpt
- goto the webpage and type name and description for the app and submit.
- "please enter the openai api key"
Expected behavior
in the .env file I changed the "OPENAI_API_BASE" and specified the 'OPENAI_API_KEY', so when clicked on submit, it should directly call the llm
Hi @redreamality,
Thank you for bringing this issue to our attention. I apologize for the inconvenience you're experiencing.
For the application to properly read the .env file, it should be placed in the $DEMOGPT_PATH/demogpt/plan
folder. This is because the load_dotenv
function operates in the scope of the application code that resides in this particular folder. Once the .env file is in the correct location, the application should automatically load the OPENAI_API_KEY
from it and populate the text area on the left side of the interface.
Currently, the application is configured to only support OPENAI_API_KEY
. To resolve your issue, please ensure that your .env file is in the $DEMOGPT_PATH/demogpt/plan
folder and try running the application again.
Alternatives:
- You can manually enter your OpenAI API Key in the text area on the left side of the web interface for immediate testing.
- Another approach is to directly define
OPENAI_API_KEY
as an environment variable in your system. You can do this by running theexport OPENAI_API_KEY=your_api_key_here
command in your terminal session or by adding the same command to your.bashrc
file.
Thank you for your understanding and cooperation. Please let me know if you encounter further issues or have additional questions.
Best regards,
Melih.