Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,10 @@ import openai
|
|
| 3 |
import os
|
| 4 |
|
| 5 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
def simple_agent(message, history):
|
| 8 |
response = openai.ChatCompletion.create(
|
|
|
|
| 3 |
import os
|
| 4 |
|
| 5 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 6 |
+
try:
|
| 7 |
+
response = openai.ChatCompletion.create(...)
|
| 8 |
+
except Exception as e:
|
| 9 |
+
return f"Error: {str(e)}"
|
| 10 |
|
| 11 |
def simple_agent(message, history):
|
| 12 |
response = openai.ChatCompletion.create(
|