-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
73 lines (63 loc) · 1.31 KB
/
types.ts
File metadata and controls
73 lines (63 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
export interface PromptVar {
key: string;
value: string;
}
export interface SavedPrompt {
id: string;
title: string;
description: string;
systemPrompt: string;
userPrompt: string;
variables: Record<string, string>;
images?: ImageAttachment[];
createdAt: number;
updatedAt: number;
}
export interface ApiConfig {
id: string;
name: string;
baseUrl: string;
apiKey: string;
models: string[];
}
export type View = 'debug' | 'manage' | 'providers' | 'settings';
export interface CompletionResponse {
content: string;
error?: string;
usage?: {
prompt_tokens: number;
completion_tokens: number;
total_tokens: number;
};
}
export interface StreamChunk {
content?: string;
usage?: {
prompt_tokens: number;
completion_tokens: number;
total_tokens: number;
};
error?: string;
}
export interface AppSettings {
defaultModels?: string[];
}
export interface ImageAttachment {
id: string;
base64: string;
mimeType: string;
originalSize: number;
compressedSize: number;
width: number;
height: number;
}
export type MessageContent =
| string
| Array<
| { type: 'text'; text: string }
| { type: 'image_url'; image_url: { url: string } }
>;
export interface ChatMessage {
role: 'system' | 'user' | 'assistant';
content: MessageContent;
}