mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
refac
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
import { goto } from '$app/navigation';
|
||||
|
||||
import { getAllModels as _getAllModels } from '$lib/utils';
|
||||
import { getModels as _getModels } from '$lib/apis';
|
||||
import { getOllamaVersion } from '$lib/apis/ollama';
|
||||
import { getPrompts } from '$lib/apis/prompts';
|
||||
|
||||
@@ -45,8 +45,8 @@
|
||||
|
||||
let showShortcuts = false;
|
||||
|
||||
const getAllModels = async () => {
|
||||
return _getAllModels(localStorage.token);
|
||||
const getModels = async () => {
|
||||
return _getModels(localStorage.token);
|
||||
};
|
||||
|
||||
onMount(async () => {
|
||||
@@ -75,7 +75,7 @@
|
||||
|
||||
await Promise.all([
|
||||
(async () => {
|
||||
models.set(await getAllModels());
|
||||
models.set(await getModels());
|
||||
})(),
|
||||
(async () => {
|
||||
prompts.set(await getPrompts(localStorage.token));
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import { splitStream } from '$lib/utils';
|
||||
import { onMount, tick, getContext } from 'svelte';
|
||||
import { createModel } from '$lib/apis/ollama';
|
||||
import { addNewModel, getModelById, getModels } from '$lib/apis/models';
|
||||
import { addNewModel, getModelById, getModelInfos } from '$lib/apis/models';
|
||||
|
||||
const i18n = getContext('i18n');
|
||||
|
||||
@@ -99,7 +99,7 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, '');
|
||||
|
||||
const saveModelfile = async (modelfile) => {
|
||||
await addNewModel(localStorage.token, modelfile);
|
||||
await modelfiles.set(await getModels(localStorage.token));
|
||||
await modelfiles.set(await getModelInfos(localStorage.token));
|
||||
};
|
||||
|
||||
const submitHandler = async () => {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
import { splitStream } from '$lib/utils';
|
||||
|
||||
import { createModel } from '$lib/apis/ollama';
|
||||
import { getModels, updateModelById } from '$lib/apis/models';
|
||||
import { getModelInfos, updateModelById } from '$lib/apis/models';
|
||||
|
||||
import AdvancedParams from '$lib/components/chat/Settings/Advanced/AdvancedParams.svelte';
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
|
||||
const updateModelfile = async (modelfile) => {
|
||||
await updateModelById(localStorage.token, modelfile.tagName, modelfile);
|
||||
await modelfiles.set(await getModels(localStorage.token));
|
||||
await modelfiles.set(await getModelInfos(localStorage.token));
|
||||
};
|
||||
|
||||
const updateHandler = async () => {
|
||||
|
||||
Reference in New Issue
Block a user