diff options
Diffstat (limited to 'backend/instance/api-defs.ts')
| -rw-r--r-- | backend/instance/api-defs.ts | 67 |
1 files changed, 67 insertions, 0 deletions
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 +} |
