Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The .env file seems not working #42

Open
redreamality opened this issue Aug 26, 2023 · 1 comment
Open

The .env file seems not working #42

redreamality opened this issue Aug 26, 2023 · 1 comment

Comments

@redreamality
Copy link

redreamality commented Aug 26, 2023

Describe the bug

To Reproduce
Steps to reproduce the behavior:

  1. put .env file into the current folder
  2. run demogpt
  3. goto the webpage and type name and description for the app and submit.
  4. "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

@melih-unsal
Copy link
Owner

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:

  1. You can manually enter your OpenAI API Key in the text area on the left side of the web interface for immediate testing.
  2. Another approach is to directly define OPENAI_API_KEY as an environment variable in your system. You can do this by running the export 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants