Update app.py
Browse files
app.py
CHANGED
@@ -251,10 +251,15 @@ def handle_submit(user_query: str):
|
|
251 |
|
252 |
# Process query
|
253 |
result = st.session_state.pipeline.process_query(query_with_context)
|
254 |
-
|
|
|
|
|
|
|
|
|
|
|
255 |
|
256 |
# Update chat history and context
|
257 |
-
st.session_state.chat_history.append(("assistant",
|
258 |
st.session_state.context_memory.append({"query": user_query, "answer": assistant_answer})
|
259 |
|
260 |
# Save to QA history
|
|
|
251 |
|
252 |
# Process query
|
253 |
result = st.session_state.pipeline.process_query(query_with_context)
|
254 |
+
|
255 |
+
# Create response dictionary with answer and documents
|
256 |
+
response_dict = {
|
257 |
+
"answer": result.get("answer", ""),
|
258 |
+
"documents": result.get("documents", [])
|
259 |
+
}
|
260 |
|
261 |
# Update chat history and context
|
262 |
+
st.session_state.chat_history.append(("assistant", response_dict))
|
263 |
st.session_state.context_memory.append({"query": user_query, "answer": assistant_answer})
|
264 |
|
265 |
# Save to QA history
|