Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,6 +14,8 @@ import os
|
|
| 14 |
import os
|
| 15 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 16 |
# Replace with your OpenAI API key
|
|
|
|
|
|
|
| 17 |
|
| 18 |
# Simple in-session memory
|
| 19 |
code_history = []
|
|
|
|
| 14 |
import os
|
| 15 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 16 |
# Replace with your OpenAI API key
|
| 17 |
+
if not openai.api_key:
|
| 18 |
+
raise EnvironmentError("OPENAI_API_KEY is not set in environment variables.")
|
| 19 |
|
| 20 |
# Simple in-session memory
|
| 21 |
code_history = []
|