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