ambrosfitz commited on
Commit
d8113bc
·
verified ·
1 Parent(s): 23a2abf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -25,8 +25,8 @@ def predict(message, history):
25
  stream=False # Set to False for simplicity in this example
26
  )
27
 
28
- if response.choices and response.choices[0].text:
29
- response_text = response.choices[0].text.strip()
30
  history.append((message, response_text)) # Update history with the new Q&A pair
31
  return response_text
32
  else:
 
25
  stream=False # Set to False for simplicity in this example
26
  )
27
 
28
+ if response.choices and response.choices[0].message['content']:
29
+ response_text = response.choices[0].message['content'].strip()
30
  history.append((message, response_text)) # Update history with the new Q&A pair
31
  return response_text
32
  else: