diff --git a/llama-index-core/llama_index/core/base/base_retriever.py b/llama-index-core/llama_index/core/base/base_retriever.py index c0fb721d3ae0afdc6bb3e55cbee3c9f29988e326..f47f7a9abde567e44c23c88cbcc0c806500e3801 100644 --- a/llama-index-core/llama_index/core/base/base_retriever.py +++ b/llama-index-core/llama_index/core/base/base_retriever.py @@ -149,7 +149,7 @@ class BaseRetriever(ChainableMixin, PromptMixin): node = n.node score = n.score or 1.0 if isinstance(node, IndexNode): - obj = self.object_map.get(node.index_id, None) + obj = node.obj or self.object_map.get(node.index_id, None) if obj is not None: if self._verbose: print_text( @@ -181,7 +181,7 @@ class BaseRetriever(ChainableMixin, PromptMixin): node = n.node score = n.score or 1.0 if isinstance(node, IndexNode): - obj = self.object_map.get(node.index_id, None) + obj = node.obj or self.object_map.get(node.index_id, None) if obj is not None: if self._verbose: print_text( diff --git a/llama-index-core/llama_index/core/schema.py b/llama-index-core/llama_index/core/schema.py index 4ecda5b9475b9d212b7f4c088f43e6ace919f57a..3c49022d180e2a0a4e8647570d6459ae8fc161d1 100644 --- a/llama-index-core/llama_index/core/schema.py +++ b/llama-index-core/llama_index/core/schema.py @@ -541,6 +541,7 @@ class IndexNode(TextNode): obj = data.get("obj", None) parsed_obj = None + if isinstance(obj, str): parsed_obj = TextNode(text=obj) elif isinstance(obj, dict): diff --git a/llama-index-core/llama_index/core/storage/docstore/utils.py b/llama-index-core/llama_index/core/storage/docstore/utils.py index f53c8735d34d3145f22009dbfc5964d3290f2ef9..a95e9d44c8744645753858456cd5304c1ad7c89d 100644 --- a/llama-index-core/llama_index/core/storage/docstore/utils.py +++ b/llama-index-core/llama_index/core/storage/docstore/utils.py @@ -27,15 +27,15 @@ def json_to_doc(doc_dict: dict) -> BaseNode: return legacy_json_to_doc(doc_dict) else: if doc_type == Document.get_type(): - doc = Document.parse_obj(data_dict) + doc = Document.from_dict(data_dict) elif doc_type == ImageDocument.get_type(): - doc = ImageDocument.parse_obj(data_dict) + doc = ImageDocument.from_dict(data_dict) elif doc_type == TextNode.get_type(): - doc = TextNode.parse_obj(data_dict) + doc = TextNode.from_dict(data_dict) elif doc_type == ImageNode.get_type(): - doc = ImageNode.parse_obj(data_dict) + doc = ImageNode.from_dict(data_dict) elif doc_type == IndexNode.get_type(): - doc = IndexNode.parse_obj(data_dict) + doc = IndexNode.from_dict(data_dict) else: raise ValueError(f"Unknown doc type: {doc_type}") diff --git a/pyproject.toml b/pyproject.toml index cbbd67b04ee4613ba807de2d50048ed2df1717e6..ffdce47d78d71608f5692f37fbe7e0b06d17f76e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ name = "llama-index" packages = [{from = "_llama-index", include = "llama_index"}] readme = "README.md" repository = "https://github.com/run-llama/llama_index" -version = "0.10.6" +version = "0.10.6.post1" [tool.poetry.dependencies] python = ">=3.8.1,<4.0"