"...git@developer.sourcefind.cn:OpenDAS/torchaudio.git" did not exist on "bc82ffe2b468d1966d5088ef40256cf58cfdf41b"
Commit 81b7cdfe authored by Jun Siang Cheah's avatar Jun Siang Cheah
Browse files

fix: add typescript types for models

parent 948f2e91
import { APP_NAME } from '$lib/constants'; import { APP_NAME } from '$lib/constants';
import { writable } from 'svelte/store'; import { type Writable, writable } from 'svelte/store';
// Backend // Backend
export const WEBUI_NAME = writable(APP_NAME); export const WEBUI_NAME = writable(APP_NAME);
...@@ -14,7 +14,7 @@ export const chatId = writable(''); ...@@ -14,7 +14,7 @@ export const chatId = writable('');
export const chats = writable([]); export const chats = writable([]);
export const tags = writable([]); export const tags = writable([]);
export const models = writable([]); export const models: Writable<Model[]> = writable([]);
export const modelfiles = writable([]); export const modelfiles = writable([]);
export const prompts = writable([]); export const prompts = writable([]);
...@@ -36,3 +36,34 @@ export const documents = writable([ ...@@ -36,3 +36,34 @@ export const documents = writable([
export const settings = writable({}); export const settings = writable({});
export const showSettings = writable(false); export const showSettings = writable(false);
export const showChangelog = writable(false); export const showChangelog = writable(false);
type Model = OpenAIModel | OllamaModel;
type OpenAIModel = {
id: string;
name: string;
external: boolean;
source?: string;
}
type OllamaModel = {
id: string;
name: string;
// Ollama specific fields
details: OllamaModelDetails;
size: number;
description: string;
model: string;
modified_at: string;
digest: string;
}
type OllamaModelDetails = {
parent_model: string;
format: string;
family: string;
families: string[] | null;
parameter_size: string;
quantization_level: string;
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment