From f723f8d7293e432b5b67fe00d241151675ea7adf Mon Sep 17 00:00:00 2001 From: Stan Girard Date: Wed, 13 Dec 2023 20:58:01 +0100 Subject: [PATCH] feat: Add logging for brain vector creation --- backend/packages/files/parsers/common.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/packages/files/parsers/common.py b/backend/packages/files/parsers/common.py index 5a3e88c4d..7af422e74 100644 --- a/backend/packages/files/parsers/common.py +++ b/backend/packages/files/parsers/common.py @@ -1,11 +1,14 @@ import time +from logger import get_logger from models import File from models.settings import get_supabase_db from modules.brain.service.brain_vector_service import BrainVectorService from packages.embeddings.vectors import Neurons from repository.files.upload_file import DocumentSerializable +logger = get_logger(__name__) + async def process_file( file: File, @@ -39,9 +42,10 @@ async def process_file( brain_vector_service = BrainVectorService(brain_id) for created_vector_id in created_vector: - brain_vector_service.create_brain_vector( + result = brain_vector_service.create_brain_vector( created_vector_id, metadata["file_sha1"] ) + logger.debug(f"Brain vector created: {result}") database.set_file_sha_from_metadata(metadata["file_sha1"])