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;