Summary
After a message is sent the assistant’s avatar becomes the default one instead of keeping that which had when the message was sent
Code snippet:
if "messages" not in st.session_state:
st.session_state.messages = []
for message in st.session_state.messages:
with st.chat_message(message["role"]):
st.markdown(message["content"])
if prompt := st.chat_input("Send a message"):
st.session_state.messages.append({"role": "user", "content": prompt})
with st.chat_message("user"):
st.markdown(prompt)
with st.chat_message("assistant",avatar='🌏'):
response = llm_chain.run(prompt)
st.markdown(response)
st.session_state.messages.append({"role": "assistant", "content": response,"avatar":'🌏'})
Expected behavior:
I believe the chat should be keeping the avatar assigned
Debug info
- Streamlit version: 1.25.0
- Python version: Python 3.8.0