@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.
- package/README.md +11 -2
- package/dist/ConfigProvider-D6LFAgg5.js +131 -0
- package/dist/ConfigProvider-D6LFAgg5.js.map +1 -0
- package/dist/GenuiRenderer-f2_6u1TA.js +141 -0
- package/dist/GenuiRenderer-f2_6u1TA.js.map +1 -0
- package/dist/chat.d.ts +6 -0
- package/dist/chat.js +17 -15
- package/dist/chat.js.map +1 -1
- package/dist/chat.types-DEDNSs5o.js +1817 -0
- package/dist/chat.types-DEDNSs5o.js.map +1 -0
- package/dist/code-generator.d.ts +139 -0
- package/dist/code-generator.js +6 -0
- package/dist/code-generator.js.map +1 -0
- package/dist/config-provider.d.ts +24 -12
- package/dist/config-provider.js +5 -5
- package/dist/index.d.ts +1100 -677
- package/dist/index.js +39 -31
- package/dist/index.js.map +1 -1
- package/dist/{GenuiRenderer-C2w3WGQa.js → injection-tokens-DDgspg4x.js} +3474 -3497
- package/dist/injection-tokens-DDgspg4x.js.map +1 -0
- package/dist/legacy-chat.d.ts +789 -534
- package/dist/legacy-chat.js +63 -19
- package/dist/legacy-chat.js.map +1 -1
- package/dist/legacy-config-provider.d.ts +58 -0
- package/dist/legacy-config-provider.js +25 -0
- package/dist/legacy-config-provider.js.map +1 -0
- package/dist/legacy-renderer.d.ts +28 -20
- package/dist/legacy-renderer.js +38 -4
- package/dist/legacy-renderer.js.map +1 -1
- package/dist/renderer.d.ts +3 -2
- package/dist/renderer.js +1 -1
- package/dist/transform-jsx.d.ts +2 -3
- package/dist/transform-jsx.js +5 -2
- package/dist/transform-jsx.js.map +1 -1
- package/dist/vue-code-generator-CwPQ3GDh.js +573 -0
- package/dist/vue-code-generator-CwPQ3GDh.js.map +1 -0
- package/package.json +18 -7
- package/dist/ConfigProvider-BzxW9L3f.js +0 -95
- package/dist/ConfigProvider-BzxW9L3f.js.map +0 -1
- package/dist/GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-Bdu-r86w.js +0 -49
- package/dist/GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-Bdu-r86w.js.map +0 -1
- package/dist/GenuiRenderer-C2w3WGQa.js.map +0 -1
- package/dist/GenuiRendererWithMaterials.vue_vue_type_script_setup_true_lang-BlhUkAxb.js +0 -39
- package/dist/GenuiRendererWithMaterials.vue_vue_type_script_setup_true_lang-BlhUkAxb.js.map +0 -1
- package/dist/chat.types-BqZOCKBz.js +0 -1794
- package/dist/chat.types-BqZOCKBz.js.map +0 -1
- package/dist/injection-tokens-CuDQs1ne.js +0 -114
- package/dist/injection-tokens-CuDQs1ne.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -21,7 +21,9 @@ import { ComputedRef } from 'vue';
|
|
|
21
21
|
import { Conversation } from '@opentiny/tiny-robot-kit';
|
|
22
22
|
import { ConversationState } from '@opentiny/tiny-robot-kit';
|
|
23
23
|
import { ConversationStorageStrategy } from '@opentiny/tiny-robot-kit';
|
|
24
|
+
import { CreateComponentPublicInstanceWithMixins } from 'vue';
|
|
24
25
|
import { DebuggerEvent } from 'vue';
|
|
26
|
+
import { default as default_2 } from '@opentiny/tiny-schema-renderer';
|
|
25
27
|
import { DefineComponent } from 'vue';
|
|
26
28
|
import { GlobalComponents } from 'vue';
|
|
27
29
|
import { GlobalDirectives } from 'vue';
|
|
@@ -34,17 +36,19 @@ import { IMaterials } from '@opentiny/genui-sdk-core';
|
|
|
34
36
|
import { InjectionKey } from 'vue';
|
|
35
37
|
import { INotificationPayload } from '@opentiny/genui-sdk-core';
|
|
36
38
|
import { IStreamData } from '@opentiny/genui-sdk-core';
|
|
39
|
+
import { MergedMaterials } from '@opentiny/genui-sdk-core';
|
|
37
40
|
import { MessageState } from '@opentiny/tiny-robot-kit';
|
|
38
41
|
import { nextTick } from 'vue';
|
|
42
|
+
import { NodeSchema } from '@opentiny/genui-sdk-core';
|
|
39
43
|
import { OnCleanup } from '@vue/reactivity';
|
|
40
44
|
import { PublicProps } from 'vue';
|
|
41
45
|
import { Reactive } from 'vue';
|
|
42
46
|
import { Ref } from 'vue';
|
|
43
|
-
import { RENDERER_SETTINGS_KEY } from '../../src/types/tiny-schema-renderer.d.ts';
|
|
44
47
|
import { RendererElement } from 'vue';
|
|
45
48
|
import { RendererNode } from 'vue';
|
|
46
49
|
import { ShallowUnwrapRef } from 'vue';
|
|
47
50
|
import { Slot } from 'vue';
|
|
51
|
+
import { ThemeColorScheme } from '@opentiny/genui-sdk-core';
|
|
48
52
|
import { UnwrapNestedRefs } from 'vue';
|
|
49
53
|
import { UseConversationOptions } from '@opentiny/tiny-robot-kit';
|
|
50
54
|
import { UseMessageReturn as UseMessageReturn_2 } from '@opentiny/tiny-robot-kit';
|
|
@@ -144,256 +148,906 @@ messagesContainer: HTMLDivElement;
|
|
|
144
148
|
declare const __VLS_component_2: DefineComponent<IRendererProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IRendererProps> & Readonly<{}>, {
|
|
145
149
|
isJsonComplete: boolean;
|
|
146
150
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
147
|
-
rendererInstance:
|
|
151
|
+
rendererInstance: default_2;
|
|
148
152
|
}, HTMLDivElement>;
|
|
149
153
|
|
|
150
154
|
declare const __VLS_component_3: DefineComponent<ConfigProviderProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ConfigProviderProps> & Readonly<{}>, {
|
|
151
155
|
id: string;
|
|
152
156
|
locale: string;
|
|
153
|
-
}, {}, {}, {}, string, ComponentProvideOptions, true, {
|
|
154
|
-
providerRef: unknown;
|
|
155
|
-
}, any>;
|
|
156
|
-
|
|
157
|
-
declare const __VLS_component_4: DefineComponent<IChatProps, {
|
|
158
|
-
$: ComponentInternalInstance;
|
|
159
|
-
$data: {};
|
|
160
|
-
$props: Partial<{}> & Omit<{
|
|
161
|
-
readonly url?: string;
|
|
162
|
-
readonly model?: string;
|
|
163
|
-
readonly temperature?: number;
|
|
164
|
-
readonly messages?: IMessage[];
|
|
165
|
-
readonly chatConfig?: IChatConfig;
|
|
166
|
-
readonly requiredCompleteFieldSelectors?: string[];
|
|
167
|
-
readonly customComponents?: ICustomComponentItem[];
|
|
168
|
-
readonly customSnippets?: IGenPromptSnippet[];
|
|
169
|
-
readonly customExamples?: IGenPromptExample[];
|
|
170
|
-
readonly customActions?: ICustomActionItem[];
|
|
171
|
-
readonly rendererSlots?: IRendererSlots;
|
|
172
|
-
readonly thinkComponent?: Component<BubbleProps>;
|
|
173
|
-
readonly roles?: IRolesConfig;
|
|
174
|
-
readonly features?: ModelCapability;
|
|
175
|
-
readonly customFetch?: CustomFetch;
|
|
176
|
-
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>;
|
|
177
|
-
$attrs: {
|
|
178
|
-
[x: string]: unknown;
|
|
179
|
-
};
|
|
180
|
-
$refs: {
|
|
181
|
-
[x: string]: unknown;
|
|
182
|
-
} & {
|
|
183
|
-
messagesContainer: HTMLDivElement;
|
|
184
|
-
};
|
|
185
|
-
$slots: Readonly<{
|
|
186
|
-
[name: string]: Slot<any>;
|
|
187
|
-
}> & {
|
|
188
|
-
empty?(_: {}): any;
|
|
189
|
-
};
|
|
190
|
-
$root: ComponentPublicInstance | null;
|
|
191
|
-
$parent: ComponentPublicInstance | null;
|
|
192
|
-
$host: Element | null;
|
|
193
|
-
$emit: (event: string, ...args: any[]) => void;
|
|
194
|
-
$el: HTMLDivElement;
|
|
195
|
-
$options: ComponentOptionsBase<Readonly<IChatProps> & Readonly<{}>, {
|
|
196
|
-
setInputMessage: (message: string) => void;
|
|
197
|
-
handleNewConversation: () => void;
|
|
198
|
-
getProps: () => IChatProps;
|
|
199
|
-
getConversation: () => UseConversationReturn;
|
|
200
|
-
getResponseHandlers: () => IResponseHandler<IStreamData>[];
|
|
201
|
-
setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
|
|
202
|
-
getMessageRenderers: () => {
|
|
203
|
-
'custom-text': (props: BubbleCommonProps & {
|
|
204
|
-
content: string;
|
|
205
|
-
}) => VNode<RendererNode, RendererElement, {
|
|
206
|
-
[key: string]: any;
|
|
207
|
-
}>;
|
|
208
|
-
'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
|
|
209
|
-
[key: string]: any;
|
|
210
|
-
}>;
|
|
211
|
-
tool: DefineComponent< {
|
|
212
|
-
name: string;
|
|
213
|
-
status: "running" | "success" | "failed" | "cancelled";
|
|
214
|
-
content?: string | {
|
|
215
|
-
params?: object;
|
|
216
|
-
result?: object;
|
|
217
|
-
[x: string]: unknown;
|
|
218
|
-
};
|
|
219
|
-
formatPretty?: boolean;
|
|
220
|
-
defaultOpen?: boolean;
|
|
221
|
-
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
222
|
-
name: string;
|
|
223
|
-
status: "running" | "success" | "failed" | "cancelled";
|
|
224
|
-
content?: string | {
|
|
225
|
-
params?: object;
|
|
226
|
-
result?: object;
|
|
227
|
-
[x: string]: unknown;
|
|
228
|
-
};
|
|
229
|
-
formatPretty?: boolean;
|
|
230
|
-
defaultOpen?: boolean;
|
|
231
|
-
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
232
|
-
reasoning: DefineComponent< {
|
|
233
|
-
content: string;
|
|
234
|
-
thinking?: boolean;
|
|
235
|
-
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
236
|
-
content: string;
|
|
237
|
-
thinking?: boolean;
|
|
238
|
-
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
239
|
-
markdown: BubbleMarkdownContentRenderer;
|
|
240
|
-
templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
241
|
-
attachments: FileMeta[];
|
|
242
|
-
templateData: UserItem[];
|
|
243
157
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
continueChatAction: {
|
|
255
|
-
name: string;
|
|
256
|
-
description: string;
|
|
257
|
-
execute: (params: {
|
|
258
|
-
message: string;
|
|
259
|
-
}, context: Record<string, any>) => void;
|
|
260
|
-
parameters: {
|
|
261
|
-
type: "object";
|
|
262
|
-
properties: {
|
|
263
|
-
message: {
|
|
264
|
-
type: string;
|
|
265
|
-
description: string;
|
|
266
|
-
};
|
|
267
|
-
};
|
|
268
|
-
};
|
|
158
|
+
|
|
159
|
+
declare function __VLS_template(): {
|
|
160
|
+
attrs: Partial<{}>;
|
|
161
|
+
slots: {
|
|
162
|
+
empty?(_: {}): any;
|
|
163
|
+
};
|
|
164
|
+
refs: {
|
|
165
|
+
messagesContainer: HTMLDivElement;
|
|
166
|
+
};
|
|
167
|
+
rootEl: HTMLDivElement;
|
|
269
168
|
};
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
169
|
+
|
|
170
|
+
declare function __VLS_template_2(): {
|
|
171
|
+
attrs: Partial<{}>;
|
|
172
|
+
slots: {
|
|
173
|
+
header?(_: {
|
|
174
|
+
schema: any;
|
|
175
|
+
isError: boolean;
|
|
176
|
+
isFinished: boolean;
|
|
177
|
+
}): any;
|
|
178
|
+
footer?(_: {
|
|
179
|
+
schema: any;
|
|
180
|
+
isError: boolean;
|
|
181
|
+
isFinished: boolean;
|
|
182
|
+
}): any;
|
|
183
|
+
};
|
|
184
|
+
refs: {
|
|
185
|
+
rendererInstance: default_2;
|
|
186
|
+
};
|
|
187
|
+
rootEl: HTMLDivElement;
|
|
276
188
|
};
|
|
189
|
+
|
|
190
|
+
declare function __VLS_template_3(): {
|
|
191
|
+
attrs: Partial<{}>;
|
|
192
|
+
slots: {
|
|
193
|
+
default?(_: {}): any;
|
|
194
|
+
};
|
|
195
|
+
refs: {};
|
|
196
|
+
rootEl: HTMLDivElement;
|
|
277
197
|
};
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
destroyed?: (() => void) | (() => void)[];
|
|
290
|
-
unmounted?: (() => void) | (() => void)[];
|
|
291
|
-
renderTracked?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
|
|
292
|
-
renderTriggered?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
|
|
293
|
-
errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
198
|
+
|
|
199
|
+
declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
200
|
+
|
|
201
|
+
declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
|
|
202
|
+
|
|
203
|
+
declare type __VLS_TemplateResult_3 = ReturnType<typeof __VLS_template_3>;
|
|
204
|
+
|
|
205
|
+
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
206
|
+
new (): {
|
|
207
|
+
$slots: S;
|
|
208
|
+
};
|
|
294
209
|
};
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
customActions?: ICustomActionItem[];
|
|
301
|
-
requiredCompleteFieldSelectors?: string[];
|
|
302
|
-
customFetch?: CustomFetch;
|
|
303
|
-
url?: string;
|
|
304
|
-
model?: string;
|
|
305
|
-
temperature?: number;
|
|
306
|
-
customSnippets?: IGenPromptSnippet[];
|
|
307
|
-
customExamples?: IGenPromptExample[];
|
|
308
|
-
chatConfig?: IChatConfig;
|
|
309
|
-
rendererSlots?: IRendererSlots;
|
|
310
|
-
thinkComponent?: Component<BubbleProps>;
|
|
311
|
-
roles?: IRolesConfig;
|
|
312
|
-
features?: ModelCapability;
|
|
313
|
-
setInputMessage: (message: string) => void;
|
|
314
|
-
handleNewConversation: () => void;
|
|
315
|
-
getProps: () => IChatProps;
|
|
316
|
-
getConversation: () => UseConversationReturn;
|
|
317
|
-
getResponseHandlers: () => IResponseHandler<IStreamData>[];
|
|
318
|
-
setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
|
|
319
|
-
getMessageRenderers: () => {
|
|
320
|
-
'custom-text': (props: BubbleCommonProps & {
|
|
321
|
-
content: string;
|
|
322
|
-
}) => VNode<RendererNode, RendererElement, {
|
|
323
|
-
[key: string]: any;
|
|
324
|
-
}>;
|
|
325
|
-
'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
|
|
326
|
-
[key: string]: any;
|
|
327
|
-
}>;
|
|
328
|
-
tool: DefineComponent< {
|
|
329
|
-
name: string;
|
|
330
|
-
status: "running" | "success" | "failed" | "cancelled";
|
|
331
|
-
content?: string | {
|
|
332
|
-
params?: object;
|
|
333
|
-
result?: object;
|
|
334
|
-
[x: string]: unknown;
|
|
210
|
+
|
|
211
|
+
declare type __VLS_WithTemplateSlots_2<T, S> = T & {
|
|
212
|
+
new (): {
|
|
213
|
+
$slots: S;
|
|
214
|
+
};
|
|
335
215
|
};
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
content?: string | {
|
|
342
|
-
params?: object;
|
|
343
|
-
result?: object;
|
|
344
|
-
[x: string]: unknown;
|
|
216
|
+
|
|
217
|
+
declare type __VLS_WithTemplateSlots_3<T, S> = T & {
|
|
218
|
+
new (): {
|
|
219
|
+
$slots: S;
|
|
220
|
+
};
|
|
345
221
|
};
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
222
|
+
|
|
223
|
+
export declare const cardIdSymbol: unique symbol;
|
|
224
|
+
|
|
225
|
+
export declare type CodegenFramework = 'vue' | 'react' | 'angular' | (string & {});
|
|
226
|
+
|
|
227
|
+
export declare interface ConfigProviderProps {
|
|
228
|
+
theme?: string;
|
|
229
|
+
id?: string;
|
|
230
|
+
locale?: string;
|
|
231
|
+
i18n?: I18nMessages;
|
|
232
|
+
materials?: MergedMaterials;
|
|
233
|
+
notify?: NotifyHandler;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export declare function createI18n(options?: I18nOptions): I18nInstance;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* 自定义请求函数类型
|
|
240
|
+
* @param url 请求地址
|
|
241
|
+
* @param options 请求选项(包含 method, headers, body, signal 等)
|
|
242
|
+
* @returns 返回 Response 对象或 Promise<Response>
|
|
243
|
+
*/
|
|
244
|
+
export declare type CustomFetch = (url: string, options: {
|
|
245
|
+
method: string;
|
|
246
|
+
headers: Record<string, string>;
|
|
247
|
+
body: string;
|
|
248
|
+
signal?: AbortSignal;
|
|
249
|
+
}) => Promise<Response> | Response;
|
|
250
|
+
|
|
251
|
+
export declare class CustomModelProvider extends BaseModelProvider {
|
|
252
|
+
private getChatOptions;
|
|
253
|
+
protected responseHandlers: IResponseHandler<IStreamData>[];
|
|
254
|
+
constructor({ getChatOptions }: ICustomModelProviderOptions);
|
|
255
|
+
validateRequest(_: ChatCompletionRequest): void;
|
|
256
|
+
setResponseHandlers(handlers: IResponseHandler<IStreamData>[]): void;
|
|
257
|
+
getData(request: ChatCompletionRequest): Promise<Response>;
|
|
258
|
+
chat(_: ChatCompletionRequest): Promise<ChatCompletionResponse>;
|
|
259
|
+
chatStream(request: any, handler: {
|
|
260
|
+
onData: any;
|
|
261
|
+
onDone: any;
|
|
262
|
+
onError: any;
|
|
263
|
+
}): Promise<void>;
|
|
264
|
+
protected setupStreamContext(context: Record<string, unknown>, _request: ChatCompletionRequest): void;
|
|
265
|
+
handlerChunk(rawData: string, context: any): void;
|
|
266
|
+
handlerBeforeRequest(context: any): void;
|
|
267
|
+
handlerRequestError(context: any, error?: unknown): void;
|
|
268
|
+
handlerStart(context: any, handlers: {
|
|
269
|
+
onData: (data: IChatMessage) => void;
|
|
270
|
+
onDone: () => void;
|
|
271
|
+
onError: (error: Error) => void;
|
|
272
|
+
}): void;
|
|
273
|
+
handlerEnd(context: any): void;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export declare const DEFAULT_IMAGE_FEATURES: ImageFeatures;
|
|
277
|
+
|
|
278
|
+
export declare const defaultResponseHandlers: IResponseHandler<IStreamData>[];
|
|
279
|
+
|
|
280
|
+
export declare const emitter: EventEmitter;
|
|
281
|
+
|
|
282
|
+
export declare class EventEmitter {
|
|
283
|
+
private events;
|
|
284
|
+
constructor();
|
|
285
|
+
/**
|
|
286
|
+
* @param {string} eventName - 事件名
|
|
287
|
+
* @param {Function} callback - 回调函数
|
|
288
|
+
* @param {boolean} [once=false] - 是否只触发一次
|
|
289
|
+
*/
|
|
290
|
+
on(eventName: string, callback: Function, once?: boolean): void;
|
|
291
|
+
/**
|
|
292
|
+
* @param {string} eventName - 事件名
|
|
293
|
+
* @param {Function} callback - 要移除的回调(必须是注册时的同一个函数引用)
|
|
294
|
+
*/
|
|
295
|
+
off(eventName: string, callback: Function): void;
|
|
296
|
+
/**
|
|
297
|
+
* @param {string} eventName - 事件名
|
|
298
|
+
* @param {...any} args - 传递给回调的参数
|
|
299
|
+
*/
|
|
300
|
+
emit(eventName: string, ...args: any[]): void;
|
|
301
|
+
/**
|
|
302
|
+
* @param {string} eventName - 事件名
|
|
303
|
+
* @param {Function} callback - 回调函数
|
|
304
|
+
*/
|
|
305
|
+
once(eventName: string, callback: Function): void;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
declare interface FileMeta {
|
|
309
|
+
name: string;
|
|
310
|
+
type: string;
|
|
311
|
+
size: number;
|
|
312
|
+
lastModified: number;
|
|
313
|
+
base64: string;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export declare const generateCode: (params: ICodeGeneratorParams) => Promise<ICodeGeneratorResult>;
|
|
317
|
+
|
|
318
|
+
export declare const GENUI_CONFIG: InjectionKey<ComputedRef<GenuiConfigState>>;
|
|
319
|
+
|
|
320
|
+
export declare const GENUI_I18N: unique symbol;
|
|
321
|
+
|
|
322
|
+
export declare const GENUI_MATERIALS: InjectionKey<IMaterials>;
|
|
323
|
+
|
|
324
|
+
export declare const GenuiChat: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
325
|
+
|
|
326
|
+
export declare const GenuiConfigProvider: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
|
|
327
|
+
|
|
328
|
+
export declare interface GenuiConfigState {
|
|
329
|
+
colorScheme: ThemeColorScheme;
|
|
330
|
+
id: string;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/** @deprecated 请改用 `GenuiChat`,并通过 `GenuiConfigProvider` 提供物料。 */
|
|
334
|
+
export declare const GenuiLegacyChat: {
|
|
335
|
+
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<IChatProps> & Readonly<{}>, {
|
|
336
|
+
$: ComponentInternalInstance;
|
|
337
|
+
$data: {};
|
|
338
|
+
$props: Partial<{}> & Omit<{
|
|
339
|
+
readonly url?: string;
|
|
340
|
+
readonly model?: string;
|
|
341
|
+
readonly temperature?: number;
|
|
342
|
+
readonly messages?: IMessage[];
|
|
343
|
+
readonly chatConfig?: IChatConfig;
|
|
344
|
+
readonly requiredCompleteFieldSelectors?: string[];
|
|
345
|
+
readonly customComponents?: ICustomComponentItem[];
|
|
346
|
+
readonly customSnippets?: IGenPromptSnippet[];
|
|
347
|
+
readonly customExamples?: IGenPromptExample[];
|
|
348
|
+
readonly customActions?: ICustomActionItem[];
|
|
349
|
+
readonly rendererSlots?: IRendererSlots;
|
|
350
|
+
readonly thinkComponent?: Component<BubbleProps>;
|
|
351
|
+
readonly roles?: IRolesConfig;
|
|
352
|
+
readonly features?: ModelCapability;
|
|
353
|
+
readonly customFetch?: CustomFetch;
|
|
354
|
+
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>;
|
|
355
|
+
$attrs: {
|
|
356
|
+
[x: string]: unknown;
|
|
357
|
+
};
|
|
358
|
+
$refs: {
|
|
359
|
+
[x: string]: unknown;
|
|
360
|
+
} & {
|
|
361
|
+
messagesContainer: HTMLDivElement;
|
|
362
|
+
};
|
|
363
|
+
$slots: Readonly<{
|
|
364
|
+
[name: string]: Slot<any>;
|
|
365
|
+
}> & {
|
|
366
|
+
empty?(_: {}): any;
|
|
367
|
+
};
|
|
368
|
+
$root: ComponentPublicInstance | null;
|
|
369
|
+
$parent: ComponentPublicInstance | null;
|
|
370
|
+
$host: Element | null;
|
|
371
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
372
|
+
$el: HTMLDivElement;
|
|
373
|
+
$options: ComponentOptionsBase<Readonly<IChatProps> & Readonly<{}>, {
|
|
374
|
+
setInputMessage: (message: string) => void;
|
|
375
|
+
handleNewConversation: () => void;
|
|
376
|
+
getProps: () => IChatProps;
|
|
377
|
+
getConversation: () => UseConversationReturn;
|
|
378
|
+
getResponseHandlers: () => IResponseHandler<IStreamData>[];
|
|
379
|
+
setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
|
|
380
|
+
getMessageRenderers: () => {
|
|
381
|
+
'custom-text': (props: BubbleCommonProps & {
|
|
382
|
+
content: string;
|
|
383
|
+
}) => VNode<RendererNode, RendererElement, {
|
|
384
|
+
[key: string]: any;
|
|
385
|
+
}>;
|
|
386
|
+
'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
|
|
387
|
+
[key: string]: any;
|
|
388
|
+
}>;
|
|
389
|
+
tool: DefineComponent< {
|
|
390
|
+
name: string;
|
|
391
|
+
status: "running" | "success" | "failed" | "cancelled";
|
|
392
|
+
content?: string | {
|
|
393
|
+
params?: object;
|
|
394
|
+
result?: object;
|
|
395
|
+
[x: string]: unknown;
|
|
396
|
+
};
|
|
397
|
+
formatPretty?: boolean;
|
|
398
|
+
defaultOpen?: boolean;
|
|
399
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
400
|
+
name: string;
|
|
401
|
+
status: "running" | "success" | "failed" | "cancelled";
|
|
402
|
+
content?: string | {
|
|
403
|
+
params?: object;
|
|
404
|
+
result?: object;
|
|
405
|
+
[x: string]: unknown;
|
|
406
|
+
};
|
|
407
|
+
formatPretty?: boolean;
|
|
408
|
+
defaultOpen?: boolean;
|
|
409
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
410
|
+
reasoning: DefineComponent< {
|
|
411
|
+
content: string;
|
|
412
|
+
thinking?: boolean;
|
|
413
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
414
|
+
content: string;
|
|
415
|
+
thinking?: boolean;
|
|
416
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
417
|
+
markdown: BubbleMarkdownContentRenderer;
|
|
418
|
+
templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
419
|
+
attachments: FileMeta[];
|
|
420
|
+
templateData: UserItem[];
|
|
421
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
422
|
+
'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
423
|
+
'error-text': DefineComponent< {
|
|
424
|
+
content: string;
|
|
425
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
426
|
+
content: string;
|
|
427
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
428
|
+
};
|
|
429
|
+
setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
|
|
430
|
+
generating: ComputedRef<boolean>;
|
|
431
|
+
lastSchemaCardId: ComputedRef<any>;
|
|
432
|
+
continueChatAction: {
|
|
433
|
+
name: string;
|
|
434
|
+
description: string;
|
|
435
|
+
execute: (params: {
|
|
436
|
+
message: string;
|
|
437
|
+
}, context: Record<string, any>) => void;
|
|
438
|
+
parameters: {
|
|
439
|
+
type: "object";
|
|
440
|
+
properties: {
|
|
441
|
+
message: {
|
|
442
|
+
type: string;
|
|
443
|
+
description: string;
|
|
444
|
+
};
|
|
445
|
+
};
|
|
446
|
+
};
|
|
447
|
+
};
|
|
448
|
+
saveStateAction: {
|
|
449
|
+
name: string;
|
|
450
|
+
description: string;
|
|
451
|
+
execute: (params: any, context: Record<string | symbol, any>) => void;
|
|
452
|
+
parameters: {
|
|
453
|
+
type: "null";
|
|
454
|
+
};
|
|
455
|
+
};
|
|
456
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
|
|
457
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
458
|
+
created?: (() => void) | (() => void)[];
|
|
459
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
460
|
+
mounted?: (() => void) | (() => void)[];
|
|
461
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
462
|
+
updated?: (() => void) | (() => void)[];
|
|
463
|
+
activated?: (() => void) | (() => void)[];
|
|
464
|
+
deactivated?: (() => void) | (() => void)[];
|
|
465
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
466
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
467
|
+
destroyed?: (() => void) | (() => void)[];
|
|
468
|
+
unmounted?: (() => void) | (() => void)[];
|
|
469
|
+
renderTracked?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
|
|
470
|
+
renderTriggered?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
|
|
471
|
+
errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
472
|
+
};
|
|
473
|
+
$forceUpdate: () => void;
|
|
474
|
+
$nextTick: nextTick;
|
|
475
|
+
$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;
|
|
476
|
+
messages?: IMessage[];
|
|
477
|
+
customComponents?: ICustomComponentItem[];
|
|
478
|
+
customActions?: ICustomActionItem[];
|
|
479
|
+
requiredCompleteFieldSelectors?: string[];
|
|
480
|
+
customFetch?: CustomFetch;
|
|
481
|
+
url?: string;
|
|
482
|
+
model?: string;
|
|
483
|
+
temperature?: number;
|
|
484
|
+
customSnippets?: IGenPromptSnippet[];
|
|
485
|
+
customExamples?: IGenPromptExample[];
|
|
486
|
+
chatConfig?: IChatConfig;
|
|
487
|
+
rendererSlots?: IRendererSlots;
|
|
488
|
+
thinkComponent?: Component<BubbleProps>;
|
|
489
|
+
roles?: IRolesConfig;
|
|
490
|
+
features?: ModelCapability;
|
|
491
|
+
setInputMessage: (message: string) => void;
|
|
492
|
+
handleNewConversation: () => void;
|
|
493
|
+
getProps: () => IChatProps;
|
|
494
|
+
getConversation: () => UseConversationReturn;
|
|
495
|
+
getResponseHandlers: () => IResponseHandler<IStreamData>[];
|
|
496
|
+
setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
|
|
497
|
+
getMessageRenderers: () => {
|
|
498
|
+
'custom-text': (props: BubbleCommonProps & {
|
|
499
|
+
content: string;
|
|
500
|
+
}) => VNode<RendererNode, RendererElement, {
|
|
501
|
+
[key: string]: any;
|
|
502
|
+
}>;
|
|
503
|
+
'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
|
|
504
|
+
[key: string]: any;
|
|
505
|
+
}>;
|
|
506
|
+
tool: DefineComponent< {
|
|
507
|
+
name: string;
|
|
508
|
+
status: "running" | "success" | "failed" | "cancelled";
|
|
509
|
+
content?: string | {
|
|
510
|
+
params?: object;
|
|
511
|
+
result?: object;
|
|
512
|
+
[x: string]: unknown;
|
|
513
|
+
};
|
|
514
|
+
formatPretty?: boolean;
|
|
515
|
+
defaultOpen?: boolean;
|
|
516
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
517
|
+
name: string;
|
|
518
|
+
status: "running" | "success" | "failed" | "cancelled";
|
|
519
|
+
content?: string | {
|
|
520
|
+
params?: object;
|
|
521
|
+
result?: object;
|
|
522
|
+
[x: string]: unknown;
|
|
523
|
+
};
|
|
524
|
+
formatPretty?: boolean;
|
|
525
|
+
defaultOpen?: boolean;
|
|
526
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
527
|
+
reasoning: DefineComponent< {
|
|
528
|
+
content: string;
|
|
529
|
+
thinking?: boolean;
|
|
530
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
531
|
+
content: string;
|
|
532
|
+
thinking?: boolean;
|
|
533
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
534
|
+
markdown: BubbleMarkdownContentRenderer;
|
|
535
|
+
templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
536
|
+
attachments: FileMeta[];
|
|
537
|
+
templateData: UserItem[];
|
|
538
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
539
|
+
'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
540
|
+
'error-text': DefineComponent< {
|
|
541
|
+
content: string;
|
|
542
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
543
|
+
content: string;
|
|
544
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
545
|
+
};
|
|
546
|
+
setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
|
|
547
|
+
generating: boolean;
|
|
548
|
+
lastSchemaCardId: any;
|
|
549
|
+
continueChatAction: {
|
|
550
|
+
name: string;
|
|
551
|
+
description: string;
|
|
552
|
+
execute: (params: {
|
|
553
|
+
message: string;
|
|
554
|
+
}, context: Record<string, any>) => void;
|
|
555
|
+
parameters: {
|
|
556
|
+
type: "object";
|
|
557
|
+
properties: {
|
|
558
|
+
message: {
|
|
559
|
+
type: string;
|
|
560
|
+
description: string;
|
|
561
|
+
};
|
|
562
|
+
};
|
|
563
|
+
};
|
|
564
|
+
};
|
|
565
|
+
saveStateAction: {
|
|
566
|
+
name: string;
|
|
567
|
+
description: string;
|
|
568
|
+
execute: (params: any, context: Record<string | symbol, any>) => void;
|
|
569
|
+
parameters: {
|
|
570
|
+
type: "null";
|
|
571
|
+
};
|
|
572
|
+
};
|
|
573
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {
|
|
574
|
+
chatRef: {
|
|
575
|
+
$: ComponentInternalInstance;
|
|
576
|
+
$data: {};
|
|
577
|
+
$props: Partial<{}> & Omit<{
|
|
578
|
+
readonly url?: string;
|
|
579
|
+
readonly model?: string;
|
|
580
|
+
readonly temperature?: number;
|
|
581
|
+
readonly messages?: IMessage[];
|
|
582
|
+
readonly chatConfig?: IChatConfig;
|
|
583
|
+
readonly requiredCompleteFieldSelectors?: string[];
|
|
584
|
+
readonly customComponents?: ICustomComponentItem[];
|
|
585
|
+
readonly customSnippets?: IGenPromptSnippet[];
|
|
586
|
+
readonly customExamples?: IGenPromptExample[];
|
|
587
|
+
readonly customActions?: ICustomActionItem[];
|
|
588
|
+
readonly rendererSlots?: IRendererSlots;
|
|
589
|
+
readonly thinkComponent?: Component<BubbleProps>;
|
|
590
|
+
readonly roles?: IRolesConfig;
|
|
591
|
+
readonly features?: ModelCapability;
|
|
592
|
+
readonly customFetch?: CustomFetch;
|
|
593
|
+
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>;
|
|
594
|
+
$attrs: {
|
|
595
|
+
[x: string]: unknown;
|
|
596
|
+
};
|
|
597
|
+
$refs: {
|
|
598
|
+
[x: string]: unknown;
|
|
599
|
+
} & {
|
|
600
|
+
messagesContainer: HTMLDivElement;
|
|
601
|
+
};
|
|
602
|
+
$slots: Readonly<{
|
|
603
|
+
[name: string]: Slot<any>;
|
|
604
|
+
}>;
|
|
605
|
+
$root: ComponentPublicInstance | null;
|
|
606
|
+
$parent: ComponentPublicInstance | null;
|
|
607
|
+
$host: Element | null;
|
|
608
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
609
|
+
$el: HTMLDivElement;
|
|
610
|
+
$options: ComponentOptionsBase<Readonly<IChatProps> & Readonly<{}>, {
|
|
611
|
+
setInputMessage: (message: string) => void;
|
|
612
|
+
handleNewConversation: () => void;
|
|
613
|
+
getProps: () => IChatProps;
|
|
614
|
+
getConversation: () => UseConversationReturn;
|
|
615
|
+
getResponseHandlers: () => IResponseHandler<IStreamData>[];
|
|
616
|
+
setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
|
|
617
|
+
getMessageRenderers: () => {
|
|
618
|
+
'custom-text': (props: BubbleCommonProps & {
|
|
619
|
+
content: string;
|
|
620
|
+
}) => VNode<RendererNode, RendererElement, {
|
|
621
|
+
[key: string]: any;
|
|
622
|
+
}>;
|
|
623
|
+
'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
|
|
624
|
+
[key: string]: any;
|
|
625
|
+
}>;
|
|
626
|
+
tool: DefineComponent< {
|
|
627
|
+
name: string;
|
|
628
|
+
status: "running" | "success" | "failed" | "cancelled";
|
|
629
|
+
content?: string | {
|
|
630
|
+
params?: object;
|
|
631
|
+
result?: object;
|
|
632
|
+
[x: string]: unknown;
|
|
633
|
+
};
|
|
634
|
+
formatPretty?: boolean;
|
|
635
|
+
defaultOpen?: boolean;
|
|
636
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
637
|
+
name: string;
|
|
638
|
+
status: "running" | "success" | "failed" | "cancelled";
|
|
639
|
+
content?: string | {
|
|
640
|
+
params?: object;
|
|
641
|
+
result?: object;
|
|
642
|
+
[x: string]: unknown;
|
|
643
|
+
};
|
|
644
|
+
formatPretty?: boolean;
|
|
645
|
+
defaultOpen?: boolean;
|
|
646
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
647
|
+
reasoning: DefineComponent< {
|
|
648
|
+
content: string;
|
|
649
|
+
thinking?: boolean;
|
|
650
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
651
|
+
content: string;
|
|
652
|
+
thinking?: boolean;
|
|
653
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
654
|
+
markdown: BubbleMarkdownContentRenderer;
|
|
655
|
+
templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
656
|
+
attachments: FileMeta[];
|
|
657
|
+
templateData: UserItem[];
|
|
658
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
659
|
+
'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
660
|
+
'error-text': DefineComponent< {
|
|
661
|
+
content: string;
|
|
662
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
663
|
+
content: string;
|
|
664
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
665
|
+
};
|
|
666
|
+
setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
|
|
667
|
+
generating: ComputedRef<boolean>;
|
|
668
|
+
lastSchemaCardId: ComputedRef<any>;
|
|
669
|
+
continueChatAction: {
|
|
670
|
+
name: string;
|
|
671
|
+
description: string;
|
|
672
|
+
execute: (params: {
|
|
673
|
+
message: string;
|
|
674
|
+
}, context: Record<string, any>) => void;
|
|
675
|
+
parameters: {
|
|
676
|
+
type: "object";
|
|
677
|
+
properties: {
|
|
678
|
+
message: {
|
|
679
|
+
type: string;
|
|
680
|
+
description: string;
|
|
681
|
+
};
|
|
682
|
+
};
|
|
683
|
+
};
|
|
684
|
+
};
|
|
685
|
+
saveStateAction: {
|
|
686
|
+
name: string;
|
|
687
|
+
description: string;
|
|
688
|
+
execute: (params: any, context: Record<string | symbol, any>) => void;
|
|
689
|
+
parameters: {
|
|
690
|
+
type: "null";
|
|
691
|
+
};
|
|
692
|
+
};
|
|
693
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
|
|
694
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
695
|
+
created?: (() => void) | (() => void)[];
|
|
696
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
697
|
+
mounted?: (() => void) | (() => void)[];
|
|
698
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
699
|
+
updated?: (() => void) | (() => void)[];
|
|
700
|
+
activated?: (() => void) | (() => void)[];
|
|
701
|
+
deactivated?: (() => void) | (() => void)[];
|
|
702
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
703
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
704
|
+
destroyed?: (() => void) | (() => void)[];
|
|
705
|
+
unmounted?: (() => void) | (() => void)[];
|
|
706
|
+
renderTracked?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
|
|
707
|
+
renderTriggered?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
|
|
708
|
+
errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
709
|
+
};
|
|
710
|
+
$forceUpdate: () => void;
|
|
711
|
+
$nextTick: nextTick;
|
|
712
|
+
$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;
|
|
713
|
+
} & Readonly<{}> & Omit<Readonly<IChatProps> & Readonly<{}>, "generating" | "continueChatAction" | "saveStateAction" | "setInputMessage" | "handleNewConversation" | "getProps" | "getConversation" | "getResponseHandlers" | "setResponseHandlers" | "getMessageRenderers" | "setMessageRenderer" | "lastSchemaCardId"> & ShallowUnwrapRef< {
|
|
714
|
+
setInputMessage: (message: string) => void;
|
|
715
|
+
handleNewConversation: () => void;
|
|
716
|
+
getProps: () => IChatProps;
|
|
717
|
+
getConversation: () => UseConversationReturn;
|
|
718
|
+
getResponseHandlers: () => IResponseHandler<IStreamData>[];
|
|
719
|
+
setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
|
|
720
|
+
getMessageRenderers: () => {
|
|
721
|
+
'custom-text': (props: BubbleCommonProps & {
|
|
722
|
+
content: string;
|
|
723
|
+
}) => VNode<RendererNode, RendererElement, {
|
|
724
|
+
[key: string]: any;
|
|
725
|
+
}>;
|
|
726
|
+
'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
|
|
727
|
+
[key: string]: any;
|
|
728
|
+
}>;
|
|
729
|
+
tool: DefineComponent< {
|
|
730
|
+
name: string;
|
|
731
|
+
status: "running" | "success" | "failed" | "cancelled";
|
|
732
|
+
content?: string | {
|
|
733
|
+
params?: object;
|
|
734
|
+
result?: object;
|
|
735
|
+
[x: string]: unknown;
|
|
736
|
+
};
|
|
737
|
+
formatPretty?: boolean;
|
|
738
|
+
defaultOpen?: boolean;
|
|
739
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
740
|
+
name: string;
|
|
741
|
+
status: "running" | "success" | "failed" | "cancelled";
|
|
742
|
+
content?: string | {
|
|
743
|
+
params?: object;
|
|
744
|
+
result?: object;
|
|
745
|
+
[x: string]: unknown;
|
|
746
|
+
};
|
|
747
|
+
formatPretty?: boolean;
|
|
748
|
+
defaultOpen?: boolean;
|
|
749
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
750
|
+
reasoning: DefineComponent< {
|
|
751
|
+
content: string;
|
|
752
|
+
thinking?: boolean;
|
|
753
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
754
|
+
content: string;
|
|
755
|
+
thinking?: boolean;
|
|
756
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
757
|
+
markdown: BubbleMarkdownContentRenderer;
|
|
758
|
+
templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
759
|
+
attachments: FileMeta[];
|
|
760
|
+
templateData: UserItem[];
|
|
761
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
762
|
+
'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
763
|
+
'error-text': DefineComponent< {
|
|
764
|
+
content: string;
|
|
765
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
766
|
+
content: string;
|
|
767
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
768
|
+
};
|
|
769
|
+
setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
|
|
770
|
+
generating: ComputedRef<boolean>;
|
|
771
|
+
lastSchemaCardId: ComputedRef<any>;
|
|
772
|
+
continueChatAction: {
|
|
773
|
+
name: string;
|
|
774
|
+
description: string;
|
|
775
|
+
execute: (params: {
|
|
776
|
+
message: string;
|
|
777
|
+
}, context: Record<string, any>) => void;
|
|
778
|
+
parameters: {
|
|
779
|
+
type: "object";
|
|
780
|
+
properties: {
|
|
781
|
+
message: {
|
|
782
|
+
type: string;
|
|
783
|
+
description: string;
|
|
784
|
+
};
|
|
785
|
+
};
|
|
786
|
+
};
|
|
787
|
+
};
|
|
788
|
+
saveStateAction: {
|
|
789
|
+
name: string;
|
|
790
|
+
description: string;
|
|
791
|
+
execute: (params: any, context: Record<string | symbol, any>) => void;
|
|
792
|
+
parameters: {
|
|
793
|
+
type: "null";
|
|
794
|
+
};
|
|
795
|
+
};
|
|
796
|
+
}> & {} & ComponentCustomProperties & {} & {
|
|
797
|
+
$slots: {
|
|
798
|
+
empty?(_: {}): any;
|
|
799
|
+
};
|
|
800
|
+
};
|
|
801
|
+
}, HTMLDivElement, ComponentProvideOptions, {
|
|
802
|
+
P: {};
|
|
803
|
+
B: {};
|
|
804
|
+
D: {};
|
|
805
|
+
C: {};
|
|
806
|
+
M: {};
|
|
807
|
+
Defaults: {};
|
|
808
|
+
}, Readonly<IChatProps> & Readonly<{}>, {
|
|
809
|
+
$: ComponentInternalInstance;
|
|
810
|
+
$data: {};
|
|
811
|
+
$props: Partial<{}> & Omit<{
|
|
812
|
+
readonly url?: string;
|
|
813
|
+
readonly model?: string;
|
|
814
|
+
readonly temperature?: number;
|
|
815
|
+
readonly messages?: IMessage[];
|
|
816
|
+
readonly chatConfig?: IChatConfig;
|
|
817
|
+
readonly requiredCompleteFieldSelectors?: string[];
|
|
818
|
+
readonly customComponents?: ICustomComponentItem[];
|
|
819
|
+
readonly customSnippets?: IGenPromptSnippet[];
|
|
820
|
+
readonly customExamples?: IGenPromptExample[];
|
|
821
|
+
readonly customActions?: ICustomActionItem[];
|
|
822
|
+
readonly rendererSlots?: IRendererSlots;
|
|
823
|
+
readonly thinkComponent?: Component<BubbleProps>;
|
|
824
|
+
readonly roles?: IRolesConfig;
|
|
825
|
+
readonly features?: ModelCapability;
|
|
826
|
+
readonly customFetch?: CustomFetch;
|
|
827
|
+
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>;
|
|
828
|
+
$attrs: {
|
|
829
|
+
[x: string]: unknown;
|
|
830
|
+
};
|
|
831
|
+
$refs: {
|
|
832
|
+
[x: string]: unknown;
|
|
833
|
+
} & {
|
|
834
|
+
messagesContainer: HTMLDivElement;
|
|
835
|
+
};
|
|
836
|
+
$slots: Readonly<{
|
|
837
|
+
[name: string]: Slot<any>;
|
|
838
|
+
}> & {
|
|
839
|
+
empty?(_: {}): any;
|
|
840
|
+
};
|
|
841
|
+
$root: ComponentPublicInstance | null;
|
|
842
|
+
$parent: ComponentPublicInstance | null;
|
|
843
|
+
$host: Element | null;
|
|
844
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
845
|
+
$el: HTMLDivElement;
|
|
846
|
+
$options: ComponentOptionsBase<Readonly<IChatProps> & Readonly<{}>, {
|
|
847
|
+
setInputMessage: (message: string) => void;
|
|
848
|
+
handleNewConversation: () => void;
|
|
849
|
+
getProps: () => IChatProps;
|
|
850
|
+
getConversation: () => UseConversationReturn;
|
|
851
|
+
getResponseHandlers: () => IResponseHandler<IStreamData>[];
|
|
852
|
+
setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
|
|
853
|
+
getMessageRenderers: () => {
|
|
854
|
+
'custom-text': (props: BubbleCommonProps & {
|
|
855
|
+
content: string;
|
|
856
|
+
}) => VNode<RendererNode, RendererElement, {
|
|
857
|
+
[key: string]: any;
|
|
858
|
+
}>;
|
|
859
|
+
'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
|
|
860
|
+
[key: string]: any;
|
|
861
|
+
}>;
|
|
862
|
+
tool: DefineComponent< {
|
|
863
|
+
name: string;
|
|
864
|
+
status: "running" | "success" | "failed" | "cancelled";
|
|
865
|
+
content?: string | {
|
|
866
|
+
params?: object;
|
|
867
|
+
result?: object;
|
|
868
|
+
[x: string]: unknown;
|
|
869
|
+
};
|
|
870
|
+
formatPretty?: boolean;
|
|
871
|
+
defaultOpen?: boolean;
|
|
872
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
873
|
+
name: string;
|
|
874
|
+
status: "running" | "success" | "failed" | "cancelled";
|
|
875
|
+
content?: string | {
|
|
876
|
+
params?: object;
|
|
877
|
+
result?: object;
|
|
878
|
+
[x: string]: unknown;
|
|
879
|
+
};
|
|
880
|
+
formatPretty?: boolean;
|
|
881
|
+
defaultOpen?: boolean;
|
|
882
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
883
|
+
reasoning: DefineComponent< {
|
|
884
|
+
content: string;
|
|
885
|
+
thinking?: boolean;
|
|
886
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
887
|
+
content: string;
|
|
888
|
+
thinking?: boolean;
|
|
889
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
890
|
+
markdown: BubbleMarkdownContentRenderer;
|
|
891
|
+
templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
892
|
+
attachments: FileMeta[];
|
|
893
|
+
templateData: UserItem[];
|
|
894
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
895
|
+
'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
896
|
+
'error-text': DefineComponent< {
|
|
897
|
+
content: string;
|
|
898
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
899
|
+
content: string;
|
|
900
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
901
|
+
};
|
|
902
|
+
setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
|
|
903
|
+
generating: ComputedRef<boolean>;
|
|
904
|
+
lastSchemaCardId: ComputedRef<any>;
|
|
905
|
+
continueChatAction: {
|
|
906
|
+
name: string;
|
|
907
|
+
description: string;
|
|
908
|
+
execute: (params: {
|
|
909
|
+
message: string;
|
|
910
|
+
}, context: Record<string, any>) => void;
|
|
911
|
+
parameters: {
|
|
912
|
+
type: "object";
|
|
913
|
+
properties: {
|
|
914
|
+
message: {
|
|
915
|
+
type: string;
|
|
916
|
+
description: string;
|
|
917
|
+
};
|
|
918
|
+
};
|
|
919
|
+
};
|
|
920
|
+
};
|
|
921
|
+
saveStateAction: {
|
|
922
|
+
name: string;
|
|
923
|
+
description: string;
|
|
924
|
+
execute: (params: any, context: Record<string | symbol, any>) => void;
|
|
925
|
+
parameters: {
|
|
926
|
+
type: "null";
|
|
927
|
+
};
|
|
928
|
+
};
|
|
929
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
|
|
930
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
931
|
+
created?: (() => void) | (() => void)[];
|
|
932
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
933
|
+
mounted?: (() => void) | (() => void)[];
|
|
934
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
935
|
+
updated?: (() => void) | (() => void)[];
|
|
936
|
+
activated?: (() => void) | (() => void)[];
|
|
937
|
+
deactivated?: (() => void) | (() => void)[];
|
|
938
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
939
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
940
|
+
destroyed?: (() => void) | (() => void)[];
|
|
941
|
+
unmounted?: (() => void) | (() => void)[];
|
|
942
|
+
renderTracked?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
|
|
943
|
+
renderTriggered?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
|
|
944
|
+
errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
945
|
+
};
|
|
946
|
+
$forceUpdate: () => void;
|
|
947
|
+
$nextTick: nextTick;
|
|
948
|
+
$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;
|
|
949
|
+
messages?: IMessage[];
|
|
950
|
+
customComponents?: ICustomComponentItem[];
|
|
951
|
+
customActions?: ICustomActionItem[];
|
|
952
|
+
requiredCompleteFieldSelectors?: string[];
|
|
953
|
+
customFetch?: CustomFetch;
|
|
954
|
+
url?: string;
|
|
955
|
+
model?: string;
|
|
956
|
+
temperature?: number;
|
|
957
|
+
customSnippets?: IGenPromptSnippet[];
|
|
958
|
+
customExamples?: IGenPromptExample[];
|
|
959
|
+
chatConfig?: IChatConfig;
|
|
960
|
+
rendererSlots?: IRendererSlots;
|
|
961
|
+
thinkComponent?: Component<BubbleProps>;
|
|
962
|
+
roles?: IRolesConfig;
|
|
963
|
+
features?: ModelCapability;
|
|
964
|
+
setInputMessage: (message: string) => void;
|
|
965
|
+
handleNewConversation: () => void;
|
|
966
|
+
getProps: () => IChatProps;
|
|
967
|
+
getConversation: () => UseConversationReturn;
|
|
968
|
+
getResponseHandlers: () => IResponseHandler<IStreamData>[];
|
|
969
|
+
setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
|
|
970
|
+
getMessageRenderers: () => {
|
|
971
|
+
'custom-text': (props: BubbleCommonProps & {
|
|
972
|
+
content: string;
|
|
973
|
+
}) => VNode<RendererNode, RendererElement, {
|
|
974
|
+
[key: string]: any;
|
|
975
|
+
}>;
|
|
976
|
+
'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
|
|
977
|
+
[key: string]: any;
|
|
978
|
+
}>;
|
|
979
|
+
tool: DefineComponent< {
|
|
980
|
+
name: string;
|
|
981
|
+
status: "running" | "success" | "failed" | "cancelled";
|
|
982
|
+
content?: string | {
|
|
983
|
+
params?: object;
|
|
984
|
+
result?: object;
|
|
985
|
+
[x: string]: unknown;
|
|
986
|
+
};
|
|
987
|
+
formatPretty?: boolean;
|
|
988
|
+
defaultOpen?: boolean;
|
|
989
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
990
|
+
name: string;
|
|
991
|
+
status: "running" | "success" | "failed" | "cancelled";
|
|
992
|
+
content?: string | {
|
|
993
|
+
params?: object;
|
|
994
|
+
result?: object;
|
|
995
|
+
[x: string]: unknown;
|
|
996
|
+
};
|
|
997
|
+
formatPretty?: boolean;
|
|
998
|
+
defaultOpen?: boolean;
|
|
999
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
1000
|
+
reasoning: DefineComponent< {
|
|
1001
|
+
content: string;
|
|
1002
|
+
thinking?: boolean;
|
|
1003
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
1004
|
+
content: string;
|
|
1005
|
+
thinking?: boolean;
|
|
1006
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
1007
|
+
markdown: BubbleMarkdownContentRenderer;
|
|
1008
|
+
templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
1009
|
+
attachments: FileMeta[];
|
|
1010
|
+
templateData: UserItem[];
|
|
1011
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
1012
|
+
'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
1013
|
+
'error-text': DefineComponent< {
|
|
1014
|
+
content: string;
|
|
1015
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
1016
|
+
content: string;
|
|
1017
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
1018
|
+
};
|
|
1019
|
+
setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
|
|
1020
|
+
generating: boolean;
|
|
1021
|
+
lastSchemaCardId: any;
|
|
1022
|
+
continueChatAction: {
|
|
1023
|
+
name: string;
|
|
1024
|
+
description: string;
|
|
1025
|
+
execute: (params: {
|
|
1026
|
+
message: string;
|
|
1027
|
+
}, context: Record<string, any>) => void;
|
|
1028
|
+
parameters: {
|
|
1029
|
+
type: "object";
|
|
1030
|
+
properties: {
|
|
1031
|
+
message: {
|
|
1032
|
+
type: string;
|
|
1033
|
+
description: string;
|
|
1034
|
+
};
|
|
1035
|
+
};
|
|
1036
|
+
};
|
|
1037
|
+
};
|
|
1038
|
+
saveStateAction: {
|
|
1039
|
+
name: string;
|
|
1040
|
+
description: string;
|
|
1041
|
+
execute: (params: any, context: Record<string | symbol, any>) => void;
|
|
1042
|
+
parameters: {
|
|
1043
|
+
type: "null";
|
|
1044
|
+
};
|
|
1045
|
+
};
|
|
1046
|
+
}, {}, {}, {}, {}>;
|
|
1047
|
+
__isFragment?: never;
|
|
1048
|
+
__isTeleport?: never;
|
|
1049
|
+
__isSuspense?: never;
|
|
1050
|
+
} & ComponentOptionsBase<Readonly<IChatProps> & Readonly<{}>, {
|
|
397
1051
|
$: ComponentInternalInstance;
|
|
398
1052
|
$data: {};
|
|
399
1053
|
$props: Partial<{}> & Omit<{
|
|
@@ -423,7 +1077,9 @@ messagesContainer: HTMLDivElement;
|
|
|
423
1077
|
};
|
|
424
1078
|
$slots: Readonly<{
|
|
425
1079
|
[name: string]: Slot<any>;
|
|
426
|
-
}
|
|
1080
|
+
}> & {
|
|
1081
|
+
empty?(_: {}): any;
|
|
1082
|
+
};
|
|
427
1083
|
$root: ComponentPublicInstance | null;
|
|
428
1084
|
$parent: ComponentPublicInstance | null;
|
|
429
1085
|
$host: Element | null;
|
|
@@ -532,7 +1188,21 @@ errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info:
|
|
|
532
1188
|
$forceUpdate: () => void;
|
|
533
1189
|
$nextTick: nextTick;
|
|
534
1190
|
$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;
|
|
535
|
-
|
|
1191
|
+
messages?: IMessage[];
|
|
1192
|
+
customComponents?: ICustomComponentItem[];
|
|
1193
|
+
customActions?: ICustomActionItem[];
|
|
1194
|
+
requiredCompleteFieldSelectors?: string[];
|
|
1195
|
+
customFetch?: CustomFetch;
|
|
1196
|
+
url?: string;
|
|
1197
|
+
model?: string;
|
|
1198
|
+
temperature?: number;
|
|
1199
|
+
customSnippets?: IGenPromptSnippet[];
|
|
1200
|
+
customExamples?: IGenPromptExample[];
|
|
1201
|
+
chatConfig?: IChatConfig;
|
|
1202
|
+
rendererSlots?: IRendererSlots;
|
|
1203
|
+
thinkComponent?: Component<BubbleProps>;
|
|
1204
|
+
roles?: IRolesConfig;
|
|
1205
|
+
features?: ModelCapability;
|
|
536
1206
|
setInputMessage: (message: string) => void;
|
|
537
1207
|
handleNewConversation: () => void;
|
|
538
1208
|
getProps: () => IChatProps;
|
|
@@ -589,8 +1259,8 @@ content: string;
|
|
|
589
1259
|
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
590
1260
|
};
|
|
591
1261
|
setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
|
|
592
|
-
generating:
|
|
593
|
-
lastSchemaCardId:
|
|
1262
|
+
generating: boolean;
|
|
1263
|
+
lastSchemaCardId: any;
|
|
594
1264
|
continueChatAction: {
|
|
595
1265
|
name: string;
|
|
596
1266
|
description: string;
|
|
@@ -615,440 +1285,51 @@ parameters: {
|
|
|
615
1285
|
type: "null";
|
|
616
1286
|
};
|
|
617
1287
|
};
|
|
618
|
-
}
|
|
619
|
-
$slots:
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
rootEl: HTMLDivElement;
|
|
638
|
-
};
|
|
639
|
-
|
|
640
|
-
declare function __VLS_template_2(): {
|
|
641
|
-
attrs: Partial<{}>;
|
|
642
|
-
slots: {
|
|
643
|
-
header?(_: {
|
|
644
|
-
schema: any;
|
|
645
|
-
isError: boolean;
|
|
646
|
-
isFinished: boolean;
|
|
647
|
-
}): any;
|
|
648
|
-
footer?(_: {
|
|
649
|
-
schema: any;
|
|
650
|
-
isError: boolean;
|
|
651
|
-
isFinished: boolean;
|
|
652
|
-
}): any;
|
|
653
|
-
};
|
|
654
|
-
refs: {
|
|
655
|
-
rendererInstance: any;
|
|
656
|
-
};
|
|
657
|
-
rootEl: HTMLDivElement;
|
|
658
|
-
};
|
|
659
|
-
|
|
660
|
-
declare function __VLS_template_3(): {
|
|
661
|
-
attrs: Partial<{}>;
|
|
662
|
-
slots: {
|
|
1288
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
1289
|
+
$slots: any;
|
|
1290
|
+
});
|
|
1291
|
+
|
|
1292
|
+
/** @deprecated 仅用于旧版组件兼容,新项目请使用 `GenuiConfigProvider` 并显式提供物料。 */
|
|
1293
|
+
export declare const GenuiLegacyConfigProvider: {
|
|
1294
|
+
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<LegacyConfigProviderProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, HTMLDivElement, ComponentProvideOptions, {
|
|
1295
|
+
P: {};
|
|
1296
|
+
B: {};
|
|
1297
|
+
D: {};
|
|
1298
|
+
C: {};
|
|
1299
|
+
M: {};
|
|
1300
|
+
Defaults: {};
|
|
1301
|
+
}, Readonly<LegacyConfigProviderProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
1302
|
+
__isFragment?: never;
|
|
1303
|
+
__isTeleport?: never;
|
|
1304
|
+
__isSuspense?: never;
|
|
1305
|
+
} & ComponentOptionsBase<Readonly<LegacyConfigProviderProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
1306
|
+
$slots: {
|
|
663
1307
|
default?(_: {}): any;
|
|
664
1308
|
};
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
readonly rendererSlots?: IRendererSlots;
|
|
690
|
-
readonly thinkComponent?: Component<BubbleProps>;
|
|
691
|
-
readonly roles?: IRolesConfig;
|
|
692
|
-
readonly features?: ModelCapability;
|
|
693
|
-
readonly customFetch?: CustomFetch;
|
|
694
|
-
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>;
|
|
695
|
-
$attrs: {
|
|
696
|
-
[x: string]: unknown;
|
|
697
|
-
};
|
|
698
|
-
$refs: {
|
|
699
|
-
[x: string]: unknown;
|
|
700
|
-
} & {
|
|
701
|
-
messagesContainer: HTMLDivElement;
|
|
702
|
-
};
|
|
703
|
-
$slots: Readonly<{
|
|
704
|
-
[name: string]: Slot<any>;
|
|
705
|
-
}>;
|
|
706
|
-
$root: ComponentPublicInstance | null;
|
|
707
|
-
$parent: ComponentPublicInstance | null;
|
|
708
|
-
$host: Element | null;
|
|
709
|
-
$emit: (event: string, ...args: any[]) => void;
|
|
710
|
-
$el: HTMLDivElement;
|
|
711
|
-
$options: ComponentOptionsBase<Readonly<IChatProps> & Readonly<{}>, {
|
|
712
|
-
setInputMessage: (message: string) => void;
|
|
713
|
-
handleNewConversation: () => void;
|
|
714
|
-
getProps: () => IChatProps;
|
|
715
|
-
getConversation: () => UseConversationReturn;
|
|
716
|
-
getResponseHandlers: () => IResponseHandler<IStreamData>[];
|
|
717
|
-
setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
|
|
718
|
-
getMessageRenderers: () => {
|
|
719
|
-
'custom-text': (props: BubbleCommonProps & {
|
|
720
|
-
content: string;
|
|
721
|
-
}) => VNode<RendererNode, RendererElement, {
|
|
722
|
-
[key: string]: any;
|
|
723
|
-
}>;
|
|
724
|
-
'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
|
|
725
|
-
[key: string]: any;
|
|
726
|
-
}>;
|
|
727
|
-
tool: DefineComponent< {
|
|
728
|
-
name: string;
|
|
729
|
-
status: "running" | "success" | "failed" | "cancelled";
|
|
730
|
-
content?: string | {
|
|
731
|
-
params?: object;
|
|
732
|
-
result?: object;
|
|
733
|
-
[x: string]: unknown;
|
|
734
|
-
};
|
|
735
|
-
formatPretty?: boolean;
|
|
736
|
-
defaultOpen?: boolean;
|
|
737
|
-
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
738
|
-
name: string;
|
|
739
|
-
status: "running" | "success" | "failed" | "cancelled";
|
|
740
|
-
content?: string | {
|
|
741
|
-
params?: object;
|
|
742
|
-
result?: object;
|
|
743
|
-
[x: string]: unknown;
|
|
744
|
-
};
|
|
745
|
-
formatPretty?: boolean;
|
|
746
|
-
defaultOpen?: boolean;
|
|
747
|
-
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
748
|
-
reasoning: DefineComponent< {
|
|
749
|
-
content: string;
|
|
750
|
-
thinking?: boolean;
|
|
751
|
-
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
752
|
-
content: string;
|
|
753
|
-
thinking?: boolean;
|
|
754
|
-
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
755
|
-
markdown: BubbleMarkdownContentRenderer;
|
|
756
|
-
templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
757
|
-
attachments: FileMeta[];
|
|
758
|
-
templateData: UserItem[];
|
|
759
|
-
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
760
|
-
'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
761
|
-
'error-text': DefineComponent< {
|
|
762
|
-
content: string;
|
|
763
|
-
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
764
|
-
content: string;
|
|
765
|
-
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
766
|
-
};
|
|
767
|
-
setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
|
|
768
|
-
generating: ComputedRef<boolean>;
|
|
769
|
-
lastSchemaCardId: ComputedRef<any>;
|
|
770
|
-
continueChatAction: {
|
|
771
|
-
name: string;
|
|
772
|
-
description: string;
|
|
773
|
-
execute: (params: {
|
|
774
|
-
message: string;
|
|
775
|
-
}, context: Record<string, any>) => void;
|
|
776
|
-
parameters: {
|
|
777
|
-
type: "object";
|
|
778
|
-
properties: {
|
|
779
|
-
message: {
|
|
780
|
-
type: string;
|
|
781
|
-
description: string;
|
|
782
|
-
};
|
|
783
|
-
};
|
|
784
|
-
};
|
|
785
|
-
};
|
|
786
|
-
saveStateAction: {
|
|
787
|
-
name: string;
|
|
788
|
-
description: string;
|
|
789
|
-
execute: (params: any, context: Record<string | symbol, any>) => void;
|
|
790
|
-
parameters: {
|
|
791
|
-
type: "null";
|
|
792
|
-
};
|
|
793
|
-
};
|
|
794
|
-
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
|
|
795
|
-
beforeCreate?: (() => void) | (() => void)[];
|
|
796
|
-
created?: (() => void) | (() => void)[];
|
|
797
|
-
beforeMount?: (() => void) | (() => void)[];
|
|
798
|
-
mounted?: (() => void) | (() => void)[];
|
|
799
|
-
beforeUpdate?: (() => void) | (() => void)[];
|
|
800
|
-
updated?: (() => void) | (() => void)[];
|
|
801
|
-
activated?: (() => void) | (() => void)[];
|
|
802
|
-
deactivated?: (() => void) | (() => void)[];
|
|
803
|
-
beforeDestroy?: (() => void) | (() => void)[];
|
|
804
|
-
beforeUnmount?: (() => void) | (() => void)[];
|
|
805
|
-
destroyed?: (() => void) | (() => void)[];
|
|
806
|
-
unmounted?: (() => void) | (() => void)[];
|
|
807
|
-
renderTracked?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
|
|
808
|
-
renderTriggered?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
|
|
809
|
-
errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
810
|
-
};
|
|
811
|
-
$forceUpdate: () => void;
|
|
812
|
-
$nextTick: nextTick;
|
|
813
|
-
$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;
|
|
814
|
-
} & Readonly<{}> & Omit<Readonly<IChatProps> & Readonly<{}>, "generating" | "continueChatAction" | "saveStateAction" | "setInputMessage" | "handleNewConversation" | "getProps" | "getConversation" | "getResponseHandlers" | "setResponseHandlers" | "getMessageRenderers" | "setMessageRenderer" | "lastSchemaCardId"> & ShallowUnwrapRef< {
|
|
815
|
-
setInputMessage: (message: string) => void;
|
|
816
|
-
handleNewConversation: () => void;
|
|
817
|
-
getProps: () => IChatProps;
|
|
818
|
-
getConversation: () => UseConversationReturn;
|
|
819
|
-
getResponseHandlers: () => IResponseHandler<IStreamData>[];
|
|
820
|
-
setResponseHandlers: (handlers: IResponseHandler<IStreamData>[]) => void;
|
|
821
|
-
getMessageRenderers: () => {
|
|
822
|
-
'custom-text': (props: BubbleCommonProps & {
|
|
823
|
-
content: string;
|
|
824
|
-
}) => VNode<RendererNode, RendererElement, {
|
|
825
|
-
[key: string]: any;
|
|
826
|
-
}>;
|
|
827
|
-
'schema-card': (schemaCardProps: IRendererProps) => VNode<RendererNode, RendererElement, {
|
|
828
|
-
[key: string]: any;
|
|
829
|
-
}>;
|
|
830
|
-
tool: DefineComponent< {
|
|
831
|
-
name: string;
|
|
832
|
-
status: "running" | "success" | "failed" | "cancelled";
|
|
833
|
-
content?: string | {
|
|
834
|
-
params?: object;
|
|
835
|
-
result?: object;
|
|
836
|
-
[x: string]: unknown;
|
|
837
|
-
};
|
|
838
|
-
formatPretty?: boolean;
|
|
839
|
-
defaultOpen?: boolean;
|
|
840
|
-
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
841
|
-
name: string;
|
|
842
|
-
status: "running" | "success" | "failed" | "cancelled";
|
|
843
|
-
content?: string | {
|
|
844
|
-
params?: object;
|
|
845
|
-
result?: object;
|
|
846
|
-
[x: string]: unknown;
|
|
847
|
-
};
|
|
848
|
-
formatPretty?: boolean;
|
|
849
|
-
defaultOpen?: boolean;
|
|
850
|
-
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
851
|
-
reasoning: DefineComponent< {
|
|
852
|
-
content: string;
|
|
853
|
-
thinking?: boolean;
|
|
854
|
-
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
855
|
-
content: string;
|
|
856
|
-
thinking?: boolean;
|
|
857
|
-
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
858
|
-
markdown: BubbleMarkdownContentRenderer;
|
|
859
|
-
templateData: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
860
|
-
attachments: FileMeta[];
|
|
861
|
-
templateData: UserItem[];
|
|
862
|
-
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
863
|
-
'loading-text': Component<BubbleProps> | DefineComponent<IThinkComponentProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IThinkComponentProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
864
|
-
'error-text': DefineComponent< {
|
|
865
|
-
content: string;
|
|
866
|
-
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
867
|
-
content: string;
|
|
868
|
-
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
869
|
-
};
|
|
870
|
-
setMessageRenderer: (key: string, renderer: Component<IRendererProps>) => void;
|
|
871
|
-
generating: ComputedRef<boolean>;
|
|
872
|
-
lastSchemaCardId: ComputedRef<any>;
|
|
873
|
-
continueChatAction: {
|
|
874
|
-
name: string;
|
|
875
|
-
description: string;
|
|
876
|
-
execute: (params: {
|
|
877
|
-
message: string;
|
|
878
|
-
}, context: Record<string, any>) => void;
|
|
879
|
-
parameters: {
|
|
880
|
-
type: "object";
|
|
881
|
-
properties: {
|
|
882
|
-
message: {
|
|
883
|
-
type: string;
|
|
884
|
-
description: string;
|
|
885
|
-
};
|
|
886
|
-
};
|
|
887
|
-
};
|
|
888
|
-
};
|
|
889
|
-
saveStateAction: {
|
|
890
|
-
name: string;
|
|
891
|
-
description: string;
|
|
892
|
-
execute: (params: any, context: Record<string | symbol, any>) => void;
|
|
893
|
-
parameters: {
|
|
894
|
-
type: "null";
|
|
895
|
-
};
|
|
896
|
-
};
|
|
897
|
-
}> & {} & ComponentCustomProperties & {} & {
|
|
898
|
-
$slots: {
|
|
899
|
-
empty?(_: {}): any;
|
|
900
|
-
};
|
|
901
|
-
};
|
|
902
|
-
};
|
|
903
|
-
rootEl: HTMLDivElement;
|
|
904
|
-
};
|
|
905
|
-
|
|
906
|
-
declare function __VLS_template_5(): {
|
|
907
|
-
attrs: Partial<{}>;
|
|
908
|
-
slots: Readonly<IRendererSlots> & IRendererSlots;
|
|
909
|
-
refs: {};
|
|
910
|
-
rootEl: HTMLDivElement;
|
|
911
|
-
};
|
|
912
|
-
|
|
913
|
-
declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
914
|
-
|
|
915
|
-
declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
|
|
916
|
-
|
|
917
|
-
declare type __VLS_TemplateResult_3 = ReturnType<typeof __VLS_template_3>;
|
|
918
|
-
|
|
919
|
-
declare type __VLS_TemplateResult_4 = ReturnType<typeof __VLS_template_4>;
|
|
920
|
-
|
|
921
|
-
declare type __VLS_TemplateResult_5 = ReturnType<typeof __VLS_template_5>;
|
|
922
|
-
|
|
923
|
-
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
924
|
-
new (): {
|
|
925
|
-
$slots: S;
|
|
926
|
-
};
|
|
927
|
-
};
|
|
928
|
-
|
|
929
|
-
declare type __VLS_WithTemplateSlots_2<T, S> = T & {
|
|
930
|
-
new (): {
|
|
931
|
-
$slots: S;
|
|
932
|
-
};
|
|
933
|
-
};
|
|
934
|
-
|
|
935
|
-
declare type __VLS_WithTemplateSlots_3<T, S> = T & {
|
|
936
|
-
new (): {
|
|
937
|
-
$slots: S;
|
|
938
|
-
};
|
|
939
|
-
};
|
|
940
|
-
|
|
941
|
-
declare type __VLS_WithTemplateSlots_4<T, S> = T & {
|
|
942
|
-
new (): {
|
|
943
|
-
$slots: S;
|
|
944
|
-
};
|
|
945
|
-
};
|
|
946
|
-
|
|
947
|
-
declare type __VLS_WithTemplateSlots_5<T, S> = T & {
|
|
948
|
-
new (): {
|
|
949
|
-
$slots: S;
|
|
950
|
-
};
|
|
951
|
-
};
|
|
952
|
-
|
|
953
|
-
declare interface ConfigProviderProps {
|
|
954
|
-
theme?: 'light' | 'dark' | 'lite' | 'auto';
|
|
955
|
-
id?: string;
|
|
956
|
-
locale?: string;
|
|
957
|
-
i18n?: I18nMessages;
|
|
958
|
-
materials?: IMaterials;
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
export declare function createI18n(options?: I18nOptions): I18nInstance;
|
|
962
|
-
|
|
963
|
-
/**
|
|
964
|
-
* 自定义请求函数类型
|
|
965
|
-
* @param url 请求地址
|
|
966
|
-
* @param options 请求选项(包含 method, headers, body, signal 等)
|
|
967
|
-
* @returns 返回 Response 对象或 Promise<Response>
|
|
968
|
-
*/
|
|
969
|
-
export declare type CustomFetch = (url: string, options: {
|
|
970
|
-
method: string;
|
|
971
|
-
headers: Record<string, string>;
|
|
972
|
-
body: string;
|
|
973
|
-
signal?: AbortSignal;
|
|
974
|
-
}) => Promise<Response> | Response;
|
|
975
|
-
|
|
976
|
-
export declare class CustomModelProvider extends BaseModelProvider {
|
|
977
|
-
private getChatOptions;
|
|
978
|
-
protected responseHandlers: IResponseHandler<IStreamData>[];
|
|
979
|
-
constructor({ getChatOptions }: ICustomModelProviderOptions);
|
|
980
|
-
validateRequest(_: ChatCompletionRequest): void;
|
|
981
|
-
setResponseHandlers(handlers: IResponseHandler<IStreamData>[]): void;
|
|
982
|
-
getData(request: ChatCompletionRequest): Promise<Response>;
|
|
983
|
-
chat(_: ChatCompletionRequest): Promise<ChatCompletionResponse>;
|
|
984
|
-
chatStream(request: any, handler: {
|
|
985
|
-
onData: any;
|
|
986
|
-
onDone: any;
|
|
987
|
-
onError: any;
|
|
988
|
-
}): Promise<void>;
|
|
989
|
-
protected setupStreamContext(context: Record<string, unknown>, _request: ChatCompletionRequest): void;
|
|
990
|
-
handlerChunk(rawData: string, context: any): void;
|
|
991
|
-
handlerStart(context: any, handlers: {
|
|
992
|
-
onData: (data: IChatMessage) => void;
|
|
993
|
-
onDone: () => void;
|
|
994
|
-
onError: (error: Error) => void;
|
|
995
|
-
}): void;
|
|
996
|
-
handlerEnd(context: any): void;
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
export declare const DEFAULT_IMAGE_FEATURES: ImageFeatures;
|
|
1000
|
-
|
|
1001
|
-
export declare const defaultResponseHandlers: IResponseHandler<IStreamData>[];
|
|
1002
|
-
|
|
1003
|
-
export declare const emitter: EventEmitter;
|
|
1004
|
-
|
|
1005
|
-
export declare class EventEmitter {
|
|
1006
|
-
private events;
|
|
1007
|
-
constructor();
|
|
1008
|
-
/**
|
|
1009
|
-
* @param {string} eventName - 事件名
|
|
1010
|
-
* @param {Function} callback - 回调函数
|
|
1011
|
-
* @param {boolean} [once=false] - 是否只触发一次
|
|
1012
|
-
*/
|
|
1013
|
-
on(eventName: string, callback: Function, once?: boolean): void;
|
|
1014
|
-
/**
|
|
1015
|
-
* @param {string} eventName - 事件名
|
|
1016
|
-
* @param {Function} callback - 要移除的回调(必须是注册时的同一个函数引用)
|
|
1017
|
-
*/
|
|
1018
|
-
off(eventName: string, callback: Function): void;
|
|
1019
|
-
/**
|
|
1020
|
-
* @param {string} eventName - 事件名
|
|
1021
|
-
* @param {...any} args - 传递给回调的参数
|
|
1022
|
-
*/
|
|
1023
|
-
emit(eventName: string, ...args: any[]): void;
|
|
1024
|
-
/**
|
|
1025
|
-
* @param {string} eventName - 事件名
|
|
1026
|
-
* @param {Function} callback - 回调函数
|
|
1027
|
-
*/
|
|
1028
|
-
once(eventName: string, callback: Function): void;
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
declare interface FileMeta {
|
|
1032
|
-
name: string;
|
|
1033
|
-
type: string;
|
|
1034
|
-
size: number;
|
|
1035
|
-
lastModified: number;
|
|
1036
|
-
base64: string;
|
|
1037
|
-
}
|
|
1038
|
-
|
|
1039
|
-
export declare const GENUI_CONFIG: unique symbol;
|
|
1040
|
-
|
|
1041
|
-
export declare const GENUI_I18N: unique symbol;
|
|
1042
|
-
|
|
1043
|
-
export declare const GENUI_MATERIALS: InjectionKey<IMaterials>;
|
|
1044
|
-
|
|
1045
|
-
export declare const GenuiChat: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
1046
|
-
|
|
1047
|
-
export declare const GenuiConfigProvider: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
|
|
1048
|
-
|
|
1049
|
-
export declare const GenuiLegacyChat: __VLS_WithTemplateSlots_4<typeof __VLS_component_4, __VLS_TemplateResult_4["slots"]>;
|
|
1050
|
-
|
|
1051
|
-
export declare const GenuiLegacyRenderer: __VLS_WithTemplateSlots_5<typeof __VLS_component_5, __VLS_TemplateResult_5["slots"]>;
|
|
1309
|
+
});
|
|
1310
|
+
|
|
1311
|
+
/** @deprecated 请改用 `GenuiRenderer`,并通过 `GenuiConfigProvider` 提供物料。 */
|
|
1312
|
+
export declare const GenuiLegacyRenderer: {
|
|
1313
|
+
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<IRendererProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
|
1314
|
+
isJsonComplete: boolean;
|
|
1315
|
+
}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, HTMLDivElement, ComponentProvideOptions, {
|
|
1316
|
+
P: {};
|
|
1317
|
+
B: {};
|
|
1318
|
+
D: {};
|
|
1319
|
+
C: {};
|
|
1320
|
+
M: {};
|
|
1321
|
+
Defaults: {};
|
|
1322
|
+
}, Readonly<IRendererProps> & Readonly<{}>, {}, {}, {}, {}, {
|
|
1323
|
+
isJsonComplete: boolean;
|
|
1324
|
+
}>;
|
|
1325
|
+
__isFragment?: never;
|
|
1326
|
+
__isTeleport?: never;
|
|
1327
|
+
__isSuspense?: never;
|
|
1328
|
+
} & ComponentOptionsBase<Readonly<IRendererProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
|
|
1329
|
+
isJsonComplete: boolean;
|
|
1330
|
+
}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
1331
|
+
$slots: Readonly<IRendererSlots> & IRendererSlots;
|
|
1332
|
+
});
|
|
1052
1333
|
|
|
1053
1334
|
export declare const GenuiRenderer: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
|
|
1054
1335
|
|
|
@@ -1108,6 +1389,48 @@ export declare interface IChatProps {
|
|
|
1108
1389
|
customFetch?: CustomFetch;
|
|
1109
1390
|
}
|
|
1110
1391
|
|
|
1392
|
+
export declare interface ICodegenDescription {
|
|
1393
|
+
componentSet: Set<string>;
|
|
1394
|
+
iconComponents: {
|
|
1395
|
+
componentNames: string[];
|
|
1396
|
+
exportNames: string[];
|
|
1397
|
+
};
|
|
1398
|
+
internalTypes: Set<string>;
|
|
1399
|
+
stateAccessors: IStateAccessorDefinition[];
|
|
1400
|
+
needsJsx: boolean;
|
|
1401
|
+
needsComputed: boolean;
|
|
1402
|
+
needsCallAction: boolean;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
export declare interface ICodeGeneratorParams {
|
|
1406
|
+
pageInfo: {
|
|
1407
|
+
schema: CardSchema | string;
|
|
1408
|
+
name?: string;
|
|
1409
|
+
};
|
|
1410
|
+
componentsMap?: IComponentMapItem[];
|
|
1411
|
+
formatWithPrettier?: boolean;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
export declare type ICodeGeneratorResult = ICodePanel & {
|
|
1415
|
+
errors: {
|
|
1416
|
+
message: string;
|
|
1417
|
+
}[];
|
|
1418
|
+
};
|
|
1419
|
+
|
|
1420
|
+
export declare interface ICodePanel {
|
|
1421
|
+
panelName: string;
|
|
1422
|
+
panelValue: string;
|
|
1423
|
+
panelType: CodegenFramework;
|
|
1424
|
+
prettierOpts: Record<string, unknown>;
|
|
1425
|
+
type: 'page';
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
export declare interface IComponentMapItem {
|
|
1429
|
+
componentName: string;
|
|
1430
|
+
package: string;
|
|
1431
|
+
exportName?: string;
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1111
1434
|
export declare interface ICustomAction extends Partial<IGenPromptAction> {
|
|
1112
1435
|
execute: (params: any, context: Record<string, any>) => any;
|
|
1113
1436
|
}
|
|
@@ -1137,6 +1460,10 @@ export declare interface ICustomModelProviderOptions {
|
|
|
1137
1460
|
getChatOptions: () => ICustomModelChatOptions;
|
|
1138
1461
|
}
|
|
1139
1462
|
|
|
1463
|
+
export declare interface IFrameworkCodeGenerator<TParams, TResult> {
|
|
1464
|
+
generate(params: TParams): Promise<TResult>;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1140
1467
|
export declare interface ImageFeatures {
|
|
1141
1468
|
enabled: boolean;
|
|
1142
1469
|
maxImageSize: number;
|
|
@@ -1206,6 +1533,8 @@ export declare interface IResponseHandler<T> {
|
|
|
1206
1533
|
match: (data: T, context: any) => boolean;
|
|
1207
1534
|
handler: (data: T, context: any) => boolean;
|
|
1208
1535
|
notMatchHandler?: (data: T, context: any) => boolean;
|
|
1536
|
+
beforeRequest?: (context: any) => void;
|
|
1537
|
+
onRequestError?: (context: any, error?: unknown) => void;
|
|
1209
1538
|
start?: (context: any, handlers: {
|
|
1210
1539
|
onData: (data: IChatMessage) => void;
|
|
1211
1540
|
onDone: () => void;
|
|
@@ -1219,14 +1548,39 @@ export declare interface IRolesConfig {
|
|
|
1219
1548
|
assistant: Partial<BubbleRoleConfig>;
|
|
1220
1549
|
}
|
|
1221
1550
|
|
|
1551
|
+
export declare interface IScriptSetupBuildContext {
|
|
1552
|
+
schema: CardSchema;
|
|
1553
|
+
componentsMap: IComponentMapItem[];
|
|
1554
|
+
description: ICodegenDescription;
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
export declare interface IScriptSetupSectionDefinition {
|
|
1558
|
+
id: string;
|
|
1559
|
+
group: string;
|
|
1560
|
+
build: (ctx: IScriptSetupBuildContext) => string;
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1222
1563
|
declare type ISlotProps = any;
|
|
1223
1564
|
|
|
1565
|
+
export declare interface IStateAccessorDefinition {
|
|
1566
|
+
name: string;
|
|
1567
|
+
getterExpr: string;
|
|
1568
|
+
setterExpr?: string;
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1224
1571
|
export declare interface IThinkComponentProps {
|
|
1225
1572
|
emitter: INotificationEventEmitter;
|
|
1226
1573
|
message: IMessage;
|
|
1227
1574
|
showThinkingResult: boolean;
|
|
1228
1575
|
}
|
|
1229
1576
|
|
|
1577
|
+
export declare interface IVueCodeGeneratorOptions {
|
|
1578
|
+
prettierOpts?: Record<string, unknown>;
|
|
1579
|
+
enableCompileValidation?: boolean;
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
export declare type LegacyConfigProviderProps = Omit<ConfigProviderProps, 'materials'>;
|
|
1583
|
+
|
|
1230
1584
|
export declare class MessageManager {
|
|
1231
1585
|
messageManagerMap: Map<string, UseMessageReturn>;
|
|
1232
1586
|
conversationState: Reactive<ConversationState>;
|
|
@@ -1254,12 +1608,19 @@ export declare interface ModelInfo {
|
|
|
1254
1608
|
features?: ModelFeatures;
|
|
1255
1609
|
}
|
|
1256
1610
|
|
|
1611
|
+
export declare type NotifyHandler = (options: {
|
|
1612
|
+
type?: 'success' | 'warning' | 'error' | 'info';
|
|
1613
|
+
title?: string;
|
|
1614
|
+
message?: string;
|
|
1615
|
+
duration?: number;
|
|
1616
|
+
}) => void;
|
|
1617
|
+
|
|
1257
1618
|
declare interface Props {
|
|
1258
1619
|
templateData?: UserItem[];
|
|
1259
1620
|
attachments?: FileMeta[];
|
|
1260
1621
|
}
|
|
1261
1622
|
|
|
1262
|
-
export
|
|
1623
|
+
export declare const RENDERER_SETTINGS_KEY: symbol;
|
|
1263
1624
|
|
|
1264
1625
|
export declare const requiredCompleteFieldSelectors: string[];
|
|
1265
1626
|
|
|
@@ -1334,7 +1695,7 @@ export declare interface UseConversationReturn {
|
|
|
1334
1695
|
export declare const useI18n: () => I18nInstance;
|
|
1335
1696
|
|
|
1336
1697
|
export declare const useMediaTheme: () => {
|
|
1337
|
-
theme: Readonly<Ref<"
|
|
1698
|
+
theme: Readonly<Ref<"light" | "dark", "light" | "dark">>;
|
|
1338
1699
|
};
|
|
1339
1700
|
|
|
1340
1701
|
export declare function useMessage(options: UseMessageOptions): UseMessageReturn;
|
|
@@ -1390,4 +1751,66 @@ export declare interface UseMessageReturn {
|
|
|
1390
1751
|
retryRequest: (msgIndex: number) => Promise<void>;
|
|
1391
1752
|
}
|
|
1392
1753
|
|
|
1754
|
+
export declare class VueCodeGenerator implements IFrameworkCodeGenerator<ICodeGeneratorParams, ICodeGeneratorResult> {
|
|
1755
|
+
private readonly generatorOptions;
|
|
1756
|
+
private readonly prettierOpts;
|
|
1757
|
+
private readonly enableCompileValidation;
|
|
1758
|
+
constructor(generatorOptions?: IVueCodeGeneratorOptions);
|
|
1759
|
+
protected replaceThis(value: string, inTemplate?: boolean): string;
|
|
1760
|
+
protected buildScriptSetupStateAccessors(ctx: IScriptSetupBuildContext): string;
|
|
1761
|
+
protected buildScriptSetupImports(ctx: IScriptSetupBuildContext): string;
|
|
1762
|
+
protected buildScriptSetupRefs(ctx: IScriptSetupBuildContext): string;
|
|
1763
|
+
protected buildScriptSetupDefineProps(ctx: IScriptSetupBuildContext): string;
|
|
1764
|
+
protected buildScriptSetupDefineEmits(ctx: IScriptSetupBuildContext): string;
|
|
1765
|
+
protected buildScriptSetupIconStatement(ctx: IScriptSetupBuildContext): string;
|
|
1766
|
+
protected buildScriptSetupReactiveState(ctx: IScriptSetupBuildContext): string;
|
|
1767
|
+
protected buildScriptSetupMethods(ctx: IScriptSetupBuildContext): string;
|
|
1768
|
+
protected buildScriptSetupCallAction(ctx: IScriptSetupBuildContext): string;
|
|
1769
|
+
protected buildScriptSetupBody(ctx: IScriptSetupBuildContext, sections: readonly IScriptSetupSectionDefinition[]): string;
|
|
1770
|
+
protected buildSfcTemplateSection(template: string): string;
|
|
1771
|
+
protected buildSfcScriptSetupSection(scriptSetup: string, needsJsx?: boolean): string;
|
|
1772
|
+
protected buildSfcStyleSection(style: string): string;
|
|
1773
|
+
protected getScriptSetupSections(): readonly IScriptSetupSectionDefinition[];
|
|
1774
|
+
protected createCodegenMeta(): ICodegenDescription;
|
|
1775
|
+
protected resolveRefAttr(value: string | undefined, asJsx: boolean): string | null;
|
|
1776
|
+
protected resolvePropValueType(value: unknown): string;
|
|
1777
|
+
protected buildJSFunctionExpression(value: string, inTemplate?: boolean): string;
|
|
1778
|
+
protected hoistPropToState(key: string, item: unknown, attrsArr: string[], state: Record<string, unknown>, asJsx?: boolean): void;
|
|
1779
|
+
protected isOnEventKey(key: string): boolean;
|
|
1780
|
+
protected handleSlotBinding(item: Record<string, unknown> | string): string;
|
|
1781
|
+
protected handleEventBinding(key: string, item: {
|
|
1782
|
+
type?: string;
|
|
1783
|
+
value?: string;
|
|
1784
|
+
params?: string[];
|
|
1785
|
+
}, asJsx?: boolean): string;
|
|
1786
|
+
protected avoidDuplicateString(existings: string[], baseName: string): string;
|
|
1787
|
+
protected handleLiteralBinding(key: string, item: unknown, attrsArr: string[], description: ICodegenDescription, state: Record<string, unknown>, asJsx?: boolean): void;
|
|
1788
|
+
protected handleBinding(props: Record<string, unknown>, attrsArr: string[], description: ICodegenDescription, state: Record<string, unknown>, asJsx?: boolean): void;
|
|
1789
|
+
protected recurseChildren(children: NodeSchema[] | NodeSchema | string | undefined, state: Record<string, unknown>, description: ICodegenDescription, result: string[]): void;
|
|
1790
|
+
protected isEmptySlotNode(componentName: string | undefined, children: unknown): boolean;
|
|
1791
|
+
protected generateTemplate(schema: CardSchema, state: Record<string, any>, description: ICodegenDescription, isRootNode?: boolean): string;
|
|
1792
|
+
protected generateSlotTemplate(item: Record<string, any>, description: ICodegenDescription, state?: Record<string, unknown>): string;
|
|
1793
|
+
protected getFunctionInfo(fnStr: string): {
|
|
1794
|
+
type: string;
|
|
1795
|
+
params: string[];
|
|
1796
|
+
body: string;
|
|
1797
|
+
} | null;
|
|
1798
|
+
protected transformStateType(current: Record<string, any>, prop: string, description: ICodegenDescription, rootState: Record<string, any>): void;
|
|
1799
|
+
protected traverseState(state: Record<string, any>, description: ICodegenDescription, rootState?: Record<string, any>): void;
|
|
1800
|
+
protected buildVueSfcSource({ schema, componentsMap, }: {
|
|
1801
|
+
schema: CardSchema;
|
|
1802
|
+
name?: string;
|
|
1803
|
+
componentsMap: IComponentMapItem[];
|
|
1804
|
+
}): string;
|
|
1805
|
+
protected normalizeIncomingSchema(origin: CardSchema | string | null | undefined): CardSchema;
|
|
1806
|
+
protected generatePageCode({ pageInfo, componentsMap, formatWithPrettier, }: {
|
|
1807
|
+
pageInfo: ICodeGeneratorParams['pageInfo'];
|
|
1808
|
+
componentsMap: IComponentMapItem[];
|
|
1809
|
+
formatWithPrettier?: boolean;
|
|
1810
|
+
}): Promise<ICodeGeneratorResult>;
|
|
1811
|
+
protected normalizeComponentsMap(componentsMap: IComponentMapItem[] | undefined): IComponentMapItem[];
|
|
1812
|
+
protected formatWithPrettier(source: string, prettierOpts: Record<string, unknown>): Promise<string>;
|
|
1813
|
+
generate({ pageInfo, componentsMap, formatWithPrettier, }: ICodeGeneratorParams): Promise<ICodeGeneratorResult>;
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1393
1816
|
export { }
|