Skip to content

Commit

Permalink
[+] Added document metadata to the summary node dictionary. (#11671)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyashusterman authored Mar 6, 2024
1 parent 8f74286 commit f485880
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
This summary can be used for retrieval.
"""

import logging
from collections import defaultdict
from enum import Enum
Expand Down Expand Up @@ -199,11 +200,13 @@ def _add_nodes_to_index(
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(
Expand Down

0 comments on commit f485880

Please sign in to comment.