Update app.py
Browse files
app.py
CHANGED
|
@@ -42,6 +42,10 @@ with st.sidebar:
|
|
| 42 |
file_paths.append(file_path)
|
| 43 |
st.write(f"✅ Saved: {file.name}")
|
| 44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
# Chat interface
|
| 46 |
st.write("### Chat Interface")
|
| 47 |
|
|
@@ -54,7 +58,7 @@ llm_model = llm_option
|
|
| 54 |
|
| 55 |
if st.button("Retrieve and Answer"):
|
| 56 |
if user_input or uploaded_files:
|
| 57 |
-
answer = multimodelrag(user_input, file_paths, embeding, llm_model,conversation)
|
| 58 |
|
| 59 |
# Update conversation history
|
| 60 |
st.session_state.conversation_history.append(f"User: {user_input}")
|
|
@@ -66,5 +70,3 @@ if st.button("Retrieve and Answer"):
|
|
| 66 |
|
| 67 |
st.write("### Answer:")
|
| 68 |
st.write(answer)
|
| 69 |
-
|
| 70 |
-
|
|
|
|
| 42 |
file_paths.append(file_path)
|
| 43 |
st.write(f"✅ Saved: {file.name}")
|
| 44 |
|
| 45 |
+
# Clear conversation history if the user refreshes or starts a new session
|
| 46 |
+
if st.button("Clear Conversation History"):
|
| 47 |
+
st.session_state.conversation_history = [] # Reset history
|
| 48 |
+
|
| 49 |
# Chat interface
|
| 50 |
st.write("### Chat Interface")
|
| 51 |
|
|
|
|
| 58 |
|
| 59 |
if st.button("Retrieve and Answer"):
|
| 60 |
if user_input or uploaded_files:
|
| 61 |
+
answer = multimodelrag(user_input, file_paths, embeding, llm_model, conversation)
|
| 62 |
|
| 63 |
# Update conversation history
|
| 64 |
st.session_state.conversation_history.append(f"User: {user_input}")
|
|
|
|
| 70 |
|
| 71 |
st.write("### Answer:")
|
| 72 |
st.write(answer)
|
|
|
|
|
|