Skip to content
Snippets Groups Projects
Unverified Commit f4858808 authored by ilya shusterman's avatar ilya shusterman Committed by GitHub
Browse files

[+] Added document metadata to the summary node dictionary. (#11671)

parent 8f74286d
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ the summary to the underlying Nodes.
This summary can be used for retrieval.
"""
import logging
from collections import defaultdict
from enum import Enum
......@@ -199,11 +200,13 @@ class DocumentSummaryIndex(BaseIndex[IndexDocumentSummary]):
nodes=nodes_with_scores,
)
summary_response = cast(Response, summary_response)
metadata = doc_id_to_nodes.get(doc_id, [TextNode()])[0].metadata
summary_node_dict[doc_id] = TextNode(
text=summary_response.response,
relationships={
NodeRelationship.SOURCE: RelatedNodeInfo(node_id=doc_id)
},
metadata=metadata,
)
self.docstore.add_documents([summary_node_dict[doc_id]])
logger.info(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment