@leeoohoo/aichat 1.0.10 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -96,6 +96,7 @@ export declare interface AiClientConfig {
96
96
  baseUrl?: string;
97
97
  model: string;
98
98
  temperature: number;
99
+ maxTokens: number;
99
100
  systemPrompt?: string;
100
101
  enableStreaming: boolean;
101
102
  }
@@ -184,6 +185,11 @@ export declare class ApiClient {
184
185
  }): Promise<any>;
185
186
  getSession(id: string): Promise<any>;
186
187
  deleteSession(id: string): Promise<any>;
188
+ updateSession(id: string, data: {
189
+ title?: string;
190
+ description?: string;
191
+ metadata?: any;
192
+ }): Promise<any>;
187
193
  getSessionMessages(sessionId: string, params?: {
188
194
  limit?: number;
189
195
  offset?: number;
@@ -198,7 +204,7 @@ export declare class ApiClient {
198
204
  createdAt?: Date;
199
205
  status?: string;
200
206
  }): Promise<any>;
201
- getMcpConfigs(userId?: string): Promise<any>;
207
+ getMcpConfigs(userId?: string): Promise<unknown>;
202
208
  createMcpConfig(data: {
203
209
  id: string;
204
210
  name: string;
@@ -210,7 +216,7 @@ export declare class ApiClient {
210
216
  enabled: boolean;
211
217
  user_id?: string;
212
218
  app_ids?: string[];
213
- }): Promise<any>;
219
+ }): Promise<unknown>;
214
220
  updateMcpConfig(id: string, data: {
215
221
  id?: string;
216
222
  name?: string;
@@ -222,9 +228,9 @@ export declare class ApiClient {
222
228
  enabled?: boolean;
223
229
  userId?: string;
224
230
  app_ids?: string[];
225
- }): Promise<any>;
226
- deleteMcpConfig(id: string): Promise<any>;
227
- getAiModelConfigs(userId?: string): Promise<any>;
231
+ }): Promise<unknown>;
232
+ deleteMcpConfig(id: string): Promise<unknown>;
233
+ getAiModelConfigs(userId?: string): Promise<unknown>;
228
234
  createAiModelConfig(data: {
229
235
  id: string;
230
236
  name: string;
@@ -234,9 +240,9 @@ export declare class ApiClient {
234
240
  base_url: string;
235
241
  user_id?: string;
236
242
  enabled: boolean;
237
- }): Promise<any>;
238
- updateAiModelConfig(id: string, data: any): Promise<any>;
239
- deleteAiModelConfig(id: string): Promise<any>;
243
+ }): Promise<unknown>;
244
+ updateAiModelConfig(id: string, data: any): Promise<unknown>;
245
+ deleteAiModelConfig(id: string): Promise<unknown>;
240
246
  getSystemContexts(userId: string): Promise<any[]>;
241
247
  getActiveSystemContext(userId: string): Promise<{
242
248
  content: string;
@@ -310,6 +316,7 @@ export declare class ApiClient {
310
316
  model_config: {
311
317
  model_name: any;
312
318
  temperature: number;
319
+ max_tokens: number;
313
320
  api_key: any;
314
321
  base_url: any;
315
322
  };
@@ -376,11 +383,9 @@ export declare class ApiClient {
376
383
  message: any;
377
384
  };
378
385
  }>;
379
- streamChat(sessionId: string, content: string, modelConfig: any, userId?: string, attachments?: any[]): Promise<ReadableStream>;
380
- streamAgentChat(sessionId: string, content: string, agentId: string, userId?: string, attachments?: any[]): Promise<ReadableStream>;
386
+ streamChat(sessionId: string, content: string, modelConfig: any, userId?: string): Promise<ReadableStream>;
387
+ streamAgentChat(sessionId: string, content: string, agentId: string, userId?: string): Promise<ReadableStream>;
381
388
  stopChat(sessionId: string): Promise<any>;
382
- getUserSettings(userId?: string): Promise<any>;
383
- updateUserSettings(userId: string, settings: Record<string, any>): Promise<any>;
384
389
  }
