Replies: 2 comments 1 reply
-
🤖 Hello @aiwalter, Good to see you again! I hope you're doing well. The behavior you're observing is due to the way the The numbering of source nodes is determined in the Here is the relevant code: def _create_citation_nodes(self, nodes: List[NodeWithScore]) -> List[NodeWithScore]:
"""Modify retrieved nodes to be granular sources."""
new_nodes: List[NodeWithScore] = []
for node in nodes:
text_chunks = self.text_splitter.split_text(
node.node.get_content(metadata_mode=self._metadata_mode)
)
for text_chunk in text_chunks:
text = f"Source {len(new_nodes)+1}:\n{text_chunk}\n"
new_node = NodeWithScore(
node=TextNode.parse_obj(node.node), score=node.score
)
new_node.node.text = text
new_nodes.append(new_node)
return new_nodes In this code, The default value for I hope this helps! Let me know if you have any other questions. Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
got it resolved |
Beta Was this translation helpful? Give feedback.
-
Now I am getting some times the issue that it is citing nodes with a greater number than the nodes that are actually in the reponse,
e.g. if
len(response.source_nodes)
is5
, I am getting sometimes still references with e.g.6
or7
like this:To me this seems to be wrong? Or how can I know what the source nodes
6
and7
are? How is the numbering done here? is it just that e.g.[1]
isresponse.source_nodes[0]
?Beta Was this translation helpful? Give feedback.
All reactions