agentbase-web-sdk 2.9.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.
Files changed (34) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/sdk.js +2456 -664
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +2456 -665
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +2456 -664
  7. package/package.json +3 -3
  8. package/types/enums/data-api-catalog-data-source-database-type.d.ts +6 -0
  9. package/types/enums/data-api-catalog-data-source-visibility-source.d.ts +7 -0
  10. package/types/enums/data-api-catalog-database-availability.d.ts +5 -0
  11. package/types/enums/data-api-catalog-database-classification.d.ts +4 -0
  12. package/types/enums/data-api-catalog-database-status.d.ts +4 -0
  13. package/types/enums/data-api-catalog-database-visibility-source.d.ts +7 -0
  14. package/types/enums/data-api-filter-logic.d.ts +4 -0
  15. package/types/enums/data-api-owned-binding-principal-type.d.ts +4 -0
  16. package/types/enums/data-api-owned-binding-status.d.ts +4 -0
  17. package/types/enums/memory-pipeline-run-result-status.d.ts +4 -0
  18. package/types/enums/memory-pipeline-run-scenario.d.ts +6 -0
  19. package/types/enums/memory-pipeline-run-status.d.ts +6 -0
  20. package/types/enums/method.d.ts +9 -0
  21. package/types/enums/path-match.d.ts +4 -0
  22. package/types/enums/scenario.d.ts +6 -0
  23. package/types/enums/scene.d.ts +4 -0
  24. package/types/enums/status.d.ts +7 -1
  25. package/types/enums/timezone.d.ts +1 -0
  26. package/types/index.d.ts +19 -2
  27. package/types/models.d.ts +798 -4
  28. package/types/services/account.d.ts +85 -2
  29. package/types/services/ai-gateway.d.ts +90 -0
  30. package/types/services/data-api.d.ts +257 -0
  31. package/types/services/functions.d.ts +35 -7
  32. package/types/services/knowledge-bases.d.ts +186 -2
  33. package/types/services/llm-gateway.d.ts +8 -1
  34. package/types/services/memory.d.ts +600 -19
package/dist/cjs/sdk.js CHANGED
@@ -595,7 +595,7 @@ class Client {
595
595
  * Holds configuration such as project.
596
596
  */
597
597
  this.config = {
598
- endpoint: 'https://appbase.local/v1',
598
+ endpoint: 'https://example.com[HOSTNAME]/v1',
599
599
  endpointRealtime: '',
600
600
  project: '',
601
601
  organization: '',
@@ -614,9 +614,9 @@ class Client {
614
614
  'x-sdk-name': 'Agentbase',
615
615
  'x-sdk-platform': 'client',
616
616
  'x-sdk-language': 'web',
617
- 'x-sdk-version': '2.9.0',
617
+ 'x-sdk-version': '2.12.0',
618
618
  'X-AppBase-SDK': 'true',
619
- 'X-Appwrite-Response-Format': '2.9.0',
619
+ 'X-Appwrite-Response-Format': '2.12.0',
620
620
  };
621
621
  this.realtime = {
622
622
  socket: undefined,
@@ -2158,6 +2158,131 @@ class Account {
2158
2158
  };
2159
2159
  return this.client.call('patch', uri, apiHeaders, payload);
2160
2160
  }
2161
+ changePhone(paramsOrFirst, ...rest) {
2162
+ let params;
2163
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2164
+ params = (paramsOrFirst || {});
2165
+ }
2166
+ else {
2167
+ params = {
2168
+ newPhone: paramsOrFirst,
2169
+ challengeId: rest[0],
2170
+ code: rest[1],
2171
+ password: rest[2]
2172
+ };
2173
+ }
2174
+ const newPhone = params.newPhone;
2175
+ const challengeId = params.challengeId;
2176
+ const code = params.code;
2177
+ const password = params.password;
2178
+ if (typeof newPhone === 'undefined') {
2179
+ throw new AgentbaseException('Missing required parameter: "newPhone"');
2180
+ }
2181
+ if (typeof challengeId === 'undefined') {
2182
+ throw new AgentbaseException('Missing required parameter: "challengeId"');
2183
+ }
2184
+ if (typeof code === 'undefined') {
2185
+ throw new AgentbaseException('Missing required parameter: "code"');
2186
+ }
2187
+ const apiPath = '/account/phone/change';
2188
+ const payload = {};
2189
+ if (typeof newPhone !== 'undefined') {
2190
+ payload['newPhone'] = newPhone;
2191
+ }
2192
+ if (typeof challengeId !== 'undefined') {
2193
+ payload['challengeId'] = challengeId;
2194
+ }
2195
+ if (typeof code !== 'undefined') {
2196
+ payload['code'] = code;
2197
+ }
2198
+ if (typeof password !== 'undefined') {
2199
+ payload['password'] = password;
2200
+ }
2201
+ const uri = new URL(this.client.config.endpoint + apiPath);
2202
+ const apiHeaders = {
2203
+ 'X-Appwrite-Project': this.client.config.project,
2204
+ 'content-type': 'application/json',
2205
+ };
2206
+ return this.client.call('post', uri, apiHeaders, payload);
2207
+ }
2208
+ sendPhoneCode(paramsOrFirst, ...rest) {
2209
+ let params;
2210
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2211
+ params = (paramsOrFirst || {});
2212
+ }
2213
+ else {
2214
+ params = {
2215
+ phone: paramsOrFirst,
2216
+ userId: rest[0],
2217
+ scene: rest[1]
2218
+ };
2219
+ }
2220
+ const phone = params.phone;
2221
+ const userId = params.userId;
2222
+ const scene = params.scene;
2223
+ if (typeof phone === 'undefined') {
2224
+ throw new AgentbaseException('Missing required parameter: "phone"');
2225
+ }
2226
+ const apiPath = '/account/phone/send-code';
2227
+ const payload = {};
2228
+ if (typeof userId !== 'undefined') {
2229
+ payload['userId'] = userId;
2230
+ }
2231
+ if (typeof phone !== 'undefined') {
2232
+ payload['phone'] = phone;
2233
+ }
2234
+ if (typeof scene !== 'undefined') {
2235
+ payload['scene'] = scene;
2236
+ }
2237
+ const uri = new URL(this.client.config.endpoint + apiPath);
2238
+ const apiHeaders = {
2239
+ 'X-Appwrite-Project': this.client.config.project,
2240
+ 'content-type': 'application/json',
2241
+ };
2242
+ return this.client.call('post', uri, apiHeaders, payload);
2243
+ }
2244
+ verifyPhone(paramsOrFirst, ...rest) {
2245
+ let params;
2246
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2247
+ params = (paramsOrFirst || {});
2248
+ }
2249
+ else {
2250
+ params = {
2251
+ challengeId: paramsOrFirst,
2252
+ phone: rest[0],
2253
+ code: rest[1]
2254
+ };
2255
+ }
2256
+ const challengeId = params.challengeId;
2257
+ const phone = params.phone;
2258
+ const code = params.code;
2259
+ if (typeof challengeId === 'undefined') {
2260
+ throw new AgentbaseException('Missing required parameter: "challengeId"');
2261
+ }
2262
+ if (typeof phone === 'undefined') {
2263
+ throw new AgentbaseException('Missing required parameter: "phone"');
2264
+ }
2265
+ if (typeof code === 'undefined') {
2266
+ throw new AgentbaseException('Missing required parameter: "code"');
2267
+ }
2268
+ const apiPath = '/account/phone/verify';
2269
+ const payload = {};
2270
+ if (typeof challengeId !== 'undefined') {
2271
+ payload['challengeId'] = challengeId;
2272
+ }
2273
+ if (typeof phone !== 'undefined') {
2274
+ payload['phone'] = phone;
2275
+ }
2276
+ if (typeof code !== 'undefined') {
2277
+ payload['code'] = code;
2278
+ }
2279
+ const uri = new URL(this.client.config.endpoint + apiPath);
2280
+ const apiHeaders = {
2281
+ 'X-Appwrite-Project': this.client.config.project,
2282
+ 'content-type': 'application/json',
2283
+ };
2284
+ return this.client.call('post', uri, apiHeaders, payload);
2285
+ }
2161
2286
  /**
2162
2287
  * Get the preferences as a key-value object for the currently logged in user.
2163
2288
  *
@@ -2689,7 +2814,8 @@ class Account {
2689
2814
  return this.client.call('delete', uri, apiHeaders, payload);
2690
2815
  }
2691
2816
  /**
2692
- * Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.
2817
+ * Block the currently logged in user account in an application project. The user record is retained, and access remains blocked until an authorized project administrator restores the status through the Users API. Console platform accounts cannot disable themselves through this endpoint; requests authenticated as a Console account return HTTP 403 with type `general_access_forbidden` without changing the account status or clearing its session cookies. To completely delete a project user, use the Users API instead.
2818
+ *
2693
2819
  *
2694
2820
  * @throws {AgentbaseException}
2695
2821
  * @returns {Promise<Models.User<Preferences>>}
@@ -2935,11 +3061,13 @@ class Account {
2935
3061
  else {
2936
3062
  params = {
2937
3063
  userId: paramsOrFirst,
2938
- phone: rest[0]
3064
+ phone: rest[0],
3065
+ scene: rest[1]
2939
3066
  };
2940
3067
  }
2941
3068
  const userId = params.userId;
2942
3069
  const phone = params.phone;
3070
+ const scene = params.scene;
2943
3071
  if (typeof userId === 'undefined') {
2944
3072
  throw new AgentbaseException('Missing required parameter: "userId"');
2945
3073
  }
@@ -2954,6 +3082,9 @@ class Account {
2954
3082
  if (typeof phone !== 'undefined') {
2955
3083
  payload['phone'] = phone;
2956
3084
  }
3085
+ if (typeof scene !== 'undefined') {
3086
+ payload['scene'] = scene;
3087
+ }
2957
3088
  const uri = new URL(this.client.config.endpoint + apiPath);
2958
3089
  const apiHeaders = {
2959
3090
  'X-Appwrite-Project': this.client.config.project,
@@ -3690,6 +3821,89 @@ class AiGateway {
3690
3821
  constructor(client) {
3691
3822
  this.client = client;
3692
3823
  }
3824
+ /**
3825
+ * Manage unified AI Gateway control-plane resources.
3826
+ *
3827
+ * @throws {AgentbaseException}
3828
+ * @returns {Promise<{}>}
3829
+ */
3830
+ listApprovalRequests() {
3831
+ const apiPath = '/ai-gateway/approval-requests';
3832
+ const payload = {};
3833
+ const uri = new URL(this.client.config.endpoint + apiPath);
3834
+ const apiHeaders = {
3835
+ 'X-Appwrite-Project': this.client.config.project,
3836
+ };
3837
+ return this.client.call('get', uri, apiHeaders, payload);
3838
+ }
3839
+ getApprovalRequest(paramsOrFirst) {
3840
+ let params;
3841
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3842
+ params = (paramsOrFirst || {});
3843
+ }
3844
+ else {
3845
+ params = {
3846
+ id: paramsOrFirst
3847
+ };
3848
+ }
3849
+ const id = params.id;
3850
+ if (typeof id === 'undefined') {
3851
+ throw new AgentbaseException('Missing required parameter: "id"');
3852
+ }
3853
+ const apiPath = '/ai-gateway/approval-requests/{id}'.replace('{id}', id);
3854
+ const payload = {};
3855
+ const uri = new URL(this.client.config.endpoint + apiPath);
3856
+ const apiHeaders = {
3857
+ 'X-Appwrite-Project': this.client.config.project,
3858
+ };
3859
+ return this.client.call('get', uri, apiHeaders, payload);
3860
+ }
3861
+ approveApprovalRequest(paramsOrFirst) {
3862
+ let params;
3863
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3864
+ params = (paramsOrFirst || {});
3865
+ }
3866
+ else {
3867
+ params = {
3868
+ id: paramsOrFirst
3869
+ };
3870
+ }
3871
+ const id = params.id;
3872
+ if (typeof id === 'undefined') {
3873
+ throw new AgentbaseException('Missing required parameter: "id"');
3874
+ }
3875
+ const apiPath = '/ai-gateway/approval-requests/{id}/approve'.replace('{id}', id);
3876
+ const payload = {};
3877
+ const uri = new URL(this.client.config.endpoint + apiPath);
3878
+ const apiHeaders = {
3879
+ 'X-Appwrite-Project': this.client.config.project,
3880
+ 'content-type': 'application/json',
3881
+ };
3882
+ return this.client.call('post', uri, apiHeaders, payload);
3883
+ }
3884
+ rejectApprovalRequest(paramsOrFirst) {
3885
+ let params;
3886
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3887
+ params = (paramsOrFirst || {});
3888
+ }
3889
+ else {
3890
+ params = {
3891
+ id: paramsOrFirst
3892
+ };
3893
+ }
3894
+ const id = params.id;
3895
+ if (typeof id === 'undefined') {
3896
+ throw new AgentbaseException('Missing required parameter: "id"');
3897
+ }
3898
+ const apiPath = '/ai-gateway/approval-requests/{id}/reject'.replace('{id}', id);
3899
+ const payload = {};
3900
+ const uri = new URL(this.client.config.endpoint + apiPath);
3901
+ const apiHeaders = {
3902
+ 'X-Appwrite-Project': this.client.config.project,
3903
+ 'content-type': 'application/json',
3904
+ };
3905
+ return this.client.call('post', uri, apiHeaders, payload);
3906
+ }
3693
3907
  updateGatewayPolicy(paramsOrFirst) {
3694
3908
  let params;
3695
3909
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -3758,6 +3972,26 @@ class AiGateway {
3758
3972
  };
3759
3973
  return this.client.call('get', uri, apiHeaders, payload);
3760
3974
  }
3975
+ /**
3976
+ * 读取当前 Shared V2 项目的 Tool Gateway 初始化状态。请求为 `GET /v1/ai-gateway/initialization-status`,无请求参数。调用方需要项目访问权限和 `aiGateway.read` scope。
3977
+ *
3978
+ * 成功时返回 HTTP 200。`{"status":"ready"}` 表示控制面已确认现有项目表就绪,可沿用原配置重新启用服务。`{"status":"uninitialized"}` 表示项目表尚未就绪,包括尚未建表或迁移标记为 dirty。此查询只读,不会调用模型、建表或开启服务。
3979
+ *
3980
+ * 缺少 `aiGateway.read` 的项目 API Key 会收到 HTTP 401(`general_unauthorized_scope`)。服务被禁用时,非特权调用方也可能先收到 HTTP 403(`general_service_disabled`)。控制面读取存储发生异常或 Core 无法连接控制面时会返回服务端错误,例如 HTTP 500。此时状态未知,调用方应显示错误并允许重试查询。
3981
+ *
3982
+ *
3983
+ * @throws {AgentbaseException}
3984
+ * @returns {Promise<{}>}
3985
+ */
3986
+ getInitializationStatus() {
3987
+ const apiPath = '/ai-gateway/initialization-status';
3988
+ const payload = {};
3989
+ const uri = new URL(this.client.config.endpoint + apiPath);
3990
+ const apiHeaders = {
3991
+ 'X-Appwrite-Project': this.client.config.project,
3992
+ };
3993
+ return this.client.call('get', uri, apiHeaders, payload);
3994
+ }
3761
3995
  /**
3762
3996
  * Manage unified AI Gateway control-plane resources.
3763
3997
  *
@@ -4751,6 +4985,37 @@ class AiGateway {
4751
4985
  };
4752
4986
  return this.client.call('post', uri, apiHeaders, payload);
4753
4987
  }
4988
+ /**
4989
+ * Manage unified AI Gateway control-plane resources.
4990
+ *
4991
+ * @throws {AgentbaseException}
4992
+ * @returns {Promise<{}>}
4993
+ */
4994
+ listToolEmbeddings() {
4995
+ const apiPath = '/ai-gateway/tool-embeddings';
4996
+ const payload = {};
4997
+ const uri = new URL(this.client.config.endpoint + apiPath);
4998
+ const apiHeaders = {
4999
+ 'X-Appwrite-Project': this.client.config.project,
5000
+ };
5001
+ return this.client.call('get', uri, apiHeaders, payload);
5002
+ }
5003
+ /**
5004
+ * Manage unified AI Gateway control-plane resources.
5005
+ *
5006
+ * @throws {AgentbaseException}
5007
+ * @returns {Promise<{}>}
5008
+ */
5009
+ createToolEmbeddings() {
5010
+ const apiPath = '/ai-gateway/tool-embeddings';
5011
+ const payload = {};
5012
+ const uri = new URL(this.client.config.endpoint + apiPath);
5013
+ const apiHeaders = {
5014
+ 'X-Appwrite-Project': this.client.config.project,
5015
+ 'content-type': 'application/json',
5016
+ };
5017
+ return this.client.call('post', uri, apiHeaders, payload);
5018
+ }
4754
5019
  }
4755
5020
 
4756
5021
  class Avatars {
@@ -5159,68 +5424,384 @@ class Avatars {
5159
5424
  }
5160
5425
  }
5161
5426
 