385
390
 
386
391
  export declare const apiClient: ApiClient;
@@ -418,7 +423,6 @@ export declare const AttachmentRenderer: default_2.FC<AttachmentRendererProps>;
418
423
 
419
424
  declare interface AttachmentRendererProps {
420
425
  attachment: Attachment;
421
- isUser?: boolean;
422
426
  customRenderer?: (attachment: Attachment) => default_2.ReactNode;
423
427
  className?: string;
424
428
  }
@@ -474,6 +478,7 @@ declare interface ChatActions {
474
478
  export declare interface ChatConfig {
475
479
  model: string;
476
480
  temperature: number;
481
+ maxTokens: number;
477
482
  systemPrompt: string;
478
483
  enableMcp: boolean;
479
484
  }
@@ -484,6 +489,7 @@ export declare interface ChatConfig {
484
489
  declare interface ChatConfig_2 {
485
490
  model: string;
486
491
  temperature: number;
492
+ maxTokens: number;
487
493
  apiKey: string;
488
494
  baseUrl: string;
489
495
  }
@@ -545,6 +551,7 @@ export declare class ChatService {
545
551
  sendMessage(sessionId: string, content: string, _attachments?: any[], callbacks?: ChatServiceCallbacks, modelConfig?: {
546
552
  model_name: string;
547
553
  temperature: number;
554
+ max_tokens: number;
548
555
  api_key: string;
549
556
  base_url: string;
550
557
  }): Promise<void>;
@@ -652,6 +659,7 @@ export declare const conversationsApi: {
652
659
  model_config: {
653
660
  model_name: any;
654
661
  temperature: number;
662
+ max_tokens: number;
655
663
  api_key: any;
656
664
  base_url: any;
657
665
  };
@@ -743,7 +751,7 @@ export declare class DatabaseService {
743
751
  createSession(data: Omit<Session_2, 'id'>): Promise<Session_2>;
744
752
  getSession(id: string): Promise<Session_2 | null>;
745
753
  getAllSessions(): Promise<Session_2[]>;
746
- updateSession(_id: string, _updates: Partial<Session_2>): Promise<Session_2 | null>;
754
+ updateSession(id: string, updates: Partial<Session_2>): Promise<Session_2 | null>;
747
755
  deleteSession(id: string): Promise<boolean>;
748
756
  createMessage(data: Omit<Message_2, 'id'>): Promise<Message_2>;
749
757
  getSessionMessages(sessionId: string, options?: {
@@ -1091,15 +1099,29 @@ declare interface Session_2 {
1091
1099
 
1092
1100
  export declare const SessionList: default_2.FC<SessionListProps_2>;
1093
1101
 
1102
+ /**
1103
+ * SessionList 组件属性
1104
+ */
1094
1105
  export declare interface SessionListProps {
1095
1106
  isOpen?: boolean;
1096
1107
  onClose?: () => void;
1108
+ /**
1109
+ * 如果为 true,则使用相对定位嵌入到布局中;否则使用固定定位(抽屉模式)
1110
+ */
1111
+ embedded?: boolean;
1112
+ /**
1113
+ * 可选的 store 函数,用于在没有 Context Provider 的情况下使用
1114
+ */
1097
1115
  store?: any;
1098
1116
  }
1099
1117
 
1100
1118
  declare interface SessionListProps_2 {
1101
1119
  isOpen?: boolean;
1102
1120
  onClose?: () => void;
1121
+ /**
1122
+ * 如果为 true,则使用相对定位嵌入到布局中;否则使用固定定位(抽屉模式)
1123
+ */
1124
+ embedded?: boolean;
1103
1125
  store?: typeof useChatStore;
1104
1126
  }
1105
1127
 
@@ -1215,7 +1237,7 @@ export declare const useTheme: () => {
1215
1237
  toggleTheme: () => void;
1216
1238
  };
1217
1239
 
1218
- export declare const version = "1.0.10";
1240
+ export declare const version = "1.0.11";
1219
1241
 
1220
1242
  export declare const XIcon: default_2.FC<{
1221
1243
  className?: string;