Repository navigation
Expand file tree
/
Copy pathtypes.ts
More file actions
100 lines (90 loc) · 2.39 KB
/
Copy pathtypes.ts
File metadata and controls
100 lines (90 loc) · 2.39 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
export enum MessageRole {
USER = 'user',
MODEL = 'model',
}
export interface FileAttachment {
id?: string; // IndexedDB 中的附件 ID(如果存储在 IndexedDB 中)
name: string;
mimeType: string;
data?: string; // base64 encoded string. Optional to allow for saving w/o data.
}
export interface PDFSummary {
id: string;
fileName: string;
pageCount: number;
fileSize: number;
author?: string;
charCount: number;
}
export interface Message {
id:string;
role: MessageRole;
content: string;
timestamp: number;
attachments?: FileAttachment[];
pdfAttachments?: PDFSummary[];
groundingMetadata?: any;
thoughts?: string;
thinkingTime?: number;
}
export interface Folder {
id: string;
name: string;
icon?: string;
createdAt: number;
}
export interface Persona {
id: string;
isDefault?: boolean;
name: string;
avatar: {
type: 'emoji' | 'url' | 'base64';
value: string;
};
bio: string;
systemPrompt: string;
model?: string;
temperature?: number;
contextLength?: number;
maxOutputTokens?: number;
isNew?: boolean;
}
export interface ChatSession {
id: string;
title: string;
icon?: string;
model: string;
messages: Message[];
createdAt: number;
folderId: string | null;
personaId?: string | null;
isArchived?: boolean;
}
import { LLMProvider } from './services/llm/types';
export interface Settings {
theme: 'apple-light' | 'apple-dark';
language: 'en' | 'zh';
fontFamily: 'system' | 'lxgw' | 'yozai';
colorPalette?: string; // 调色板ID (blue, orange, green, purple, red, indigo, cyan, pink)
customColor?: string; // 自定义颜色 (HEX格式)
llmProvider?: LLMProvider; // 用户选择的LLM服务商
apiKey: string[] | null;
lastSelectedModel?: string; // 用户最后选择的模型(模型选择器记忆功能)
defaultPersona: string;
autoTitleGeneration: boolean;
titleGenerationModel: string;
showThoughts: boolean;
optimizeFormatting: boolean;
thinkDeeper: boolean;
enableSearch: boolean;
apiBaseUrl?: string;
useCustomApi?: boolean; // 是否使用自定义 API 配置(包括 URL 和 Key,覆盖环境变量)
customModels?: string; // 用户自定义的模型列表(逗号或换行分隔)
temperature?: number;
maxOutputTokens?: number;
contextLength?: number;
password?: string;
pdfQuality?: 'sd' | 'hd' | 'uhd';
streamInactivityTimeout?: number;
fontSize?: number;
}