mirror of
https://github.com/open-webui/open-webui
synced 2025-01-18 08:40:58 +00:00
Merge pull request #4746 from 5E-324/fix-type-errors
chore: Fix type errors.
This commit is contained in:
commit
22d8f8f1ef
@ -950,6 +950,7 @@ export interface ModelConfig {
|
||||
export interface ModelMeta {
|
||||
description?: string;
|
||||
capabilities?: object;
|
||||
profile_image_url?: string;
|
||||
}
|
||||
|
||||
export interface ModelParams {}
|
||||
|
@ -396,7 +396,7 @@ export const deleteModel = async (token: string, tagName: string, urlIdx: string
|
||||
return res;
|
||||
};
|
||||
|
||||
export const pullModel = async (token: string, tagName: string, urlIdx: string | null = null) => {
|
||||
export const pullModel = async (token: string, tagName: string, urlIdx: number | null = null) => {
|
||||
let error = null;
|
||||
const controller = new AbortController();
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
let ollamaEnabled = null;
|
||||
|
||||
let OLLAMA_URLS = [];
|
||||
let selectedOllamaUrlIdx: string | null = null;
|
||||
let selectedOllamaUrlIdx: number | null = null;
|
||||
|
||||
let updateModelId = null;
|
||||
let updateProgress = null;
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
import { deleteModel, getOllamaVersion, pullModel } from '$lib/apis/ollama';
|
||||
|
||||
import { user, MODEL_DOWNLOAD_POOL, models, mobile, temporaryChatEnabled } from '$lib/stores';
|
||||
import { user, MODEL_DOWNLOAD_POOL, models, mobile, temporaryChatEnabled, Model } from '$lib/stores';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { capitalizeFirstLetter, sanitizeResponseContent, splitStream } from '$lib/utils';
|
||||
import { getModels } from '$lib/apis';
|
||||
@ -35,9 +35,10 @@
|
||||
export let items: {
|
||||
label: string;
|
||||
value: string;
|
||||
model: Model;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
[key: string]: any;
|
||||
} = [];
|
||||
}[] = [];
|
||||
|
||||
export let className = 'w-[32rem]';
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
let themes = ['dark', 'light', 'rose-pine dark', 'rose-pine-dawn light', 'oled-dark'];
|
||||
let selectedTheme = 'system';
|
||||
|
||||
let languages = [];
|
||||
let languages: Awaited<ReturnType<typeof getLanguages>> = [];
|
||||
let lang = $i18n.language;
|
||||
let notificationEnabled = false;
|
||||
let system = '';
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
// Advanced
|
||||
let requestFormat = '';
|
||||
let keepAlive = null;
|
||||
let keepAlive: string | null = null;
|
||||
|
||||
let params = {
|
||||
// Advanced
|
||||
|
@ -31,7 +31,7 @@
|
||||
let ollamaEnabled = null;
|
||||
|
||||
let OLLAMA_URLS = [];
|
||||
let selectedOllamaUrlIdx: string | null = null;
|
||||
let selectedOllamaUrlIdx: number | null = null;
|
||||
|
||||
let updateModelId = null;
|
||||
let updateProgress = null;
|
||||
|
@ -52,20 +52,39 @@ type BaseModel = {
|
||||
id: string;
|
||||
name: string;
|
||||
info?: ModelConfig;
|
||||
owned_by: 'ollama' | 'openai';
|
||||
};
|
||||
|
||||
export interface OpenAIModel extends BaseModel {
|
||||
owned_by: 'openai';
|
||||
external: boolean;
|
||||
source?: string;
|
||||
}
|
||||
|
||||
export interface OllamaModel extends BaseModel {
|
||||
owned_by: 'ollama';
|
||||
details: OllamaModelDetails;
|
||||
size: number;
|
||||
description: string;
|
||||
model: string;
|
||||
modified_at: string;
|
||||
digest: string;
|
||||
ollama?: {
|
||||
name?: string;
|
||||
model?: string;
|
||||
modified_at: string;
|
||||
size?: number;
|
||||
digest?: string;
|
||||
details?: {
|
||||
parent_model?: string;
|
||||
format?: string;
|
||||
family?: string;
|
||||
families?: string[];
|
||||
parameter_size?: string;
|
||||
quantization_level?: string;
|
||||
};
|
||||
urls?: number[];
|
||||
};
|
||||
}
|
||||
|
||||
type OllamaModelDetails = {
|
||||
|
Loading…
Reference in New Issue
Block a user