Make save_data_item_with_metadata_to_storage async
This commit is contained in:
parent
5b5c1ea5c6
commit
9e93ea0794
1 changed files with 2 additions and 2 deletions
|
|
@ -4,12 +4,12 @@ from cognee.modules.ingestion import save_data_to_file
|
||||||
from cognee.modules.ingestion.operations.write_metadata import write_metadata
|
from cognee.modules.ingestion.operations.write_metadata import write_metadata
|
||||||
|
|
||||||
|
|
||||||
def save_data_item_with_metadata_to_storage(
|
async def save_data_item_with_metadata_to_storage(
|
||||||
data_item: Union[BinaryIO, str, Any], dataset_name: str
|
data_item: Union[BinaryIO, str, Any], dataset_name: str
|
||||||
) -> str:
|
) -> str:
|
||||||
# Dynamic import is used because the llama_index module is optional.
|
# Dynamic import is used because the llama_index module is optional.
|
||||||
# For the same reason Any is accepted as a data item
|
# For the same reason Any is accepted as a data item
|
||||||
metadata_id = write_metadata(data_item)
|
metadata_id = await write_metadata(data_item)
|
||||||
|
|
||||||
# Check if data is of type Document or any of it's subclasses
|
# Check if data is of type Document or any of it's subclasses
|
||||||
if str(type(data_item)).startswith("llama_index"):
|
if str(type(data_item)).startswith("llama_index"):
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue