Update app.py
Browse files
app.py
CHANGED
@@ -31,8 +31,8 @@ load_dotenv()
|
|
31 |
|
32 |
# # Retrieve OpenAI API key
|
33 |
openai_api_key = os.getenv("OPENAI_API_KEY")
|
34 |
-
|
35 |
-
|
36 |
|
37 |
# # Set the OpenAI API key for the OpenAI library
|
38 |
openai.api_key = openai_api_key
|
|
|
31 |
|
32 |
# # Retrieve OpenAI API key
|
33 |
openai_api_key = os.getenv("OPENAI_API_KEY")
|
34 |
+
if openai_api_key is None:
|
35 |
+
raise ValueError("The OPENAI_API_KEY environment variable is not set")
|
36 |
|
37 |
# # Set the OpenAI API key for the OpenAI library
|
38 |
openai.api_key = openai_api_key
|