5162
- class Databases {
5427
+ class DataApi {
5163
5428
  constructor(client) {
5164
5429
  this.client = client;
5165
5430
  }
5166
- listTransactions(paramsOrFirst) {
5431
+ listBindingDataSources(paramsOrFirst) {
5167
5432
  let params;
5168
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
5433
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
5169
5434
  params = (paramsOrFirst || {});
5170
5435
  }
5171
5436
  else {
5172
5437
  params = {
5173
- queries: paramsOrFirst
5438
+ accessBindingId: paramsOrFirst
5174
5439
  };
5175
5440
  }
5176
- const queries = params.queries;
5177
- const apiPath = '/databases/transactions';
5178
- const payload = {};
5179
- if (typeof queries !== 'undefined') {
5180
- payload['queries'] = queries;
5441
+ const accessBindingId = params.accessBindingId;
5442
+ if (typeof accessBindingId === 'undefined') {
5443
+ throw new AgentbaseException('Missing required parameter: "accessBindingId"');
5181
5444
  }
5445
+ const apiPath = '/data-api/bindings/{accessBindingId}/catalog/data-sources'.replace('{accessBindingId}', String(accessBindingId));
5446
+ const payload = {};
5182
5447
  const uri = new URL(this.client.config.endpoint + apiPath);
5183
- const apiHeaders = {
5184
- 'X-Appwrite-Project': this.client.config.project,
5185
- };
5448
+ const apiHeaders = {};
5186
5449
  return this.client.call('get', uri, apiHeaders, payload);
5187
5450
  }
5188
- createTransaction(paramsOrFirst) {
5451
+ listBindingDatabases(paramsOrFirst, ...rest) {
5189
5452
  let params;
5190
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
5453
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
5191
5454
  params = (paramsOrFirst || {});
5192
5455
  }
5193
5456
  else {
5194
5457
  params = {
5195
- ttl: paramsOrFirst
5458
+ accessBindingId: paramsOrFirst,
5459
+ dataSourceId: rest[0]
5196
5460
  };
5197
5461
  }
5198
- const ttl = params.ttl;
5199
- const apiPath = '/databases/transactions';
5200
- const payload = {};
5201
- if (typeof ttl !== 'undefined') {
5202
- payload['ttl'] = ttl;
5462
+ const accessBindingId = params.accessBindingId;
5463
+ const dataSourceId = params.dataSourceId;
5464
+ if (typeof accessBindingId === 'undefined') {
5465
+ throw new AgentbaseException('Missing required parameter: "accessBindingId"');
5203
5466
  }
5467
+ if (typeof dataSourceId === 'undefined') {
5468
+ throw new AgentbaseException('Missing required parameter: "dataSourceId"');
5469
+ }
5470
+ const apiPath = '/data-api/bindings/{accessBindingId}/catalog/data-sources/{dataSourceId}/databases'.replace('{accessBindingId}', String(accessBindingId)).replace('{dataSourceId}', String(dataSourceId));
5471
+ const payload = {};
5204
5472
  const uri = new URL(this.client.config.endpoint + apiPath);
5205
- const apiHeaders = {
5206
- 'X-Appwrite-Project': this.client.config.project,
5207
- 'content-type': 'application/json',
5208
- };
5209
- return this.client.call('post', uri, apiHeaders, payload);
5473
+ const apiHeaders = {};
5474
+ return this.client.call('get', uri, apiHeaders, payload);
5210
5475
  }
5211
- getTransaction(paramsOrFirst) {
5476
+ listBindingTables(paramsOrFirst, ...rest) {
5212
5477
  let params;
5213
5478
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
5214
5479
  params = (paramsOrFirst || {});
5215
5480
  }
5216
5481
  else {
5217
5482
  params = {
5218
- transactionId: paramsOrFirst
5483
+ accessBindingId: paramsOrFirst,
5484
+ dataSourceId: rest[0],
5485
+ databaseId: rest[1]
5219
5486
  };
5220
5487
  }
5221
- const transactionId = params.transactionId;
5222
- if (typeof transactionId === 'undefined') {
5223
- throw new AgentbaseException('Missing required parameter: "transactionId"');
5488
+ const accessBindingId = params.accessBindingId;
5489
+ const dataSourceId = params.dataSourceId;
5490
+ const databaseId = params.databaseId;
5491
+ if (typeof accessBindingId === 'undefined') {
5492
+ throw new AgentbaseException('Missing required parameter: "accessBindingId"');
5493
+ }
5494
+ if (typeof dataSourceId === 'undefined') {
5495
+ throw new AgentbaseException('Missing required parameter: "dataSourceId"');
5496
+ }
5497
+ if (typeof databaseId === 'undefined') {
5498
+ throw new AgentbaseException('Missing required parameter: "databaseId"');
5499
+ }
5500
+ const apiPath = '/data-api/bindings/{accessBindingId}/catalog/data-sources/{dataSourceId}/databases/{databaseId}/tables'.replace('{accessBindingId}', String(accessBindingId)).replace('{dataSourceId}', String(dataSourceId)).replace('{databaseId}', String(databaseId));
5501
+ const payload = {};
5502
+ const uri = new URL(this.client.config.endpoint + apiPath);
5503
+ const apiHeaders = {};
5504
+ return this.client.call('get', uri, apiHeaders, payload);
5505
+ }
5506
+ getBindingTable(paramsOrFirst, ...rest) {
5507
+ let params;
5508
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
5509
+ params = (paramsOrFirst || {});
5510
+ }
5511
+ else {
5512
+ params = {
5513
+ accessBindingId: paramsOrFirst,
5514
+ dataSourceId: rest[0],
5515
+ databaseId: rest[1],
5516
+ tableName: rest[2]
5517
+ };
5518
+ }
5519
+ const accessBindingId = params.accessBindingId;
5520
+ const dataSourceId = params.dataSourceId;
5521
+ const databaseId = params.databaseId;
5522
+ const tableName = params.tableName;
5523
+ if (typeof accessBindingId === 'undefined') {
5524
+ throw new AgentbaseException('Missing required parameter: "accessBindingId"');
5525
+ }
5526
+ if (typeof dataSourceId === 'undefined') {
5527
+ throw new AgentbaseException('Missing required parameter: "dataSourceId"');
5528
+ }
5529
+ if (typeof databaseId === 'undefined') {
5530
+ throw new AgentbaseException('Missing required parameter: "databaseId"');
5531
+ }
5532
+ if (typeof tableName === 'undefined') {
5533
+ throw new AgentbaseException('Missing required parameter: "tableName"');
5534
+ }
5535
+ const apiPath = '/data-api/bindings/{accessBindingId}/catalog/data-sources/{dataSourceId}/databases/{databaseId}/tables/{tableName}'.replace('{accessBindingId}', String(accessBindingId)).replace('{dataSourceId}', String(dataSourceId)).replace('{databaseId}', String(databaseId)).replace('{tableName}', tableName);
5536
+ const payload = {};
5537
+ const uri = new URL(this.client.config.endpoint + apiPath);
5538
+ const apiHeaders = {};
5539
+ return this.client.call('get', uri, apiHeaders, payload);
5540
+ }
5541
+ executeNativeSql(paramsOrFirst, ...rest) {
5542
+ let params;
5543
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
5544
+ params = (paramsOrFirst || {});
5545
+ }
5546
+ else {
5547
+ params = {
5548
+ accessBindingId: paramsOrFirst,
5549
+ sql: rest[0]
5550
+ };
5551
+ }
5552
+ const accessBindingId = params.accessBindingId;
5553
+ const sql = params.sql;
5554
+ if (typeof accessBindingId === 'undefined') {
5555
+ throw new AgentbaseException('Missing required parameter: "accessBindingId"');
5556
+ }
5557
+ if (typeof sql === 'undefined') {
5558
+ throw new AgentbaseException('Missing required parameter: "sql"');
5559
+ }
5560
+ const apiPath = '/data-api/bindings/{accessBindingId}/native-sql'.replace('{accessBindingId}', String(accessBindingId));
5561
+ const payload = {};
5562
+ if (typeof sql !== 'undefined') {
5563
+ payload['sql'] = sql;
5564
+ }
5565
+ const uri = new URL(this.client.config.endpoint + apiPath);
5566
+ const apiHeaders = {
5567
+ 'content-type': 'application/json',
5568
+ };
5569
+ return this.client.call('post', uri, apiHeaders, payload);
5570
+ }
5571
+ executeRestAggregates(paramsOrFirst, ...rest) {
5572
+ let params;
5573
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
5574
+ params = (paramsOrFirst || {});
5575
+ }
5576
+ else {
5577
+ params = {
5578
+ accessBindingId: paramsOrFirst,
5579
+ databaseId: rest[0],
5580
+ tableName: rest[1],
5581
+ query: rest[2]
5582
+ };
5583
+ }
5584
+ const accessBindingId = params.accessBindingId;
5585
+ const databaseId = params.databaseId;
5586
+ const tableName = params.tableName;
5587
+ const query = params.query;
5588
+ if (typeof accessBindingId === 'undefined') {
5589
+ throw new AgentbaseException('Missing required parameter: "accessBindingId"');
5590
+ }
5591
+ if (typeof databaseId === 'undefined') {
5592
+ throw new AgentbaseException('Missing required parameter: "databaseId"');
5593
+ }
5594
+ if (typeof tableName === 'undefined') {
5595
+ throw new AgentbaseException('Missing required parameter: "tableName"');
5596
+ }
5597
+ if (typeof query === 'undefined') {
5598
+ throw new AgentbaseException('Missing required parameter: "query"');
5599
+ }
5600
+ const apiPath = '/data-api/bindings/{accessBindingId}/rest/databases/{databaseId}/tables/{tableName}/aggregates/query'.replace('{accessBindingId}', String(accessBindingId)).replace('{databaseId}', String(databaseId)).replace('{tableName}', tableName);
5601
+ const payload = {};
5602
+ if (typeof query !== 'undefined') {
5603
+ payload['query'] = query;
5604
+ }
5605
+ const uri = new URL(this.client.config.endpoint + apiPath);
5606
+ const apiHeaders = {
5607
+ 'content-type': 'application/json',
5608
+ };
5609
+ return this.client.call('post', uri, apiHeaders, payload);
5610
+ }
5611
+ executeRestRows(paramsOrFirst, ...rest) {
5612
+ let params;
5613
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
5614
+ params = (paramsOrFirst || {});
5615
+ }
5616
+ else {
5617
+ params = {
5618
+ accessBindingId: paramsOrFirst,
5619
+ databaseId: rest[0],
5620
+ tableName: rest[1],
5621
+ query: rest[2]
5622
+ };
5623
+ }
5624
+ const accessBindingId = params.accessBindingId;
5625
+ const databaseId = params.databaseId;
5626
+ const tableName = params.tableName;
5627
+ const query = params.query;
5628
+ if (typeof accessBindingId === 'undefined') {
5629
+ throw new AgentbaseException('Missing required parameter: "accessBindingId"');
5630
+ }
5631
+ if (typeof databaseId === 'undefined') {
5632
+ throw new AgentbaseException('Missing required parameter: "databaseId"');
5633
+ }
5634
+ if (typeof tableName === 'undefined') {
5635
+ throw new AgentbaseException('Missing required parameter: "tableName"');
5636
+ }
5637
+ if (typeof query === 'undefined') {
5638
+ throw new AgentbaseException('Missing required parameter: "query"');
5639
+ }
5640
+ const apiPath = '/data-api/bindings/{accessBindingId}/rest/databases/{databaseId}/tables/{tableName}/rows/query'.replace('{accessBindingId}', String(accessBindingId)).replace('{databaseId}', String(databaseId)).replace('{tableName}', tableName);
5641
+ const payload = {};
5642
+ if (typeof query !== 'undefined') {
5643
+ payload['query'] = query;
5644
+ }
5645
+ const uri = new URL(this.client.config.endpoint + apiPath);
5646
+ const apiHeaders = {
5647
+ 'content-type': 'application/json',
5648
+ };
5649
+ return this.client.call('post', uri, apiHeaders, payload);
5650
+ }
5651
+ listMyBindings(paramsOrFirst, ...rest) {
5652
+ let params;
5653
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
5654
+ params = (paramsOrFirst || {});
5655
+ }
5656
+ else {
5657
+ params = {
5658
+ cursor: paramsOrFirst,
5659
+ limit: rest[0]
5660
+ };
5661
+ }
5662
+ const cursor = params.cursor;
5663
+ const limit = params.limit;
5664
+ const apiPath = '/data-api/me/bindings';
5665
+ const payload = {};
5666
+ if (typeof cursor !== 'undefined') {
5667
+ payload['cursor'] = cursor;
5668
+ }
5669
+ if (typeof limit !== 'undefined') {
5670
+ payload['limit'] = limit;
5671
+ }
5672
+ const uri = new URL(this.client.config.endpoint + apiPath);
5673
+ const apiHeaders = {};
5674
+ return this.client.call('get', uri, apiHeaders, payload);
5675
+ }
5676
+ getMyBinding(paramsOrFirst) {
5677
+ let params;
5678
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
5679
+ params = (paramsOrFirst || {});
5680
+ }
5681
+ else {
5682
+ params = {
5683
+ accessBindingId: paramsOrFirst
5684
+ };
5685
+ }
5686
+ const accessBindingId = params.accessBindingId;
5687
+ if (typeof accessBindingId === 'undefined') {
5688
+ throw new AgentbaseException('Missing required parameter: "accessBindingId"');
5689
+ }
5690
+ const apiPath = '/data-api/me/bindings/{accessBindingId}'.replace('{accessBindingId}', String(accessBindingId));
5691
+ const payload = {};
5692
+ const uri = new URL(this.client.config.endpoint + apiPath);
5693
+ const apiHeaders = {};
5694
+ return this.client.call('get', uri, apiHeaders, payload);
5695
+ }
5696
+ executeFixedQueryLink(paramsOrFirst) {
5697
+ let params;
5698
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
5699
+ params = (paramsOrFirst || {});
5700
+ }
5701
+ else {
5702
+ params = {
5703
+ queryId: paramsOrFirst
5704
+ };
5705
+ }
5706
+ const queryId = params.queryId;
5707
+ if (typeof queryId === 'undefined') {
5708
+ throw new AgentbaseException('Missing required parameter: "queryId"');
5709
+ }
5710
+ const apiPath = '/data-api/public/query-interfaces/{queryId}/executions'.replace('{queryId}', queryId);
5711
+ const payload = {};
5712
+ const uri = new URL(this.client.config.endpoint + apiPath);
5713
+ const apiHeaders = {
5714
+ 'X-Appwrite-Project': this.client.config.project,
5715
+ };
5716
+ return this.client.call('get', uri, apiHeaders, payload);
5717
+ }
5718
+ executeFixedQuery(paramsOrFirst) {
5719
+ let params;
5720
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
5721
+ params = (paramsOrFirst || {});
5722
+ }
5723
+ else {
5724
+ params = {
5725
+ queryId: paramsOrFirst
5726
+ };
5727
+ }
5728
+ const queryId = params.queryId;
5729
+ if (typeof queryId === 'undefined') {
5730
+ throw new AgentbaseException('Missing required parameter: "queryId"');
5731
+ }
5732
+ const apiPath = '/data-api/public/query-interfaces/{queryId}/executions'.replace('{queryId}', queryId);
5733
+ const payload = {};
5734
+ const uri = new URL(this.client.config.endpoint + apiPath);
5735
+ const apiHeaders = {
5736
+ 'X-Appwrite-Project': this.client.config.project,
5737
+ 'content-type': 'application/json',
5738
+ };
5739
+ return this.client.call('post', uri, apiHeaders, payload);
5740
+ }
5741
+ }
5742
+
5743
+ class Databases {
5744
+ constructor(client) {
5745
+ this.client = client;
5746
+ }
5747
+ listTransactions(paramsOrFirst) {
5748
+ let params;
5749
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
5750
+ params = (paramsOrFirst || {});
5751
+ }
5752
+ else {
5753
+ params = {
5754
+ queries: paramsOrFirst
5755
+ };
5756
+ }
5757
+ const queries = params.queries;
5758
+ const apiPath = '/databases/transactions';
5759
+ const payload = {};
5760
+ if (typeof queries !== 'undefined') {
5761
+ payload['queries'] = queries;
5762
+ }
5763
+ const uri = new URL(this.client.config.endpoint + apiPath);
5764
+ const apiHeaders = {
5765
+ 'X-Appwrite-Project': this.client.config.project,
5766
+ };
5767
+ return this.client.call('get', uri, apiHeaders, payload);
5768
+ }
5769
+ createTransaction(paramsOrFirst) {
5770
+ let params;
5771
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
5772
+ params = (paramsOrFirst || {});
5773
+ }
5774
+ else {
5775
+ params = {
5776
+ ttl: paramsOrFirst
5777
+ };
5778
+ }
5779
+ const ttl = params.ttl;
5780
+ const apiPath = '/databases/transactions';
5781
+ const payload = {};
5782
+ if (typeof ttl !== 'undefined') {
5783
+ payload['ttl'] = ttl;
5784
+ }
5785
+ const uri = new URL(this.client.config.endpoint + apiPath);
5786
+ const apiHeaders = {
5787
+ 'X-Appwrite-Project': this.client.config.project,
5788
+ 'content-type': 'application/json',
5789
+ };
5790
+ return this.client.call('post', uri, apiHeaders, payload);
5791
+ }
5792
+ getTransaction(paramsOrFirst) {
5793
+ let params;
5794
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
5795
+ params = (paramsOrFirst || {});
5796
+ }
5797
+ else {
5798
+ params = {
5799
+ transactionId: paramsOrFirst
5800
+ };
5801
+ }
5802
+ const transactionId = params.transactionId;
5803
+ if (typeof transactionId === 'undefined') {
5804
+ throw new AgentbaseException('Missing required parameter: "transactionId"');
5224
5805
  }
5225
5806
  const apiPath = '/databases/transactions/{transactionId}'.replace('{transactionId}', transactionId);
5226
5807
  const payload = {};
@@ -6317,13 +6898,19 @@ class Functions {
6317
6898
  functionId: paramsOrFirst,
6318
6899
  limit: rest[0],
6319
6900
  offset: rest[1],
6320
- total: rest[2]
6901
+ total: rest[2],
6902
+ xpath: rest[3],
6903
+ pathMatch: rest[4],
6904
+ method: rest[5]
6321
6905
  };
6322
6906
  }
6323
6907
  const functionId = params.functionId;
6324
6908
  const limit = params.limit;
6325
6909
  const offset = params.offset;
6326
6910
  const total = params.total;
6911
+ const xpath = params.xpath;
6912
+ const pathMatch = params.pathMatch;
6913
+ const method = params.method;
6327
6914
  if (typeof functionId === 'undefined') {
6328
6915
  throw new AgentbaseException('Missing required parameter: "functionId"');
6329
6916
  }
@@ -6338,6 +6925,15 @@ class Functions {
6338
6925
  if (typeof total !== 'undefined') {
6339
6926
  payload['total'] = total;
6340
6927
  }
6928
+ if (typeof xpath !== 'undefined') {
6929
+ payload['path'] = xpath;
6930
+ }
6931
+ if (typeof pathMatch !== 'undefined') {
6932
+ payload['pathMatch'] = pathMatch;
6933
+ }
6934
+ if (typeof method !== 'undefined') {
6935
+ payload['method'] = method;
6936
+ }
6341
6937
  const uri = new URL(this.client.config.endpoint + apiPath);
6342
6938
  const apiHeaders = {
6343
6939
  'X-Appwrite-Project': this.client.config.project,
@@ -6354,13 +6950,17 @@ class Functions {
6354
6950
  functionId: paramsOrFirst,
6355
6951
  xpath: rest[0],
6356
6952
  queries: rest[1],
6357
- total: rest[2]
6953
+ total: rest[2],
6954
+ pathMatch: rest[3],
6955
+ method: rest[4]
6358
6956
  };
6359
6957
  }
6360
6958
  const functionId = params.functionId;
6361
6959
  const xpath = params.xpath;
6362
6960
  const queries = params.queries;
6363
6961
  const total = params.total;
6962
+ const pathMatch = params.pathMatch;
6963
+ const method = params.method;
6364
6964
  if (typeof functionId === 'undefined') {
6365
6965
  throw new AgentbaseException('Missing required parameter: "functionId"');
6366
6966
  }
@@ -6378,6 +6978,12 @@ class Functions {
6378
6978
  if (typeof total !== 'undefined') {
6379
6979
  payload['total'] = total;
6380
6980
  }
6981
+ if (typeof pathMatch !== 'undefined') {
6982
+ payload['pathMatch'] = pathMatch;
6983
+ }
6984
+ if (typeof method !== 'undefined') {
6985
+ payload['method'] = method;
6986
+ }
6381
6987
  const uri = new URL(this.client.config.endpoint + apiPath);
6382
6988
  const apiHeaders = {
6383
6989
  'X-Appwrite-Project': this.client.config.project,
@@ -6393,12 +6999,18 @@ class Functions {
6393
6999
  params = {
6394
7000
  functionId: paramsOrFirst,
6395
7001
  queries: rest[0],
6396
- total: rest[1]
7002
+ total: rest[1],
7003
+ xpath: rest[2],
7004
+ pathMatch: rest[3],
7005
+ method: rest[4]
6397
7006
  };
6398
7007
  }
6399
7008
  const functionId = params.functionId;
6400
7009
  const queries = params.queries;
6401
7010
  const total = params.total;
7011
+ const xpath = params.xpath;
7012
+ const pathMatch = params.pathMatch;
7013
+ const method = params.method;
6402
7014
  if (typeof functionId === 'undefined') {
6403
7015
  throw new AgentbaseException('Missing required parameter: "functionId"');
6404
7016
  }
@@ -6410,9 +7022,18 @@ class Functions {
6410
7022
  if (typeof total !== 'undefined') {
6411
7023
  payload['total'] = total;
6412
7024
  }
6413
- const uri = new URL(this.client.config.endpoint + apiPath);
6414
- const apiHeaders = {
6415
- 'X-Appwrite-Project': this.client.config.project,
7025
+ if (typeof xpath !== 'undefined') {
7026
+ payload['path'] = xpath;
7027
+ }
7028
+ if (typeof pathMatch !== 'undefined') {
7029
+ payload['pathMatch'] = pathMatch;
7030
+ }
7031
+ if (typeof method !== 'undefined') {
7032
+ payload['method'] = method;
7033
+ }
7034
+ const uri = new URL(this.client.config.endpoint + apiPath);
7035
+ const apiHeaders = {
7036
+ 'X-Appwrite-Project': this.client.config.project,
6416
7037
  };
6417
7038
  return this.client.call('get', uri, apiHeaders, payload);
6418
7039
  }
@@ -6689,6 +7310,218 @@ class KnowledgeBases {
6689
7310
  };
6690
7311
  return this.client.call('get', uri, apiHeaders, payload);
6691
7312
  }
7313
+ listYuquePersonalDataSources(paramsOrFirst, ...rest) {
7314
+ let params;
7315
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
7316
+ params = (paramsOrFirst || {});
7317
+ }
7318
+ else {
7319
+ params = {
7320
+ knowledgeBaseId: paramsOrFirst,
7321
+ versionId: rest[0]
7322
+ };
7323
+ }
7324
+ const knowledgeBaseId = params.knowledgeBaseId;
7325
+ const versionId = params.versionId;
7326
+ if (typeof knowledgeBaseId === 'undefined') {
7327
+ throw new AgentbaseException('Missing required parameter: "knowledgeBaseId"');
7328
+ }
7329
+ const apiPath = '/knowledgebases/{knowledgeBaseId}/yuque/personal-datasources'.replace('{knowledgeBaseId}', knowledgeBaseId);
7330
+ const payload = {};
7331
+ if (typeof versionId !== 'undefined') {
7332
+ payload['versionId'] = versionId;
7333
+ }
7334
+ const uri = new URL(this.client.config.endpoint + apiPath);
7335
+ const apiHeaders = {
7336
+ 'X-Appwrite-Project': this.client.config.project,
7337
+ };
7338
+ return this.client.call('get', uri, apiHeaders, payload);
7339
+ }
7340
+ createYuquePersonalDataSource(paramsOrFirst, ...rest) {
7341
+ let params;
7342
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
7343
+ params = (paramsOrFirst || {});
7344
+ }
7345
+ else {
7346
+ params = {
7347
+ knowledgeBaseId: paramsOrFirst,
7348
+ sessionId: rest[0],
7349
+ name: rest[1],
7350
+ urls: rest[2],
7351
+ versionId: rest[3],
7352
+ syncSchedule: rest[4],
7353
+ status: rest[5],
7354
+ triggerSync: rest[6]
7355
+ };
7356
+ }
7357
+ const knowledgeBaseId = params.knowledgeBaseId;
7358
+ const sessionId = params.sessionId;
7359
+ const name = params.name;
7360
+ const urls = params.urls;
7361
+ const versionId = params.versionId;
7362
+ const syncSchedule = params.syncSchedule;
7363
+ const status = params.status;
7364
+ const triggerSync = params.triggerSync;
7365
+ if (typeof knowledgeBaseId === 'undefined') {
7366
+ throw new AgentbaseException('Missing required parameter: "knowledgeBaseId"');
7367
+ }
7368
+ if (typeof sessionId === 'undefined') {
7369
+ throw new AgentbaseException('Missing required parameter: "sessionId"');
7370
+ }
7371
+ if (typeof name === 'undefined') {
7372
+ throw new AgentbaseException('Missing required parameter: "name"');
7373
+ }
7374
+ if (typeof urls === 'undefined') {
7375
+ throw new AgentbaseException('Missing required parameter: "urls"');
7376
+ }
7377
+ const apiPath = '/knowledgebases/{knowledgeBaseId}/yuque/personal-datasources'.replace('{knowledgeBaseId}', knowledgeBaseId);
7378
+ const payload = {};
7379
+ if (typeof versionId !== 'undefined') {
7380
+ payload['versionId'] = versionId;
7381
+ }
7382
+ if (typeof sessionId !== 'undefined') {
7383
+ payload['sessionId'] = sessionId;
7384
+ }
7385
+ if (typeof name !== 'undefined') {
7386
+ payload['name'] = name;
7387
+ }
7388
+ if (typeof urls !== 'undefined') {
7389
+ payload['urls'] = urls;
7390
+ }
7391
+ if (typeof syncSchedule !== 'undefined') {
7392
+ payload['syncSchedule'] = syncSchedule;
7393
+ }
7394
+ if (typeof status !== 'undefined') {
7395
+ payload['status'] = status;
7396
+ }
7397
+ if (typeof triggerSync !== 'undefined') {
7398
+ payload['triggerSync'] = triggerSync;
7399
+ }
7400
+ const uri = new URL(this.client.config.endpoint + apiPath);
7401
+ const apiHeaders = {
7402
+ 'X-Appwrite-Project': this.client.config.project,
7403
+ 'content-type': 'application/json',
7404
+ };
7405
+ return this.client.call('post', uri, apiHeaders, payload);
7406
+ }
7407
+ getYuquePersonalDataSource(paramsOrFirst, ...rest) {
7408
+ let params;
7409
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
7410
+ params = (paramsOrFirst || {});
7411
+ }
7412
+ else {
7413
+ params = {
7414
+ knowledgeBaseId: paramsOrFirst,
7415
+ dataSourceId: rest[0],
7416
+ versionId: rest[1]
7417
+ };
7418
+ }
7419
+ const knowledgeBaseId = params.knowledgeBaseId;
7420
+ const dataSourceId = params.dataSourceId;
7421
+ const versionId = params.versionId;
7422
+ if (typeof knowledgeBaseId === 'undefined') {
7423
+ throw new AgentbaseException('Missing required parameter: "knowledgeBaseId"');
7424
+ }
7425
+ if (typeof dataSourceId === 'undefined') {
7426
+ throw new AgentbaseException('Missing required parameter: "dataSourceId"');
7427
+ }
7428
+ const apiPath = '/knowledgebases/{knowledgeBaseId}/yuque/personal-datasources/{dataSourceId}'.replace('{knowledgeBaseId}', knowledgeBaseId).replace('{dataSourceId}', dataSourceId);
7429
+ const payload = {};
7430
+ if (typeof versionId !== 'undefined') {
7431
+ payload['versionId'] = versionId;
7432
+ }
7433
+ const uri = new URL(this.client.config.endpoint + apiPath);
7434
+ const apiHeaders = {
7435
+ 'X-Appwrite-Project': this.client.config.project,
7436
+ };
7437
+ return this.client.call('get', uri, apiHeaders, payload);
7438
+ }
7439
+ updateYuquePersonalDataSource(paramsOrFirst, ...rest) {
7440
+ let params;
7441
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
7442
+ params = (paramsOrFirst || {});
7443
+ }
7444
+ else {
7445
+ params = {
7446
+ knowledgeBaseId: paramsOrFirst,
7447
+ dataSourceId: rest[0],
7448
+ versionId: rest[1],
7449
+ name: rest[2],
7450
+ urls: rest[3],
7451
+ syncSchedule: rest[4],
7452
+ status: rest[5]
7453
+ };
7454
+ }
7455
+ const knowledgeBaseId = params.knowledgeBaseId;
7456
+ const dataSourceId = params.dataSourceId;
7457
+ const versionId = params.versionId;
7458
+ const name = params.name;
7459
+ const urls = params.urls;
7460
+ const syncSchedule = params.syncSchedule;
7461
+ const status = params.status;
7462
+ if (typeof knowledgeBaseId === 'undefined') {
7463
+ throw new AgentbaseException('Missing required parameter: "knowledgeBaseId"');
7464
+ }
7465
+ if (typeof dataSourceId === 'undefined') {
7466
+ throw new AgentbaseException('Missing required parameter: "dataSourceId"');
7467
+ }
7468
+ const apiPath = '/knowledgebases/{knowledgeBaseId}/yuque/personal-datasources/{dataSourceId}'.replace('{knowledgeBaseId}', knowledgeBaseId).replace('{dataSourceId}', dataSourceId);
7469
+ const payload = {};
7470
+ if (typeof versionId !== 'undefined') {
7471
+ payload['versionId'] = versionId;
7472
+ }
7473
+ if (typeof name !== 'undefined') {
7474
+ payload['name'] = name;
7475
+ }
7476
+ if (typeof urls !== 'undefined') {
7477
+ payload['urls'] = urls;
7478
+ }
7479
+ if (typeof syncSchedule !== 'undefined') {
7480
+ payload['syncSchedule'] = syncSchedule;
7481
+ }
7482
+ if (typeof status !== 'undefined') {
7483
+ payload['status'] = status;
7484
+ }
7485
+ const uri = new URL(this.client.config.endpoint + apiPath);
7486
+ const apiHeaders = {
7487
+ 'X-Appwrite-Project': this.client.config.project,
7488
+ 'content-type': 'application/json',
7489
+ };
7490
+ return this.client.call('patch', uri, apiHeaders, payload);
7491
+ }
7492
+ deleteYuquePersonalDataSource(paramsOrFirst, ...rest) {
7493
+ let params;
7494
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
7495
+ params = (paramsOrFirst || {});
7496
+ }
7497
+ else {
7498
+ params = {
7499
+ knowledgeBaseId: paramsOrFirst,
7500
+ dataSourceId: rest[0],
7501
+ versionId: rest[1]
7502
+ };
7503
+ }
7504
+ const knowledgeBaseId = params.knowledgeBaseId;
7505
+ const dataSourceId = params.dataSourceId;
7506
+ const versionId = params.versionId;
7507
+ if (typeof knowledgeBaseId === 'undefined') {
7508
+ throw new AgentbaseException('Missing required parameter: "knowledgeBaseId"');
7509
+ }
7510
+ if (typeof dataSourceId === 'undefined') {
7511
+ throw new AgentbaseException('Missing required parameter: "dataSourceId"');
7512
+ }
7513
+ const apiPath = '/knowledgebases/{knowledgeBaseId}/yuque/personal-datasources/{dataSourceId}'.replace('{knowledgeBaseId}', knowledgeBaseId).replace('{dataSourceId}', dataSourceId);
7514
+ const payload = {};
7515
+ if (typeof versionId !== 'undefined') {
7516
+ payload['versionId'] = versionId;
7517
+ }
7518
+ const uri = new URL(this.client.config.endpoint + apiPath);
7519
+ const apiHeaders = {
7520
+ 'X-Appwrite-Project': this.client.config.project,
7521
+ 'content-type': 'application/json',
7522
+ };
7523
+ return this.client.call('delete', uri, apiHeaders, payload);
7524
+ }
6692
7525
  }
