@opentiny/genui-sdk-vue 1.3.1 → 1.4.0-alpha.3

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.
Files changed (48) hide show
  1. package/README.md +11 -2
  2. package/dist/ConfigProvider-D6LFAgg5.js +131 -0
  3. package/dist/ConfigProvider-D6LFAgg5.js.map +1 -0
  4. package/dist/GenuiRenderer-f2_6u1TA.js +141 -0
  5. package/dist/GenuiRenderer-f2_6u1TA.js.map +1 -0
  6. package/dist/chat.d.ts +6 -0
  7. package/dist/chat.js +17 -15
  8. package/dist/chat.js.map +1 -1
  9. package/dist/chat.types-DEDNSs5o.js +1817 -0
  10. package/dist/chat.types-DEDNSs5o.js.map +1 -0
  11. package/dist/code-generator.d.ts +139 -0
  12. package/dist/code-generator.js +6 -0
  13. package/dist/code-generator.js.map +1 -0
  14. package/dist/config-provider.d.ts +24 -12
  15. package/dist/config-provider.js +5 -5
  16. package/dist/index.d.ts +1100 -677
  17. package/dist/index.js +39 -31
  18. package/dist/index.js.map +1 -1
  19. package/dist/{GenuiRenderer-C2w3WGQa.js → injection-tokens-DDgspg4x.js} +3474 -3497
  20. package/dist/injection-tokens-DDgspg4x.js.map +1 -0
  21. package/dist/legacy-chat.d.ts +789 -534
  22. package/dist/legacy-chat.js +63 -19
  23. package/dist/legacy-chat.js.map +1 -1
  24. package/dist/legacy-config-provider.d.ts +58 -0
  25. package/dist/legacy-config-provider.js +25 -0
  26. package/dist/legacy-config-provider.js.map +1 -0
  27. package/dist/legacy-renderer.d.ts +28 -20
  28. package/dist/legacy-renderer.js +38 -4
  29. package/dist/legacy-renderer.js.map +1 -1
  30. package/dist/renderer.d.ts +3 -2
  31. package/dist/renderer.js +1 -1
  32. package/dist/transform-jsx.d.ts +2 -3
  33. package/dist/transform-jsx.js +5 -2
  34. package/dist/transform-jsx.js.map +1 -1
  35. package/dist/vue-code-generator-CwPQ3GDh.js +573 -0
  36. package/dist/vue-code-generator-CwPQ3GDh.js.map +1 -0
  37. package/package.json +18 -7
  38. package/dist/ConfigProvider-BzxW9L3f.js +0 -95
  39. package/dist/ConfigProvider-BzxW9L3f.js.map +0 -1
  40. package/dist/GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-Bdu-r86w.js +0 -49
  41. package/dist/GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-Bdu-r86w.js.map +0 -1
  42. package/dist/GenuiRenderer-C2w3WGQa.js.map +0 -1
  43. package/dist/GenuiRendererWithMaterials.vue_vue_type_script_setup_true_lang-BlhUkAxb.js +0 -39
  44. package/dist/GenuiRendererWithMaterials.vue_vue_type_script_setup_true_lang-BlhUkAxb.js.map +0 -1
  45. package/dist/chat.types-BqZOCKBz.js +0 -1794
  46. package/dist/chat.types-BqZOCKBz.js.map +0 -1
  47. package/dist/injection-tokens-CuDQs1ne.js +0 -114
  48. package/dist/injection-tokens-CuDQs1ne.js.map +0 -1
@@ -18,6 +18,7 @@ import { ComputedRef } from 'vue';
18
18
  import { Conversation } from '@opentiny/tiny-robot-kit';
19
19
  import { ConversationState } from '@opentiny/tiny-robot-kit';
20
20
  import { ConversationStorageStrategy } from '@opentiny/tiny-robot-kit';
21
+ import { CreateComponentPublicInstanceWithMixins } from 'vue';
21
22
  import { DebuggerEvent } from 'vue';
22
23
  import { DefineComponent } from 'vue';
23
24
  import { GlobalComponents } from 'vue';
@@ -41,6 +42,7 @@ import { RendererElement } from 'vue';
41
42
  import { RendererNode } from 'vue';
42
43
  import { ShallowUnwrapRef } from 'vue';
43
44
  import { Slot } from 'vue';
45
+ import { ThemeColorScheme } from '@opentiny/genui-sdk-core';
44
46
  import { UnwrapNestedRefs } from 'vue';
45
47
  import { UseConversationOptions } from '@opentiny/tiny-robot-kit';
46
48
  import { UseMessageReturn as UseMessageReturn_2 } from '@opentiny/tiny-robot-kit';
@@ -50,7 +52,788 @@ import { VNodeProps } from 'vue';
50
52
  import { WatchOptions } from 'vue';
51
53
  import { WatchStopHandle } from 'vue';
52
54
 
