summaryrefslogtreecommitdiff
path: root/backend/instance/api-defs.ts
diff options
context:
space:
mode:
authoraura <nw@moneybot.cc>2026-02-17 22:39:42 +0100
committeraura <nw@moneybot.cc>2026-02-17 22:39:42 +0100
commit636b0323075225c584b62719ed51e75521bb7ffb (patch)
tree61b02271b6d0695a4beffc23fb6eb062a7da22c3 /backend/instance/api-defs.ts
push source
Diffstat (limited to 'backend/instance/api-defs.ts')
-rw-r--r--backend/instance/api-defs.ts67
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
+}