smithaneka commited on
Commit
c896dad
·
verified ·
1 Parent(s): 45f74a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
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(