Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -288,8 +288,11 @@ class LangChainRAGSystem:
|
|
| 288 |
}
|
| 289 |
|
| 290 |
def reset_conversation(self):
|
| 291 |
-
"""Reset the conversation memory."""
|
| 292 |
self.memory.clear()
|
|
|
|
|
|
|
|
|
|
| 293 |
st.success("π Conversation history cleared!")
|
| 294 |
|
| 295 |
# Initialize the RAG system
|
|
@@ -325,6 +328,7 @@ def main():
|
|
| 325 |
|
| 326 |
if st.button("ποΈ Clear Conversation"):
|
| 327 |
rag_system.reset_conversation()
|
|
|
|
| 328 |
|
| 329 |
st.markdown("---")
|
| 330 |
st.subheader("π System Info")
|
|
|
|
| 288 |
}
|
| 289 |
|
| 290 |
def reset_conversation(self):
|
| 291 |
+
"""Reset the conversation memory and UI chat history."""
|
| 292 |
self.memory.clear()
|
| 293 |
+
# Also clear Streamlit session state messages
|
| 294 |
+
if "messages" in st.session_state:
|
| 295 |
+
st.session_state.messages = []
|
| 296 |
st.success("π Conversation history cleared!")
|
| 297 |
|
| 298 |
# Initialize the RAG system
|
|
|
|
| 328 |
|
| 329 |
if st.button("ποΈ Clear Conversation"):
|
| 330 |
rag_system.reset_conversation()
|
| 331 |
+
st.rerun() # Force UI refresh
|
| 332 |
|
| 333 |
st.markdown("---")
|
| 334 |
st.subheader("π System Info")
|