As mentioned, I built something similar with python's streamlit chat + langchain + pdf loader. The memory for this application was made by adding it to streamlit session. Here is some of my code for the memory with streamlit chat:
with st.sidebar.form(key="message_form", clear_on_submit=True):
user_input = st.text_input("Type your message here...", value="", key="user_input")
submit_button = st.form_submit_button("Send")
if submit_button:
st.session_state.messages.append(HumanMessage(content=user_input))
with st.spinner("Thinking..."):
response = chat(st.session_state.messages)
st.session_state.messages.append(AIMessage(content=response.content))
If I wanted to use chatstream instead, how would I handle this?
As mentioned, I built something similar with python's streamlit chat + langchain + pdf loader. The memory for this application was made by adding it to streamlit session. Here is some of my code for the memory with streamlit chat:
If I wanted to use chatstream instead, how would I handle this?