Spaces:
Sleeping
Sleeping
[email protected]
commited on
Commit
·
b2f6734
1
Parent(s):
e496d26
feat: Add button to clear message history in chatbot
Browse files- pages/chatbot.py +4 -0
pages/chatbot.py
CHANGED
@@ -124,6 +124,10 @@ def page():
|
|
124 |
# Models selector
|
125 |
selector.ModelSelector()
|
126 |
|
|
|
|
|
|
|
|
|
127 |
# Displaying messages
|
128 |
display_messages()
|
129 |
|
|
|
124 |
# Models selector
|
125 |
selector.ModelSelector()
|
126 |
|
127 |
+
if(len(st.session_state[chapter_session_key]["messages"]) > 1):
|
128 |
+
if st.button("Effacer l'historique"):
|
129 |
+
st.session_state[chapter_session_key]["messages"] = [ SystemMessage(content=chapterDB['prompt_system']) ]
|
130 |
+
|
131 |
# Displaying messages
|
132 |
display_messages()
|
133 |
|