From 74cc1b44aea66fa3362f72a2d0e6fd33f4d76b61 Mon Sep 17 00:00:00 2001 From: emrgnt-cmplxty Date: Fri, 10 Jan 2025 16:35:29 -0800 Subject: [PATCH] upsert document info infront of hatchet --- py/core/main/api/v3/documents_router.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/py/core/main/api/v3/documents_router.py b/py/core/main/api/v3/documents_router.py index b0810541e..f879d361c 100644 --- a/py/core/main/api/v3/documents_router.py +++ b/py/core/main/api/v3/documents_router.py @@ -431,8 +431,6 @@ async def create_document( ), } - # TODO - Modify create_chunks so that we can add chunks to existing document - if run_with_orchestration: # Run ingestion with orchestration raw_message = ( @@ -537,6 +535,21 @@ async def create_document( ) if run_with_orchestration: + # TODO - Modify create_chunks so that we can add chunks to existing document + document_info = ( + self.services.ingestion._create_document_info_from_file( + document_id, + auth_user, + file_name, + workflow_input["metadata"], + "v0", + workflow_input["size_in_bytes"], + ) + ) + await self.providers.database.documents_handler.upsert_documents_overview( + document_info + ) + raw_message: dict[str, str | None] = await self.providers.orchestration.run_workflow( # type: ignore "ingest-files", {"request": workflow_input},