Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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()
|