Summary
Add a “history_list” variable to webui_pages/dialogue/dialogue.py in the Langchain-Chatchat repository and on clicking the button at “col[1]” clear its value.
Steps to reproduce
Code snippet:
...
# outside the function
if 'history_list' not in st.session_state:
st.session_state['history_list'] = []
...
# add something to history_list[]
...
#
# The last few lines in the dialogue.py code in the function dialogue_page():
with st.sidebar:
cols = st.columns(2)
export_btn = cols[0]
if cols[1].button(
"清空对话",
use_container_width=True,
):
chat_box.reset_history()
st.experimental_rerun()
st.session_state['history_list'] = []
If applicable, please provide the steps we should take to reproduce the error or specified behavior.
Expected behavior:
When I click on this button, the “history_list” should be cleared out.
Actual behavior:
st.session_state['history_list'] = []
didn’t work
Requirements file
Consistent with the environment in this repository
Additional information
I’m deploying it to a LAN for multiple people to use, will introducing this variable affect the asynchrony?