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.
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.