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