Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -258,10 +258,9 @@ PROMPTS:
|
|
258 |
)
|
259 |
|
260 |
if use_openai:
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
try:
|
266 |
response = openai.ChatCompletion.create(
|
267 |
model="gpt-3.5-turbo",
|
|
|
258 |
)
|
259 |
|
260 |
if use_openai:
|
261 |
+
if not openai.api_key:
|
262 |
+
st.error("❌ OPENAI_API_KEY is not set.")
|
263 |
+
return "⚠️ OpenAI key missing."
|
|
|
264 |
try:
|
265 |
response = openai.ChatCompletion.create(
|
266 |
model="gpt-3.5-turbo",
|