@blueking/chat-helper 0.0.1-beta.9 → 0.0.2
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 +631 -141
- package/dist/agent/type.d.ts +27 -2
- package/dist/agent/type.ts.js +1 -1
- package/dist/agent/use-agent.d.ts +464 -484
- package/dist/agent/use-agent.ts.js +191 -42
- package/dist/event/ag-ui.d.ts +37 -7
- package/dist/event/ag-ui.ts.js +225 -173
- package/dist/event/type.d.ts +99 -107
- package/dist/event/type.ts.js +34 -11
- package/dist/http/fetch/fetch.d.ts +2 -1
- package/dist/http/fetch/fetch.ts.js +38 -8
- package/dist/http/fetch/index.d.ts +1 -0
- package/dist/http/fetch/index.ts.js +17 -1
- package/dist/http/index.d.ts +14 -5
- package/dist/http/index.ts.js +59 -3
- package/dist/http/module/index.d.ts +13 -5
- package/dist/http/module/index.ts.js +2 -1
- package/dist/http/module/message.d.ts +22 -5
- package/dist/http/module/message.ts.js +51 -4
- package/dist/http/module/session.d.ts +4 -1
- package/dist/http/module/session.ts.js +66 -4
- package/dist/http/transform/agent.ts.js +11 -8
- package/dist/http/transform/message.d.ts +6 -6
- package/dist/http/transform/message.ts.js +566 -118
- package/dist/http/transform/session.ts.js +9 -1
- package/dist/index.d.ts +2983 -3314
- package/dist/index.ts.js +27 -5
- package/dist/mediator/index.d.ts +2 -0
- package/dist/mediator/index.ts.js +26 -0
- package/dist/mediator/type.d.ts +50 -0
- package/dist/mediator/type.ts.js +28 -0
- package/dist/mediator/use-mediator.d.ts +7 -0
- package/dist/mediator/use-mediator.ts.js +47 -0
- package/dist/message/type.d.ts +280 -146
- package/dist/message/type.ts.js +16 -15
- package/dist/message/use-message.d.ts +847 -963
- package/dist/message/use-message.ts.js +230 -37
- package/dist/session/type.d.ts +10 -0
- package/dist/session/use-session.d.ts +2006 -2214
- package/dist/session/use-session.ts.js +198 -33
- package/package.json +11 -6
|
@@ -1,10 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import { MessageRole, MessageStatus } from '../message';
|
|
2
|
+
import type { IRequestConfig, ISSEProtocol } from '../http';
|
|
3
|
+
import type { IMediatorModule } from '../mediator';
|
|
4
|
+
import type { IMessageProperty, IUserMessage } from '../message/type';
|
|
4
5
|
import type { IAgentInfo } from './type';
|
|
5
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Agent 模块
|
|
8
|
+
* @param options - 配置选项
|
|
9
|
+
* @param mediator - 中介者模块,用于获取其他模块的引用
|
|
10
|
+
*/
|
|
11
|
+
export declare const useAgent: (mediator: IMediatorModule, protocol: ISSEProtocol) => {
|
|
6
12
|
info: import("vue").Ref<{
|
|
7
13
|
agentName?: string;
|
|
14
|
+
resources?: {
|
|
15
|
+
code: string;
|
|
16
|
+
icon: null | string;
|
|
17
|
+
id: null | number;
|
|
18
|
+
name: string;
|
|
19
|
+
type: string;
|
|
20
|
+
}[];
|
|
8
21
|
saasUrl?: string;
|
|
9
22
|
chatGroup?: {
|
|
10
23
|
enabled: boolean;
|
|
@@ -14,6 +27,7 @@ export declare const useAgent: (options: IUseChatHelperOptions, http: IHttpModul
|
|
|
14
27
|
conversationSettings?: {
|
|
15
28
|
commands?: {
|
|
16
29
|
agentId: number;
|
|
30
|
+
alias?: string;
|
|
17
31
|
components: {
|
|
18
32
|
default?: null | string;
|
|
19
33
|
fillBack?: boolean;
|
|
@@ -36,6 +50,9 @@ export declare const useAgent: (options: IUseChatHelperOptions, http: IHttpModul
|
|
|
36
50
|
id: string;
|
|
37
51
|
name: string;
|
|
38
52
|
status: string;
|
|
53
|
+
supportUpload?: {
|
|
54
|
+
vision: boolean;
|
|
55
|
+
};
|
|
39
56
|
}[];
|
|
40
57
|
enableChatSession?: boolean;
|
|
41
58
|
openingRemark?: string;
|
|
@@ -43,283 +60,263 @@ export declare const useAgent: (options: IUseChatHelperOptions, http: IHttpModul
|
|
|
43
60
|
};
|
|
44
61
|
promptSetting?: {
|
|
45
62
|
content?: ({
|
|
46
|
-
|
|
47
|
-
content:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
54
|
-
status: MessageContentStatus;
|
|
63
|
+
activityType: import("../message").ActivityType;
|
|
64
|
+
content: {
|
|
65
|
+
nodes: Record<string, import("../event").IFlowAgentNode>;
|
|
66
|
+
task_id: number;
|
|
67
|
+
task_name: string;
|
|
68
|
+
task_outputs: string[];
|
|
69
|
+
task_state: import("../event").FlowTaskState;
|
|
55
70
|
} | {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
71
|
+
content: string;
|
|
72
|
+
referenceDocument: {
|
|
73
|
+
name: string;
|
|
59
74
|
originFileUrl?: string;
|
|
60
|
-
title: string;
|
|
61
75
|
url: string;
|
|
62
76
|
}[];
|
|
63
|
-
status: MessageContentStatus;
|
|
64
77
|
} | {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
|
|
78
|
+
name: string;
|
|
79
|
+
originFileUrl?: string;
|
|
80
|
+
url: string;
|
|
81
|
+
}[];
|
|
82
|
+
role: MessageRole.Activity;
|
|
83
|
+
id?: string;
|
|
84
|
+
messageId?: string;
|
|
85
|
+
name?: string;
|
|
86
|
+
sessionCode?: string;
|
|
87
|
+
status: MessageStatus;
|
|
88
|
+
} | {
|
|
89
|
+
content?: string;
|
|
90
|
+
property?: {
|
|
91
|
+
[x: string]: unknown;
|
|
92
|
+
extra?: {
|
|
93
|
+
[x: string]: unknown;
|
|
94
|
+
cite?: string | {
|
|
95
|
+
data: {
|
|
96
|
+
key: string;
|
|
97
|
+
value: string;
|
|
98
|
+
}[];
|
|
99
|
+
title: string;
|
|
100
|
+
type: string;
|
|
101
|
+
};
|
|
102
|
+
command?: string;
|
|
103
|
+
context?: Array<Record<string, unknown>>;
|
|
104
|
+
resources?: Array<Record<string, unknown>>;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
role: MessageRole.Assistant;
|
|
108
|
+
toolCalls?: {
|
|
109
|
+
function: {
|
|
110
|
+
arguments: string;
|
|
111
|
+
description?: string;
|
|
112
|
+
mcpName?: string;
|
|
113
|
+
name: string;
|
|
114
|
+
};
|
|
115
|
+
id: string;
|
|
116
|
+
type: import("../message").MessageType.Function;
|
|
117
|
+
}[];
|
|
118
|
+
id?: string;
|
|
119
|
+
messageId?: string;
|
|
120
|
+
name?: string;
|
|
121
|
+
sessionCode?: string;
|
|
122
|
+
status: MessageStatus;
|
|
123
|
+
} | {
|
|
124
|
+
content: string;
|
|
125
|
+
role: MessageRole.Developer;
|
|
126
|
+
id?: string;
|
|
127
|
+
messageId?: string;
|
|
128
|
+
name?: string;
|
|
129
|
+
sessionCode?: string;
|
|
130
|
+
status: MessageStatus;
|
|
131
|
+
} | {
|
|
132
|
+
content: string;
|
|
104
133
|
role: MessageRole.Guide;
|
|
105
|
-
id?:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
134
|
+
id?: string;
|
|
135
|
+
messageId?: string;
|
|
136
|
+
name?: string;
|
|
137
|
+
sessionCode?: string;
|
|
138
|
+
status: MessageStatus;
|
|
109
139
|
} | {
|
|
110
|
-
content:
|
|
111
|
-
id?: number;
|
|
112
|
-
type: MessageContentType.Text;
|
|
113
|
-
data: {
|
|
114
|
-
text: string;
|
|
115
|
-
};
|
|
116
|
-
status: MessageContentStatus;
|
|
117
|
-
}[];
|
|
140
|
+
content: string;
|
|
118
141
|
role: MessageRole.HiddenAssistant;
|
|
119
|
-
id?:
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
142
|
+
id?: string;
|
|
143
|
+
messageId?: string;
|
|
144
|
+
name?: string;
|
|
145
|
+
sessionCode?: string;
|
|
146
|
+
status: MessageStatus;
|
|
123
147
|
} | {
|
|
124
|
-
content:
|
|
125
|
-
id?: number;
|
|
126
|
-
type: MessageContentType.Text;
|
|
127
|
-
data: {
|
|
128
|
-
text: string;
|
|
129
|
-
};
|
|
130
|
-
status: MessageContentStatus;
|
|
131
|
-
}[];
|
|
148
|
+
content: string;
|
|
132
149
|
role: MessageRole.HiddenGuide;
|
|
133
|
-
id?:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
150
|
+
id?: string;
|
|
151
|
+
messageId?: string;
|
|
152
|
+
name?: string;
|
|
153
|
+
sessionCode?: string;
|
|
154
|
+
status: MessageStatus;
|
|
137
155
|
} | {
|
|
138
|
-
content:
|
|
139
|
-
id?: number;
|
|
140
|
-
type: MessageContentType.Text;
|
|
141
|
-
data: {
|
|
142
|
-
text: string;
|
|
143
|
-
};
|
|
144
|
-
status: MessageContentStatus;
|
|
145
|
-
}[];
|
|
156
|
+
content: string;
|
|
146
157
|
role: MessageRole.Hidden;
|
|
147
|
-
id?:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
158
|
+
id?: string;
|
|
159
|
+
messageId?: string;
|
|
160
|
+
name?: string;
|
|
161
|
+
sessionCode?: string;
|
|
162
|
+
status: MessageStatus;
|
|
151
163
|
} | {
|
|
152
|
-
content:
|
|
153
|
-
id?: number;
|
|
154
|
-
type: MessageContentType.Text;
|
|
155
|
-
data: {
|
|
156
|
-
text: string;
|
|
157
|
-
};
|
|
158
|
-
status: MessageContentStatus;
|
|
159
|
-
}[];
|
|
164
|
+
content: string;
|
|
160
165
|
role: MessageRole.HiddenSystem;
|
|
161
|
-
id?:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
166
|
+
id?: string;
|
|
167
|
+
messageId?: string;
|
|
168
|
+
name?: string;
|
|
169
|
+
sessionCode?: string;
|
|
170
|
+
status: MessageStatus;
|
|
165
171
|
} | {
|
|
166
|
-
content:
|
|
167
|
-
id?: number;
|
|
168
|
-
type: MessageContentType.Text;
|
|
169
|
-
data: {
|
|
170
|
-
text: string;
|
|
171
|
-
};
|
|
172
|
-
status: MessageContentStatus;
|
|
173
|
-
}[];
|
|
172
|
+
content: string;
|
|
174
173
|
role: MessageRole.HiddenUser;
|
|
175
|
-
id?:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
id?: string;
|
|
175
|
+
messageId?: string;
|
|
176
|
+
name?: string;
|
|
177
|
+
sessionCode?: string;
|
|
178
|
+
status: MessageStatus;
|
|
179
179
|
} | {
|
|
180
|
-
content:
|
|
181
|
-
id?: number;
|
|
182
|
-
type: MessageContentType.Text;
|
|
183
|
-
data: {
|
|
184
|
-
text: string;
|
|
185
|
-
};
|
|
186
|
-
status: MessageContentStatus;
|
|
187
|
-
}[];
|
|
180
|
+
content: string;
|
|
188
181
|
role: MessageRole.Info;
|
|
189
|
-
id?:
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
182
|
+
id?: string;
|
|
183
|
+
messageId?: string;
|
|
184
|
+
name?: string;
|
|
185
|
+
sessionCode?: string;
|
|
186
|
+
status: MessageStatus;
|
|
193
187
|
} | {
|
|
194
|
-
content:
|
|
195
|
-
id?: number;
|
|
196
|
-
type: MessageContentType.Text;
|
|
197
|
-
data: {
|
|
198
|
-
text: string;
|
|
199
|
-
};
|
|
200
|
-
status: MessageContentStatus;
|
|
201
|
-
}[];
|
|
188
|
+
content: string;
|
|
202
189
|
role: MessageRole.Pause;
|
|
203
|
-
id?:
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
190
|
+
id?: string;
|
|
191
|
+
messageId?: string;
|
|
192
|
+
name?: string;
|
|
193
|
+
sessionCode?: string;
|
|
194
|
+
status: MessageStatus;
|
|
207
195
|
} | {
|
|
208
|
-
content:
|
|
209
|
-
id?: number;
|
|
210
|
-
type: MessageContentType.Text;
|
|
211
|
-
data: {
|
|
212
|
-
text: string;
|
|
213
|
-
};
|
|
214
|
-
status: MessageContentStatus;
|
|
215
|
-
}[];
|
|
196
|
+
content: string;
|
|
216
197
|
role: MessageRole.Placeholder;
|
|
217
|
-
id?:
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
198
|
+
id?: string;
|
|
199
|
+
messageId?: string;
|
|
200
|
+
name?: string;
|
|
201
|
+
sessionCode?: string;
|
|
202
|
+
status: MessageStatus;
|
|
203
|
+
} | {
|
|
204
|
+
content: string[];
|
|
205
|
+
duration?: number;
|
|
206
|
+
role: MessageRole.Reasoning;
|
|
207
|
+
id?: string;
|
|
208
|
+
messageId?: string;
|
|
209
|
+
name?: string;
|
|
210
|
+
sessionCode?: string;
|
|
211
|
+
status: MessageStatus;
|
|
212
|
+
} | {
|
|
213
|
+
content: string;
|
|
230
214
|
role: MessageRole.System;
|
|
231
|
-
id?:
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
215
|
+
id?: string;
|
|
216
|
+
messageId?: string;
|
|
217
|
+
name?: string;
|
|
218
|
+
sessionCode?: string;
|
|
219
|
+
status: MessageStatus;
|
|
235
220
|
} | {
|
|
236
|
-
content:
|
|
237
|
-
id?: number;
|
|
238
|
-
type: MessageContentType.Text;
|
|
239
|
-
data: {
|
|
240
|
-
text: string;
|
|
241
|
-
};
|
|
242
|
-
status: MessageContentStatus;
|
|
243
|
-
}[];
|
|
221
|
+
content: string;
|
|
244
222
|
role: MessageRole.TemplateAssistant;
|
|
245
|
-
id?:
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
223
|
+
id?: string;
|
|
224
|
+
messageId?: string;
|
|
225
|
+
name?: string;
|
|
226
|
+
sessionCode?: string;
|
|
227
|
+
status: MessageStatus;
|
|
249
228
|
} | {
|
|
250
|
-
content:
|
|
251
|
-
id?: number;
|
|
252
|
-
type: MessageContentType.Text;
|
|
253
|
-
data: {
|
|
254
|
-
text: string;
|
|
255
|
-
};
|
|
256
|
-
status: MessageContentStatus;
|
|
257
|
-
}[];
|
|
229
|
+
content: string;
|
|
258
230
|
role: MessageRole.TemplateGuide;
|
|
259
|
-
id?:
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
231
|
+
id?: string;
|
|
232
|
+
messageId?: string;
|
|
233
|
+
name?: string;
|
|
234
|
+
sessionCode?: string;
|
|
235
|
+
status: MessageStatus;
|
|
263
236
|
} | {
|
|
264
|
-
content:
|
|
265
|
-
id?: number;
|
|
266
|
-
type: MessageContentType.Text;
|
|
267
|
-
data: {
|
|
268
|
-
text: string;
|
|
269
|
-
};
|
|
270
|
-
status: MessageContentStatus;
|
|
271
|
-
}[];
|
|
237
|
+
content: string;
|
|
272
238
|
role: MessageRole.TemplateHidden;
|
|
273
|
-
id?:
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
239
|
+
id?: string;
|
|
240
|
+
messageId?: string;
|
|
241
|
+
name?: string;
|
|
242
|
+
sessionCode?: string;
|
|
243
|
+
status: MessageStatus;
|
|
277
244
|
} | {
|
|
278
|
-
content:
|
|
279
|
-
id?: number;
|
|
280
|
-
type: MessageContentType.Text;
|
|
281
|
-
data: {
|
|
282
|
-
text: string;
|
|
283
|
-
};
|
|
284
|
-
status: MessageContentStatus;
|
|
285
|
-
}[];
|
|
245
|
+
content: string;
|
|
286
246
|
role: MessageRole.TemplateSystem;
|
|
287
|
-
id?:
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
247
|
+
id?: string;
|
|
248
|
+
messageId?: string;
|
|
249
|
+
name?: string;
|
|
250
|
+
sessionCode?: string;
|
|
251
|
+
status: MessageStatus;
|
|
291
252
|
} | {
|
|
292
|
-
content:
|
|
293
|
-
id?: number;
|
|
294
|
-
type: MessageContentType.Text;
|
|
295
|
-
data: {
|
|
296
|
-
text: string;
|
|
297
|
-
};
|
|
298
|
-
status: MessageContentStatus;
|
|
299
|
-
}[];
|
|
253
|
+
content: string;
|
|
300
254
|
role: MessageRole.TemplateUser;
|
|
301
|
-
id?:
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
255
|
+
id?: string;
|
|
256
|
+
messageId?: string;
|
|
257
|
+
name?: string;
|
|
258
|
+
sessionCode?: string;
|
|
259
|
+
status: MessageStatus;
|
|
260
|
+
} | {
|
|
261
|
+
content: string;
|
|
262
|
+
duration?: number;
|
|
263
|
+
error?: string;
|
|
264
|
+
role: MessageRole.Tool;
|
|
265
|
+
toolCallId: string;
|
|
266
|
+
id?: string;
|
|
267
|
+
messageId?: string;
|
|
268
|
+
name?: string;
|
|
269
|
+
sessionCode?: string;
|
|
270
|
+
status: MessageStatus;
|
|
271
|
+
} | {
|
|
272
|
+
content: string | ({
|
|
273
|
+
data?: string;
|
|
274
|
+
filename?: string;
|
|
275
|
+
id?: string;
|
|
276
|
+
mimeType: string;
|
|
277
|
+
type: import("../message").MessageType.Binary;
|
|
278
|
+
url?: string;
|
|
279
|
+
} | {
|
|
280
|
+
text: string;
|
|
281
|
+
type: import("../message").MessageType.Text;
|
|
282
|
+
})[];
|
|
283
|
+
property?: {
|
|
284
|
+
[x: string]: unknown;
|
|
285
|
+
extra?: {
|
|
286
|
+
[x: string]: unknown;
|
|
287
|
+
cite?: string | {
|
|
288
|
+
data: {
|
|
289
|
+
key: string;
|
|
290
|
+
value: string;
|
|
291
|
+
}[];
|
|
292
|
+
title: string;
|
|
293
|
+
type: string;
|
|
294
|
+
};
|
|
295
|
+
command?: string;
|
|
296
|
+
context?: Array<Record<string, unknown>>;
|
|
297
|
+
resources?: Array<Record<string, unknown>>;
|
|
298
|
+
};
|
|
299
|
+
};
|
|
314
300
|
role: MessageRole.User;
|
|
315
|
-
id?:
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
301
|
+
id?: string;
|
|
302
|
+
messageId?: string;
|
|
303
|
+
name?: string;
|
|
304
|
+
sessionCode?: string;
|
|
305
|
+
status: MessageStatus;
|
|
319
306
|
})[];
|
|
307
|
+
supportUpload?: {
|
|
308
|
+
vision: boolean;
|
|
309
|
+
};
|
|
320
310
|
};
|
|
321
311
|
}, IAgentInfo | {
|
|
322
312
|
agentName?: string;
|
|
313
|
+
resources?: {
|
|
314
|
+
code: string;
|
|
315
|
+
icon: null | string;
|
|
316
|
+
id: null | number;
|
|
317
|
+
name: string;
|
|
318
|
+
type: string;
|
|
319
|
+
}[];
|
|
323
320
|
saasUrl?: string;
|
|
324
321
|
chatGroup?: {
|
|
325
322
|
enabled: boolean;
|
|
@@ -329,6 +326,7 @@ export declare const useAgent: (options: IUseChatHelperOptions, http: IHttpModul
|
|
|
329
326
|
conversationSettings?: {
|
|
330
327
|
commands?: {
|
|
331
328
|
agentId: number;
|
|
329
|
+
alias?: string;
|
|
332
330
|
components: {
|
|
333
331
|
default?: null | string;
|
|
334
332
|
fillBack?: boolean;
|
|
@@ -351,6 +349,9 @@ export declare const useAgent: (options: IUseChatHelperOptions, http: IHttpModul
|
|
|
351
349
|
id: string;
|
|
352
350
|
name: string;
|
|
353
351
|
status: string;
|
|
352
|
+
supportUpload?: {
|
|
353
|
+
vision: boolean;
|
|
354
|
+
};
|
|
354
355
|
}[];
|
|
355
356
|
enableChatSession?: boolean;
|
|
356
357
|
openingRemark?: string;
|
|
@@ -358,285 +359,264 @@ export declare const useAgent: (options: IUseChatHelperOptions, http: IHttpModul
|
|
|
358
359
|
};
|
|
359
360
|
promptSetting?: {
|
|
360
361
|
content?: ({
|
|
361
|
-
|
|
362
|
-
content:
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
};
|
|
369
|
-
status: MessageContentStatus;
|
|
362
|
+
activityType: import("../message").ActivityType;
|
|
363
|
+
content: {
|
|
364
|
+
nodes: Record<string, import("../event").IFlowAgentNode>;
|
|
365
|
+
task_id: number;
|
|
366
|
+
task_name: string;
|
|
367
|
+
task_outputs: string[];
|
|
368
|
+
task_state: import("../event").FlowTaskState;
|
|
370
369
|
} | {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
370
|
+
content: string;
|
|
371
|
+
referenceDocument: {
|
|
372
|
+
name: string;
|
|
374
373
|
originFileUrl?: string;
|
|
375
|
-
title: string;
|
|
376
374
|
url: string;
|
|
377
375
|
}[];
|
|
378
|
-
status: MessageContentStatus;
|
|
379
376
|
} | {
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
};
|
|
417
|
-
|
|
418
|
-
|
|
377
|
+
name: string;
|
|
378
|
+
originFileUrl?: string;
|
|
379
|
+
url: string;
|
|
380
|
+
}[];
|
|
381
|
+
role: MessageRole.Activity;
|
|
382
|
+
id?: string;
|
|
383
|
+
messageId?: string;
|
|
384
|
+
name?: string;
|
|
385
|
+
sessionCode?: string;
|
|
386
|
+
status: MessageStatus;
|
|
387
|
+
} | {
|
|
388
|
+
content?: string;
|
|
389
|
+
property?: {
|
|
390
|
+
[x: string]: unknown;
|
|
391
|
+
extra?: {
|
|
392
|
+
[x: string]: unknown;
|
|
393
|
+
cite?: string | {
|
|
394
|
+
data: {
|
|
395
|
+
key: string;
|
|
396
|
+
value: string;
|
|
397
|
+
}[];
|
|
398
|
+
title: string;
|
|
399
|
+
type: string;
|
|
400
|
+
};
|
|
401
|
+
command?: string;
|
|
402
|
+
context?: Array<Record<string, unknown>>;
|
|
403
|
+
resources?: Array<Record<string, unknown>>;
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
role: MessageRole.Assistant;
|
|
407
|
+
toolCalls?: {
|
|
408
|
+
function: {
|
|
409
|
+
arguments: string;
|
|
410
|
+
description?: string;
|
|
411
|
+
mcpName?: string;
|
|
412
|
+
name: string;
|
|
413
|
+
};
|
|
414
|
+
id: string;
|
|
415
|
+
type: import("../message").MessageType.Function;
|
|
416
|
+
}[];
|
|
417
|
+
id?: string;
|
|
418
|
+
messageId?: string;
|
|
419
|
+
name?: string;
|
|
420
|
+
sessionCode?: string;
|
|
421
|
+
status: MessageStatus;
|
|
422
|
+
} | {
|
|
423
|
+
content: string;
|
|
424
|
+
role: MessageRole.Developer;
|
|
425
|
+
id?: string;
|
|
426
|
+
messageId?: string;
|
|
427
|
+
name?: string;
|
|
428
|
+
sessionCode?: string;
|
|
429
|
+
status: MessageStatus;
|
|
430
|
+
} | {
|
|
431
|
+
content: string;
|
|
419
432
|
role: MessageRole.Guide;
|
|
420
|
-
id?:
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
433
|
+
id?: string;
|
|
434
|
+
messageId?: string;
|
|
435
|
+
name?: string;
|
|
436
|
+
sessionCode?: string;
|
|
437
|
+
status: MessageStatus;
|
|
424
438
|
} | {
|
|
425
|
-
content:
|
|
426
|
-
id?: number;
|
|
427
|
-
type: MessageContentType.Text;
|
|
428
|
-
data: {
|
|
429
|
-
text: string;
|
|
430
|
-
};
|
|
431
|
-
status: MessageContentStatus;
|
|
432
|
-
}[];
|
|
439
|
+
content: string;
|
|
433
440
|
role: MessageRole.HiddenAssistant;
|
|
434
|
-
id?:
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
441
|
+
id?: string;
|
|
442
|
+
messageId?: string;
|
|
443
|
+
name?: string;
|
|
444
|
+
sessionCode?: string;
|
|
445
|
+
status: MessageStatus;
|
|
438
446
|
} | {
|
|
439
|
-
content:
|
|
440
|
-
id?: number;
|
|
441
|
-
type: MessageContentType.Text;
|
|
442
|
-
data: {
|
|
443
|
-
text: string;
|
|
444
|
-
};
|
|
445
|
-
status: MessageContentStatus;
|
|
446
|
-
}[];
|
|
447
|
+
content: string;
|
|
447
448
|
role: MessageRole.HiddenGuide;
|
|
448
|
-
id?:
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
449
|
+
id?: string;
|
|
450
|
+
messageId?: string;
|
|
451
|
+
name?: string;
|
|
452
|
+
sessionCode?: string;
|
|
453
|
+
status: MessageStatus;
|
|
452
454
|
} | {
|
|
453
|
-
content:
|
|
454
|
-
id?: number;
|
|
455
|
-
type: MessageContentType.Text;
|
|
456
|
-
data: {
|
|
457
|
-
text: string;
|
|
458
|
-
};
|
|
459
|
-
status: MessageContentStatus;
|
|
460
|
-
}[];
|
|
455
|
+
content: string;
|
|
461
456
|
role: MessageRole.Hidden;
|
|
462
|
-
id?:
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
457
|
+
id?: string;
|
|
458
|
+
messageId?: string;
|
|
459
|
+
name?: string;
|
|
460
|
+
sessionCode?: string;
|
|
461
|
+
status: MessageStatus;
|
|
466
462
|
} | {
|
|
467
|
-
content:
|
|
468
|
-
id?: number;
|
|
469
|
-
type: MessageContentType.Text;
|
|
470
|
-
data: {
|
|
471
|
-
text: string;
|
|
472
|
-
};
|
|
473
|
-
status: MessageContentStatus;
|
|
474
|
-
}[];
|
|
463
|
+
content: string;
|
|
475
464
|
role: MessageRole.HiddenSystem;
|
|
476
|
-
id?:
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
465
|
+
id?: string;
|
|
466
|
+
messageId?: string;
|
|
467
|
+
name?: string;
|
|
468
|
+
sessionCode?: string;
|
|
469
|
+
status: MessageStatus;
|
|
480
470
|
} | {
|
|
481
|
-
content:
|
|
482
|
-
id?: number;
|
|
483
|
-
type: MessageContentType.Text;
|
|
484
|
-
data: {
|
|
485
|
-
text: string;
|
|
486
|
-
};
|
|
487
|
-
status: MessageContentStatus;
|
|
488
|
-
}[];
|
|
471
|
+
content: string;
|
|
489
472
|
role: MessageRole.HiddenUser;
|
|
490
|
-
id?:
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
473
|
+
id?: string;
|
|
474
|
+
messageId?: string;
|
|
475
|
+
name?: string;
|
|
476
|
+
sessionCode?: string;
|
|
477
|
+
status: MessageStatus;
|
|
494
478
|
} | {
|
|
495
|
-
content:
|
|
496
|
-
id?: number;
|
|
497
|
-
type: MessageContentType.Text;
|
|
498
|
-
data: {
|
|
499
|
-
text: string;
|
|
500
|
-
};
|
|
501
|
-
status: MessageContentStatus;
|
|
502
|
-
}[];
|
|
479
|
+
content: string;
|
|
503
480
|
role: MessageRole.Info;
|
|
504
|
-
id?:
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
481
|
+
id?: string;
|
|
482
|
+
messageId?: string;
|
|
483
|
+
name?: string;
|
|
484
|
+
sessionCode?: string;
|
|
485
|
+
status: MessageStatus;
|
|
508
486
|
} | {
|
|
509
|
-
content:
|
|
510
|
-
id?: number;
|
|
511
|
-
type: MessageContentType.Text;
|
|
512
|
-
data: {
|
|
513
|
-
text: string;
|
|
514
|
-
};
|
|
515
|
-
status: MessageContentStatus;
|
|
516
|
-
}[];
|
|
487
|
+
content: string;
|
|
517
488
|
role: MessageRole.Pause;
|
|
518
|
-
id?:
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
489
|
+
id?: string;
|
|
490
|
+
messageId?: string;
|
|
491
|
+
name?: string;
|
|
492
|
+
sessionCode?: string;
|
|
493
|
+
status: MessageStatus;
|
|
522
494
|
} | {
|
|
523
|
-
content:
|
|
524
|
-
id?: number;
|
|
525
|
-
type: MessageContentType.Text;
|
|
526
|
-
data: {
|
|
527
|
-
text: string;
|
|
528
|
-
};
|
|
529
|
-
status: MessageContentStatus;
|
|
530
|
-
}[];
|
|
495
|
+
content: string;
|
|
531
496
|
role: MessageRole.Placeholder;
|
|
532
|
-
id?:
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
497
|
+
id?: string;
|
|
498
|
+
messageId?: string;
|
|
499
|
+
name?: string;
|
|
500
|
+
sessionCode?: string;
|
|
501
|
+
status: MessageStatus;
|
|
502
|
+
} | {
|
|
503
|
+
content: string[];
|
|
504
|
+
duration?: number;
|
|
505
|
+
role: MessageRole.Reasoning;
|
|
506
|
+
id?: string;
|
|
507
|
+
messageId?: string;
|
|
508
|
+
name?: string;
|
|
509
|
+
sessionCode?: string;
|
|
510
|
+
status: MessageStatus;
|
|
511
|
+
} | {
|
|
512
|
+
content: string;
|
|
545
513
|
role: MessageRole.System;
|
|
546
|
-
id?:
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
514
|
+
id?: string;
|
|
515
|
+
messageId?: string;
|
|
516
|
+
name?: string;
|
|
517
|
+
sessionCode?: string;
|
|
518
|
+
status: MessageStatus;
|
|
550
519
|
} | {
|
|
551
|
-
content:
|
|
552
|
-
id?: number;
|
|
553
|
-
type: MessageContentType.Text;
|
|
554
|
-
data: {
|
|
555
|
-
text: string;
|
|
556
|
-
};
|
|
557
|
-
status: MessageContentStatus;
|
|
558
|
-
}[];
|
|
520
|
+
content: string;
|
|
559
521
|
role: MessageRole.TemplateAssistant;
|
|
560
|
-
id?:
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
522
|
+
id?: string;
|
|
523
|
+
messageId?: string;
|
|
524
|
+
name?: string;
|
|
525
|
+
sessionCode?: string;
|
|
526
|
+
status: MessageStatus;
|
|
564
527
|
} | {
|
|
565
|
-
content:
|
|
566
|
-
id?: number;
|
|
567
|
-
type: MessageContentType.Text;
|
|
568
|
-
data: {
|
|
569
|
-
text: string;
|
|
570
|
-
};
|
|
571
|
-
status: MessageContentStatus;
|
|
572
|
-
}[];
|
|
528
|
+
content: string;
|
|
573
529
|
role: MessageRole.TemplateGuide;
|
|
574
|
-
id?:
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
530
|
+
id?: string;
|
|
531
|
+
messageId?: string;
|
|
532
|
+
name?: string;
|
|
533
|
+
sessionCode?: string;
|
|
534
|
+
status: MessageStatus;
|
|
578
535
|
} | {
|
|
579
|
-
content:
|
|
580
|
-
id?: number;
|
|
581
|
-
type: MessageContentType.Text;
|
|
582
|
-
data: {
|
|
583
|
-
text: string;
|
|
584
|
-
};
|
|
585
|
-
status: MessageContentStatus;
|
|
586
|
-
}[];
|
|
536
|
+
content: string;
|
|
587
537
|
role: MessageRole.TemplateHidden;
|
|
588
|
-
id?:
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
538
|
+
id?: string;
|
|
539
|
+
messageId?: string;
|
|
540
|
+
name?: string;
|
|
541
|
+
sessionCode?: string;
|
|
542
|
+
status: MessageStatus;
|
|
592
543
|
} | {
|
|
593
|
-
content:
|
|
594
|
-
id?: number;
|
|
595
|
-
type: MessageContentType.Text;
|
|
596
|
-
data: {
|
|
597
|
-
text: string;
|
|
598
|
-
};
|
|
599
|
-
status: MessageContentStatus;
|
|
600
|
-
}[];
|
|
544
|
+
content: string;
|
|
601
545
|
role: MessageRole.TemplateSystem;
|
|
602
|
-
id?:
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
546
|
+
id?: string;
|
|
547
|
+
messageId?: string;
|
|
548
|
+
name?: string;
|
|
549
|
+
sessionCode?: string;
|
|
550
|
+
status: MessageStatus;
|
|
606
551
|
} | {
|
|
607
|
-
content:
|
|
608
|
-
id?: number;
|
|
609
|
-
type: MessageContentType.Text;
|
|
610
|
-
data: {
|
|
611
|
-
text: string;
|
|
612
|
-
};
|
|
613
|
-
status: MessageContentStatus;
|
|
614
|
-
}[];
|
|
552
|
+
content: string;
|
|
615
553
|
role: MessageRole.TemplateUser;
|
|
616
|
-
id?:
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
554
|
+
id?: string;
|
|
555
|
+
messageId?: string;
|
|
556
|
+
name?: string;
|
|
557
|
+
sessionCode?: string;
|
|
558
|
+
status: MessageStatus;
|
|
559
|
+
} | {
|
|
560
|
+
content: string;
|
|
561
|
+
duration?: number;
|
|
562
|
+
error?: string;
|
|
563
|
+
role: MessageRole.Tool;
|
|
564
|
+
toolCallId: string;
|
|
565
|
+
id?: string;
|
|
566
|
+
messageId?: string;
|
|
567
|
+
name?: string;
|
|
568
|
+
sessionCode?: string;
|
|
569
|
+
status: MessageStatus;
|
|
570
|
+
} | {
|
|
571
|
+
content: string | ({
|
|
572
|
+
data?: string;
|
|
573
|
+
filename?: string;
|
|
574
|
+
id?: string;
|
|
575
|
+
mimeType: string;
|
|
576
|
+
type: import("../message").MessageType.Binary;
|
|
577
|
+
url?: string;
|
|
578
|
+
} | {
|
|
579
|
+
text: string;
|
|
580
|
+
type: import("../message").MessageType.Text;
|
|
581
|
+
})[];
|
|
582
|
+
property?: {
|
|
583
|
+
[x: string]: unknown;
|
|
584
|
+
extra?: {
|
|
585
|
+
[x: string]: unknown;
|
|
586
|
+
cite?: string | {
|
|
587
|
+
data: {
|
|
588
|
+
key: string;
|
|
589
|
+
value: string;
|
|
590
|
+
}[];
|
|
591
|
+
title: string;
|
|
592
|
+
type: string;
|
|
593
|
+
};
|
|
594
|
+
command?: string;
|
|
595
|
+
context?: Array<Record<string, unknown>>;
|
|
596
|
+
resources?: Array<Record<string, unknown>>;
|
|
597
|
+
};
|
|
598
|
+
};
|
|
629
599
|
role: MessageRole.User;
|
|
630
|
-
id?:
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
600
|
+
id?: string;
|
|
601
|
+
messageId?: string;
|
|
602
|
+
name?: string;
|
|
603
|
+
sessionCode?: string;
|
|
604
|
+
status: MessageStatus;
|
|
634
605
|
})[];
|
|
606
|
+
supportUpload?: {
|
|
607
|
+
vision: boolean;
|
|
608
|
+
};
|
|
635
609
|
};
|
|
636
610
|
}>;
|
|
637
611
|
isInfoLoading: import("vue").Ref<boolean, boolean>;
|
|
638
|
-
|
|
639
|
-
|
|
612
|
+
isChatting: import("vue").Ref<boolean, boolean>;
|
|
613
|
+
chat: (userInput: IUserMessage["content"], sessionCode: string, url?: string, config?: IRequestConfig, property?: IMessageProperty) => Promise<void>;
|
|
614
|
+
handleRole: (data: IAgentInfo, sessionCode: string) => void;
|
|
615
|
+
resendMessage: (messageId: string, sessionCode: string, newContent?: IUserMessage["content"], url?: string, config?: IRequestConfig) => Promise<void>;
|
|
616
|
+
resumeStreamingChat: (sessionCode: string, url?: string, config?: IRequestConfig) => void;
|
|
617
|
+
abortChat: () => void;
|
|
618
|
+
stopChat: (sessionCode: string) => Promise<void>;
|
|
640
619
|
getAgentInfo: () => Promise<void>;
|
|
620
|
+
reset: (protocol: ISSEProtocol) => void;
|
|
641
621
|
};
|
|
642
622
|
export type IAgentModule = ReturnType<typeof useAgent>;
|