فهرست منبع

Merge pull request #3753 from jonathan-rohde/fix/store-default-model

fix: preselect default model from config if no setting stored
Timothy Jaeryang Baek 9 ماه پیش
والد
کامیت
f7777f489e
2فایلهای تغییر یافته به همراه5 افزوده شده و 2 حذف شده
  1. 4 1
      src/lib/components/chat/Settings/Interface.svelte
  2. 1 1
      src/lib/stores/index.ts

+ 4 - 1
src/lib/components/chat/Settings/Interface.svelte

@@ -144,7 +144,10 @@
 		chatDirection = $settings.chatDirection ?? 'LTR';
 		userLocation = $settings.userLocation ?? false;
 
-		defaultModelId = ($settings?.models ?? ['']).at(0);
+		defaultModelId = $settings?.models?.at(0) ?? '';
+		if ($config?.default_models) {
+			defaultModelId = $config.default_models.split(',')[0];
+		}
 
 		backgroundImageUrl = $settings.backgroundImageUrl ?? null;
 	});

+ 1 - 1
src/lib/stores/index.ts

@@ -139,7 +139,7 @@ type Config = {
 	name: string;
 	version: string;
 	default_locale: string;
-	default_models: string[];
+	default_models: string;
 	default_prompt_suggestions: PromptSuggestion[];
 	features: {
 		auth: boolean;