Spaces:
Running
Running
more constraints on the memory
Browse files
document_qa/document_qa_engine.py
CHANGED
|
@@ -169,7 +169,9 @@ class DocumentQAEngine:
|
|
| 169 |
relevant_documents = retriever.get_relevant_documents(query)
|
| 170 |
if self.memory and len(self.memory.buffer_as_messages) > 0:
|
| 171 |
relevant_documents.append(
|
| 172 |
-
Document(
|
|
|
|
|
|
|
| 173 |
)
|
| 174 |
return relevant_documents
|
| 175 |
|
|
|
|
| 169 |
relevant_documents = retriever.get_relevant_documents(query)
|
| 170 |
if self.memory and len(self.memory.buffer_as_messages) > 0:
|
| 171 |
relevant_documents.append(
|
| 172 |
+
Document(
|
| 173 |
+
page_content="""Following, the previous question and answers. Use these information only when in the question there are unspecified references:\n{}\n\n""".format(
|
| 174 |
+
self.memory.buffer_as_str))
|
| 175 |
)
|
| 176 |
return relevant_documents
|
| 177 |
|