Timothy Jaeryang Baek 8 miesięcy temu
rodzic
commit
464b086ec5

+ 29 - 29
src/lib/components/chat/Settings/Interface.svelte

@@ -292,36 +292,36 @@
 
 
 	onMount(async () => {
 	onMount(async () => {
 		titleAutoGenerate = $settings?.title?.auto ?? true;
 		titleAutoGenerate = $settings?.title?.auto ?? true;
-		autoTags = $settings.autoTags ?? true;
-		autoFollowUps = $settings.autoFollowUps ?? true;
+		autoTags = $settings?.autoTags ?? true;
+		autoFollowUps = $settings?.autoFollowUps ?? true;
 
 
-		highContrastMode = $settings.highContrastMode ?? false;
+		highContrastMode = $settings?.highContrastMode ?? false;
 
 
-		detectArtifacts = $settings.detectArtifacts ?? true;
-		responseAutoCopy = $settings.responseAutoCopy ?? false;
+		detectArtifacts = $settings?.detectArtifacts ?? true;
+		responseAutoCopy = $settings?.responseAutoCopy ?? false;
 
 
-		showUsername = $settings.showUsername ?? false;
-		showUpdateToast = $settings.showUpdateToast ?? true;
-		showChangelog = $settings.showChangelog ?? true;
+		showUsername = $settings?.showUsername ?? false;
+		showUpdateToast = $settings?.showUpdateToast ?? true;
+		showChangelog = $settings?.showChangelog ?? true;
 
 
-		showEmojiInCall = $settings.showEmojiInCall ?? false;
-		voiceInterruption = $settings.voiceInterruption ?? false;
+		showEmojiInCall = $settings?.showEmojiInCall ?? false;
+		voiceInterruption = $settings?.voiceInterruption ?? false;
 
 
-		richTextInput = $settings.richTextInput ?? true;
-		promptAutocomplete = $settings.promptAutocomplete ?? false;
-		largeTextAsFile = $settings.largeTextAsFile ?? false;
-		copyFormatted = $settings.copyFormatted ?? false;
+		richTextInput = $settings?.richTextInput ?? true;
+		promptAutocomplete = $settings?.promptAutocomplete ?? false;
+		largeTextAsFile = $settings?.largeTextAsFile ?? false;
+		copyFormatted = $settings?.copyFormatted ?? false;
 
 
-		collapseCodeBlocks = $settings.collapseCodeBlocks ?? false;
-		expandDetails = $settings.expandDetails ?? false;
+		collapseCodeBlocks = $settings?.collapseCodeBlocks ?? false;
+		expandDetails = $settings?.expandDetails ?? false;
 
 
-		landingPageMode = $settings.landingPageMode ?? '';
-		chatBubble = $settings.chatBubble ?? true;
-		widescreenMode = $settings.widescreenMode ?? false;
-		splitLargeChunks = $settings.splitLargeChunks ?? false;
-		scrollOnBranchChange = $settings.scrollOnBranchChange ?? true;
-		chatDirection = $settings.chatDirection ?? 'auto';
-		userLocation = $settings.userLocation ?? false;
+		landingPageMode = $settings?.landingPageMode ?? '';
+		chatBubble = $settings?.chatBubble ?? true;
+		widescreenMode = $settings?.widescreenMode ?? false;
+		splitLargeChunks = $settings?.splitLargeChunks ?? false;
+		scrollOnBranchChange = $settings?.scrollOnBranchChange ?? true;
+		chatDirection = $settings?.chatDirection ?? 'auto';
+		userLocation = $settings?.userLocation ?? false;
 
 
 		notificationSound = $settings?.notificationSound ?? true;
 		notificationSound = $settings?.notificationSound ?? true;
 		notificationSoundAlways = $settings?.notificationSoundAlways ?? false;
 		notificationSoundAlways = $settings?.notificationSoundAlways ?? false;
@@ -331,19 +331,19 @@
 
 
 		stylizedPdfExport = $settings?.stylizedPdfExport ?? true;
 		stylizedPdfExport = $settings?.stylizedPdfExport ?? true;
 
 
-		hapticFeedback = $settings.hapticFeedback ?? false;
-		ctrlEnterToSend = $settings.ctrlEnterToSend ?? false;
+		hapticFeedback = $settings?.hapticFeedback ?? false;
+		ctrlEnterToSend = $settings?.ctrlEnterToSend ?? false;
 
 
-		imageCompression = $settings.imageCompression ?? false;
-		imageCompressionSize = $settings.imageCompressionSize ?? { width: '', height: '' };
+		imageCompression = $settings?.imageCompression ?? false;
+		imageCompressionSize = $settings?.imageCompressionSize ?? { width: '', height: '' };
 
 
 		defaultModelId = $settings?.models?.at(0) ?? '';
 		defaultModelId = $settings?.models?.at(0) ?? '';
 		if ($config?.default_models) {
 		if ($config?.default_models) {
 			defaultModelId = $config.default_models.split(',')[0];
 			defaultModelId = $config.default_models.split(',')[0];
 		}
 		}
 
 
-		backgroundImageUrl = $settings.backgroundImageUrl ?? null;
-		webSearch = $settings.webSearch ?? null;
+		backgroundImageUrl = $settings?.backgroundImageUrl ?? null;
+		webSearch = $settings?.webSearch ?? null;
 	});
 	});
 </script>
 </script>
 
 

