From da8ee43481d612e26d421fa8794af7aab50ffc77 Mon Sep 17 00:00:00 2001 From: Jonathan Rohde Date: Wed, 10 Jul 2024 08:43:28 +0200 Subject: [PATCH] fix: use default model from config if available --- src/lib/components/chat/Settings/Interface.svelte | 5 ++++- src/lib/stores/index.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/Settings/Interface.svelte b/src/lib/components/chat/Settings/Interface.svelte index 5af33888a..e6eefaefc 100644 --- a/src/lib/components/chat/Settings/Interface.svelte +++ b/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; }); diff --git a/src/lib/stores/index.ts b/src/lib/stores/index.ts index de83a8ef6..bf8fb20c7 100644 --- a/src/lib/stores/index.ts +++ b/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;