53
- declare const __VLS_component: DefineComponent<IChatProps, {
55
+ export declare function createI18n(options?: I18nOptions): I18nInstance;
56
+
57
+ /**
58
+ * 自定义请求函数类型
59
+ * @param url 请求地址
60
+ * @param options 请求选项(包含 method, headers, body, signal 等)
61
+ * @returns 返回 Response 对象或 Promise<Response>
62
+ */
63
+ export declare type CustomFetch = (url: string, options: {
64
+ method: string;
65
+ headers: Record<string, string>;
66
+ body: string;
67
+ signal?: AbortSignal;
68
+ }) => Promise<Response> | Response;
69
+
70
+ export declare const DEFAULT_IMAGE_FEATURES: ImageFeatures;
71
+
72
+ export declare const emitter: EventEmitter;
73
+
74
+ export declare class EventEmitter {
75
+ private events;
76
+ constructor();
77
+ /**
78
+ * @param {string} eventName - 事件名
79
+ * @param {Function} callback - 回调函数
80
+ * @param {boolean} [once=false] - 是否只触发一次
81
+ */
82
+ on(eventName: string, callback: Function, once?: boolean): void;
83
+ /**
84
+ * @param {string} eventName - 事件名
85
+ * @param {Function} callback - 要移除的回调(必须是注册时的同一个函数引用)
86
+ */
87
+ off(eventName: string, callback: Function): void;
88
+ /**
89
+ * @param {string} eventName - 事件名
90
+ * @param {...any} args - 传递给回调的参数
91
+ */
92
+ emit(eventName: string, ...args: any[]): void;
93
+ /**
94
+ * @param {string} eventName - 事件名
95
+ * @param {Function} callback - 回调函数
96
+ */
97
+ once(eventName: string, callback: Function): void;
98
+ }
99
+
100
+ declare interface FileMeta {
101
+ name: string;
102
+ type: string;
103
+ size: number;
104
+ lastModified: number;
105
+ base64: string;
106
+ }
107
+
108
+ export declare const GENUI_CONFIG: InjectionKey<ComputedRef<GenuiConfigState>>;
109
+
110
+ export declare const GENUI_I18N: unique symbol;
111
+
112
+ export declare const GENUI_MATERIALS: InjectionKey<IMaterials>;
113
+
114
+ export declare interface GenuiConfigState {
115
+ colorScheme: ThemeColorScheme;
116
+ id: string;
117
+ }
118
+
119
+ /** @deprecated 请改用 `GenuiChat`,并通过 `GenuiConfigProvider` 提供物料。 */
120
+ export declare const GenuiLegacyChat: {
121
+ new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<IChatProps> & Readonly<{}>, {
122
+ $: ComponentInternalInstance;
123
+ $data: {};
124
+ $props: Partial<{}> & Omit<{
125
+ readonly url?: string;
126
+ readonly model?: string;
127
+ readonly temperature?: number;
128
+ readonly messages?: IMessage[];
129
+ readonly chatConfig?: IChatConfig;
130
+ readonly requiredCompleteFieldSelectors?: string[];
131
+ readonly customComponents?: ICustomComponentItem[];
132
+ readonly customSnippets?: IGenPromptSnippet[];
133
+ readonly customExamples?: IGenPromptExample[];
134
+ readonly customActions?: ICustomActionItem[];
135
+ readonly rendererSlots?: IRendererSlots_2;
136
+ readonly thinkComponent?: Component<BubbleProps>;
137
+ readonly roles?: IRolesConfig;
138
+ readonly features?: ModelCapability;
139
+ readonly customFetch?: CustomFetch;
140
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>;
141
+ $attrs: {
142
+ [x: string]: unknown;
143
+ };
144
+ $refs: {
145
+ [x: string]: unknown;
146
+ } & {
147
+ messagesContainer: HTMLDivElement;
148
+ };
149
+ $slots: Readonly<{
150
+ [name: string]: Slot<any>;
151
+ }> & {
152
+ empty?(_: {}): any;
153
+ };
154
+ $root: ComponentPublicInstance | null;
155
+ $parent: ComponentPublicInstance | null;
156
+ $host: Element | null;
157
+ $emit: (event: string, ...args: any[]) => void;
158
+ $el: HTMLDivElement;
159
+ $options: ComponentOptionsBase<Readonly<IChatProps> & Readonly<{}>, {
160
+ setInputMessage: (message: string) => void;
161
+ handleNewConversation: () => void;
162
+ getProps: () => IChatProps;
163
+ getConversation: () => UseConversationReturn;
164
+ getResponseHandlers: () => IResponseHandler<IStreamData>[];
165
+ setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
166
+ getMessageRenderers: () => {
167
+ 'custom-text': (props: BubbleCommonProps & {
168
+ content: string;
169
+ }) => VNode<RendererNode, RendererElement, {
170
+ [key: string]: any;
171
+ }>;
172
+ 'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
173
+ [key: string]: any;
174
+ }>;
175
+ tool: DefineComponent< {
176
+ name: string;
177
+ status: "running" | "success" | "failed" | "cancelled";
178
+ content?: string | {
179
+ params?: object;
180
+ result?: object;
181
+ [x: string]: unknown;
182
+ };
183
+ formatPretty?: boolean;
184
+ defaultOpen?: boolean;
185
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
186
+ name: string;
187
+ status: "running" | "success" | "failed" | "cancelled";
188
+ content?: string | {
189
+ params?: object;
190
+ result?: object;
191
+ [x: string]: unknown;
192
+ };
193
+ formatPretty?: boolean;
194
+ defaultOpen?: boolean;
195
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
196
+ reasoning: DefineComponent< {
197
+ content: string;
198
+ thinking?: boolean;
199
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
200
+ content: string;
201
+ thinking?: boolean;
202
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
203
+ markdown: BubbleMarkdownContentRenderer;
204
+ templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
205
+ attachments: FileMeta[];
206
+ templateData: UserItem[];
207
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
208
+ 'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
209
+ 'error-text': DefineComponent< {
210
+ content: string;
211
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
212
+ content: string;
213
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
214
+ };
215
+ setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
216
+ generating: ComputedRef<boolean>;
217
+ lastSchemaCardId: ComputedRef<any>;
218
+ continueChatAction: {
219
+ name: string;
220
+ description: string;
221
+ execute: (params: {
222
+ message: string;
223
+ }, context: Record<string, any>) => void;
224
+ parameters: {
225
+ type: "object";
226
+ properties: {
227
+ message: {
228
+ type: string;
229
+ description: string;
230
+ };
231
+ };
232
+ };
233
+ };
234
+ saveStateAction: {
235
+ name: string;
236
+ description: string;
237
+ execute: (params: any, context: Record<string | symbol, any>) => void;
238
+ parameters: {
239
+ type: "null";
240
+ };
241
+ };
242
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
243
+ beforeCreate?: (() => void) | (() => void)[];
244
+ created?: (() => void) | (() => void)[];
245
+ beforeMount?: (() => void) | (() => void)[];
246
+ mounted?: (() => void) | (() => void)[];
247
+ beforeUpdate?: (() => void) | (() => void)[];
248
+ updated?: (() => void) | (() => void)[];
249
+ activated?: (() => void) | (() => void)[];
250
+ deactivated?: (() => void) | (() => void)[];
251
+ beforeDestroy?: (() => void) | (() => void)[];
252
+ beforeUnmount?: (() => void) | (() => void)[];
253
+ destroyed?: (() => void) | (() => void)[];
254
+ unmounted?: (() => void) | (() => void)[];
255
+ renderTracked?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
256
+ renderTriggered?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
257
+ errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
258
+ };
259
+ $forceUpdate: () => void;
260
+ $nextTick: nextTick;
261
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle;
262
+ messages?: IMessage[];
263
+ customComponents?: ICustomComponentItem[];
264
+ customActions?: ICustomActionItem[];
265
+ requiredCompleteFieldSelectors?: string[];
266
+ customFetch?: CustomFetch;
267
+ url?: string;
268
+ model?: string;
269
+ temperature?: number;
270
+ customSnippets?: IGenPromptSnippet[];
271
+ customExamples?: IGenPromptExample[];
272
+ chatConfig?: IChatConfig;
273
+ rendererSlots?: IRendererSlots_2;
274
+ thinkComponent?: Component<BubbleProps>;
275
+ roles?: IRolesConfig;
276
+ features?: ModelCapability;
277
+ setInputMessage: (message: string) => void;
278
+ handleNewConversation: () => void;
279
+ getProps: () => IChatProps;
280
+ getConversation: () => UseConversationReturn;
281
+ getResponseHandlers: () => IResponseHandler<IStreamData>[];
282
+ setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
283
+ getMessageRenderers: () => {
284
+ 'custom-text': (props: BubbleCommonProps & {
285
+ content: string;
286
+ }) => VNode<RendererNode, RendererElement, {
287
+ [key: string]: any;
288
+ }>;
289
+ 'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
290
+ [key: string]: any;
291
+ }>;
292
+ tool: DefineComponent< {
293
+ name: string;
294
+ status: "running" | "success" | "failed" | "cancelled";
295
+ content?: string | {
296
+ params?: object;
297
+ result?: object;
298
+ [x: string]: unknown;
299
+ };
300
+ formatPretty?: boolean;
301
+ defaultOpen?: boolean;
302
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
303
+ name: string;
304
+ status: "running" | "success" | "failed" | "cancelled";
305
+ content?: string | {
306
+ params?: object;
307
+ result?: object;
308
+ [x: string]: unknown;
309
+ };
310
+ formatPretty?: boolean;
311
+ defaultOpen?: boolean;
312
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
313
+ reasoning: DefineComponent< {
314
+ content: string;
315
+ thinking?: boolean;
316
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
317
+ content: string;
318
+ thinking?: boolean;
319
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
320
+ markdown: BubbleMarkdownContentRenderer;
321
+ templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
322
+ attachments: FileMeta[];
323
+ templateData: UserItem[];
324
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
325
+ 'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
326
+ 'error-text': DefineComponent< {
327
+ content: string;
328
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
329
+ content: string;
330
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
331
+ };
332
+ setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
333
+ generating: boolean;
334
+ lastSchemaCardId: any;
335
+ continueChatAction: {
336
+ name: string;
337
+ description: string;
338
+ execute: (params: {
339
+ message: string;
340
+ }, context: Record<string, any>) => void;
341
+ parameters: {
342
+ type: "object";
343
+ properties: {
344
+ message: {
345
+ type: string;
346
+ description: string;
347
+ };
348
+ };
349
+ };
350
+ };
351
+ saveStateAction: {
352
+ name: string;
353
+ description: string;
354
+ execute: (params: any, context: Record<string | symbol, any>) => void;
355
+ parameters: {
356
+ type: "null";
357
+ };
358
+ };
359
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {
360
+ chatRef: {
361
+ $: ComponentInternalInstance;
362
+ $data: {};
363
+ $props: Partial<{}> & Omit<{
364
+ readonly url?: string;
365
+ readonly model?: string;
366
+ readonly temperature?: number;
367
+ readonly messages?: IMessage[];
368
+ readonly chatConfig?: IChatConfig;
369
+ readonly requiredCompleteFieldSelectors?: string[];
370
+ readonly customComponents?: ICustomComponentItem[];
371
+ readonly customSnippets?: IGenPromptSnippet[];
372
+ readonly customExamples?: IGenPromptExample[];
373
+ readonly customActions?: ICustomActionItem[];
374
+ readonly rendererSlots?: IRendererSlots_2;
375
+ readonly thinkComponent?: Component<BubbleProps>;
376
+ readonly roles?: IRolesConfig;
377
+ readonly features?: ModelCapability;
378
+ readonly customFetch?: CustomFetch;
379
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>;
380
+ $attrs: {
381
+ [x: string]: unknown;
382
+ };
383
+ $refs: {
384
+ [x: string]: unknown;
385
+ } & {
386
+ messagesContainer: HTMLDivElement;
387
+ };
388
+ $slots: Readonly<{
389
+ [name: string]: Slot<any>;
390
+ }>;
391
+ $root: ComponentPublicInstance | null;
392
+ $parent: ComponentPublicInstance | null;
393
+ $host: Element | null;
394
+ $emit: (event: string, ...args: any[]) => void;
395
+ $el: HTMLDivElement;
396
+ $options: ComponentOptionsBase<Readonly<IChatProps> & Readonly<{}>, {
397
+ setInputMessage: (message: string) => void;
398
+ handleNewConversation: () => void;
399
+ getProps: () => IChatProps;
400
+ getConversation: () => UseConversationReturn;
401
+ getResponseHandlers: () => IResponseHandler<IStreamData>[];
402
+ setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
403
+ getMessageRenderers: () => {
404
+ 'custom-text': (props: BubbleCommonProps & {
405
+ content: string;
406
+ }) => VNode<RendererNode, RendererElement, {
407
+ [key: string]: any;
408
+ }>;
409
+ 'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
410
+ [key: string]: any;
411
+ }>;
412
+ tool: DefineComponent< {
413
+ name: string;
414
+ status: "running" | "success" | "failed" | "cancelled";
415
+ content?: string | {
416
+ params?: object;
417
+ result?: object;
418
+ [x: string]: unknown;
419
+ };
420
+ formatPretty?: boolean;
421
+ defaultOpen?: boolean;
422
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
423
+ name: string;
424
+ status: "running" | "success" | "failed" | "cancelled";
425
+ content?: string | {
426
+ params?: object;
427
+ result?: object;
428
+ [x: string]: unknown;
429
+ };
430
+ formatPretty?: boolean;
431
+ defaultOpen?: boolean;
432
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
433
+ reasoning: DefineComponent< {
434
+ content: string;
435
+ thinking?: boolean;
436
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
437
+ content: string;
438
+ thinking?: boolean;
439
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
440
+ markdown: BubbleMarkdownContentRenderer;
441
+ templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
442
+ attachments: FileMeta[];
443
+ templateData: UserItem[];
444
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
445
+ 'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
446
+ 'error-text': DefineComponent< {
447
+ content: string;
448
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
449
+ content: string;
450
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
451
+ };
452
+ setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
453
+ generating: ComputedRef<boolean>;
454
+ lastSchemaCardId: ComputedRef<any>;
455
+ continueChatAction: {
456
+ name: string;
457
+ description: string;
458
+ execute: (params: {
459
+ message: string;
460
+ }, context: Record<string, any>) => void;
461
+ parameters: {
462
+ type: "object";
463
+ properties: {
464
+ message: {
465
+ type: string;
466
+ description: string;
467
+ };
468
+ };
469
+ };
470
+ };
471
+ saveStateAction: {
472
+ name: string;
473
+ description: string;
474
+ execute: (params: any, context: Record<string | symbol, any>) => void;
475
+ parameters: {
476
+ type: "null";
477
+ };
478
+ };
479
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
480
+ beforeCreate?: (() => void) | (() => void)[];
481
+ created?: (() => void) | (() => void)[];
482
+ beforeMount?: (() => void) | (() => void)[];
483
+ mounted?: (() => void) | (() => void)[];
484
+ beforeUpdate?: (() => void) | (() => void)[];
485
+ updated?: (() => void) | (() => void)[];
486
+ activated?: (() => void) | (() => void)[];
487
+ deactivated?: (() => void) | (() => void)[];
488
+ beforeDestroy?: (() => void) | (() => void)[];
489
+ beforeUnmount?: (() => void) | (() => void)[];
490
+ destroyed?: (() => void) | (() => void)[];
491
+ unmounted?: (() => void) | (() => void)[];
492
+ renderTracked?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
493
+ renderTriggered?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
494
+ errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
495
+ };
496
+ $forceUpdate: () => void;
497
+ $nextTick: nextTick;
498
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle;
499
+ } & Readonly<{}> & Omit<Readonly<IChatProps> & Readonly<{}>, "generating" | "continueChatAction" | "saveStateAction" | "setInputMessage" | "handleNewConversation" | "getProps" | "getConversation" | "getResponseHandlers" | "setResponseHandlers" | "getMessageRenderers" | "setMessageRenderer" | "lastSchemaCardId"> & ShallowUnwrapRef< {
500
+ setInputMessage: (message: string) => void;
501
+ handleNewConversation: () => void;
502
+ getProps: () => IChatProps;
503
+ getConversation: () => UseConversationReturn;
504
+ getResponseHandlers: () => IResponseHandler<IStreamData>[];
505
+ setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
506
+ getMessageRenderers: () => {
507
+ 'custom-text': (props: BubbleCommonProps & {
508
+ content: string;
509
+ }) => VNode<RendererNode, RendererElement, {
510
+ [key: string]: any;
511
+ }>;
512
+ 'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
513
+ [key: string]: any;
514
+ }>;
515
+ tool: DefineComponent< {
516
+ name: string;
517
+ status: "running" | "success" | "failed" | "cancelled";
518
+ content?: string | {
519
+ params?: object;
520
+ result?: object;
521
+ [x: string]: unknown;
522
+ };
523
+ formatPretty?: boolean;
524
+ defaultOpen?: boolean;
525
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
526
+ name: string;
527
+ status: "running" | "success" | "failed" | "cancelled";
528
+ content?: string | {
529
+ params?: object;
530
+ result?: object;
531
+ [x: string]: unknown;
532
+ };
533
+ formatPretty?: boolean;
534
+ defaultOpen?: boolean;
535
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
536
+ reasoning: DefineComponent< {
537
+ content: string;
538
+ thinking?: boolean;
539
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
540
+ content: string;
541
+ thinking?: boolean;
542
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
543
+ markdown: BubbleMarkdownContentRenderer;
544
+ templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
545
+ attachments: FileMeta[];
546
+ templateData: UserItem[];
547
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
548
+ 'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
549
+ 'error-text': DefineComponent< {
550
+ content: string;
551
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
552
+ content: string;
553
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
554
+ };
555
+ setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
556
+ generating: ComputedRef<boolean>;
557
+ lastSchemaCardId: ComputedRef<any>;
558
+ continueChatAction: {
559
+ name: string;
560
+ description: string;
561
+ execute: (params: {
562
+ message: string;
563
+ }, context: Record<string, any>) => void;
564
+ parameters: {
565
+ type: "object";
566
+ properties: {
567
+ message: {
568
+ type: string;
569
+ description: string;
570
+ };
571
+ };
572
+ };
573
+ };
574
+ saveStateAction: {
575
+ name: string;
576
+ description: string;
577
+ execute: (params: any, context: Record<string | symbol, any>) => void;
578
+ parameters: {
579
+ type: "null";
580
+ };
581
+ };
582
+ }> & {} & ComponentCustomProperties & {} & {
583
+ $slots: {
584
+ empty?(_: {}): any;
585
+ };
586
+ };
587
+ }, HTMLDivElement, ComponentProvideOptions, {
588
+ P: {};
589
+ B: {};
590
+ D: {};
591
+ C: {};
592
+ M: {};
593
+ Defaults: {};
594
+ }, Readonly<IChatProps> & Readonly<{}>, {
595
+ $: ComponentInternalInstance;
596
+ $data: {};
597
+ $props: Partial<{}> & Omit<{
598
+ readonly url?: string;
599
+ readonly model?: string;
600
+ readonly temperature?: number;
601
+ readonly messages?: IMessage[];
602
+ readonly chatConfig?: IChatConfig;
603
+ readonly requiredCompleteFieldSelectors?: string[];
604
+ readonly customComponents?: ICustomComponentItem[];
605
+ readonly customSnippets?: IGenPromptSnippet[];
606
+ readonly customExamples?: IGenPromptExample[];
607
+ readonly customActions?: ICustomActionItem[];
608
+ readonly rendererSlots?: IRendererSlots_2;
609
+ readonly thinkComponent?: Component<BubbleProps>;
610
+ readonly roles?: IRolesConfig;
611
+ readonly features?: ModelCapability;
612
+ readonly customFetch?: CustomFetch;
613
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>;
614
+ $attrs: {
615
+ [x: string]: unknown;
616
+ };
617
+ $refs: {
618
+ [x: string]: unknown;
619
+ } & {
620
+ messagesContainer: HTMLDivElement;
621
+ };
622
+ $slots: Readonly<{
623
+ [name: string]: Slot<any>;
624
+ }> & {
625
+ empty?(_: {}): any;
626
+ };
627
+ $root: ComponentPublicInstance | null;
628
+ $parent: ComponentPublicInstance | null;
629
+ $host: Element | null;
630
+ $emit: (event: string, ...args: any[]) => void;
631
+ $el: HTMLDivElement;
632
+ $options: ComponentOptionsBase<Readonly<IChatProps> & Readonly<{}>, {
633
+ setInputMessage: (message: string) => void;
634
+ handleNewConversation: () => void;
635
+ getProps: () => IChatProps;
636
+ getConversation: () => UseConversationReturn;
637
+ getResponseHandlers: () => IResponseHandler<IStreamData>[];
638
+ setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
639
+ getMessageRenderers: () => {
640
+ 'custom-text': (props: BubbleCommonProps & {
641
+ content: string;
642
+ }) => VNode<RendererNode, RendererElement, {
643
+ [key: string]: any;
644
+ }>;
645
+ 'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
646
+ [key: string]: any;
647
+ }>;
648
+ tool: DefineComponent< {
649
+ name: string;
650
+ status: "running" | "success" | "failed" | "cancelled";
651
+ content?: string | {
652
+ params?: object;
653
+ result?: object;
654
+ [x: string]: unknown;
655
+ };
656
+ formatPretty?: boolean;
657
+ defaultOpen?: boolean;
658
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
659
+ name: string;
660
+ status: "running" | "success" | "failed" | "cancelled";
661
+ content?: string | {
662
+ params?: object;
663
+ result?: object;
664
+ [x: string]: unknown;
665
+ };
666
+ formatPretty?: boolean;
667
+ defaultOpen?: boolean;
668
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
669
+ reasoning: DefineComponent< {
670
+ content: string;
671
+ thinking?: boolean;
672
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
673
+ content: string;
674
+ thinking?: boolean;
675
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
676
+ markdown: BubbleMarkdownContentRenderer;
677
+ templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
678
+ attachments: FileMeta[];
679
+ templateData: UserItem[];
680
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
681
+ 'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
682
+ 'error-text': DefineComponent< {
683
+ content: string;
684
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
685
+ content: string;
686
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
687
+ };
688
+ setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
689
+ generating: ComputedRef<boolean>;
690
+ lastSchemaCardId: ComputedRef<any>;
691
+ continueChatAction: {
692
+ name: string;
693
+ description: string;
694
+ execute: (params: {
695
+ message: string;
696
+ }, context: Record<string, any>) => void;
697
+ parameters: {
698
+ type: "object";
699
+ properties: {
700
+ message: {
701
+ type: string;
702
+ description: string;
703
+ };
704
+ };
705
+ };
706
+ };
707
+ saveStateAction: {
708
+ name: string;
709
+ description: string;
710
+ execute: (params: any, context: Record<string | symbol, any>) => void;
711
+ parameters: {
712
+ type: "null";
713
+ };
714
+ };
715
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
716
+ beforeCreate?: (() => void) | (() => void)[];
717
+ created?: (() => void) | (() => void)[];
718
+ beforeMount?: (() => void) | (() => void)[];
719
+ mounted?: (() => void) | (() => void)[];
720
+ beforeUpdate?: (() => void) | (() => void)[];
721
+ updated?: (() => void) | (() => void)[];
722
+ activated?: (() => void) | (() => void)[];
723
+ deactivated?: (() => void) | (() => void)[];
724
+ beforeDestroy?: (() => void) | (() => void)[];
725
+ beforeUnmount?: (() => void) | (() => void)[];
726
+ destroyed?: (() => void) | (() => void)[];
727
+ unmounted?: (() => void) | (() => void)[];
728
+ renderTracked?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
729
+ renderTriggered?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
730
+ errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
731
+ };
732
+ $forceUpdate: () => void;
733
+ $nextTick: nextTick;
734
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle;
735
+ messages?: IMessage[];
736
+ customComponents?: ICustomComponentItem[];
737
+ customActions?: ICustomActionItem[];
738
+ requiredCompleteFieldSelectors?: string[];
739
+ customFetch?: CustomFetch;
740
+ url?: string;
741
+ model?: string;
742
+ temperature?: number;
743
+ customSnippets?: IGenPromptSnippet[];
744
+ customExamples?: IGenPromptExample[];
745
+ chatConfig?: IChatConfig;
746
+ rendererSlots?: IRendererSlots_2;
747
+ thinkComponent?: Component<BubbleProps>;
748
+ roles?: IRolesConfig;
749
+ features?: ModelCapability;
750
+ setInputMessage: (message: string) => void;
751
+ handleNewConversation: () => void;
752
+ getProps: () => IChatProps;
753
+ getConversation: () => UseConversationReturn;
754
+ getResponseHandlers: () => IResponseHandler<IStreamData>[];
755
+ setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
756
+ getMessageRenderers: () => {
757
+ 'custom-text': (props: BubbleCommonProps & {
758
+ content: string;
759
+ }) => VNode<RendererNode, RendererElement, {
760
+ [key: string]: any;
761
+ }>;
762
+ 'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
763
+ [key: string]: any;
764
+ }>;
765
+ tool: DefineComponent< {
766
+ name: string;
767
+ status: "running" | "success" | "failed" | "cancelled";
768
+ content?: string | {
769
+ params?: object;
770
+ result?: object;
771
+ [x: string]: unknown;
772
+ };
773
+ formatPretty?: boolean;
774
+ defaultOpen?: boolean;
775
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
776
+ name: string;
777
+ status: "running" | "success" | "failed" | "cancelled";
778
+ content?: string | {
779
+ params?: object;
780
+ result?: object;
781
+ [x: string]: unknown;
782
+ };
783
+ formatPretty?: boolean;
784
+ defaultOpen?: boolean;
785
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
786
+ reasoning: DefineComponent< {
787
+ content: string;
788
+ thinking?: boolean;
789
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
790
+ content: string;
791
+ thinking?: boolean;
792
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
793
+ markdown: BubbleMarkdownContentRenderer;
794
+ templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
795
+ attachments: FileMeta[];
796
+ templateData: UserItem[];
797
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
798
+ 'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
799
+ 'error-text': DefineComponent< {
800
+ content: string;
801
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
802
+ content: string;
803
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
804
+ };
805
+ setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
806
+ generating: boolean;
807
+ lastSchemaCardId: any;
808
+ continueChatAction: {
809
+ name: string;
810
+ description: string;
811
+ execute: (params: {
812
+ message: string;
813
+ }, context: Record<string, any>) => void;
814
+ parameters: {
815
+ type: "object";
816
+ properties: {
817
+ message: {
818
+ type: string;
819
+ description: string;
820
+ };
821
+ };
822
+ };
823
+ };
824
+ saveStateAction: {
825
+ name: string;
826
+ description: string;
827
+ execute: (params: any, context: Record<string | symbol, any>) => void;
828
+ parameters: {
829
+ type: "null";
830
+ };
831
+ };
832
+ }, {}, {}, {}, {}>;
833
+ __isFragment?: never;
834
+ __isTeleport?: never;
835
+ __isSuspense?: never;
836
+ } & ComponentOptionsBase<Readonly<IChatProps> & Readonly<{}>, {
54
837
  $: ComponentInternalInstance;
55
838
  $data: {};
56
839
  $props: Partial<{}> & Omit<{
@@ -288,539 +1071,9 @@ parameters: {
288
1071
  type: "null";
289
1072
  };
290
1073
  };
291
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IChatProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {
292
- chatRef: {
293
- $: ComponentInternalInstance;
294
- $data: {};
295
- $props: Partial<{}> & Omit<{
296
- readonly url?: string;
297
- readonly model?: string;
298
- readonly temperature?: number;
299
- readonly messages?: IMessage[];
300
- readonly chatConfig?: IChatConfig;
301
- readonly requiredCompleteFieldSelectors?: string[];
302
- readonly customComponents?: ICustomComponentItem[];
303
- readonly customSnippets?: IGenPromptSnippet[];
304
- readonly customExamples?: IGenPromptExample[];
305
- readonly customActions?: ICustomActionItem[];
306
- readonly rendererSlots?: IRendererSlots_2;
307
- readonly thinkComponent?: Component<BubbleProps>;
308
- readonly roles?: IRolesConfig;
309
- readonly features?: ModelCapability;
310
- readonly customFetch?: CustomFetch;
311
- } & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>;
312
- $attrs: {
313
- [x: string]: unknown;
314
- };
315
- $refs: {
316
- [x: string]: unknown;
317
- } & {
318
- messagesContainer: HTMLDivElement;
319
- };
320
- $slots: Readonly<{
321
- [name: string]: Slot<any>;
322
- }>;
323
- $root: ComponentPublicInstance | null;
324
- $parent: ComponentPublicInstance | null;
325
- $host: Element | null;
326
- $emit: (event: string, ...args: any[]) => void;
327
- $el: HTMLDivElement;
328
- $options: ComponentOptionsBase<Readonly<IChatProps> & Readonly<{}>, {
329
- setInputMessage: (message: string) => void;
330
- handleNewConversation: () => void;
331
- getProps: () => IChatProps;
332
- getConversation: () => UseConversationReturn;
333
- getResponseHandlers: () => IResponseHandler<IStreamData>[];
334
- setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
335
- getMessageRenderers: () => {
336
- 'custom-text': (props: BubbleCommonProps & {
337
- content: string;
338
- }) => VNode<RendererNode, RendererElement, {
339
- [key: string]: any;
340
- }>;
341
- 'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
342
- [key: string]: any;
343
- }>;
344
- tool: DefineComponent< {
345
- name: string;
346
- status: "running" | "success" | "failed" | "cancelled";
347
- content?: string | {
348
- params?: object;
349
- result?: object;
350
- [x: string]: unknown;
351
- };
352
- formatPretty?: boolean;
353
- defaultOpen?: boolean;
354
- }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
355
- name: string;
356
- status: "running" | "success" | "failed" | "cancelled";
357
- content?: string | {
358
- params?: object;
359
- result?: object;
360
- [x: string]: unknown;
361
- };
362
- formatPretty?: boolean;
363
- defaultOpen?: boolean;
364
- }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
365
- reasoning: DefineComponent< {
366
- content: string;
367
- thinking?: boolean;
368
- }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
369
- content: string;
370
- thinking?: boolean;
371
- }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
372
- markdown: BubbleMarkdownContentRenderer;
373
- templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
374
- attachments: FileMeta[];
375
- templateData: UserItem[];
376
- }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
377
- 'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
378
- 'error-text': DefineComponent< {
379
- content: string;
380
- }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
381
- content: string;
382
- }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
383
- };
384
- setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
385
- generating: ComputedRef<boolean>;
386
- lastSchemaCardId: ComputedRef<any>;
387
- continueChatAction: {
388
- name: string;
389
- description: string;
390
- execute: (params: {
391
- message: string;
392
- }, context: Record<string, any>) => void;
393
- parameters: {
394
- type: "object";
395
- properties: {
396
- message: {
397
- type: string;
398
- description: string;
399
- };
400
- };
401
- };
402
- };
403
- saveStateAction: {
404
- name: string;
405
- description: string;
406
- execute: (params: any, context: Record<string | symbol, any>) => void;
407
- parameters: {
408
- type: "null";
409
- };
410
- };
411
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
412
- beforeCreate?: (() => void) | (() => void)[];
413
- created?: (() => void) | (() => void)[];
414
- beforeMount?: (() => void) | (() => void)[];
415
- mounted?: (() => void) | (() => void)[];
416
- beforeUpdate?: (() => void) | (() => void)[];
417
- updated?: (() => void) | (() => void)[];
418
- activated?: (() => void) | (() => void)[];
419
- deactivated?: (() => void) | (() => void)[];
420
- beforeDestroy?: (() => void) | (() => void)[];
421
- beforeUnmount?: (() => void) | (() => void)[];
422
- destroyed?: (() => void) | (() => void)[];
423
- unmounted?: (() => void) | (() => void)[];
424
- renderTracked?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
425
- renderTriggered?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
426
- errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
427
- };
428
- $forceUpdate: () => void;
429
- $nextTick: nextTick;
430
- $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle;
431
- } & Readonly<{}> & Omit<Readonly<IChatProps> & Readonly<{}>, "generating" | "continueChatAction" | "saveStateAction" | "setInputMessage" | "handleNewConversation" | "getProps" | "getConversation" | "getResponseHandlers" | "setResponseHandlers" | "getMessageRenderers" | "setMessageRenderer" | "lastSchemaCardId"> & ShallowUnwrapRef< {
432
- setInputMessage: (message: string) => void;
433
- handleNewConversation: () => void;
434
- getProps: () => IChatProps;
435
- getConversation: () => UseConversationReturn;
436
- getResponseHandlers: () => IResponseHandler<IStreamData>[];
437
- setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
438
- getMessageRenderers: () => {
439
- 'custom-text': (props: BubbleCommonProps & {
440
- content: string;
441
- }) => VNode<RendererNode, RendererElement, {
442
- [key: string]: any;
443
- }>;
444
- 'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
445
- [key: string]: any;
446
- }>;
447
- tool: DefineComponent< {
448
- name: string;
449
- status: "running" | "success" | "failed" | "cancelled";
450
- content?: string | {
451
- params?: object;
452
- result?: object;
453
- [x: string]: unknown;
454
- };
455
- formatPretty?: boolean;
456
- defaultOpen?: boolean;
457
- }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
458
- name: string;
459
- status: "running" | "success" | "failed" | "cancelled";
460
- content?: string | {
461
- params?: object;
462
- result?: object;
463
- [x: string]: unknown;
464
- };
465
- formatPretty?: boolean;
466
- defaultOpen?: boolean;
467
- }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
468
- reasoning: DefineComponent< {
469
- content: string;
470
- thinking?: boolean;
471
- }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
472
- content: string;
473
- thinking?: boolean;
474
- }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
475
- markdown: BubbleMarkdownContentRenderer;
476
- templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
477
- attachments: FileMeta[];
478
- templateData: UserItem[];
479
- }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
480
- 'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
481
- 'error-text': DefineComponent< {
482
- content: string;
483
- }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
484
- content: string;
485
- }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
486
- };
487
- setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
488
- generating: ComputedRef<boolean>;
489
- lastSchemaCardId: ComputedRef<any>;
490
- continueChatAction: {
491
- name: string;
492
- description: string;
493
- execute: (params: {
494
- message: string;
495
- }, context: Record<string, any>) => void;
496
- parameters: {
497
- type: "object";
498
- properties: {
499
- message: {
500
- type: string;
501
- description: string;
502
- };
503
- };
504
- };
505
- };
506
- saveStateAction: {
507
- name: string;
508
- description: string;
509
- execute: (params: any, context: Record<string | symbol, any>) => void;
510
- parameters: {
511
- type: "null";
512
- };
513
- };
514
- }> & {} & ComponentCustomProperties & {} & {
515
- $slots: {
516
- empty?(_: {}): any;
517
- };
518
- };
519
- }, HTMLDivElement>;
520
-
521
- declare function __VLS_template(): {
522
- attrs: Partial<{}>;
523
- slots: any;
524
- refs: {
525
- chatRef: {
526
- $: ComponentInternalInstance;
527
- $data: {};
528
- $props: Partial<{}> & Omit<{
529
- readonly url?: string;
530
- readonly model?: string;
531
- readonly temperature?: number;
532
- readonly messages?: IMessage[];
533
- readonly chatConfig?: IChatConfig;
534
- readonly requiredCompleteFieldSelectors?: string[];
535
- readonly customComponents?: ICustomComponentItem[];
536
- readonly customSnippets?: IGenPromptSnippet[];
537
- readonly customExamples?: IGenPromptExample[];
538
- readonly customActions?: ICustomActionItem[];
539
- readonly rendererSlots?: IRendererSlots_2;
540
- readonly thinkComponent?: Component<BubbleProps>;
541
- readonly roles?: IRolesConfig;
542
- readonly features?: ModelCapability;
543
- readonly customFetch?: CustomFetch;
544
- } & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>;
545
- $attrs: {
546
- [x: string]: unknown;
547
- };
548
- $refs: {
549
- [x: string]: unknown;
550
- } & {
551
- messagesContainer: HTMLDivElement;
552
- };
553
- $slots: Readonly<{
554
- [name: string]: Slot<any>;
555
- }>;
556
- $root: ComponentPublicInstance | null;
557
- $parent: ComponentPublicInstance | null;
558
- $host: Element | null;
559
- $emit: (event: string, ...args: any[]) => void;
560
- $el: HTMLDivElement;
561
- $options: ComponentOptionsBase<Readonly<IChatProps> & Readonly<{}>, {
562
- setInputMessage: (message: string) => void;
563
- handleNewConversation: () => void;
564
- getProps: () => IChatProps;
565
- getConversation: () => UseConversationReturn;
566
- getResponseHandlers: () => IResponseHandler<IStreamData>[];
567
- setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
568
- getMessageRenderers: () => {
569
- 'custom-text': (props: BubbleCommonProps & {
570
- content: string;
571
- }) => VNode<RendererNode, RendererElement, {
572
- [key: string]: any;
573
- }>;
574
- 'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
575
- [key: string]: any;
576
- }>;
577
- tool: DefineComponent< {
578
- name: string;
579
- status: "running" | "success" | "failed" | "cancelled";
580
- content?: string | {
581
- params?: object;
582
- result?: object;
583
- [x: string]: unknown;
584
- };
585
- formatPretty?: boolean;
586
- defaultOpen?: boolean;
587
- }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
588
- name: string;
589
- status: "running" | "success" | "failed" | "cancelled";
590
- content?: string | {
591
- params?: object;
592
- result?: object;
593
- [x: string]: unknown;
594
- };
595
- formatPretty?: boolean;
596
- defaultOpen?: boolean;
597
- }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
598
- reasoning: DefineComponent< {
599
- content: string;
600
- thinking?: boolean;
601
- }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
602
- content: string;
603
- thinking?: boolean;
604
- }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
605
- markdown: BubbleMarkdownContentRenderer;
606
- templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
607
- attachments: FileMeta[];
608
- templateData: UserItem[];
609
- }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
610
- 'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
611
- 'error-text': DefineComponent< {
612
- content: string;
613
- }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
614
- content: string;
615
- }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
616
- };
617
- setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
618
- generating: ComputedRef<boolean>;
619
- lastSchemaCardId: ComputedRef<any>;
620
- continueChatAction: {
621
- name: string;
622
- description: string;
623
- execute: (params: {
624
- message: string;
625
- }, context: Record<string, any>) => void;
626
- parameters: {
627
- type: "object";
628
- properties: {
629
- message: {
630
- type: string;
631
- description: string;
632
- };
633
- };
634
- };
635
- };
636
- saveStateAction: {
637
- name: string;
638
- description: string;
639
- execute: (params: any, context: Record<string | symbol, any>) => void;
640
- parameters: {
641
- type: "null";
642
- };
643
- };
644
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
645
- beforeCreate?: (() => void) | (() => void)[];
646
- created?: (() => void) | (() => void)[];
647
- beforeMount?: (() => void) | (() => void)[];
648
- mounted?: (() => void) | (() => void)[];
649
- beforeUpdate?: (() => void) | (() => void)[];
650
- updated?: (() => void) | (() => void)[];
651
- activated?: (() => void) | (() => void)[];
652
- deactivated?: (() => void) | (() => void)[];
653
- beforeDestroy?: (() => void) | (() => void)[];
654
- beforeUnmount?: (() => void) | (() => void)[];
655
- destroyed?: (() => void) | (() => void)[];
656
- unmounted?: (() => void) | (() => void)[];
657
- renderTracked?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
658
- renderTriggered?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
659
- errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
660
- };
661
- $forceUpdate: () => void;
662
- $nextTick: nextTick;
663
- $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle;
664
- } & Readonly<{}> & Omit<Readonly<IChatProps> & Readonly<{}>, "generating" | "continueChatAction" | "saveStateAction" | "setInputMessage" | "handleNewConversation" | "getProps" | "getConversation" | "getResponseHandlers" | "setResponseHandlers" | "getMessageRenderers" | "setMessageRenderer" | "lastSchemaCardId"> & ShallowUnwrapRef< {
665
- setInputMessage: (message: string) => void;
666
- handleNewConversation: () => void;
667
- getProps: () => IChatProps;
668
- getConversation: () => UseConversationReturn;
669
- getResponseHandlers: () => IResponseHandler<IStreamData>[];
670
- setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
671
- getMessageRenderers: () => {
672
- 'custom-text': (props: BubbleCommonProps & {
673
- content: string;
674
- }) => VNode<RendererNode, RendererElement, {
675
- [key: string]: any;
676
- }>;
677
- 'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
678
- [key: string]: any;
679
- }>;
680
- tool: DefineComponent< {
681
- name: string;
682
- status: "running" | "success" | "failed" | "cancelled";
683
- content?: string | {
684
- params?: object;
685
- result?: object;
686
- [x: string]: unknown;
687
- };
688
- formatPretty?: boolean;
689
- defaultOpen?: boolean;
690
- }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
691
- name: string;
692
- status: "running" | "success" | "failed" | "cancelled";
693
- content?: string | {
694
- params?: object;
695
- result?: object;
696
- [x: string]: unknown;
697
- };
698
- formatPretty?: boolean;
699
- defaultOpen?: boolean;
700
- }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
701
- reasoning: DefineComponent< {
702
- content: string;
703
- thinking?: boolean;
704
- }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
705
- content: string;
706
- thinking?: boolean;
707
- }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
708
- markdown: BubbleMarkdownContentRenderer;
709
- templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
710
- attachments: FileMeta[];
711
- templateData: UserItem[];
712
- }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
713
- 'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
714
- 'error-text': DefineComponent< {
715
- content: string;
716
- }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
717
- content: string;
718
- }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
719
- };
720
- setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
721
- generating: ComputedRef<boolean>;
722
- lastSchemaCardId: ComputedRef<any>;
723
- continueChatAction: {
724
- name: string;
725
- description: string;
726
- execute: (params: {
727
- message: string;
728
- }, context: Record<string, any>) => void;
729
- parameters: {
730
- type: "object";
731
- properties: {
732
- message: {
733
- type: string;
734
- description: string;
735
- };
736
- };
737
- };
738
- };
739
- saveStateAction: {
740
- name: string;
741
- description: string;
742
- execute: (params: any, context: Record<string | symbol, any>) => void;
743
- parameters: {
744
- type: "null";
745
- };
746
- };
747
- }> & {} & ComponentCustomProperties & {} & {
748
- $slots: {
749
- empty?(_: {}): any;
750
- };
751
- };
752
- };
753
- rootEl: HTMLDivElement;
754
- };
755
-
756
- declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
757
-
758
- declare type __VLS_WithTemplateSlots<T, S> = T & {
759
- new (): {
760
- $slots: S;
761
- };
762
- };
763
-
764
- export declare function createI18n(options?: I18nOptions): I18nInstance;
765
-
766
- /**
767
- * 自定义请求函数类型
768
- * @param url 请求地址
769
- * @param options 请求选项(包含 method, headers, body, signal 等)
770
- * @returns 返回 Response 对象或 Promise<Response>
771
- */
772
- export declare type CustomFetch = (url: string, options: {
773
- method: string;
774
- headers: Record<string, string>;
775
- body: string;
776
- signal?: AbortSignal;
777
- }) => Promise<Response> | Response;
778
-
779
- export declare const DEFAULT_IMAGE_FEATURES: ImageFeatures;
780
-
781
- export declare const emitter: EventEmitter;
782
-
783
- export declare class EventEmitter {
784
- private events;
785
- constructor();
786
- /**
787
- * @param {string} eventName - 事件名
788
- * @param {Function} callback - 回调函数
789
- * @param {boolean} [once=false] - 是否只触发一次
790
- */
791
- on(eventName: string, callback: Function, once?: boolean): void;
792
- /**
793
- * @param {string} eventName - 事件名
794
- * @param {Function} callback - 要移除的回调(必须是注册时的同一个函数引用)
795
- */
796
- off(eventName: string, callback: Function): void;
797
- /**
798
- * @param {string} eventName - 事件名
799
- * @param {...any} args - 传递给回调的参数
800
- */
801
- emit(eventName: string, ...args: any[]): void;
802
- /**
803
- * @param {string} eventName - 事件名
804
- * @param {Function} callback - 回调函数
805
- */
806
- once(eventName: string, callback: Function): void;
807
- }
808
-
809
- declare interface FileMeta {
810
- name: string;
811
- type: string;
812
- size: number;
813
- lastModified: number;
814
- base64: string;
815
- }
816
-
817
- export declare const GENUI_CONFIG: unique symbol;
818
-
819
- export declare const GENUI_I18N: unique symbol;
820
-
821
- export declare const GENUI_MATERIALS: InjectionKey<IMaterials>;
822
-
823
- export declare const GenuiLegacyChat: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
1074
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
1075
+ $slots: any;
1076
+ });
824
1077
 
825
1078
  export declare interface I18nInstance {
826
1079
  locale: Ref<string>;
@@ -970,6 +1223,8 @@ declare interface IResponseHandler<T> {
970
1223
  match: (data: T, context: any) => boolean;
971
1224
  handler: (data: T, context: any) => boolean;
972
1225
  notMatchHandler?: (data: T, context: any) => boolean;
1226
+ beforeRequest?: (context: any) => void;
1227
+ onRequestError?: (context: any, error?: unknown) => void;
973
1228
  start?: (context: any, handlers: {
974
1229
  onData: (data: IChatMessage) => void;
975
1230
  onDone: () => void;