Langchain - Memory

Hi all,

If you are looking into implementing the langchain memory to mimic a chatbot in streamlit using openAI API, here is the code snippet that might help you.

you need to put st.cache_resource and put all the functions in a function call.

6 Likes

To anyone in the same boat, the decorator below also works:

@st.cache(allow_output_mutation=True)

1 Like