pvanand commited on
Commit
db25947
·
1 Parent(s): 373ce2a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -33,8 +33,11 @@ if user_input := st.chat_input("What is up?"):
33
  # Extract assistant response
34
  if bot_reply !=[]:
35
  assistant_response = ""
36
- for reply in bot_reply:
37
- assistant_response+=(" "+reply['text'])
 
 
 
38
  else:
39
  assistant_response = 'API request returned with an empty list []. Please continue with a different question'
40
 
 
33
  # Extract assistant response
34
  if bot_reply !=[]:
35
  assistant_response = ""
36
+ if len(bot_reply)>1:
37
+ for reply in bot_reply[1:]:
38
+ assistant_response+=(" "+reply['text'])
39
+ else:
40
+ assistant_response = bot_reply[0]['text']
41
  else:
42
  assistant_response = 'API request returned with an empty list []. Please continue with a different question'
43