From 636b0323075225c584b62719ed51e75521bb7ffb Mon Sep 17 00:00:00 2001 From: aura Date: Tue, 17 Feb 2026 22:39:42 +0100 Subject: push source --- backend/instance/api-defs.ts | 67 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 backend/instance/api-defs.ts (limited to 'backend/instance/api-defs.ts') diff --git a/backend/instance/api-defs.ts b/backend/instance/api-defs.ts new file mode 100644 index 0000000..a655b16 --- /dev/null +++ b/backend/instance/api-defs.ts @@ -0,0 +1,67 @@ +export interface ServerStatus { + lastUpdate: number, + loadedModel: string, + isBusy: boolean, + domain: string, + msg?: string +}; + +export interface ModelInfo { + name: string, + modelname: string, + capabilities: any, + system: string, + description: string, + short_description: string, + free: number, +}; + +export interface ToolCall { + name: string, + parameters: any +}; + +export interface ToolNote { + content: string, + id: string +}; + +export interface ChatMsg { + timestamp: string, + role: string, + content: string, + toolCall?: ToolCall, + /** valid when: passing from model backend to ollama + * null when: passing from client to api or from api to model backend */ + images?: string[], + /** valid when: when passing from client to api and from api to model backend + * null when: passing from model backend to ollama */ + files?: { + name: string, + type: string, + content: string + }[], + + /** only valid when title is generated for the first response */ + title?: string +}; + +/** chat options while passing from api to model instance */ +export interface ChatOptions { + system?: { + model?: string, + user?: string + }, + model: ModelInfo, + uuid: string, + generateTitle: boolean, + chatfile?: string +}; + +export interface ChatStream { + response?: string, + status: string, + done: boolean, + finalMsg?: string, + tool?: boolean +} -- cgit v1.2.3