agentbase-web-sdk 2.10.0 → 2.12.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 +2 -2
- package/dist/cjs/sdk.js +1152 -103
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +1152 -104
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +1152 -103
- package/package.json +3 -3
- package/types/enums/data-api-catalog-data-source-database-type.d.ts +6 -0
- package/types/enums/data-api-catalog-data-source-visibility-source.d.ts +7 -0
- package/types/enums/data-api-catalog-database-availability.d.ts +5 -0
- package/types/enums/data-api-catalog-database-classification.d.ts +4 -0
- package/types/enums/data-api-catalog-database-status.d.ts +4 -0
- package/types/enums/data-api-catalog-database-visibility-source.d.ts +7 -0
- package/types/enums/data-api-filter-logic.d.ts +4 -0
- package/types/enums/data-api-owned-binding-principal-type.d.ts +4 -0
- package/types/enums/data-api-owned-binding-status.d.ts +4 -0
- package/types/enums/memory-pipeline-run-result-status.d.ts +4 -0
- package/types/enums/memory-pipeline-run-scenario.d.ts +6 -0
- package/types/enums/memory-pipeline-run-status.d.ts +6 -0
- package/types/enums/scene.d.ts +4 -0
- package/types/enums/status.d.ts +3 -1
- package/types/enums/timezone.d.ts +1 -0
- package/types/index.d.ts +16 -2
- package/types/models.d.ts +798 -4
- package/types/services/account.d.ts +85 -2
- package/types/services/ai-gateway.d.ts +90 -0
- package/types/services/data-api.d.ts +257 -0
- package/types/services/functions.d.ts +2 -0
- package/types/services/knowledge-bases.d.ts +186 -2
- package/types/services/llm-gateway.d.ts +8 -1
- package/types/services/memory.d.ts +117 -8
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Client } from '../client';
|
|
2
2
|
import type { Models } from '../models';
|
|
3
|
+
import { Status } from '../enums/status';
|
|
3
4
|
export declare class KnowledgeBases {
|
|
4
5
|
client: Client;
|
|
5
6
|
constructor(client: Client);
|
|
6
7
|
/**
|
|
7
|
-
* Import the current user's
|
|
8
|
+
* Import the current user's Ant Documents by URL through an authorized Yuque OAuth session. No team data source is required. Document ownership uses `source=yuque:personal` for compatibility.
|
|
8
9
|
*
|
|
9
10
|
* The service resolves the session's current-user credential from encrypted private storage before requesting the Yuque Open API. If the credential is missing, was locally cancelled, was revoked at Yuque, or Yuque returns 401/403, the request fails with `knowledge_base_yuque_oauth_reauth_required` (HTTP 401); authorize again before retrying.
|
|
10
11
|
*
|
|
@@ -27,7 +28,7 @@ export declare class KnowledgeBases {
|
|
|
27
28
|
versionId?: string;
|
|
28
29
|
}): Promise<Models.KnowledgeBaseDataSourceDocumentImportBatch>;
|
|
29
30
|
/**
|
|
30
|
-
* Import the current user's
|
|
31
|
+
* Import the current user's Ant Documents by URL through an authorized Yuque OAuth session. No team data source is required. Document ownership uses `source=yuque:personal` for compatibility.
|
|
31
32
|
*
|
|
32
33
|
* The service resolves the session's current-user credential from encrypted private storage before requesting the Yuque Open API. If the credential is missing, was locally cancelled, was revoked at Yuque, or Yuque returns 401/403, the request fails with `knowledge_base_yuque_oauth_reauth_required` (HTTP 401); authorize again before retrying.
|
|
33
34
|
*
|
|
@@ -117,4 +118,187 @@ export declare class KnowledgeBases {
|
|
|
117
118
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
118
119
|
*/
|
|
119
120
|
getYuqueOAuthSession(knowledgeBaseId: string, sessionId: string): Promise<{}>;
|
|
121
|
+
/**
|
|
122
|
+
* 列出当前登录用户在指定知识库中拥有的蚂蚁文档数据源(API 类型为 `yuque_personal`)。
|
|
123
|
+
*
|
|
124
|
+
* 此接口仅接受 `SESSION` 或 `JWT`,并要求 `knowledgebases.read`。它只返回当前用户的 `yuque_personal` 资源,供 Console 管理;不会返回其他成员的 OAuth 绑定。响应为 `KnowledgeBaseDataSourceList`,credentials 均已脱敏。
|
|
125
|
+
*
|
|
126
|
+
*
|
|
127
|
+
* @param {string} params.knowledgeBaseId - Knowledge base ID.
|
|
128
|
+
* @param {string} params.versionId - Optional Version ID.
|
|
129
|
+
* @throws {AgentbaseException}
|
|
130
|
+
* @returns {Promise<Models.KnowledgeBaseDataSourceList>}
|
|
131
|
+
*/
|
|
132
|
+
listYuquePersonalDataSources(params: {
|
|
133
|
+
knowledgeBaseId: string;
|
|
134
|
+
versionId?: string;
|
|
135
|
+
}): Promise<Models.KnowledgeBaseDataSourceList>;
|
|
136
|
+
/**
|
|
137
|
+
* 列出当前登录用户在指定知识库中拥有的蚂蚁文档数据源(API 类型为 `yuque_personal`)。
|
|
138
|
+
*
|
|
139
|
+
* 此接口仅接受 `SESSION` 或 `JWT`,并要求 `knowledgebases.read`。它只返回当前用户的 `yuque_personal` 资源,供 Console 管理;不会返回其他成员的 OAuth 绑定。响应为 `KnowledgeBaseDataSourceList`,credentials 均已脱敏。
|
|
140
|
+
*
|
|
141
|
+
*
|
|
142
|
+
* @param {string} knowledgeBaseId - Knowledge base ID.
|
|
143
|
+
* @param {string} versionId - Optional Version ID.
|
|
144
|
+
* @throws {AgentbaseException}
|
|
145
|
+
* @returns {Promise<Models.KnowledgeBaseDataSourceList>}
|
|
146
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
147
|
+
*/
|
|
148
|
+
listYuquePersonalDataSources(knowledgeBaseId: string, versionId?: string): Promise<Models.KnowledgeBaseDataSourceList>;
|
|
149
|
+
/**
|
|
150
|
+
* 创建当前登录用户拥有的蚂蚁文档定时数据源(API 类型为 `yuque_personal`)。
|
|
151
|
+
*
|
|
152
|
+
* 此接口仅接受 `SESSION` 或 `JWT`,并要求 `knowledgebases.write`。请求必须包含已授权且与当前 project、知识库和用户匹配的 `sessionId`、数据源 `name` 与 1–20 个 `urls`;可选 `syncSchedule` 为 cron 表达式,`triggerSync` 控制是否立即创建首次异步同步。
|
|
153
|
+
*
|
|
154
|
+
* 服务端从当前用户写入 owner reference,并只在 worker 运行时解析该用户的加密 OAuth credential。请求不能提供 `ownerUserId`、OAuth token、code 或 credentials;响应中的 credentials 也始终脱敏。Version DRAFT 不支持 `syncSchedule`。
|
|
155
|
+
*
|
|
156
|
+
*
|
|
157
|
+
* @param {string} params.knowledgeBaseId - Knowledge base ID.
|
|
158
|
+
* @param {string} params.sessionId - Authorized Yuque OAuth session ID.
|
|
159
|
+
* @param {string} params.name - Personal data source name.
|
|
160
|
+
* @param {string[]} params.urls - Personal Yuque document URLs.
|
|
161
|
+
* @param {string} params.versionId - Optional DRAFT Version ID. Required when Versioning is active.
|
|
162
|
+
* @param {string} params.syncSchedule - Optional cron schedule for automatic synchronization.
|
|
163
|
+
* @param {Status} params.status - Data source status.
|
|
164
|
+
* @param {boolean} params.triggerSync - Trigger an initial sync after creation.
|
|
165
|
+
* @throws {AgentbaseException}
|
|
166
|
+
* @returns {Promise<Models.KnowledgeBaseDataSource>}
|
|
167
|
+
*/
|
|
168
|
+
createYuquePersonalDataSource(params: {
|
|
169
|
+
knowledgeBaseId: string;
|
|
170
|
+
sessionId: string;
|
|
171
|
+
name: string;
|
|
172
|
+
urls: string[];
|
|
173
|
+
versionId?: string;
|
|
174
|
+
syncSchedule?: string;
|
|
175
|
+
status?: Status;
|
|
176
|
+
triggerSync?: boolean;
|
|
177
|
+
}): Promise<Models.KnowledgeBaseDataSource>;
|
|
178
|
+
/**
|
|
179
|
+
* 创建当前登录用户拥有的蚂蚁文档定时数据源(API 类型为 `yuque_personal`)。
|
|
180
|
+
*
|
|
181
|
+
* 此接口仅接受 `SESSION` 或 `JWT`,并要求 `knowledgebases.write`。请求必须包含已授权且与当前 project、知识库和用户匹配的 `sessionId`、数据源 `name` 与 1–20 个 `urls`;可选 `syncSchedule` 为 cron 表达式,`triggerSync` 控制是否立即创建首次异步同步。
|
|
182
|
+
*
|
|
183
|
+
* 服务端从当前用户写入 owner reference,并只在 worker 运行时解析该用户的加密 OAuth credential。请求不能提供 `ownerUserId`、OAuth token、code 或 credentials;响应中的 credentials 也始终脱敏。Version DRAFT 不支持 `syncSchedule`。
|
|
184
|
+
*
|
|
185
|
+
*
|
|
186
|
+
* @param {string} knowledgeBaseId - Knowledge base ID.
|
|
187
|
+
* @param {string} sessionId - Authorized Yuque OAuth session ID.
|
|
188
|
+
* @param {string} name - Personal data source name.
|
|
189
|
+
* @param {string[]} urls - Personal Yuque document URLs.
|
|
190
|
+
* @param {string} versionId - Optional DRAFT Version ID. Required when Versioning is active.
|
|
191
|
+
* @param {string} syncSchedule - Optional cron schedule for automatic synchronization.
|
|
192
|
+
* @param {Status} status - Data source status.
|
|
193
|
+
* @param {boolean} triggerSync - Trigger an initial sync after creation.
|
|
194
|
+
* @throws {AgentbaseException}
|
|
195
|
+
* @returns {Promise<Models.KnowledgeBaseDataSource>}
|
|
196
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
197
|
+
*/
|
|
198
|
+
createYuquePersonalDataSource(knowledgeBaseId: string, sessionId: string, name: string, urls: string[], versionId?: string, syncSchedule?: string, status?: Status, triggerSync?: boolean): Promise<Models.KnowledgeBaseDataSource>;
|
|
199
|
+
/**
|
|
200
|
+
* 读取当前登录用户拥有的一条蚂蚁文档数据源(API 类型为 `yuque_personal`)。
|
|
201
|
+
*
|
|
202
|
+
* 此接口仅接受 `SESSION` 或 `JWT`,并要求 `knowledgebases.read`。服务端会将 source owner 与当前用户比对;不匹配时拒绝访问,不通过数据源 ID、URL 或 credentials 推断 owner。响应复用 `KnowledgeBaseDataSource`,其中 credentials 均已脱敏。
|
|
203
|
+
*
|
|
204
|
+
*
|
|
205
|
+
* @param {string} params.knowledgeBaseId - Knowledge base ID.
|
|
206
|
+
* @param {string} params.dataSourceId - Data source ID.
|
|
207
|
+
* @param {string} params.versionId - Optional Version ID.
|
|
208
|
+
* @throws {AgentbaseException}
|
|
209
|
+
* @returns {Promise<Models.KnowledgeBaseDataSource>}
|
|
210
|
+
*/
|
|
211
|
+
getYuquePersonalDataSource(params: {
|
|
212
|
+
knowledgeBaseId: string;
|
|
213
|
+
dataSourceId: string;
|
|
214
|
+
versionId?: string;
|
|
215
|
+
}): Promise<Models.KnowledgeBaseDataSource>;
|
|
216
|
+
/**
|
|
217
|
+
* 读取当前登录用户拥有的一条蚂蚁文档数据源(API 类型为 `yuque_personal`)。
|
|
218
|
+
*
|
|
219
|
+
* 此接口仅接受 `SESSION` 或 `JWT`,并要求 `knowledgebases.read`。服务端会将 source owner 与当前用户比对;不匹配时拒绝访问,不通过数据源 ID、URL 或 credentials 推断 owner。响应复用 `KnowledgeBaseDataSource`,其中 credentials 均已脱敏。
|
|
220
|
+
*
|
|
221
|
+
*
|
|
222
|
+
* @param {string} knowledgeBaseId - Knowledge base ID.
|
|
223
|
+
* @param {string} dataSourceId - Data source ID.
|
|
224
|
+
* @param {string} versionId - Optional Version ID.
|
|
225
|
+
* @throws {AgentbaseException}
|
|
226
|
+
* @returns {Promise<Models.KnowledgeBaseDataSource>}
|
|
227
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
228
|
+
*/
|
|
229
|
+
getYuquePersonalDataSource(knowledgeBaseId: string, dataSourceId: string, versionId?: string): Promise<Models.KnowledgeBaseDataSource>;
|
|
230
|
+
/**
|
|
231
|
+
* 更新当前登录用户拥有的蚂蚁文档数据源(API 类型为 `yuque_personal`)。
|
|
232
|
+
*
|
|
233
|
+
* 此接口仅接受 `SESSION` 或 `JWT`,并要求 `knowledgebases.write`。可更新字段为 `name`、`urls`、`syncSchedule` 与 `status`;服务端验证 owner,且不允许修改 OAuth credential 或 owner reference。修改 cron、启停或清除 cron 后会同步创建、更新或移除既有 schedule。Version DRAFT 不支持 `syncSchedule`。
|
|
234
|
+
*
|
|
235
|
+
*
|
|
236
|
+
* @param {string} params.knowledgeBaseId - Knowledge base ID.
|
|
237
|
+
* @param {string} params.dataSourceId - Data source ID.
|
|
238
|
+
* @param {string} params.versionId - Optional DRAFT Version ID.
|
|
239
|
+
* @param {string} params.name - Personal data source name.
|
|
240
|
+
* @param {string[]} params.urls - Personal Yuque document URLs.
|
|
241
|
+
* @param {string} params.syncSchedule - Cron schedule for automatic synchronization.
|
|
242
|
+
* @param {Status} params.status - Data source status.
|
|
243
|
+
* @throws {AgentbaseException}
|
|
244
|
+
* @returns {Promise<Models.KnowledgeBaseDataSource>}
|
|
245
|
+
*/
|
|
246
|
+
updateYuquePersonalDataSource(params: {
|
|
247
|
+
knowledgeBaseId: string;
|
|
248
|
+
dataSourceId: string;
|
|
249
|
+
versionId?: string;
|
|
250
|
+
name?: string;
|
|
251
|
+
urls?: string[];
|
|
252
|
+
syncSchedule?: string;
|
|
253
|
+
status?: Status;
|
|
254
|
+
}): Promise<Models.KnowledgeBaseDataSource>;
|
|
255
|
+
/**
|
|
256
|
+
* 更新当前登录用户拥有的蚂蚁文档数据源(API 类型为 `yuque_personal`)。
|
|
257
|
+
*
|
|
258
|
+
* 此接口仅接受 `SESSION` 或 `JWT`,并要求 `knowledgebases.write`。可更新字段为 `name`、`urls`、`syncSchedule` 与 `status`;服务端验证 owner,且不允许修改 OAuth credential 或 owner reference。修改 cron、启停或清除 cron 后会同步创建、更新或移除既有 schedule。Version DRAFT 不支持 `syncSchedule`。
|
|
259
|
+
*
|
|
260
|
+
*
|
|
261
|
+
* @param {string} knowledgeBaseId - Knowledge base ID.
|
|
262
|
+
* @param {string} dataSourceId - Data source ID.
|
|
263
|
+
* @param {string} versionId - Optional DRAFT Version ID.
|
|
264
|
+
* @param {string} name - Personal data source name.
|
|
265
|
+
* @param {string[]} urls - Personal Yuque document URLs.
|
|
266
|
+
* @param {string} syncSchedule - Cron schedule for automatic synchronization.
|
|
267
|
+
* @param {Status} status - Data source status.
|
|
268
|
+
* @throws {AgentbaseException}
|
|
269
|
+
* @returns {Promise<Models.KnowledgeBaseDataSource>}
|
|
270
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
271
|
+
*/
|
|
272
|
+
updateYuquePersonalDataSource(knowledgeBaseId: string, dataSourceId: string, versionId?: string, name?: string, urls?: string[], syncSchedule?: string, status?: Status): Promise<Models.KnowledgeBaseDataSource>;
|
|
273
|
+
/**
|
|
274
|
+
* 删除当前登录用户拥有的蚂蚁文档数据源(API 类型为 `yuque_personal`)。
|
|
275
|
+
*
|
|
276
|
+
* 此接口仅接受 `SESSION` 或 `JWT`,并要求 `knowledgebases.write`。服务端验证 source owner 后删除数据源、同步历史及其定时 schedule;已经由该源导入的知识库文档不会被删除。删除操作不会删除用户的 OAuth credential。
|
|
277
|
+
*
|
|
278
|
+
*
|
|
279
|
+
* @param {string} params.knowledgeBaseId - Knowledge base ID.
|
|
280
|
+
* @param {string} params.dataSourceId - Data source ID.
|
|
281
|
+
* @param {string} params.versionId - Optional DRAFT Version ID.
|
|
282
|
+
* @throws {AgentbaseException}
|
|
283
|
+
* @returns {Promise<{}>}
|
|
284
|
+
*/
|
|
285
|
+
deleteYuquePersonalDataSource(params: {
|
|
286
|
+
knowledgeBaseId: string;
|
|
287
|
+
dataSourceId: string;
|
|
288
|
+
versionId?: string;
|
|
289
|
+
}): Promise<{}>;
|
|
290
|
+
/**
|
|
291
|
+
* 删除当前登录用户拥有的蚂蚁文档数据源(API 类型为 `yuque_personal`)。
|
|
292
|
+
*
|
|
293
|
+
* 此接口仅接受 `SESSION` 或 `JWT`,并要求 `knowledgebases.write`。服务端验证 source owner 后删除数据源、同步历史及其定时 schedule;已经由该源导入的知识库文档不会被删除。删除操作不会删除用户的 OAuth credential。
|
|
294
|
+
*
|
|
295
|
+
*
|
|
296
|
+
* @param {string} knowledgeBaseId - Knowledge base ID.
|
|
297
|
+
* @param {string} dataSourceId - Data source ID.
|
|
298
|
+
* @param {string} versionId - Optional DRAFT Version ID.
|
|
299
|
+
* @throws {AgentbaseException}
|
|
300
|
+
* @returns {Promise<{}>}
|
|
301
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
302
|
+
*/
|
|
303
|
+
deleteYuquePersonalDataSource(knowledgeBaseId: string, dataSourceId: string, versionId?: string): Promise<{}>;
|
|
120
304
|
}
|
|
@@ -167,12 +167,15 @@ export declare class LlmGateway {
|
|
|
167
167
|
*
|
|
168
168
|
* Pass an `x-provider-key` header to bring your own upstream API key (BYOK) instead of the provider's stored key. If the request is authenticated with a Gateway Key whose `allowedModels` doesn't include the requested model, the endpoint returns a 403 `GENERAL_ACCESS_FORBIDDEN` error.
|
|
169
169
|
*
|
|
170
|
+
* 可选字符串 `instruct` 为原生排序任务说明,最长 65536 UTF-8 字节,拒绝纯空白和非法控制字符。省略或传空字符串时不发送该参数,保持默认行为。支持百炼 DashScope 的 `qwen3.7-text-rerank`、`qwen3-rerank` 和 `qwen3-vl-rerank`;非空值使用原生 `parameters.instruct`,`input.query` 和 `input.documents` 保持原文。不支持的 Provider 或模型返回参数错误,不会静默忽略。说明会计入试用额度预估;不影响原有超时、限流及结果索引校验。
|
|
171
|
+
*
|
|
170
172
|
*
|
|
171
173
|
* @param {string} params.model - Rerank model ID.
|
|
172
174
|
* @param {string} params.query - Query text to rank documents against.
|
|
173
175
|
* @param {string[]} params.documents - Documents to rerank.
|
|
174
176
|
* @param {number} params.topN - Return only the top N results.
|
|
175
177
|
* @param {boolean} params.returnDocuments - Include document text in the response.
|
|
178
|
+
* @param {string} params.instruct - Optional native sorting instruction for supported DashScope rerank models. Empty omits the instruction.
|
|
176
179
|
* @throws {AgentbaseException}
|
|
177
180
|
* @returns {Promise<Models.LlmGatewayRerankResponse>}
|
|
178
181
|
*/
|
|
@@ -182,23 +185,27 @@ export declare class LlmGateway {
|
|
|
182
185
|
documents: string[];
|
|
183
186
|
topN?: number;
|
|
184
187
|
returnDocuments?: boolean;
|
|
188
|
+
instruct?: string;
|
|
185
189
|
}): Promise<Models.LlmGatewayRerankResponse>;
|
|
186
190
|
/**
|
|
187
191
|
* Rerank documents by relevance to a query through the LLM Gateway. The response returns ranked document indexes, relevance scores, optional document text, and token usage for the rerank request. Streaming is not supported.
|
|
188
192
|
*
|
|
189
193
|
* Pass an `x-provider-key` header to bring your own upstream API key (BYOK) instead of the provider's stored key. If the request is authenticated with a Gateway Key whose `allowedModels` doesn't include the requested model, the endpoint returns a 403 `GENERAL_ACCESS_FORBIDDEN` error.
|
|
190
194
|
*
|
|
195
|
+
* 可选字符串 `instruct` 为原生排序任务说明,最长 65536 UTF-8 字节,拒绝纯空白和非法控制字符。省略或传空字符串时不发送该参数,保持默认行为。支持百炼 DashScope 的 `qwen3.7-text-rerank`、`qwen3-rerank` 和 `qwen3-vl-rerank`;非空值使用原生 `parameters.instruct`,`input.query` 和 `input.documents` 保持原文。不支持的 Provider 或模型返回参数错误,不会静默忽略。说明会计入试用额度预估;不影响原有超时、限流及结果索引校验。
|
|
196
|
+
*
|
|
191
197
|
*
|
|
192
198
|
* @param {string} model - Rerank model ID.
|
|
193
199
|
* @param {string} query - Query text to rank documents against.
|
|
194
200
|
* @param {string[]} documents - Documents to rerank.
|
|
195
201
|
* @param {number} topN - Return only the top N results.
|
|
196
202
|
* @param {boolean} returnDocuments - Include document text in the response.
|
|
203
|
+
* @param {string} instruct - Optional native sorting instruction for supported DashScope rerank models. Empty omits the instruction.
|
|
197
204
|
* @throws {AgentbaseException}
|
|
198
205
|
* @returns {Promise<Models.LlmGatewayRerankResponse>}
|
|
199
206
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
200
207
|
*/
|
|
201
|
-
createRerank(model: string, query: string, documents: string[], topN?: number, returnDocuments?: boolean): Promise<Models.LlmGatewayRerankResponse>;
|
|
208
|
+
createRerank(model: string, query: string, documents: string[], topN?: number, returnDocuments?: boolean, instruct?: string): Promise<Models.LlmGatewayRerankResponse>;
|
|
202
209
|
/**
|
|
203
210
|
*
|
|
204
211
|
* @throws {AgentbaseException}
|
|
@@ -17,8 +17,8 @@ import { FeedbackType } from '../enums/feedback-type';
|
|
|
17
17
|
import { ValidationStatus } from '../enums/validation-status';
|
|
18
18
|
import { Outcome } from '../enums/outcome';
|
|
19
19
|
import { VerificationSource } from '../enums/verification-source';
|
|
20
|
-
import { Kinds } from '../enums/kinds';
|
|
21
20
|
import { ProfileType } from '../enums/profile-type';
|
|
21
|
+
import { Kinds } from '../enums/kinds';
|
|
22
22
|
import { ProfileExtractionMode } from '../enums/profile-extraction-mode';
|
|
23
23
|
import { RetentionPolicy } from '../enums/retention-policy';
|
|
24
24
|
import { MemoryShareSubjectType } from '../enums/memory-share-subject-type';
|
|
@@ -96,6 +96,7 @@ export declare class Memory {
|
|
|
96
96
|
* @param {MemorySensitivity} params.sensitivity - Content classification. Secret values must use Agentbase Secret or variables.
|
|
97
97
|
* @param {MemoryHandlingPolicy} params.handlingPolicy - Processing restriction. no_model requires infer=false.
|
|
98
98
|
* @param {object} params.metadata - Memory metadata.
|
|
99
|
+
* @param {object} params.sourceContext - Optional source conversationTime (YYYY-MM-DD or RFC3339 with offset) and timeZone (IANA). Missing conversation time stays unknown; it is not the event or import time.
|
|
99
100
|
* @param {boolean} params.infer - Use configured model-assisted extraction and cross-type deduplication. Defaults to true.
|
|
100
101
|
* @param {boolean} params.reRemember - Explicitly create new evidence for forgotten content.
|
|
101
102
|
* @param {boolean} params.async - Queue memory creation and return immediately. Defaults to the infer value for text; media always requires true, including infer=false.
|
|
@@ -117,6 +118,7 @@ export declare class Memory {
|
|
|
117
118
|
sensitivity?: MemorySensitivity;
|
|
118
119
|
handlingPolicy?: MemoryHandlingPolicy;
|
|
119
120
|
metadata?: object;
|
|
121
|
+
sourceContext?: object;
|
|
120
122
|
infer?: boolean;
|
|
121
123
|
reRemember?: boolean;
|
|
122
124
|
async?: boolean;
|
|
@@ -138,6 +140,7 @@ export declare class Memory {
|
|
|
138
140
|
* @param {MemorySensitivity} sensitivity - Content classification. Secret values must use Agentbase Secret or variables.
|
|
139
141
|
* @param {MemoryHandlingPolicy} handlingPolicy - Processing restriction. no_model requires infer=false.
|
|
140
142
|
* @param {object} metadata - Memory metadata.
|
|
143
|
+
* @param {object} sourceContext - Optional source conversationTime (YYYY-MM-DD or RFC3339 with offset) and timeZone (IANA). Missing conversation time stays unknown; it is not the event or import time.
|
|
141
144
|
* @param {boolean} infer - Use configured model-assisted extraction and cross-type deduplication. Defaults to true.
|
|
142
145
|
* @param {boolean} reRemember - Explicitly create new evidence for forgotten content.
|
|
143
146
|
* @param {boolean} async - Queue memory creation and return immediately. Defaults to the infer value for text; media always requires true, including infer=false.
|
|
@@ -145,7 +148,7 @@ export declare class Memory {
|
|
|
145
148
|
* @returns {Promise<{}>}
|
|
146
149
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
147
150
|
*/
|
|
148
|
-
create(userId: string, scope: MemoryScope, memoryType: string, recordKind: RecordKind, pipelineId?: string, content?: string, messages?: Models.MemoryMessage[], media?: object, agentId?: string, runId?: string, sessionId?: string, sensitivity?: MemorySensitivity, handlingPolicy?: MemoryHandlingPolicy, metadata?: object, infer?: boolean, reRemember?: boolean, async?: boolean): Promise<{}>;
|
|
151
|
+
create(userId: string, scope: MemoryScope, memoryType: string, recordKind: RecordKind, pipelineId?: string, content?: string, messages?: Models.MemoryMessage[], media?: object, agentId?: string, runId?: string, sessionId?: string, sensitivity?: MemorySensitivity, handlingPolicy?: MemoryHandlingPolicy, metadata?: object, sourceContext?: object, infer?: boolean, reRemember?: boolean, async?: boolean): Promise<{}>;
|
|
149
152
|
/**
|
|
150
153
|
* Forget memory records in one bounded pass. Repeat while hasMore is true and inspect failed and items before considering the scope fully deleted.
|
|
151
154
|
*
|
|
@@ -1380,6 +1383,34 @@ export declare class Memory {
|
|
|
1380
1383
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1381
1384
|
*/
|
|
1382
1385
|
createKnowledgeObservation(knowledgeId: string, revision: number, outcome: Outcome, evidence: object, scope?: Scope, userId?: string, agentId?: string, sessionId?: string, runId?: string, memorySubStoreId?: string, sourceId?: string, injectionId?: string, verificationSource?: VerificationSource, toolName?: string, toolVersion?: string, toolSchemaVersion?: string, errorFingerprint?: string, weight?: number, observedAt?: string, idempotencyKey?: string): Promise<{}>;
|
|
1386
|
+
/**
|
|
1387
|
+
* List live user memory profiles.
|
|
1388
|
+
*
|
|
1389
|
+
* @param {string} params.cursor - Opaque pagination cursor.
|
|
1390
|
+
* @param {number} params.limit - Maximum number of profiles.
|
|
1391
|
+
* @param {string} params.userId - Target user ID.
|
|
1392
|
+
* @param {ProfileType} params.profileType - Profile type. Omit to include every type.
|
|
1393
|
+
* @throws {AgentbaseException}
|
|
1394
|
+
* @returns {Promise<{}>}
|
|
1395
|
+
*/
|
|
1396
|
+
listProfiles(params?: {
|
|
1397
|
+
cursor?: string;
|
|
1398
|
+
limit?: number;
|
|
1399
|
+
userId?: string;
|
|
1400
|
+
profileType?: ProfileType;
|
|
1401
|
+
}): Promise<{}>;
|
|
1402
|
+
/**
|
|
1403
|
+
* List live user memory profiles.
|
|
1404
|
+
*
|
|
1405
|
+
* @param {string} cursor - Opaque pagination cursor.
|
|
1406
|
+
* @param {number} limit - Maximum number of profiles.
|
|
1407
|
+
* @param {string} userId - Target user ID.
|
|
1408
|
+
* @param {ProfileType} profileType - Profile type. Omit to include every type.
|
|
1409
|
+
* @throws {AgentbaseException}
|
|
1410
|
+
* @returns {Promise<{}>}
|
|
1411
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1412
|
+
*/
|
|
1413
|
+
listProfiles(cursor?: string, limit?: number, userId?: string, profileType?: ProfileType): Promise<{}>;
|
|
1383
1414
|
/**
|
|
1384
1415
|
* Get a memory quality report.
|
|
1385
1416
|
*
|
|
@@ -1440,7 +1471,7 @@ export declare class Memory {
|
|
|
1440
1471
|
*/
|
|
1441
1472
|
recallKnowledge(query: string, scope?: Scope, userId?: string, agentId?: string, sessionId?: string, runId?: string, memorySubStoreId?: string, kinds?: Kinds[], limit?: number, tokenBudget?: number, retrieval?: object, accessMode?: MemoryAccessMode): Promise<{}>;
|
|
1442
1473
|
/**
|
|
1443
|
-
* Search memory records
|
|
1474
|
+
* Search visible memory records. When memoryLinking is enabled, includes one bounded hop of L1 evidence and typed links between returned records. Historical facts remain visible.
|
|
1444
1475
|
*
|
|
1445
1476
|
* @param {string} params.query - Search query. May be omitted with media.
|
|
1446
1477
|
* @param {string} params.searchMode - Recall mode override.
|
|
@@ -1453,6 +1484,7 @@ export declare class Memory {
|
|
|
1453
1484
|
* @param {string} params.memoryType - Memory type filter.
|
|
1454
1485
|
* @param {string} params.recordKind - Record kind filter.
|
|
1455
1486
|
* @param {object} params.filter - Structured memory filter.
|
|
1487
|
+
* @param {object} params.temporal - Optional mode current, asOf or history; asOf requires a timestamp with timezone. Uncertain facts are returned separately.
|
|
1456
1488
|
* @param {number} params.limit - Maximum results; zero uses the project default.
|
|
1457
1489
|
* @param {string} params.cursor - Pagination cursor.
|
|
1458
1490
|
* @param {string} params.sort - Sort mode.
|
|
@@ -1475,6 +1507,7 @@ export declare class Memory {
|
|
|
1475
1507
|
memoryType?: string;
|
|
1476
1508
|
recordKind?: string;
|
|
1477
1509
|
filter?: object;
|
|
1510
|
+
temporal?: object;
|
|
1478
1511
|
limit?: number;
|
|
1479
1512
|
cursor?: string;
|
|
1480
1513
|
sort?: string;
|
|
@@ -1484,7 +1517,7 @@ export declare class Memory {
|
|
|
1484
1517
|
accessMode?: MemoryAccessMode;
|
|
1485
1518
|
}): Promise<{}>;
|
|
1486
1519
|
/**
|
|
1487
|
-
* Search memory records
|
|
1520
|
+
* Search visible memory records. When memoryLinking is enabled, includes one bounded hop of L1 evidence and typed links between returned records. Historical facts remain visible.
|
|
1488
1521
|
*
|
|
1489
1522
|
* @param {string} query - Search query. May be omitted with media.
|
|
1490
1523
|
* @param {string} searchMode - Recall mode override.
|
|
@@ -1497,6 +1530,7 @@ export declare class Memory {
|
|
|
1497
1530
|
* @param {string} memoryType - Memory type filter.
|
|
1498
1531
|
* @param {string} recordKind - Record kind filter.
|
|
1499
1532
|
* @param {object} filter - Structured memory filter.
|
|
1533
|
+
* @param {object} temporal - Optional mode current, asOf or history; asOf requires a timestamp with timezone. Uncertain facts are returned separately.
|
|
1500
1534
|
* @param {number} limit - Maximum results; zero uses the project default.
|
|
1501
1535
|
* @param {string} cursor - Pagination cursor.
|
|
1502
1536
|
* @param {string} sort - Sort mode.
|
|
@@ -1508,7 +1542,7 @@ export declare class Memory {
|
|
|
1508
1542
|
* @returns {Promise<{}>}
|
|
1509
1543
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1510
1544
|
*/
|
|
1511
|
-
search(query?: string, searchMode?: string, retrieval?: object, media?: object, userId?: string, agentId?: string, runId?: string, scope?: string, memoryType?: string, recordKind?: string, filter?: object, limit?: number, cursor?: string, sort?: string, memorySubStoreId?: string, sessionId?: string, groupId?: string, accessMode?: MemoryAccessMode): Promise<{}>;
|
|
1545
|
+
search(query?: string, searchMode?: string, retrieval?: object, media?: object, userId?: string, agentId?: string, runId?: string, scope?: string, memoryType?: string, recordKind?: string, filter?: object, temporal?: object, limit?: number, cursor?: string, sort?: string, memorySubStoreId?: string, sessionId?: string, groupId?: string, accessMode?: MemoryAccessMode): Promise<{}>;
|
|
1512
1546
|
/**
|
|
1513
1547
|
* Get memory session aggregates.
|
|
1514
1548
|
*
|
|
@@ -2002,6 +2036,78 @@ export declare class Memory {
|
|
|
2002
2036
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2003
2037
|
*/
|
|
2004
2038
|
listSources(memoryId: string, cursor?: string, limit?: number): Promise<{}>;
|
|
2039
|
+
/**
|
|
2040
|
+
* List Pipeline trial runs in the current project and scenario.
|
|
2041
|
+
*
|
|
2042
|
+
* @param {Scenario} params.scenario - Pipeline scenario.
|
|
2043
|
+
* @param {number} params.limit - Maximum number of trial runs.
|
|
2044
|
+
* @param {string} params.cursor - Opaque pagination cursor.
|
|
2045
|
+
* @throws {AgentbaseException}
|
|
2046
|
+
* @returns {Promise<Models.MemoryPipelineRunList>}
|
|
2047
|
+
*/
|
|
2048
|
+
listPipelineRuns(params?: {
|
|
2049
|
+
scenario?: Scenario;
|
|
2050
|
+
limit?: number;
|
|
2051
|
+
cursor?: string;
|
|
2052
|
+
}): Promise<Models.MemoryPipelineRunList>;
|
|
2053
|
+
/**
|
|
2054
|
+
* List Pipeline trial runs in the current project and scenario.
|
|
2055
|
+
*
|
|
2056
|
+
* @param {Scenario} scenario - Pipeline scenario.
|
|
2057
|
+
* @param {number} limit - Maximum number of trial runs.
|
|
2058
|
+
* @param {string} cursor - Opaque pagination cursor.
|
|
2059
|
+
* @throws {AgentbaseException}
|
|
2060
|
+
* @returns {Promise<Models.MemoryPipelineRunList>}
|
|
2061
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2062
|
+
*/
|
|
2063
|
+
listPipelineRuns(scenario?: Scenario, limit?: number, cursor?: string): Promise<Models.MemoryPipelineRunList>;
|
|
2064
|
+
/**
|
|
2065
|
+
* Compare saved Pipeline versions against bounded samples without business writes. Candidate configurations and sample inputs are frozen when the run is accepted.
|
|
2066
|
+
*
|
|
2067
|
+
* @param {string} params.name - Trial run name, from 1 to 256 UTF-8 bytes after trimming.
|
|
2068
|
+
* @param {Scenario} params.scenario - Shared scenario of all candidates.
|
|
2069
|
+
* @param {object[]} params.candidates - One to eight objects containing pipelineId and saved versionId.
|
|
2070
|
+
* @param {object[]} params.samples - One to twenty objects containing a unique id and scenario-specific data object.
|
|
2071
|
+
* @throws {AgentbaseException}
|
|
2072
|
+
* @returns {Promise<Models.MemoryPipelineRun>}
|
|
2073
|
+
*/
|
|
2074
|
+
createPipelineRun(params: {
|
|
2075
|
+
name: string;
|
|
2076
|
+
scenario: Scenario;
|
|
2077
|
+
candidates: object[];
|
|
2078
|
+
samples: object[];
|
|
2079
|
+
}): Promise<Models.MemoryPipelineRun>;
|
|
2080
|
+
/**
|
|
2081
|
+
* Compare saved Pipeline versions against bounded samples without business writes. Candidate configurations and sample inputs are frozen when the run is accepted.
|
|
2082
|
+
*
|
|
2083
|
+
* @param {string} name - Trial run name, from 1 to 256 UTF-8 bytes after trimming.
|
|
2084
|
+
* @param {Scenario} scenario - Shared scenario of all candidates.
|
|
2085
|
+
* @param {object[]} candidates - One to eight objects containing pipelineId and saved versionId.
|
|
2086
|
+
* @param {object[]} samples - One to twenty objects containing a unique id and scenario-specific data object.
|
|
2087
|
+
* @throws {AgentbaseException}
|
|
2088
|
+
* @returns {Promise<Models.MemoryPipelineRun>}
|
|
2089
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2090
|
+
*/
|
|
2091
|
+
createPipelineRun(name: string, scenario: Scenario, candidates: object[], samples: object[]): Promise<Models.MemoryPipelineRun>;
|
|
2092
|
+
/**
|
|
2093
|
+
* Read the frozen inputs, progress, and per-sample results of a Pipeline trial run.
|
|
2094
|
+
*
|
|
2095
|
+
* @param {string} params.runId - Trial run ID.
|
|
2096
|
+
* @throws {AgentbaseException}
|
|
2097
|
+
* @returns {Promise<Models.MemoryPipelineRun>}
|
|
2098
|
+
*/
|
|
2099
|
+
getPipelineRun(params: {
|
|
2100
|
+
runId: string;
|
|
2101
|
+
}): Promise<Models.MemoryPipelineRun>;
|
|
2102
|
+
/**
|
|
2103
|
+
* Read the frozen inputs, progress, and per-sample results of a Pipeline trial run.
|
|
2104
|
+
*
|
|
2105
|
+
* @param {string} runId - Trial run ID.
|
|
2106
|
+
* @throws {AgentbaseException}
|
|
2107
|
+
* @returns {Promise<Models.MemoryPipelineRun>}
|
|
2108
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2109
|
+
*/
|
|
2110
|
+
getPipelineRun(runId: string): Promise<Models.MemoryPipelineRun>;
|
|
2005
2111
|
/**
|
|
2006
2112
|
* Configure Memory Pipelines.
|
|
2007
2113
|
*
|
|
@@ -2194,8 +2300,9 @@ export declare class Memory {
|
|
|
2194
2300
|
* Validate a Memory Pipeline.
|
|
2195
2301
|
*
|
|
2196
2302
|
* @param {string} params.pipelineId - Pipeline ID.
|
|
2197
|
-
* @param {string} params.versionId - Saved configuration version.
|
|
2303
|
+
* @param {string} params.versionId - Saved configuration version or current system default hash.
|
|
2198
2304
|
* @param {object} params.data - Sample input for the Pipeline scenario, evaluated without business writes.
|
|
2305
|
+
* @param {Scenario} params.scenario - Scenario for system default validation.
|
|
2199
2306
|
* @throws {AgentbaseException}
|
|
2200
2307
|
* @returns {Promise<{}>}
|
|
2201
2308
|
*/
|
|
@@ -2203,18 +2310,20 @@ export declare class Memory {
|
|
|
2203
2310
|
pipelineId: string;
|
|
2204
2311
|
versionId: string;
|
|
2205
2312
|
data: object;
|
|
2313
|
+
scenario?: Scenario;
|
|
2206
2314
|
}): Promise<{}>;
|
|
2207
2315
|
/**
|
|
2208
2316
|
* Validate a Memory Pipeline.
|
|
2209
2317
|
*
|
|
2210
2318
|
* @param {string} pipelineId - Pipeline ID.
|
|
2211
|
-
* @param {string} versionId - Saved configuration version.
|
|
2319
|
+
* @param {string} versionId - Saved configuration version or current system default hash.
|
|
2212
2320
|
* @param {object} data - Sample input for the Pipeline scenario, evaluated without business writes.
|
|
2321
|
+
* @param {Scenario} scenario - Scenario for system default validation.
|
|
2213
2322
|
* @throws {AgentbaseException}
|
|
2214
2323
|
* @returns {Promise<{}>}
|
|
2215
2324
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2216
2325
|
*/
|
|
2217
|
-
validatePipeline(pipelineId: string, versionId: string, data: object): Promise<{}>;
|
|
2326
|
+
validatePipeline(pipelineId: string, versionId: string, data: object, scenario?: Scenario): Promise<{}>;
|
|
2218
2327
|
/**
|
|
2219
2328
|
* Configure a Memory Pipeline.
|
|
2220
2329
|
*
|