+ 19 - 19
src/lib/components/chat/SettingsModal.svelte

@@ -583,10 +583,10 @@
 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 								${
 								${
 									selectedTab === 'general'
 									selectedTab === 'general'
-										? ($settings.highContrastMode ?? false)
+										? ($settings?.highContrastMode ?? false)
 											? 'dark:bg-gray-800 bg-gray-200'
 											? 'dark:bg-gray-800 bg-gray-200'
 											: ''
 											: ''
-										: ($settings.highContrastMode ?? false)
+										: ($settings?.highContrastMode ?? false)
 											? 'hover:bg-gray-200 dark:hover:bg-gray-800'
 											? 'hover:bg-gray-200 dark:hover:bg-gray-800'
 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'
 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'
 								}`}
 								}`}
@@ -615,10 +615,10 @@
 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 								${
 								${
 									selectedTab === 'interface'
 									selectedTab === 'interface'
-										? ($settings.highContrastMode ?? false)
+										? ($settings?.highContrastMode ?? false)
 											? 'dark:bg-gray-800 bg-gray-200'
 											? 'dark:bg-gray-800 bg-gray-200'
 											: ''
 											: ''
-										: ($settings.highContrastMode ?? false)
+										: ($settings?.highContrastMode ?? false)
 											? 'hover:bg-gray-200 dark:hover:bg-gray-800'
 											? 'hover:bg-gray-200 dark:hover:bg-gray-800'
 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'
 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'
 								}`}
 								}`}
@@ -648,10 +648,10 @@
 									class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 									class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 								${
 								${
 									selectedTab === 'connections'
 									selectedTab === 'connections'
-										? ($settings.highContrastMode ?? false)
+										? ($settings?.highContrastMode ?? false)
 											? 'dark:bg-gray-800 bg-gray-200'
 											? 'dark:bg-gray-800 bg-gray-200'
 											: ''
 											: ''
-										: ($settings.highContrastMode ?? false)
+										: ($settings?.highContrastMode ?? false)
 											? 'hover:bg-gray-200 dark:hover:bg-gray-800'
 											? 'hover:bg-gray-200 dark:hover:bg-gray-800'
 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'
 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'
 								}`}
 								}`}
@@ -680,10 +680,10 @@
 									class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 									class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 								${
 								${
 									selectedTab === 'tools'
 									selectedTab === 'tools'
-										? ($settings.highContrastMode ?? false)
+										? ($settings?.highContrastMode ?? false)
 											? 'dark:bg-gray-800 bg-gray-200'
 											? 'dark:bg-gray-800 bg-gray-200'
 											: ''
 											: ''
-										: ($settings.highContrastMode ?? false)
+										: ($settings?.highContrastMode ?? false)
 											? 'hover:bg-gray-200 dark:hover:bg-gray-800'
 											? 'hover:bg-gray-200 dark:hover:bg-gray-800'
 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'
 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'
 								}`}
 								}`}
