From fcd067b96091fd6ea9f6a232701e9902087c6cff Mon Sep 17 00:00:00 2001 From: abhishek-git Date: Wed, 9 Oct 2024 19:24:55 +0530 Subject: [PATCH] Update base.py Empty nodes list trying to fetch all nodes from get_llama_nodes method --- .../core/indices/property_graph/sub_retrievers/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llama-index-core/llama_index/core/indices/property_graph/sub_retrievers/base.py b/llama-index-core/llama_index/core/indices/property_graph/sub_retrievers/base.py index 68168c6f699ce..b215709693891 100644 --- a/llama-index-core/llama_index/core/indices/property_graph/sub_retrievers/base.py +++ b/llama-index-core/llama_index/core/indices/property_graph/sub_retrievers/base.py @@ -140,13 +140,13 @@ async def async_add_source_text( def _retrieve(self, query_bundle: QueryBundle) -> List[NodeWithScore]: nodes = self.retrieve_from_graph(query_bundle) - if self.include_text: + if self.include_text and nodes: nodes = self.add_source_text(nodes) return nodes async def _aretrieve(self, query_bundle: QueryBundle) -> List[NodeWithScore]: nodes = await self.aretrieve_from_graph(query_bundle) - if self.include_text: + if self.include_text and nodes: nodes = await self.async_add_source_text(nodes) return nodes