|
@@ -26,6 +26,7 @@
|
|
|
import ResetVectorDBConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
|
|
|
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
|
|
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
|
|
+ import Switch from '$lib/components/common/Switch.svelte';
|
|
|
|
|
|
const i18n = getContext('i18n');
|
|
|
|
|
@@ -535,13 +536,13 @@
|
|
|
<hr class=" dark:border-gray-850" />
|
|
|
|
|
|
<div class="">
|
|
|
- <div class="text-sm font-medium">{$i18n.t('Content Extraction')}</div>
|
|
|
+ <div class="text-sm font-medium mb-1">{$i18n.t('Content Extraction')}</div>
|
|
|
|
|
|
- <div class="flex w-full justify-between mt-2">
|
|
|
+ <div class="flex w-full justify-between">
|
|
|
<div class="self-center text-xs font-medium">{$i18n.t('Engine')}</div>
|
|
|
<div class="flex items-center relative">
|
|
|
<select
|
|
|
- class="dark:bg-gray-900 w-fit pr-8 rounded px-2 p-1 text-xs bg-transparent outline-none text-right"
|
|
|
+ class="dark:bg-gray-900 w-fit pr-8 rounded px-2 text-xs bg-transparent outline-none text-right"
|
|
|
bind:value={contentExtractionEngine}
|
|
|
on:change={(e) => {
|
|
|
showTikaServerUrl = e.target.value === 'tika';
|
|
@@ -554,7 +555,7 @@
|
|
|
</div>
|
|
|
|
|
|
{#if showTikaServerUrl}
|
|
|
- <div class="flex w-full mt-2">
|
|
|
+ <div class="flex w-full mt-1">
|
|
|
<div class="flex-1 mr-2">
|
|
|
<input
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-none"
|
|
@@ -568,69 +569,14 @@
|
|
|
|
|
|
<hr class=" dark:border-gray-850" />
|
|
|
|
|
|
- <div class="">
|
|
|
- <div class="text-sm font-medium">{$i18n.t('Files')}</div>
|
|
|
-
|
|
|
- <div class=" my-2 flex gap-1.5">
|
|
|
- <div class="w-full">
|
|
|
- <div class=" self-center text-xs font-medium min-w-fit mb-1">
|
|
|
- {$i18n.t('Max Upload Size')}
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="self-center">
|
|
|
- <Tooltip
|
|
|
- content={$i18n.t(
|
|
|
- 'The maximum file size in MB. If the file size exceeds this limit, the file will not be uploaded.'
|
|
|
- )}
|
|
|
- placement="top-start"
|
|
|
- >
|
|
|
- <input
|
|
|
- class="w-full rounded-lg py-1.5 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-none"
|
|
|
- type="number"
|
|
|
- placeholder={$i18n.t('Leave empty for unlimited')}
|
|
|
- bind:value={fileMaxSize}
|
|
|
- autocomplete="off"
|
|
|
- min="0"
|
|
|
- />
|
|
|
- </Tooltip>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class=" w-full">
|
|
|
- <div class="self-center text-xs font-medium min-w-fit mb-1">
|
|
|
- {$i18n.t('Max Upload Count')}
|
|
|
- </div>
|
|
|
- <div class="self-center">
|
|
|
- <Tooltip
|
|
|
- content={$i18n.t(
|
|
|
- 'The maximum number of files that can be used at once in chat. If the number of files exceeds this limit, the files will not be uploaded.'
|
|
|
- )}
|
|
|
- placement="top-start"
|
|
|
- >
|
|
|
- <input
|
|
|
- class=" w-full rounded-lg py-1.5 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-none"
|
|
|
- type="number"
|
|
|
- placeholder={$i18n.t('Leave empty for unlimited')}
|
|
|
- bind:value={fileMaxCount}
|
|
|
- autocomplete="off"
|
|
|
- min="0"
|
|
|
- />
|
|
|
- </Tooltip>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <hr class=" dark:border-gray-850" />
|
|
|
-
|
|
|
<div class=" ">
|
|
|
- <div class=" text-sm font-medium">{$i18n.t('Query Params')}</div>
|
|
|
+ <div class=" text-sm font-medium mb-1">{$i18n.t('Query Params')}</div>
|
|
|
|
|
|
- <div class=" flex gap-1">
|
|
|
- <div class=" flex w-full justify-between">
|
|
|
- <div class="self-center text-xs font-medium min-w-fit">{$i18n.t('Top K')}</div>
|
|
|
+ <div class=" flex gap-1.5">
|
|
|
+ <div class="flex flex-col w-full gap-1">
|
|
|
+ <div class=" text-xs font-medium w-full">{$i18n.t('Top K')}</div>
|
|
|
|
|
|
- <div class="self-center p-3">
|
|
|
+ <div class="w-full">
|
|
|
<input
|
|
|
class=" w-full rounded-lg py-1.5 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-none"
|
|
|
type="number"
|
|
@@ -643,12 +589,12 @@
|
|
|
</div>
|
|
|
|
|
|
{#if querySettings.hybrid === true}
|
|
|
- <div class=" flex w-full justify-between">
|
|
|
- <div class=" self-center text-xs font-medium min-w-fit">
|
|
|
+ <div class=" flex flex-col w-full gap-1">
|
|
|
+ <div class="text-xs font-medium w-full">
|
|
|
{$i18n.t('Minimum Score')}
|
|
|
</div>
|
|
|
|
|
|
- <div class="self-center p-3">
|
|
|
+ <div class="w-full">
|
|
|
<input
|
|
|
class=" w-full rounded-lg py-1.5 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-none"
|
|
|
type="number"
|
|
@@ -665,17 +611,15 @@
|
|
|
</div>
|
|
|
|
|
|
{#if querySettings.hybrid === true}
|
|
|
- <div class="mt-2 mb-1 text-xs text-gray-400 dark:text-gray-500">
|
|
|
+ <div class="mt-2 text-xs text-gray-400 dark:text-gray-500">
|
|
|
{$i18n.t(
|
|
|
'Note: If you set a minimum score, the search will only return documents with a score greater than or equal to the minimum score.'
|
|
|
)}
|
|
|
</div>
|
|
|
-
|
|
|
- <hr class=" dark:border-gray-850 my-3" />
|
|
|
{/if}
|
|
|
|
|
|
- <div>
|
|
|
- <div class=" mb-2.5 text-sm font-medium">{$i18n.t('RAG Template')}</div>
|
|
|
+ <div class="mt-2">
|
|
|
+ <div class=" mb-1 text-xs font-medium">{$i18n.t('RAG Template')}</div>
|
|
|
<Tooltip
|
|
|
content={$i18n.t('Leave empty to use the default prompt, or enter a custom prompt')}
|
|
|
placement="top-start"
|
|
@@ -693,9 +637,9 @@
|
|
|
<hr class=" dark:border-gray-850" />
|
|
|
|
|
|
<div class=" ">
|
|
|
- <div class=" text-sm font-medium">{$i18n.t('Chunk Params')}</div>
|
|
|
+ <div class="mb-1 text-sm font-medium">{$i18n.t('Chunk Params')}</div>
|
|
|
|
|
|
- <div class=" my-2 flex gap-1.5">
|
|
|
+ <div class=" flex gap-1.5">
|
|
|
<div class=" w-full justify-between">
|
|
|
<div class="self-center text-xs font-medium min-w-fit mb-1">{$i18n.t('Chunk Size')}</div>
|
|
|
<div class="self-center">
|
|
@@ -728,17 +672,68 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="my-3">
|
|
|
+ <div class="my-2">
|
|
|
<div class="flex justify-between items-center text-xs">
|
|
|
<div class=" text-xs font-medium">{$i18n.t('PDF Extract Images (OCR)')}</div>
|
|
|
|
|
|
- <button
|
|
|
- class=" text-xs font-medium text-gray-500"
|
|
|
- type="button"
|
|
|
- on:click={() => {
|
|
|
- pdfExtractImages = !pdfExtractImages;
|
|
|
- }}>{pdfExtractImages ? $i18n.t('On') : $i18n.t('Off')}</button
|
|
|
- >
|
|
|
+ <div>
|
|
|
+ <Switch bind:state={pdfExtractImages} />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <hr class=" dark:border-gray-850" />
|
|
|
+
|
|
|
+ <div class="">
|
|
|
+ <div class="text-sm font-medium mb-1">{$i18n.t('Files')}</div>
|
|
|
+
|
|
|
+ <div class=" flex gap-1.5">
|
|
|
+ <div class="w-full">
|
|
|
+ <div class=" self-center text-xs font-medium min-w-fit mb-1">
|
|
|
+ {$i18n.t('Max Upload Size')}
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="self-center">
|
|
|
+ <Tooltip
|
|
|
+ content={$i18n.t(
|
|
|
+ 'The maximum file size in MB. If the file size exceeds this limit, the file will not be uploaded.'
|
|
|
+ )}
|
|
|
+ placement="top-start"
|
|
|
+ >
|
|
|
+ <input
|
|
|
+ class="w-full rounded-lg py-1.5 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-none"
|
|
|
+ type="number"
|
|
|
+ placeholder={$i18n.t('Leave empty for unlimited')}
|
|
|
+ bind:value={fileMaxSize}
|
|
|
+ autocomplete="off"
|
|
|
+ min="0"
|
|
|
+ />
|
|
|
+ </Tooltip>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class=" w-full">
|
|
|
+ <div class="self-center text-xs font-medium min-w-fit mb-1">
|
|
|
+ {$i18n.t('Max Upload Count')}
|
|
|
+ </div>
|
|
|
+ <div class="self-center">
|
|
|
+ <Tooltip
|
|
|
+ content={$i18n.t(
|
|
|
+ 'The maximum number of files that can be used at once in chat. If the number of files exceeds this limit, the files will not be uploaded.'
|
|
|
+ )}
|
|
|
+ placement="top-start"
|
|
|
+ >
|
|
|
+ <input
|
|
|
+ class=" w-full rounded-lg py-1.5 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-none"
|
|
|
+ type="number"
|
|
|
+ placeholder={$i18n.t('Leave empty for unlimited')}
|
|
|
+ bind:value={fileMaxCount}
|
|
|
+ autocomplete="off"
|
|
|
+ min="0"
|
|
|
+ />
|
|
|
+ </Tooltip>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -794,7 +789,9 @@
|
|
|
/>
|
|
|
</svg>
|
|
|
</div>
|
|
|
- <div class=" self-center text-sm font-medium">{$i18n.t('Reset Vector Storage')}</div>
|
|
|
+ <div class=" self-center text-sm font-medium">
|
|
|
+ {$i18n.t('Reset Vector Storage/Knowledge')}
|
|
|
+ </div>
|
|
|
</button>
|
|
|
</div>
|
|
|
</div>
|