6693
7526
 
6694
7527
  class LlmGateway {
@@ -6898,7 +7731,8 @@ class LlmGateway {
6898
7731
  query: rest[0],
6899
7732
  documents: rest[1],
6900
7733
  topN: rest[2],
6901
- returnDocuments: rest[3]
7734
+ returnDocuments: rest[3],
7735
+ instruct: rest[4]
6902
7736
  };
6903
7737
  }
6904
7738
  const model = params.model;
@@ -6906,6 +7740,7 @@ class LlmGateway {
6906
7740
  const documents = params.documents;
6907
7741
  const topN = params.topN;
6908
7742
  const returnDocuments = params.returnDocuments;
7743
+ const instruct = params.instruct;
6909
7744
  if (typeof model === 'undefined') {
6910
7745
  throw new AgentbaseException('Missing required parameter: "model"');
6911
7746
  }
@@ -6932,6 +7767,9 @@ class LlmGateway {
6932
7767
  if (typeof returnDocuments !== 'undefined') {
6933
7768
  payload['returnDocuments'] = returnDocuments;
6934
7769
  }
7770
+ if (typeof instruct !== 'undefined') {
7771
+ payload['instruct'] = instruct;
7772
+ }
6935
7773
  const uri = new URL(this.client.config.endpoint + apiPath);
6936
7774
  const apiHeaders = {
6937
7775
  'X-Appwrite-Project': this.client.config.project,
@@ -7275,31 +8113,37 @@ class Memory {
7275
8113
  scope: rest[0],
7276
8114
  memoryType: rest[1],
7277
8115
  recordKind: rest[2],
7278
- content: rest[3],
7279
- messages: rest[4],
7280
- agentId: rest[5],
7281
- runId: rest[6],
7282
- sessionId: rest[7],
7283
- sensitivity: rest[8],
7284
- handlingPolicy: rest[9],
7285
- metadata: rest[10],
7286
- infer: rest[11],
7287
- reRemember: rest[12],
7288
- async: rest[13]
8116
+ pipelineId: rest[3],
8117
+ content: rest[4],
8118
+ messages: rest[5],
8119
+ media: rest[6],
8120
+ agentId: rest[7],
8121
+ runId: rest[8],
8122
+ sessionId: rest[9],
8123
+ sensitivity: rest[10],
8124
+ handlingPolicy: rest[11],
8125
+ metadata: rest[12],
8126
+ sourceContext: rest[13],
8127
+ infer: rest[14],
8128
+ reRemember: rest[15],
8129
+ async: rest[16]
7289
8130
  };
7290
8131
  }
7291
8132
  const userId = params.userId;
7292
8133
  const scope = params.scope;
7293
8134
  const memoryType = params.memoryType;
7294
8135
  const recordKind = params.recordKind;
8136
+ const pipelineId = params.pipelineId;
7295
8137
  const content = params.content;
7296
8138
  const messages = params.messages;
8139
+ const media = params.media;
7297
8140
  const agentId = params.agentId;
7298
8141
  const runId = params.runId;
7299
8142
  const sessionId = params.sessionId;
7300
8143
  const sensitivity = params.sensitivity;
7301
8144
  const handlingPolicy = params.handlingPolicy;
7302
8145
  const metadata = params.metadata;
8146
+ const sourceContext = params.sourceContext;
7303
8147
  const infer = params.infer;
7304
8148
  const reRemember = params.reRemember;
7305
8149
  const async = params.async;
@@ -7317,12 +8161,18 @@ class Memory {
7317
8161
  }
7318
8162
  const apiPath = '/memory/memories';
7319
8163
  const payload = {};
8164
+ if (typeof pipelineId !== 'undefined') {
8165
+ payload['pipelineId'] = pipelineId;
8166
+ }
7320
8167
  if (typeof content !== 'undefined') {
7321
8168
  payload['content'] = content;
7322
8169
  }
7323
8170
  if (typeof messages !== 'undefined') {
7324
8171
  payload['messages'] = messages;
7325
8172
  }
8173
+ if (typeof media !== 'undefined') {
8174
+ payload['media'] = media;
8175
+ }
7326
8176
  if (typeof userId !== 'undefined') {
7327
8177
  payload['userId'] = userId;
7328
8178
  }
@@ -7353,6 +8203,9 @@ class Memory {
7353
8203
  if (typeof metadata !== 'undefined') {
7354
8204
  payload['metadata'] = metadata;
7355
8205
  }
8206
+ if (typeof sourceContext !== 'undefined') {
8207
+ payload['sourceContext'] = sourceContext;
8208
+ }
7356
8209
  if (typeof infer !== 'undefined') {
7357
8210
  payload['infer'] = infer;
7358
8211
  }
@@ -7377,12 +8230,14 @@ class Memory {
7377
8230
  else {
7378
8231
  params = {
7379
8232
  userId: paramsOrFirst,
7380
- limit: rest[0],
7381
- reason: rest[1],
7382
- source: rest[2]
8233
+ memorySubStoreId: rest[0],
8234
+ limit: rest[1],
8235
+ reason: rest[2],
8236
+ source: rest[3]
7383
8237
  };
7384
8238
  }
7385
8239
  const userId = params.userId;
8240
+ const memorySubStoreId = params.memorySubStoreId;
7386
8241
  const limit = params.limit;
7387
8242
  const reason = params.reason;
7388
8243
  const source = params.source;
@@ -7391,6 +8246,9 @@ class Memory {
7391
8246
  if (typeof userId !== 'undefined') {
7392
8247
  payload['userId'] = userId;
7393
8248
  }
8249
+ if (typeof memorySubStoreId !== 'undefined') {
8250
+ payload['memorySubStoreId'] = memorySubStoreId;
8251
+ }
7394
8252
  if (typeof limit !== 'undefined') {
7395
8253
  payload['limit'] = limit;
7396
8254
  }
@@ -7918,7 +8776,7 @@ class Memory {
7918
8776
  }
7919
8777
  submitDistillation(paramsOrFirst, ...rest) {
7920
8778
  let params;
7921
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('scope' in paramsOrFirst || 'userId' in paramsOrFirst || 'agentId' in paramsOrFirst || 'sessionId' in paramsOrFirst || 'runId' in paramsOrFirst || 'memorySubStoreId' in paramsOrFirst || 'sourceId' in paramsOrFirst || 'sourceType' in paramsOrFirst || 'messages' in paramsOrFirst || 'toolEvents' in paramsOrFirst || 'mode' in paramsOrFirst || 'idempotencyKey' in paramsOrFirst))) {
8779
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('scope' in paramsOrFirst || 'userId' in paramsOrFirst || 'agentId' in paramsOrFirst || 'sessionId' in paramsOrFirst || 'runId' in paramsOrFirst || 'memorySubStoreId' in paramsOrFirst || 'pipelineId' in paramsOrFirst || 'sourceId' in paramsOrFirst || 'sourceType' in paramsOrFirst || 'messages' in paramsOrFirst || 'toolEvents' in paramsOrFirst || 'mode' in paramsOrFirst || 'idempotencyKey' in paramsOrFirst))) {
7922
8780
  params = (paramsOrFirst || {});
7923
8781
  }
7924
8782
  else {
@@ -7929,12 +8787,13 @@ class Memory {
7929
8787
  sessionId: rest[2],
7930
8788
  runId: rest[3],
7931
8789
  memorySubStoreId: rest[4],
7932
- sourceId: rest[5],
7933
- sourceType: rest[6],
7934
- messages: rest[7],
7935
- toolEvents: rest[8],
7936
- mode: rest[9],
7937
- idempotencyKey: rest[10]
8790
+ pipelineId: rest[5],
8791
+ sourceId: rest[6],
8792
+ sourceType: rest[7],
8793
+ messages: rest[8],
8794
+ toolEvents: rest[9],
8795
+ mode: rest[10],
8796
+ idempotencyKey: rest[11]
7938
8797
  };
7939
8798
  }
7940
8799
  const scope = params.scope;
@@ -7943,6 +8802,7 @@ class Memory {
7943
8802
  const sessionId = params.sessionId;
7944
8803
  const runId = params.runId;
7945
8804
  const memorySubStoreId = params.memorySubStoreId;
8805
+ const pipelineId = params.pipelineId;
7946
8806
  const sourceId = params.sourceId;
7947
8807
  const sourceType = params.sourceType;
7948
8808
  const messages = params.messages;
@@ -7969,6 +8829,9 @@ class Memory {
7969
8829
  if (typeof memorySubStoreId !== 'undefined') {
7970
8830
  payload['memorySubStoreId'] = memorySubStoreId;
7971
8831
  }
8832
+ if (typeof pipelineId !== 'undefined') {
8833
+ payload['pipelineId'] = pipelineId;
8834
+ }
7972
8835
  if (typeof sourceId !== 'undefined') {
7973
8836
  payload['sourceId'] = sourceId;
7974
8837
  }
@@ -8562,13 +9425,15 @@ class Memory {
8562
9425
  else {
8563
9426
  params = {
8564
9427
  userId: paramsOrFirst,
8565
- format: rest[0],
8566
- data: rest[1],
8567
- records: rest[2],
8568
- dryRun: rest[3]
9428
+ pipelineId: rest[0],
9429
+ format: rest[1],
9430
+ data: rest[2],
9431
+ records: rest[3],
9432
+ dryRun: rest[4]
8569
9433
  };
8570
9434
  }
8571
9435
  const userId = params.userId;
9436
+ const pipelineId = params.pipelineId;
8572
9437
  const format = params.format;
8573
9438
  const data = params.data;
8574
9439
  const records = params.records;
@@ -8578,6 +9443,9 @@ class Memory {
8578
9443
  }
8579
9444
  const apiPath = '/memory/memories/imports';
8580
9445
  const payload = {};
9446
+ if (typeof pipelineId !== 'undefined') {
9447
+ payload['pipelineId'] = pipelineId;
9448
+ }
8581
9449
  if (typeof userId !== 'undefined') {
8582
9450
  payload['userId'] = userId;
8583
9451
  }
@@ -8622,42 +9490,36 @@ class Memory {
8622
9490
  };
8623
9491
  return this.client.call('get', uri, apiHeaders, payload);
8624
9492
  }
8625
- updateKnowledge(paramsOrFirst, ...rest) {
9493
+ listKnowledgeReviews(paramsOrFirst, ...rest) {
8626
9494
  let params;
8627
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9495
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('scope' in paramsOrFirst || 'userId' in paramsOrFirst || 'agentId' in paramsOrFirst || 'sessionId' in paramsOrFirst || 'runId' in paramsOrFirst || 'memorySubStoreId' in paramsOrFirst || 'limit' in paramsOrFirst || 'offset' in paramsOrFirst || 'status' in paramsOrFirst || 'knowledgeId' in paramsOrFirst))) {
8628
9496
  params = (paramsOrFirst || {});
8629
9497
  }
8630
9498
  else {
8631
9499
  params = {
8632
- knowledgeId: paramsOrFirst,
8633
- expectedVersion: rest[0],
8634
- scope: rest[1],
8635
- userId: rest[2],
8636
- agentId: rest[3],
8637
- sessionId: rest[4],
8638
- runId: rest[5],
8639
- memorySubStoreId: rest[6],
9500
+ scope: paramsOrFirst,
9501
+ userId: rest[0],
9502
+ agentId: rest[1],
9503
+ sessionId: rest[2],
9504
+ runId: rest[3],
9505
+ memorySubStoreId: rest[4],
9506
+ limit: rest[5],
9507
+ offset: rest[6],
8640
9508
  status: rest[7],
8641
- validationStatus: rest[8]
9509
+ knowledgeId: rest[8]
8642
9510
  };
8643
9511
  }
8644
- const knowledgeId = params.knowledgeId;
8645
- const expectedVersion = params.expectedVersion;
8646
9512
  const scope = params.scope;
8647
9513
  const userId = params.userId;
8648
9514
  const agentId = params.agentId;
8649
9515
  const sessionId = params.sessionId;
8650
9516
  const runId = params.runId;
8651
9517
  const memorySubStoreId = params.memorySubStoreId;
9518
+ const limit = params.limit;
9519
+ const offset = params.offset;
8652
9520
  const status = params.status;
8653
- const validationStatus = params.validationStatus;
8654
- if (typeof knowledgeId === 'undefined') {
8655
- throw new AgentbaseException('Missing required parameter: "knowledgeId"');
8656
- }
8657
- if (typeof expectedVersion === 'undefined') {
8658
- throw new AgentbaseException('Missing required parameter: "expectedVersion"');
8659
- }
8660
- const apiPath = '/memory/memories/knowledge/{knowledgeId}'.replace('{knowledgeId}', knowledgeId);
9521
+ const knowledgeId = params.knowledgeId;
9522
+ const apiPath = '/memory/memories/knowledge/reviews';
8661
9523
  const payload = {};
8662
9524
  if (typeof scope !== 'undefined') {
8663
9525
  payload['scope'] = scope;
@@ -8677,39 +9539,93 @@ class Memory {
8677
9539
  if (typeof memorySubStoreId !== 'undefined') {
8678
9540
  payload['memorySubStoreId'] = memorySubStoreId;
8679
9541
  }
8680
- if (typeof expectedVersion !== 'undefined') {
8681
- payload['expectedVersion'] = expectedVersion;
9542
+ if (typeof limit !== 'undefined') {
9543
+ payload['limit'] = limit;
9544
+ }
9545
+ if (typeof offset !== 'undefined') {
9546
+ payload['offset'] = offset;
8682
9547
  }
8683
9548
  if (typeof status !== 'undefined') {
8684
9549
  payload['status'] = status;
8685
9550
  }
8686
- if (typeof validationStatus !== 'undefined') {
8687
- payload['validationStatus'] = validationStatus;
9551
+ if (typeof knowledgeId !== 'undefined') {
9552
+ payload['knowledgeId'] = knowledgeId;
8688
9553
  }
8689
9554
  const uri = new URL(this.client.config.endpoint + apiPath);
8690
9555
  const apiHeaders = {
8691
9556
  'X-Appwrite-Project': this.client.config.project,
8692
- 'content-type': 'application/json',
8693
9557
  };
8694
- return this.client.call('patch', uri, apiHeaders, payload);
9558
+ return this.client.call('get', uri, apiHeaders, payload);
8695
9559
  }
8696
- forgetKnowledge(paramsOrFirst, ...rest) {
9560
+ getKnowledgeReview(paramsOrFirst, ...rest) {
8697
9561
  let params;
8698
9562
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
8699
9563
  params = (paramsOrFirst || {});
8700
9564
  }
8701
9565
  else {
8702
9566
  params = {
8703
- knowledgeId: paramsOrFirst,
8704
- expectedVersion: rest[0],
8705
- scope: rest[1],
8706
- userId: rest[2],
8707
- agentId: rest[3],
8708
- sessionId: rest[4],
8709
- runId: rest[5],
8710
- memorySubStoreId: rest[6],
8711
- reason: rest[7],
8712
- source: rest[8]
9567
+ reviewId: paramsOrFirst,
9568
+ scope: rest[0],
9569
+ userId: rest[1],
9570
+ agentId: rest[2],
9571
+ sessionId: rest[3],
9572
+ runId: rest[4],
9573
+ memorySubStoreId: rest[5]
9574
+ };
9575
+ }
9576
+ const reviewId = params.reviewId;
9577
+ const scope = params.scope;
9578
+ const userId = params.userId;
9579
+ const agentId = params.agentId;
9580
+ const sessionId = params.sessionId;
9581
+ const runId = params.runId;
9582
+ const memorySubStoreId = params.memorySubStoreId;
9583
+ if (typeof reviewId === 'undefined') {
9584
+ throw new AgentbaseException('Missing required parameter: "reviewId"');
9585
+ }
9586
+ const apiPath = '/memory/memories/knowledge/reviews/{reviewId}'.replace('{reviewId}', reviewId);
9587
+ const payload = {};
9588
+ if (typeof scope !== 'undefined') {
9589
+ payload['scope'] = scope;
9590
+ }
9591
+ if (typeof userId !== 'undefined') {
9592
+ payload['userId'] = userId;
9593
+ }
9594
+ if (typeof agentId !== 'undefined') {
9595
+ payload['agentId'] = agentId;
9596
+ }
9597
+ if (typeof sessionId !== 'undefined') {
9598
+ payload['sessionId'] = sessionId;
9599
+ }
9600
+ if (typeof runId !== 'undefined') {
9601
+ payload['runId'] = runId;
9602
+ }
9603
+ if (typeof memorySubStoreId !== 'undefined') {
9604
+ payload['memorySubStoreId'] = memorySubStoreId;
9605
+ }
9606
+ const uri = new URL(this.client.config.endpoint + apiPath);
9607
+ const apiHeaders = {
9608
+ 'X-Appwrite-Project': this.client.config.project,
9609
+ };
9610
+ return this.client.call('get', uri, apiHeaders, payload);
9611
+ }
9612
+ updateKnowledge(paramsOrFirst, ...rest) {
9613
+ let params;
9614
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9615
+ params = (paramsOrFirst || {});
9616
+ }
9617
+ else {
9618
+ params = {
9619
+ knowledgeId: paramsOrFirst,
9620
+ expectedVersion: rest[0],
9621
+ scope: rest[1],
9622
+ userId: rest[2],
9623
+ agentId: rest[3],
9624
+ sessionId: rest[4],
9625
+ runId: rest[5],
9626
+ memorySubStoreId: rest[6],
9627
+ status: rest[7],
9628
+ validationStatus: rest[8]
8713
9629
  };
8714
9630
  }
8715
9631
  const knowledgeId = params.knowledgeId;
@@ -8720,8 +9636,8 @@ class Memory {
8720
9636
  const sessionId = params.sessionId;
8721
9637
  const runId = params.runId;
8722
9638
  const memorySubStoreId = params.memorySubStoreId;
8723
- const reason = params.reason;
8724
- const source = params.source;
9639
+ const status = params.status;
9640
+ const validationStatus = params.validationStatus;
8725
9641
  if (typeof knowledgeId === 'undefined') {
8726
9642
  throw new AgentbaseException('Missing required parameter: "knowledgeId"');
8727
9643
  }
@@ -8751,20 +9667,20 @@ class Memory {
8751
9667
  if (typeof expectedVersion !== 'undefined') {
8752
9668
  payload['expectedVersion'] = expectedVersion;
8753
9669
  }
8754
- if (typeof reason !== 'undefined') {
8755
- payload['reason'] = reason;
9670
+ if (typeof status !== 'undefined') {
9671
+ payload['status'] = status;
8756
9672
  }
8757
- if (typeof source !== 'undefined') {
8758
- payload['source'] = source;
9673
+ if (typeof validationStatus !== 'undefined') {
9674
+ payload['validationStatus'] = validationStatus;
8759
9675
  }
8760
9676
  const uri = new URL(this.client.config.endpoint + apiPath);
8761
9677
  const apiHeaders = {
8762
9678
  'X-Appwrite-Project': this.client.config.project,
8763
9679
  'content-type': 'application/json',
8764
9680
  };
8765
- return this.client.call('delete', uri, apiHeaders, payload);
9681
+ return this.client.call('patch', uri, apiHeaders, payload);
8766
9682
  }
8767
- createKnowledgeObservation(paramsOrFirst, ...rest) {
9683
+ forgetKnowledge(paramsOrFirst, ...rest) {
8768
9684
  let params;
8769
9685
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
8770
9686
  params = (paramsOrFirst || {});
@@ -8772,60 +9688,34 @@ class Memory {
8772
9688
  else {
8773
9689
  params = {
8774
9690
  knowledgeId: paramsOrFirst,
8775
- revision: rest[0],
8776
- outcome: rest[1],
8777
- evidence: rest[2],
8778
- scope: rest[3],
8779
- userId: rest[4],
8780
- agentId: rest[5],
8781
- sessionId: rest[6],
8782
- runId: rest[7],
8783
- memorySubStoreId: rest[8],
8784
- sourceId: rest[9],
8785
- injectionId: rest[10],
8786
- verificationSource: rest[11],
8787
- toolName: rest[12],
8788
- toolVersion: rest[13],
8789
- toolSchemaVersion: rest[14],
8790
- errorFingerprint: rest[15],
8791
- weight: rest[16],
8792
- observedAt: rest[17],
8793
- idempotencyKey: rest[18]
9691
+ expectedVersion: rest[0],
9692
+ scope: rest[1],
9693
+ userId: rest[2],
9694
+ agentId: rest[3],
9695
+ sessionId: rest[4],
9696
+ runId: rest[5],
9697
+ memorySubStoreId: rest[6],
9698
+ reason: rest[7],
9699
+ source: rest[8]
8794
9700
  };
8795
9701
  }
8796
9702
  const knowledgeId = params.knowledgeId;
8797
- const revision = params.revision;
8798
- const outcome = params.outcome;
8799
- const evidence = params.evidence;
9703
+ const expectedVersion = params.expectedVersion;
8800
9704
  const scope = params.scope;
8801
9705
  const userId = params.userId;
8802
9706
  const agentId = params.agentId;
8803
9707
  const sessionId = params.sessionId;
8804
9708
  const runId = params.runId;
8805
9709
  const memorySubStoreId = params.memorySubStoreId;
8806
- const sourceId = params.sourceId;
8807
- const injectionId = params.injectionId;
8808
- const verificationSource = params.verificationSource;
8809
- const toolName = params.toolName;
8810
- const toolVersion = params.toolVersion;
8811
- const toolSchemaVersion = params.toolSchemaVersion;
8812
- const errorFingerprint = params.errorFingerprint;
8813
- const weight = params.weight;
8814
- const observedAt = params.observedAt;
8815
- const idempotencyKey = params.idempotencyKey;
9710
+ const reason = params.reason;
9711
+ const source = params.source;
8816
9712
  if (typeof knowledgeId === 'undefined') {
8817
9713
  throw new AgentbaseException('Missing required parameter: "knowledgeId"');
8818
9714
  }
8819
- if (typeof revision === 'undefined') {
8820
- throw new AgentbaseException('Missing required parameter: "revision"');
8821
- }
8822
- if (typeof outcome === 'undefined') {
8823
- throw new AgentbaseException('Missing required parameter: "outcome"');
8824
- }
8825
- if (typeof evidence === 'undefined') {
8826
- throw new AgentbaseException('Missing required parameter: "evidence"');
9715
+ if (typeof expectedVersion === 'undefined') {
9716
+ throw new AgentbaseException('Missing required parameter: "expectedVersion"');
8827
9717
  }
8828
- const apiPath = '/memory/memories/observations';
9718
+ const apiPath = '/memory/memories/knowledge/{knowledgeId}'.replace('{knowledgeId}', knowledgeId);
8829
9719
  const payload = {};
8830
9720
  if (typeof scope !== 'undefined') {
8831
9721
  payload['scope'] = scope;
@@ -8845,107 +9735,114 @@ class Memory {
8845
9735
  if (typeof memorySubStoreId !== 'undefined') {
8846
9736
  payload['memorySubStoreId'] = memorySubStoreId;
8847
9737
  }
8848
- if (typeof knowledgeId !== 'undefined') {
8849
- payload['knowledgeId'] = knowledgeId;
9738
+ if (typeof expectedVersion !== 'undefined') {
9739
+ payload['expectedVersion'] = expectedVersion;
8850
9740
  }
8851
- if (typeof revision !== 'undefined') {
8852
- payload['revision'] = revision;
9741
+ if (typeof reason !== 'undefined') {
9742
+ payload['reason'] = reason;
8853
9743
  }
8854
- if (typeof sourceId !== 'undefined') {
8855
- payload['sourceId'] = sourceId;
9744
+ if (typeof source !== 'undefined') {
9745
+ payload['source'] = source;
8856
9746
  }
8857
- if (typeof injectionId !== 'undefined') {
8858
- payload['injectionId'] = injectionId;
9747
+ const uri = new URL(this.client.config.endpoint + apiPath);
9748
+ const apiHeaders = {
9749
+ 'X-Appwrite-Project': this.client.config.project,
9750
+ 'content-type': 'application/json',
9751
+ };
9752
+ return this.client.call('delete', uri, apiHeaders, payload);
9753
+ }
9754
+ getKnowledgeDiff(paramsOrFirst, ...rest) {
9755
+ let params;
9756
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9757
+ params = (paramsOrFirst || {});
8859
9758
  }
8860
- if (typeof outcome !== 'undefined') {
8861
- payload['outcome'] = outcome;
9759
+ else {
9760
+ params = {
9761
+ knowledgeId: paramsOrFirst,
9762
+ toRevisionId: rest[0],
9763
+ scope: rest[1],
9764
+ userId: rest[2],
9765
+ agentId: rest[3],
9766
+ sessionId: rest[4],
9767
+ runId: rest[5],
9768
+ memorySubStoreId: rest[6],
9769
+ fromRevisionId: rest[7]
9770
+ };
8862
9771
  }
8863
- if (typeof verificationSource !== 'undefined') {
8864
- payload['verificationSource'] = verificationSource;
9772
+ const knowledgeId = params.knowledgeId;
9773
+ const toRevisionId = params.toRevisionId;
9774
+ const scope = params.scope;
9775
+ const userId = params.userId;
9776
+ const agentId = params.agentId;
9777
+ const sessionId = params.sessionId;
9778
+ const runId = params.runId;
9779
+ const memorySubStoreId = params.memorySubStoreId;
9780
+ const fromRevisionId = params.fromRevisionId;
9781
+ if (typeof knowledgeId === 'undefined') {
9782
+ throw new AgentbaseException('Missing required parameter: "knowledgeId"');
8865
9783
  }
8866
- if (typeof toolName !== 'undefined') {
8867
- payload['toolName'] = toolName;
9784
+ if (typeof toRevisionId === 'undefined') {
9785
+ throw new AgentbaseException('Missing required parameter: "toRevisionId"');
8868
9786
  }
8869
- if (typeof toolVersion !== 'undefined') {
8870
- payload['toolVersion'] = toolVersion;
9787
+ const apiPath = '/memory/memories/knowledge/{knowledgeId}/diff'.replace('{knowledgeId}', knowledgeId);
9788
+ const payload = {};
9789
+ if (typeof scope !== 'undefined') {
9790
+ payload['scope'] = scope;
8871
9791
  }
8872
- if (typeof toolSchemaVersion !== 'undefined') {
8873
- payload['toolSchemaVersion'] = toolSchemaVersion;
9792
+ if (typeof userId !== 'undefined') {
9793
+ payload['userId'] = userId;
8874
9794
  }
8875
- if (typeof errorFingerprint !== 'undefined') {
8876
- payload['errorFingerprint'] = errorFingerprint;
9795
+ if (typeof agentId !== 'undefined') {
9796
+ payload['agentId'] = agentId;
8877
9797
  }
8878
- if (typeof evidence !== 'undefined') {
8879
- payload['evidence'] = evidence;
9798
+ if (typeof sessionId !== 'undefined') {
9799
+ payload['sessionId'] = sessionId;
8880
9800
  }
8881
- if (typeof weight !== 'undefined') {
8882
- payload['weight'] = weight;
9801
+ if (typeof runId !== 'undefined') {
9802
+ payload['runId'] = runId;
8883
9803
  }
8884
- if (typeof observedAt !== 'undefined') {
8885
- payload['observedAt'] = observedAt;
9804
+ if (typeof memorySubStoreId !== 'undefined') {
9805
+ payload['memorySubStoreId'] = memorySubStoreId;
8886
9806
  }
8887
- if (typeof idempotencyKey !== 'undefined') {
8888
- payload['idempotencyKey'] = idempotencyKey;
9807
+ if (typeof fromRevisionId !== 'undefined') {
9808
+ payload['fromRevisionId'] = fromRevisionId;
9809
+ }
9810
+ if (typeof toRevisionId !== 'undefined') {
9811
+ payload['toRevisionId'] = toRevisionId;
8889
9812
  }
8890
- const uri = new URL(this.client.config.endpoint + apiPath);
8891
- const apiHeaders = {
8892
- 'X-Appwrite-Project': this.client.config.project,
8893
- 'content-type': 'application/json',
8894
- };
8895
- return this.client.call('post', uri, apiHeaders, payload);
8896
- }
8897
- /**
8898
- * Get a memory quality report.
8899
- *
8900
- * @throws {AgentbaseException}
8901
- * @returns {Promise<{}>}
8902
- */
8903
- getQuality() {
8904
- const apiPath = '/memory/memories/quality';
8905
- const payload = {};
8906
9813
  const uri = new URL(this.client.config.endpoint + apiPath);
8907
9814
  const apiHeaders = {
8908
9815
  'X-Appwrite-Project': this.client.config.project,
8909
9816
  };
8910
9817
  return this.client.call('get', uri, apiHeaders, payload);
8911
9818
  }
8912
- recallKnowledge(paramsOrFirst, ...rest) {
9819
+ listKnowledgeEvents(paramsOrFirst, ...rest) {
8913
9820
  let params;
8914
9821
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
8915
9822
  params = (paramsOrFirst || {});
8916
9823
  }
8917
9824
  else {
8918
9825
  params = {
8919
- query: paramsOrFirst,
9826
+ knowledgeId: paramsOrFirst,
8920
9827
  scope: rest[0],
8921
9828
  userId: rest[1],
8922
9829
  agentId: rest[2],
8923
9830
  sessionId: rest[3],
8924
9831
  runId: rest[4],
8925
- memorySubStoreId: rest[5],
8926
- kinds: rest[6],
8927
- limit: rest[7],
8928
- tokenBudget: rest[8],
8929
- retrieval: rest[9],
8930
- accessMode: rest[10]
9832
+ memorySubStoreId: rest[5]
8931
9833
  };
8932
9834
  }
8933
- const query = params.query;
9835
+ const knowledgeId = params.knowledgeId;
8934
9836
  const scope = params.scope;
8935
9837
  const userId = params.userId;
8936
9838
  const agentId = params.agentId;
8937
9839
  const sessionId = params.sessionId;
8938
9840
  const runId = params.runId;
8939
9841
  const memorySubStoreId = params.memorySubStoreId;
8940
- const kinds = params.kinds;
8941
- const limit = params.limit;
8942
- const tokenBudget = params.tokenBudget;
8943
- const retrieval = params.retrieval;
8944
- const accessMode = params.accessMode;
8945
- if (typeof query === 'undefined') {
8946
- throw new AgentbaseException('Missing required parameter: "query"');
9842
+ if (typeof knowledgeId === 'undefined') {
9843
+ throw new AgentbaseException('Missing required parameter: "knowledgeId"');
8947
9844
  }
8948
- const apiPath = '/memory/memories/recall';
9845
+ const apiPath = '/memory/memories/knowledge/{knowledgeId}/events'.replace('{knowledgeId}', knowledgeId);
8949
9846
  const payload = {};
8950
9847
  if (typeof scope !== 'undefined') {
8951
9848
  payload['scope'] = scope;
@@ -8965,87 +9862,139 @@ class Memory {
8965
9862
  if (typeof memorySubStoreId !== 'undefined') {
8966
9863
  payload['memorySubStoreId'] = memorySubStoreId;
8967
9864
  }
8968
- if (typeof query !== 'undefined') {
8969
- payload['query'] = query;
9865
+ const uri = new URL(this.client.config.endpoint + apiPath);
9866
+ const apiHeaders = {
9867
+ 'X-Appwrite-Project': this.client.config.project,
9868
+ };
9869
+ return this.client.call('get', uri, apiHeaders, payload);
9870
+ }
9871
+ listKnowledgeRevisions(paramsOrFirst, ...rest) {
9872
+ let params;
9873
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9874
+ params = (paramsOrFirst || {});
8970
9875
  }
8971
- if (typeof kinds !== 'undefined') {
8972
- payload['kinds'] = kinds;
9876
+ else {
9877
+ params = {
9878
+ knowledgeId: paramsOrFirst,
9879
+ scope: rest[0],
9880
+ userId: rest[1],
9881
+ agentId: rest[2],
9882
+ sessionId: rest[3],
9883
+ runId: rest[4],
9884
+ memorySubStoreId: rest[5],
9885
+ limit: rest[6],
9886
+ offset: rest[7]
9887
+ };
8973
9888
  }
8974
- if (typeof limit !== 'undefined') {
8975
- payload['limit'] = limit;
9889
+ const knowledgeId = params.knowledgeId;
9890
+ const scope = params.scope;
9891
+ const userId = params.userId;
9892
+ const agentId = params.agentId;
9893
+ const sessionId = params.sessionId;
9894
+ const runId = params.runId;
9895
+ const memorySubStoreId = params.memorySubStoreId;
9896
+ const limit = params.limit;
9897
+ const offset = params.offset;
9898
+ if (typeof knowledgeId === 'undefined') {
9899
+ throw new AgentbaseException('Missing required parameter: "knowledgeId"');
8976
9900
  }
8977
- if (typeof tokenBudget !== 'undefined') {
8978
- payload['tokenBudget'] = tokenBudget;
9901
+ const apiPath = '/memory/memories/knowledge/{knowledgeId}/revisions'.replace('{knowledgeId}', knowledgeId);
9902
+ const payload = {};
9903
+ if (typeof scope !== 'undefined') {
9904
+ payload['scope'] = scope;
8979
9905
  }
8980
- if (typeof retrieval !== 'undefined') {
8981
- payload['retrieval'] = retrieval;
9906
+ if (typeof userId !== 'undefined') {
9907
+ payload['userId'] = userId;
8982
9908
  }
8983
- if (typeof accessMode !== 'undefined') {
8984
- payload['accessMode'] = accessMode;
9909
+ if (typeof agentId !== 'undefined') {
9910
+ payload['agentId'] = agentId;
9911
+ }
9912
+ if (typeof sessionId !== 'undefined') {
9913
+ payload['sessionId'] = sessionId;
9914
+ }
9915
+ if (typeof runId !== 'undefined') {
9916
+ payload['runId'] = runId;
9917
+ }
9918
+ if (typeof memorySubStoreId !== 'undefined') {
9919
+ payload['memorySubStoreId'] = memorySubStoreId;
9920
+ }
9921
+ if (typeof limit !== 'undefined') {
9922
+ payload['limit'] = limit;
9923
+ }
9924
+ if (typeof offset !== 'undefined') {
9925
+ payload['offset'] = offset;
8985
9926
  }
8986
9927
  const uri = new URL(this.client.config.endpoint + apiPath);
8987
9928
  const apiHeaders = {
8988
9929
  'X-Appwrite-Project': this.client.config.project,
8989
- 'content-type': 'application/json',
8990
9930
  };
8991
- return this.client.call('post', uri, apiHeaders, payload);
9931
+ return this.client.call('get', uri, apiHeaders, payload);
8992
9932
  }
8993
- search(paramsOrFirst, ...rest) {
9933
+ createKnowledgeObservation(paramsOrFirst, ...rest) {
8994
9934
  let params;
8995
9935
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
8996
9936
  params = (paramsOrFirst || {});
8997
9937
  }
8998
9938
  else {
8999
9939
  params = {
9000
- query: paramsOrFirst,
9001
- searchMode: rest[0],
9002
- retrieval: rest[1],
9003
- userId: rest[2],
9004
- agentId: rest[3],
9005
- runId: rest[4],
9006
- scope: rest[5],
9007
- memoryType: rest[6],
9008
- recordKind: rest[7],
9009
- filter: rest[8],
9010
- limit: rest[9],
9011
- cursor: rest[10],
9012
- sort: rest[11],
9013
- memorySubStoreId: rest[12],
9014
- sessionId: rest[13],
9015
- groupId: rest[14],
9016
- accessMode: rest[15]
9940
+ knowledgeId: paramsOrFirst,
9941
+ revision: rest[0],
9942
+ outcome: rest[1],
9943
+ evidence: rest[2],
9944
+ scope: rest[3],
9945
+ userId: rest[4],
9946
+ agentId: rest[5],
9947
+ sessionId: rest[6],
9948
+ runId: rest[7],
9949
+ memorySubStoreId: rest[8],
9950
+ sourceId: rest[9],
9951
+ injectionId: rest[10],
9952
+ verificationSource: rest[11],
9953
+ toolName: rest[12],
9954
+ toolVersion: rest[13],
9955
+ toolSchemaVersion: rest[14],
9956
+ errorFingerprint: rest[15],
9957
+ weight: rest[16],
9958
+ observedAt: rest[17],
9959
+ idempotencyKey: rest[18]
9017
9960
  };
9018
9961
  }
9019
- const query = params.query;
9020
- const searchMode = params.searchMode;
9021
- const retrieval = params.retrieval;
9962
+ const knowledgeId = params.knowledgeId;
9963
+ const revision = params.revision;
9964
+ const outcome = params.outcome;
9965
+ const evidence = params.evidence;
9966
+ const scope = params.scope;
9022
9967
  const userId = params.userId;
9023
9968
  const agentId = params.agentId;
9969
+ const sessionId = params.sessionId;
9024
9970
  const runId = params.runId;
9025
- const scope = params.scope;
9026
- const memoryType = params.memoryType;
9027
- const recordKind = params.recordKind;
9028
- const filter = params.filter;
9029
- const limit = params.limit;
9030
- const cursor = params.cursor;
9031
- const sort = params.sort;
9032
9971
  const memorySubStoreId = params.memorySubStoreId;
9033
- const sessionId = params.sessionId;
9034
- const groupId = params.groupId;
9035
- const accessMode = params.accessMode;
9036
- if (typeof query === 'undefined') {
9037
- throw new AgentbaseException('Missing required parameter: "query"');
9972
+ const sourceId = params.sourceId;
9973
+ const injectionId = params.injectionId;
9974
+ const verificationSource = params.verificationSource;
9975
+ const toolName = params.toolName;
9976
+ const toolVersion = params.toolVersion;
9977
+ const toolSchemaVersion = params.toolSchemaVersion;
9978
+ const errorFingerprint = params.errorFingerprint;
9979
+ const weight = params.weight;
9980
+ const observedAt = params.observedAt;
9981
+ const idempotencyKey = params.idempotencyKey;
9982
+ if (typeof knowledgeId === 'undefined') {
9983
+ throw new AgentbaseException('Missing required parameter: "knowledgeId"');
9038
9984
  }
9039
- const apiPath = '/memory/memories/search';
9040
- const payload = {};
9041
- if (typeof query !== 'undefined') {
9042
- payload['query'] = query;
9985
+ if (typeof revision === 'undefined') {
9986
+ throw new AgentbaseException('Missing required parameter: "revision"');
9043
9987
  }
9044
- if (typeof searchMode !== 'undefined') {
9045
- payload['searchMode'] = searchMode;
9988
+ if (typeof outcome === 'undefined') {
9989
+ throw new AgentbaseException('Missing required parameter: "outcome"');
9046
9990
  }
9047
- if (typeof retrieval !== 'undefined') {
9048
- payload['retrieval'] = retrieval;
9991
+ if (typeof evidence === 'undefined') {
9992
+ throw new AgentbaseException('Missing required parameter: "evidence"');
9993
+ }
9994
+ const apiPath = '/memory/memories/observations';
9995
+ const payload = {};
9996
+ if (typeof scope !== 'undefined') {
9997
+ payload['scope'] = scope;
9049
9998
  }
9050
9999
  if (typeof userId !== 'undefined') {
9051
10000
  payload['userId'] = userId;
@@ -9053,41 +10002,56 @@ class Memory {
9053
10002
  if (typeof agentId !== 'undefined') {
9054
10003
  payload['agentId'] = agentId;
9055
10004
  }
10005
+ if (typeof sessionId !== 'undefined') {
10006
+ payload['sessionId'] = sessionId;
10007
+ }
9056
10008
  if (typeof runId !== 'undefined') {
9057
10009
  payload['runId'] = runId;
9058
10010
  }
9059
- if (typeof scope !== 'undefined') {
9060
- payload['scope'] = scope;
10011
+ if (typeof memorySubStoreId !== 'undefined') {
10012
+ payload['memorySubStoreId'] = memorySubStoreId;
9061
10013
  }
9062
- if (typeof memoryType !== 'undefined') {
9063
- payload['memoryType'] = memoryType;
10014
+ if (typeof knowledgeId !== 'undefined') {
10015
+ payload['knowledgeId'] = knowledgeId;
9064
10016
  }
9065
- if (typeof recordKind !== 'undefined') {
9066
- payload['recordKind'] = recordKind;
10017
+ if (typeof revision !== 'undefined') {
10018
+ payload['revision'] = revision;
9067
10019
  }
9068
- if (typeof filter !== 'undefined') {
9069
- payload['filter'] = filter;
10020
+ if (typeof sourceId !== 'undefined') {
10021
+ payload['sourceId'] = sourceId;
9070
10022
  }
9071
- if (typeof limit !== 'undefined') {
9072
- payload['limit'] = limit;
10023
+ if (typeof injectionId !== 'undefined') {
10024
+ payload['injectionId'] = injectionId;
9073
10025
  }
9074
- if (typeof cursor !== 'undefined') {
9075
- payload['cursor'] = cursor;
10026
+ if (typeof outcome !== 'undefined') {
10027
+ payload['outcome'] = outcome;
9076
10028
  }
9077
- if (typeof sort !== 'undefined') {
9078
- payload['sort'] = sort;
10029
+ if (typeof verificationSource !== 'undefined') {
10030
+ payload['verificationSource'] = verificationSource;
9079
10031
  }
9080
- if (typeof memorySubStoreId !== 'undefined') {
9081
- payload['memorySubStoreId'] = memorySubStoreId;
10032
+ if (typeof toolName !== 'undefined') {
10033
+ payload['toolName'] = toolName;
9082
10034
  }
9083
- if (typeof sessionId !== 'undefined') {
9084
- payload['sessionId'] = sessionId;
10035
+ if (typeof toolVersion !== 'undefined') {
10036
+ payload['toolVersion'] = toolVersion;
9085
10037
  }
9086
- if (typeof groupId !== 'undefined') {
9087
- payload['groupId'] = groupId;
10038
+ if (typeof toolSchemaVersion !== 'undefined') {
10039
+ payload['toolSchemaVersion'] = toolSchemaVersion;
9088
10040
  }
9089
- if (typeof accessMode !== 'undefined') {
9090
- payload['accessMode'] = accessMode;
10041
+ if (typeof errorFingerprint !== 'undefined') {
10042
+ payload['errorFingerprint'] = errorFingerprint;
10043
+ }
10044
+ if (typeof evidence !== 'undefined') {
10045
+ payload['evidence'] = evidence;
10046
+ }
10047
+ if (typeof weight !== 'undefined') {
10048
+ payload['weight'] = weight;
10049
+ }
10050
+ if (typeof observedAt !== 'undefined') {
10051
+ payload['observedAt'] = observedAt;
10052
+ }
10053
+ if (typeof idempotencyKey !== 'undefined') {
10054
+ payload['idempotencyKey'] = idempotencyKey;
9091
10055
  }
9092
10056
  const uri = new URL(this.client.config.endpoint + apiPath);
9093
10057
  const apiHeaders = {
@@ -9096,14 +10060,51 @@ class Memory {
9096
10060
  };
9097
10061
  return this.client.call('post', uri, apiHeaders, payload);
9098
10062
  }
10063
+ listProfiles(paramsOrFirst, ...rest) {
10064
+ let params;
10065
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
10066
+ params = (paramsOrFirst || {});
10067
+ }
10068
+ else {
10069
+ params = {
10070
+ cursor: paramsOrFirst,
10071
+ limit: rest[0],
10072
+ userId: rest[1],
10073
+ profileType: rest[2]
10074
+ };
10075
+ }
10076
+ const cursor = params.cursor;
10077
+ const limit = params.limit;
10078
+ const userId = params.userId;
10079
+ const profileType = params.profileType;
10080
+ const apiPath = '/memory/memories/profiles';
10081
+ const payload = {};
10082
+ if (typeof cursor !== 'undefined') {
10083
+ payload['cursor'] = cursor;
10084
+ }
10085
+ if (typeof limit !== 'undefined') {
10086
+ payload['limit'] = limit;
10087
+ }
10088
+ if (typeof userId !== 'undefined') {
10089
+ payload['userId'] = userId;
10090
+ }
10091
+ if (typeof profileType !== 'undefined') {
10092
+ payload['profileType'] = profileType;
10093
+ }
10094
+ const uri = new URL(this.client.config.endpoint + apiPath);
10095
+ const apiHeaders = {
10096
+ 'X-Appwrite-Project': this.client.config.project,
10097
+ };
10098
+ return this.client.call('get', uri, apiHeaders, payload);
10099
+ }
9099
10100
  /**
9100
- * Get memory session aggregates.
10101
+ * Get a memory quality report.
9101
10102
  *
9102
10103
  * @throws {AgentbaseException}
9103
10104
  * @returns {Promise<{}>}
9104
10105
  */
9105
- getSessions() {
9106
- const apiPath = '/memory/memories/sessions';
10106
+ getQuality() {
10107
+ const apiPath = '/memory/memories/quality';
9107
10108
  const payload = {};
9108
10109
  const uri = new URL(this.client.config.endpoint + apiPath);
9109
10110
  const apiHeaders = {
@@ -9111,30 +10112,239 @@ class Memory {
9111
10112
  };
9112
10113
  return this.client.call('get', uri, apiHeaders, payload);
9113
10114
  }
9114
- listSkills(paramsOrFirst, ...rest) {
10115
+ recallKnowledge(paramsOrFirst, ...rest) {
9115
10116
  let params;
9116
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('scope' in paramsOrFirst || 'userId' in paramsOrFirst || 'agentId' in paramsOrFirst || 'sessionId' in paramsOrFirst || 'runId' in paramsOrFirst || 'memorySubStoreId' in paramsOrFirst || 'cursor' in paramsOrFirst || 'limit' in paramsOrFirst))) {
10117
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9117
10118
  params = (paramsOrFirst || {});
9118
10119
  }
9119
10120
  else {
9120
10121
  params = {
9121
- scope: paramsOrFirst,
9122
- userId: rest[0],
9123
- agentId: rest[1],
9124
- sessionId: rest[2],
9125
- runId: rest[3],
9126
- memorySubStoreId: rest[4],
9127
- cursor: rest[5],
9128
- limit: rest[6]
9129
- };
9130
- }
9131
- const scope = params.scope;
9132
- const userId = params.userId;
9133
- const agentId = params.agentId;
9134
- const sessionId = params.sessionId;
9135
- const runId = params.runId;
9136
- const memorySubStoreId = params.memorySubStoreId;
9137
- const cursor = params.cursor;
10122
+ query: paramsOrFirst,
10123
+ scope: rest[0],
10124
+ userId: rest[1],
10125
+ agentId: rest[2],
10126
+ sessionId: rest[3],
10127
+ runId: rest[4],
10128
+ memorySubStoreId: rest[5],
10129
+ kinds: rest[6],
10130
+ limit: rest[7],
10131
+ tokenBudget: rest[8],
10132
+ retrieval: rest[9],
10133
+ accessMode: rest[10]
10134
+ };
10135
+ }
10136
+ const query = params.query;
10137
+ const scope = params.scope;
10138
+ const userId = params.userId;
10139
+ const agentId = params.agentId;
10140
+ const sessionId = params.sessionId;
10141
+ const runId = params.runId;
10142
+ const memorySubStoreId = params.memorySubStoreId;
10143
+ const kinds = params.kinds;
10144
+ const limit = params.limit;
10145
+ const tokenBudget = params.tokenBudget;
10146
+ const retrieval = params.retrieval;
10147
+ const accessMode = params.accessMode;
10148
+ if (typeof query === 'undefined') {
10149
+ throw new AgentbaseException('Missing required parameter: "query"');
10150
+ }
10151
+ const apiPath = '/memory/memories/recall';
10152
+ const payload = {};
10153
+ if (typeof scope !== 'undefined') {
10154
+ payload['scope'] = scope;
10155
+ }
10156
+ if (typeof userId !== 'undefined') {
10157
+ payload['userId'] = userId;
10158
+ }
10159
+ if (typeof agentId !== 'undefined') {
10160
+ payload['agentId'] = agentId;
10161
+ }
10162
+ if (typeof sessionId !== 'undefined') {
10163
+ payload['sessionId'] = sessionId;
10164
+ }
10165
+ if (typeof runId !== 'undefined') {
10166
+ payload['runId'] = runId;
10167
+ }
10168
+ if (typeof memorySubStoreId !== 'undefined') {
10169
+ payload['memorySubStoreId'] = memorySubStoreId;
10170
+ }
10171
+ if (typeof query !== 'undefined') {
10172
+ payload['query'] = query;
10173
+ }
10174
+ if (typeof kinds !== 'undefined') {
10175
+ payload['kinds'] = kinds;
10176
+ }
10177
+ if (typeof limit !== 'undefined') {
10178
+ payload['limit'] = limit;
10179
+ }
10180
+ if (typeof tokenBudget !== 'undefined') {
10181
+ payload['tokenBudget'] = tokenBudget;
10182
+ }
10183
+ if (typeof retrieval !== 'undefined') {
10184
+ payload['retrieval'] = retrieval;
10185
+ }
10186
+ if (typeof accessMode !== 'undefined') {
10187
+ payload['accessMode'] = accessMode;
10188
+ }
10189
+ const uri = new URL(this.client.config.endpoint + apiPath);
10190
+ const apiHeaders = {
10191
+ 'X-Appwrite-Project': this.client.config.project,
10192
+ 'content-type': 'application/json',
10193
+ };
10194
+ return this.client.call('post', uri, apiHeaders, payload);
10195
+ }
10196
+ search(paramsOrFirst, ...rest) {
10197
+ let params;
10198
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
10199
+ params = (paramsOrFirst || {});
10200
+ }
10201
+ else {
10202
+ params = {
10203
+ query: paramsOrFirst,
10204
+ searchMode: rest[0],
10205
+ retrieval: rest[1],
10206
+ media: rest[2],
10207
+ userId: rest[3],
10208
+ agentId: rest[4],
10209
+ runId: rest[5],
10210
+ scope: rest[6],
10211
+ memoryType: rest[7],
10212
+ recordKind: rest[8],
10213
+ filter: rest[9],
10214
+ temporal: rest[10],
10215
+ limit: rest[11],
10216
+ cursor: rest[12],
10217
+ sort: rest[13],
10218
+ memorySubStoreId: rest[14],
10219
+ sessionId: rest[15],
10220
+ groupId: rest[16],
10221
+ accessMode: rest[17]
10222
+ };
10223
+ }
10224
+ const query = params.query;
10225
+ const searchMode = params.searchMode;
10226
+ const retrieval = params.retrieval;
10227
+ const media = params.media;
10228
+ const userId = params.userId;
10229
+ const agentId = params.agentId;
10230
+ const runId = params.runId;
10231
+ const scope = params.scope;
10232
+ const memoryType = params.memoryType;
10233
+ const recordKind = params.recordKind;
10234
+ const filter = params.filter;
10235
+ const temporal = params.temporal;
10236
+ const limit = params.limit;
10237
+ const cursor = params.cursor;
10238
+ const sort = params.sort;
10239
+ const memorySubStoreId = params.memorySubStoreId;
10240
+ const sessionId = params.sessionId;
10241
+ const groupId = params.groupId;
10242
+ const accessMode = params.accessMode;
10243
+ const apiPath = '/memory/memories/search';
10244
+ const payload = {};
10245
+ if (typeof query !== 'undefined') {
10246
+ payload['query'] = query;
10247
+ }
10248
+ if (typeof searchMode !== 'undefined') {
10249
+ payload['searchMode'] = searchMode;
10250
+ }
10251
+ if (typeof retrieval !== 'undefined') {
10252
+ payload['retrieval'] = retrieval;
10253
+ }
10254
+ if (typeof media !== 'undefined') {
10255
+ payload['media'] = media;
10256
+ }
10257
+ if (typeof userId !== 'undefined') {
10258
+ payload['userId'] = userId;
10259
+ }
10260
+ if (typeof agentId !== 'undefined') {
10261
+ payload['agentId'] = agentId;
10262
+ }
10263
+ if (typeof runId !== 'undefined') {
10264
+ payload['runId'] = runId;
10265
+ }
10266
+ if (typeof scope !== 'undefined') {
10267
+ payload['scope'] = scope;
10268
+ }
10269
+ if (typeof memoryType !== 'undefined') {
10270
+ payload['memoryType'] = memoryType;
10271
+ }
10272
+ if (typeof recordKind !== 'undefined') {
10273
+ payload['recordKind'] = recordKind;
10274
+ }
10275
+ if (typeof filter !== 'undefined') {
10276
+ payload['filter'] = filter;
10277
+ }
10278
+ if (typeof temporal !== 'undefined') {
10279
+ payload['temporal'] = temporal;
10280
+ }
10281
+ if (typeof limit !== 'undefined') {
10282
+ payload['limit'] = limit;
10283
+ }
10284
+ if (typeof cursor !== 'undefined') {
10285
+ payload['cursor'] = cursor;
10286
+ }
10287
+ if (typeof sort !== 'undefined') {
10288
+ payload['sort'] = sort;
10289
+ }
10290
+ if (typeof memorySubStoreId !== 'undefined') {
10291
+ payload['memorySubStoreId'] = memorySubStoreId;
10292
+ }
10293
+ if (typeof sessionId !== 'undefined') {
10294
+ payload['sessionId'] = sessionId;
10295
+ }
10296
+ if (typeof groupId !== 'undefined') {
10297
+ payload['groupId'] = groupId;
10298
+ }
10299
+ if (typeof accessMode !== 'undefined') {
10300
+ payload['accessMode'] = accessMode;
10301
+ }
10302
+ const uri = new URL(this.client.config.endpoint + apiPath);
10303
+ const apiHeaders = {
10304
+ 'X-Appwrite-Project': this.client.config.project,
10305
+ 'content-type': 'application/json',
10306
+ };
10307
+ return this.client.call('post', uri, apiHeaders, payload);
10308
+ }
10309
+ /**
10310
+ * Get memory session aggregates.
10311
+ *
10312
+ * @throws {AgentbaseException}
10313
+ * @returns {Promise<{}>}
10314
+ */
10315
+ getSessions() {
10316
+ const apiPath = '/memory/memories/sessions';
10317
+ const payload = {};
10318
+ const uri = new URL(this.client.config.endpoint + apiPath);
10319
+ const apiHeaders = {
10320
+ 'X-Appwrite-Project': this.client.config.project,
10321
+ };
10322
+ return this.client.call('get', uri, apiHeaders, payload);
10323
+ }
10324
+ listSkills(paramsOrFirst, ...rest) {
10325
+ let params;
10326
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('scope' in paramsOrFirst || 'userId' in paramsOrFirst || 'agentId' in paramsOrFirst || 'sessionId' in paramsOrFirst || 'runId' in paramsOrFirst || 'memorySubStoreId' in paramsOrFirst || 'cursor' in paramsOrFirst || 'limit' in paramsOrFirst))) {
10327
+ params = (paramsOrFirst || {});
10328
+ }
10329
+ else {
10330
+ params = {
10331
+ scope: paramsOrFirst,
10332
+ userId: rest[0],
10333
+ agentId: rest[1],
10334
+ sessionId: rest[2],
10335
+ runId: rest[3],
10336
+ memorySubStoreId: rest[4],
10337
+ cursor: rest[5],
10338
+ limit: rest[6]
10339
+ };
10340
+ }
10341
+ const scope = params.scope;
10342
+ const userId = params.userId;
10343
+ const agentId = params.agentId;
10344
+ const sessionId = params.sessionId;
10345
+ const runId = params.runId;
10346
+ const memorySubStoreId = params.memorySubStoreId;
10347
+ const cursor = params.cursor;
9138
10348
  const limit = params.limit;
9139
10349
  const apiPath = '/memory/memories/skills';
9140
10350
  const payload = {};
@@ -9156,81 +10366,575 @@ class Memory {
9156
10366
  if (typeof memorySubStoreId !== 'undefined') {
9157
10367
  payload['memorySubStoreId'] = memorySubStoreId;
9158
10368
  }
9159
- if (typeof cursor !== 'undefined') {
9160
- payload['cursor'] = cursor;
10369
+ if (typeof cursor !== 'undefined') {
10370
+ payload['cursor'] = cursor;
10371
+ }
10372
+ if (typeof limit !== 'undefined') {
10373
+ payload['limit'] = limit;
10374
+ }
10375
+ const uri = new URL(this.client.config.endpoint + apiPath);
10376
+ const apiHeaders = {
10377
+ 'X-Appwrite-Project': this.client.config.project,
10378
+ };
10379
+ return this.client.call('get', uri, apiHeaders, payload);
10380
+ }
10381
+ searchSkills(paramsOrFirst, ...rest) {
10382
+ let params;
10383
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
10384
+ params = (paramsOrFirst || {});
10385
+ }
10386
+ else {
10387
+ params = {
10388
+ query: paramsOrFirst,
10389
+ scope: rest[0],
10390
+ userId: rest[1],
10391
+ agentId: rest[2],
10392
+ sessionId: rest[3],
10393
+ runId: rest[4],
10394
+ memorySubStoreId: rest[5],
10395
+ cursor: rest[6],
10396
+ limit: rest[7],
10397
+ retrieval: rest[8]
10398
+ };
10399
+ }
10400
+ const query = params.query;
10401
+ const scope = params.scope;
10402
+ const userId = params.userId;
10403
+ const agentId = params.agentId;
10404
+ const sessionId = params.sessionId;
10405
+ const runId = params.runId;
10406
+ const memorySubStoreId = params.memorySubStoreId;
10407
+ const cursor = params.cursor;
10408
+ const limit = params.limit;
10409
+ const retrieval = params.retrieval;
10410
+ if (typeof query === 'undefined') {
10411
+ throw new AgentbaseException('Missing required parameter: "query"');
10412
+ }
10413
+ const apiPath = '/memory/memories/skills/search';
10414
+ const payload = {};
10415
+ if (typeof scope !== 'undefined') {
10416
+ payload['scope'] = scope;
10417
+ }
10418
+ if (typeof userId !== 'undefined') {
10419
+ payload['userId'] = userId;
10420
+ }
10421
+ if (typeof agentId !== 'undefined') {
10422
+ payload['agentId'] = agentId;
10423
+ }
10424
+ if (typeof sessionId !== 'undefined') {
10425
+ payload['sessionId'] = sessionId;
10426
+ }
10427
+ if (typeof runId !== 'undefined') {
10428
+ payload['runId'] = runId;
10429
+ }
10430
+ if (typeof memorySubStoreId !== 'undefined') {
10431
+ payload['memorySubStoreId'] = memorySubStoreId;
10432
+ }
10433
+ if (typeof query !== 'undefined') {
10434
+ payload['query'] = query;
10435
+ }
10436
+ if (typeof cursor !== 'undefined') {
10437
+ payload['cursor'] = cursor;
10438
+ }
10439
+ if (typeof limit !== 'undefined') {
10440
+ payload['limit'] = limit;
10441
+ }
10442
+ if (typeof retrieval !== 'undefined') {
10443
+ payload['retrieval'] = retrieval;
10444
+ }
10445
+ const uri = new URL(this.client.config.endpoint + apiPath);
10446
+ const apiHeaders = {
10447
+ 'X-Appwrite-Project': this.client.config.project,
10448
+ 'content-type': 'application/json',
10449
+ };
10450
+ return this.client.call('post', uri, apiHeaders, payload);
10451
+ }
10452
+ getSkill(paramsOrFirst, ...rest) {
10453
+ let params;
10454
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
10455
+ params = (paramsOrFirst || {});
10456
+ }
10457
+ else {
10458
+ params = {
10459
+ knowledgeId: paramsOrFirst,
10460
+ scope: rest[0],
10461
+ userId: rest[1],
10462
+ agentId: rest[2],
10463
+ sessionId: rest[3],
10464
+ runId: rest[4],
10465
+ memorySubStoreId: rest[5]
10466
+ };
10467
+ }
10468
+ const knowledgeId = params.knowledgeId;
10469
+ const scope = params.scope;
10470
+ const userId = params.userId;
10471
+ const agentId = params.agentId;
10472
+ const sessionId = params.sessionId;
10473
+ const runId = params.runId;
10474
+ const memorySubStoreId = params.memorySubStoreId;
10475
+ if (typeof knowledgeId === 'undefined') {
10476
+ throw new AgentbaseException('Missing required parameter: "knowledgeId"');
10477
+ }
10478
+ const apiPath = '/memory/memories/skills/{knowledgeId}'.replace('{knowledgeId}', knowledgeId);
10479
+ const payload = {};
10480
+ if (typeof scope !== 'undefined') {
10481
+ payload['scope'] = scope;
10482
+ }
10483
+ if (typeof userId !== 'undefined') {
10484
+ payload['userId'] = userId;
10485
+ }
10486
+ if (typeof agentId !== 'undefined') {
10487
+ payload['agentId'] = agentId;
10488
+ }
10489
+ if (typeof sessionId !== 'undefined') {
10490
+ payload['sessionId'] = sessionId;
10491
+ }
10492
+ if (typeof runId !== 'undefined') {
10493
+ payload['runId'] = runId;
10494
+ }
10495
+ if (typeof memorySubStoreId !== 'undefined') {
10496
+ payload['memorySubStoreId'] = memorySubStoreId;
10497
+ }
10498
+ const uri = new URL(this.client.config.endpoint + apiPath);
10499
+ const apiHeaders = {
10500
+ 'X-Appwrite-Project': this.client.config.project,
10501
+ };
10502
+ return this.client.call('get', uri, apiHeaders, payload);
10503
+ }
10504
+ listSkillSources(paramsOrFirst, ...rest) {
10505
+ let params;
10506
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
10507
+ params = (paramsOrFirst || {});
10508
+ }
10509
+ else {
10510
+ params = {
10511
+ knowledgeId: paramsOrFirst,
10512
+ scope: rest[0],
10513
+ userId: rest[1],
10514
+ agentId: rest[2],
10515
+ sessionId: rest[3],
10516
+ runId: rest[4],
10517
+ memorySubStoreId: rest[5],
10518
+ cursor: rest[6],
10519
+ limit: rest[7]
10520
+ };
10521
+ }
10522
+ const knowledgeId = params.knowledgeId;
10523
+ const scope = params.scope;
10524
+ const userId = params.userId;
10525
+ const agentId = params.agentId;
10526
+ const sessionId = params.sessionId;
10527
+ const runId = params.runId;
10528
+ const memorySubStoreId = params.memorySubStoreId;
10529
+ const cursor = params.cursor;
10530
+ const limit = params.limit;
10531
+ if (typeof knowledgeId === 'undefined') {
10532
+ throw new AgentbaseException('Missing required parameter: "knowledgeId"');
10533
+ }
10534
+ const apiPath = '/memory/memories/skills/{knowledgeId}/sources'.replace('{knowledgeId}', knowledgeId);
10535
+ const payload = {};
10536
+ if (typeof scope !== 'undefined') {
10537
+ payload['scope'] = scope;
10538
+ }
10539
+ if (typeof userId !== 'undefined') {
10540
+ payload['userId'] = userId;
10541
+ }
10542
+ if (typeof agentId !== 'undefined') {
10543
+ payload['agentId'] = agentId;
10544
+ }
10545
+ if (typeof sessionId !== 'undefined') {
10546
+ payload['sessionId'] = sessionId;
10547
+ }
10548
+ if (typeof runId !== 'undefined') {
10549
+ payload['runId'] = runId;
10550
+ }
10551
+ if (typeof memorySubStoreId !== 'undefined') {
10552
+ payload['memorySubStoreId'] = memorySubStoreId;
10553
+ }
10554
+ if (typeof cursor !== 'undefined') {
10555
+ payload['cursor'] = cursor;
10556
+ }
10557
+ if (typeof limit !== 'undefined') {
10558
+ payload['limit'] = limit;
10559
+ }
10560
+ const uri = new URL(this.client.config.endpoint + apiPath);
10561
+ const apiHeaders = {
10562
+ 'X-Appwrite-Project': this.client.config.project,
10563
+ };
10564
+ return this.client.call('get', uri, apiHeaders, payload);
10565
+ }
10566
+ /**
10567
+ * Get memory statistics visible to the current caller.
10568
+ *
10569
+ * @throws {AgentbaseException}
10570
+ * @returns {Promise<{}>}
10571
+ */
10572
+ getStats() {
10573
+ const apiPath = '/memory/memories/stats';
10574
+ const payload = {};
10575
+ const uri = new URL(this.client.config.endpoint + apiPath);
10576
+ const apiHeaders = {
10577
+ 'X-Appwrite-Project': this.client.config.project,
10578
+ };
10579
+ return this.client.call('get', uri, apiHeaders, payload);
10580
+ }
10581
+ /**
10582
+ * Get a memory activity timeline.
10583
+ *
10584
+ * @throws {AgentbaseException}
10585
+ * @returns {Promise<{}>}
10586
+ */
10587
+ getTimeline() {
10588
+ const apiPath = '/memory/memories/timeline';
10589
+ const payload = {};
10590
+ const uri = new URL(this.client.config.endpoint + apiPath);
10591
+ const apiHeaders = {
10592
+ 'X-Appwrite-Project': this.client.config.project,
10593
+ };
10594
+ return this.client.call('get', uri, apiHeaders, payload);
10595
+ }
10596
+ getProfile(paramsOrFirst, ...rest) {
10597
+ let params;
10598
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
10599
+ params = (paramsOrFirst || {});
10600
+ }
10601
+ else {
10602
+ params = {
10603
+ userId: paramsOrFirst,
10604
+ profileType: rest[0]
10605
+ };
10606
+ }
10607
+ const userId = params.userId;
10608
+ const profileType = params.profileType;
10609
+ if (typeof userId === 'undefined') {
10610
+ throw new AgentbaseException('Missing required parameter: "userId"');
10611
+ }
10612
+ const apiPath = '/memory/memories/users/{userId}/profile'.replace('{userId}', userId);
10613
+ const payload = {};
10614
+ if (typeof profileType !== 'undefined') {
10615
+ payload['profileType'] = profileType;
10616
+ }
10617
+ const uri = new URL(this.client.config.endpoint + apiPath);
10618
+ const apiHeaders = {
10619
+ 'X-Appwrite-Project': this.client.config.project,
10620
+ };
10621
+ return this.client.call('get', uri, apiHeaders, payload);
10622
+ }
10623
+ deleteProfile(paramsOrFirst, ...rest) {
10624
+ let params;
10625
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
10626
+ params = (paramsOrFirst || {});
10627
+ }
10628
+ else {
10629
+ params = {
10630
+ userId: paramsOrFirst,
10631
+ profileType: rest[0],
10632
+ reason: rest[1],
10633
+ source: rest[2]
10634
+ };
10635
+ }
10636
+ const userId = params.userId;
10637
+ const profileType = params.profileType;
10638
+ const reason = params.reason;
10639
+ const source = params.source;
10640
+ if (typeof userId === 'undefined') {
10641
+ throw new AgentbaseException('Missing required parameter: "userId"');
10642
+ }
10643
+ const apiPath = '/memory/memories/users/{userId}/profile'.replace('{userId}', userId);
10644
+ const payload = {};
10645
+ if (typeof profileType !== 'undefined') {
10646
+ payload['profileType'] = profileType;
10647
+ }
10648
+ if (typeof reason !== 'undefined') {
10649
+ payload['reason'] = reason;
10650
+ }
10651
+ if (typeof source !== 'undefined') {
10652
+ payload['source'] = source;
10653
+ }
10654
+ const uri = new URL(this.client.config.endpoint + apiPath);
10655
+ const apiHeaders = {
10656
+ 'X-Appwrite-Project': this.client.config.project,
10657
+ 'content-type': 'application/json',
10658
+ };
10659
+ return this.client.call('delete', uri, apiHeaders, payload);
10660
+ }
10661
+ createProfileExtraction(paramsOrFirst, ...rest) {
10662
+ let params;
10663
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
10664
+ params = (paramsOrFirst || {});
10665
+ }
10666
+ else {
10667
+ params = {
10668
+ userId: paramsOrFirst,
10669
+ pipelineId: rest[0],
10670
+ profileType: rest[1],
10671
+ messages: rest[2],
10672
+ sourceMemoryIds: rest[3],
10673
+ sessionId: rest[4],
10674
+ mode: rest[5]
10675
+ };
10676
+ }
10677
+ const userId = params.userId;
10678
+ const pipelineId = params.pipelineId;
10679
+ const profileType = params.profileType;
10680
+ const messages = params.messages;
10681
+ const sourceMemoryIds = params.sourceMemoryIds;
10682
+ const sessionId = params.sessionId;
10683
+ const mode = params.mode;
10684
+ if (typeof userId === 'undefined') {
10685
+ throw new AgentbaseException('Missing required parameter: "userId"');
10686
+ }
10687
+ const apiPath = '/memory/memories/users/{userId}/profile/extractions'.replace('{userId}', userId);
10688
+ const payload = {};
10689
+ if (typeof pipelineId !== 'undefined') {
10690
+ payload['pipelineId'] = pipelineId;
10691
+ }
10692
+ if (typeof profileType !== 'undefined') {
10693
+ payload['profileType'] = profileType;
10694
+ }
10695
+ if (typeof messages !== 'undefined') {
10696
+ payload['messages'] = messages;
10697
+ }
10698
+ if (typeof sourceMemoryIds !== 'undefined') {
10699
+ payload['sourceMemoryIds'] = sourceMemoryIds;
10700
+ }
10701
+ if (typeof sessionId !== 'undefined') {
10702
+ payload['sessionId'] = sessionId;
10703
+ }
10704
+ if (typeof mode !== 'undefined') {
10705
+ payload['mode'] = mode;
10706
+ }
10707
+ const uri = new URL(this.client.config.endpoint + apiPath);
10708
+ const apiHeaders = {
10709
+ 'X-Appwrite-Project': this.client.config.project,
10710
+ 'content-type': 'application/json',
10711
+ };
10712
+ return this.client.call('post', uri, apiHeaders, payload);
10713
+ }
10714
+ createProfileRebuild(paramsOrFirst, ...rest) {
10715
+ let params;
10716
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
10717
+ params = (paramsOrFirst || {});
10718
+ }
10719
+ else {
10720
+ params = {
10721
+ userId: paramsOrFirst,
10722
+ pipelineId: rest[0],
10723
+ profileType: rest[1]
10724
+ };
10725
+ }
10726
+ const userId = params.userId;
10727
+ const pipelineId = params.pipelineId;
10728
+ const profileType = params.profileType;
10729
+ if (typeof userId === 'undefined') {
10730
+ throw new AgentbaseException('Missing required parameter: "userId"');
10731
+ }
10732
+ const apiPath = '/memory/memories/users/{userId}/profile/rebuild'.replace('{userId}', userId);
10733
+ const payload = {};
10734
+ if (typeof pipelineId !== 'undefined') {
10735
+ payload['pipelineId'] = pipelineId;
10736
+ }
10737
+ if (typeof profileType !== 'undefined') {
10738
+ payload['profileType'] = profileType;
10739
+ }
10740
+ const uri = new URL(this.client.config.endpoint + apiPath);
10741
+ const apiHeaders = {
10742
+ 'X-Appwrite-Project': this.client.config.project,
10743
+ 'content-type': 'application/json',
10744
+ };
10745
+ return this.client.call('post', uri, apiHeaders, payload);
10746
+ }
10747
+ listProfileSources(paramsOrFirst, ...rest) {
10748
+ let params;
10749
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
10750
+ params = (paramsOrFirst || {});
10751
+ }
10752
+ else {
10753
+ params = {
10754
+ userId: paramsOrFirst,
10755
+ profileType: rest[0]
10756
+ };
10757
+ }
10758
+ const userId = params.userId;
10759
+ const profileType = params.profileType;
10760
+ if (typeof userId === 'undefined') {
10761
+ throw new AgentbaseException('Missing required parameter: "userId"');
10762
+ }
10763
+ const apiPath = '/memory/memories/users/{userId}/profile/sources'.replace('{userId}', userId);
10764
+ const payload = {};
10765
+ if (typeof profileType !== 'undefined') {
10766
+ payload['profileType'] = profileType;
10767
+ }
10768
+ const uri = new URL(this.client.config.endpoint + apiPath);
10769
+ const apiHeaders = {
10770
+ 'X-Appwrite-Project': this.client.config.project,
10771
+ };
10772
+ return this.client.call('get', uri, apiHeaders, payload);
10773
+ }
10774
+ get(paramsOrFirst) {
10775
+ let params;
10776
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
10777
+ params = (paramsOrFirst || {});
10778
+ }
10779
+ else {
10780
+ params = {
10781
+ memoryId: paramsOrFirst
10782
+ };
10783
+ }
10784
+ const memoryId = params.memoryId;
10785
+ if (typeof memoryId === 'undefined') {
10786
+ throw new AgentbaseException('Missing required parameter: "memoryId"');
10787
+ }
10788
+ const apiPath = '/memory/memories/{memoryId}'.replace('{memoryId}', memoryId);
10789
+ const payload = {};
10790
+ const uri = new URL(this.client.config.endpoint + apiPath);
10791
+ const apiHeaders = {
10792
+ 'X-Appwrite-Project': this.client.config.project,
10793
+ };
10794
+ return this.client.call('get', uri, apiHeaders, payload);
10795
+ }
10796
+ update(paramsOrFirst, ...rest) {
10797
+ let params;
10798
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
10799
+ params = (paramsOrFirst || {});
10800
+ }
10801
+ else {
10802
+ params = {
10803
+ memoryId: paramsOrFirst,
10804
+ version: rest[0],
10805
+ content: rest[1],
10806
+ metadata: rest[2],
10807
+ retentionPolicy: rest[3]
10808
+ };
10809
+ }
10810
+ const memoryId = params.memoryId;
10811
+ const version = params.version;
10812
+ const content = params.content;
10813
+ const metadata = params.metadata;
10814
+ const retentionPolicy = params.retentionPolicy;
10815
+ if (typeof memoryId === 'undefined') {
10816
+ throw new AgentbaseException('Missing required parameter: "memoryId"');
10817
+ }
10818
+ if (typeof version === 'undefined') {
10819
+ throw new AgentbaseException('Missing required parameter: "version"');
10820
+ }
10821
+ const apiPath = '/memory/memories/{memoryId}'.replace('{memoryId}', memoryId);
10822
+ const payload = {};
10823
+ if (typeof version !== 'undefined') {
10824
+ payload['version'] = version;
10825
+ }
10826
+ if (typeof content !== 'undefined') {
10827
+ payload['content'] = content;
10828
+ }
10829
+ if (typeof metadata !== 'undefined') {
10830
+ payload['metadata'] = metadata;
10831
+ }
10832
+ if (typeof retentionPolicy !== 'undefined') {
10833
+ payload['retentionPolicy'] = retentionPolicy;
10834
+ }
10835
+ const uri = new URL(this.client.config.endpoint + apiPath);
10836
+ const apiHeaders = {
10837
+ 'X-Appwrite-Project': this.client.config.project,
10838
+ 'content-type': 'application/json',
10839
+ };
10840
+ return this.client.call('patch', uri, apiHeaders, payload);
10841
+ }
10842
+ delete(paramsOrFirst, ...rest) {
10843
+ let params;
10844
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
10845
+ params = (paramsOrFirst || {});
10846
+ }
10847
+ else {
10848
+ params = {
10849
+ memoryId: paramsOrFirst,
10850
+ memorySubStoreId: rest[0],
10851
+ reason: rest[1],
10852
+ source: rest[2]
10853
+ };
10854
+ }
10855
+ const memoryId = params.memoryId;
10856
+ const memorySubStoreId = params.memorySubStoreId;
10857
+ const reason = params.reason;
10858
+ const source = params.source;
10859
+ if (typeof memoryId === 'undefined') {
10860
+ throw new AgentbaseException('Missing required parameter: "memoryId"');
10861
+ }
10862
+ const apiPath = '/memory/memories/{memoryId}'.replace('{memoryId}', memoryId);
10863
+ const payload = {};
10864
+ if (typeof memorySubStoreId !== 'undefined') {
10865
+ payload['memorySubStoreId'] = memorySubStoreId;
10866
+ }
10867
+ if (typeof reason !== 'undefined') {
10868
+ payload['reason'] = reason;
9161
10869
  }
9162
- if (typeof limit !== 'undefined') {
9163
- payload['limit'] = limit;
10870
+ if (typeof source !== 'undefined') {
10871
+ payload['source'] = source;
9164
10872
  }
9165
10873
  const uri = new URL(this.client.config.endpoint + apiPath);
9166
10874
  const apiHeaders = {
9167
10875
  'X-Appwrite-Project': this.client.config.project,
10876
+ 'content-type': 'application/json',
9168
10877
  };
9169
- return this.client.call('get', uri, apiHeaders, payload);
10878
+ return this.client.call('delete', uri, apiHeaders, payload);
9170
10879
  }
9171
- searchSkills(paramsOrFirst, ...rest) {
10880
+ listShares(paramsOrFirst) {
9172
10881
  let params;
9173
10882
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9174
10883
  params = (paramsOrFirst || {});
9175
10884
  }
9176
10885
  else {
9177
10886
  params = {
9178
- query: paramsOrFirst,
9179
- scope: rest[0],
9180
- userId: rest[1],
9181
- agentId: rest[2],
9182
- sessionId: rest[3],
9183
- runId: rest[4],
9184
- memorySubStoreId: rest[5],
9185
- cursor: rest[6],
9186
- limit: rest[7],
9187
- retrieval: rest[8]
10887
+ memoryId: paramsOrFirst
9188
10888
  };
9189
10889
  }
9190
- const query = params.query;
9191
- const scope = params.scope;
9192
- const userId = params.userId;
9193
- const agentId = params.agentId;
9194
- const sessionId = params.sessionId;
9195
- const runId = params.runId;
9196
- const memorySubStoreId = params.memorySubStoreId;
9197
- const cursor = params.cursor;
9198
- const limit = params.limit;
9199
- const retrieval = params.retrieval;
9200
- if (typeof query === 'undefined') {
9201
- throw new AgentbaseException('Missing required parameter: "query"');
10890
+ const memoryId = params.memoryId;
10891
+ if (typeof memoryId === 'undefined') {
10892
+ throw new AgentbaseException('Missing required parameter: "memoryId"');
9202
10893
  }
9203
- const apiPath = '/memory/memories/skills/search';
10894
+ const apiPath = '/memory/memories/{memoryId}/shares'.replace('{memoryId}', memoryId);
9204
10895
  const payload = {};
9205
- if (typeof scope !== 'undefined') {
9206
- payload['scope'] = scope;
9207
- }
9208
- if (typeof userId !== 'undefined') {
9209
- payload['userId'] = userId;
9210
- }
9211
- if (typeof agentId !== 'undefined') {
9212
- payload['agentId'] = agentId;
10896
+ const uri = new URL(this.client.config.endpoint + apiPath);
10897
+ const apiHeaders = {
10898
+ 'X-Appwrite-Project': this.client.config.project,
10899
+ };
10900
+ return this.client.call('get', uri, apiHeaders, payload);
10901
+ }
10902
+ createShare(paramsOrFirst, ...rest) {
10903
+ let params;
10904
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
10905
+ params = (paramsOrFirst || {});
9213
10906
  }
9214
- if (typeof sessionId !== 'undefined') {
9215
- payload['sessionId'] = sessionId;
10907
+ else {
10908
+ params = {
10909
+ memoryId: paramsOrFirst,
10910
+ subjectType: rest[0],
10911
+ subjectId: rest[1],
10912
+ expiresAt: rest[2]
10913
+ };
9216
10914
  }
9217
- if (typeof runId !== 'undefined') {
9218
- payload['runId'] = runId;
10915
+ const memoryId = params.memoryId;
10916
+ const subjectType = params.subjectType;
10917
+ const subjectId = params.subjectId;
10918
+ const expiresAt = params.expiresAt;
10919
+ if (typeof memoryId === 'undefined') {
10920
+ throw new AgentbaseException('Missing required parameter: "memoryId"');
9219
10921
  }
9220
- if (typeof memorySubStoreId !== 'undefined') {
9221
- payload['memorySubStoreId'] = memorySubStoreId;
10922
+ if (typeof subjectType === 'undefined') {
10923
+ throw new AgentbaseException('Missing required parameter: "subjectType"');
9222
10924
  }
9223
- if (typeof query !== 'undefined') {
9224
- payload['query'] = query;
10925
+ if (typeof subjectId === 'undefined') {
10926
+ throw new AgentbaseException('Missing required parameter: "subjectId"');
9225
10927
  }
9226
- if (typeof cursor !== 'undefined') {
9227
- payload['cursor'] = cursor;
10928
+ const apiPath = '/memory/memories/{memoryId}/shares'.replace('{memoryId}', memoryId);
10929
+ const payload = {};
10930
+ if (typeof subjectType !== 'undefined') {
10931
+ payload['subjectType'] = subjectType;
9228
10932
  }
9229
- if (typeof limit !== 'undefined') {
9230
- payload['limit'] = limit;
10933
+ if (typeof subjectId !== 'undefined') {
10934
+ payload['subjectId'] = subjectId;
9231
10935
  }
9232
- if (typeof retrieval !== 'undefined') {
9233
- payload['retrieval'] = retrieval;
10936
+ if (typeof expiresAt !== 'undefined') {
10937
+ payload['expiresAt'] = expiresAt;
9234
10938
  }
9235
10939
  const uri = new URL(this.client.config.endpoint + apiPath);
9236
10940
  const apiHeaders = {
@@ -9239,108 +10943,54 @@ class Memory {
9239
10943
  };
9240
10944
  return this.client.call('post', uri, apiHeaders, payload);
9241
10945
  }
9242
- getSkill(paramsOrFirst, ...rest) {
10946
+ deleteShare(paramsOrFirst, ...rest) {
9243
10947
  let params;
9244
10948
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9245
10949
  params = (paramsOrFirst || {});
9246
10950
  }
9247
10951
  else {
9248
10952
  params = {
9249
- knowledgeId: paramsOrFirst,
9250
- scope: rest[0],
9251
- userId: rest[1],
9252
- agentId: rest[2],
9253
- sessionId: rest[3],
9254
- runId: rest[4],
9255
- memorySubStoreId: rest[5]
10953
+ memoryId: paramsOrFirst,
10954
+ shareId: rest[0]
9256
10955
  };
9257
10956
  }
9258
- const knowledgeId = params.knowledgeId;
9259
- const scope = params.scope;
9260
- const userId = params.userId;
9261
- const agentId = params.agentId;
9262
- const sessionId = params.sessionId;
9263
- const runId = params.runId;
9264
- const memorySubStoreId = params.memorySubStoreId;
9265
- if (typeof knowledgeId === 'undefined') {
9266
- throw new AgentbaseException('Missing required parameter: "knowledgeId"');
9267
- }
9268
- const apiPath = '/memory/memories/skills/{knowledgeId}'.replace('{knowledgeId}', knowledgeId);
9269
- const payload = {};
9270
- if (typeof scope !== 'undefined') {
9271
- payload['scope'] = scope;
9272
- }
9273
- if (typeof userId !== 'undefined') {
9274
- payload['userId'] = userId;
9275
- }
9276
- if (typeof agentId !== 'undefined') {
9277
- payload['agentId'] = agentId;
9278
- }
9279
- if (typeof sessionId !== 'undefined') {
9280
- payload['sessionId'] = sessionId;
9281
- }
9282
- if (typeof runId !== 'undefined') {
9283
- payload['runId'] = runId;
10957
+ const memoryId = params.memoryId;
10958
+ const shareId = params.shareId;
10959
+ if (typeof memoryId === 'undefined') {
10960
+ throw new AgentbaseException('Missing required parameter: "memoryId"');
9284
10961
  }
9285
- if (typeof memorySubStoreId !== 'undefined') {
9286
- payload['memorySubStoreId'] = memorySubStoreId;
10962
+ if (typeof shareId === 'undefined') {
10963
+ throw new AgentbaseException('Missing required parameter: "shareId"');
9287
10964
  }
10965
+ const apiPath = '/memory/memories/{memoryId}/shares/{shareId}'.replace('{memoryId}', memoryId).replace('{shareId}', shareId);
10966
+ const payload = {};
9288
10967
  const uri = new URL(this.client.config.endpoint + apiPath);
9289
10968
  const apiHeaders = {
9290
10969
  'X-Appwrite-Project': this.client.config.project,
10970
+ 'content-type': 'application/json',
9291
10971
  };
9292
- return this.client.call('get', uri, apiHeaders, payload);
10972
+ return this.client.call('delete', uri, apiHeaders, payload);
9293
10973
  }
9294
- listSkillSources(paramsOrFirst, ...rest) {
10974
+ listSources(paramsOrFirst, ...rest) {
9295
10975
  let params;
9296
10976
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9297
10977
  params = (paramsOrFirst || {});
9298
10978
  }
9299
10979
  else {
9300
10980
  params = {
9301
- knowledgeId: paramsOrFirst,
9302
- scope: rest[0],
9303
- userId: rest[1],
9304
- agentId: rest[2],
9305
- sessionId: rest[3],
9306
- runId: rest[4],
9307
- memorySubStoreId: rest[5],
9308
- cursor: rest[6],
9309
- limit: rest[7]
10981
+ memoryId: paramsOrFirst,
10982
+ cursor: rest[0],
10983
+ limit: rest[1]
9310
10984
  };
9311
10985
  }
9312
- const knowledgeId = params.knowledgeId;
9313
- const scope = params.scope;
9314
- const userId = params.userId;
9315
- const agentId = params.agentId;
9316
- const sessionId = params.sessionId;
9317
- const runId = params.runId;
9318
- const memorySubStoreId = params.memorySubStoreId;
10986
+ const memoryId = params.memoryId;
9319
10987
  const cursor = params.cursor;
9320
10988
  const limit = params.limit;
9321
- if (typeof knowledgeId === 'undefined') {
9322
- throw new AgentbaseException('Missing required parameter: "knowledgeId"');
10989
+ if (typeof memoryId === 'undefined') {
10990
+ throw new AgentbaseException('Missing required parameter: "memoryId"');
9323
10991
  }
9324
- const apiPath = '/memory/memories/skills/{knowledgeId}/sources'.replace('{knowledgeId}', knowledgeId);
10992
+ const apiPath = '/memory/memories/{memoryId}/sources'.replace('{memoryId}', memoryId);
9325
10993
  const payload = {};
9326
- if (typeof scope !== 'undefined') {
9327
- payload['scope'] = scope;
9328
- }
9329
- if (typeof userId !== 'undefined') {
9330
- payload['userId'] = userId;
9331
- }
9332
- if (typeof agentId !== 'undefined') {
9333
- payload['agentId'] = agentId;
9334
- }
9335
- if (typeof sessionId !== 'undefined') {
9336
- payload['sessionId'] = sessionId;
9337
- }
9338
- if (typeof runId !== 'undefined') {
9339
- payload['runId'] = runId;
9340
- }
9341
- if (typeof memorySubStoreId !== 'undefined') {
9342
- payload['memorySubStoreId'] = memorySubStoreId;
9343
- }
9344
10994
  if (typeof cursor !== 'undefined') {
9345
10995
  payload['cursor'] = cursor;
9346
10996
  }
@@ -9353,169 +11003,157 @@ class Memory {
9353
11003
  };
9354
11004
  return this.client.call('get', uri, apiHeaders, payload);
9355
11005
  }
9356
- /**
9357
- * Get memory statistics visible to the current caller.
9358
- *
9359
- * @throws {AgentbaseException}
9360
- * @returns {Promise<{}>}
9361
- */
9362
- getStats() {
9363
- const apiPath = '/memory/memories/stats';
9364
- const payload = {};
9365
- const uri = new URL(this.client.config.endpoint + apiPath);
9366
- const apiHeaders = {
9367
- 'X-Appwrite-Project': this.client.config.project,
9368
- };
9369
- return this.client.call('get', uri, apiHeaders, payload);
9370
- }
9371
- /**
9372
- * Get a memory activity timeline.
9373
- *
9374
- * @throws {AgentbaseException}
9375
- * @returns {Promise<{}>}
9376
- */
9377
- getTimeline() {
9378
- const apiPath = '/memory/memories/timeline';
11006
+ listPipelineRuns(paramsOrFirst, ...rest) {
11007
+ let params;
11008
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('scenario' in paramsOrFirst || 'limit' in paramsOrFirst || 'cursor' in paramsOrFirst))) {
11009
+ params = (paramsOrFirst || {});
11010
+ }
11011
+ else {
11012
+ params = {
11013
+ scenario: paramsOrFirst,
11014
+ limit: rest[0],
11015
+ cursor: rest[1]
11016
+ };
11017
+ }
11018
+ const scenario = params.scenario;
11019
+ const limit = params.limit;
11020
+ const cursor = params.cursor;
11021
+ const apiPath = '/memory/pipeline-runs';
9379
11022
  const payload = {};
11023
+ if (typeof scenario !== 'undefined') {
11024
+ payload['scenario'] = scenario;
11025
+ }
11026
+ if (typeof limit !== 'undefined') {
11027
+ payload['limit'] = limit;
11028
+ }
11029
+ if (typeof cursor !== 'undefined') {
11030
+ payload['cursor'] = cursor;
11031
+ }
9380
11032
  const uri = new URL(this.client.config.endpoint + apiPath);
9381
11033
  const apiHeaders = {
9382
11034
  'X-Appwrite-Project': this.client.config.project,
9383
11035
  };
9384
11036
  return this.client.call('get', uri, apiHeaders, payload);
9385
11037
  }
9386
- getProfile(paramsOrFirst, ...rest) {
11038
+ createPipelineRun(paramsOrFirst, ...rest) {
9387
11039
  let params;
9388
11040
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9389
11041
  params = (paramsOrFirst || {});
9390
11042
  }
9391
11043
  else {
9392
11044
  params = {
9393
- userId: paramsOrFirst,
9394
- profileType: rest[0]
11045
+ name: paramsOrFirst,
11046
+ scenario: rest[0],
11047
+ candidates: rest[1],
11048
+ samples: rest[2]
9395
11049
  };
9396
11050
  }
9397
- const userId = params.userId;
9398
- const profileType = params.profileType;
9399
- if (typeof userId === 'undefined') {
9400
- throw new AgentbaseException('Missing required parameter: "userId"');
11051
+ const name = params.name;
11052
+ const scenario = params.scenario;
11053
+ const candidates = params.candidates;
11054
+ const samples = params.samples;
11055
+ if (typeof name === 'undefined') {
11056
+ throw new AgentbaseException('Missing required parameter: "name"');
9401
11057
  }
9402
- const apiPath = '/memory/memories/users/{userId}/profile'.replace('{userId}', userId);
11058
+ if (typeof scenario === 'undefined') {
11059
+ throw new AgentbaseException('Missing required parameter: "scenario"');
11060
+ }
11061
+ if (typeof candidates === 'undefined') {
11062
+ throw new AgentbaseException('Missing required parameter: "candidates"');
11063
+ }
11064
+ if (typeof samples === 'undefined') {
11065
+ throw new AgentbaseException('Missing required parameter: "samples"');
11066
+ }
11067
+ const apiPath = '/memory/pipeline-runs';
9403
11068
  const payload = {};
9404
- if (typeof profileType !== 'undefined') {
9405
- payload['profileType'] = profileType;
11069
+ if (typeof name !== 'undefined') {
11070
+ payload['name'] = name;
11071
+ }
11072
+ if (typeof scenario !== 'undefined') {
11073
+ payload['scenario'] = scenario;
11074
+ }
11075
+ if (typeof candidates !== 'undefined') {
11076
+ payload['candidates'] = candidates;
11077
+ }
11078
+ if (typeof samples !== 'undefined') {
11079
+ payload['samples'] = samples;
9406
11080
  }
9407
11081
  const uri = new URL(this.client.config.endpoint + apiPath);
9408
11082
  const apiHeaders = {
9409
11083
  'X-Appwrite-Project': this.client.config.project,
11084
+ 'content-type': 'application/json',
9410
11085
  };
9411
- return this.client.call('get', uri, apiHeaders, payload);
11086
+ return this.client.call('post', uri, apiHeaders, payload);
9412
11087
  }
9413
- deleteProfile(paramsOrFirst, ...rest) {
11088
+ getPipelineRun(paramsOrFirst) {
9414
11089
  let params;
9415
11090
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9416
11091
  params = (paramsOrFirst || {});
9417
11092
  }
9418
11093
  else {
9419
11094
  params = {
9420
- userId: paramsOrFirst,
9421
- profileType: rest[0],
9422
- reason: rest[1],
9423
- source: rest[2]
11095
+ runId: paramsOrFirst
9424
11096
  };
9425
11097
  }
9426
- const userId = params.userId;
9427
- const profileType = params.profileType;
9428
- const reason = params.reason;
9429
- const source = params.source;
9430
- if (typeof userId === 'undefined') {
9431
- throw new AgentbaseException('Missing required parameter: "userId"');
11098
+ const runId = params.runId;
11099
+ if (typeof runId === 'undefined') {
11100
+ throw new AgentbaseException('Missing required parameter: "runId"');
9432
11101
  }
9433
- const apiPath = '/memory/memories/users/{userId}/profile'.replace('{userId}', userId);
11102
+ const apiPath = '/memory/pipeline-runs/{runId}'.replace('{runId}', runId);
9434
11103
  const payload = {};
9435
- if (typeof profileType !== 'undefined') {
9436
- payload['profileType'] = profileType;
9437
- }
9438
- if (typeof reason !== 'undefined') {
9439
- payload['reason'] = reason;
9440
- }
9441
- if (typeof source !== 'undefined') {
9442
- payload['source'] = source;
9443
- }
9444
11104
  const uri = new URL(this.client.config.endpoint + apiPath);
9445
11105
  const apiHeaders = {
9446
11106
  'X-Appwrite-Project': this.client.config.project,
9447
- 'content-type': 'application/json',
9448
11107
  };
9449
- return this.client.call('delete', uri, apiHeaders, payload);
11108
+ return this.client.call('get', uri, apiHeaders, payload);
9450
11109
  }
9451
- createProfileExtraction(paramsOrFirst, ...rest) {
11110
+ listPipelines(paramsOrFirst) {
9452
11111
  let params;
9453
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
11112
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('scenario' in paramsOrFirst))) {
9454
11113
  params = (paramsOrFirst || {});
9455
11114
  }
9456
11115
  else {
9457
11116
  params = {
9458
- userId: paramsOrFirst,
9459
- profileType: rest[0],
9460
- messages: rest[1],
9461
- sourceMemoryIds: rest[2],
9462
- sessionId: rest[3],
9463
- mode: rest[4]
11117
+ scenario: paramsOrFirst
9464
11118
  };
9465
11119
  }
9466
- const userId = params.userId;
9467
- const profileType = params.profileType;
9468
- const messages = params.messages;
9469
- const sourceMemoryIds = params.sourceMemoryIds;
9470
- const sessionId = params.sessionId;
9471
- const mode = params.mode;
9472
- if (typeof userId === 'undefined') {
9473
- throw new AgentbaseException('Missing required parameter: "userId"');
9474
- }
9475
- const apiPath = '/memory/memories/users/{userId}/profile/extractions'.replace('{userId}', userId);
11120
+ const scenario = params.scenario;
11121
+ const apiPath = '/memory/pipelines';
9476
11122
  const payload = {};
9477
- if (typeof profileType !== 'undefined') {
9478
- payload['profileType'] = profileType;
9479
- }
9480
- if (typeof messages !== 'undefined') {
9481
- payload['messages'] = messages;
9482
- }
9483
- if (typeof sourceMemoryIds !== 'undefined') {
9484
- payload['sourceMemoryIds'] = sourceMemoryIds;
9485
- }
9486
- if (typeof sessionId !== 'undefined') {
9487
- payload['sessionId'] = sessionId;
9488
- }
9489
- if (typeof mode !== 'undefined') {
9490
- payload['mode'] = mode;
11123
+ if (typeof scenario !== 'undefined') {
11124
+ payload['scenario'] = scenario;
9491
11125
  }
9492
11126
  const uri = new URL(this.client.config.endpoint + apiPath);
9493
11127
  const apiHeaders = {
9494
11128
  'X-Appwrite-Project': this.client.config.project,
9495
- 'content-type': 'application/json',
9496
11129
  };
9497
- return this.client.call('post', uri, apiHeaders, payload);
11130
+ return this.client.call('get', uri, apiHeaders, payload);
9498
11131
  }
9499
- createProfileRebuild(paramsOrFirst, ...rest) {
11132
+ createPipeline(paramsOrFirst, ...rest) {
9500
11133
  let params;
9501
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
11134
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('scenario' in paramsOrFirst || 'fromDefaults' in paramsOrFirst || 'config' in paramsOrFirst))) {
9502
11135
  params = (paramsOrFirst || {});
9503
11136
  }
9504
11137
  else {
9505
11138
  params = {
9506
- userId: paramsOrFirst,
9507
- profileType: rest[0]
11139
+ scenario: paramsOrFirst,
11140
+ fromDefaults: rest[0],
11141
+ config: rest[1]
9508
11142
  };
9509
11143
  }
9510
- const userId = params.userId;
9511
- const profileType = params.profileType;
9512
- if (typeof userId === 'undefined') {
9513
- throw new AgentbaseException('Missing required parameter: "userId"');
9514
- }
9515
- const apiPath = '/memory/memories/users/{userId}/profile/rebuild'.replace('{userId}', userId);
11144
+ const scenario = params.scenario;
11145
+ const fromDefaults = params.fromDefaults;
11146
+ const config = params.config;
11147
+ const apiPath = '/memory/pipelines';
9516
11148
  const payload = {};
9517
- if (typeof profileType !== 'undefined') {
9518
- payload['profileType'] = profileType;
11149
+ if (typeof scenario !== 'undefined') {
11150
+ payload['scenario'] = scenario;
11151
+ }
11152
+ if (typeof fromDefaults !== 'undefined') {
11153
+ payload['fromDefaults'] = fromDefaults;
11154
+ }
11155
+ if (typeof config !== 'undefined') {
11156
+ payload['config'] = config;
9519
11157
  }
9520
11158
  const uri = new URL(this.client.config.endpoint + apiPath);
9521
11159
  const apiHeaders = {
@@ -9524,48 +11162,54 @@ class Memory {
9524
11162
  };
9525
11163
  return this.client.call('post', uri, apiHeaders, payload);
9526
11164
  }
9527
- listProfileSources(paramsOrFirst, ...rest) {
11165
+ setDefaultPipeline(paramsOrFirst, ...rest) {
9528
11166
  let params;
9529
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
11167
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('scenario' in paramsOrFirst || 'pipelineId' in paramsOrFirst || 'expectedRevision' in paramsOrFirst))) {
9530
11168
  params = (paramsOrFirst || {});
9531
11169
  }
9532
11170
  else {
9533
11171
  params = {
9534
- userId: paramsOrFirst,
9535
- profileType: rest[0]
11172
+ scenario: paramsOrFirst,
11173
+ pipelineId: rest[0],
11174
+ expectedRevision: rest[1]
9536
11175
  };
9537
11176
  }
9538
- const userId = params.userId;
9539
- const profileType = params.profileType;
9540
- if (typeof userId === 'undefined') {
9541
- throw new AgentbaseException('Missing required parameter: "userId"');
9542
- }
9543
- const apiPath = '/memory/memories/users/{userId}/profile/sources'.replace('{userId}', userId);
11177
+ const scenario = params.scenario;
11178
+ const pipelineId = params.pipelineId;
11179
+ const expectedRevision = params.expectedRevision;
11180
+ const apiPath = '/memory/pipelines/default';
9544
11181
  const payload = {};
9545
- if (typeof profileType !== 'undefined') {
9546
- payload['profileType'] = profileType;
11182
+ if (typeof scenario !== 'undefined') {
11183
+ payload['scenario'] = scenario;
11184
+ }
11185
+ if (typeof pipelineId !== 'undefined') {
11186
+ payload['pipelineId'] = pipelineId;
11187
+ }
11188
+ if (typeof expectedRevision !== 'undefined') {
11189
+ payload['expectedRevision'] = expectedRevision;
9547
11190
  }
9548
11191
  const uri = new URL(this.client.config.endpoint + apiPath);
9549
11192
  const apiHeaders = {
9550
11193
  'X-Appwrite-Project': this.client.config.project,
11194
+ 'content-type': 'application/json',
9551
11195
  };
9552
- return this.client.call('get', uri, apiHeaders, payload);
11196
+ return this.client.call('put', uri, apiHeaders, payload);
9553
11197
  }
9554
- get(paramsOrFirst) {
11198
+ getPipeline(paramsOrFirst) {
9555
11199
  let params;
9556
11200
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9557
11201
  params = (paramsOrFirst || {});
9558
11202
  }
9559
11203
  else {
9560
11204
  params = {
9561
- memoryId: paramsOrFirst
11205
+ pipelineId: paramsOrFirst
9562
11206
  };
9563
11207
  }
9564
- const memoryId = params.memoryId;
9565
- if (typeof memoryId === 'undefined') {
9566
- throw new AgentbaseException('Missing required parameter: "memoryId"');
11208
+ const pipelineId = params.pipelineId;
11209
+ if (typeof pipelineId === 'undefined') {
11210
+ throw new AgentbaseException('Missing required parameter: "pipelineId"');
9567
11211
  }
9568
- const apiPath = '/memory/memories/{memoryId}'.replace('{memoryId}', memoryId);
11212
+ const apiPath = '/memory/pipelines/{pipelineId}'.replace('{pipelineId}', pipelineId);
9569
11213
  const payload = {};
9570
11214
  const uri = new URL(this.client.config.endpoint + apiPath);
9571
11215
  const apiHeaders = {
@@ -9573,44 +11217,37 @@ class Memory {
9573
11217
  };
9574
11218
  return this.client.call('get', uri, apiHeaders, payload);
9575
11219
  }
9576
- update(paramsOrFirst, ...rest) {
11220
+ updatePipeline(paramsOrFirst, ...rest) {
9577
11221
  let params;
9578
11222
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9579
11223
  params = (paramsOrFirst || {});
9580
11224
  }
9581
11225
  else {
9582
11226
  params = {
9583
- memoryId: paramsOrFirst,
9584
- version: rest[0],
9585
- content: rest[1],
9586
- metadata: rest[2],
9587
- retentionPolicy: rest[3]
11227
+ pipelineId: paramsOrFirst,
11228
+ expectedRevision: rest[0],
11229
+ config: rest[1]
9588
11230
  };
9589
11231
  }
9590
- const memoryId = params.memoryId;
9591
- const version = params.version;
9592
- const content = params.content;
9593
- const metadata = params.metadata;
9594
- const retentionPolicy = params.retentionPolicy;
9595
- if (typeof memoryId === 'undefined') {
9596
- throw new AgentbaseException('Missing required parameter: "memoryId"');
9597
- }
9598
- if (typeof version === 'undefined') {
9599
- throw new AgentbaseException('Missing required parameter: "version"');
11232
+ const pipelineId = params.pipelineId;
11233
+ const expectedRevision = params.expectedRevision;
11234
+ const config = params.config;
11235
+ if (typeof pipelineId === 'undefined') {
11236
+ throw new AgentbaseException('Missing required parameter: "pipelineId"');
9600
11237
  }
9601
- const apiPath = '/memory/memories/{memoryId}'.replace('{memoryId}', memoryId);
9602
- const payload = {};
9603
- if (typeof version !== 'undefined') {
9604
- payload['version'] = version;
11238
+ if (typeof expectedRevision === 'undefined') {
11239
+ throw new AgentbaseException('Missing required parameter: "expectedRevision"');
9605
11240
  }
9606
- if (typeof content !== 'undefined') {
9607
- payload['content'] = content;
11241
+ if (typeof config === 'undefined') {
11242
+ throw new AgentbaseException('Missing required parameter: "config"');
9608
11243
  }
9609
- if (typeof metadata !== 'undefined') {
9610
- payload['metadata'] = metadata;
11244
+ const apiPath = '/memory/pipelines/{pipelineId}'.replace('{pipelineId}', pipelineId);
11245
+ const payload = {};
11246
+ if (typeof expectedRevision !== 'undefined') {
11247
+ payload['expectedRevision'] = expectedRevision;
9611
11248
  }
9612
- if (typeof retentionPolicy !== 'undefined') {
9613
- payload['retentionPolicy'] = retentionPolicy;
11249
+ if (typeof config !== 'undefined') {
11250
+ payload['config'] = config;
9614
11251
  }
9615
11252
  const uri = new URL(this.client.config.endpoint + apiPath);
9616
11253
  const apiHeaders = {
@@ -9619,31 +11256,29 @@ class Memory {
9619
11256
  };
9620
11257
  return this.client.call('patch', uri, apiHeaders, payload);
9621
11258
  }
9622
- delete(paramsOrFirst, ...rest) {
11259
+ deletePipeline(paramsOrFirst, ...rest) {
9623
11260
  let params;
9624
11261
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9625
11262
  params = (paramsOrFirst || {});
9626
11263
  }
9627
11264
  else {
9628
11265
  params = {
9629
- memoryId: paramsOrFirst,
9630
- reason: rest[0],
9631
- source: rest[1]
11266
+ pipelineId: paramsOrFirst,
11267
+ expectedRevision: rest[0]
9632
11268
  };
9633
11269
  }
9634
- const memoryId = params.memoryId;
9635
- const reason = params.reason;
9636
- const source = params.source;
9637
- if (typeof memoryId === 'undefined') {
9638
- throw new AgentbaseException('Missing required parameter: "memoryId"');
11270
+ const pipelineId = params.pipelineId;
11271
+ const expectedRevision = params.expectedRevision;
11272
+ if (typeof pipelineId === 'undefined') {
11273
+ throw new AgentbaseException('Missing required parameter: "pipelineId"');
9639
11274
  }
9640
- const apiPath = '/memory/memories/{memoryId}'.replace('{memoryId}', memoryId);
9641
- const payload = {};
9642
- if (typeof reason !== 'undefined') {
9643
- payload['reason'] = reason;
11275
+ if (typeof expectedRevision === 'undefined') {
11276
+ throw new AgentbaseException('Missing required parameter: "expectedRevision"');
9644
11277
  }
9645
- if (typeof source !== 'undefined') {
9646
- payload['source'] = source;
11278
+ const apiPath = '/memory/pipelines/{pipelineId}'.replace('{pipelineId}', pipelineId);
11279
+ const payload = {};
11280
+ if (typeof expectedRevision !== 'undefined') {
11281
+ payload['expectedRevision'] = expectedRevision;
9647
11282
  }
9648
11283
  const uri = new URL(this.client.config.endpoint + apiPath);
9649
11284
  const apiHeaders = {
@@ -9652,64 +11287,81 @@ class Memory {
9652
11287
  };
9653
11288
  return this.client.call('delete', uri, apiHeaders, payload);
9654
11289
  }
9655
- listShares(paramsOrFirst) {
11290
+ publishPipeline(paramsOrFirst, ...rest) {
9656
11291
  let params;
9657
11292
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9658
11293
  params = (paramsOrFirst || {});
9659
11294
  }
9660
11295
  else {
9661
11296
  params = {
9662
- memoryId: paramsOrFirst
11297
+ pipelineId: paramsOrFirst,
11298
+ versionId: rest[0],
11299
+ expectedRevision: rest[1],
11300
+ makeDefault: rest[2]
9663
11301
  };
9664
11302
  }
9665
- const memoryId = params.memoryId;
9666
- if (typeof memoryId === 'undefined') {
9667
- throw new AgentbaseException('Missing required parameter: "memoryId"');
11303
+ const pipelineId = params.pipelineId;
11304
+ const versionId = params.versionId;
11305
+ const expectedRevision = params.expectedRevision;
11306
+ const makeDefault = params.makeDefault;
11307
+ if (typeof pipelineId === 'undefined') {
11308
+ throw new AgentbaseException('Missing required parameter: "pipelineId"');
9668
11309
  }
9669
- const apiPath = '/memory/memories/{memoryId}/shares'.replace('{memoryId}', memoryId);
11310
+ if (typeof versionId === 'undefined') {
11311
+ throw new AgentbaseException('Missing required parameter: "versionId"');
11312
+ }
11313
+ if (typeof expectedRevision === 'undefined') {
11314
+ throw new AgentbaseException('Missing required parameter: "expectedRevision"');
11315
+ }
11316
+ const apiPath = '/memory/pipelines/{pipelineId}/publish'.replace('{pipelineId}', pipelineId);
9670
11317
  const payload = {};
11318
+ if (typeof versionId !== 'undefined') {
11319
+ payload['versionId'] = versionId;
11320
+ }
11321
+ if (typeof expectedRevision !== 'undefined') {
11322
+ payload['expectedRevision'] = expectedRevision;
11323
+ }
11324
+ if (typeof makeDefault !== 'undefined') {
11325
+ payload['makeDefault'] = makeDefault;
11326
+ }
9671
11327
  const uri = new URL(this.client.config.endpoint + apiPath);
9672
11328
  const apiHeaders = {
9673
11329
  'X-Appwrite-Project': this.client.config.project,
11330
+ 'content-type': 'application/json',
9674
11331
  };
9675
- return this.client.call('get', uri, apiHeaders, payload);
11332
+ return this.client.call('post', uri, apiHeaders, payload);
9676
11333
  }
9677
- createShare(paramsOrFirst, ...rest) {
11334
+ rollbackPipeline(paramsOrFirst, ...rest) {
9678
11335
  let params;
9679
11336
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9680
11337
  params = (paramsOrFirst || {});
9681
11338
  }
9682
11339
  else {
9683
11340
  params = {
9684
- memoryId: paramsOrFirst,
9685
- subjectType: rest[0],
9686
- subjectId: rest[1],
9687
- expiresAt: rest[2]
11341
+ pipelineId: paramsOrFirst,
11342
+ versionId: rest[0],
11343
+ expectedRevision: rest[1]
9688
11344
  };
9689
11345
  }
9690
- const memoryId = params.memoryId;
9691
- const subjectType = params.subjectType;
9692
- const subjectId = params.subjectId;
9693
- const expiresAt = params.expiresAt;
9694
- if (typeof memoryId === 'undefined') {
9695
- throw new AgentbaseException('Missing required parameter: "memoryId"');
11346
+ const pipelineId = params.pipelineId;
11347
+ const versionId = params.versionId;
11348
+ const expectedRevision = params.expectedRevision;
11349
+ if (typeof pipelineId === 'undefined') {
11350
+ throw new AgentbaseException('Missing required parameter: "pipelineId"');
9696
11351
  }
9697
- if (typeof subjectType === 'undefined') {
9698
- throw new AgentbaseException('Missing required parameter: "subjectType"');
11352
+ if (typeof versionId === 'undefined') {
11353
+ throw new AgentbaseException('Missing required parameter: "versionId"');
9699
11354
  }
9700
- if (typeof subjectId === 'undefined') {
9701
- throw new AgentbaseException('Missing required parameter: "subjectId"');
11355
+ if (typeof expectedRevision === 'undefined') {
11356
+ throw new AgentbaseException('Missing required parameter: "expectedRevision"');
9702
11357
  }
9703
- const apiPath = '/memory/memories/{memoryId}/shares'.replace('{memoryId}', memoryId);
11358
+ const apiPath = '/memory/pipelines/{pipelineId}/rollback'.replace('{pipelineId}', pipelineId);
9704
11359
  const payload = {};
9705
- if (typeof subjectType !== 'undefined') {
9706
- payload['subjectType'] = subjectType;
9707
- }
9708
- if (typeof subjectId !== 'undefined') {
9709
- payload['subjectId'] = subjectId;
11360
+ if (typeof versionId !== 'undefined') {
11361
+ payload['versionId'] = versionId;
9710
11362
  }
9711
- if (typeof expiresAt !== 'undefined') {
9712
- payload['expiresAt'] = expiresAt;
11363
+ if (typeof expectedRevision !== 'undefined') {
11364
+ payload['expectedRevision'] = expectedRevision;
9713
11365
  }
9714
11366
  const uri = new URL(this.client.config.endpoint + apiPath);
9715
11367
  const apiHeaders = {
@@ -9718,59 +11370,75 @@ class Memory {
9718
11370
  };
9719
11371
  return this.client.call('post', uri, apiHeaders, payload);
9720
11372
  }
9721
- deleteShare(paramsOrFirst, ...rest) {
11373
+ validatePipeline(paramsOrFirst, ...rest) {
9722
11374
  let params;
9723
11375
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9724
11376
  params = (paramsOrFirst || {});
9725
11377
  }
9726
11378
  else {
9727
11379
  params = {
9728
- memoryId: paramsOrFirst,
9729
- shareId: rest[0]
11380
+ pipelineId: paramsOrFirst,
11381
+ versionId: rest[0],
11382
+ data: rest[1],
11383
+ scenario: rest[2]
9730
11384
  };
9731
11385
  }
9732
- const memoryId = params.memoryId;
9733
- const shareId = params.shareId;
9734
- if (typeof memoryId === 'undefined') {
9735
- throw new AgentbaseException('Missing required parameter: "memoryId"');
11386
+ const pipelineId = params.pipelineId;
11387
+ const versionId = params.versionId;
11388
+ const data = params.data;
11389
+ const scenario = params.scenario;
11390
+ if (typeof pipelineId === 'undefined') {
11391
+ throw new AgentbaseException('Missing required parameter: "pipelineId"');
9736
11392
  }
9737
- if (typeof shareId === 'undefined') {
9738
- throw new AgentbaseException('Missing required parameter: "shareId"');
11393
+ if (typeof versionId === 'undefined') {
11394
+ throw new AgentbaseException('Missing required parameter: "versionId"');
9739
11395
  }
9740
- const apiPath = '/memory/memories/{memoryId}/shares/{shareId}'.replace('{memoryId}', memoryId).replace('{shareId}', shareId);
11396
+ if (typeof data === 'undefined') {
11397
+ throw new AgentbaseException('Missing required parameter: "data"');
11398
+ }
11399
+ const apiPath = '/memory/pipelines/{pipelineId}/validate'.replace('{pipelineId}', pipelineId);
9741
11400
  const payload = {};
11401
+ if (typeof versionId !== 'undefined') {
11402
+ payload['versionId'] = versionId;
11403
+ }
11404
+ if (typeof scenario !== 'undefined') {
11405
+ payload['scenario'] = scenario;
11406
+ }
11407
+ if (typeof data !== 'undefined') {
11408
+ payload['data'] = data;
11409
+ }
9742
11410
  const uri = new URL(this.client.config.endpoint + apiPath);
9743
11411
  const apiHeaders = {
9744
11412
  'X-Appwrite-Project': this.client.config.project,
9745
11413
  'content-type': 'application/json',
9746
11414
  };
9747
- return this.client.call('delete', uri, apiHeaders, payload);
11415
+ return this.client.call('post', uri, apiHeaders, payload);
9748
11416
  }
9749
- listSources(paramsOrFirst, ...rest) {
11417
+ listPipelineVersions(paramsOrFirst, ...rest) {
9750
11418
  let params;
9751
11419
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9752
11420
  params = (paramsOrFirst || {});
9753
11421
  }
9754
11422
  else {
9755
11423
  params = {
9756
- memoryId: paramsOrFirst,
9757
- cursor: rest[0],
9758
- limit: rest[1]
11424
+ pipelineId: paramsOrFirst,
11425
+ versionId: rest[0],
11426
+ beforeRevision: rest[1]
9759
11427
  };
9760
11428
  }
9761
- const memoryId = params.memoryId;
9762
- const cursor = params.cursor;
9763
- const limit = params.limit;
9764
- if (typeof memoryId === 'undefined') {
9765
- throw new AgentbaseException('Missing required parameter: "memoryId"');
11429
+ const pipelineId = params.pipelineId;
11430
+ const versionId = params.versionId;
11431
+ const beforeRevision = params.beforeRevision;
11432
+ if (typeof pipelineId === 'undefined') {
11433
+ throw new AgentbaseException('Missing required parameter: "pipelineId"');
9766
11434
  }
9767
- const apiPath = '/memory/memories/{memoryId}/sources'.replace('{memoryId}', memoryId);
11435
+ const apiPath = '/memory/pipelines/{pipelineId}/versions'.replace('{pipelineId}', pipelineId);
9768
11436
  const payload = {};
9769
- if (typeof cursor !== 'undefined') {
9770
- payload['cursor'] = cursor;
11437
+ if (typeof versionId !== 'undefined') {
11438
+ payload['versionId'] = versionId;
9771
11439
  }
9772
- if (typeof limit !== 'undefined') {
9773
- payload['limit'] = limit;
11440
+ if (typeof beforeRevision !== 'undefined') {
11441
+ payload['beforeRevision'] = beforeRevision;
9774
11442
  }
9775
11443
  const uri = new URL(this.client.config.endpoint + apiPath);
9776
11444
  const apiHeaders = {
@@ -13429,6 +15097,12 @@ exports.AuthenticationFactor = void 0;
13429
15097
  AuthenticationFactor["Recoverycode"] = "recoverycode";
13430
15098
  })(exports.AuthenticationFactor || (exports.AuthenticationFactor = {}));
13431
15099
 
15100
+ exports.Scene = void 0;
15101
+ (function (Scene) {
15102
+ Scene["Verify"] = "verify";
15103
+ Scene["AccountChange"] = "accountChange";
15104
+ })(exports.Scene || (exports.Scene = {}));
15105
+
13432
15106
  exports.OAuthProvider = void 0;
13433
15107
  (function (OAuthProvider) {
13434
15108
  OAuthProvider["Amazon"] = "amazon";
@@ -13493,6 +15167,12 @@ exports.Status = void 0;
13493
15167
  Status["PartialFailed"] = "partial_failed";
13494
15168
  Status["Failed"] = "failed";
13495
15169
  Status["Dead"] = "dead";
15170
+ Status["Pending"] = "pending";
15171
+ Status["Approved"] = "approved";
15172
+ Status["Rejected"] = "rejected";
15173
+ Status["Superseded"] = "superseded";
15174
+ Status["Disabled"] = "disabled";
15175
+ Status["Error"] = "error";
13496
15176
  })(exports.Status || (exports.Status = {}));
13497
15177
 
13498
15178
  exports.Browser = void 0;
@@ -13962,6 +15642,7 @@ exports.Timezone = void 0;
13962
15642
  Timezone["AsiaBaku"] = "asia/baku";
13963
15643
  Timezone["AsiaBangkok"] = "asia/bangkok";
13964
15644
  Timezone["AsiaBarnaul"] = "asia/barnaul";
15645
+ Timezone["AsiaBeijing"] = "asia/beijing";
13965
15646
  Timezone["AsiaBeirut"] = "asia/beirut";
13966
15647
  Timezone["AsiaBishkek"] = "asia/bishkek";
13967
15648
  Timezone["AsiaBrunei"] = "asia/brunei";
@@ -14197,6 +15878,23 @@ exports.ImageFormat = void 0;
14197
15878
  ImageFormat["Gif"] = "gif";
14198
15879
  })(exports.ImageFormat || (exports.ImageFormat = {}));
14199
15880
 
15881
+ exports.PathMatch = void 0;
15882
+ (function (PathMatch) {
15883
+ PathMatch["Exact"] = "exact";
15884
+ PathMatch["Regex"] = "regex";
15885
+ })(exports.PathMatch || (exports.PathMatch = {}));
15886
+
15887
+ exports.Method = void 0;
15888
+ (function (Method) {
15889
+ Method["GET"] = "GET";
15890
+ Method["POST"] = "POST";
15891
+ Method["PUT"] = "PUT";
15892
+ Method["PATCH"] = "PATCH";
15893
+ Method["DELETE"] = "DELETE";
15894
+ Method["OPTIONS"] = "OPTIONS";
15895
+ Method["HEAD"] = "HEAD";
15896
+ })(exports.Method || (exports.Method = {}));
15897
+
14200
15898
  exports.ExecutionMethod = void 0;
14201
15899
  (function (ExecutionMethod) {
14202
15900
  ExecutionMethod["GET"] = "GET";
@@ -14321,6 +16019,12 @@ exports.VerificationSource = void 0;
14321
16019
  VerificationSource["Toolresult"] = "tool-result";
14322
16020
  })(exports.VerificationSource || (exports.VerificationSource = {}));
14323
16021
 
16022
+ exports.ProfileType = void 0;
16023
+ (function (ProfileType) {
16024
+ ProfileType["Content"] = "content";
16025
+ ProfileType["Topics"] = "topics";
16026
+ })(exports.ProfileType || (exports.ProfileType = {}));
16027
+
14324
16028
  exports.Kinds = void 0;
14325
16029
  (function (Kinds) {
14326
16030
  Kinds["Memory"] = "memory";
@@ -14329,12 +16033,6 @@ exports.Kinds = void 0;
14329
16033
  Kinds["Experience"] = "experience";
14330
16034
  })(exports.Kinds || (exports.Kinds = {}));
14331
16035
 
14332
- exports.ProfileType = void 0;
14333
- (function (ProfileType) {
14334
- ProfileType["Content"] = "content";
14335
- ProfileType["Topics"] = "topics";
14336
- })(exports.ProfileType || (exports.ProfileType = {}));
14337
-
14338
16036
  exports.ProfileExtractionMode = void 0;
14339
16037
  (function (ProfileExtractionMode) {
14340
16038
  ProfileExtractionMode["Incremental"] = "incremental";
@@ -14352,6 +16050,14 @@ exports.MemoryShareSubjectType = void 0;
14352
16050
  MemoryShareSubjectType["Group"] = "group";
14353
16051
  })(exports.MemoryShareSubjectType || (exports.MemoryShareSubjectType = {}));
14354
16052
 
16053
+ exports.Scenario = void 0;
16054
+ (function (Scenario) {
16055
+ Scenario["AddMemory"] = "add_memory";
16056
+ Scenario["Profile"] = "profile";
16057
+ Scenario["Distillation"] = "distillation";
16058
+ Scenario["Forgetting"] = "forgetting";
16059
+ })(exports.Scenario || (exports.Scenario = {}));
16060
+
14355
16061
  exports.OrganizationRole = void 0;
14356
16062
  (function (OrganizationRole) {
14357
16063
  OrganizationRole["Owner"] = "owner";
@@ -14396,6 +16102,12 @@ exports.TransactionAction = void 0;
14396
16102
  TransactionAction["BulkDelete"] = "bulkDelete";
14397
16103
  })(exports.TransactionAction || (exports.TransactionAction = {}));
14398
16104
 
16105
+ exports.DataApiFilterLogic = void 0;
16106
+ (function (DataApiFilterLogic) {
16107
+ DataApiFilterLogic["And"] = "AND";
16108
+ DataApiFilterLogic["Or"] = "OR";
16109
+ })(exports.DataApiFilterLogic || (exports.DataApiFilterLogic = {}));
16110
+
14399
16111
  exports.MemoryMessageRole = void 0;
14400
16112
  (function (MemoryMessageRole) {
14401
16113
  MemoryMessageRole["User"] = "user";
@@ -14438,6 +16150,63 @@ exports.DistillationToolStatus = void 0;
14438
16150
  DistillationToolStatus["Failed"] = "failed";
14439
16151
  })(exports.DistillationToolStatus || (exports.DistillationToolStatus = {}));
14440
16152
 
16153
+ exports.DataApiOwnedBindingPrincipalType = void 0;
16154
+ (function (DataApiOwnedBindingPrincipalType) {
16155
+ DataApiOwnedBindingPrincipalType["USER"] = "USER";
16156
+ DataApiOwnedBindingPrincipalType["SERVICE"] = "SERVICE";
16157
+ })(exports.DataApiOwnedBindingPrincipalType || (exports.DataApiOwnedBindingPrincipalType = {}));
16158
+
16159
+ exports.DataApiOwnedBindingStatus = void 0;
16160
+ (function (DataApiOwnedBindingStatus) {
16161
+ DataApiOwnedBindingStatus["ACTIVE"] = "ACTIVE";
16162
+ DataApiOwnedBindingStatus["DISABLED"] = "DISABLED";
16163
+ })(exports.DataApiOwnedBindingStatus || (exports.DataApiOwnedBindingStatus = {}));
16164
+
16165
+ exports.DataApiCatalogDataSourceDatabaseType = void 0;
16166
+ (function (DataApiCatalogDataSourceDatabaseType) {
16167
+ DataApiCatalogDataSourceDatabaseType["OBMYSQL"] = "OB_MYSQL";
16168
+ DataApiCatalogDataSourceDatabaseType["OBORACLE"] = "OB_ORACLE";
16169
+ DataApiCatalogDataSourceDatabaseType["MYSQL"] = "MYSQL";
16170
+ DataApiCatalogDataSourceDatabaseType["ORACLE"] = "ORACLE";
16171
+ })(exports.DataApiCatalogDataSourceDatabaseType || (exports.DataApiCatalogDataSourceDatabaseType = {}));
16172
+
16173
+ exports.DataApiCatalogDataSourceVisibilitySource = void 0;
16174
+ (function (DataApiCatalogDataSourceVisibilitySource) {
16175
+ DataApiCatalogDataSourceVisibilitySource["ORGANIZATIONOWNER"] = "ORGANIZATION_OWNER";
16176
+ DataApiCatalogDataSourceVisibilitySource["PROJECTDATASOURCEGRANT"] = "PROJECT_DATA_SOURCE_GRANT";
16177
+ DataApiCatalogDataSourceVisibilitySource["CONTROLPLANEPOLICY"] = "CONTROL_PLANE_POLICY";
16178
+ DataApiCatalogDataSourceVisibilitySource["ACCESSBINDING"] = "ACCESS_BINDING";
16179
+ DataApiCatalogDataSourceVisibilitySource["BOTH"] = "BOTH";
16180
+ })(exports.DataApiCatalogDataSourceVisibilitySource || (exports.DataApiCatalogDataSourceVisibilitySource = {}));
16181
+
16182
+ exports.DataApiCatalogDatabaseClassification = void 0;
16183
+ (function (DataApiCatalogDatabaseClassification) {
16184
+ DataApiCatalogDatabaseClassification["USER"] = "USER";
16185
+ DataApiCatalogDatabaseClassification["SYSTEM"] = "SYSTEM";
16186
+ })(exports.DataApiCatalogDatabaseClassification || (exports.DataApiCatalogDatabaseClassification = {}));
16187
+
16188
+ exports.DataApiCatalogDatabaseStatus = void 0;
16189
+ (function (DataApiCatalogDatabaseStatus) {
16190
+ DataApiCatalogDatabaseStatus["VALID"] = "VALID";
16191
+ DataApiCatalogDatabaseStatus["INVALID"] = "INVALID";
16192
+ })(exports.DataApiCatalogDatabaseStatus || (exports.DataApiCatalogDatabaseStatus = {}));
16193
+
16194
+ exports.DataApiCatalogDatabaseAvailability = void 0;
16195
+ (function (DataApiCatalogDatabaseAvailability) {
16196
+ DataApiCatalogDatabaseAvailability["UNKNOWN"] = "UNKNOWN";
16197
+ DataApiCatalogDatabaseAvailability["AVAILABLE"] = "AVAILABLE";
16198
+ DataApiCatalogDatabaseAvailability["UNAVAILABLE"] = "UNAVAILABLE";
16199
+ })(exports.DataApiCatalogDatabaseAvailability || (exports.DataApiCatalogDatabaseAvailability = {}));
16200
+
16201
+ exports.DataApiCatalogDatabaseVisibilitySource = void 0;
16202
+ (function (DataApiCatalogDatabaseVisibilitySource) {
16203
+ DataApiCatalogDatabaseVisibilitySource["ORGANIZATIONOWNER"] = "ORGANIZATION_OWNER";
16204
+ DataApiCatalogDatabaseVisibilitySource["PROJECTDATASOURCEGRANT"] = "PROJECT_DATA_SOURCE_GRANT";
16205
+ DataApiCatalogDatabaseVisibilitySource["CONTROLPLANEPOLICY"] = "CONTROL_PLANE_POLICY";
16206
+ DataApiCatalogDatabaseVisibilitySource["ACCESSBINDING"] = "ACCESS_BINDING";
16207
+ DataApiCatalogDatabaseVisibilitySource["BOTH"] = "BOTH";
16208
+ })(exports.DataApiCatalogDatabaseVisibilitySource || (exports.DataApiCatalogDatabaseVisibilitySource = {}));
16209
+
14441
16210
  exports.ExecutionTrigger = void 0;
14442
16211
  (function (ExecutionTrigger) {
14443
16212
  ExecutionTrigger["Http"] = "http";
@@ -14492,6 +16261,28 @@ exports.MemoryBulkDeleteResponseStatus = void 0;
14492
16261
  MemoryBulkDeleteResponseStatus["PartialFailed"] = "partial_failed";
14493
16262
  })(exports.MemoryBulkDeleteResponseStatus || (exports.MemoryBulkDeleteResponseStatus = {}));
14494
16263
 
16264
+ exports.MemoryPipelineRunResultStatus = void 0;
16265
+ (function (MemoryPipelineRunResultStatus) {
16266
+ MemoryPipelineRunResultStatus["Completed"] = "completed";
16267
+ MemoryPipelineRunResultStatus["Failed"] = "failed";
16268
+ })(exports.MemoryPipelineRunResultStatus || (exports.MemoryPipelineRunResultStatus = {}));
16269
+
16270
+ exports.MemoryPipelineRunScenario = void 0;
16271
+ (function (MemoryPipelineRunScenario) {
16272
+ MemoryPipelineRunScenario["AddMemory"] = "add_memory";
16273
+ MemoryPipelineRunScenario["Profile"] = "profile";
16274
+ MemoryPipelineRunScenario["Distillation"] = "distillation";
16275
+ MemoryPipelineRunScenario["Forgetting"] = "forgetting";
16276
+ })(exports.MemoryPipelineRunScenario || (exports.MemoryPipelineRunScenario = {}));
16277
+
16278
+ exports.MemoryPipelineRunStatus = void 0;
16279
+ (function (MemoryPipelineRunStatus) {
16280
+ MemoryPipelineRunStatus["Queued"] = "queued";
16281
+ MemoryPipelineRunStatus["Running"] = "running";
16282
+ MemoryPipelineRunStatus["Completed"] = "completed";
16283
+ MemoryPipelineRunStatus["Failed"] = "failed";
16284
+ })(exports.MemoryPipelineRunStatus || (exports.MemoryPipelineRunStatus = {}));
16285
+
14495
16286
  exports.KnowledgeBaseDataSourceDocumentImportResultStatus = void 0;
14496
16287
  (function (KnowledgeBaseDataSourceDocumentImportResultStatus) {
14497
16288
  KnowledgeBaseDataSourceDocumentImportResultStatus["Accepted"] = "accepted";
@@ -14506,6 +16297,7 @@ exports.AiGateway = AiGateway;
14506
16297
  exports.Avatars = Avatars;
14507
16298
  exports.Channel = Channel;
14508
16299
  exports.Client = Client;
16300
+ exports.DataApi = DataApi;
14509
16301
  exports.Databases = Databases;
14510
16302
  exports.DocumentsDB = DocumentsDB;
14511
16303
  exports.Functions = Functions;