|
@@ -54,6 +54,8 @@
|
|
let documentIntelligenceEndpoint = '';
|
|
let documentIntelligenceEndpoint = '';
|
|
let documentIntelligenceKey = '';
|
|
let documentIntelligenceKey = '';
|
|
let showDocumentIntelligenceConfig = false;
|
|
let showDocumentIntelligenceConfig = false;
|
|
|
|
+ let mistralApiKey = '';
|
|
|
|
+ let showMistralOcrConfig = false;
|
|
|
|
|
|
let textSplitter = '';
|
|
let textSplitter = '';
|
|
let chunkSize = 0;
|
|
let chunkSize = 0;
|
|
@@ -189,6 +191,10 @@
|
|
toast.error($i18n.t('Document Intelligence endpoint and key required.'));
|
|
toast.error($i18n.t('Document Intelligence endpoint and key required.'));
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ if (contentExtractionEngine === 'mistral_ocr' && mistralApiKey === '') {
|
|
|
|
+ toast.error($i18n.t('Mistral OCR API Key required.'));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
|
|
if (!BYPASS_EMBEDDING_AND_RETRIEVAL) {
|
|
if (!BYPASS_EMBEDDING_AND_RETRIEVAL) {
|
|
await embeddingModelUpdateHandler();
|
|
await embeddingModelUpdateHandler();
|
|
@@ -220,6 +226,9 @@
|
|
document_intelligence_config: {
|
|
document_intelligence_config: {
|
|
key: documentIntelligenceKey,
|
|
key: documentIntelligenceKey,
|
|
endpoint: documentIntelligenceEndpoint
|
|
endpoint: documentIntelligenceEndpoint
|
|
|
|
+ },
|
|
|
|
+ mistral_ocr_config: {
|
|
|
|
+ api_key: mistralApiKey
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -284,6 +293,8 @@
|
|
documentIntelligenceEndpoint = res.content_extraction.document_intelligence_config.endpoint;
|
|
documentIntelligenceEndpoint = res.content_extraction.document_intelligence_config.endpoint;
|
|
documentIntelligenceKey = res.content_extraction.document_intelligence_config.key;
|
|
documentIntelligenceKey = res.content_extraction.document_intelligence_config.key;
|
|
showDocumentIntelligenceConfig = contentExtractionEngine === 'document_intelligence';
|
|
showDocumentIntelligenceConfig = contentExtractionEngine === 'document_intelligence';
|
|
|
|
+ mistralApiKey = res.content_extraction.mistral_ocr_config.api_key;
|
|
|
|
+ showMistralOcrConfig = contentExtractionEngine === 'mistral_ocr';
|
|
|
|
|
|
fileMaxSize = res?.file.max_size ?? '';
|
|
fileMaxSize = res?.file.max_size ?? '';
|
|
fileMaxCount = res?.file.max_count ?? '';
|
|
fileMaxCount = res?.file.max_count ?? '';
|
|
@@ -335,21 +346,21 @@
|
|
|
|
|
|
<hr class=" border-gray-100 dark:border-gray-850 my-2" />
|
|
<hr class=" border-gray-100 dark:border-gray-850 my-2" />
|
|
|
|
|
|
- <div class=" mb-2.5 flex flex-col w-full justify-between">
|
|
|
|
|
|
+ <div class="mb-2.5 flex flex-col w-full justify-between">
|
|
<div class="flex w-full justify-between">
|
|
<div class="flex w-full justify-between">
|
|
- <div class=" self-center text-xs font-medium">
|
|
|
|
|
|
+ <div class="self-center text-xs font-medium">
|
|
{$i18n.t('Content Extraction Engine')}
|
|
{$i18n.t('Content Extraction Engine')}
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
<div class="">
|
|
<div class="">
|
|
<select
|
|
<select
|
|
class="dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 text-xs bg-transparent outline-hidden text-right"
|
|
class="dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 text-xs bg-transparent outline-hidden text-right"
|
|
bind:value={contentExtractionEngine}
|
|
bind:value={contentExtractionEngine}
|
|
>
|
|
>
|
|
- <option value="">{$i18n.t('Default')} </option>
|
|
|
|
|
|
+ <option value="">{$i18n.t('Default')}</option>
|
|
<option value="tika">{$i18n.t('Tika')}</option>
|
|
<option value="tika">{$i18n.t('Tika')}</option>
|
|
<option value="docling">{$i18n.t('Docling')}</option>
|
|
<option value="docling">{$i18n.t('Docling')}</option>
|
|
<option value="document_intelligence">{$i18n.t('Document Intelligence')}</option>
|
|
<option value="document_intelligence">{$i18n.t('Document Intelligence')}</option>
|
|
|
|
+ <option value="mistral_ocr">{$i18n.t('Mistral OCR')}</option>
|
|
</select>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -378,12 +389,18 @@
|
|
placeholder={$i18n.t('Enter Document Intelligence Endpoint')}
|
|
placeholder={$i18n.t('Enter Document Intelligence Endpoint')}
|
|
bind:value={documentIntelligenceEndpoint}
|
|
bind:value={documentIntelligenceEndpoint}
|
|
/>
|
|
/>
|
|
-
|
|
|
|
<SensitiveInput
|
|
<SensitiveInput
|
|
placeholder={$i18n.t('Enter Document Intelligence Key')}
|
|
placeholder={$i18n.t('Enter Document Intelligence Key')}
|
|
bind:value={documentIntelligenceKey}
|
|
bind:value={documentIntelligenceKey}
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
+ {:else if contentExtractionEngine === 'mistral_ocr'}
|
|
|
|
+ <div class="my-0.5 flex gap-2 pr-2">
|
|
|
|
+ <SensitiveInput
|
|
|
|
+ placeholder={$i18n.t('Enter Mistral API Key')}
|
|
|
|
+ bind:value={mistralApiKey}
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
{/if}
|
|
{/if}
|
|
</div>
|
|
</div>
|
|
|
|
|