@lingya-ai/agents-sdk 0.3.0 → 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/README.md +45 -25
- package/dist/bound.d.ts +100 -79
- package/dist/bound.js +34 -23
- package/dist/client.d.ts +26 -20
- package/dist/client.js +26 -23
- package/dist/esm/bound.d.ts +100 -79
- package/dist/esm/bound.js +33 -11
- package/dist/esm/client.d.ts +26 -20
- package/dist/esm/client.js +26 -20
- package/dist/esm/events.d.ts +9 -5
- package/dist/esm/index.d.ts +1 -2
- package/dist/esm/index.js +1 -2
- package/dist/events.d.ts +9 -5
- package/dist/index.d.ts +1 -2
- package/dist/index.js +4 -2
- package/package.json +1 -1
package/dist/esm/bound.js
CHANGED
|
@@ -35,7 +35,7 @@ import { ChatStreamProbeEventFromJSON } from './models/ChatStreamProbeEvent';
|
|
|
35
35
|
import { decodeAiChatBriefEvent } from './events';
|
|
36
36
|
import { decodeSse } from './sse';
|
|
37
37
|
/** Generated APIs retained as an explicit compatibility escape hatch until 1.0. */
|
|
38
|
-
export class
|
|
38
|
+
export class AgentsLowLevelApis {
|
|
39
39
|
constructor(configuration, chat, conversations, sql, messages, events, interactions, files, knowledge, workspace) {
|
|
40
40
|
this.configuration = configuration;
|
|
41
41
|
this.chat = chat;
|
|
@@ -50,7 +50,7 @@ export class LingyaAgentsLowLevelApis {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
/** Channel-bound configuration operations for one external user. */
|
|
53
|
-
export class
|
|
53
|
+
export class ConfigurationApi {
|
|
54
54
|
constructor(channelId, delegate) {
|
|
55
55
|
this.channelId = channelId;
|
|
56
56
|
this.delegate = delegate;
|
|
@@ -74,7 +74,7 @@ export class LingyaConfigurationApi {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
/** Channel-bound chat operations for one external user. */
|
|
77
|
-
export class
|
|
77
|
+
export class ChatApi {
|
|
78
78
|
constructor(channelId, delegate, rawRequest) {
|
|
79
79
|
this.channelId = channelId;
|
|
80
80
|
this.delegate = delegate;
|
|
@@ -179,7 +179,7 @@ export class LingyaChatApi {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
/** Channel-bound conversations operations for one external user. */
|
|
182
|
-
export class
|
|
182
|
+
export class ConversationsApi {
|
|
183
183
|
constructor(channelId, delegate) {
|
|
184
184
|
this.channelId = channelId;
|
|
185
185
|
this.delegate = delegate;
|
|
@@ -314,7 +314,7 @@ export class LingyaConversationsApi {
|
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
/** Channel-bound sql operations for one external user. */
|
|
317
|
-
export class
|
|
317
|
+
export class SqlApi {
|
|
318
318
|
constructor(channelId, delegate) {
|
|
319
319
|
this.channelId = channelId;
|
|
320
320
|
this.delegate = delegate;
|
|
@@ -356,7 +356,7 @@ export class LingyaSqlApi {
|
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
358
|
/** Channel-bound messages operations for one external user. */
|
|
359
|
-
export class
|
|
359
|
+
export class MessagesApi {
|
|
360
360
|
constructor(channelId, delegate) {
|
|
361
361
|
this.channelId = channelId;
|
|
362
362
|
this.delegate = delegate;
|
|
@@ -413,7 +413,7 @@ export class LingyaMessagesApi {
|
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
415
|
/** Channel-bound events operations for one external user. */
|
|
416
|
-
export class
|
|
416
|
+
export class EventsApi {
|
|
417
417
|
constructor(channelId, delegate) {
|
|
418
418
|
this.channelId = channelId;
|
|
419
419
|
this.delegate = delegate;
|
|
@@ -438,7 +438,7 @@ export class LingyaEventsApi {
|
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
440
|
/** Channel-bound interactions operations for one external user. */
|
|
441
|
-
export class
|
|
441
|
+
export class InteractionsApi {
|
|
442
442
|
constructor(channelId, delegate) {
|
|
443
443
|
this.channelId = channelId;
|
|
444
444
|
this.delegate = delegate;
|
|
@@ -482,7 +482,7 @@ export class LingyaInteractionsApi {
|
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
484
|
/** Channel-bound files operations for one external user. */
|
|
485
|
-
export class
|
|
485
|
+
export class FilesApi {
|
|
486
486
|
constructor(channelId, delegate) {
|
|
487
487
|
this.channelId = channelId;
|
|
488
488
|
this.delegate = delegate;
|
|
@@ -546,7 +546,7 @@ export class LingyaFilesApi {
|
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
548
|
/** Channel-bound knowledge operations for one external user. */
|
|
549
|
-
export class
|
|
549
|
+
export class KnowledgeApi {
|
|
550
550
|
constructor(channelId, delegate) {
|
|
551
551
|
this.channelId = channelId;
|
|
552
552
|
this.delegate = delegate;
|
|
@@ -572,7 +572,7 @@ export class LingyaKnowledgeApi {
|
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
574
|
/** Channel-bound workspace operations for one external user. */
|
|
575
|
-
export class
|
|
575
|
+
export class WorkspaceApi {
|
|
576
576
|
constructor(channelId, delegate) {
|
|
577
577
|
this.channelId = channelId;
|
|
578
578
|
this.delegate = delegate;
|
|
@@ -598,3 +598,25 @@ export class LingyaWorkspaceApi {
|
|
|
598
598
|
return this.delegate.getWorkspaceFilePreview(Object.assign({ channelId: this.channelId, conversationId }, options));
|
|
599
599
|
}
|
|
600
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 };
|
package/dist/esm/client.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Configuration } from './runtime';
|
|
2
2
|
import { type OpenApiCredentials } from './hmac';
|
|
3
|
-
import { type
|
|
4
|
-
import {
|
|
3
|
+
import { type AiChatBriefEvent } from './events';
|
|
4
|
+
import { AgentsLowLevelApis, ChatApi as BoundChatApi, ConfigurationApi as BoundConfigurationApi, ConversationsApi as BoundConversationsApi, EventsApi as BoundEventsApi, FilesApi as BoundFilesApi, InteractionsApi as BoundInteractionsApi, KnowledgeApi as BoundKnowledgeApi, MessagesApi as BoundMessagesApi, SqlApi, WorkspaceApi as BoundWorkspaceApi } from './bound';
|
|
5
5
|
/**
|
|
6
6
|
* Lingya Agents SDK 入口,仅适用于可信服务端。 / Server-side Lingya Agents SDK entry point.
|
|
7
7
|
*
|
|
8
8
|
* 客户端保存 channel 范围的凭证,但只有 [forUser] 创建的用户客户端可以发起请求。
|
|
9
9
|
*/
|
|
10
|
-
export declare class
|
|
10
|
+
export declare class AgentsClient {
|
|
11
11
|
private readonly baseUrl;
|
|
12
12
|
readonly channelId: string;
|
|
13
13
|
private readonly credentials;
|
|
@@ -25,39 +25,39 @@ export declare class LingyaAgentsClient {
|
|
|
25
25
|
* @param externalUserId - 调用方系统的稳定用户 ID,UTF-8 编码后为 1..256 字节且不能含 NUL。
|
|
26
26
|
* @returns 注入用户身份并可调用全部契约 API 的客户端。
|
|
27
27
|
*/
|
|
28
|
-
forUser(externalUserId: string):
|
|
28
|
+
forUser(externalUserId: string): AgentsUserClient;
|
|
29
29
|
}
|
|
30
30
|
/** 已绑定外部用户的强类型 API 集合。 / Strongly typed API collection bound to one external user. */
|
|
31
|
-
export declare class
|
|
31
|
+
export declare class AgentsUserClient {
|
|
32
32
|
readonly channelId: string;
|
|
33
33
|
private readonly signedFetch;
|
|
34
34
|
private readonly baseUrl;
|
|
35
35
|
/** 发起新聊天和流探针。 / Starts chats and stream probes. */
|
|
36
|
-
readonly chat:
|
|
36
|
+
readonly chat: BoundChatApi;
|
|
37
37
|
/** 读取 Agent 与会话配置。 / Reads Agent and conversation configuration. */
|
|
38
|
-
readonly configuration:
|
|
38
|
+
readonly configuration: BoundConfigurationApi;
|
|
39
39
|
/** 管理会话、状态、分享和异步任务。 / Manages conversations, status, shares, and async tasks. */
|
|
40
|
-
readonly conversations:
|
|
40
|
+
readonly conversations: BoundConversationsApi;
|
|
41
41
|
/** 查询已持久化事件。 / Reads persisted events. */
|
|
42
|
-
readonly events:
|
|
42
|
+
readonly events: BoundEventsApi;
|
|
43
43
|
/** 管理附件与预签名 URL。 / Manages attachments and pre-signed URLs. */
|
|
44
|
-
readonly files:
|
|
44
|
+
readonly files: BoundFilesApi;
|
|
45
45
|
/** 回答用户问题并处理计划审批。 / Handles user answers and plan approval. */
|
|
46
|
-
readonly interactions:
|
|
46
|
+
readonly interactions: BoundInteractionsApi;
|
|
47
47
|
/** 查询引用元数据。 / Reads citation metadata. */
|
|
48
|
-
readonly knowledge:
|
|
48
|
+
readonly knowledge: BoundKnowledgeApi;
|
|
49
49
|
/** 查询消息并控制排队消息。 / Reads messages and controls queued messages. */
|
|
50
|
-
readonly messages:
|
|
50
|
+
readonly messages: BoundMessagesApi;
|
|
51
51
|
/** 查询、导出 SQL 结果与图表数据。 / Reads and exports SQL results and chart data. */
|
|
52
|
-
readonly sql:
|
|
52
|
+
readonly sql: SqlApi;
|
|
53
53
|
/** 查询工作区文件及预览。 / Reads workspace files and previews. */
|
|
54
|
-
readonly workspace:
|
|
54
|
+
readonly workspace: BoundWorkspaceApi;
|
|
55
55
|
/**
|
|
56
56
|
* 兼容旧版本的原始生成 API;正常业务调用应使用绑定门面。 / Raw generated APIs retained for migration only.
|
|
57
57
|
*
|
|
58
58
|
* @deprecated 将在 1.0 移除。 / Scheduled for removal in 1.0.
|
|
59
59
|
*/
|
|
60
|
-
readonly lowLevel:
|
|
60
|
+
readonly lowLevel: AgentsLowLevelApis;
|
|
61
61
|
constructor(channelId: string, configuration: Configuration, signedFetch: typeof fetch, baseUrl: string);
|
|
62
62
|
/**
|
|
63
63
|
* 调用契约端点并按指定类型返回 JSON;优先使用上方生成的强类型 API。 / Calls a contract endpoint and decodes typed JSON.
|
|
@@ -67,7 +67,7 @@ export declare class LingyaAgentsUserClient {
|
|
|
67
67
|
* @param bodyJson - 最终发送并参与签名的 UTF-8 JSON 字符串;无请求体时省略。
|
|
68
68
|
* @param query - 已按最终顺序组装的查询参数,允许重复键。
|
|
69
69
|
* @returns 调用方指定的响应类型。
|
|
70
|
-
* @throws [
|
|
70
|
+
* @throws [ApiError] 当服务端返回非 2xx 状态。
|
|
71
71
|
*/
|
|
72
72
|
/** @deprecated 使用对应的业务分组方法。 / Use the matching grouped facade operation. */
|
|
73
73
|
request<T>(method: string, suffix: string, bodyJson?: string, query?: URLSearchParams): Promise<T>;
|
|
@@ -100,7 +100,7 @@ export declare class LingyaAgentsUserClient {
|
|
|
100
100
|
* @returns 支持取消的异步事件序列;未知 type 保留 `rawJson`。
|
|
101
101
|
*/
|
|
102
102
|
/** @deprecated 使用 `chat.streamChatEvents(conversationId, { messageId })`。 / Use the channel-bound chat facade. */
|
|
103
|
-
streamChatEvents(conversationId: string, messageId: string): AsyncGenerator<
|
|
103
|
+
streamChatEvents(conversationId: string, messageId: string): AsyncGenerator<AiChatBriefEvent>;
|
|
104
104
|
/**
|
|
105
105
|
* 发送底层受控请求;调用前固定最终 path、query、Content-Type 与 body 字节。 / Sends an exactly signed low-level request.
|
|
106
106
|
*
|
|
@@ -112,16 +112,22 @@ export declare class LingyaAgentsUserClient {
|
|
|
112
112
|
* @param query - 最终查询参数;顺序和重复键均参与签名。
|
|
113
113
|
* @param accept - 精确的 Accept 值,例如 `application/json`、`text/event-stream` 或 `text/csv`。
|
|
114
114
|
* @returns 成功的原始 Fetch Response。
|
|
115
|
-
* @throws [
|
|
115
|
+
* @throws [ApiError] 当服务端返回非 2xx 状态。
|
|
116
116
|
*/
|
|
117
117
|
/** @deprecated 使用 `lowLevel`,或使用对应的业务分组方法。 / Use `lowLevel` or a grouped facade operation. */
|
|
118
118
|
rawRequest(method: string, suffix: string, bodyJson?: string, query?: URLSearchParams, accept?: string, requestId?: string): Promise<Response>;
|
|
119
119
|
}
|
|
120
120
|
/** 不含凭证的 HTTP 错误。 / HTTP failure that never includes credentials. */
|
|
121
|
-
export declare class
|
|
121
|
+
export declare class ApiError extends Error {
|
|
122
122
|
readonly method: string;
|
|
123
123
|
readonly path: string;
|
|
124
124
|
readonly status: number;
|
|
125
125
|
readonly responseBody: string;
|
|
126
126
|
constructor(method: string, path: string, status: number, responseBody: string);
|
|
127
127
|
}
|
|
128
|
+
/** @deprecated Use [AgentsClient]. */
|
|
129
|
+
export { AgentsClient as LingyaAgentsClient };
|
|
130
|
+
/** @deprecated Use [AgentsUserClient]. */
|
|
131
|
+
export { AgentsUserClient as LingyaAgentsUserClient };
|
|
132
|
+
/** @deprecated Use [ApiError]. */
|
|
133
|
+
export { ApiError as LingyaApiError };
|
package/dist/esm/client.js
CHANGED
|
@@ -10,13 +10,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { Configuration } from './runtime';
|
|
11
11
|
import { ChatApi, ConfigurationApi, ConversationsApi, EventsApi, FilesApi, InteractionsApi, KnowledgeApi, MessagesApi, SQLApi, WorkspaceApi } from './apis';
|
|
12
12
|
import { createSignedFetch } from './hmac';
|
|
13
|
-
import {
|
|
13
|
+
import { AgentsLowLevelApis, ChatApi as BoundChatApi, ConfigurationApi as BoundConfigurationApi, ConversationsApi as BoundConversationsApi, EventsApi as BoundEventsApi, FilesApi as BoundFilesApi, InteractionsApi as BoundInteractionsApi, KnowledgeApi as BoundKnowledgeApi, MessagesApi as BoundMessagesApi, SqlApi, WorkspaceApi as BoundWorkspaceApi, } from './bound';
|
|
14
14
|
/**
|
|
15
15
|
* Lingya Agents SDK 入口,仅适用于可信服务端。 / Server-side Lingya Agents SDK entry point.
|
|
16
16
|
*
|
|
17
17
|
* 客户端保存 channel 范围的凭证,但只有 [forUser] 创建的用户客户端可以发起请求。
|
|
18
18
|
*/
|
|
19
|
-
export class
|
|
19
|
+
export class AgentsClient {
|
|
20
20
|
/**
|
|
21
21
|
* 创建 channel 范围的客户端。 / Creates a channel-scoped client.
|
|
22
22
|
*
|
|
@@ -40,11 +40,11 @@ export class LingyaAgentsClient {
|
|
|
40
40
|
forUser(externalUserId) {
|
|
41
41
|
const signedFetch = createSignedFetch(this.credentials, externalUserId);
|
|
42
42
|
const configuration = new Configuration({ basePath: this.baseUrl.replace(/\/+$/, ''), fetchApi: signedFetch });
|
|
43
|
-
return new
|
|
43
|
+
return new AgentsUserClient(this.channelId, configuration, signedFetch, this.baseUrl);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
/** 已绑定外部用户的强类型 API 集合。 / Strongly typed API collection bound to one external user. */
|
|
47
|
-
export class
|
|
47
|
+
export class AgentsUserClient {
|
|
48
48
|
constructor(channelId, configuration, signedFetch, baseUrl) {
|
|
49
49
|
this.channelId = channelId;
|
|
50
50
|
this.signedFetch = signedFetch;
|
|
@@ -59,18 +59,18 @@ export class LingyaAgentsUserClient {
|
|
|
59
59
|
const messages = new MessagesApi(configuration);
|
|
60
60
|
const sql = new SQLApi(configuration);
|
|
61
61
|
const workspace = new WorkspaceApi(configuration);
|
|
62
|
-
this.lowLevel = new
|
|
62
|
+
this.lowLevel = new AgentsLowLevelApis(configurationApi, chat, conversations, sql, messages, events, interactions, files, knowledge, workspace);
|
|
63
63
|
const rawRequest = this.rawRequest.bind(this);
|
|
64
|
-
this.chat = new
|
|
65
|
-
this.configuration = new
|
|
66
|
-
this.conversations = new
|
|
67
|
-
this.events = new
|
|
68
|
-
this.files = new
|
|
69
|
-
this.interactions = new
|
|
70
|
-
this.knowledge = new
|
|
71
|
-
this.messages = new
|
|
72
|
-
this.sql = new
|
|
73
|
-
this.workspace = new
|
|
64
|
+
this.chat = new BoundChatApi(channelId, chat, rawRequest);
|
|
65
|
+
this.configuration = new BoundConfigurationApi(channelId, configurationApi);
|
|
66
|
+
this.conversations = new BoundConversationsApi(channelId, conversations);
|
|
67
|
+
this.events = new BoundEventsApi(channelId, events);
|
|
68
|
+
this.files = new BoundFilesApi(channelId, files);
|
|
69
|
+
this.interactions = new BoundInteractionsApi(channelId, interactions);
|
|
70
|
+
this.knowledge = new BoundKnowledgeApi(channelId, knowledge);
|
|
71
|
+
this.messages = new BoundMessagesApi(channelId, messages);
|
|
72
|
+
this.sql = new SqlApi(channelId, sql);
|
|
73
|
+
this.workspace = new BoundWorkspaceApi(channelId, workspace);
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* 调用契约端点并按指定类型返回 JSON;优先使用上方生成的强类型 API。 / Calls a contract endpoint and decodes typed JSON.
|
|
@@ -80,7 +80,7 @@ export class LingyaAgentsUserClient {
|
|
|
80
80
|
* @param bodyJson - 最终发送并参与签名的 UTF-8 JSON 字符串;无请求体时省略。
|
|
81
81
|
* @param query - 已按最终顺序组装的查询参数,允许重复键。
|
|
82
82
|
* @returns 调用方指定的响应类型。
|
|
83
|
-
* @throws [
|
|
83
|
+
* @throws [ApiError] 当服务端返回非 2xx 状态。
|
|
84
84
|
*/
|
|
85
85
|
/** @deprecated 使用对应的业务分组方法。 / Use the matching grouped facade operation. */
|
|
86
86
|
request(method, suffix, bodyJson, query) {
|
|
@@ -141,7 +141,7 @@ export class LingyaAgentsUserClient {
|
|
|
141
141
|
* @param query - 最终查询参数;顺序和重复键均参与签名。
|
|
142
142
|
* @param accept - 精确的 Accept 值,例如 `application/json`、`text/event-stream` 或 `text/csv`。
|
|
143
143
|
* @returns 成功的原始 Fetch Response。
|
|
144
|
-
* @throws [
|
|
144
|
+
* @throws [ApiError] 当服务端返回非 2xx 状态。
|
|
145
145
|
*/
|
|
146
146
|
/** @deprecated 使用 `lowLevel`,或使用对应的业务分组方法。 / Use `lowLevel` or a grouped facade operation. */
|
|
147
147
|
rawRequest(method_1, suffix_1, bodyJson_1, query_1) {
|
|
@@ -154,19 +154,25 @@ export class LingyaAgentsUserClient {
|
|
|
154
154
|
body: bodyJson,
|
|
155
155
|
});
|
|
156
156
|
if (!response.ok)
|
|
157
|
-
throw new
|
|
157
|
+
throw new ApiError(method, suffix, response.status, yield response.text());
|
|
158
158
|
return response;
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
/** 不含凭证的 HTTP 错误。 / HTTP failure that never includes credentials. */
|
|
163
|
-
export class
|
|
163
|
+
export class ApiError extends Error {
|
|
164
164
|
constructor(method, path, status, responseBody) {
|
|
165
165
|
super(`${method} ${path} returned HTTP ${status}`);
|
|
166
166
|
this.method = method;
|
|
167
167
|
this.path = path;
|
|
168
168
|
this.status = status;
|
|
169
169
|
this.responseBody = responseBody;
|
|
170
|
-
this.name = '
|
|
170
|
+
this.name = 'ApiError';
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
+
/** @deprecated Use [AgentsClient]. */
|
|
174
|
+
export { AgentsClient as LingyaAgentsClient };
|
|
175
|
+
/** @deprecated Use [AgentsUserClient]. */
|
|
176
|
+
export { AgentsUserClient as LingyaAgentsUserClient };
|
|
177
|
+
/** @deprecated Use [ApiError]. */
|
|
178
|
+
export { ApiError as LingyaApiError };
|
package/dist/esm/events.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { AiChatBriefEvent, ToolExtension, UnknownAiChatBriefEvent, UnknownToolExtension } from './models';
|
|
1
|
+
import type { AiChatBriefEvent as GeneratedAiChatBriefEvent, ToolExtension as GeneratedToolExtension, UnknownAiChatBriefEvent, UnknownToolExtension } from './models';
|
|
2
2
|
/** 包含全部已知事件以及携带原始 JSON 的未知事件。 / All known events plus a raw-JSON fallback for future event types. */
|
|
3
|
-
export type
|
|
3
|
+
export type AiChatBriefEvent = GeneratedAiChatBriefEvent | UnknownAiChatBriefEvent;
|
|
4
4
|
/** 包含全部已知工具扩展以及携带原始 JSON 的未知扩展。 / All known tool extensions plus a raw-JSON fallback. */
|
|
5
|
-
export type
|
|
5
|
+
export type ToolExtension = GeneratedToolExtension | UnknownToolExtension;
|
|
6
6
|
/**
|
|
7
7
|
* 按 type 判别事件;未知值只暴露 type 与 rawJson。 / Decodes by type with an exact JSON fallback.
|
|
8
8
|
*
|
|
@@ -10,7 +10,7 @@ export type LingyaToolExtension = ToolExtension | UnknownToolExtension;
|
|
|
10
10
|
* @returns 已知事件联合,或保存输入原文的未知事件。
|
|
11
11
|
* @throws SyntaxError 当输入不是有效 JSON。
|
|
12
12
|
*/
|
|
13
|
-
export declare function decodeAiChatBriefEvent(rawJson: string):
|
|
13
|
+
export declare function decodeAiChatBriefEvent(rawJson: string): AiChatBriefEvent;
|
|
14
14
|
/**
|
|
15
15
|
* 按 category 判别工具扩展。 / Decodes a tool extension by category.
|
|
16
16
|
*
|
|
@@ -18,4 +18,8 @@ export declare function decodeAiChatBriefEvent(rawJson: string): LingyaAiChatBri
|
|
|
18
18
|
* @returns 12 种已知扩展之一,或保存输入原文的未知扩展。
|
|
19
19
|
* @throws SyntaxError 当输入不是有效 JSON。
|
|
20
20
|
*/
|
|
21
|
-
export declare function decodeToolExtension(rawJson: string):
|
|
21
|
+
export declare function decodeToolExtension(rawJson: string): ToolExtension;
|
|
22
|
+
/** @deprecated Use [AiChatBriefEvent]. */
|
|
23
|
+
export type LingyaAiChatBriefEvent = AiChatBriefEvent;
|
|
24
|
+
/** @deprecated Use [ToolExtension]. */
|
|
25
|
+
export type LingyaToolExtension = ToolExtension;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export * from './runtime';
|
|
2
|
-
export * from './apis/index';
|
|
3
2
|
export * from './models/index';
|
|
4
3
|
export * from './client';
|
|
5
4
|
export * from './bound';
|
|
6
5
|
export * from './hmac';
|
|
7
6
|
export * from './sse';
|
|
8
|
-
export
|
|
7
|
+
export { decodeAiChatBriefEvent, decodeToolExtension, type AiChatBriefEvent, type ToolExtension, type LingyaAiChatBriefEvent, type LingyaToolExtension, } from './events';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export * from './runtime';
|
|
4
|
-
export * from './apis/index';
|
|
5
4
|
export * from './models/index';
|
|
6
5
|
export * from './client';
|
|
7
6
|
export * from './bound';
|
|
8
7
|
export * from './hmac';
|
|
9
8
|
export * from './sse';
|
|
10
|
-
export
|
|
9
|
+
export { decodeAiChatBriefEvent, decodeToolExtension, } from './events';
|
package/dist/events.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { AiChatBriefEvent, ToolExtension, UnknownAiChatBriefEvent, UnknownToolExtension } from './models';
|
|
1
|
+
import type { AiChatBriefEvent as GeneratedAiChatBriefEvent, ToolExtension as GeneratedToolExtension, UnknownAiChatBriefEvent, UnknownToolExtension } from './models';
|
|
2
2
|
/** 包含全部已知事件以及携带原始 JSON 的未知事件。 / All known events plus a raw-JSON fallback for future event types. */
|
|
3
|
-
export type
|
|
3
|
+
export type AiChatBriefEvent = GeneratedAiChatBriefEvent | UnknownAiChatBriefEvent;
|
|
4
4
|
/** 包含全部已知工具扩展以及携带原始 JSON 的未知扩展。 / All known tool extensions plus a raw-JSON fallback. */
|
|
5
|
-
export type
|
|
5
|
+
export type ToolExtension = GeneratedToolExtension | UnknownToolExtension;
|
|
6
6
|
/**
|
|
7
7
|
* 按 type 判别事件;未知值只暴露 type 与 rawJson。 / Decodes by type with an exact JSON fallback.
|
|
8
8
|
*
|
|
@@ -10,7 +10,7 @@ export type LingyaToolExtension = ToolExtension | UnknownToolExtension;
|
|
|
10
10
|
* @returns 已知事件联合,或保存输入原文的未知事件。
|
|
11
11
|
* @throws SyntaxError 当输入不是有效 JSON。
|
|
12
12
|
*/
|
|
13
|
-
export declare function decodeAiChatBriefEvent(rawJson: string):
|
|
13
|
+
export declare function decodeAiChatBriefEvent(rawJson: string): AiChatBriefEvent;
|
|
14
14
|
/**
|
|
15
15
|
* 按 category 判别工具扩展。 / Decodes a tool extension by category.
|
|
16
16
|
*
|
|
@@ -18,4 +18,8 @@ export declare function decodeAiChatBriefEvent(rawJson: string): LingyaAiChatBri
|
|
|
18
18
|
* @returns 12 种已知扩展之一,或保存输入原文的未知扩展。
|
|
19
19
|
* @throws SyntaxError 当输入不是有效 JSON。
|
|
20
20
|
*/
|
|
21
|
-
export declare function decodeToolExtension(rawJson: string):
|
|
21
|
+
export declare function decodeToolExtension(rawJson: string): ToolExtension;
|
|
22
|
+
/** @deprecated Use [AiChatBriefEvent]. */
|
|
23
|
+
export type LingyaAiChatBriefEvent = AiChatBriefEvent;
|
|
24
|
+
/** @deprecated Use [ToolExtension]. */
|
|
25
|
+
export type LingyaToolExtension = ToolExtension;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export * from './runtime';
|
|
2
|
-
export * from './apis/index';
|
|
3
2
|
export * from './models/index';
|
|
4
3
|
export * from './client';
|
|
5
4
|
export * from './bound';
|
|
6
5
|
export * from './hmac';
|
|
7
6
|
export * from './sse';
|
|
8
|
-
export
|
|
7
|
+
export { decodeAiChatBriefEvent, decodeToolExtension, type AiChatBriefEvent, type ToolExtension, type LingyaAiChatBriefEvent, type LingyaToolExtension, } from './events';
|
package/dist/index.js
CHANGED
|
@@ -14,13 +14,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.decodeToolExtension = exports.decodeAiChatBriefEvent = void 0;
|
|
17
18
|
/* tslint:disable */
|
|
18
19
|
/* eslint-disable */
|
|
19
20
|
__exportStar(require("./runtime"), exports);
|
|
20
|
-
__exportStar(require("./apis/index"), exports);
|
|
21
21
|
__exportStar(require("./models/index"), exports);
|
|
22
22
|
__exportStar(require("./client"), exports);
|
|
23
23
|
__exportStar(require("./bound"), exports);
|
|
24
24
|
__exportStar(require("./hmac"), exports);
|
|
25
25
|
__exportStar(require("./sse"), exports);
|
|
26
|
-
|
|
26
|
+
var events_1 = require("./events");
|
|
27
|
+
Object.defineProperty(exports, "decodeAiChatBriefEvent", { enumerable: true, get: function () { return events_1.decodeAiChatBriefEvent; } });
|
|
28
|
+
Object.defineProperty(exports, "decodeToolExtension", { enumerable: true, get: function () { return events_1.decodeToolExtension; } });
|