-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
51 lines (47 loc) · 1.43 KB
/
types.ts
File metadata and controls
51 lines (47 loc) · 1.43 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
// Data Structure Types
export interface TableRow {
id: number;
name: string;
age: number;
}
export interface BPlusTreeNode {
keys: number[]; // The index keys (IDs or Ages)
children: BPlusTreeNode[]; // Pointers to child nodes (for internal nodes)
isLeaf: boolean;
next: BPlusTreeNode | null; // Pointer to next leaf (for linked list)
data: TableRow[][]; // Actual row data (2D array to support duplicate keys)
id: string; // Unique ID for visualization mapping
parent: BPlusTreeNode | null;
}
// AI Configuration Types
export enum AIProvider {
GEMINI = 'GEMINI',
SILICONFLOW = 'SILICONFLOW',
OLLAMA = 'OLLAMA',
}
export interface AIConfig {
provider: AIProvider;
apiKey: string; // For Gemini and SiliconFlow
baseUrl: string; // Primarily for Ollama (e.g., http://localhost:11434/v1) or SiliconFlow
model: string;
}
export const DEFAULT_AI_CONFIG: Record<AIProvider, AIConfig> = {
[AIProvider.GEMINI]: {
provider: AIProvider.GEMINI,
apiKey: '',
baseUrl: '',
model: 'gemini-3-flash-preview',
},
[AIProvider.SILICONFLOW]: {
provider: AIProvider.SILICONFLOW,
apiKey: '',
baseUrl: 'https://api.siliconflow.cn/v1',
model: 'deepseek-ai/DeepSeek-V3', // Popular model on SiliconFlow
},
[AIProvider.OLLAMA]: {
provider: AIProvider.OLLAMA,
apiKey: 'ollama', // Not usually needed but required for some headers
baseUrl: 'http://localhost:11434/v1',
model: 'llama3',
},
};