From ceebcdb2517d6da4915dbad3e696598a27495cc7 Mon Sep 17 00:00:00 2001 From: Igor Ilic Date: Wed, 4 Dec 2024 11:29:27 +0100 Subject: [PATCH] fix: Resolve issue with llama index type resolution Resolve issue with llama index type resolution Fix --- .../ingestion/save_data_item_with_metadata_to_storage.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cognee/tasks/ingestion/save_data_item_with_metadata_to_storage.py b/cognee/tasks/ingestion/save_data_item_with_metadata_to_storage.py index ef1ce4ec1..d758ebcd1 100644 --- a/cognee/tasks/ingestion/save_data_item_with_metadata_to_storage.py +++ b/cognee/tasks/ingestion/save_data_item_with_metadata_to_storage.py @@ -7,10 +7,9 @@ from cognee.modules.ingestion import save_data_to_file async def save_data_item_with_metadata_to_storage( data_item: Union[BinaryIO, str, Any], dataset_name: str ) -> str: - # Dynamic import is used because the llama_index module is optional. - # For the same reason Any is accepted as a data item - # Check if data is of type Document or any of it's subclasses - if str(type(data_item)).startswith("llama_index"): + + if "llama_index" in str(type(data_item)): + # Dynamic import is used because the llama_index module is optional. from .transform_data import get_data_from_llama_index file_path = get_data_from_llama_index(data_item, dataset_name)