|
@@ -13,17 +13,16 @@
|
|
updateEmbeddingConfig,
|
|
updateEmbeddingConfig,
|
|
getRerankingConfig,
|
|
getRerankingConfig,
|
|
updateRerankingConfig,
|
|
updateRerankingConfig,
|
|
- resetUploadDir,
|
|
|
|
getRAGConfig,
|
|
getRAGConfig,
|
|
updateRAGConfig
|
|
updateRAGConfig
|
|
} from '$lib/apis/retrieval';
|
|
} from '$lib/apis/retrieval';
|
|
|
|
|
|
- import { knowledge, models } from '$lib/stores';
|
|
|
|
- import { getKnowledgeBases } from '$lib/apis/knowledge';
|
|
|
|
- import { uploadDir, deleteAllFiles, deleteFileById } from '$lib/apis/files';
|
|
|
|
|
|
+ import { reindexKnowledgeFiles} from '$lib/apis/knowledge';
|
|
|
|
+ import { deleteAllFiles } from '$lib/apis/files';
|
|
|
|
|
|
import ResetUploadDirConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
|
|
import ResetUploadDirConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
|
|
import ResetVectorDBConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
|
|
import ResetVectorDBConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
|
|
|
|
+ import ReindexKnowledgeFilesConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
|
|
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
|
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
|
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
|
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
|
import Switch from '$lib/components/common/Switch.svelte';
|
|
import Switch from '$lib/components/common/Switch.svelte';
|
|
@@ -31,12 +30,12 @@
|
|
|
|
|
|
const i18n = getContext('i18n');
|
|
const i18n = getContext('i18n');
|
|
|
|
|
|
- let scanDirLoading = false;
|
|
|
|
let updateEmbeddingModelLoading = false;
|
|
let updateEmbeddingModelLoading = false;
|
|
let updateRerankingModelLoading = false;
|
|
let updateRerankingModelLoading = false;
|
|
|
|
|
|
let showResetConfirm = false;
|
|
let showResetConfirm = false;
|
|
let showResetUploadDirConfirm = false;
|
|
let showResetUploadDirConfirm = false;
|
|
|
|
+ let showReindexConfirm = false;
|
|
|
|
|
|
let embeddingEngine = '';
|
|
let embeddingEngine = '';
|
|
let embeddingModel = '';
|
|
let embeddingModel = '';
|
|
@@ -333,6 +332,21 @@
|
|
}}
|
|
}}
|
|
/>
|
|
/>
|
|
|
|
|
|
|
|
+
|
|
|
|
+<ReindexKnowledgeFilesConfirmDialog
|
|
|
|
+ bind:show={showReindexConfirm}
|
|
|
|
+ on:confirm={async () => {
|
|
|
|
+ const res = await reindexKnowledgeFiles(localStorage.token).catch((error) => {
|
|
|
|
+ toast.error(`${error}`);
|
|
|
|
+ return null;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ if (res) {
|
|
|
|
+ toast.success($i18n.t('Success'));
|
|
|
|
+ }
|
|
|
|
+ }}
|
|
|
|
+/>
|
|
|
|
+
|
|
<form
|
|
<form
|
|
class="flex flex-col h-full justify-between space-y-3 text-sm"
|
|
class="flex flex-col h-full justify-between space-y-3 text-sm"
|
|
on:submit|preventDefault={() => {
|
|
on:submit|preventDefault={() => {
|
|
@@ -950,6 +964,21 @@
|
|
</button>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class=" mb-2.5 flex w-full justify-between">
|
|
|
|
+ <div class=" self-center text-xs font-medium">
|
|
|
|
+ {$i18n.t('Reindex Knowledge Base Vectors')}
|
|
|
|
+ </div>
|
|
|
|
+ <div class="flex items-center relative">
|
|
|
|
+ <button
|
|
|
|
+ class="text-xs"
|
|
|
|
+ on:click={() => {
|
|
|
|
+ showReindexConfirm = true;
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ {$i18n.t('Reindex')}
|
|
|
|
+ </button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|