[Improvement] return all the metadata when citations flag is True (#1059)

Co-authored-by: Deven Patel <deven298@yahoo.com>
This commit is contained in:
Deven Patel
2023-12-29 14:48:41 +05:30
committed by GitHub
parent d9d529987e
commit 19d80914df
15 changed files with 47 additions and 56 deletions

View File

@@ -218,9 +218,7 @@ class OpenSearchDB(BaseVectorDB):
for doc in docs:
context = doc.page_content
if citations:
source = doc.metadata["url"]
doc_id = doc.metadata["doc_id"]
contexts.append(tuple((context, source, doc_id)))
contexts.append(tuple((context, doc.metadata)))
else:
contexts.append(context)
return contexts