From 428a943644b7ef598f76e7478b9810562e19f3a8 Mon Sep 17 00:00:00 2001 From: silentoplayz Date: Fri, 23 Jan 2026 10:53:06 -0500 Subject: [PATCH] feat: add default upload mode setting Add user setting to configure the default upload mode for files, allowing users to choose between "Using Entire Document" (full context) and "Using Focused Retrieval" (RAG processing) as the default behavior. --- .../components/chat/Settings/Interface.svelte | 29 +++++++++++++++++++ .../components/common/FileItemModal.svelte | 3 ++ src/lib/i18n/locales/en-US/translation.json | 1 + src/lib/stores/index.ts | 2 ++ 4 files changed, 35 insertions(+) diff --git a/src/lib/components/chat/Settings/Interface.svelte b/src/lib/components/chat/Settings/Interface.svelte index 14b84aab58..2123968324 100644 --- a/src/lib/components/chat/Settings/Interface.svelte +++ b/src/lib/components/chat/Settings/Interface.svelte @@ -88,6 +88,9 @@ let showUpdateToast = true; let showChangelog = true; + // File + let defaultUploadContext: 'full' | 'focused' = 'focused'; + let showEmojiInCall = false; let voiceInterruption = false; let hapticFeedback = false; @@ -269,6 +272,8 @@ webSearch = $settings?.webSearch ?? null; textScale = $settings?.textScale ?? null; + + defaultUploadContext = $settings?.defaultUploadContext ?? 'focused'; }); @@ -1278,6 +1283,30 @@
{$i18n.t('File')}
+
+
+
+ {$i18n.t('Default Upload Mode')} +
+ + +
+
+
diff --git a/src/lib/components/common/FileItemModal.svelte b/src/lib/components/common/FileItemModal.svelte index 7db775865e..22aa8b7635 100644 --- a/src/lib/components/common/FileItemModal.svelte +++ b/src/lib/components/common/FileItemModal.svelte @@ -5,6 +5,7 @@ import { formatFileSize, getLineCount } from '$lib/utils'; import { WEBUI_API_BASE_URL } from '$lib/constants'; + import { settings } from '$lib/stores'; import { getKnowledgeById } from '$lib/apis/knowledge'; import { getFileById, getFileContentById } from '$lib/apis/files'; @@ -174,6 +175,8 @@ console.log(item); if (item?.context === 'full') { enableFullContent = true; + } else if (item?.context === undefined && $settings?.defaultUploadContext === 'full') { + enableFullContent = true; } }); diff --git a/src/lib/i18n/locales/en-US/translation.json b/src/lib/i18n/locales/en-US/translation.json index 96644f5d0f..b910419cfa 100644 --- a/src/lib/i18n/locales/en-US/translation.json +++ b/src/lib/i18n/locales/en-US/translation.json @@ -411,6 +411,7 @@ "Decrease UI Scale": "", "Deepgram": "", "Default": "", + "Default Upload Mode": "", "Default (Open AI)": "", "Default (SentenceTransformers)": "", "Default action buttons will be used.": "", diff --git a/src/lib/stores/index.ts b/src/lib/stores/index.ts index 5475480194..22f4f82ef3 100644 --- a/src/lib/stores/index.ts +++ b/src/lib/stores/index.ts @@ -204,6 +204,8 @@ type Settings = { chatDirection?: 'LTR' | 'RTL' | 'auto'; ctrlEnterToSend?: boolean; + defaultUploadContext?: 'full' | 'focused'; + system?: string; seed?: number; temperature?: string;