Tonic commited on
Commit
979fe41
1 Parent(s): 3309025

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -54,11 +54,9 @@ def ask_openai(question):
54
  thread_id=thread.id,
55
  message_id=message_id
56
  )
57
- return message.content[0]['text']['value']
58
-
59
  return "No response."
60
- except Exception as e:
61
- return f"An error occurred: {str(e)}"
62
 
63
  examples = [
64
  ["My Eucalyptus tree is struggling outside in the cold weather in europe"],
 
54
  thread_id=thread.id,
55
  message_id=message_id
56
  )
57
+ if message.content and message.content[0].type == 'text':
58
+ return message.content[0].text.value # Accessing the 'value' field correctly
59
  return "No response."
 
 
60
 
61
  examples = [
62
  ["My Eucalyptus tree is struggling outside in the cold weather in europe"],