cognee/cognee/modules/ingestion/identify.py
Igor Ilic cc6fbe2a5f refactor: Add space to ingest function
Add space and newline to ingest function

Refactor COG-505
2024-12-06 13:48:39 +01:00

11 lines
346 B
Python

from uuid import uuid5, NAMESPACE_OID
from .data_types import IngestionData
from cognee.modules.users.models import User
def identify(data: IngestionData, user: User) -> str:
data_content_hash: str = data.get_identifier()
# return UUID hash of file contents + owner id
return uuid5(NAMESPACE_OID, f"{data_content_hash}{user.id}")