Hi.
Is there an option to use a different emoji for default st chat emojis?
(the ones on the left of the UI, not the avatars you can concatenate to a message)
Hi.
Is there an option to use a different emoji for default st chat emojis?
(the ones on the left of the UI, not the avatars you can concatenate to a message)
You can pass an avatar argument
import streamlit as st
st.chat_message("user", avatar="😂").write("Hello")
st.chat_message("user", avatar="👩🎤").write("Hi!")
st.chat_message("user", avatar="👩🎨").write("Hey!")
Hello!,
You can use the avatar parameter in st.chat_message to change the avatar of the chat
import streamlit as st
with st.chat_message('Momos', avatar="🤖"):
st.write('Hello there!')
with st.chat_message('Me', avatar="🦖"):
st.write("Hi!")

You can also add your own image by using st.image:
with st.chat_message('Momos', avatar=st.image('path_to_image'):
st.write('Hello there!')
For changing avatars in chat input, simply use chat_message instead of st.write
prompt = st.chat_input('Enter your prompt!')
if prompt:
with st.chat_message('Momos', avatar="🤖"):
st.write('Hello again... again!')
Cheers,
Moiz
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.