openai / openai-quickstart-python

Python example app from the OpenAI API quickstart tutorial
https://platform.openai.com/docs/quickstart?context=python
MIT License
1.66k stars 1.31k forks source link

Include load dotenv #42

Closed albertoecf closed 4 months ago

albertoecf commented 1 year ago

Description

This pull request fixes an issue with the app.py file by including the load_dotenv module. This is necessary for loading environment variables from a .env file.

Changes Made

Added from dotenv import load_dotenv module to app.py Added load_dotenv(dotenv_path=".env") to load environment variables from .env file

Reason for Changes

Without the load_dotenv module, environment variables could not be loaded from the .env file, leading to issues with the application. This fix ensures that the application runs smoothly and as intended.

logankilpatrick commented 4 months ago

Going to close this for now, I believe the OpenAI SDK does this for you automatically.