diff --git a/backend/src/controllers/documentController.ts b/backend/src/controllers/documentController.ts index f513615..280bc99 100644 --- a/backend/src/controllers/documentController.ts +++ b/backend/src/controllers/documentController.ts @@ -217,7 +217,7 @@ export const documentController = { document_id: documentId, user_id: userId, options: { - strategy: 'document_ai_agentic_rag', + strategy: config.processingStrategy || 'single_pass_quality_check', }, max_attempts: 3, }); @@ -451,19 +451,20 @@ export const documentController = { const { unifiedDocumentProcessor } = await import('../services/unifiedDocumentProcessor'); const processingStartTime = Date.now(); + const activeStrategy = config.processingStrategy || 'single_pass_quality_check'; logger.info('Calling unifiedDocumentProcessor.processDocument', { documentId, - strategy: 'document_ai_agentic_rag', + strategy: activeStrategy, fileSize: fileBuffer.length, correlationId }); - + const result = await unifiedDocumentProcessor.processDocument( documentId, userId, - '', // Text is not needed for this strategy - { - strategy: 'document_ai_agentic_rag', + '', // Text will be extracted from fileBuffer + { + strategy: activeStrategy, fileBuffer: fileBuffer, fileName: document.original_file_name, mimeType: 'application/pdf'