From 437804a2f8bc94527aa06f41581b49d110e86526 Mon Sep 17 00:00:00 2001 From: Athanasios Oikonomou Date: Sat, 3 May 2025 08:12:58 +0300 Subject: [PATCH] fix: update validation logic for Docling OCR engine and language requirements Both Docling OCR Engine and Language(s) must be provided or both left empty. --- src/lib/components/admin/Settings/Documents.svelte | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lib/components/admin/Settings/Documents.svelte b/src/lib/components/admin/Settings/Documents.svelte index fcc5afe44..ed314e658 100644 --- a/src/lib/components/admin/Settings/Documents.svelte +++ b/src/lib/components/admin/Settings/Documents.svelte @@ -161,11 +161,10 @@ toast.error($i18n.t('Docling Server URL required.')); return; } - if ( - RAGConfig.CONTENT_EXTRACTION_ENGINE === 'docling' && - (RAGConfig.DOCLING_OCR_ENGINE !== '' || RAGConfig.DOCLING_OCR_LANG !== '') - ) { - toast.error($i18n.t('Docling OCR Engine and Language(s) required.')); + if (RAGConfig.CONTENT_EXTRACTION_ENGINE === 'docling' && + ((RAGConfig.DOCLING_OCR_ENGINE === '' && RAGConfig.DOCLING_OCR_LANG !== '') || + (RAGConfig.DOCLING_OCR_ENGINE !== '' && RAGConfig.DOCLING_OCR_LANG === ''))) { + toast.error($i18n.t('Both Docling OCR Engine and Language(s) must be provided or both left empty.')); return; }