GGLS commited on
Commit
f6048e2
·
verified ·
1 Parent(s): 10bdb20

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -112,7 +112,7 @@ if prompt := st.chat_input("Do androids dream of electric sheep?"):
112
  st.write(prompt)
113
 
114
  # Generate a new response if last message is not from assistant
115
- if st.session_state.messages[-1]["role"] != "assistant":
116
  with st.chat_message("assistant"):
117
  with st.spinner("Thinking..."):
118
  response = generate_fusechat_response()
 
112
  st.write(prompt)
113
 
114
  # Generate a new response if last message is not from assistant
115
+ if len(st.session_state.messages) > 0 and st.session_state.messages[-1]["role"] != "assistant":
116
  with st.chat_message("assistant"):
117
  with st.spinner("Thinking..."):
118
  response = generate_fusechat_response()