Streamlit is an open-source Python library that makes it easy to create and share beautiful, custom web apps for machine learning and data science.This notebook goes over how to store and use chat message history in a
Streamlit app. StreamlitChatMessageHistory will store messages in
Streamlit session state
at the specified key=. The default key is "langchain_messages".
- Note,
StreamlitChatMessageHistoryonly works when run in a Streamlit app. - You may also be interested in StreamlitCallbackHandler for LangChain.
- For more on Streamlit check out their getting started documentation.
langchain-community package, so we need to install that. We also need to install streamlit.
StreamlitChatMessageHistory will NOT be persisted or shared across user sessions.
StreamlitChatMessageHistory.messages: