JirasakJo commited on
Commit
a744d7e
·
verified ·
1 Parent(s): 9beef51

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
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
- assistant_answer = result["answer"]
 
 
 
 
 
255
 
256
  # Update chat history and context
257
- st.session_state.chat_history.append(("assistant", assistant_answer))
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