it seems like there is a bug with the new chat features where when I try to add buttons under chat input it just gets layered in a strange way
Steps to reproduce
Code snippet:
if prompt := st.chat_input("What would you like to know about this document?"):
## code
with col_9 :
rerun = st.button('Re-run',help="this button will delete your chat history and prompt you to create a new one")
if rerun:
st.session_state.history=[]
st.session_state.chat_his=[]
st.session_state.messages=[]
st.experimental_rerun()
Could you help to provide more information on what is the expected or desired output of the rerun, if it is to reset the app, could you try experimenting with unindenting the if rerun statements to be independent of the prompt statement.
Hey @dataprofessor Thank your for assistance
the expected output is having the buttons BELOW the text box
it works fine using third-party implementation st_chat
i have tried unindenting and itâs still always on top, no matter where I put it in the code
I had a need for buttons in a chat program. I decided to go with buttons in the sidebar instead of bottom of conversation area. ChatGPT Style Example SOTA
Hi, has anyone found a solution yet? I have a similar use case and I want to put a button below the st.chat_input widget.
st.chat_input(placeholder="Enter your message", key="user_message", on_submit=chat_input_callback)
st.markdown("***")
#!! Accept voice input
if st.button("Toggle mic input"):
if st.session_state.mic_toggle:
process_input_message(st.session_state.mic_prompt, insert_sample)
st.session_state.mic_prompt = ""
st.session_state.mic_toggle = not(st.session_state.mic_toggle)
# Show device list of microphones in streamlit
selected_mic = st.selectbox("Select device", sr.Microphone.list_microphone_names())
selected_mic_index = sr.Microphone.list_microphone_names().index(selected_mic)
As you can see in the code, the st.chat_input widget is called first and before the markdown and the âToggle mic inputâ button. However, this is how it looks like upon running:
hi @dataprofessor / Anyone , is their any help on how to place the buttonâs after the chat input, still on latest version 1.28.2 it is showing on the top.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking âAccept allâ, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
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.
Performance cookies
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.
Functional cookies
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.
Targeting cookies
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.