I am creating a multipage chatbot application using streamlit.
Each page is a separate chatbot referring a separate vector database. However, when navigating between the pages, the chats do not refresh between each page and the conversation continues from the context of the previous page.
I would like to perform the following function if the page is changed to reset the session state of the chat.
if "messages" not in st.session_state.keys(): # Initialize the chat messages history
st.session_state.messages = [
{"role": "assistant", "content": "Ask me a question!"}
]
Is there any way to do this? Thanks.