From c2d6d3230b0ed178d5cccc9cffe6a8edb73c1a29 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sat, 23 Mar 2024 20:50:57 -0700 Subject: [PATCH] refac: reset vector db --- src/lib/components/chat/Settings/Chats.svelte | 33 ------ .../documents/Settings/General.svelte | 100 +++++++++++++++++- 2 files changed, 99 insertions(+), 34 deletions(-) diff --git a/src/lib/components/chat/Settings/Chats.svelte b/src/lib/components/chat/Settings/Chats.svelte index ecaf587a4..191e64d35 100644 --- a/src/lib/components/chat/Settings/Chats.svelte +++ b/src/lib/components/chat/Settings/Chats.svelte @@ -2,7 +2,6 @@ import fileSaver from 'file-saver'; const { saveAs } = fileSaver; - import { resetVectorDB } from '$lib/apis/rag'; import { chats, user } from '$lib/stores'; import { @@ -330,38 +329,6 @@ {$i18n.t('Export All Chats (All Users)')} - -
- - {/if} diff --git a/src/lib/components/documents/Settings/General.svelte b/src/lib/components/documents/Settings/General.svelte index 3f8020e2a..f00038de4 100644 --- a/src/lib/components/documents/Settings/General.svelte +++ b/src/lib/components/documents/Settings/General.svelte @@ -5,8 +5,10 @@ updateRAGConfig, getQuerySettings, scanDocs, - updateQuerySettings + updateQuerySettings, + resetVectorDB } from '$lib/apis/rag'; + import { documents } from '$lib/stores'; import { onMount, getContext } from 'svelte'; import { toast } from 'svelte-sonner'; @@ -17,6 +19,8 @@ let loading = false; + let showResetConfirm = false; + let chunkSize = 0; let chunkOverlap = 0; let pdfExtractImages = true; @@ -231,6 +235,100 @@ /> + +
+ + {#if showResetConfirm} +
+
+ + + + + {$i18n.t('Are you sure?')} +
+ +
+ + +
+
+ {:else} + + {/if}