@@ -713,10 +713,10 @@
 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 								${
 								${
 									selectedTab === 'personalization'
 									selectedTab === 'personalization'
-										? ($settings.highContrastMode ?? false)
+										? ($settings?.highContrastMode ?? false)
 											? 'dark:bg-gray-800 bg-gray-200'
 											? 'dark:bg-gray-800 bg-gray-200'
 											: ''
 											: ''
-										: ($settings.highContrastMode ?? false)
+										: ($settings?.highContrastMode ?? false)
 											? 'hover:bg-gray-200 dark:hover:bg-gray-800'
 											? 'hover:bg-gray-200 dark:hover:bg-gray-800'
 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'
 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'
 								}`}
 								}`}
@@ -734,10 +734,10 @@
 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 								${
 								${
 									selectedTab === 'audio'
 									selectedTab === 'audio'
-										? ($settings.highContrastMode ?? false)
+										? ($settings?.highContrastMode ?? false)
 											? 'dark:bg-gray-800 bg-gray-200'
 											? 'dark:bg-gray-800 bg-gray-200'
 											: ''
 											: ''
-										: ($settings.highContrastMode ?? false)
+										: ($settings?.highContrastMode ?? false)
 											? 'hover:bg-gray-200 dark:hover:bg-gray-800'
 											? 'hover:bg-gray-200 dark:hover:bg-gray-800'
 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'
 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'
 								}`}
 								}`}
@@ -767,10 +767,10 @@
 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 								${
 								${
 									selectedTab === 'chats'
 									selectedTab === 'chats'
-										? ($settings.highContrastMode ?? false)
+										? ($settings?.highContrastMode ?? false)
 											? 'dark:bg-gray-800 bg-gray-200'
 											? 'dark:bg-gray-800 bg-gray-200'
 											: ''
 											: ''
-										: ($settings.highContrastMode ?? false)
+										: ($settings?.highContrastMode ?? false)
 											? 'hover:bg-gray-200 dark:hover:bg-gray-800'
 											? 'hover:bg-gray-200 dark:hover:bg-gray-800'
 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'
 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'
 								}`}
 								}`}
@@ -799,10 +799,10 @@
 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 								${
 								${
 									selectedTab === 'account'
 									selectedTab === 'account'
-										? ($settings.highContrastMode ?? false)
+										? ($settings?.highContrastMode ?? false)
 											? 'dark:bg-gray-800 bg-gray-200'
 											? 'dark:bg-gray-800 bg-gray-200'
 											: ''
 											: ''
-										: ($settings.highContrastMode ?? false)
+										: ($settings?.highContrastMode ?? false)
 											? 'hover:bg-gray-200 dark:hover:bg-gray-800'
 											? 'hover:bg-gray-200 dark:hover:bg-gray-800'
 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'
 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'
 								}`}
 								}`}
@@ -831,10 +831,10 @@
 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 								${
 								${
 									selectedTab === 'about'
 									selectedTab === 'about'
-										? ($settings.highContrastMode ?? false)
+										? ($settings?.highContrastMode ?? false)
 											? 'dark:bg-gray-800 bg-gray-200'
 											? 'dark:bg-gray-800 bg-gray-200'
 											: ''
 											: ''
-										: ($settings.highContrastMode ?? false)
+										: ($settings?.highContrastMode ?? false)
 											? 'hover:bg-gray-200 dark:hover:bg-gray-800'
 											? 'hover:bg-gray-200 dark:hover:bg-gray-800'
 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'
 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'
 								}`}
 								}`}
@@ -868,7 +868,7 @@
 
 
 				{#if $user?.role === 'admin'}
 				{#if $user?.role === 'admin'}
 					<button
 					<button
-						class="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition {$settings.highContrastMode
+						class="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition {$settings?.highContrastMode
 							? 'hover:bg-gray-200 dark:hover:bg-gray-800'
 							? 'hover:bg-gray-200 dark:hover:bg-gray-800'
 							: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'}"
 							: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'}"
 						on:click={async () => {
 						on:click={async () => {

+ 0 - 2
src/lib/stores/index.ts

@@ -149,8 +149,6 @@ type Settings = {
 	ctrlEnterToSend?: boolean;
 	ctrlEnterToSend?: boolean;
 
 
 	system?: string;
 	system?: string;
-	requestFormat?: string;
-	keepAlive?: string;
 	seed?: number;
 	seed?: number;
 	temperature?: string;
 	temperature?: string;
 	repeat_penalty?: string;
 	repeat_penalty?: string;