Fix a bug where langchain memories were not being cleaned (#71)

This commit is contained in:
zhulixi 2023-05-20 22:19:35 +08:00 committed by GitHub
parent 85eed9e2c2
commit 0d08e7707c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,6 +41,8 @@ def chat_with_doc(model, vector_store: SupabaseVectorStore, stats_db):
if clear_history:
# Clear memory in Langchain
memory.clear()
st.session_state['chat_history'] = []
st.experimental_rerun()