@lingya-ai/agents-sdk 0.1.2 → 0.3.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/README.md CHANGED
@@ -26,15 +26,20 @@ const user = new LingyaAgentsClient('https://lingtong.lingya.tech/', channelId,
26
26
  }).forUser('external-user-id');
27
27
 
28
28
  const submission = await user.chat.createChat({
29
- channelId,
30
- aiChatInput: { query: '你好' },
29
+ query: '你好',
31
30
  });
32
31
 
33
- for await (const event of user.streamChatEvents(submission.conversationId, submission.messageId)) {
32
+ for await (const event of user.chat.streamChatEvents(
33
+ submission.conversationId,
34
+ { messageId: submission.messageId },
35
+ )) {
34
36
  if (event.type === 'end') break;
35
37
  }
36
38
  ```
37
39
 
40
+ 十个业务分组覆盖全部 46 个接口;`channelId` 只在根客户端构造时提供,`user.lowLevel` 仅作为迁移入口保留到 1.0。
41
+ Ten business groups cover all 46 operations; provide `channelId` only to the root client, while `user.lowLevel` remains a migration-only escape hatch until 1.0.
42
+
38
43
  SDK 会在最终 URL、查询串、`Content-Type` 与正文(body)字节确定后签名;每次请求独立生成 nonce,secret 不会进入请求、日志或异常。
39
44
  The SDK signs only after the final URL, query string, `Content-Type`, and body bytes are fixed. Every request receives a fresh nonce, and the secret is never included in requests, logs, or exceptions.
40
45
 
@@ -0,0 +1,451 @@
1
+ import { ConfigurationApi, ChatApi, ConversationsApi, SQLApi, MessagesApi, EventsApi, InteractionsApi, FilesApi, KnowledgeApi, WorkspaceApi, type GetConversationConfigRequest, type CreateChatRequest, type ContinueChatRequest, type DeleteConversationRequest, type StreamChatEventsRequest, type ProbeEventStreamRequest, type InterruptConversationRequest, type CompactConversationRequest, type GetConversationContextUsageRequest, type ListConversationsRequest, type QueryConversationActivitiesRequest, type MarkConversationReadRequest, type GetConversationTitleRequest, type UpdateConversationTitleRequest, type UpdateConversationStatusRequest, type GetSqlQueryResultRequest, type GetSqlQueryChartDataRequest, type ExportSqlQueryResultRequest, type ListConversationMessagesRequest, type GetConversationMessageRequest, type ListConversationAsyncTasksRequest, type GetConversationAsyncTaskRequest, type CancelQueuedMessageRequest, type GetChatEventsRequest, type GetChatEventsBatchRequest, type ListConversationSharesRequest, type CreateConversationShareRequest, type RevokeConversationShareRequest, type ApprovePlanRequest, type GetPlanStatusRequest, type GetUserInputStatusRequest, type AnswerUserInputRequest, type CreatePreSignedUploadRequest, type ConfirmPreSignedUploadRequest, type CreateFileByContentMd5Request, type FileExistsByContentMd5Request, type GetConversationFilePreviewRequest, type GetPlanIntermediateFilePreviewRequest, type GetCitationMetadataBatchRequest, type GetCitationMetadataRequest, type ListWorkspaceArtifactsRequest, type GetWorkspaceFilePreviewRequest } from './apis';
2
+ import { type ChatStreamProbeEvent } from './models/ChatStreamProbeEvent';
3
+ import { type LingyaAiChatBriefEvent } from './events';
4
+ type BoundRawRequest = (method: string, suffix: string, bodyJson: string | undefined, query: URLSearchParams | undefined, accept: string, requestId?: string) => Promise<Response>;
5
+ /** Query values and optional request headers that are not bound by the client. */
6
+ export type StreamChatEventsOptions = Omit<StreamChatEventsRequest, 'channelId' | 'conversationId' | 'aiChatStreamInput'>;
7
+ /** Query values and optional request headers that are not bound by the client. */
8
+ export type ProbeEventStreamOptions = Omit<ProbeEventStreamRequest, 'channelId' | 'chatStreamProbeInput'>;
9
+ /** Query values and optional request headers that are not bound by the client. */
10
+ export type CompactConversationOptions = Omit<CompactConversationRequest, 'channelId' | 'conversationId'>;
11
+ /** Query values and optional request headers that are not bound by the client. */
12
+ export type ListConversationsOptions = Omit<ListConversationsRequest, 'channelId'>;
13
+ /** Query values and optional request headers that are not bound by the client. */
14
+ export type GetSqlQueryResultOptions = Omit<GetSqlQueryResultRequest, 'channelId' | 'conversationId' | 'resultId'>;
15
+ /** Query values and optional request headers that are not bound by the client. */
16
+ export type ExportSqlQueryResultOptions = Omit<ExportSqlQueryResultRequest, 'channelId' | 'conversationId' | 'resultId'>;
17
+ /** Query values and optional request headers that are not bound by the client. */
18
+ export type ListConversationMessagesOptions = Omit<ListConversationMessagesRequest, 'channelId' | 'conversationId'>;
19
+ /** Query values and optional request headers that are not bound by the client. */
20
+ export type ListConversationAsyncTasksOptions = Omit<ListConversationAsyncTasksRequest, 'channelId' | 'conversationId'>;
21
+ /** Query values and optional request headers that are not bound by the client. */
22
+ export type GetChatEventsOptions = Omit<GetChatEventsRequest, 'channelId'>;
23
+ /** Query values and optional request headers that are not bound by the client. */
24
+ export type GetUserInputStatusOptions = Omit<GetUserInputStatusRequest, 'channelId' | 'questionId'>;
25
+ /** Query values and optional request headers that are not bound by the client. */
26
+ export type FileExistsByContentMd5Options = Omit<FileExistsByContentMd5Request, 'channelId'>;
27
+ /** Query values and optional request headers that are not bound by the client. */
28
+ export type ListWorkspaceArtifactsOptions = Omit<ListWorkspaceArtifactsRequest, 'channelId' | 'conversationId'>;
29
+ /** Query values and optional request headers that are not bound by the client. */
30
+ export type GetWorkspaceFilePreviewOptions = Omit<GetWorkspaceFilePreviewRequest, 'channelId' | 'conversationId'>;
31
+ /** Generated APIs retained as an explicit compatibility escape hatch until 1.0. */
32
+ export declare class LingyaAgentsLowLevelApis {
33
+ readonly configuration: ConfigurationApi;
34
+ readonly chat: ChatApi;
35
+ readonly conversations: ConversationsApi;
36
+ readonly sql: SQLApi;
37
+ readonly messages: MessagesApi;
38
+ readonly events: EventsApi;
39
+ readonly interactions: InteractionsApi;
40
+ readonly files: FilesApi;
41
+ readonly knowledge: KnowledgeApi;
42
+ readonly workspace: WorkspaceApi;
43
+ constructor(configuration: ConfigurationApi, chat: ChatApi, conversations: ConversationsApi, sql: SQLApi, messages: MessagesApi, events: EventsApi, interactions: InteractionsApi, files: FilesApi, knowledge: KnowledgeApi, workspace: WorkspaceApi);
44
+ }
45
+ /** Channel-bound configuration operations for one external user. */
46
+ export declare class LingyaConfigurationApi {
47
+ private readonly channelId;
48
+ private readonly delegate;
49
+ constructor(channelId: string, delegate: ConfigurationApi);
50
+ /**
51
+ * 读取 Agent 配置 / Get Agent configuration
52
+ *
53
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
54
+ */
55
+ getAgentsConfig(): ReturnType<ConfigurationApi['getAgentsConfig']>;
56
+ /**
57
+ * 读取会话配置 / Get conversation configuration
58
+ *
59
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
60
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
61
+ */
62
+ getConversationConfig(conversationId: GetConversationConfigRequest['conversationId']): ReturnType<ConfigurationApi['getConversationConfig']>;
63
+ }
64
+ /** Channel-bound chat operations for one external user. */
65
+ export declare class LingyaChatApi {
66
+ private readonly channelId;
67
+ private readonly delegate;
68
+ private readonly rawRequest;
69
+ constructor(channelId: string, delegate: ChatApi, rawRequest: BoundRawRequest);
70
+ /**
71
+ * 创建会话并提交消息 / Create a conversation and submit a message
72
+ *
73
+ * @param input - 创建会话并提交消息 / Create a conversation and submit a message 的强类型请求体。 / Typed request body for createChat.
74
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
75
+ */
76
+ createChat(input: CreateChatRequest['aiChatInput']): ReturnType<ChatApi['createChat']>;
77
+ /**
78
+ * 向已有会话提交消息 / Submit a message to an existing conversation
79
+ *
80
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
81
+ * @param input - 向已有会话提交消息 / Submit a message to an existing conversation 的强类型请求体。 / Typed request body for continueChat.
82
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
83
+ */
84
+ continueChat(conversationId: ContinueChatRequest['conversationId'], input: ContinueChatRequest['aiChatInput']): ReturnType<ChatApi['continueChat']>;
85
+ /**
86
+ * 订阅消息事件流 / Stream message events
87
+ *
88
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
89
+ * @param input - 订阅消息事件流 / Stream message events 的强类型请求体。 / Typed request body for streamChatEvents.
90
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
91
+ * @returns 可取消的强类型事件序列。 / A cancellable typed event sequence.
92
+ */
93
+ streamChatEvents(conversationId: StreamChatEventsRequest['conversationId'], input: StreamChatEventsRequest['aiChatStreamInput'], options?: StreamChatEventsOptions): AsyncGenerator<LingyaAiChatBriefEvent>;
94
+ /**
95
+ * 探测 SSE 连接 / Probe the SSE connection
96
+ *
97
+ * @param input - 探测 SSE 连接 / Probe the SSE connection 的强类型请求体。 / Typed request body for probeEventStream.
98
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
99
+ * @returns 可取消的强类型事件序列。 / A cancellable typed event sequence.
100
+ */
101
+ probeEventStream(input: ProbeEventStreamRequest['chatStreamProbeInput'], options?: ProbeEventStreamOptions): AsyncGenerator<ChatStreamProbeEvent>;
102
+ /**
103
+ * 中断会话执行 / Interrupt conversation execution
104
+ *
105
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
106
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
107
+ */
108
+ interruptConversation(conversationId: InterruptConversationRequest['conversationId']): ReturnType<ChatApi['interruptConversation']>;
109
+ /**
110
+ * 压缩会话上下文 / Compact conversation context
111
+ *
112
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
113
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
114
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
115
+ */
116
+ compactConversation(conversationId: CompactConversationRequest['conversationId'], options?: CompactConversationOptions): ReturnType<ChatApi['compactConversation']>;
117
+ }
118
+ /** Channel-bound conversations operations for one external user. */
119
+ export declare class LingyaConversationsApi {
120
+ private readonly channelId;
121
+ private readonly delegate;
122
+ constructor(channelId: string, delegate: ConversationsApi);
123
+ /**
124
+ * 删除会话 / Delete a conversation
125
+ *
126
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
127
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
128
+ */
129
+ deleteConversation(conversationId: DeleteConversationRequest['conversationId']): ReturnType<ConversationsApi['deleteConversation']>;
130
+ /**
131
+ * 读取上下文占用 / Get context usage
132
+ *
133
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
134
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
135
+ */
136
+ getConversationContextUsage(conversationId: GetConversationContextUsageRequest['conversationId']): ReturnType<ConversationsApi['getConversationContextUsage']>;
137
+ /**
138
+ * 分页查询会话 / List conversations
139
+ *
140
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
141
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
142
+ */
143
+ listConversations(options?: ListConversationsOptions): ReturnType<ConversationsApi['listConversations']>;
144
+ /**
145
+ * 查询活动会话 / List active conversations
146
+ *
147
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
148
+ */
149
+ listActiveConversations(): ReturnType<ConversationsApi['listActiveConversations']>;
150
+ /**
151
+ * 查询未读会话 / List unread conversations
152
+ *
153
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
154
+ */
155
+ listUnreadConversations(): ReturnType<ConversationsApi['listUnreadConversations']>;
156
+ /**
157
+ * 批量查询会话活动 / Query conversation activities
158
+ *
159
+ * @param input - 批量查询会话活动 / Query conversation activities 的强类型请求体。 / Typed request body for queryConversationActivities.
160
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
161
+ */
162
+ queryConversationActivities(input: QueryConversationActivitiesRequest['conversationActivityBatchInput']): ReturnType<ConversationsApi['queryConversationActivities']>;
163
+ /**
164
+ * 推进会话已读游标 / Mark a conversation as read
165
+ *
166
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
167
+ * @param input - 推进会话已读游标 / Mark a conversation as read 的强类型请求体。 / Typed request body for markConversationRead.
168
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
169
+ */
170
+ markConversationRead(conversationId: MarkConversationReadRequest['conversationId'], input: MarkConversationReadRequest['conversationReadReceiptInput']): ReturnType<ConversationsApi['markConversationRead']>;
171
+ /**
172
+ * 读取会话统计 / Get conversation statistics
173
+ *
174
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
175
+ */
176
+ getConversationStats(): ReturnType<ConversationsApi['getConversationStats']>;
177
+ /**
178
+ * 读取会话标题 / Get conversation title
179
+ *
180
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
181
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
182
+ */
183
+ getConversationTitle(conversationId: GetConversationTitleRequest['conversationId']): ReturnType<ConversationsApi['getConversationTitle']>;
184
+ /**
185
+ * 更新会话标题 / Update conversation title
186
+ *
187
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
188
+ * @param input - 更新会话标题 / Update conversation title 的强类型请求体。 / Typed request body for updateConversationTitle.
189
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
190
+ */
191
+ updateConversationTitle(conversationId: UpdateConversationTitleRequest['conversationId'], input: UpdateConversationTitleRequest['conversationTitleInput']): ReturnType<ConversationsApi['updateConversationTitle']>;
192
+ /**
193
+ * 更新会话状态 / Update conversation status
194
+ *
195
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
196
+ * @param input - 更新会话状态 / Update conversation status 的强类型请求体。 / Typed request body for updateConversationStatus.
197
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
198
+ */
199
+ updateConversationStatus(conversationId: UpdateConversationStatusRequest['conversationId'], input: UpdateConversationStatusRequest['conversationStatusInput']): ReturnType<ConversationsApi['updateConversationStatus']>;
200
+ /**
201
+ * 查询会话分享 / List conversation shares
202
+ *
203
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
204
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
205
+ */
206
+ listConversationShares(conversationId: ListConversationSharesRequest['conversationId']): ReturnType<ConversationsApi['listConversationShares']>;
207
+ /**
208
+ * 创建会话分享 / Create a conversation share
209
+ *
210
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
211
+ * @param input - 创建会话分享 / Create a conversation share 的强类型请求体。 / Typed request body for createConversationShare.
212
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
213
+ */
214
+ createConversationShare(conversationId: CreateConversationShareRequest['conversationId'], input: CreateConversationShareRequest['conversationShareInput']): ReturnType<ConversationsApi['createConversationShare']>;
215
+ /**
216
+ * 撤销会话分享 / Revoke a conversation share
217
+ *
218
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
219
+ * @param shareId - 会话分享记录 ID。 / Conversation-share record ID.
220
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
221
+ */
222
+ revokeConversationShare(conversationId: RevokeConversationShareRequest['conversationId'], shareId: RevokeConversationShareRequest['shareId']): ReturnType<ConversationsApi['revokeConversationShare']>;
223
+ }
224
+ /** Channel-bound sql operations for one external user. */
225
+ export declare class LingyaSqlApi {
226
+ private readonly channelId;
227
+ private readonly delegate;
228
+ constructor(channelId: string, delegate: SQLApi);
229
+ /**
230
+ * 分页读取 SQL 结果 / Get paged SQL results
231
+ *
232
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
233
+ * @param resultId - SQL 查询结果 ID。 / SQL query-result ID.
234
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
235
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
236
+ */
237
+ getSqlQueryResult(conversationId: GetSqlQueryResultRequest['conversationId'], resultId: GetSqlQueryResultRequest['resultId'], options?: GetSqlQueryResultOptions): ReturnType<SQLApi['getSqlQueryResult']>;
238
+ /**
239
+ * 读取 SQL 图表数据 / Get SQL chart data
240
+ *
241
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
242
+ * @param resultId - SQL 查询结果 ID。 / SQL query-result ID.
243
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
244
+ */
245
+ getSqlQueryChartData(conversationId: GetSqlQueryChartDataRequest['conversationId'], resultId: GetSqlQueryChartDataRequest['resultId']): ReturnType<SQLApi['getSqlQueryChartData']>;
246
+ /**
247
+ * 导出 SQL 结果 / Export SQL results
248
+ *
249
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
250
+ * @param resultId - SQL 查询结果 ID。 / SQL query-result ID.
251
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
252
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
253
+ */
254
+ exportSqlQueryResult(conversationId: ExportSqlQueryResultRequest['conversationId'], resultId: ExportSqlQueryResultRequest['resultId'], options: ExportSqlQueryResultOptions): Promise<Uint8Array>;
255
+ }
256
+ /** Channel-bound messages operations for one external user. */
257
+ export declare class LingyaMessagesApi {
258
+ private readonly channelId;
259
+ private readonly delegate;
260
+ constructor(channelId: string, delegate: MessagesApi);
261
+ /**
262
+ * 分页查询会话消息 / List conversation messages
263
+ *
264
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
265
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
266
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
267
+ */
268
+ listConversationMessages(conversationId: ListConversationMessagesRequest['conversationId'], options?: ListConversationMessagesOptions): ReturnType<MessagesApi['listConversationMessages']>;
269
+ /**
270
+ * 读取单条会话消息 / Get a conversation message
271
+ *
272
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
273
+ * @param messageId - 用户消息 ID;必须属于指定会话。 / User-message ID owned by the specified conversation.
274
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
275
+ */
276
+ getConversationMessage(conversationId: GetConversationMessageRequest['conversationId'], messageId: GetConversationMessageRequest['messageId']): ReturnType<MessagesApi['getConversationMessage']>;
277
+ /**
278
+ * 分页查询异步任务 / List asynchronous tasks
279
+ *
280
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
281
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
282
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
283
+ */
284
+ listConversationAsyncTasks(conversationId: ListConversationAsyncTasksRequest['conversationId'], options?: ListConversationAsyncTasksOptions): ReturnType<MessagesApi['listConversationAsyncTasks']>;
285
+ /**
286
+ * 读取异步任务 / Get an asynchronous task
287
+ *
288
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
289
+ * @param asyncTaskId - 异步任务 ID。 / Asynchronous task ID.
290
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
291
+ */
292
+ getConversationAsyncTask(conversationId: GetConversationAsyncTaskRequest['conversationId'], asyncTaskId: GetConversationAsyncTaskRequest['asyncTaskId']): ReturnType<MessagesApi['getConversationAsyncTask']>;
293
+ /**
294
+ * 取消排队消息 / Cancel a queued message
295
+ *
296
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
297
+ * @param messageId - 用户消息 ID;必须属于指定会话。 / User-message ID owned by the specified conversation.
298
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
299
+ */
300
+ cancelQueuedMessage(conversationId: CancelQueuedMessageRequest['conversationId'], messageId: CancelQueuedMessageRequest['messageId']): ReturnType<MessagesApi['cancelQueuedMessage']>;
301
+ }
302
+ /** Channel-bound events operations for one external user. */
303
+ export declare class LingyaEventsApi {
304
+ private readonly channelId;
305
+ private readonly delegate;
306
+ constructor(channelId: string, delegate: EventsApi);
307
+ /**
308
+ * 读取消息事件 / Get message events
309
+ *
310
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
311
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
312
+ */
313
+ getChatEvents(options: GetChatEventsOptions): ReturnType<EventsApi['getChatEvents']>;
314
+ /**
315
+ * 批量读取消息事件 / Get message events in batch
316
+ *
317
+ * @param input - 批量读取消息事件 / Get message events in batch 的强类型请求体。 / Typed request body for getChatEventsBatch.
318
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
319
+ */
320
+ getChatEventsBatch(input: GetChatEventsBatchRequest['aiChatEventsBatchInput']): ReturnType<EventsApi['getChatEventsBatch']>;
321
+ }
322
+ /** Channel-bound interactions operations for one external user. */
323
+ export declare class LingyaInteractionsApi {
324
+ private readonly channelId;
325
+ private readonly delegate;
326
+ constructor(channelId: string, delegate: InteractionsApi);
327
+ /**
328
+ * 提交计划审批 / Submit plan approval
329
+ *
330
+ * @param input - 提交计划审批 / Submit plan approval 的强类型请求体。 / Typed request body for approvePlan.
331
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
332
+ */
333
+ approvePlan(input: ApprovePlanRequest['planApprovalInput']): ReturnType<InteractionsApi['approvePlan']>;
334
+ /**
335
+ * 查询计划审批状态 / Get plan approval status
336
+ *
337
+ * @param planId - 等待审批的计划 ID。 / Pending plan-approval ID.
338
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
339
+ */
340
+ getPlanStatus(planId: GetPlanStatusRequest['planId']): ReturnType<InteractionsApi['getPlanStatus']>;
341
+ /**
342
+ * 查询用户问答状态 / Get user-input status
343
+ *
344
+ * @param questionId - 等待回答的问题 ID。 / Pending question ID.
345
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
346
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
347
+ */
348
+ getUserInputStatus(questionId: GetUserInputStatusRequest['questionId'], options: GetUserInputStatusOptions): ReturnType<InteractionsApi['getUserInputStatus']>;
349
+ /**
350
+ * 提交用户回答 / Submit a user answer
351
+ *
352
+ * @param input - 提交用户回答 / Submit a user answer 的强类型请求体。 / Typed request body for answerUserInput.
353
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
354
+ */
355
+ answerUserInput(input: AnswerUserInputRequest['userInputAnswerInput']): ReturnType<InteractionsApi['answerUserInput']>;
356
+ }
357
+ /** Channel-bound files operations for one external user. */
358
+ export declare class LingyaFilesApi {
359
+ private readonly channelId;
360
+ private readonly delegate;
361
+ constructor(channelId: string, delegate: FilesApi);
362
+ /**
363
+ * 创建预签名上传地址 / Create a presigned upload URL
364
+ *
365
+ * @param input - 创建预签名上传地址 / Create a presigned upload URL 的强类型请求体。 / Typed request body for createPreSignedUpload.
366
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
367
+ */
368
+ createPreSignedUpload(input: CreatePreSignedUploadRequest['generatePreSignedUrlInput']): ReturnType<FilesApi['createPreSignedUpload']>;
369
+ /**
370
+ * 确认预签名上传 / Confirm a presigned upload
371
+ *
372
+ * @param input - 确认预签名上传 / Confirm a presigned upload 的强类型请求体。 / Typed request body for confirmPreSignedUpload.
373
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
374
+ */
375
+ confirmPreSignedUpload(input: ConfirmPreSignedUploadRequest['confirmUploadInput']): ReturnType<FilesApi['confirmPreSignedUpload']>;
376
+ /**
377
+ * 按 MD5 复用文件 / Reuse a file by MD5
378
+ *
379
+ * @param input - 按 MD5 复用文件 / Reuse a file by MD5 的强类型请求体。 / Typed request body for createFileByContentMd5.
380
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
381
+ */
382
+ createFileByContentMd5(input: CreateFileByContentMd5Request['createFileInput']): ReturnType<FilesApi['createFileByContentMd5']>;
383
+ /**
384
+ * 检查 MD5 文件是否存在 / Check file existence by MD5
385
+ *
386
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
387
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
388
+ */
389
+ fileExistsByContentMd5(options: FileExistsByContentMd5Options): ReturnType<FilesApi['fileExistsByContentMd5']>;
390
+ /**
391
+ * 创建会话文件预览地址 / Create a conversation file preview URL
392
+ *
393
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
394
+ * @param fileId - 文件记录 ID。 / File record ID.
395
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
396
+ */
397
+ getConversationFilePreview(conversationId: GetConversationFilePreviewRequest['conversationId'], fileId: GetConversationFilePreviewRequest['fileId']): ReturnType<FilesApi['getConversationFilePreview']>;
398
+ /**
399
+ * 创建计划快照预览地址 / Create a plan snapshot preview URL
400
+ *
401
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
402
+ * @param messageId - 用户消息 ID;必须属于指定会话。 / User-message ID owned by the specified conversation.
403
+ * @param fileId - 文件记录 ID。 / File record ID.
404
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
405
+ */
406
+ getPlanIntermediateFilePreview(conversationId: GetPlanIntermediateFilePreviewRequest['conversationId'], messageId: GetPlanIntermediateFilePreviewRequest['messageId'], fileId: GetPlanIntermediateFilePreviewRequest['fileId']): ReturnType<FilesApi['getPlanIntermediateFilePreview']>;
407
+ }
408
+ /** Channel-bound knowledge operations for one external user. */
409
+ export declare class LingyaKnowledgeApi {
410
+ private readonly channelId;
411
+ private readonly delegate;
412
+ constructor(channelId: string, delegate: KnowledgeApi);
413
+ /**
414
+ * 批量读取引用元数据 / Get citation metadata in batch
415
+ *
416
+ * @param input - 批量读取引用元数据 / Get citation metadata in batch 的强类型请求体。 / Typed request body for getCitationMetadataBatch.
417
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
418
+ */
419
+ getCitationMetadataBatch(input: GetCitationMetadataBatchRequest['returnedReference']): ReturnType<KnowledgeApi['getCitationMetadataBatch']>;
420
+ /**
421
+ * 读取引用元数据 / Get citation metadata
422
+ *
423
+ * @param citationType - 知识引用类型。 / Knowledge citation type.
424
+ * @param referenceId - 知识引用记录 ID。 / Knowledge-reference record ID.
425
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
426
+ */
427
+ getCitationMetadata(citationType: GetCitationMetadataRequest['citationType'], referenceId: GetCitationMetadataRequest['referenceId']): ReturnType<KnowledgeApi['getCitationMetadata']>;
428
+ }
429
+ /** Channel-bound workspace operations for one external user. */
430
+ export declare class LingyaWorkspaceApi {
431
+ private readonly channelId;
432
+ private readonly delegate;
433
+ constructor(channelId: string, delegate: WorkspaceApi);
434
+ /**
435
+ * 分页查询工作区制品 / List workspace artifacts
436
+ *
437
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
438
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
439
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
440
+ */
441
+ listWorkspaceArtifacts(conversationId: ListWorkspaceArtifactsRequest['conversationId'], options?: ListWorkspaceArtifactsOptions): ReturnType<WorkspaceApi['listWorkspaceArtifacts']>;
442
+ /**
443
+ * 创建工作区文件预览地址 / Create a workspace file preview URL
444
+ *
445
+ * @param conversationId - 会话 ID;必须属于当前外部用户。 / Conversation ID owned by the current external user.
446
+ * @param options - 查询参数与可选请求头。 / Query parameters and optional request headers.
447
+ * @returns 契约定义的强类型响应。 / The typed response defined by the contract.
448
+ */
449
+ getWorkspaceFilePreview(conversationId: GetWorkspaceFilePreviewRequest['conversationId'], options: GetWorkspaceFilePreviewOptions): ReturnType<WorkspaceApi['getWorkspaceFilePreview']>;
450
+ }
451
+ export {};