Spaces:
Sleeping
Sleeping
Update document_chat.py
Browse files- document_chat.py +4 -2
document_chat.py
CHANGED
@@ -48,6 +48,8 @@ def process_query_with_memory(query, chat_memory):
|
|
48 |
retriever=retriever,
|
49 |
memory=chat_memory
|
50 |
)
|
51 |
-
chat_history = chat_memory.chat_memory.messages if chat_memory else []
|
52 |
|
53 |
-
|
|
|
|
|
|
|
|
48 |
retriever=retriever,
|
49 |
memory=chat_memory
|
50 |
)
|
|
|
51 |
|
52 |
+
# Fix: Properly load chat history
|
53 |
+
chat_history = chat_memory.load_memory_variables({}).get("chat_history", [])
|
54 |
+
|
55 |
+
return conversation_chain.run({"question": query, "chat_history": chat_history})
|