From 935b14e4bfb0ae5a4d286650274dde07dc6867d6 Mon Sep 17 00:00:00 2001 From: arvinChen <40080081+minmie@users.noreply.github.com> Date: Sat, 11 Jan 2025 04:23:25 +0800 Subject: [PATCH] bugfix: Duplicated citation nodes (#17440) --- .../llama_index/core/query_engine/citation_query_engine.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llama-index-core/llama_index/core/query_engine/citation_query_engine.py b/llama-index-core/llama_index/core/query_engine/citation_query_engine.py index 5209e53dc2931..c4c7ba160d44c 100644 --- a/llama-index-core/llama_index/core/query_engine/citation_query_engine.py +++ b/llama-index-core/llama_index/core/query_engine/citation_query_engine.py @@ -217,7 +217,8 @@ def _create_citation_nodes(self, nodes: List[NodeWithScore]) -> List[NodeWithSco text = f"Source {len(new_nodes) + 1}:\n{text_chunk}\n" new_node = NodeWithScore( - node=TextNode.model_validate(node.node), score=node.score + node=TextNode.model_validate(node.node.model_dump()), + score=node.score, ) new_node.node.set_content(text) new_nodes.append(new_node)