@lingya-ai/agents-sdk 0.1.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bound.js ADDED
@@ -0,0 +1,625 @@
1
+ "use strict";
2
+ // This file is generated by scripts/generate-bound-api.mjs. Do not edit it manually.
3
+ //
4
+ // These facades bind channelId once so application code cannot accidentally sign a
5
+ // request for a channel that differs from the client configuration.
6
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
7
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
8
+ return new (P || (P = Promise))(function (resolve, reject) {
9
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
10
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
11
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
12
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
13
+ });
14
+ };
15
+ var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
16
+ var __asyncValues = (this && this.__asyncValues) || function (o) {
17
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
18
+ var m = o[Symbol.asyncIterator], i;
19
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
20
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
21
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
22
+ };
23
+ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
24
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
25
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
26
+ return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
27
+ function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
28
+ function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
29
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
30
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
31
+ function fulfill(value) { resume("next", value); }
32
+ function reject(value) { resume("throw", value); }
33
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
34
+ };
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.LingyaWorkspaceApi = exports.LingyaKnowledgeApi = exports.LingyaFilesApi = exports.LingyaInteractionsApi = exports.LingyaEventsApi = exports.LingyaMessagesApi = exports.LingyaSqlApi = exports.LingyaConversationsApi = exports.LingyaChatApi = exports.LingyaConfigurationApi = exports.LingyaAgentsLowLevelApis = exports.WorkspaceApi = exports.KnowledgeApi = exports.FilesApi = exports.InteractionsApi = exports.EventsApi = exports.MessagesApi = exports.SqlApi = exports.ConversationsApi = exports.ChatApi = exports.ConfigurationApi = exports.AgentsLowLevelApis = void 0;
37
+ const ChatStreamProbeEvent_1 = require("./models/ChatStreamProbeEvent");
38
+ const events_1 = require("./events");
39
+ const sse_1 = require("./sse");
40
+ /** Generated APIs retained as an explicit compatibility escape hatch until 1.0. */
41
+ class AgentsLowLevelApis {
42
+ constructor(configuration, chat, conversations, sql, messages, events, interactions, files, knowledge, workspace) {
43
+ this.configuration = configuration;
44
+ this.chat = chat;
45
+ this.conversations = conversations;
46
+ this.sql = sql;
47
+ this.messages = messages;
48
+ this.events = events;
49
+ this.interactions = interactions;
50
+ this.files = files;
51
+ this.knowledge = knowledge;
52
+ this.workspace = workspace;
53
+ }
54
+ }
55
+ exports.AgentsLowLevelApis = AgentsLowLevelApis;
56
+ exports.LingyaAgentsLowLevelApis = AgentsLowLevelApis;
57
+ /** Channel-bound configuration operations for one external user. */
58
+ class ConfigurationApi {
59
+ constructor(channelId, delegate) {
60
+ this.channelId = channelId;
61
+ this.delegate = delegate;
62
+ }
63
+ /**
64
+ * 读取 Agent 配置 / Get Agent configuration
65
+ *
66
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
67
+ */
68
+ getAgentsConfig() {
69
+ return this.delegate.getAgentsConfig({ channelId: this.channelId });
70
+ }
71
+ /**
72
+ * 读取会话配置 / Get conversation configuration
73
+ *
74
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
75
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
76
+ */
77
+ getConversationConfig(conversationId) {
78
+ return this.delegate.getConversationConfig({ channelId: this.channelId, conversationId });
79
+ }
80
+ }
81
+ exports.ConfigurationApi = ConfigurationApi;
82
+ exports.LingyaConfigurationApi = ConfigurationApi;
83
+ /** Channel-bound chat operations for one external user. */
84
+ class ChatApi {
85
+ constructor(channelId, delegate, rawRequest) {
86
+ this.channelId = channelId;
87
+ this.delegate = delegate;
88
+ this.rawRequest = rawRequest;
89
+ }
90
+ /**
91
+ * 创建会话并提交消息 / Create a conversation and submit a message
92
+ *
93
+ * @param input - 创建会话并提交消息 / Create a conversation and submit a message 的强类型请求体。 / Typed request body for createChat.
94
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
95
+ */
96
+ createChat(input) {
97
+ return this.delegate.createChat({ channelId: this.channelId, aiChatInput: input });
98
+ }
99
+ /**
100
+ * 向已有会话提交消息 / Submit a message to an existing conversation
101
+ *
102
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
103
+ * @param input - 向已有会话提交消息 / Submit a message to an existing conversation 的强类型请求体。 / Typed request body for continueChat.
104
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
105
+ */
106
+ continueChat(conversationId, input) {
107
+ return this.delegate.continueChat({ channelId: this.channelId, conversationId, aiChatInput: input });
108
+ }
109
+ /**
110
+ * 订阅消息事件流 / Stream message events
111
+ *
112
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
113
+ * @param input - 订阅消息事件流 / Stream message events 的强类型请求体。 / Typed request body for streamChatEvents.
114
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
115
+ * @returns 可取消的强类型事件序列。 / A cancellable typed event sequence.
116
+ */
117
+ streamChatEvents(conversationId_1, input_1) {
118
+ return __asyncGenerator(this, arguments, function* streamChatEvents_1(conversationId, input, options = {}) {
119
+ var _a, e_1, _b, _c;
120
+ const suffix = `/conversations/${encodeURIComponent(String(conversationId))}/stream`;
121
+ const response = yield __await(this.rawRequest('POST', suffix, JSON.stringify(input), undefined, 'text/event-stream', options === null || options === void 0 ? void 0 : options.xRequestID));
122
+ try {
123
+ for (var _d = true, _e = __asyncValues((0, sse_1.decodeSse)(response)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
124
+ _c = _f.value;
125
+ _d = false;
126
+ const data = _c;
127
+ yield yield __await((0, events_1.decodeAiChatBriefEvent)(data));
128
+ }
129
+ }
130
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
131
+ finally {
132
+ try {
133
+ if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
134
+ }
135
+ finally { if (e_1) throw e_1.error; }
136
+ }
137
+ });
138
+ }
139
+ /**
140
+ * 探测 SSE 连接 / Probe the SSE connection
141
+ *
142
+ * @param input - 探测 SSE 连接 / Probe the SSE connection 的强类型请求体。 / Typed request body for probeEventStream.
143
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
144
+ * @returns 可取消的强类型事件序列。 / A cancellable typed event sequence.
145
+ */
146
+ probeEventStream(input_1) {
147
+ return __asyncGenerator(this, arguments, function* probeEventStream_1(input, options = {}) {
148
+ var _a, e_2, _b, _c;
149
+ const suffix = `/stream-probe`;
150
+ const response = yield __await(this.rawRequest('POST', suffix, JSON.stringify(input), undefined, 'text/event-stream', options === null || options === void 0 ? void 0 : options.xRequestID));
151
+ try {
152
+ for (var _d = true, _e = __asyncValues((0, sse_1.decodeSse)(response)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
153
+ _c = _f.value;
154
+ _d = false;
155
+ const data = _c;
156
+ yield yield __await((0, ChatStreamProbeEvent_1.ChatStreamProbeEventFromJSON)(JSON.parse(data)));
157
+ }
158
+ }
159
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
160
+ finally {
161
+ try {
162
+ if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
163
+ }
164
+ finally { if (e_2) throw e_2.error; }
165
+ }
166
+ });
167
+ }
168
+ /**
169
+ * 中断会话执行 / Interrupt conversation execution
170
+ *
171
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
172
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
173
+ */
174
+ interruptConversation(conversationId) {
175
+ return this.delegate.interruptConversation({ channelId: this.channelId, conversationId });
176
+ }
177
+ /**
178
+ * 压缩会话上下文 / Compact conversation context
179
+ *
180
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
181
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
182
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
183
+ */
184
+ compactConversation(conversationId, options = {}) {
185
+ return this.delegate.compactConversation(Object.assign({ channelId: this.channelId, conversationId }, options));
186
+ }
187
+ }
188
+ exports.ChatApi = ChatApi;
189
+ exports.LingyaChatApi = ChatApi;
190
+ /** Channel-bound conversations operations for one external user. */
191
+ class ConversationsApi {
192
+ constructor(channelId, delegate) {
193
+ this.channelId = channelId;
194
+ this.delegate = delegate;
195
+ }
196
+ /**
197
+ * 删除会话 / Delete a conversation
198
+ *
199
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
200
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
201
+ */
202
+ deleteConversation(conversationId) {
203
+ return this.delegate.deleteConversation({ channelId: this.channelId, conversationId });
204
+ }
205
+ /**
206
+ * 读取上下文占用 / Get context usage
207
+ *
208
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
209
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
210
+ */
211
+ getConversationContextUsage(conversationId) {
212
+ return this.delegate.getConversationContextUsage({ channelId: this.channelId, conversationId });
213
+ }
214
+ /**
215
+ * 分页查询会话 / List conversations
216
+ *
217
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
218
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
219
+ */
220
+ listConversations(options = {}) {
221
+ return this.delegate.listConversations(Object.assign({ channelId: this.channelId }, options));
222
+ }
223
+ /**
224
+ * 查询活动会话 / List active conversations
225
+ *
226
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
227
+ */
228
+ listActiveConversations() {
229
+ return this.delegate.listActiveConversations({ channelId: this.channelId });
230
+ }
231
+ /**
232
+ * 查询未读会话 / List unread conversations
233
+ *
234
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
235
+ */
236
+ listUnreadConversations() {
237
+ return this.delegate.listUnreadConversations({ channelId: this.channelId });
238
+ }
239
+ /**
240
+ * 批量查询会话活动 / Query conversation activities
241
+ *
242
+ * @param input - 批量查询会话活动 / Query conversation activities 的强类型请求体。 / Typed request body for queryConversationActivities.
243
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
244
+ */
245
+ queryConversationActivities(input) {
246
+ return this.delegate.queryConversationActivities({ channelId: this.channelId, conversationActivityBatchInput: input });
247
+ }
248
+ /**
249
+ * 推进会话已读游标 / Mark a conversation as read
250
+ *
251
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
252
+ * @param input - 推进会话已读游标 / Mark a conversation as read 的强类型请求体。 / Typed request body for markConversationRead.
253
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
254
+ */
255
+ markConversationRead(conversationId, input) {
256
+ return this.delegate.markConversationRead({ channelId: this.channelId, conversationId, conversationReadReceiptInput: input });
257
+ }
258
+ /**
259
+ * 读取会话统计 / Get conversation statistics
260
+ *
261
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
262
+ */
263
+ getConversationStats() {
264
+ return this.delegate.getConversationStats({ channelId: this.channelId });
265
+ }
266
+ /**
267
+ * 读取会话标题 / Get conversation title
268
+ *
269
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
270
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
271
+ */
272
+ getConversationTitle(conversationId) {
273
+ return this.delegate.getConversationTitle({ channelId: this.channelId, conversationId });
274
+ }
275
+ /**
276
+ * 更新会话标题 / Update conversation title
277
+ *
278
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
279
+ * @param input - 更新会话标题 / Update conversation title 的强类型请求体。 / Typed request body for updateConversationTitle.
280
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
281
+ */
282
+ updateConversationTitle(conversationId, input) {
283
+ return this.delegate.updateConversationTitle({ channelId: this.channelId, conversationId, conversationTitleInput: input });
284
+ }
285
+ /**
286
+ * 更新会话状态 / Update conversation status
287
+ *
288
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
289
+ * @param input - 更新会话状态 / Update conversation status 的强类型请求体。 / Typed request body for updateConversationStatus.
290
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
291
+ */
292
+ updateConversationStatus(conversationId, input) {
293
+ return this.delegate.updateConversationStatus({ channelId: this.channelId, conversationId, conversationStatusInput: input });
294
+ }
295
+ /**
296
+ * 查询会话分享 / List conversation shares
297
+ *
298
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
299
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
300
+ */
301
+ listConversationShares(conversationId) {
302
+ return this.delegate.listConversationShares({ channelId: this.channelId, conversationId });
303
+ }
304
+ /**
305
+ * 创建会话分享 / Create a conversation share
306
+ *
307
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
308
+ * @param input - 创建会话分享 / Create a conversation share 的强类型请求体。 / Typed request body for createConversationShare.
309
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
310
+ */
311
+ createConversationShare(conversationId, input) {
312
+ return this.delegate.createConversationShare({ channelId: this.channelId, conversationId, conversationShareInput: input });
313
+ }
314
+ /**
315
+ * 撤销会话分享 / Revoke a conversation share
316
+ *
317
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
318
+ * @param shareId - 会话分享记录 ID。 / Conversation-share record ID.
319
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
320
+ */
321
+ revokeConversationShare(conversationId, shareId) {
322
+ return this.delegate.revokeConversationShare({ channelId: this.channelId, conversationId, shareId });
323
+ }
324
+ }
325
+ exports.ConversationsApi = ConversationsApi;
326
+ exports.LingyaConversationsApi = ConversationsApi;
327
+ /** Channel-bound sql operations for one external user. */
328
+ class SqlApi {
329
+ constructor(channelId, delegate) {
330
+ this.channelId = channelId;
331
+ this.delegate = delegate;
332
+ }
333
+ /**
334
+ * 分页读取 SQL 结果 / Get paged SQL results
335
+ *
336
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
337
+ * @param resultId - SQL 查询结果 ID。 / SQL query-result ID.
338
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
339
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
340
+ */
341
+ getSqlQueryResult(conversationId, resultId, options = {}) {
342
+ return this.delegate.getSqlQueryResult(Object.assign({ channelId: this.channelId, conversationId, resultId }, options));
343
+ }
344
+ /**
345
+ * 读取 SQL 图表数据 / Get SQL chart data
346
+ *
347
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
348
+ * @param resultId - SQL 查询结果 ID。 / SQL query-result ID.
349
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
350
+ */
351
+ getSqlQueryChartData(conversationId, resultId) {
352
+ return this.delegate.getSqlQueryChartData({ channelId: this.channelId, conversationId, resultId });
353
+ }
354
+ /**
355
+ * 导出 SQL 结果 / Export SQL results
356
+ *
357
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
358
+ * @param resultId - SQL 查询结果 ID。 / SQL query-result ID.
359
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
360
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
361
+ */
362
+ exportSqlQueryResult(conversationId, resultId, options) {
363
+ return __awaiter(this, void 0, void 0, function* () {
364
+ const value = yield this.delegate.exportSqlQueryResult(Object.assign({ channelId: this.channelId, conversationId, resultId }, options));
365
+ return new Uint8Array(yield value.arrayBuffer());
366
+ });
367
+ }
368
+ }
369
+ exports.SqlApi = SqlApi;
370
+ exports.LingyaSqlApi = SqlApi;
371
+ /** Channel-bound messages operations for one external user. */
372
+ class MessagesApi {
373
+ constructor(channelId, delegate) {
374
+ this.channelId = channelId;
375
+ this.delegate = delegate;
376
+ }
377
+ /**
378
+ * 分页查询会话消息 / List conversation messages
379
+ *
380
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
381
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
382
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
383
+ */
384
+ listConversationMessages(conversationId, options = {}) {
385
+ return this.delegate.listConversationMessages(Object.assign({ channelId: this.channelId, conversationId }, options));
386
+ }
387
+ /**
388
+ * 读取单条会话消息 / Get a conversation message
389
+ *
390
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
391
+ * @param messageId - 用户消息 ID;必须属于指定会话。 / User-message ID owned by the specified conversation.
392
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
393
+ */
394
+ getConversationMessage(conversationId, messageId) {
395
+ return this.delegate.getConversationMessage({ channelId: this.channelId, conversationId, messageId });
396
+ }
397
+ /**
398
+ * 分页查询异步任务 / List asynchronous tasks
399
+ *
400
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
401
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
402
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
403
+ */
404
+ listConversationAsyncTasks(conversationId, options = {}) {
405
+ return this.delegate.listConversationAsyncTasks(Object.assign({ channelId: this.channelId, conversationId }, options));
406
+ }
407
+ /**
408
+ * 读取异步任务 / Get an asynchronous task
409
+ *
410
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
411
+ * @param asyncTaskId - 异步任务 ID。 / Asynchronous task ID.
412
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
413
+ */
414
+ getConversationAsyncTask(conversationId, asyncTaskId) {
415
+ return this.delegate.getConversationAsyncTask({ channelId: this.channelId, conversationId, asyncTaskId });
416
+ }
417
+ /**
418
+ * 取消排队消息 / Cancel a queued message
419
+ *
420
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
421
+ * @param messageId - 用户消息 ID;必须属于指定会话。 / User-message ID owned by the specified conversation.
422
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
423
+ */
424
+ cancelQueuedMessage(conversationId, messageId) {
425
+ return this.delegate.cancelQueuedMessage({ channelId: this.channelId, conversationId, messageId });
426
+ }
427
+ }
428
+ exports.MessagesApi = MessagesApi;
429
+ exports.LingyaMessagesApi = MessagesApi;
430
+ /** Channel-bound events operations for one external user. */
431
+ class EventsApi {
432
+ constructor(channelId, delegate) {
433
+ this.channelId = channelId;
434
+ this.delegate = delegate;
435
+ }
436
+ /**
437
+ * 读取消息事件 / Get message events
438
+ *
439
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
440
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
441
+ */
442
+ getChatEvents(options) {
443
+ return this.delegate.getChatEvents(Object.assign({ channelId: this.channelId }, options));
444
+ }
445
+ /**
446
+ * 批量读取消息事件 / Get message events in batch
447
+ *
448
+ * @param input - 批量读取消息事件 / Get message events in batch 的强类型请求体。 / Typed request body for getChatEventsBatch.
449
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
450
+ */
451
+ getChatEventsBatch(input) {
452
+ return this.delegate.getChatEventsBatch({ channelId: this.channelId, aiChatEventsBatchInput: input });
453
+ }
454
+ }
455
+ exports.EventsApi = EventsApi;
456
+ exports.LingyaEventsApi = EventsApi;
457
+ /** Channel-bound interactions operations for one external user. */
458
+ class InteractionsApi {
459
+ constructor(channelId, delegate) {
460
+ this.channelId = channelId;
461
+ this.delegate = delegate;
462
+ }
463
+ /**
464
+ * 提交计划审批 / Submit plan approval
465
+ *
466
+ * @param input - 提交计划审批 / Submit plan approval 的强类型请求体。 / Typed request body for approvePlan.
467
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
468
+ */
469
+ approvePlan(input) {
470
+ return this.delegate.approvePlan({ channelId: this.channelId, planApprovalInput: input });
471
+ }
472
+ /**
473
+ * 查询计划审批状态 / Get plan approval status
474
+ *
475
+ * @param planId - 等待审批的计划 ID。 / Pending plan-approval ID.
476
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
477
+ */
478
+ getPlanStatus(planId) {
479
+ return this.delegate.getPlanStatus({ channelId: this.channelId, planId });
480
+ }
481
+ /**
482
+ * 查询用户问答状态 / Get user-input status
483
+ *
484
+ * @param questionId - 等待回答的问题 ID。 / Pending question ID.
485
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
486
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
487
+ */
488
+ getUserInputStatus(questionId, options) {
489
+ return this.delegate.getUserInputStatus(Object.assign({ channelId: this.channelId, questionId }, options));
490
+ }
491
+ /**
492
+ * 提交用户回答 / Submit a user answer
493
+ *
494
+ * @param input - 提交用户回答 / Submit a user answer 的强类型请求体。 / Typed request body for answerUserInput.
495
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
496
+ */
497
+ answerUserInput(input) {
498
+ return this.delegate.answerUserInput({ channelId: this.channelId, userInputAnswerInput: input });
499
+ }
500
+ }
501
+ exports.InteractionsApi = InteractionsApi;
502
+ exports.LingyaInteractionsApi = InteractionsApi;
503
+ /** Channel-bound files operations for one external user. */
504
+ class FilesApi {
505
+ constructor(channelId, delegate) {
506
+ this.channelId = channelId;
507
+ this.delegate = delegate;
508
+ }
509
+ /**
510
+ * 创建预签名上传地址 / Create a presigned upload URL
511
+ *
512
+ * @param input - 创建预签名上传地址 / Create a presigned upload URL 的强类型请求体。 / Typed request body for createPreSignedUpload.
513
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
514
+ */
515
+ createPreSignedUpload(input) {
516
+ return this.delegate.createPreSignedUpload({ channelId: this.channelId, generatePreSignedUrlInput: input });
517
+ }
518
+ /**
519
+ * 确认预签名上传 / Confirm a presigned upload
520
+ *
521
+ * @param input - 确认预签名上传 / Confirm a presigned upload 的强类型请求体。 / Typed request body for confirmPreSignedUpload.
522
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
523
+ */
524
+ confirmPreSignedUpload(input) {
525
+ return this.delegate.confirmPreSignedUpload({ channelId: this.channelId, confirmUploadInput: input });
526
+ }
527
+ /**
528
+ * 按 MD5 复用文件 / Reuse a file by MD5
529
+ *
530
+ * @param input - 按 MD5 复用文件 / Reuse a file by MD5 的强类型请求体。 / Typed request body for createFileByContentMd5.
531
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
532
+ */
533
+ createFileByContentMd5(input) {
534
+ return this.delegate.createFileByContentMd5({ channelId: this.channelId, createFileInput: input });
535
+ }
536
+ /**
537
+ * 检查 MD5 文件是否存在 / Check file existence by MD5
538
+ *
539
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
540
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
541
+ */
542
+ fileExistsByContentMd5(options) {
543
+ return this.delegate.fileExistsByContentMd5(Object.assign({ channelId: this.channelId }, options));
544
+ }
545
+ /**
546
+ * 创建会话文件预览地址 / Create a conversation file preview URL
547
+ *
548
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
549
+ * @param fileId - 文件记录 ID。 / File record ID.
550
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
551
+ */
552
+ getConversationFilePreview(conversationId, fileId) {
553
+ return this.delegate.getConversationFilePreview({ channelId: this.channelId, conversationId, fileId });
554
+ }
555
+ /**
556
+ * 创建计划快照预览地址 / Create a plan snapshot preview URL
557
+ *
558
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
559
+ * @param messageId - 用户消息 ID;必须属于指定会话。 / User-message ID owned by the specified conversation.
560
+ * @param fileId - 文件记录 ID。 / File record ID.
561
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
562
+ */
563
+ getPlanIntermediateFilePreview(conversationId, messageId, fileId) {
564
+ return this.delegate.getPlanIntermediateFilePreview({ channelId: this.channelId, conversationId, messageId, fileId });
565
+ }
566
+ }
567
+ exports.FilesApi = FilesApi;
568
+ exports.LingyaFilesApi = FilesApi;
569
+ /** Channel-bound knowledge operations for one external user. */
570
+ class KnowledgeApi {
571
+ constructor(channelId, delegate) {
572
+ this.channelId = channelId;
573
+ this.delegate = delegate;
574
+ }
575
+ /**
576
+ * 批量读取引用元数据 / Get citation metadata in batch
577
+ *
578
+ * @param input - 批量读取引用元数据 / Get citation metadata in batch 的强类型请求体。 / Typed request body for getCitationMetadataBatch.
579
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
580
+ */
581
+ getCitationMetadataBatch(input) {
582
+ return this.delegate.getCitationMetadataBatch({ channelId: this.channelId, returnedReference: input });
583
+ }
584
+ /**
585
+ * 读取引用元数据 / Get citation metadata
586
+ *
587
+ * @param citationType - 知识引用类型。 / Knowledge citation type.
588
+ * @param referenceId - 知识引用记录 ID。 / Knowledge-reference record ID.
589
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
590
+ */
591
+ getCitationMetadata(citationType, referenceId) {
592
+ return this.delegate.getCitationMetadata({ channelId: this.channelId, citationType, referenceId });
593
+ }
594
+ }
595
+ exports.KnowledgeApi = KnowledgeApi;
596
+ exports.LingyaKnowledgeApi = KnowledgeApi;
597
+ /** Channel-bound workspace operations for one external user. */
598
+ class WorkspaceApi {
599
+ constructor(channelId, delegate) {
600
+ this.channelId = channelId;
601
+ this.delegate = delegate;
602
+ }
603
+ /**
604
+ * 分页查询工作区制品 / List workspace artifacts
605
+ *
606
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
607
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
608
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
609
+ */
610
+ listWorkspaceArtifacts(conversationId, options = {}) {
611
+ return this.delegate.listWorkspaceArtifacts(Object.assign({ channelId: this.channelId, conversationId }, options));
612
+ }
613
+ /**
614
+ * 创建工作区文件预览地址 / Create a workspace file preview URL
615
+ *
616
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
617
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
618
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
619
+ */
620
+ getWorkspaceFilePreview(conversationId, options) {
621
+ return this.delegate.getWorkspaceFilePreview(Object.assign({ channelId: this.channelId, conversationId }, options));
622
+ }
623
+ }
624
+ exports.WorkspaceApi = WorkspaceApi;
625
+ exports.LingyaWorkspaceApi = WorkspaceApi;