mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-01 17:32:52 -05:00
refac
This commit is contained in:
1 parent
419d248093
commit
30881dbcc9
73 files changed
+1214
-49
No files matched your search
@@ -9,6 +9,7 @@
|
||||
import { getModelsConfig, setModelsConfig, setDefaultPromptSuggestions } from '$lib/apis/configs';
|
||||
import { getBackendConfig } from '$lib/apis';
|
||||
import { getLanguages } from '$lib/i18n';
|
||||
import { resolveLocalizedPromptSuggestions } from '$lib/utils/localizedContent';
|
||||
|
||||
import AdvancedParams from '$lib/components/chat/Settings/Advanced/AdvancedParams.svelte';
|
||||
import Capabilities from '$lib/components/workspace/Models/Capabilities.svelte';
|
||||
@@ -80,7 +81,10 @@
|
||||
}
|
||||
|
||||
defaultParams = config?.DEFAULT_MODEL_PARAMS ?? {};
|
||||
promptSuggestions = $appConfig?.default_prompt_suggestions ?? [];
|
||||
promptSuggestions = resolveLocalizedPromptSuggestions(
|
||||
$appConfig?.default_prompt_suggestions,
|
||||
{}
|
||||
);
|
||||
promptSuggestionsI18n = $appConfig?.default_prompt_suggestions_i18n ?? {};
|
||||
languages = await getLanguages();
|
||||
savedSnapshot = getSnapshot();
|
||||
@@ -115,9 +119,12 @@
|
||||
if (res) {
|
||||
config = res;
|
||||
promptSuggestions = promptSuggestions.filter((p) => p.content !== '');
|
||||
const suggestionsChanged =
|
||||
JSON.stringify(promptSuggestions) !==
|
||||
JSON.stringify(JSON.parse(savedSnapshot).promptSuggestions);
|
||||
const suggestionsRes = await setDefaultPromptSuggestions(
|
||||
localStorage.token,
|
||||
promptSuggestions,
|
||||
suggestionsChanged ? promptSuggestions : ($appConfig?.default_prompt_suggestions ?? null),
|
||||
promptSuggestionsI18n
|
||||
);
|
||||
promptSuggestions = suggestionsRes?.suggestions ?? promptSuggestions;
|
||||
|
||||
Reference in new issue
Block a user