arnaudmiribel / streamlit-extras

Discover, try, install and share Streamlit re-usable bits we call "extras"!
https://extras.streamlit.app
Apache License 2.0
669 stars 117 forks source link

✨ [IDEA] - Stateful chat support for expanders, buttons, etc. #206

Closed Vlassie closed 5 months ago

Vlassie commented 7 months ago

Description

I would love to be able to add expanders, buttons or other interactable elements to stateful chat. This could, for example, make answers from a chatbot more customizable. One example would be the ability for a RAG application to return its sources in an expander, such that the sources aren't simply added to the answer text.

arnaudmiribel commented 5 months ago

Hey @Vlassie, have you checked out the native st.chat_input and st.chat_message? That should work well with them!

LukasMasuch commented 5 months ago

For interactivity inside chat messages, using st.chat_message and st.chat_input directly is the best way to got 👍 Making that stateful in a generic way is quite complicated.