How do i put buttons under st chat input in streamlit?

Summary

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()

Hi @tarek-kerbedj

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

@dataprofessor,

Has this issue been resolved? I’m experiencing a similar problem as well.
I need to place buttons below the prompt.

1 Like

The issue still persists.
The feature to add more buttons to the chat_input would solve both my and @tarek-kerbedj 's problem

1 Like