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/iife/sdk.js CHANGED
@@ -4393,7 +4393,7 @@
4393
4393
  * Holds configuration such as project.
4394
4394
  */
4395
4395
  this.config = {
4396
- endpoint: 'https://appbase.local/v1',
4396
+ endpoint: 'https://example.com[HOSTNAME]/v1',
4397
4397
  endpointRealtime: '',
4398
4398
  project: '',
4399
4399
  organization: '',
@@ -4412,9 +4412,9 @@
4412
4412
  'x-sdk-name': 'Agentbase',
4413
4413
  'x-sdk-platform': 'client',
4414
4414
  'x-sdk-language': 'web',
4415
- 'x-sdk-version': '2.9.0',
4415
+ 'x-sdk-version': '2.12.0',
4416
4416
  'X-AppBase-SDK': 'true',
4417
- 'X-Appwrite-Response-Format': '2.9.0',
4417
+ 'X-Appwrite-Response-Format': '2.12.0',
4418
4418
  };
4419
4419
  this.realtime = {
4420
4420
  socket: undefined,
@@ -5956,6 +5956,131 @@
5956
5956
  };
5957
5957
  return this.client.call('patch', uri, apiHeaders, payload);
5958
5958
  }
5959
+ changePhone(paramsOrFirst, ...rest) {
5960
+ let params;
5961
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
5962
+ params = (paramsOrFirst || {});
5963
+ }
5964
+ else {
5965
+ params = {
5966
+ newPhone: paramsOrFirst,
5967
+ challengeId: rest[0],
5968
+ code: rest[1],
5969
+ password: rest[2]
5970
+ };
5971
+ }
5972
+ const newPhone = params.newPhone;
5973
+ const challengeId = params.challengeId;
5974
+ const code = params.code;
5975
+ const password = params.password;
5976
+ if (typeof newPhone === 'undefined') {
5977
+ throw new AgentbaseException('Missing required parameter: "newPhone"');
5978
+ }
5979
+ if (typeof challengeId === 'undefined') {
5980
+ throw new AgentbaseException('Missing required parameter: "challengeId"');
5981
+ }
5982
+ if (typeof code === 'undefined') {
5983
+ throw new AgentbaseException('Missing required parameter: "code"');
5984
+ }
5985
+ const apiPath = '/account/phone/change';
5986
+ const payload = {};
5987
+ if (typeof newPhone !== 'undefined') {
5988
+ payload['newPhone'] = newPhone;
5989
+ }
5990
+ if (typeof challengeId !== 'undefined') {
5991
+ payload['challengeId'] = challengeId;
5992
+ }
5993
+ if (typeof code !== 'undefined') {
5994
+ payload['code'] = code;
5995
+ }
5996
+ if (typeof password !== 'undefined') {
5997
+ payload['password'] = password;
5998
+ }
5999
+ const uri = new URL(this.client.config.endpoint + apiPath);
6000
+ const apiHeaders = {
6001
+ 'X-Appwrite-Project': this.client.config.project,
6002
+ 'content-type': 'application/json',
6003
+ };
6004
+ return this.client.call('post', uri, apiHeaders, payload);
6005
+ }
6006
+ sendPhoneCode(paramsOrFirst, ...rest) {
6007
+ let params;
6008
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
6009
+ params = (paramsOrFirst || {});
6010
+ }
6011
+ else {
6012
+ params = {
6013
+ phone: paramsOrFirst,
6014
+ userId: rest[0],
6015
+ scene: rest[1]
6016
+ };
6017
+ }
6018
+ const phone = params.phone;
6019
+ const userId = params.userId;
6020
+ const scene = params.scene;
6021
+ if (typeof phone === 'undefined') {
6022
+ throw new AgentbaseException('Missing required parameter: "phone"');
6023
+ }
6024
+ const apiPath = '/account/phone/send-code';
6025
+ const payload = {};
6026
+ if (typeof userId !== 'undefined') {
6027
+ payload['userId'] = userId;
6028
+ }
6029
+ if (typeof phone !== 'undefined') {
6030
+ payload['phone'] = phone;
6031
+ }
6032
+ if (typeof scene !== 'undefined') {
6033
+ payload['scene'] = scene;
6034
+ }
6035
+ const uri = new URL(this.client.config.endpoint + apiPath);
6036
+ const apiHeaders = {
6037
+ 'X-Appwrite-Project': this.client.config.project,
6038
+ 'content-type': 'application/json',
6039
+ };
6040
+ return this.client.call('post', uri, apiHeaders, payload);
6041
+ }
6042
+ verifyPhone(paramsOrFirst, ...rest) {
6043
+ let params;
6044
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
6045
+ params = (paramsOrFirst || {});
6046
+ }
6047
+ else {
6048
+ params = {
6049
+ challengeId: paramsOrFirst,
6050
+ phone: rest[0],
6051
+ code: rest[1]
6052
+ };
6053
+ }
6054
+ const challengeId = params.challengeId;
6055
+ const phone = params.phone;
6056
+ const code = params.code;
6057
+ if (typeof challengeId === 'undefined') {
6058
+ throw new AgentbaseException('Missing required parameter: "challengeId"');
6059
+ }
6060
+ if (typeof phone === 'undefined') {
6061
+ throw new AgentbaseException('Missing required parameter: "phone"');
6062
+ }
6063
+ if (typeof code === 'undefined') {
6064
+ throw new AgentbaseException('Missing required parameter: "code"');
6065
+ }
6066
+ const apiPath = '/account/phone/verify';
6067
+ const payload = {};
6068
+ if (typeof challengeId !== 'undefined') {
6069
+ payload['challengeId'] = challengeId;
6070
+ }
6071
+ if (typeof phone !== 'undefined') {
6072
+ payload['phone'] = phone;
6073
+ }
6074
+ if (typeof code !== 'undefined') {
6075
+ payload['code'] = code;
6076
+ }
6077
+ const uri = new URL(this.client.config.endpoint + apiPath);
6078
+ const apiHeaders = {
6079
+ 'X-Appwrite-Project': this.client.config.project,
6080
+ 'content-type': 'application/json',
6081
+ };
6082
+ return this.client.call('post', uri, apiHeaders, payload);
6083
+ }
5959
6084
  /**
5960
6085
  * Get the preferences as a key-value object for the currently logged in user.
5961
6086
  *
@@ -6487,7 +6612,8 @@
6487
6612
  return this.client.call('delete', uri, apiHeaders, payload);
6488
6613
  }
6489
6614
  /**
6490
- * 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.
6615
+ * 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.
6616
+ *
6491
6617
  *
6492
6618
  * @throws {AgentbaseException}
6493
6619
  * @returns {Promise<Models.User<Preferences>>}
@@ -6733,11 +6859,13 @@
6733
6859
  else {
6734
6860
  params = {
6735
6861
  userId: paramsOrFirst,
6736
- phone: rest[0]
6862
+ phone: rest[0],
6863
+ scene: rest[1]
6737
6864
  };
6738
6865
  }
6739
6866
  const userId = params.userId;
6740
6867
  const phone = params.phone;
6868
+ const scene = params.scene;
6741
6869
  if (typeof userId === 'undefined') {
6742
6870
  throw new AgentbaseException('Missing required parameter: "userId"');
6743
6871
  }
@@ -6752,6 +6880,9 @@
6752
6880
  if (typeof phone !== 'undefined') {
6753
6881
  payload['phone'] = phone;
6754
6882
  }
6883
+ if (typeof scene !== 'undefined') {
6884
+ payload['scene'] = scene;
6885
+ }
6755
6886
  const uri = new URL(this.client.config.endpoint + apiPath);
6756
6887
  const apiHeaders = {
6757
6888
  'X-Appwrite-Project': this.client.config.project,
@@ -7488,6 +7619,89 @@
7488
7619
  constructor(client) {
7489
7620
  this.client = client;
7490
7621
  }
7622
+ /**
7623
+ * Manage unified AI Gateway control-plane resources.
7624
+ *
7625
+ * @throws {AgentbaseException}
7626
+ * @returns {Promise<{}>}
7627
+ */
7628
+ listApprovalRequests() {
7629
+ const apiPath = '/ai-gateway/approval-requests';
7630
+ const payload = {};
7631
+ const uri = new URL(this.client.config.endpoint + apiPath);
7632
+ const apiHeaders = {
7633
+ 'X-Appwrite-Project': this.client.config.project,
7634
+ };
7635
+ return this.client.call('get', uri, apiHeaders, payload);
7636
+ }
7637
+ getApprovalRequest(paramsOrFirst) {
7638
+ let params;
7639
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
7640
+ params = (paramsOrFirst || {});
7641
+ }
7642
+ else {
7643
+ params = {
7644
+ id: paramsOrFirst
7645
+ };
7646
+ }
7647
+ const id = params.id;
7648
+ if (typeof id === 'undefined') {
7649
+ throw new AgentbaseException('Missing required parameter: "id"');
7650
+ }
7651
+ const apiPath = '/ai-gateway/approval-requests/{id}'.replace('{id}', id);
7652
+ const payload = {};
7653
+ const uri = new URL(this.client.config.endpoint + apiPath);
7654
+ const apiHeaders = {
7655
+ 'X-Appwrite-Project': this.client.config.project,
7656
+ };
7657
+ return this.client.call('get', uri, apiHeaders, payload);
7658
+ }
7659
+ approveApprovalRequest(paramsOrFirst) {
7660
+ let params;
7661
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
7662
+ params = (paramsOrFirst || {});
7663
+ }
7664
+ else {
7665
+ params = {
7666
+ id: paramsOrFirst
7667
+ };
7668
+ }
7669
+ const id = params.id;
7670
+ if (typeof id === 'undefined') {
7671
+ throw new AgentbaseException('Missing required parameter: "id"');
7672
+ }
7673
+ const apiPath = '/ai-gateway/approval-requests/{id}/approve'.replace('{id}', id);
7674
+ const payload = {};
7675
+ const uri = new URL(this.client.config.endpoint + apiPath);
7676
+ const apiHeaders = {
7677
+ 'X-Appwrite-Project': this.client.config.project,
7678
+ 'content-type': 'application/json',
7679
+ };
7680
+ return this.client.call('post', uri, apiHeaders, payload);
7681
+ }
7682
+ rejectApprovalRequest(paramsOrFirst) {
7683
+ let params;
7684
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
7685
+ params = (paramsOrFirst || {});
7686
+ }
7687
+ else {
7688
+ params = {
7689
+ id: paramsOrFirst
7690
+ };
7691
+ }
7692
+ const id = params.id;
7693
+ if (typeof id === 'undefined') {
7694
+ throw new AgentbaseException('Missing required parameter: "id"');
7695
+ }
7696
+ const apiPath = '/ai-gateway/approval-requests/{id}/reject'.replace('{id}', id);
7697
+ const payload = {};
7698
+ const uri = new URL(this.client.config.endpoint + apiPath);
7699
+ const apiHeaders = {
7700
+ 'X-Appwrite-Project': this.client.config.project,
7701
+ 'content-type': 'application/json',
7702
+ };
7703
+ return this.client.call('post', uri, apiHeaders, payload);
7704
+ }
7491
7705
  updateGatewayPolicy(paramsOrFirst) {
7492
7706
  let params;
7493
7707
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -7556,6 +7770,26 @@
7556
7770
  };
7557
7771
  return this.client.call('get', uri, apiHeaders, payload);
7558
7772
  }
7773
+ /**
7774
+ * 读取当前 Shared V2 项目的 Tool Gateway 初始化状态。请求为 `GET /v1/ai-gateway/initialization-status`,无请求参数。调用方需要项目访问权限和 `aiGateway.read` scope。
7775
+ *
7776
+ * 成功时返回 HTTP 200。`{"status":"ready"}` 表示控制面已确认现有项目表就绪,可沿用原配置重新启用服务。`{"status":"uninitialized"}` 表示项目表尚未就绪,包括尚未建表或迁移标记为 dirty。此查询只读,不会调用模型、建表或开启服务。
7777
+ *
7778
+ * 缺少 `aiGateway.read` 的项目 API Key 会收到 HTTP 401(`general_unauthorized_scope`)。服务被禁用时,非特权调用方也可能先收到 HTTP 403(`general_service_disabled`)。控制面读取存储发生异常或 Core 无法连接控制面时会返回服务端错误,例如 HTTP 500。此时状态未知,调用方应显示错误并允许重试查询。
7779
+ *
7780
+ *
7781
+ * @throws {AgentbaseException}
7782
+ * @returns {Promise<{}>}
7783
+ */
7784
+ getInitializationStatus() {
7785
+ const apiPath = '/ai-gateway/initialization-status';
7786
+ const payload = {};
7787
+ const uri = new URL(this.client.config.endpoint + apiPath);
7788
+ const apiHeaders = {
7789
+ 'X-Appwrite-Project': this.client.config.project,
7790
+ };
7791
+ return this.client.call('get', uri, apiHeaders, payload);
7792
+ }
7559
7793
  /**
7560
7794
  * Manage unified AI Gateway control-plane resources.
7561
7795
  *
@@ -8549,6 +8783,37 @@
8549
8783
  };
8550
8784
  return this.client.call('post', uri, apiHeaders, payload);
8551
8785
  }
8786
+ /**
8787
+ * Manage unified AI Gateway control-plane resources.
8788
+ *
8789
+ * @throws {AgentbaseException}
8790
+ * @returns {Promise<{}>}
8791
+ */
8792
+ listToolEmbeddings() {
8793
+ const apiPath = '/ai-gateway/tool-embeddings';
8794
+ const payload = {};
8795
+ const uri = new URL(this.client.config.endpoint + apiPath);
8796
+ const apiHeaders = {
8797
+ 'X-Appwrite-Project': this.client.config.project,
8798
+ };
8799
+ return this.client.call('get', uri, apiHeaders, payload);
8800
+ }
8801
+ /**
8802
+ * Manage unified AI Gateway control-plane resources.
8803
+ *
8804
+ * @throws {AgentbaseException}
8805
+ * @returns {Promise<{}>}
8806
+ */
8807
+ createToolEmbeddings() {
8808
+ const apiPath = '/ai-gateway/tool-embeddings';
8809
+ const payload = {};
8810
+ const uri = new URL(this.client.config.endpoint + apiPath);
8811
+ const apiHeaders = {
8812
+ 'X-Appwrite-Project': this.client.config.project,
8813
+ 'content-type': 'application/json',
8814
+ };
8815
+ return this.client.call('post', uri, apiHeaders, payload);
8816
+ }
8552
8817
  }
8553
8818
 
8554
8819
  class Avatars {
@@ -8957,68 +9222,384 @@
8957
9222
  }
8958
9223
  }
8959
9224
 
8960
- class Databases {
9225
+ class DataApi {
8961
9226
  constructor(client) {
8962
9227
  this.client = client;
8963
9228
  }
8964
- listTransactions(paramsOrFirst) {
9229
+ listBindingDataSources(paramsOrFirst) {
8965
9230
  let params;
8966
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9231
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
8967
9232
  params = (paramsOrFirst || {});
8968
9233
  }
8969
9234
  else {
8970
9235
  params = {
8971
- queries: paramsOrFirst
9236
+ accessBindingId: paramsOrFirst
8972
9237
  };
8973
9238
  }
8974
- const queries = params.queries;
8975
- const apiPath = '/databases/transactions';
8976
- const payload = {};
8977
- if (typeof queries !== 'undefined') {
8978
- payload['queries'] = queries;
9239
+ const accessBindingId = params.accessBindingId;
9240
+ if (typeof accessBindingId === 'undefined') {
9241
+ throw new AgentbaseException('Missing required parameter: "accessBindingId"');
8979
9242
  }
9243
+ const apiPath = '/data-api/bindings/{accessBindingId}/catalog/data-sources'.replace('{accessBindingId}', String(accessBindingId));
9244
+ const payload = {};
8980
9245
  const uri = new URL(this.client.config.endpoint + apiPath);
8981
- const apiHeaders = {
8982
- 'X-Appwrite-Project': this.client.config.project,
8983
- };
9246
+ const apiHeaders = {};
8984
9247
  return this.client.call('get', uri, apiHeaders, payload);
8985
9248
  }
8986
- createTransaction(paramsOrFirst) {
9249
+ listBindingDatabases(paramsOrFirst, ...rest) {
8987
9250
  let params;
8988
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9251
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
8989
9252
  params = (paramsOrFirst || {});
8990
9253
  }
8991
9254
  else {
8992
9255
  params = {
8993
- ttl: paramsOrFirst
9256
+ accessBindingId: paramsOrFirst,
9257
+ dataSourceId: rest[0]
8994
9258
  };
8995
9259
  }
8996
- const ttl = params.ttl;
8997
- const apiPath = '/databases/transactions';
8998
- const payload = {};
8999
- if (typeof ttl !== 'undefined') {
9000
- payload['ttl'] = ttl;
9260
+ const accessBindingId = params.accessBindingId;
9261
+ const dataSourceId = params.dataSourceId;
9262
+ if (typeof accessBindingId === 'undefined') {
9263
+ throw new AgentbaseException('Missing required parameter: "accessBindingId"');
9001
9264
  }
9265
+ if (typeof dataSourceId === 'undefined') {
9266
+ throw new AgentbaseException('Missing required parameter: "dataSourceId"');
9267
+ }
9268
+ const apiPath = '/data-api/bindings/{accessBindingId}/catalog/data-sources/{dataSourceId}/databases'.replace('{accessBindingId}', String(accessBindingId)).replace('{dataSourceId}', String(dataSourceId));
9269
+ const payload = {};
9002
9270
  const uri = new URL(this.client.config.endpoint + apiPath);
9003
- const apiHeaders = {
9004
- 'X-Appwrite-Project': this.client.config.project,
9005
- 'content-type': 'application/json',
9006
- };
9007
- return this.client.call('post', uri, apiHeaders, payload);
9271
+ const apiHeaders = {};
9272
+ return this.client.call('get', uri, apiHeaders, payload);
9008
9273
  }
9009
- getTransaction(paramsOrFirst) {
9274
+ listBindingTables(paramsOrFirst, ...rest) {
9010
9275
  let params;
9011
9276
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9012
9277
  params = (paramsOrFirst || {});
9013
9278
  }
9014
9279
  else {
9015
9280
  params = {
9016
- transactionId: paramsOrFirst
9281
+ accessBindingId: paramsOrFirst,
9282
+ dataSourceId: rest[0],
9283
+ databaseId: rest[1]
9017
9284
  };
9018
9285
  }
9019
- const transactionId = params.transactionId;
9020
- if (typeof transactionId === 'undefined') {
9021
- throw new AgentbaseException('Missing required parameter: "transactionId"');
9286
+ const accessBindingId = params.accessBindingId;
9287
+ const dataSourceId = params.dataSourceId;
9288
+ const databaseId = params.databaseId;
9289
+ if (typeof accessBindingId === 'undefined') {
9290
+ throw new AgentbaseException('Missing required parameter: "accessBindingId"');
9291
+ }
9292
+ if (typeof dataSourceId === 'undefined') {
9293
+ throw new AgentbaseException('Missing required parameter: "dataSourceId"');
9294
+ }
9295
+ if (typeof databaseId === 'undefined') {
9296
+ throw new AgentbaseException('Missing required parameter: "databaseId"');
9297
+ }
9298
+ 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));
9299
+ const payload = {};
9300
+ const uri = new URL(this.client.config.endpoint + apiPath);
9301
+ const apiHeaders = {};
9302
+ return this.client.call('get', uri, apiHeaders, payload);
9303
+ }
9304
+ getBindingTable(paramsOrFirst, ...rest) {
9305
+ let params;
9306
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9307
+ params = (paramsOrFirst || {});
9308
+ }
9309
+ else {
9310
+ params = {
9311
+ accessBindingId: paramsOrFirst,
9312
+ dataSourceId: rest[0],
9313
+ databaseId: rest[1],
9314
+ tableName: rest[2]
9315
+ };
9316
+ }
9317
+ const accessBindingId = params.accessBindingId;
9318
+ const dataSourceId = params.dataSourceId;
9319
+ const databaseId = params.databaseId;
9320
+ const tableName = params.tableName;
9321
+ if (typeof accessBindingId === 'undefined') {
9322
+ throw new AgentbaseException('Missing required parameter: "accessBindingId"');
9323
+ }
9324
+ if (typeof dataSourceId === 'undefined') {
9325
+ throw new AgentbaseException('Missing required parameter: "dataSourceId"');
9326
+ }
9327
+ if (typeof databaseId === 'undefined') {
9328
+ throw new AgentbaseException('Missing required parameter: "databaseId"');
9329
+ }
9330
+ if (typeof tableName === 'undefined') {
9331
+ throw new AgentbaseException('Missing required parameter: "tableName"');
9332
+ }
9333
+ 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);
9334
+ const payload = {};
9335
+ const uri = new URL(this.client.config.endpoint + apiPath);
9336
+ const apiHeaders = {};
9337
+ return this.client.call('get', uri, apiHeaders, payload);
9338
+ }
9339
+ executeNativeSql(paramsOrFirst, ...rest) {
9340
+ let params;
9341
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9342
+ params = (paramsOrFirst || {});
9343
+ }
9344
+ else {
9345
+ params = {
9346
+ accessBindingId: paramsOrFirst,
9347
+ sql: rest[0]
9348
+ };
9349
+ }
9350
+ const accessBindingId = params.accessBindingId;
9351
+ const sql = params.sql;
9352
+ if (typeof accessBindingId === 'undefined') {
9353
+ throw new AgentbaseException('Missing required parameter: "accessBindingId"');
9354
+ }
9355
+ if (typeof sql === 'undefined') {
9356
+ throw new AgentbaseException('Missing required parameter: "sql"');
9357
+ }
9358
+ const apiPath = '/data-api/bindings/{accessBindingId}/native-sql'.replace('{accessBindingId}', String(accessBindingId));
9359
+ const payload = {};
9360
+ if (typeof sql !== 'undefined') {
9361
+ payload['sql'] = sql;
9362
+ }
9363
+ const uri = new URL(this.client.config.endpoint + apiPath);
9364
+ const apiHeaders = {
9365
+ 'content-type': 'application/json',
9366
+ };
9367
+ return this.client.call('post', uri, apiHeaders, payload);
9368
+ }
9369
+ executeRestAggregates(paramsOrFirst, ...rest) {
9370
+ let params;
9371
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9372
+ params = (paramsOrFirst || {});
9373
+ }
9374
+ else {
9375
+ params = {
9376
+ accessBindingId: paramsOrFirst,
9377
+ databaseId: rest[0],
9378
+ tableName: rest[1],
9379
+ query: rest[2]
9380
+ };
9381
+ }
9382
+ const accessBindingId = params.accessBindingId;
9383
+ const databaseId = params.databaseId;
9384
+ const tableName = params.tableName;
9385
+ const query = params.query;
9386
+ if (typeof accessBindingId === 'undefined') {
9387
+ throw new AgentbaseException('Missing required parameter: "accessBindingId"');
9388
+ }
9389
+ if (typeof databaseId === 'undefined') {
9390
+ throw new AgentbaseException('Missing required parameter: "databaseId"');
9391
+ }
9392
+ if (typeof tableName === 'undefined') {
9393
+ throw new AgentbaseException('Missing required parameter: "tableName"');
9394
+ }
9395
+ if (typeof query === 'undefined') {
9396
+ throw new AgentbaseException('Missing required parameter: "query"');
9397
+ }
9398
+ const apiPath = '/data-api/bindings/{accessBindingId}/rest/databases/{databaseId}/tables/{tableName}/aggregates/query'.replace('{accessBindingId}', String(accessBindingId)).replace('{databaseId}', String(databaseId)).replace('{tableName}', tableName);
9399
+ const payload = {};
9400
+ if (typeof query !== 'undefined') {
9401
+ payload['query'] = query;
9402
+ }
9403
+ const uri = new URL(this.client.config.endpoint + apiPath);
9404
+ const apiHeaders = {
9405
+ 'content-type': 'application/json',
9406
+ };
9407
+ return this.client.call('post', uri, apiHeaders, payload);
9408
+ }
9409
+ executeRestRows(paramsOrFirst, ...rest) {
9410
+ let params;
9411
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9412
+ params = (paramsOrFirst || {});
9413
+ }
9414
+ else {
9415
+ params = {
9416
+ accessBindingId: paramsOrFirst,
9417
+ databaseId: rest[0],
9418
+ tableName: rest[1],
9419
+ query: rest[2]
9420
+ };
9421
+ }
9422
+ const accessBindingId = params.accessBindingId;
9423
+ const databaseId = params.databaseId;
9424
+ const tableName = params.tableName;
9425
+ const query = params.query;
9426
+ if (typeof accessBindingId === 'undefined') {
9427
+ throw new AgentbaseException('Missing required parameter: "accessBindingId"');
9428
+ }
9429
+ if (typeof databaseId === 'undefined') {
9430
+ throw new AgentbaseException('Missing required parameter: "databaseId"');
9431
+ }
9432
+ if (typeof tableName === 'undefined') {
9433
+ throw new AgentbaseException('Missing required parameter: "tableName"');
9434
+ }
9435
+ if (typeof query === 'undefined') {
9436
+ throw new AgentbaseException('Missing required parameter: "query"');
9437
+ }
9438
+ const apiPath = '/data-api/bindings/{accessBindingId}/rest/databases/{databaseId}/tables/{tableName}/rows/query'.replace('{accessBindingId}', String(accessBindingId)).replace('{databaseId}', String(databaseId)).replace('{tableName}', tableName);
9439
+ const payload = {};
9440
+ if (typeof query !== 'undefined') {
9441
+ payload['query'] = query;
9442
+ }
9443
+ const uri = new URL(this.client.config.endpoint + apiPath);
9444
+ const apiHeaders = {
9445
+ 'content-type': 'application/json',
9446
+ };
9447
+ return this.client.call('post', uri, apiHeaders, payload);
9448
+ }
9449
+ listMyBindings(paramsOrFirst, ...rest) {
9450
+ let params;
9451
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9452
+ params = (paramsOrFirst || {});
9453
+ }
9454
+ else {
9455
+ params = {
9456
+ cursor: paramsOrFirst,
9457
+ limit: rest[0]
9458
+ };
9459
+ }
9460
+ const cursor = params.cursor;
9461
+ const limit = params.limit;
9462
+ const apiPath = '/data-api/me/bindings';
9463
+ const payload = {};
9464
+ if (typeof cursor !== 'undefined') {
9465
+ payload['cursor'] = cursor;
9466
+ }
9467
+ if (typeof limit !== 'undefined') {
9468
+ payload['limit'] = limit;
9469
+ }
9470
+ const uri = new URL(this.client.config.endpoint + apiPath);
9471
+ const apiHeaders = {};
9472
+ return this.client.call('get', uri, apiHeaders, payload);
9473
+ }
9474
+ getMyBinding(paramsOrFirst) {
9475
+ let params;
9476
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9477
+ params = (paramsOrFirst || {});
9478
+ }
9479
+ else {
9480
+ params = {
9481
+ accessBindingId: paramsOrFirst
9482
+ };
9483
+ }
9484
+ const accessBindingId = params.accessBindingId;
9485
+ if (typeof accessBindingId === 'undefined') {
9486
+ throw new AgentbaseException('Missing required parameter: "accessBindingId"');
9487
+ }
9488
+ const apiPath = '/data-api/me/bindings/{accessBindingId}'.replace('{accessBindingId}', String(accessBindingId));
9489
+ const payload = {};
9490
+ const uri = new URL(this.client.config.endpoint + apiPath);
9491
+ const apiHeaders = {};
9492
+ return this.client.call('get', uri, apiHeaders, payload);
9493
+ }
9494
+ executeFixedQueryLink(paramsOrFirst) {
9495
+ let params;
9496
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9497
+ params = (paramsOrFirst || {});
9498
+ }
9499
+ else {
9500
+ params = {
9501
+ queryId: paramsOrFirst
9502
+ };
9503
+ }
9504
+ const queryId = params.queryId;
9505
+ if (typeof queryId === 'undefined') {
9506
+ throw new AgentbaseException('Missing required parameter: "queryId"');
9507
+ }
9508
+ const apiPath = '/data-api/public/query-interfaces/{queryId}/executions'.replace('{queryId}', queryId);
9509
+ const payload = {};
9510
+ const uri = new URL(this.client.config.endpoint + apiPath);
9511
+ const apiHeaders = {
9512
+ 'X-Appwrite-Project': this.client.config.project,
9513
+ };
9514
+ return this.client.call('get', uri, apiHeaders, payload);
9515
+ }
9516
+ executeFixedQuery(paramsOrFirst) {
9517
+ let params;
9518
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9519
+ params = (paramsOrFirst || {});
9520
+ }
9521
+ else {
9522
+ params = {
9523
+ queryId: paramsOrFirst
9524
+ };
9525
+ }
9526
+ const queryId = params.queryId;
9527
+ if (typeof queryId === 'undefined') {
9528
+ throw new AgentbaseException('Missing required parameter: "queryId"');
9529
+ }
9530
+ const apiPath = '/data-api/public/query-interfaces/{queryId}/executions'.replace('{queryId}', queryId);
9531
+ const payload = {};
9532
+ const uri = new URL(this.client.config.endpoint + apiPath);
9533
+ const apiHeaders = {
9534
+ 'X-Appwrite-Project': this.client.config.project,
9535
+ 'content-type': 'application/json',
9536
+ };
9537
+ return this.client.call('post', uri, apiHeaders, payload);
9538
+ }
9539
+ }
9540
+
9541
+ class Databases {
9542
+ constructor(client) {
9543
+ this.client = client;
9544
+ }
9545
+ listTransactions(paramsOrFirst) {
9546
+ let params;
9547
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9548
+ params = (paramsOrFirst || {});
9549
+ }
9550
+ else {
9551
+ params = {
9552
+ queries: paramsOrFirst
9553
+ };
9554
+ }
9555
+ const queries = params.queries;
9556
+ const apiPath = '/databases/transactions';
9557
+ const payload = {};
9558
+ if (typeof queries !== 'undefined') {
9559
+ payload['queries'] = queries;
9560
+ }
9561
+ const uri = new URL(this.client.config.endpoint + apiPath);
9562
+ const apiHeaders = {
9563
+ 'X-Appwrite-Project': this.client.config.project,
9564
+ };
9565
+ return this.client.call('get', uri, apiHeaders, payload);
9566
+ }
9567
+ createTransaction(paramsOrFirst) {
9568
+ let params;
9569
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9570
+ params = (paramsOrFirst || {});
9571
+ }
9572
+ else {
9573
+ params = {
9574
+ ttl: paramsOrFirst
9575
+ };
9576
+ }
9577
+ const ttl = params.ttl;
9578
+ const apiPath = '/databases/transactions';
9579
+ const payload = {};
9580
+ if (typeof ttl !== 'undefined') {
9581
+ payload['ttl'] = ttl;
9582
+ }
9583
+ const uri = new URL(this.client.config.endpoint + apiPath);
9584
+ const apiHeaders = {
9585
+ 'X-Appwrite-Project': this.client.config.project,
9586
+ 'content-type': 'application/json',
9587
+ };
9588
+ return this.client.call('post', uri, apiHeaders, payload);
9589
+ }
9590
+ getTransaction(paramsOrFirst) {
9591
+ let params;
9592
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
9593
+ params = (paramsOrFirst || {});
9594
+ }
9595
+ else {
9596
+ params = {
9597
+ transactionId: paramsOrFirst
9598
+ };
9599
+ }
9600
+ const transactionId = params.transactionId;
9601
+ if (typeof transactionId === 'undefined') {
9602
+ throw new AgentbaseException('Missing required parameter: "transactionId"');
9022
9603
  }
9023
9604
  const apiPath = '/databases/transactions/{transactionId}'.replace('{transactionId}', transactionId);
9024
9605
  const payload = {};
@@ -10115,13 +10696,19 @@
10115
10696
  functionId: paramsOrFirst,
10116
10697
  limit: rest[0],
10117
10698
  offset: rest[1],
10118
- total: rest[2]
10699
+ total: rest[2],
10700
+ xpath: rest[3],
10701
+ pathMatch: rest[4],
10702
+ method: rest[5]
10119
10703
  };
10120
10704
  }
10121
10705
  const functionId = params.functionId;
10122
10706
  const limit = params.limit;
10123
10707
  const offset = params.offset;
10124
10708
  const total = params.total;
10709
+ const xpath = params.xpath;
10710
+ const pathMatch = params.pathMatch;
10711
+ const method = params.method;
10125
10712
  if (typeof functionId === 'undefined') {
10126
10713
  throw new AgentbaseException('Missing required parameter: "functionId"');
10127
10714
  }
@@ -10136,6 +10723,15 @@
10136
10723
  if (typeof total !== 'undefined') {
10137
10724
  payload['total'] = total;
10138
10725
  }
10726
+ if (typeof xpath !== 'undefined') {
10727
+ payload['path'] = xpath;
10728
+ }
10729
+ if (typeof pathMatch !== 'undefined') {
10730
+ payload['pathMatch'] = pathMatch;
10731
+ }
10732
+ if (typeof method !== 'undefined') {
10733
+ payload['method'] = method;
10734
+ }
10139
10735
  const uri = new URL(this.client.config.endpoint + apiPath);
10140
10736
  const apiHeaders = {
10141
10737
  'X-Appwrite-Project': this.client.config.project,
@@ -10152,13 +10748,17 @@
10152
10748
  functionId: paramsOrFirst,
10153
10749
  xpath: rest[0],
10154
10750
  queries: rest[1],
10155
- total: rest[2]
10751
+ total: rest[2],
10752
+ pathMatch: rest[3],
10753
+ method: rest[4]
10156
10754
  };
10157
10755
  }
10158
10756
  const functionId = params.functionId;
10159
10757
  const xpath = params.xpath;
10160
10758
  const queries = params.queries;
10161
10759
  const total = params.total;
10760
+ const pathMatch = params.pathMatch;
10761
+ const method = params.method;
10162
10762
  if (typeof functionId === 'undefined') {
10163
10763
  throw new AgentbaseException('Missing required parameter: "functionId"');
10164
10764
  }
@@ -10176,6 +10776,12 @@
10176
10776
  if (typeof total !== 'undefined') {
10177
10777
  payload['total'] = total;
10178
10778
  }
10779
+ if (typeof pathMatch !== 'undefined') {
10780
+ payload['pathMatch'] = pathMatch;
10781
+ }
10782
+ if (typeof method !== 'undefined') {
10783
+ payload['method'] = method;
10784
+ }
10179
10785
  const uri = new URL(this.client.config.endpoint + apiPath);
10180
10786
  const apiHeaders = {
10181
10787
  'X-Appwrite-Project': this.client.config.project,
@@ -10191,12 +10797,18 @@
10191
10797
  params = {
10192
10798
  functionId: paramsOrFirst,
10193
10799
  queries: rest[0],
10194
- total: rest[1]
10800
+ total: rest[1],
10801
+ xpath: rest[2],
10802
+ pathMatch: rest[3],
10803
+ method: rest[4]
10195
10804
  };
10196
10805
  }
10197
10806
  const functionId = params.functionId;
10198
10807
  const queries = params.queries;
10199
10808
  const total = params.total;
10809
+ const xpath = params.xpath;
10810
+ const pathMatch = params.pathMatch;
10811
+ const method = params.method;
10200
10812
  if (typeof functionId === 'undefined') {
10201
10813
  throw new AgentbaseException('Missing required parameter: "functionId"');
10202
10814
  }
@@ -10208,9 +10820,18 @@
10208
10820
  if (typeof total !== 'undefined') {
10209
10821
  payload['total'] = total;
10210
10822
  }
10211
- const uri = new URL(this.client.config.endpoint + apiPath);
10212
- const apiHeaders = {
10213
- 'X-Appwrite-Project': this.client.config.project,
10823
+ if (typeof xpath !== 'undefined') {
10824
+ payload['path'] = xpath;
10825
+ }
10826
+ if (typeof pathMatch !== 'undefined') {
10827
+ payload['pathMatch'] = pathMatch;
10828
+ }
10829
+ if (typeof method !== 'undefined') {
10830
+ payload['method'] = method;
10831
+ }
10832
+ const uri = new URL(this.client.config.endpoint + apiPath);
10833
+ const apiHeaders = {
10834
+ 'X-Appwrite-Project': this.client.config.project,
10214
10835
  };
10215
10836
  return this.client.call('get', uri, apiHeaders, payload);
10216
10837
  }
@@ -10487,6 +11108,218 @@
10487
11108
  };
10488
11109
  return this.client.call('get', uri, apiHeaders, payload);
10489
11110
  }
11111
+ listYuquePersonalDataSources(paramsOrFirst, ...rest) {
11112
+ let params;
11113
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
11114
+ params = (paramsOrFirst || {});
11115
+ }
11116
+ else {
11117
+ params = {
11118
+ knowledgeBaseId: paramsOrFirst,
11119
+ versionId: rest[0]
11120
+ };
11121
+ }
11122
+ const knowledgeBaseId = params.knowledgeBaseId;
11123
+ const versionId = params.versionId;
11124
+ if (typeof knowledgeBaseId === 'undefined') {
11125
+ throw new AgentbaseException('Missing required parameter: "knowledgeBaseId"');
11126
+ }
11127
+ const apiPath = '/knowledgebases/{knowledgeBaseId}/yuque/personal-datasources'.replace('{knowledgeBaseId}', knowledgeBaseId);
11128
+ const payload = {};
11129
+ if (typeof versionId !== 'undefined') {
11130
+ payload['versionId'] = versionId;
11131
+ }
11132
+ const uri = new URL(this.client.config.endpoint + apiPath);
11133
+ const apiHeaders = {
11134
+ 'X-Appwrite-Project': this.client.config.project,
11135
+ };
11136
+ return this.client.call('get', uri, apiHeaders, payload);
11137
+ }
11138
+ createYuquePersonalDataSource(paramsOrFirst, ...rest) {
11139
+ let params;
11140
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
11141
+ params = (paramsOrFirst || {});
11142
+ }
11143
+ else {
11144
+ params = {
11145
+ knowledgeBaseId: paramsOrFirst,
11146
+ sessionId: rest[0],
11147
+ name: rest[1],
11148
+ urls: rest[2],
11149
+ versionId: rest[3],
11150
+ syncSchedule: rest[4],
11151
+ status: rest[5],
11152
+ triggerSync: rest[6]
11153
+ };
11154
+ }
11155
+ const knowledgeBaseId = params.knowledgeBaseId;
11156
+ const sessionId = params.sessionId;
11157
+ const name = params.name;
11158
+ const urls = params.urls;
11159
+ const versionId = params.versionId;
11160
+ const syncSchedule = params.syncSchedule;
11161
+ const status = params.status;
11162
+ const triggerSync = params.triggerSync;
11163
+ if (typeof knowledgeBaseId === 'undefined') {
11164
+ throw new AgentbaseException('Missing required parameter: "knowledgeBaseId"');
11165
+ }
11166
+ if (typeof sessionId === 'undefined') {
11167
+ throw new AgentbaseException('Missing required parameter: "sessionId"');
11168
+ }
11169
+ if (typeof name === 'undefined') {
11170
+ throw new AgentbaseException('Missing required parameter: "name"');
11171
+ }
11172
+ if (typeof urls === 'undefined') {
11173
+ throw new AgentbaseException('Missing required parameter: "urls"');
11174
+ }
11175
+ const apiPath = '/knowledgebases/{knowledgeBaseId}/yuque/personal-datasources'.replace('{knowledgeBaseId}', knowledgeBaseId);
11176
+ const payload = {};
11177
+ if (typeof versionId !== 'undefined') {
11178
+ payload['versionId'] = versionId;
11179
+ }
11180
+ if (typeof sessionId !== 'undefined') {
11181
+ payload['sessionId'] = sessionId;
11182
+ }
11183
+ if (typeof name !== 'undefined') {
11184
+ payload['name'] = name;
11185
+ }
11186
+ if (typeof urls !== 'undefined') {
11187
+ payload['urls'] = urls;
11188
+ }
11189
+ if (typeof syncSchedule !== 'undefined') {
11190
+ payload['syncSchedule'] = syncSchedule;
11191
+ }
11192
+ if (typeof status !== 'undefined') {
11193
+ payload['status'] = status;
11194
+ }
11195
+ if (typeof triggerSync !== 'undefined') {
11196
+ payload['triggerSync'] = triggerSync;
11197
+ }
11198
+ const uri = new URL(this.client.config.endpoint + apiPath);
11199
+ const apiHeaders = {
11200
+ 'X-Appwrite-Project': this.client.config.project,
11201
+ 'content-type': 'application/json',
11202
+ };
11203
+ return this.client.call('post', uri, apiHeaders, payload);
11204
+ }
11205
+ getYuquePersonalDataSource(paramsOrFirst, ...rest) {
11206
+ let params;
11207
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
11208
+ params = (paramsOrFirst || {});
11209
+ }
11210
+ else {
11211
+ params = {
11212
+ knowledgeBaseId: paramsOrFirst,
11213
+ dataSourceId: rest[0],
11214
+ versionId: rest[1]
11215
+ };
11216
+ }
11217
+ const knowledgeBaseId = params.knowledgeBaseId;
11218
+ const dataSourceId = params.dataSourceId;
11219
+ const versionId = params.versionId;
11220
+ if (typeof knowledgeBaseId === 'undefined') {
11221
+ throw new AgentbaseException('Missing required parameter: "knowledgeBaseId"');
11222
+ }
11223
+ if (typeof dataSourceId === 'undefined') {
11224
+ throw new AgentbaseException('Missing required parameter: "dataSourceId"');
11225
+ }
11226
+ const apiPath = '/knowledgebases/{knowledgeBaseId}/yuque/personal-datasources/{dataSourceId}'.replace('{knowledgeBaseId}', knowledgeBaseId).replace('{dataSourceId}', dataSourceId);
11227
+ const payload = {};
11228
+ if (typeof versionId !== 'undefined') {
11229
+ payload['versionId'] = versionId;
11230
+ }
11231
+ const uri = new URL(this.client.config.endpoint + apiPath);
11232
+ const apiHeaders = {
11233
+ 'X-Appwrite-Project': this.client.config.project,
11234
+ };
11235
+ return this.client.call('get', uri, apiHeaders, payload);
11236
+ }
11237
+ updateYuquePersonalDataSource(paramsOrFirst, ...rest) {
11238
+ let params;
11239
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
11240
+ params = (paramsOrFirst || {});
11241
+ }
11242
+ else {
11243
+ params = {
11244
+ knowledgeBaseId: paramsOrFirst,
11245
+ dataSourceId: rest[0],
11246
+ versionId: rest[1],
11247
+ name: rest[2],
11248
+ urls: rest[3],
11249
+ syncSchedule: rest[4],
11250
+ status: rest[5]
11251
+ };
11252
+ }
11253
+ const knowledgeBaseId = params.knowledgeBaseId;
11254
+ const dataSourceId = params.dataSourceId;
11255
+ const versionId = params.versionId;
11256
+ const name = params.name;
11257
+ const urls = params.urls;
11258
+ const syncSchedule = params.syncSchedule;
11259
+ const status = params.status;
11260
+ if (typeof knowledgeBaseId === 'undefined') {
11261
+ throw new AgentbaseException('Missing required parameter: "knowledgeBaseId"');
11262
+ }
11263
+ if (typeof dataSourceId === 'undefined') {
11264
+ throw new AgentbaseException('Missing required parameter: "dataSourceId"');
11265
+ }
11266
+ const apiPath = '/knowledgebases/{knowledgeBaseId}/yuque/personal-datasources/{dataSourceId}'.replace('{knowledgeBaseId}', knowledgeBaseId).replace('{dataSourceId}', dataSourceId);
11267
+ const payload = {};
11268
+ if (typeof versionId !== 'undefined') {
11269
+ payload['versionId'] = versionId;
11270
+ }
11271
+ if (typeof name !== 'undefined') {
11272
+ payload['name'] = name;
11273
+ }
11274
+ if (typeof urls !== 'undefined') {
11275
+ payload['urls'] = urls;
11276
+ }
11277
+ if (typeof syncSchedule !== 'undefined') {
11278
+ payload['syncSchedule'] = syncSchedule;
11279
+ }
11280
+ if (typeof status !== 'undefined') {
11281
+ payload['status'] = status;
11282
+ }
11283
+ const uri = new URL(this.client.config.endpoint + apiPath);
11284
+ const apiHeaders = {
11285
+ 'X-Appwrite-Project': this.client.config.project,
11286
+ 'content-type': 'application/json',
11287
+ };
11288
+ return this.client.call('patch', uri, apiHeaders, payload);
11289
+ }
11290
+ deleteYuquePersonalDataSource(paramsOrFirst, ...rest) {
11291
+ let params;
11292
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
11293
+ params = (paramsOrFirst || {});
11294
+ }
11295
+ else {
11296
+ params = {
11297
+ knowledgeBaseId: paramsOrFirst,
11298
+ dataSourceId: rest[0],
11299
+ versionId: rest[1]
11300
+ };
11301
+ }
11302
+ const knowledgeBaseId = params.knowledgeBaseId;
11303
+ const dataSourceId = params.dataSourceId;
11304
+ const versionId = params.versionId;
11305
+ if (typeof knowledgeBaseId === 'undefined') {
11306
+ throw new AgentbaseException('Missing required parameter: "knowledgeBaseId"');
11307
+ }
11308
+ if (typeof dataSourceId === 'undefined') {
11309
+ throw new AgentbaseException('Missing required parameter: "dataSourceId"');
11310
+ }
11311
+ const apiPath = '/knowledgebases/{knowledgeBaseId}/yuque/personal-datasources/{dataSourceId}'.replace('{knowledgeBaseId}', knowledgeBaseId).replace('{dataSourceId}', dataSourceId);
11312
+ const payload = {};
11313
+ if (typeof versionId !== 'undefined') {
11314
+ payload['versionId'] = versionId;
11315
+ }
11316
+ const uri = new URL(this.client.config.endpoint + apiPath);
11317
+ const apiHeaders = {
11318
+ 'X-Appwrite-Project': this.client.config.project,
11319
+ 'content-type': 'application/json',
11320
+ };
11321
+ return this.client.call('delete', uri, apiHeaders, payload);
11322
+ }
10490
11323
  }
10491
11324
 
10492
11325
  class LlmGateway {
@@ -10696,7 +11529,8 @@
10696
11529
  query: rest[0],
10697
11530
  documents: rest[1],
10698
11531
  topN: rest[2],
10699
- returnDocuments: rest[3]
11532
+ returnDocuments: rest[3],
11533
+ instruct: rest[4]
10700
11534
  };
10701
11535
  }
10702
11536
  const model = params.model;
@@ -10704,6 +11538,7 @@
10704
11538
  const documents = params.documents;
10705
11539
  const topN = params.topN;
10706
11540
  const returnDocuments = params.returnDocuments;
11541
+ const instruct = params.instruct;
10707
11542
  if (typeof model === 'undefined') {
10708
11543
  throw new AgentbaseException('Missing required parameter: "model"');
10709
11544
  }
@@ -10730,6 +11565,9 @@
10730
11565
  if (typeof returnDocuments !== 'undefined') {
10731
11566
  payload['returnDocuments'] = returnDocuments;
10732
11567
  }
11568
+ if (typeof instruct !== 'undefined') {
11569
+ payload['instruct'] = instruct;
11570
+ }
10733
11571
  const uri = new URL(this.client.config.endpoint + apiPath);
10734
11572
  const apiHeaders = {
10735
11573
  'X-Appwrite-Project': this.client.config.project,
@@ -11073,31 +11911,37 @@
11073
11911
  scope: rest[0],
11074
11912
  memoryType: rest[1],
11075
11913
  recordKind: rest[2],
11076
- content: rest[3],
11077
- messages: rest[4],
11078
- agentId: rest[5],
11079
- runId: rest[6],
11080
- sessionId: rest[7],
11081
- sensitivity: rest[8],
11082
- handlingPolicy: rest[9],
11083
- metadata: rest[10],
11084
- infer: rest[11],
11085
- reRemember: rest[12],
11086
- async: rest[13]
11914
+ pipelineId: rest[3],
11915
+ content: rest[4],
11916
+ messages: rest[5],
11917
+ media: rest[6],
11918
+ agentId: rest[7],
11919
+ runId: rest[8],
11920
+ sessionId: rest[9],
11921
+ sensitivity: rest[10],
11922
+ handlingPolicy: rest[11],
11923
+ metadata: rest[12],
11924
+ sourceContext: rest[13],
11925
+ infer: rest[14],
11926
+ reRemember: rest[15],
11927
+ async: rest[16]
11087
11928
  };
11088
11929
  }
11089
11930
  const userId = params.userId;
11090
11931
  const scope = params.scope;
11091
11932
  const memoryType = params.memoryType;
11092
11933
  const recordKind = params.recordKind;
11934
+ const pipelineId = params.pipelineId;
11093
11935
  const content = params.content;
11094
11936
  const messages = params.messages;
11937
+ const media = params.media;
11095
11938
  const agentId = params.agentId;
11096
11939
  const runId = params.runId;
11097
11940
  const sessionId = params.sessionId;
11098
11941
  const sensitivity = params.sensitivity;
11099
11942
  const handlingPolicy = params.handlingPolicy;
11100
11943
  const metadata = params.metadata;
11944
+ const sourceContext = params.sourceContext;
11101
11945
  const infer = params.infer;
11102
11946
  const reRemember = params.reRemember;
11103
11947
  const async = params.async;
@@ -11115,12 +11959,18 @@
11115
11959
  }
11116
11960
  const apiPath = '/memory/memories';
11117
11961
  const payload = {};
11962
+ if (typeof pipelineId !== 'undefined') {
11963
+ payload['pipelineId'] = pipelineId;
11964
+ }
11118
11965
  if (typeof content !== 'undefined') {
11119
11966
  payload['content'] = content;
11120
11967
  }
11121
11968
  if (typeof messages !== 'undefined') {
11122
11969
  payload['messages'] = messages;
11123
11970
  }
11971
+ if (typeof media !== 'undefined') {
11972
+ payload['media'] = media;
11973
+ }
11124
11974
  if (typeof userId !== 'undefined') {
11125
11975
  payload['userId'] = userId;
11126
11976
  }
@@ -11151,6 +12001,9 @@
11151
12001
  if (typeof metadata !== 'undefined') {
11152
12002
  payload['metadata'] = metadata;
11153
12003
  }
12004
+ if (typeof sourceContext !== 'undefined') {
12005
+ payload['sourceContext'] = sourceContext;
12006
+ }
11154
12007
  if (typeof infer !== 'undefined') {
11155
12008
  payload['infer'] = infer;
11156
12009
  }
@@ -11175,12 +12028,14 @@
11175
12028
  else {
11176
12029
  params = {
11177
12030
  userId: paramsOrFirst,
11178
- limit: rest[0],
11179
- reason: rest[1],
11180
- source: rest[2]
12031
+ memorySubStoreId: rest[0],
12032
+ limit: rest[1],
12033
+ reason: rest[2],
12034
+ source: rest[3]
11181
12035
  };
11182
12036
  }
11183
12037
  const userId = params.userId;
12038
+ const memorySubStoreId = params.memorySubStoreId;
11184
12039
  const limit = params.limit;
11185
12040
  const reason = params.reason;
11186
12041
  const source = params.source;
@@ -11189,6 +12044,9 @@
11189
12044
  if (typeof userId !== 'undefined') {
11190
12045
  payload['userId'] = userId;
11191
12046
  }
12047
+ if (typeof memorySubStoreId !== 'undefined') {
12048
+ payload['memorySubStoreId'] = memorySubStoreId;
12049
+ }
11192
12050
  if (typeof limit !== 'undefined') {
11193
12051
  payload['limit'] = limit;
11194
12052
  }
@@ -11716,7 +12574,7 @@
11716
12574
  }
11717
12575
  submitDistillation(paramsOrFirst, ...rest) {
11718
12576
  let params;
11719
- 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))) {
12577
+ 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))) {
11720
12578
  params = (paramsOrFirst || {});
11721
12579
  }
11722
12580
  else {
@@ -11727,12 +12585,13 @@
11727
12585
  sessionId: rest[2],
11728
12586
  runId: rest[3],
11729
12587
  memorySubStoreId: rest[4],
11730
- sourceId: rest[5],
11731
- sourceType: rest[6],
11732
- messages: rest[7],
11733
- toolEvents: rest[8],
11734
- mode: rest[9],
11735
- idempotencyKey: rest[10]
12588
+ pipelineId: rest[5],
12589
+ sourceId: rest[6],
12590
+ sourceType: rest[7],
12591
+ messages: rest[8],
12592
+ toolEvents: rest[9],
12593
+ mode: rest[10],
12594
+ idempotencyKey: rest[11]
11736
12595
  };
11737
12596
  }
11738
12597
  const scope = params.scope;
@@ -11741,6 +12600,7 @@
11741
12600
  const sessionId = params.sessionId;
11742
12601
  const runId = params.runId;
11743
12602
  const memorySubStoreId = params.memorySubStoreId;
12603
+ const pipelineId = params.pipelineId;
11744
12604
  const sourceId = params.sourceId;
11745
12605
  const sourceType = params.sourceType;
11746
12606
  const messages = params.messages;
@@ -11767,6 +12627,9 @@
11767
12627
  if (typeof memorySubStoreId !== 'undefined') {
11768
12628
  payload['memorySubStoreId'] = memorySubStoreId;
11769
12629
  }
12630
+ if (typeof pipelineId !== 'undefined') {
12631
+ payload['pipelineId'] = pipelineId;
12632
+ }
11770
12633
  if (typeof sourceId !== 'undefined') {
11771
12634
  payload['sourceId'] = sourceId;
11772
12635
  }
@@ -12360,13 +13223,15 @@
12360
13223
  else {
12361
13224
  params = {
12362
13225
  userId: paramsOrFirst,
12363
- format: rest[0],
12364
- data: rest[1],
12365
- records: rest[2],
12366
- dryRun: rest[3]
13226
+ pipelineId: rest[0],
13227
+ format: rest[1],
13228
+ data: rest[2],
13229
+ records: rest[3],
13230
+ dryRun: rest[4]
12367
13231
  };
12368
13232
  }
12369
13233
  const userId = params.userId;
13234
+ const pipelineId = params.pipelineId;
12370
13235
  const format = params.format;
12371
13236
  const data = params.data;
12372
13237
  const records = params.records;
@@ -12376,6 +13241,9 @@
12376
13241
  }
12377
13242
  const apiPath = '/memory/memories/imports';
12378
13243
  const payload = {};
13244
+ if (typeof pipelineId !== 'undefined') {
13245
+ payload['pipelineId'] = pipelineId;
13246
+ }
12379
13247
  if (typeof userId !== 'undefined') {
12380
13248
  payload['userId'] = userId;
12381
13249
  }
@@ -12420,42 +13288,36 @@
12420
13288
  };
12421
13289
  return this.client.call('get', uri, apiHeaders, payload);
12422
13290
  }
12423
- updateKnowledge(paramsOrFirst, ...rest) {
13291
+ listKnowledgeReviews(paramsOrFirst, ...rest) {
12424
13292
  let params;
12425
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
13293
+ 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))) {
12426
13294
  params = (paramsOrFirst || {});
12427
13295
  }
12428
13296
  else {
12429
13297
  params = {
12430
- knowledgeId: paramsOrFirst,
12431
- expectedVersion: rest[0],
12432
- scope: rest[1],
12433
- userId: rest[2],
12434
- agentId: rest[3],
12435
- sessionId: rest[4],
12436
- runId: rest[5],
12437
- memorySubStoreId: rest[6],
13298
+ scope: paramsOrFirst,
13299
+ userId: rest[0],
13300
+ agentId: rest[1],
13301
+ sessionId: rest[2],
13302
+ runId: rest[3],
13303
+ memorySubStoreId: rest[4],
13304
+ limit: rest[5],
13305
+ offset: rest[6],
12438
13306
  status: rest[7],
12439
- validationStatus: rest[8]
13307
+ knowledgeId: rest[8]
12440
13308
  };
12441
13309
  }
12442
- const knowledgeId = params.knowledgeId;
12443
- const expectedVersion = params.expectedVersion;
12444
13310
  const scope = params.scope;
12445
13311
  const userId = params.userId;
12446
13312
  const agentId = params.agentId;
12447
13313
  const sessionId = params.sessionId;
12448
13314
  const runId = params.runId;
12449
13315
  const memorySubStoreId = params.memorySubStoreId;
13316
+ const limit = params.limit;
13317
+ const offset = params.offset;
12450
13318
  const status = params.status;
12451
- const validationStatus = params.validationStatus;
12452
- if (typeof knowledgeId === 'undefined') {
12453
- throw new AgentbaseException('Missing required parameter: "knowledgeId"');
12454
- }
12455
- if (typeof expectedVersion === 'undefined') {
12456
- throw new AgentbaseException('Missing required parameter: "expectedVersion"');
12457
- }
12458
- const apiPath = '/memory/memories/knowledge/{knowledgeId}'.replace('{knowledgeId}', knowledgeId);
13319
+ const knowledgeId = params.knowledgeId;
13320
+ const apiPath = '/memory/memories/knowledge/reviews';
12459
13321
  const payload = {};
12460
13322
  if (typeof scope !== 'undefined') {
12461
13323
  payload['scope'] = scope;
@@ -12475,39 +13337,93 @@
12475
13337
  if (typeof memorySubStoreId !== 'undefined') {
12476
13338
  payload['memorySubStoreId'] = memorySubStoreId;
12477
13339
  }
12478
- if (typeof expectedVersion !== 'undefined') {
12479
- payload['expectedVersion'] = expectedVersion;
13340
+ if (typeof limit !== 'undefined') {
13341
+ payload['limit'] = limit;
13342
+ }
13343
+ if (typeof offset !== 'undefined') {
13344
+ payload['offset'] = offset;
12480
13345
  }
12481
13346
  if (typeof status !== 'undefined') {
12482
13347
  payload['status'] = status;
12483
13348
  }
12484
- if (typeof validationStatus !== 'undefined') {
12485
- payload['validationStatus'] = validationStatus;
13349
+ if (typeof knowledgeId !== 'undefined') {
13350
+ payload['knowledgeId'] = knowledgeId;
12486
13351
  }
12487
13352
  const uri = new URL(this.client.config.endpoint + apiPath);
12488
13353
  const apiHeaders = {
12489
13354
  'X-Appwrite-Project': this.client.config.project,
12490
- 'content-type': 'application/json',
12491
13355
  };
12492
- return this.client.call('patch', uri, apiHeaders, payload);
13356
+ return this.client.call('get', uri, apiHeaders, payload);
12493
13357
  }
12494
- forgetKnowledge(paramsOrFirst, ...rest) {
13358
+ getKnowledgeReview(paramsOrFirst, ...rest) {
12495
13359
  let params;
12496
13360
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
12497
13361
  params = (paramsOrFirst || {});
12498
13362
  }
12499
13363
  else {
12500
13364
  params = {
12501
- knowledgeId: paramsOrFirst,
12502
- expectedVersion: rest[0],
12503
- scope: rest[1],
12504
- userId: rest[2],
12505
- agentId: rest[3],
12506
- sessionId: rest[4],
12507
- runId: rest[5],
12508
- memorySubStoreId: rest[6],
12509
- reason: rest[7],
12510
- source: rest[8]
13365
+ reviewId: paramsOrFirst,
13366
+ scope: rest[0],
13367
+ userId: rest[1],
13368
+ agentId: rest[2],
13369
+ sessionId: rest[3],
13370
+ runId: rest[4],
13371
+ memorySubStoreId: rest[5]
13372
+ };
13373
+ }
13374
+ const reviewId = params.reviewId;
13375
+ const scope = params.scope;
13376
+ const userId = params.userId;
13377
+ const agentId = params.agentId;
13378
+ const sessionId = params.sessionId;
13379
+ const runId = params.runId;
13380
+ const memorySubStoreId = params.memorySubStoreId;
13381
+ if (typeof reviewId === 'undefined') {
13382
+ throw new AgentbaseException('Missing required parameter: "reviewId"');
13383
+ }
13384
+ const apiPath = '/memory/memories/knowledge/reviews/{reviewId}'.replace('{reviewId}', reviewId);
13385
+ const payload = {};
13386
+ if (typeof scope !== 'undefined') {
13387
+ payload['scope'] = scope;
13388
+ }
13389
+ if (typeof userId !== 'undefined') {
13390
+ payload['userId'] = userId;
13391
+ }
13392
+ if (typeof agentId !== 'undefined') {
13393
+ payload['agentId'] = agentId;
13394
+ }
13395
+ if (typeof sessionId !== 'undefined') {
13396
+ payload['sessionId'] = sessionId;
13397
+ }
13398
+ if (typeof runId !== 'undefined') {
13399
+ payload['runId'] = runId;
13400
+ }
13401
+ if (typeof memorySubStoreId !== 'undefined') {
13402
+ payload['memorySubStoreId'] = memorySubStoreId;
13403
+ }
13404
+ const uri = new URL(this.client.config.endpoint + apiPath);
13405
+ const apiHeaders = {
13406
+ 'X-Appwrite-Project': this.client.config.project,
13407
+ };
13408
+ return this.client.call('get', uri, apiHeaders, payload);
13409
+ }
13410
+ updateKnowledge(paramsOrFirst, ...rest) {
13411
+ let params;
13412
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
13413
+ params = (paramsOrFirst || {});
13414
+ }
13415
+ else {
13416
+ params = {
13417
+ knowledgeId: paramsOrFirst,
13418
+ expectedVersion: rest[0],
13419
+ scope: rest[1],
13420
+ userId: rest[2],
13421
+ agentId: rest[3],
13422
+ sessionId: rest[4],
13423
+ runId: rest[5],
13424
+ memorySubStoreId: rest[6],
13425
+ status: rest[7],
13426
+ validationStatus: rest[8]
12511
13427
  };
12512
13428
  }
12513
13429
  const knowledgeId = params.knowledgeId;
@@ -12518,8 +13434,8 @@
12518
13434
  const sessionId = params.sessionId;
12519
13435
  const runId = params.runId;
12520
13436
  const memorySubStoreId = params.memorySubStoreId;
12521
- const reason = params.reason;
12522
- const source = params.source;
13437
+ const status = params.status;
13438
+ const validationStatus = params.validationStatus;
12523
13439
  if (typeof knowledgeId === 'undefined') {
12524
13440
  throw new AgentbaseException('Missing required parameter: "knowledgeId"');
12525
13441
  }
@@ -12549,20 +13465,20 @@
12549
13465
  if (typeof expectedVersion !== 'undefined') {
12550
13466
  payload['expectedVersion'] = expectedVersion;
12551
13467
  }
12552
- if (typeof reason !== 'undefined') {
12553
- payload['reason'] = reason;
13468
+ if (typeof status !== 'undefined') {
13469
+ payload['status'] = status;
12554
13470
  }
12555
- if (typeof source !== 'undefined') {
12556
- payload['source'] = source;
13471
+ if (typeof validationStatus !== 'undefined') {
13472
+ payload['validationStatus'] = validationStatus;
12557
13473
  }
12558
13474
  const uri = new URL(this.client.config.endpoint + apiPath);
12559
13475
  const apiHeaders = {
12560
13476
  'X-Appwrite-Project': this.client.config.project,
12561
13477
  'content-type': 'application/json',
12562
13478
  };
12563
- return this.client.call('delete', uri, apiHeaders, payload);
13479
+ return this.client.call('patch', uri, apiHeaders, payload);
12564
13480
  }
12565
- createKnowledgeObservation(paramsOrFirst, ...rest) {
13481
+ forgetKnowledge(paramsOrFirst, ...rest) {
12566
13482
  let params;
12567
13483
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
12568
13484
  params = (paramsOrFirst || {});
@@ -12570,60 +13486,34 @@
12570
13486
  else {
12571
13487
  params = {
12572
13488
  knowledgeId: paramsOrFirst,
12573
- revision: rest[0],
12574
- outcome: rest[1],
12575
- evidence: rest[2],
12576
- scope: rest[3],
12577
- userId: rest[4],
12578
- agentId: rest[5],
12579
- sessionId: rest[6],
12580
- runId: rest[7],
12581
- memorySubStoreId: rest[8],
12582
- sourceId: rest[9],
12583
- injectionId: rest[10],
12584
- verificationSource: rest[11],
12585
- toolName: rest[12],
12586
- toolVersion: rest[13],
12587
- toolSchemaVersion: rest[14],
12588
- errorFingerprint: rest[15],
12589
- weight: rest[16],
12590
- observedAt: rest[17],
12591
- idempotencyKey: rest[18]
13489
+ expectedVersion: rest[0],
13490
+ scope: rest[1],
13491
+ userId: rest[2],
13492
+ agentId: rest[3],
13493
+ sessionId: rest[4],
13494
+ runId: rest[5],
13495
+ memorySubStoreId: rest[6],
13496
+ reason: rest[7],
13497
+ source: rest[8]
12592
13498
  };
12593
13499
  }
12594
13500
  const knowledgeId = params.knowledgeId;
12595
- const revision = params.revision;
12596
- const outcome = params.outcome;
12597
- const evidence = params.evidence;
13501
+ const expectedVersion = params.expectedVersion;
12598
13502
  const scope = params.scope;
12599
13503
  const userId = params.userId;
12600
13504
  const agentId = params.agentId;
12601
13505
  const sessionId = params.sessionId;
12602
13506
  const runId = params.runId;
12603
13507
  const memorySubStoreId = params.memorySubStoreId;
12604
- const sourceId = params.sourceId;
12605
- const injectionId = params.injectionId;
12606
- const verificationSource = params.verificationSource;
12607
- const toolName = params.toolName;
12608
- const toolVersion = params.toolVersion;
12609
- const toolSchemaVersion = params.toolSchemaVersion;
12610
- const errorFingerprint = params.errorFingerprint;
12611
- const weight = params.weight;
12612
- const observedAt = params.observedAt;
12613
- const idempotencyKey = params.idempotencyKey;
13508
+ const reason = params.reason;
13509
+ const source = params.source;
12614
13510
  if (typeof knowledgeId === 'undefined') {
12615
13511
  throw new AgentbaseException('Missing required parameter: "knowledgeId"');
12616
13512
  }
12617
- if (typeof revision === 'undefined') {
12618
- throw new AgentbaseException('Missing required parameter: "revision"');
12619
- }
12620
- if (typeof outcome === 'undefined') {
12621
- throw new AgentbaseException('Missing required parameter: "outcome"');
12622
- }
12623
- if (typeof evidence === 'undefined') {
12624
- throw new AgentbaseException('Missing required parameter: "evidence"');
13513
+ if (typeof expectedVersion === 'undefined') {
13514
+ throw new AgentbaseException('Missing required parameter: "expectedVersion"');
12625
13515
  }
12626
- const apiPath = '/memory/memories/observations';
13516
+ const apiPath = '/memory/memories/knowledge/{knowledgeId}'.replace('{knowledgeId}', knowledgeId);
12627
13517
  const payload = {};
12628
13518
  if (typeof scope !== 'undefined') {
12629
13519
  payload['scope'] = scope;
@@ -12643,107 +13533,114 @@
12643
13533
  if (typeof memorySubStoreId !== 'undefined') {
12644
13534
  payload['memorySubStoreId'] = memorySubStoreId;
12645
13535
  }
12646
- if (typeof knowledgeId !== 'undefined') {
12647
- payload['knowledgeId'] = knowledgeId;
13536
+ if (typeof expectedVersion !== 'undefined') {
13537
+ payload['expectedVersion'] = expectedVersion;
12648
13538
  }
12649
- if (typeof revision !== 'undefined') {
12650
- payload['revision'] = revision;
13539
+ if (typeof reason !== 'undefined') {
13540
+ payload['reason'] = reason;
12651
13541
  }
12652
- if (typeof sourceId !== 'undefined') {
12653
- payload['sourceId'] = sourceId;
13542
+ if (typeof source !== 'undefined') {
13543
+ payload['source'] = source;
12654
13544
  }
12655
- if (typeof injectionId !== 'undefined') {
12656
- payload['injectionId'] = injectionId;
13545
+ const uri = new URL(this.client.config.endpoint + apiPath);
13546
+ const apiHeaders = {
13547
+ 'X-Appwrite-Project': this.client.config.project,
13548
+ 'content-type': 'application/json',
13549
+ };
13550
+ return this.client.call('delete', uri, apiHeaders, payload);
13551
+ }
13552
+ getKnowledgeDiff(paramsOrFirst, ...rest) {
13553
+ let params;
13554
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
13555
+ params = (paramsOrFirst || {});
12657
13556
  }
12658
- if (typeof outcome !== 'undefined') {
12659
- payload['outcome'] = outcome;
13557
+ else {
13558
+ params = {
13559
+ knowledgeId: paramsOrFirst,
13560
+ toRevisionId: rest[0],
13561
+ scope: rest[1],
13562
+ userId: rest[2],
13563
+ agentId: rest[3],
13564
+ sessionId: rest[4],
13565
+ runId: rest[5],
13566
+ memorySubStoreId: rest[6],
13567
+ fromRevisionId: rest[7]
13568
+ };
12660
13569
  }
12661
- if (typeof verificationSource !== 'undefined') {
12662
- payload['verificationSource'] = verificationSource;
13570
+ const knowledgeId = params.knowledgeId;
13571
+ const toRevisionId = params.toRevisionId;
13572
+ const scope = params.scope;
13573
+ const userId = params.userId;
13574
+ const agentId = params.agentId;
13575
+ const sessionId = params.sessionId;
13576
+ const runId = params.runId;
13577
+ const memorySubStoreId = params.memorySubStoreId;
13578
+ const fromRevisionId = params.fromRevisionId;
13579
+ if (typeof knowledgeId === 'undefined') {
13580
+ throw new AgentbaseException('Missing required parameter: "knowledgeId"');
12663
13581
  }
12664
- if (typeof toolName !== 'undefined') {
12665
- payload['toolName'] = toolName;
13582
+ if (typeof toRevisionId === 'undefined') {
13583
+ throw new AgentbaseException('Missing required parameter: "toRevisionId"');
12666
13584
  }
12667
- if (typeof toolVersion !== 'undefined') {
12668
- payload['toolVersion'] = toolVersion;
13585
+ const apiPath = '/memory/memories/knowledge/{knowledgeId}/diff'.replace('{knowledgeId}', knowledgeId);
13586
+ const payload = {};
13587
+ if (typeof scope !== 'undefined') {
13588
+ payload['scope'] = scope;
12669
13589
  }
12670
- if (typeof toolSchemaVersion !== 'undefined') {
12671
- payload['toolSchemaVersion'] = toolSchemaVersion;
13590
+ if (typeof userId !== 'undefined') {
13591
+ payload['userId'] = userId;
12672
13592
  }
12673
- if (typeof errorFingerprint !== 'undefined') {
12674
- payload['errorFingerprint'] = errorFingerprint;
13593
+ if (typeof agentId !== 'undefined') {
13594
+ payload['agentId'] = agentId;
12675
13595
  }
12676
- if (typeof evidence !== 'undefined') {
12677
- payload['evidence'] = evidence;
13596
+ if (typeof sessionId !== 'undefined') {
13597
+ payload['sessionId'] = sessionId;
12678
13598
  }
12679
- if (typeof weight !== 'undefined') {
12680
- payload['weight'] = weight;
13599
+ if (typeof runId !== 'undefined') {
13600
+ payload['runId'] = runId;
12681
13601
  }
12682
- if (typeof observedAt !== 'undefined') {
12683
- payload['observedAt'] = observedAt;
13602
+ if (typeof memorySubStoreId !== 'undefined') {
13603
+ payload['memorySubStoreId'] = memorySubStoreId;
12684
13604
  }
12685
- if (typeof idempotencyKey !== 'undefined') {
12686
- payload['idempotencyKey'] = idempotencyKey;
13605
+ if (typeof fromRevisionId !== 'undefined') {
13606
+ payload['fromRevisionId'] = fromRevisionId;
13607
+ }
13608
+ if (typeof toRevisionId !== 'undefined') {
13609
+ payload['toRevisionId'] = toRevisionId;
12687
13610
  }
12688
- const uri = new URL(this.client.config.endpoint + apiPath);
12689
- const apiHeaders = {
12690
- 'X-Appwrite-Project': this.client.config.project,
12691
- 'content-type': 'application/json',
12692
- };
12693
- return this.client.call('post', uri, apiHeaders, payload);
12694
- }
12695
- /**
12696
- * Get a memory quality report.
12697
- *
12698
- * @throws {AgentbaseException}
12699
- * @returns {Promise<{}>}
12700
- */
12701
- getQuality() {
12702
- const apiPath = '/memory/memories/quality';
12703
- const payload = {};
12704
13611
  const uri = new URL(this.client.config.endpoint + apiPath);
12705
13612
  const apiHeaders = {
12706
13613
  'X-Appwrite-Project': this.client.config.project,
12707
13614
  };
12708
13615
  return this.client.call('get', uri, apiHeaders, payload);
12709
13616
  }
12710
- recallKnowledge(paramsOrFirst, ...rest) {
13617
+ listKnowledgeEvents(paramsOrFirst, ...rest) {
12711
13618
  let params;
12712
13619
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
12713
13620
  params = (paramsOrFirst || {});
12714
13621
  }
12715
13622
  else {
12716
13623
  params = {
12717
- query: paramsOrFirst,
13624
+ knowledgeId: paramsOrFirst,
12718
13625
  scope: rest[0],
12719
13626
  userId: rest[1],
12720
13627
  agentId: rest[2],
12721
13628
  sessionId: rest[3],
12722
13629
  runId: rest[4],
12723
- memorySubStoreId: rest[5],
12724
- kinds: rest[6],
12725
- limit: rest[7],
12726
- tokenBudget: rest[8],
12727
- retrieval: rest[9],
12728
- accessMode: rest[10]
13630
+ memorySubStoreId: rest[5]
12729
13631
  };
12730
13632
  }
12731
- const query = params.query;
13633
+ const knowledgeId = params.knowledgeId;
12732
13634
  const scope = params.scope;
12733
13635
  const userId = params.userId;
12734
13636
  const agentId = params.agentId;
12735
13637
  const sessionId = params.sessionId;
12736
13638
  const runId = params.runId;
12737
13639
  const memorySubStoreId = params.memorySubStoreId;
12738
- const kinds = params.kinds;
12739
- const limit = params.limit;
12740
- const tokenBudget = params.tokenBudget;
12741
- const retrieval = params.retrieval;
12742
- const accessMode = params.accessMode;
12743
- if (typeof query === 'undefined') {
12744
- throw new AgentbaseException('Missing required parameter: "query"');
13640
+ if (typeof knowledgeId === 'undefined') {
13641
+ throw new AgentbaseException('Missing required parameter: "knowledgeId"');
12745
13642
  }
12746
- const apiPath = '/memory/memories/recall';
13643
+ const apiPath = '/memory/memories/knowledge/{knowledgeId}/events'.replace('{knowledgeId}', knowledgeId);
12747
13644
  const payload = {};
12748
13645
  if (typeof scope !== 'undefined') {
12749
13646
  payload['scope'] = scope;
@@ -12763,87 +13660,139 @@
12763
13660
  if (typeof memorySubStoreId !== 'undefined') {
12764
13661
  payload['memorySubStoreId'] = memorySubStoreId;
12765
13662
  }
12766
- if (typeof query !== 'undefined') {
12767
- payload['query'] = query;
13663
+ const uri = new URL(this.client.config.endpoint + apiPath);
13664
+ const apiHeaders = {
13665
+ 'X-Appwrite-Project': this.client.config.project,
13666
+ };
13667
+ return this.client.call('get', uri, apiHeaders, payload);
13668
+ }
13669
+ listKnowledgeRevisions(paramsOrFirst, ...rest) {
13670
+ let params;
13671
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
13672
+ params = (paramsOrFirst || {});
12768
13673
  }
12769
- if (typeof kinds !== 'undefined') {
12770
- payload['kinds'] = kinds;
13674
+ else {
13675
+ params = {
13676
+ knowledgeId: paramsOrFirst,
13677
+ scope: rest[0],
13678
+ userId: rest[1],
13679
+ agentId: rest[2],
13680
+ sessionId: rest[3],
13681
+ runId: rest[4],
13682
+ memorySubStoreId: rest[5],
13683
+ limit: rest[6],
13684
+ offset: rest[7]
13685
+ };
12771
13686
  }
12772
- if (typeof limit !== 'undefined') {
12773
- payload['limit'] = limit;
13687
+ const knowledgeId = params.knowledgeId;
13688
+ const scope = params.scope;
13689
+ const userId = params.userId;
13690
+ const agentId = params.agentId;
13691
+ const sessionId = params.sessionId;
13692
+ const runId = params.runId;
13693
+ const memorySubStoreId = params.memorySubStoreId;
13694
+ const limit = params.limit;
13695
+ const offset = params.offset;
13696
+ if (typeof knowledgeId === 'undefined') {
13697
+ throw new AgentbaseException('Missing required parameter: "knowledgeId"');
12774
13698
  }
12775
- if (typeof tokenBudget !== 'undefined') {
12776
- payload['tokenBudget'] = tokenBudget;
13699
+ const apiPath = '/memory/memories/knowledge/{knowledgeId}/revisions'.replace('{knowledgeId}', knowledgeId);
13700
+ const payload = {};
13701
+ if (typeof scope !== 'undefined') {
13702
+ payload['scope'] = scope;
12777
13703
  }
12778
- if (typeof retrieval !== 'undefined') {
12779
- payload['retrieval'] = retrieval;
13704
+ if (typeof userId !== 'undefined') {
13705
+ payload['userId'] = userId;
12780
13706
  }
12781
- if (typeof accessMode !== 'undefined') {
12782
- payload['accessMode'] = accessMode;
13707
+ if (typeof agentId !== 'undefined') {
13708
+ payload['agentId'] = agentId;
13709
+ }
13710
+ if (typeof sessionId !== 'undefined') {
13711
+ payload['sessionId'] = sessionId;
13712
+ }
13713
+ if (typeof runId !== 'undefined') {
13714
+ payload['runId'] = runId;
13715
+ }
13716
+ if (typeof memorySubStoreId !== 'undefined') {
13717
+ payload['memorySubStoreId'] = memorySubStoreId;
13718
+ }
13719
+ if (typeof limit !== 'undefined') {
13720
+ payload['limit'] = limit;
13721
+ }
13722
+ if (typeof offset !== 'undefined') {
13723
+ payload['offset'] = offset;
12783
13724
  }
12784
13725
  const uri = new URL(this.client.config.endpoint + apiPath);
12785
13726
  const apiHeaders = {
12786
13727
  'X-Appwrite-Project': this.client.config.project,
12787
- 'content-type': 'application/json',
12788
13728
  };
12789
- return this.client.call('post', uri, apiHeaders, payload);
13729
+ return this.client.call('get', uri, apiHeaders, payload);
12790
13730
  }
12791
- search(paramsOrFirst, ...rest) {
13731
+ createKnowledgeObservation(paramsOrFirst, ...rest) {
12792
13732
  let params;
12793
13733
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
12794
13734
  params = (paramsOrFirst || {});
12795
13735
  }
12796
13736
  else {
12797
13737
  params = {
12798
- query: paramsOrFirst,
12799
- searchMode: rest[0],
12800
- retrieval: rest[1],
12801
- userId: rest[2],
12802
- agentId: rest[3],
12803
- runId: rest[4],
12804
- scope: rest[5],
12805
- memoryType: rest[6],
12806
- recordKind: rest[7],
12807
- filter: rest[8],
12808
- limit: rest[9],
12809
- cursor: rest[10],
12810
- sort: rest[11],
12811
- memorySubStoreId: rest[12],
12812
- sessionId: rest[13],
12813
- groupId: rest[14],
12814
- accessMode: rest[15]
13738
+ knowledgeId: paramsOrFirst,
13739
+ revision: rest[0],
13740
+ outcome: rest[1],
13741
+ evidence: rest[2],
13742
+ scope: rest[3],
13743
+ userId: rest[4],
13744
+ agentId: rest[5],
13745
+ sessionId: rest[6],
13746
+ runId: rest[7],
13747
+ memorySubStoreId: rest[8],
13748
+ sourceId: rest[9],
13749
+ injectionId: rest[10],
13750
+ verificationSource: rest[11],
13751
+ toolName: rest[12],
13752
+ toolVersion: rest[13],
13753
+ toolSchemaVersion: rest[14],
13754
+ errorFingerprint: rest[15],
13755
+ weight: rest[16],
13756
+ observedAt: rest[17],
13757
+ idempotencyKey: rest[18]
12815
13758
  };
12816
13759
  }
12817
- const query = params.query;
12818
- const searchMode = params.searchMode;
12819
- const retrieval = params.retrieval;
13760
+ const knowledgeId = params.knowledgeId;
13761
+ const revision = params.revision;
13762
+ const outcome = params.outcome;
13763
+ const evidence = params.evidence;
13764
+ const scope = params.scope;
12820
13765
  const userId = params.userId;
12821
13766
  const agentId = params.agentId;
13767
+ const sessionId = params.sessionId;
12822
13768
  const runId = params.runId;
12823
- const scope = params.scope;
12824
- const memoryType = params.memoryType;
12825
- const recordKind = params.recordKind;
12826
- const filter = params.filter;
12827
- const limit = params.limit;
12828
- const cursor = params.cursor;
12829
- const sort = params.sort;
12830
13769
  const memorySubStoreId = params.memorySubStoreId;
12831
- const sessionId = params.sessionId;
12832
- const groupId = params.groupId;
12833
- const accessMode = params.accessMode;
12834
- if (typeof query === 'undefined') {
12835
- throw new AgentbaseException('Missing required parameter: "query"');
13770
+ const sourceId = params.sourceId;
13771
+ const injectionId = params.injectionId;
13772
+ const verificationSource = params.verificationSource;
13773
+ const toolName = params.toolName;
13774
+ const toolVersion = params.toolVersion;
13775
+ const toolSchemaVersion = params.toolSchemaVersion;
13776
+ const errorFingerprint = params.errorFingerprint;
13777
+ const weight = params.weight;
13778
+ const observedAt = params.observedAt;
13779
+ const idempotencyKey = params.idempotencyKey;
13780
+ if (typeof knowledgeId === 'undefined') {
13781
+ throw new AgentbaseException('Missing required parameter: "knowledgeId"');
12836
13782
  }
12837
- const apiPath = '/memory/memories/search';
12838
- const payload = {};
12839
- if (typeof query !== 'undefined') {
12840
- payload['query'] = query;
13783
+ if (typeof revision === 'undefined') {
13784
+ throw new AgentbaseException('Missing required parameter: "revision"');
12841
13785
  }
12842
- if (typeof searchMode !== 'undefined') {
12843
- payload['searchMode'] = searchMode;
13786
+ if (typeof outcome === 'undefined') {
13787
+ throw new AgentbaseException('Missing required parameter: "outcome"');
12844
13788
  }
12845
- if (typeof retrieval !== 'undefined') {
12846
- payload['retrieval'] = retrieval;
13789
+ if (typeof evidence === 'undefined') {
13790
+ throw new AgentbaseException('Missing required parameter: "evidence"');
13791
+ }
13792
+ const apiPath = '/memory/memories/observations';
13793
+ const payload = {};
13794
+ if (typeof scope !== 'undefined') {
13795
+ payload['scope'] = scope;
12847
13796
  }
12848
13797
  if (typeof userId !== 'undefined') {
12849
13798
  payload['userId'] = userId;
@@ -12851,41 +13800,56 @@
12851
13800
  if (typeof agentId !== 'undefined') {
12852
13801
  payload['agentId'] = agentId;
12853
13802
  }
13803
+ if (typeof sessionId !== 'undefined') {
13804
+ payload['sessionId'] = sessionId;
13805
+ }
12854
13806
  if (typeof runId !== 'undefined') {
12855
13807
  payload['runId'] = runId;
12856
13808
  }
12857
- if (typeof scope !== 'undefined') {
12858
- payload['scope'] = scope;
13809
+ if (typeof memorySubStoreId !== 'undefined') {
13810
+ payload['memorySubStoreId'] = memorySubStoreId;
12859
13811
  }
12860
- if (typeof memoryType !== 'undefined') {
12861
- payload['memoryType'] = memoryType;
13812
+ if (typeof knowledgeId !== 'undefined') {
13813
+ payload['knowledgeId'] = knowledgeId;
12862
13814
  }
12863
- if (typeof recordKind !== 'undefined') {
12864
- payload['recordKind'] = recordKind;
13815
+ if (typeof revision !== 'undefined') {
13816
+ payload['revision'] = revision;
12865
13817
  }
12866
- if (typeof filter !== 'undefined') {
12867
- payload['filter'] = filter;
13818
+ if (typeof sourceId !== 'undefined') {
13819
+ payload['sourceId'] = sourceId;
12868
13820
  }
12869
- if (typeof limit !== 'undefined') {
12870
- payload['limit'] = limit;
13821
+ if (typeof injectionId !== 'undefined') {
13822
+ payload['injectionId'] = injectionId;
12871
13823
  }
12872
- if (typeof cursor !== 'undefined') {
12873
- payload['cursor'] = cursor;
13824
+ if (typeof outcome !== 'undefined') {
13825
+ payload['outcome'] = outcome;
12874
13826
  }
12875
- if (typeof sort !== 'undefined') {
12876
- payload['sort'] = sort;
13827
+ if (typeof verificationSource !== 'undefined') {
13828
+ payload['verificationSource'] = verificationSource;
12877
13829
  }
12878
- if (typeof memorySubStoreId !== 'undefined') {
12879
- payload['memorySubStoreId'] = memorySubStoreId;
13830
+ if (typeof toolName !== 'undefined') {
13831
+ payload['toolName'] = toolName;
12880
13832
  }
12881
- if (typeof sessionId !== 'undefined') {
12882
- payload['sessionId'] = sessionId;
13833
+ if (typeof toolVersion !== 'undefined') {
13834
+ payload['toolVersion'] = toolVersion;
12883
13835
  }
12884
- if (typeof groupId !== 'undefined') {
12885
- payload['groupId'] = groupId;
13836
+ if (typeof toolSchemaVersion !== 'undefined') {
13837
+ payload['toolSchemaVersion'] = toolSchemaVersion;
12886
13838
  }
12887
- if (typeof accessMode !== 'undefined') {
12888
- payload['accessMode'] = accessMode;
13839
+ if (typeof errorFingerprint !== 'undefined') {
13840
+ payload['errorFingerprint'] = errorFingerprint;
13841
+ }
13842
+ if (typeof evidence !== 'undefined') {
13843
+ payload['evidence'] = evidence;
13844
+ }
13845
+ if (typeof weight !== 'undefined') {
13846
+ payload['weight'] = weight;
13847
+ }
13848
+ if (typeof observedAt !== 'undefined') {
13849
+ payload['observedAt'] = observedAt;
13850
+ }
13851
+ if (typeof idempotencyKey !== 'undefined') {
13852
+ payload['idempotencyKey'] = idempotencyKey;
12889
13853
  }
12890
13854
  const uri = new URL(this.client.config.endpoint + apiPath);
12891
13855
  const apiHeaders = {
@@ -12894,14 +13858,51 @@
12894
13858
  };
12895
13859
  return this.client.call('post', uri, apiHeaders, payload);
12896
13860
  }
13861
+ listProfiles(paramsOrFirst, ...rest) {
13862
+ let params;
13863
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
13864
+ params = (paramsOrFirst || {});
13865
+ }
13866
+ else {
13867
+ params = {
13868
+ cursor: paramsOrFirst,
13869
+ limit: rest[0],
13870
+ userId: rest[1],
13871
+ profileType: rest[2]
13872
+ };
13873
+ }
13874
+ const cursor = params.cursor;
13875
+ const limit = params.limit;
13876
+ const userId = params.userId;
13877
+ const profileType = params.profileType;
13878
+ const apiPath = '/memory/memories/profiles';
13879
+ const payload = {};
13880
+ if (typeof cursor !== 'undefined') {
13881
+ payload['cursor'] = cursor;
13882
+ }
13883
+ if (typeof limit !== 'undefined') {
13884
+ payload['limit'] = limit;
13885
+ }
13886
+ if (typeof userId !== 'undefined') {
13887
+ payload['userId'] = userId;
13888
+ }
13889
+ if (typeof profileType !== 'undefined') {
13890
+ payload['profileType'] = profileType;
13891
+ }
13892
+ const uri = new URL(this.client.config.endpoint + apiPath);
13893
+ const apiHeaders = {
13894
+ 'X-Appwrite-Project': this.client.config.project,
13895
+ };
13896
+ return this.client.call('get', uri, apiHeaders, payload);
13897
+ }
12897
13898
  /**
12898
- * Get memory session aggregates.
13899
+ * Get a memory quality report.
12899
13900
  *
12900
13901
  * @throws {AgentbaseException}
12901
13902
  * @returns {Promise<{}>}
12902
13903
  */
12903
- getSessions() {
12904
- const apiPath = '/memory/memories/sessions';
13904
+ getQuality() {
13905
+ const apiPath = '/memory/memories/quality';
12905
13906
  const payload = {};
12906
13907
  const uri = new URL(this.client.config.endpoint + apiPath);
12907
13908
  const apiHeaders = {
@@ -12909,30 +13910,239 @@
12909
13910
  };
12910
13911
  return this.client.call('get', uri, apiHeaders, payload);
12911
13912
  }
12912
- listSkills(paramsOrFirst, ...rest) {
13913
+ recallKnowledge(paramsOrFirst, ...rest) {
12913
13914
  let params;
12914
- 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))) {
13915
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
12915
13916
  params = (paramsOrFirst || {});
12916
13917
  }
12917
13918
  else {
12918
13919
  params = {
12919
- scope: paramsOrFirst,
12920
- userId: rest[0],
12921
- agentId: rest[1],
12922
- sessionId: rest[2],
12923
- runId: rest[3],
12924
- memorySubStoreId: rest[4],
12925
- cursor: rest[5],
12926
- limit: rest[6]
12927
- };
12928
- }
12929
- const scope = params.scope;
12930
- const userId = params.userId;
12931
- const agentId = params.agentId;
12932
- const sessionId = params.sessionId;
12933
- const runId = params.runId;
12934
- const memorySubStoreId = params.memorySubStoreId;
12935
- const cursor = params.cursor;
13920
+ query: paramsOrFirst,
13921
+ scope: rest[0],
13922
+ userId: rest[1],
13923
+ agentId: rest[2],
13924
+ sessionId: rest[3],
13925
+ runId: rest[4],
13926
+ memorySubStoreId: rest[5],
13927
+ kinds: rest[6],
13928
+ limit: rest[7],
13929
+ tokenBudget: rest[8],
13930
+ retrieval: rest[9],
13931
+ accessMode: rest[10]
13932
+ };
13933
+ }
13934
+ const query = params.query;
13935
+ const scope = params.scope;
13936
+ const userId = params.userId;
13937
+ const agentId = params.agentId;
13938
+ const sessionId = params.sessionId;
13939
+ const runId = params.runId;
13940
+ const memorySubStoreId = params.memorySubStoreId;
13941
+ const kinds = params.kinds;
13942
+ const limit = params.limit;
13943
+ const tokenBudget = params.tokenBudget;
13944
+ const retrieval = params.retrieval;
13945
+ const accessMode = params.accessMode;
13946
+ if (typeof query === 'undefined') {
13947
+ throw new AgentbaseException('Missing required parameter: "query"');
13948
+ }
13949
+ const apiPath = '/memory/memories/recall';
13950
+ const payload = {};
13951
+ if (typeof scope !== 'undefined') {
13952
+ payload['scope'] = scope;
13953
+ }
13954
+ if (typeof userId !== 'undefined') {
13955
+ payload['userId'] = userId;
13956
+ }
13957
+ if (typeof agentId !== 'undefined') {
13958
+ payload['agentId'] = agentId;
13959
+ }
13960
+ if (typeof sessionId !== 'undefined') {
13961
+ payload['sessionId'] = sessionId;
13962
+ }
13963
+ if (typeof runId !== 'undefined') {
13964
+ payload['runId'] = runId;
13965
+ }
13966
+ if (typeof memorySubStoreId !== 'undefined') {
13967
+ payload['memorySubStoreId'] = memorySubStoreId;
13968
+ }
13969
+ if (typeof query !== 'undefined') {
13970
+ payload['query'] = query;
13971
+ }
13972
+ if (typeof kinds !== 'undefined') {
13973
+ payload['kinds'] = kinds;
13974
+ }
13975
+ if (typeof limit !== 'undefined') {
13976
+ payload['limit'] = limit;
13977
+ }
13978
+ if (typeof tokenBudget !== 'undefined') {
13979
+ payload['tokenBudget'] = tokenBudget;
13980
+ }
13981
+ if (typeof retrieval !== 'undefined') {
13982
+ payload['retrieval'] = retrieval;
13983
+ }
13984
+ if (typeof accessMode !== 'undefined') {
13985
+ payload['accessMode'] = accessMode;
13986
+ }
13987
+ const uri = new URL(this.client.config.endpoint + apiPath);
13988
+ const apiHeaders = {
13989
+ 'X-Appwrite-Project': this.client.config.project,
13990
+ 'content-type': 'application/json',
13991
+ };
13992
+ return this.client.call('post', uri, apiHeaders, payload);
13993
+ }
13994
+ search(paramsOrFirst, ...rest) {
13995
+ let params;
13996
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
13997
+ params = (paramsOrFirst || {});
13998
+ }
13999
+ else {
14000
+ params = {
14001
+ query: paramsOrFirst,
14002
+ searchMode: rest[0],
14003
+ retrieval: rest[1],
14004
+ media: rest[2],
14005
+ userId: rest[3],
14006
+ agentId: rest[4],
14007
+ runId: rest[5],
14008
+ scope: rest[6],
14009
+ memoryType: rest[7],
14010
+ recordKind: rest[8],
14011
+ filter: rest[9],
14012
+ temporal: rest[10],
14013
+ limit: rest[11],
14014
+ cursor: rest[12],
14015
+ sort: rest[13],
14016
+ memorySubStoreId: rest[14],
14017
+ sessionId: rest[15],
14018
+ groupId: rest[16],
14019
+ accessMode: rest[17]
14020
+ };
14021
+ }
14022
+ const query = params.query;
14023
+ const searchMode = params.searchMode;
14024
+ const retrieval = params.retrieval;
14025
+ const media = params.media;
14026
+ const userId = params.userId;
14027
+ const agentId = params.agentId;
14028
+ const runId = params.runId;
14029
+ const scope = params.scope;
14030
+ const memoryType = params.memoryType;
14031
+ const recordKind = params.recordKind;
14032
+ const filter = params.filter;
14033
+ const temporal = params.temporal;
14034
+ const limit = params.limit;
14035
+ const cursor = params.cursor;
14036
+ const sort = params.sort;
14037
+ const memorySubStoreId = params.memorySubStoreId;
14038
+ const sessionId = params.sessionId;
14039
+ const groupId = params.groupId;
14040
+ const accessMode = params.accessMode;
14041
+ const apiPath = '/memory/memories/search';
14042
+ const payload = {};
14043
+ if (typeof query !== 'undefined') {
14044
+ payload['query'] = query;
14045
+ }
14046
+ if (typeof searchMode !== 'undefined') {
14047
+ payload['searchMode'] = searchMode;
14048
+ }
14049
+ if (typeof retrieval !== 'undefined') {
14050
+ payload['retrieval'] = retrieval;
14051
+ }
14052
+ if (typeof media !== 'undefined') {
14053
+ payload['media'] = media;
14054
+ }
14055
+ if (typeof userId !== 'undefined') {
14056
+ payload['userId'] = userId;
14057
+ }
14058
+ if (typeof agentId !== 'undefined') {
14059
+ payload['agentId'] = agentId;
14060
+ }
14061
+ if (typeof runId !== 'undefined') {
14062
+ payload['runId'] = runId;
14063
+ }
14064
+ if (typeof scope !== 'undefined') {
14065
+ payload['scope'] = scope;
14066
+ }
14067
+ if (typeof memoryType !== 'undefined') {
14068
+ payload['memoryType'] = memoryType;
14069
+ }
14070
+ if (typeof recordKind !== 'undefined') {
14071
+ payload['recordKind'] = recordKind;
14072
+ }
14073
+ if (typeof filter !== 'undefined') {
14074
+ payload['filter'] = filter;
14075
+ }
14076
+ if (typeof temporal !== 'undefined') {
14077
+ payload['temporal'] = temporal;
14078
+ }
14079
+ if (typeof limit !== 'undefined') {
14080
+ payload['limit'] = limit;
14081
+ }
14082
+ if (typeof cursor !== 'undefined') {
14083
+ payload['cursor'] = cursor;
14084
+ }
14085
+ if (typeof sort !== 'undefined') {
14086
+ payload['sort'] = sort;
14087
+ }
14088
+ if (typeof memorySubStoreId !== 'undefined') {
14089
+ payload['memorySubStoreId'] = memorySubStoreId;
14090
+ }
14091
+ if (typeof sessionId !== 'undefined') {
14092
+ payload['sessionId'] = sessionId;
14093
+ }
14094
+ if (typeof groupId !== 'undefined') {
14095
+ payload['groupId'] = groupId;
14096
+ }
14097
+ if (typeof accessMode !== 'undefined') {
14098
+ payload['accessMode'] = accessMode;
14099
+ }
14100
+ const uri = new URL(this.client.config.endpoint + apiPath);
14101
+ const apiHeaders = {
14102
+ 'X-Appwrite-Project': this.client.config.project,
14103
+ 'content-type': 'application/json',
14104
+ };
14105
+ return this.client.call('post', uri, apiHeaders, payload);
14106
+ }
14107
+ /**
14108
+ * Get memory session aggregates.
14109
+ *
14110
+ * @throws {AgentbaseException}
14111
+ * @returns {Promise<{}>}
14112
+ */
14113
+ getSessions() {
14114
+ const apiPath = '/memory/memories/sessions';
14115
+ const payload = {};
14116
+ const uri = new URL(this.client.config.endpoint + apiPath);
14117
+ const apiHeaders = {
14118
+ 'X-Appwrite-Project': this.client.config.project,
14119
+ };
14120
+ return this.client.call('get', uri, apiHeaders, payload);
14121
+ }
14122
+ listSkills(paramsOrFirst, ...rest) {
14123
+ let params;
14124
+ 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))) {
14125
+ params = (paramsOrFirst || {});
14126
+ }
14127
+ else {
14128
+ params = {
14129
+ scope: paramsOrFirst,
14130
+ userId: rest[0],
14131
+ agentId: rest[1],
14132
+ sessionId: rest[2],
14133
+ runId: rest[3],
14134
+ memorySubStoreId: rest[4],
14135
+ cursor: rest[5],
14136
+ limit: rest[6]
14137
+ };
14138
+ }
14139
+ const scope = params.scope;
14140
+ const userId = params.userId;
14141
+ const agentId = params.agentId;
14142
+ const sessionId = params.sessionId;
14143
+ const runId = params.runId;
14144
+ const memorySubStoreId = params.memorySubStoreId;
14145
+ const cursor = params.cursor;
12936
14146
  const limit = params.limit;
12937
14147
  const apiPath = '/memory/memories/skills';
12938
14148
  const payload = {};
@@ -12954,81 +14164,575 @@
12954
14164
  if (typeof memorySubStoreId !== 'undefined') {
12955
14165
  payload['memorySubStoreId'] = memorySubStoreId;
12956
14166
  }
12957
- if (typeof cursor !== 'undefined') {
12958
- payload['cursor'] = cursor;
14167
+ if (typeof cursor !== 'undefined') {
14168
+ payload['cursor'] = cursor;
14169
+ }
14170
+ if (typeof limit !== 'undefined') {
14171
+ payload['limit'] = limit;
14172
+ }
14173
+ const uri = new URL(this.client.config.endpoint + apiPath);
14174
+ const apiHeaders = {
14175
+ 'X-Appwrite-Project': this.client.config.project,
14176
+ };
14177
+ return this.client.call('get', uri, apiHeaders, payload);
14178
+ }
14179
+ searchSkills(paramsOrFirst, ...rest) {
14180
+ let params;
14181
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
14182
+ params = (paramsOrFirst || {});
14183
+ }
14184
+ else {
14185
+ params = {
14186
+ query: paramsOrFirst,
14187
+ scope: rest[0],
14188
+ userId: rest[1],
14189
+ agentId: rest[2],
14190
+ sessionId: rest[3],
14191
+ runId: rest[4],
14192
+ memorySubStoreId: rest[5],
14193
+ cursor: rest[6],
14194
+ limit: rest[7],
14195
+ retrieval: rest[8]
14196
+ };
14197
+ }
14198
+ const query = params.query;
14199
+ const scope = params.scope;
14200
+ const userId = params.userId;
14201
+ const agentId = params.agentId;
14202
+ const sessionId = params.sessionId;
14203
+ const runId = params.runId;
14204
+ const memorySubStoreId = params.memorySubStoreId;
14205
+ const cursor = params.cursor;
14206
+ const limit = params.limit;
14207
+ const retrieval = params.retrieval;
14208
+ if (typeof query === 'undefined') {
14209
+ throw new AgentbaseException('Missing required parameter: "query"');
14210
+ }
14211
+ const apiPath = '/memory/memories/skills/search';
14212
+ const payload = {};
14213
+ if (typeof scope !== 'undefined') {
14214
+ payload['scope'] = scope;
14215
+ }
14216
+ if (typeof userId !== 'undefined') {
14217
+ payload['userId'] = userId;
14218
+ }
14219
+ if (typeof agentId !== 'undefined') {
14220
+ payload['agentId'] = agentId;
14221
+ }
14222
+ if (typeof sessionId !== 'undefined') {
14223
+ payload['sessionId'] = sessionId;
14224
+ }
14225
+ if (typeof runId !== 'undefined') {
14226
+ payload['runId'] = runId;
14227
+ }
14228
+ if (typeof memorySubStoreId !== 'undefined') {
14229
+ payload['memorySubStoreId'] = memorySubStoreId;
14230
+ }
14231
+ if (typeof query !== 'undefined') {
14232
+ payload['query'] = query;
14233
+ }
14234
+ if (typeof cursor !== 'undefined') {
14235
+ payload['cursor'] = cursor;
14236
+ }
14237
+ if (typeof limit !== 'undefined') {
14238
+ payload['limit'] = limit;
14239
+ }
14240
+ if (typeof retrieval !== 'undefined') {
14241
+ payload['retrieval'] = retrieval;
14242
+ }
14243
+ const uri = new URL(this.client.config.endpoint + apiPath);
14244
+ const apiHeaders = {
14245
+ 'X-Appwrite-Project': this.client.config.project,
14246
+ 'content-type': 'application/json',
14247
+ };
14248
+ return this.client.call('post', uri, apiHeaders, payload);
14249
+ }
14250
+ getSkill(paramsOrFirst, ...rest) {
14251
+ let params;
14252
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
14253
+ params = (paramsOrFirst || {});
14254
+ }
14255
+ else {
14256
+ params = {
14257
+ knowledgeId: paramsOrFirst,
14258
+ scope: rest[0],
14259
+ userId: rest[1],
14260
+ agentId: rest[2],
14261
+ sessionId: rest[3],
14262
+ runId: rest[4],
14263
+ memorySubStoreId: rest[5]
14264
+ };
14265
+ }
14266
+ const knowledgeId = params.knowledgeId;
14267
+ const scope = params.scope;
14268
+ const userId = params.userId;
14269
+ const agentId = params.agentId;
14270
+ const sessionId = params.sessionId;
14271
+ const runId = params.runId;
14272
+ const memorySubStoreId = params.memorySubStoreId;
14273
+ if (typeof knowledgeId === 'undefined') {
14274
+ throw new AgentbaseException('Missing required parameter: "knowledgeId"');
14275
+ }
14276
+ const apiPath = '/memory/memories/skills/{knowledgeId}'.replace('{knowledgeId}', knowledgeId);
14277
+ const payload = {};
14278
+ if (typeof scope !== 'undefined') {
14279
+ payload['scope'] = scope;
14280
+ }
14281
+ if (typeof userId !== 'undefined') {
14282
+ payload['userId'] = userId;
14283
+ }
14284
+ if (typeof agentId !== 'undefined') {
14285
+ payload['agentId'] = agentId;
14286
+ }
14287
+ if (typeof sessionId !== 'undefined') {
14288
+ payload['sessionId'] = sessionId;
14289
+ }
14290
+ if (typeof runId !== 'undefined') {
14291
+ payload['runId'] = runId;
14292
+ }
14293
+ if (typeof memorySubStoreId !== 'undefined') {
14294
+ payload['memorySubStoreId'] = memorySubStoreId;
14295
+ }
14296
+ const uri = new URL(this.client.config.endpoint + apiPath);
14297
+ const apiHeaders = {
14298
+ 'X-Appwrite-Project': this.client.config.project,
14299
+ };
14300
+ return this.client.call('get', uri, apiHeaders, payload);
14301
+ }
14302
+ listSkillSources(paramsOrFirst, ...rest) {
14303
+ let params;
14304
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
14305
+ params = (paramsOrFirst || {});
14306
+ }
14307
+ else {
14308
+ params = {
14309
+ knowledgeId: paramsOrFirst,
14310
+ scope: rest[0],
14311
+ userId: rest[1],
14312
+ agentId: rest[2],
14313
+ sessionId: rest[3],
14314
+ runId: rest[4],
14315
+ memorySubStoreId: rest[5],
14316
+ cursor: rest[6],
14317
+ limit: rest[7]
14318
+ };
14319
+ }
14320
+ const knowledgeId = params.knowledgeId;
14321
+ const scope = params.scope;
14322
+ const userId = params.userId;
14323
+ const agentId = params.agentId;
14324
+ const sessionId = params.sessionId;
14325
+ const runId = params.runId;
14326
+ const memorySubStoreId = params.memorySubStoreId;
14327
+ const cursor = params.cursor;
14328
+ const limit = params.limit;
14329
+ if (typeof knowledgeId === 'undefined') {
14330
+ throw new AgentbaseException('Missing required parameter: "knowledgeId"');
14331
+ }
14332
+ const apiPath = '/memory/memories/skills/{knowledgeId}/sources'.replace('{knowledgeId}', knowledgeId);
14333
+ const payload = {};
14334
+ if (typeof scope !== 'undefined') {
14335
+ payload['scope'] = scope;
14336
+ }
14337
+ if (typeof userId !== 'undefined') {
14338
+ payload['userId'] = userId;
14339
+ }
14340
+ if (typeof agentId !== 'undefined') {
14341
+ payload['agentId'] = agentId;
14342
+ }
14343
+ if (typeof sessionId !== 'undefined') {
14344
+ payload['sessionId'] = sessionId;
14345
+ }
14346
+ if (typeof runId !== 'undefined') {
14347
+ payload['runId'] = runId;
14348
+ }
14349
+ if (typeof memorySubStoreId !== 'undefined') {
14350
+ payload['memorySubStoreId'] = memorySubStoreId;
14351
+ }
14352
+ if (typeof cursor !== 'undefined') {
14353
+ payload['cursor'] = cursor;
14354
+ }
14355
+ if (typeof limit !== 'undefined') {
14356
+ payload['limit'] = limit;
14357
+ }
14358
+ const uri = new URL(this.client.config.endpoint + apiPath);
14359
+ const apiHeaders = {
14360
+ 'X-Appwrite-Project': this.client.config.project,
14361
+ };
14362
+ return this.client.call('get', uri, apiHeaders, payload);
14363
+ }
14364
+ /**
14365
+ * Get memory statistics visible to the current caller.
14366
+ *
14367
+ * @throws {AgentbaseException}
14368
+ * @returns {Promise<{}>}
14369
+ */
14370
+ getStats() {
14371
+ const apiPath = '/memory/memories/stats';
14372
+ const payload = {};
14373
+ const uri = new URL(this.client.config.endpoint + apiPath);
14374
+ const apiHeaders = {
14375
+ 'X-Appwrite-Project': this.client.config.project,
14376
+ };
14377
+ return this.client.call('get', uri, apiHeaders, payload);
14378
+ }
14379
+ /**
14380
+ * Get a memory activity timeline.
14381
+ *
14382
+ * @throws {AgentbaseException}
14383
+ * @returns {Promise<{}>}
14384
+ */
14385
+ getTimeline() {
14386
+ const apiPath = '/memory/memories/timeline';
14387
+ const payload = {};
14388
+ const uri = new URL(this.client.config.endpoint + apiPath);
14389
+ const apiHeaders = {
14390
+ 'X-Appwrite-Project': this.client.config.project,
14391
+ };
14392
+ return this.client.call('get', uri, apiHeaders, payload);
14393
+ }
14394
+ getProfile(paramsOrFirst, ...rest) {
14395
+ let params;
14396
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
14397
+ params = (paramsOrFirst || {});
14398
+ }
14399
+ else {
14400
+ params = {
14401
+ userId: paramsOrFirst,
14402
+ profileType: rest[0]
14403
+ };
14404
+ }
14405
+ const userId = params.userId;
14406
+ const profileType = params.profileType;
14407
+ if (typeof userId === 'undefined') {
14408
+ throw new AgentbaseException('Missing required parameter: "userId"');
14409
+ }
14410
+ const apiPath = '/memory/memories/users/{userId}/profile'.replace('{userId}', userId);
14411
+ const payload = {};
14412
+ if (typeof profileType !== 'undefined') {
14413
+ payload['profileType'] = profileType;
14414
+ }
14415
+ const uri = new URL(this.client.config.endpoint + apiPath);
14416
+ const apiHeaders = {
14417
+ 'X-Appwrite-Project': this.client.config.project,
14418
+ };
14419
+ return this.client.call('get', uri, apiHeaders, payload);
14420
+ }
14421
+ deleteProfile(paramsOrFirst, ...rest) {
14422
+ let params;
14423
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
14424
+ params = (paramsOrFirst || {});
14425
+ }
14426
+ else {
14427
+ params = {
14428
+ userId: paramsOrFirst,
14429
+ profileType: rest[0],
14430
+ reason: rest[1],
14431
+ source: rest[2]
14432
+ };
14433
+ }
14434
+ const userId = params.userId;
14435
+ const profileType = params.profileType;
14436
+ const reason = params.reason;
14437
+ const source = params.source;
14438
+ if (typeof userId === 'undefined') {
14439
+ throw new AgentbaseException('Missing required parameter: "userId"');
14440
+ }
14441
+ const apiPath = '/memory/memories/users/{userId}/profile'.replace('{userId}', userId);
14442
+ const payload = {};
14443
+ if (typeof profileType !== 'undefined') {
14444
+ payload['profileType'] = profileType;
14445
+ }
14446
+ if (typeof reason !== 'undefined') {
14447
+ payload['reason'] = reason;
14448
+ }
14449
+ if (typeof source !== 'undefined') {
14450
+ payload['source'] = source;
14451
+ }
14452
+ const uri = new URL(this.client.config.endpoint + apiPath);
14453
+ const apiHeaders = {
14454
+ 'X-Appwrite-Project': this.client.config.project,
14455
+ 'content-type': 'application/json',
14456
+ };
14457
+ return this.client.call('delete', uri, apiHeaders, payload);
14458
+ }
14459
+ createProfileExtraction(paramsOrFirst, ...rest) {
14460
+ let params;
14461
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
14462
+ params = (paramsOrFirst || {});
14463
+ }
14464
+ else {
14465
+ params = {
14466
+ userId: paramsOrFirst,
14467
+ pipelineId: rest[0],
14468
+ profileType: rest[1],
14469
+ messages: rest[2],
14470
+ sourceMemoryIds: rest[3],
14471
+ sessionId: rest[4],
14472
+ mode: rest[5]
14473
+ };
14474
+ }
14475
+ const userId = params.userId;
14476
+ const pipelineId = params.pipelineId;
14477
+ const profileType = params.profileType;
14478
+ const messages = params.messages;
14479
+ const sourceMemoryIds = params.sourceMemoryIds;
14480
+ const sessionId = params.sessionId;
14481
+ const mode = params.mode;
14482
+ if (typeof userId === 'undefined') {
14483
+ throw new AgentbaseException('Missing required parameter: "userId"');
14484
+ }
14485
+ const apiPath = '/memory/memories/users/{userId}/profile/extractions'.replace('{userId}', userId);
14486
+ const payload = {};
14487
+ if (typeof pipelineId !== 'undefined') {
14488
+ payload['pipelineId'] = pipelineId;
14489
+ }
14490
+ if (typeof profileType !== 'undefined') {
14491
+ payload['profileType'] = profileType;
14492
+ }
14493
+ if (typeof messages !== 'undefined') {
14494
+ payload['messages'] = messages;
14495
+ }
14496
+ if (typeof sourceMemoryIds !== 'undefined') {
14497
+ payload['sourceMemoryIds'] = sourceMemoryIds;
14498
+ }
14499
+ if (typeof sessionId !== 'undefined') {
14500
+ payload['sessionId'] = sessionId;
14501
+ }
14502
+ if (typeof mode !== 'undefined') {
14503
+ payload['mode'] = mode;
14504
+ }
14505
+ const uri = new URL(this.client.config.endpoint + apiPath);
14506
+ const apiHeaders = {
14507
+ 'X-Appwrite-Project': this.client.config.project,
14508
+ 'content-type': 'application/json',
14509
+ };
14510
+ return this.client.call('post', uri, apiHeaders, payload);
14511
+ }
14512
+ createProfileRebuild(paramsOrFirst, ...rest) {
14513
+ let params;
14514
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
14515
+ params = (paramsOrFirst || {});
14516
+ }
14517
+ else {
14518
+ params = {
14519
+ userId: paramsOrFirst,
14520
+ pipelineId: rest[0],
14521
+ profileType: rest[1]
14522
+ };
14523
+ }
14524
+ const userId = params.userId;
14525
+ const pipelineId = params.pipelineId;
14526
+ const profileType = params.profileType;
14527
+ if (typeof userId === 'undefined') {
14528
+ throw new AgentbaseException('Missing required parameter: "userId"');
14529
+ }
14530
+ const apiPath = '/memory/memories/users/{userId}/profile/rebuild'.replace('{userId}', userId);
14531
+ const payload = {};
14532
+ if (typeof pipelineId !== 'undefined') {
14533
+ payload['pipelineId'] = pipelineId;
14534
+ }
14535
+ if (typeof profileType !== 'undefined') {
14536
+ payload['profileType'] = profileType;
14537
+ }
14538
+ const uri = new URL(this.client.config.endpoint + apiPath);
14539
+ const apiHeaders = {
14540
+ 'X-Appwrite-Project': this.client.config.project,
14541
+ 'content-type': 'application/json',
14542
+ };
14543
+ return this.client.call('post', uri, apiHeaders, payload);
14544
+ }
14545
+ listProfileSources(paramsOrFirst, ...rest) {
14546
+ let params;
14547
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
14548
+ params = (paramsOrFirst || {});
14549
+ }
14550
+ else {
14551
+ params = {
14552
+ userId: paramsOrFirst,
14553
+ profileType: rest[0]
14554
+ };
14555
+ }
14556
+ const userId = params.userId;
14557
+ const profileType = params.profileType;
14558
+ if (typeof userId === 'undefined') {
14559
+ throw new AgentbaseException('Missing required parameter: "userId"');
14560
+ }
14561
+ const apiPath = '/memory/memories/users/{userId}/profile/sources'.replace('{userId}', userId);
14562
+ const payload = {};
14563
+ if (typeof profileType !== 'undefined') {
14564
+ payload['profileType'] = profileType;
14565
+ }
14566
+ const uri = new URL(this.client.config.endpoint + apiPath);
14567
+ const apiHeaders = {
14568
+ 'X-Appwrite-Project': this.client.config.project,
14569
+ };
14570
+ return this.client.call('get', uri, apiHeaders, payload);
14571
+ }
14572
+ get(paramsOrFirst) {
14573
+ let params;
14574
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
14575
+ params = (paramsOrFirst || {});
14576
+ }
14577
+ else {
14578
+ params = {
14579
+ memoryId: paramsOrFirst
14580
+ };
14581
+ }
14582
+ const memoryId = params.memoryId;
14583
+ if (typeof memoryId === 'undefined') {
14584
+ throw new AgentbaseException('Missing required parameter: "memoryId"');
14585
+ }
14586
+ const apiPath = '/memory/memories/{memoryId}'.replace('{memoryId}', memoryId);
14587
+ const payload = {};
14588
+ const uri = new URL(this.client.config.endpoint + apiPath);
14589
+ const apiHeaders = {
14590
+ 'X-Appwrite-Project': this.client.config.project,
14591
+ };
14592
+ return this.client.call('get', uri, apiHeaders, payload);
14593
+ }
14594
+ update(paramsOrFirst, ...rest) {
14595
+ let params;
14596
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
14597
+ params = (paramsOrFirst || {});
14598
+ }
14599
+ else {
14600
+ params = {
14601
+ memoryId: paramsOrFirst,
14602
+ version: rest[0],
14603
+ content: rest[1],
14604
+ metadata: rest[2],
14605
+ retentionPolicy: rest[3]
14606
+ };
14607
+ }
14608
+ const memoryId = params.memoryId;
14609
+ const version = params.version;
14610
+ const content = params.content;
14611
+ const metadata = params.metadata;
14612
+ const retentionPolicy = params.retentionPolicy;
14613
+ if (typeof memoryId === 'undefined') {
14614
+ throw new AgentbaseException('Missing required parameter: "memoryId"');
14615
+ }
14616
+ if (typeof version === 'undefined') {
14617
+ throw new AgentbaseException('Missing required parameter: "version"');
14618
+ }
14619
+ const apiPath = '/memory/memories/{memoryId}'.replace('{memoryId}', memoryId);
14620
+ const payload = {};
14621
+ if (typeof version !== 'undefined') {
14622
+ payload['version'] = version;
14623
+ }
14624
+ if (typeof content !== 'undefined') {
14625
+ payload['content'] = content;
14626
+ }
14627
+ if (typeof metadata !== 'undefined') {
14628
+ payload['metadata'] = metadata;
14629
+ }
14630
+ if (typeof retentionPolicy !== 'undefined') {
14631
+ payload['retentionPolicy'] = retentionPolicy;
14632
+ }
14633
+ const uri = new URL(this.client.config.endpoint + apiPath);
14634
+ const apiHeaders = {
14635
+ 'X-Appwrite-Project': this.client.config.project,
14636
+ 'content-type': 'application/json',
14637
+ };
14638
+ return this.client.call('patch', uri, apiHeaders, payload);
14639
+ }
14640
+ delete(paramsOrFirst, ...rest) {
14641
+ let params;
14642
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
14643
+ params = (paramsOrFirst || {});
14644
+ }
14645
+ else {
14646
+ params = {
14647
+ memoryId: paramsOrFirst,
14648
+ memorySubStoreId: rest[0],
14649
+ reason: rest[1],
14650
+ source: rest[2]
14651
+ };
14652
+ }
14653
+ const memoryId = params.memoryId;
14654
+ const memorySubStoreId = params.memorySubStoreId;
14655
+ const reason = params.reason;
14656
+ const source = params.source;
14657
+ if (typeof memoryId === 'undefined') {
14658
+ throw new AgentbaseException('Missing required parameter: "memoryId"');
14659
+ }
14660
+ const apiPath = '/memory/memories/{memoryId}'.replace('{memoryId}', memoryId);
14661
+ const payload = {};
14662
+ if (typeof memorySubStoreId !== 'undefined') {
14663
+ payload['memorySubStoreId'] = memorySubStoreId;
14664
+ }
14665
+ if (typeof reason !== 'undefined') {
14666
+ payload['reason'] = reason;
12959
14667
  }
12960
- if (typeof limit !== 'undefined') {
12961
- payload['limit'] = limit;
14668
+ if (typeof source !== 'undefined') {
14669
+ payload['source'] = source;
12962
14670
  }
12963
14671
  const uri = new URL(this.client.config.endpoint + apiPath);
12964
14672
  const apiHeaders = {
12965
14673
  'X-Appwrite-Project': this.client.config.project,
14674
+ 'content-type': 'application/json',
12966
14675
  };
12967
- return this.client.call('get', uri, apiHeaders, payload);
14676
+ return this.client.call('delete', uri, apiHeaders, payload);
12968
14677
  }
12969
- searchSkills(paramsOrFirst, ...rest) {
14678
+ listShares(paramsOrFirst) {
12970
14679
  let params;
12971
14680
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
12972
14681
  params = (paramsOrFirst || {});
12973
14682
  }
12974
14683
  else {
12975
14684
  params = {
12976
- query: paramsOrFirst,
12977
- scope: rest[0],
12978
- userId: rest[1],
12979
- agentId: rest[2],
12980
- sessionId: rest[3],
12981
- runId: rest[4],
12982
- memorySubStoreId: rest[5],
12983
- cursor: rest[6],
12984
- limit: rest[7],
12985
- retrieval: rest[8]
14685
+ memoryId: paramsOrFirst
12986
14686
  };
12987
14687
  }
12988
- const query = params.query;
12989
- const scope = params.scope;
12990
- const userId = params.userId;
12991
- const agentId = params.agentId;
12992
- const sessionId = params.sessionId;
12993
- const runId = params.runId;
12994
- const memorySubStoreId = params.memorySubStoreId;
12995
- const cursor = params.cursor;
12996
- const limit = params.limit;
12997
- const retrieval = params.retrieval;
12998
- if (typeof query === 'undefined') {
12999
- throw new AgentbaseException('Missing required parameter: "query"');
14688
+ const memoryId = params.memoryId;
14689
+ if (typeof memoryId === 'undefined') {
14690
+ throw new AgentbaseException('Missing required parameter: "memoryId"');
13000
14691
  }
13001
- const apiPath = '/memory/memories/skills/search';
14692
+ const apiPath = '/memory/memories/{memoryId}/shares'.replace('{memoryId}', memoryId);
13002
14693
  const payload = {};
13003
- if (typeof scope !== 'undefined') {
13004
- payload['scope'] = scope;
13005
- }
13006
- if (typeof userId !== 'undefined') {
13007
- payload['userId'] = userId;
13008
- }
13009
- if (typeof agentId !== 'undefined') {
13010
- payload['agentId'] = agentId;
14694
+ const uri = new URL(this.client.config.endpoint + apiPath);
14695
+ const apiHeaders = {
14696
+ 'X-Appwrite-Project': this.client.config.project,
14697
+ };
14698
+ return this.client.call('get', uri, apiHeaders, payload);
14699
+ }
14700
+ createShare(paramsOrFirst, ...rest) {
14701
+ let params;
14702
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
14703
+ params = (paramsOrFirst || {});
13011
14704
  }
13012
- if (typeof sessionId !== 'undefined') {
13013
- payload['sessionId'] = sessionId;
14705
+ else {
14706
+ params = {
14707
+ memoryId: paramsOrFirst,
14708
+ subjectType: rest[0],
14709
+ subjectId: rest[1],
14710
+ expiresAt: rest[2]
14711
+ };
13014
14712
  }
13015
- if (typeof runId !== 'undefined') {
13016
- payload['runId'] = runId;
14713
+ const memoryId = params.memoryId;
14714
+ const subjectType = params.subjectType;
14715
+ const subjectId = params.subjectId;
14716
+ const expiresAt = params.expiresAt;
14717
+ if (typeof memoryId === 'undefined') {
14718
+ throw new AgentbaseException('Missing required parameter: "memoryId"');
13017
14719
  }
13018
- if (typeof memorySubStoreId !== 'undefined') {
13019
- payload['memorySubStoreId'] = memorySubStoreId;
14720
+ if (typeof subjectType === 'undefined') {
14721
+ throw new AgentbaseException('Missing required parameter: "subjectType"');
13020
14722
  }
13021
- if (typeof query !== 'undefined') {
13022
- payload['query'] = query;
14723
+ if (typeof subjectId === 'undefined') {
14724
+ throw new AgentbaseException('Missing required parameter: "subjectId"');
13023
14725
  }
13024
- if (typeof cursor !== 'undefined') {
13025
- payload['cursor'] = cursor;
14726
+ const apiPath = '/memory/memories/{memoryId}/shares'.replace('{memoryId}', memoryId);
14727
+ const payload = {};
14728
+ if (typeof subjectType !== 'undefined') {
14729
+ payload['subjectType'] = subjectType;
13026
14730
  }
13027
- if (typeof limit !== 'undefined') {
13028
- payload['limit'] = limit;
14731
+ if (typeof subjectId !== 'undefined') {
14732
+ payload['subjectId'] = subjectId;
13029
14733
  }
13030
- if (typeof retrieval !== 'undefined') {
13031
- payload['retrieval'] = retrieval;
14734
+ if (typeof expiresAt !== 'undefined') {
14735
+ payload['expiresAt'] = expiresAt;
13032
14736
  }
13033
14737
  const uri = new URL(this.client.config.endpoint + apiPath);
13034
14738
  const apiHeaders = {
@@ -13037,108 +14741,54 @@
13037
14741
  };
13038
14742
  return this.client.call('post', uri, apiHeaders, payload);
13039
14743
  }
13040
- getSkill(paramsOrFirst, ...rest) {
14744
+ deleteShare(paramsOrFirst, ...rest) {
13041
14745
  let params;
13042
14746
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
13043
14747
  params = (paramsOrFirst || {});
13044
14748
  }
13045
14749
  else {
13046
14750
  params = {
13047
- knowledgeId: paramsOrFirst,
13048
- scope: rest[0],
13049
- userId: rest[1],
13050
- agentId: rest[2],
13051
- sessionId: rest[3],
13052
- runId: rest[4],
13053
- memorySubStoreId: rest[5]
14751
+ memoryId: paramsOrFirst,
14752
+ shareId: rest[0]
13054
14753
  };
13055
14754
  }
13056
- const knowledgeId = params.knowledgeId;
13057
- const scope = params.scope;
13058
- const userId = params.userId;
13059
- const agentId = params.agentId;
13060
- const sessionId = params.sessionId;
13061
- const runId = params.runId;
13062
- const memorySubStoreId = params.memorySubStoreId;
13063
- if (typeof knowledgeId === 'undefined') {
13064
- throw new AgentbaseException('Missing required parameter: "knowledgeId"');
13065
- }
13066
- const apiPath = '/memory/memories/skills/{knowledgeId}'.replace('{knowledgeId}', knowledgeId);
13067
- const payload = {};
13068
- if (typeof scope !== 'undefined') {
13069
- payload['scope'] = scope;
13070
- }
13071
- if (typeof userId !== 'undefined') {
13072
- payload['userId'] = userId;
13073
- }
13074
- if (typeof agentId !== 'undefined') {
13075
- payload['agentId'] = agentId;
13076
- }
13077
- if (typeof sessionId !== 'undefined') {
13078
- payload['sessionId'] = sessionId;
13079
- }
13080
- if (typeof runId !== 'undefined') {
13081
- payload['runId'] = runId;
14755
+ const memoryId = params.memoryId;
14756
+ const shareId = params.shareId;
14757
+ if (typeof memoryId === 'undefined') {
14758
+ throw new AgentbaseException('Missing required parameter: "memoryId"');
13082
14759
  }
13083
- if (typeof memorySubStoreId !== 'undefined') {
13084
- payload['memorySubStoreId'] = memorySubStoreId;
14760
+ if (typeof shareId === 'undefined') {
14761
+ throw new AgentbaseException('Missing required parameter: "shareId"');
13085
14762
  }
14763
+ const apiPath = '/memory/memories/{memoryId}/shares/{shareId}'.replace('{memoryId}', memoryId).replace('{shareId}', shareId);
14764
+ const payload = {};
13086
14765
  const uri = new URL(this.client.config.endpoint + apiPath);
13087
14766
  const apiHeaders = {
13088
14767
  'X-Appwrite-Project': this.client.config.project,
14768
+ 'content-type': 'application/json',
13089
14769
  };
13090
- return this.client.call('get', uri, apiHeaders, payload);
14770
+ return this.client.call('delete', uri, apiHeaders, payload);
13091
14771
  }
13092
- listSkillSources(paramsOrFirst, ...rest) {
14772
+ listSources(paramsOrFirst, ...rest) {
13093
14773
  let params;
13094
14774
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
13095
14775
  params = (paramsOrFirst || {});
13096
14776
  }
13097
14777
  else {
13098
14778
  params = {
13099
- knowledgeId: paramsOrFirst,
13100
- scope: rest[0],
13101
- userId: rest[1],
13102
- agentId: rest[2],
13103
- sessionId: rest[3],
13104
- runId: rest[4],
13105
- memorySubStoreId: rest[5],
13106
- cursor: rest[6],
13107
- limit: rest[7]
14779
+ memoryId: paramsOrFirst,
14780
+ cursor: rest[0],
14781
+ limit: rest[1]
13108
14782
  };
13109
14783
  }
13110
- const knowledgeId = params.knowledgeId;
13111
- const scope = params.scope;
13112
- const userId = params.userId;
13113
- const agentId = params.agentId;
13114
- const sessionId = params.sessionId;
13115
- const runId = params.runId;
13116
- const memorySubStoreId = params.memorySubStoreId;
14784
+ const memoryId = params.memoryId;
13117
14785
  const cursor = params.cursor;
13118
14786
  const limit = params.limit;
13119
- if (typeof knowledgeId === 'undefined') {
13120
- throw new AgentbaseException('Missing required parameter: "knowledgeId"');
14787
+ if (typeof memoryId === 'undefined') {
14788
+ throw new AgentbaseException('Missing required parameter: "memoryId"');
13121
14789
  }
13122
- const apiPath = '/memory/memories/skills/{knowledgeId}/sources'.replace('{knowledgeId}', knowledgeId);
14790
+ const apiPath = '/memory/memories/{memoryId}/sources'.replace('{memoryId}', memoryId);
13123
14791
  const payload = {};
13124
- if (typeof scope !== 'undefined') {
13125
- payload['scope'] = scope;
13126
- }
13127
- if (typeof userId !== 'undefined') {
13128
- payload['userId'] = userId;
13129
- }
13130
- if (typeof agentId !== 'undefined') {
13131
- payload['agentId'] = agentId;
13132
- }
13133
- if (typeof sessionId !== 'undefined') {
13134
- payload['sessionId'] = sessionId;
13135
- }
13136
- if (typeof runId !== 'undefined') {
13137
- payload['runId'] = runId;
13138
- }
13139
- if (typeof memorySubStoreId !== 'undefined') {
13140
- payload['memorySubStoreId'] = memorySubStoreId;
13141
- }
13142
14792
  if (typeof cursor !== 'undefined') {
13143
14793
  payload['cursor'] = cursor;
13144
14794
  }
@@ -13151,169 +14801,157 @@
13151
14801
  };
13152
14802
  return this.client.call('get', uri, apiHeaders, payload);
13153
14803
  }
13154
- /**
13155
- * Get memory statistics visible to the current caller.
13156
- *
13157
- * @throws {AgentbaseException}
13158
- * @returns {Promise<{}>}
13159
- */
13160
- getStats() {
13161
- const apiPath = '/memory/memories/stats';
13162
- const payload = {};
13163
- const uri = new URL(this.client.config.endpoint + apiPath);
13164
- const apiHeaders = {
13165
- 'X-Appwrite-Project': this.client.config.project,
13166
- };
13167
- return this.client.call('get', uri, apiHeaders, payload);
13168
- }
13169
- /**
13170
- * Get a memory activity timeline.
13171
- *
13172
- * @throws {AgentbaseException}
13173
- * @returns {Promise<{}>}
13174
- */
13175
- getTimeline() {
13176
- const apiPath = '/memory/memories/timeline';
14804
+ listPipelineRuns(paramsOrFirst, ...rest) {
14805
+ let params;
14806
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('scenario' in paramsOrFirst || 'limit' in paramsOrFirst || 'cursor' in paramsOrFirst))) {
14807
+ params = (paramsOrFirst || {});
14808
+ }
14809
+ else {
14810
+ params = {
14811
+ scenario: paramsOrFirst,
14812
+ limit: rest[0],
14813
+ cursor: rest[1]
14814
+ };
14815
+ }
14816
+ const scenario = params.scenario;
14817
+ const limit = params.limit;
14818
+ const cursor = params.cursor;
14819
+ const apiPath = '/memory/pipeline-runs';
13177
14820
  const payload = {};
14821
+ if (typeof scenario !== 'undefined') {
14822
+ payload['scenario'] = scenario;
14823
+ }
14824
+ if (typeof limit !== 'undefined') {
14825
+ payload['limit'] = limit;
14826
+ }
14827
+ if (typeof cursor !== 'undefined') {
14828
+ payload['cursor'] = cursor;
14829
+ }
13178
14830
  const uri = new URL(this.client.config.endpoint + apiPath);
13179
14831
  const apiHeaders = {
13180
14832
  'X-Appwrite-Project': this.client.config.project,
13181
14833
  };
13182
14834
  return this.client.call('get', uri, apiHeaders, payload);
13183
14835
  }
13184
- getProfile(paramsOrFirst, ...rest) {
14836
+ createPipelineRun(paramsOrFirst, ...rest) {
13185
14837
  let params;
13186
14838
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
13187
14839
  params = (paramsOrFirst || {});
13188
14840
  }
13189
14841
  else {
13190
14842
  params = {
13191
- userId: paramsOrFirst,
13192
- profileType: rest[0]
14843
+ name: paramsOrFirst,
14844
+ scenario: rest[0],
14845
+ candidates: rest[1],
14846
+ samples: rest[2]
13193
14847
  };
13194
14848
  }
13195
- const userId = params.userId;
13196
- const profileType = params.profileType;
13197
- if (typeof userId === 'undefined') {
13198
- throw new AgentbaseException('Missing required parameter: "userId"');
14849
+ const name = params.name;
14850
+ const scenario = params.scenario;
14851
+ const candidates = params.candidates;
14852
+ const samples = params.samples;
14853
+ if (typeof name === 'undefined') {
14854
+ throw new AgentbaseException('Missing required parameter: "name"');
13199
14855
  }
13200
- const apiPath = '/memory/memories/users/{userId}/profile'.replace('{userId}', userId);
14856
+ if (typeof scenario === 'undefined') {
14857
+ throw new AgentbaseException('Missing required parameter: "scenario"');
14858
+ }
14859
+ if (typeof candidates === 'undefined') {
14860
+ throw new AgentbaseException('Missing required parameter: "candidates"');
14861
+ }
14862
+ if (typeof samples === 'undefined') {
14863
+ throw new AgentbaseException('Missing required parameter: "samples"');
14864
+ }
14865
+ const apiPath = '/memory/pipeline-runs';
13201
14866
  const payload = {};
13202
- if (typeof profileType !== 'undefined') {
13203
- payload['profileType'] = profileType;
14867
+ if (typeof name !== 'undefined') {
14868
+ payload['name'] = name;
14869
+ }
14870
+ if (typeof scenario !== 'undefined') {
14871
+ payload['scenario'] = scenario;
14872
+ }
14873
+ if (typeof candidates !== 'undefined') {
14874
+ payload['candidates'] = candidates;
14875
+ }
14876
+ if (typeof samples !== 'undefined') {
14877
+ payload['samples'] = samples;
13204
14878
  }
13205
14879
  const uri = new URL(this.client.config.endpoint + apiPath);
13206
14880
  const apiHeaders = {
13207
14881
  'X-Appwrite-Project': this.client.config.project,
14882
+ 'content-type': 'application/json',
13208
14883
  };
13209
- return this.client.call('get', uri, apiHeaders, payload);
14884
+ return this.client.call('post', uri, apiHeaders, payload);
13210
14885
  }
13211
- deleteProfile(paramsOrFirst, ...rest) {
14886
+ getPipelineRun(paramsOrFirst) {
13212
14887
  let params;
13213
14888
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
13214
14889
  params = (paramsOrFirst || {});
13215
14890
  }
13216
14891
  else {
13217
14892
  params = {
13218
- userId: paramsOrFirst,
13219
- profileType: rest[0],
13220
- reason: rest[1],
13221
- source: rest[2]
14893
+ runId: paramsOrFirst
13222
14894
  };
13223
14895
  }
13224
- const userId = params.userId;
13225
- const profileType = params.profileType;
13226
- const reason = params.reason;
13227
- const source = params.source;
13228
- if (typeof userId === 'undefined') {
13229
- throw new AgentbaseException('Missing required parameter: "userId"');
14896
+ const runId = params.runId;
14897
+ if (typeof runId === 'undefined') {
14898
+ throw new AgentbaseException('Missing required parameter: "runId"');
13230
14899
  }
13231
- const apiPath = '/memory/memories/users/{userId}/profile'.replace('{userId}', userId);
14900
+ const apiPath = '/memory/pipeline-runs/{runId}'.replace('{runId}', runId);
13232
14901
  const payload = {};
13233
- if (typeof profileType !== 'undefined') {
13234
- payload['profileType'] = profileType;
13235
- }
13236
- if (typeof reason !== 'undefined') {
13237
- payload['reason'] = reason;
13238
- }
13239
- if (typeof source !== 'undefined') {
13240
- payload['source'] = source;
13241
- }
13242
14902
  const uri = new URL(this.client.config.endpoint + apiPath);
13243
14903
  const apiHeaders = {
13244
14904
  'X-Appwrite-Project': this.client.config.project,
13245
- 'content-type': 'application/json',
13246
14905
  };
13247
- return this.client.call('delete', uri, apiHeaders, payload);
14906
+ return this.client.call('get', uri, apiHeaders, payload);
13248
14907
  }
13249
- createProfileExtraction(paramsOrFirst, ...rest) {
14908
+ listPipelines(paramsOrFirst) {
13250
14909
  let params;
13251
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
14910
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('scenario' in paramsOrFirst))) {
13252
14911
  params = (paramsOrFirst || {});
13253
14912
  }
13254
14913
  else {
13255
14914
  params = {
13256
- userId: paramsOrFirst,
13257
- profileType: rest[0],
13258
- messages: rest[1],
13259
- sourceMemoryIds: rest[2],
13260
- sessionId: rest[3],
13261
- mode: rest[4]
14915
+ scenario: paramsOrFirst
13262
14916
  };
13263
14917
  }
13264
- const userId = params.userId;
13265
- const profileType = params.profileType;
13266
- const messages = params.messages;
13267
- const sourceMemoryIds = params.sourceMemoryIds;
13268
- const sessionId = params.sessionId;
13269
- const mode = params.mode;
13270
- if (typeof userId === 'undefined') {
13271
- throw new AgentbaseException('Missing required parameter: "userId"');
13272
- }
13273
- const apiPath = '/memory/memories/users/{userId}/profile/extractions'.replace('{userId}', userId);
14918
+ const scenario = params.scenario;
14919
+ const apiPath = '/memory/pipelines';
13274
14920
  const payload = {};
13275
- if (typeof profileType !== 'undefined') {
13276
- payload['profileType'] = profileType;
13277
- }
13278
- if (typeof messages !== 'undefined') {
13279
- payload['messages'] = messages;
13280
- }
13281
- if (typeof sourceMemoryIds !== 'undefined') {
13282
- payload['sourceMemoryIds'] = sourceMemoryIds;
13283
- }
13284
- if (typeof sessionId !== 'undefined') {
13285
- payload['sessionId'] = sessionId;
13286
- }
13287
- if (typeof mode !== 'undefined') {
13288
- payload['mode'] = mode;
14921
+ if (typeof scenario !== 'undefined') {
14922
+ payload['scenario'] = scenario;
13289
14923
  }
13290
14924
  const uri = new URL(this.client.config.endpoint + apiPath);
13291
14925
  const apiHeaders = {
13292
14926
  'X-Appwrite-Project': this.client.config.project,
13293
- 'content-type': 'application/json',
13294
14927
  };
13295
- return this.client.call('post', uri, apiHeaders, payload);
14928
+ return this.client.call('get', uri, apiHeaders, payload);
13296
14929
  }
13297
- createProfileRebuild(paramsOrFirst, ...rest) {
14930
+ createPipeline(paramsOrFirst, ...rest) {
13298
14931
  let params;
13299
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
14932
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('scenario' in paramsOrFirst || 'fromDefaults' in paramsOrFirst || 'config' in paramsOrFirst))) {
13300
14933
  params = (paramsOrFirst || {});
13301
14934
  }
13302
14935
  else {
13303
14936
  params = {
13304
- userId: paramsOrFirst,
13305
- profileType: rest[0]
14937
+ scenario: paramsOrFirst,
14938
+ fromDefaults: rest[0],
14939
+ config: rest[1]
13306
14940
  };
13307
14941
  }
13308
- const userId = params.userId;
13309
- const profileType = params.profileType;
13310
- if (typeof userId === 'undefined') {
13311
- throw new AgentbaseException('Missing required parameter: "userId"');
13312
- }
13313
- const apiPath = '/memory/memories/users/{userId}/profile/rebuild'.replace('{userId}', userId);
14942
+ const scenario = params.scenario;
14943
+ const fromDefaults = params.fromDefaults;
14944
+ const config = params.config;
14945
+ const apiPath = '/memory/pipelines';
13314
14946
  const payload = {};
13315
- if (typeof profileType !== 'undefined') {
13316
- payload['profileType'] = profileType;
14947
+ if (typeof scenario !== 'undefined') {
14948
+ payload['scenario'] = scenario;
14949
+ }
14950
+ if (typeof fromDefaults !== 'undefined') {
14951
+ payload['fromDefaults'] = fromDefaults;
14952
+ }
14953
+ if (typeof config !== 'undefined') {
14954
+ payload['config'] = config;
13317
14955
  }
13318
14956
  const uri = new URL(this.client.config.endpoint + apiPath);
13319
14957
  const apiHeaders = {
@@ -13322,48 +14960,54 @@
13322
14960
  };
13323
14961
  return this.client.call('post', uri, apiHeaders, payload);
13324
14962
  }
13325
- listProfileSources(paramsOrFirst, ...rest) {
14963
+ setDefaultPipeline(paramsOrFirst, ...rest) {
13326
14964
  let params;
13327
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
14965
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('scenario' in paramsOrFirst || 'pipelineId' in paramsOrFirst || 'expectedRevision' in paramsOrFirst))) {
13328
14966
  params = (paramsOrFirst || {});
13329
14967
  }
13330
14968
  else {
13331
14969
  params = {
13332
- userId: paramsOrFirst,
13333
- profileType: rest[0]
14970
+ scenario: paramsOrFirst,
14971
+ pipelineId: rest[0],
14972
+ expectedRevision: rest[1]
13334
14973
  };
13335
14974
  }
13336
- const userId = params.userId;
13337
- const profileType = params.profileType;
13338
- if (typeof userId === 'undefined') {
13339
- throw new AgentbaseException('Missing required parameter: "userId"');
13340
- }
13341
- const apiPath = '/memory/memories/users/{userId}/profile/sources'.replace('{userId}', userId);
14975
+ const scenario = params.scenario;
14976
+ const pipelineId = params.pipelineId;
14977
+ const expectedRevision = params.expectedRevision;
14978
+ const apiPath = '/memory/pipelines/default';
13342
14979
  const payload = {};
13343
- if (typeof profileType !== 'undefined') {
13344
- payload['profileType'] = profileType;
14980
+ if (typeof scenario !== 'undefined') {
14981
+ payload['scenario'] = scenario;
14982
+ }
14983
+ if (typeof pipelineId !== 'undefined') {
14984
+ payload['pipelineId'] = pipelineId;
14985
+ }
14986
+ if (typeof expectedRevision !== 'undefined') {
14987
+ payload['expectedRevision'] = expectedRevision;
13345
14988
  }
13346
14989
  const uri = new URL(this.client.config.endpoint + apiPath);
13347
14990
  const apiHeaders = {
13348
14991
  'X-Appwrite-Project': this.client.config.project,
14992
+ 'content-type': 'application/json',
13349
14993
  };
13350
- return this.client.call('get', uri, apiHeaders, payload);
14994
+ return this.client.call('put', uri, apiHeaders, payload);
13351
14995
  }
13352
- get(paramsOrFirst) {
14996
+ getPipeline(paramsOrFirst) {
13353
14997
  let params;
13354
14998
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
13355
14999
  params = (paramsOrFirst || {});
13356
15000
  }
13357
15001
  else {
13358
15002
  params = {
13359
- memoryId: paramsOrFirst
15003
+ pipelineId: paramsOrFirst
13360
15004
  };
13361
15005
  }
13362
- const memoryId = params.memoryId;
13363
- if (typeof memoryId === 'undefined') {
13364
- throw new AgentbaseException('Missing required parameter: "memoryId"');
15006
+ const pipelineId = params.pipelineId;
15007
+ if (typeof pipelineId === 'undefined') {
15008
+ throw new AgentbaseException('Missing required parameter: "pipelineId"');
13365
15009
  }
13366
- const apiPath = '/memory/memories/{memoryId}'.replace('{memoryId}', memoryId);
15010
+ const apiPath = '/memory/pipelines/{pipelineId}'.replace('{pipelineId}', pipelineId);
13367
15011
  const payload = {};
13368
15012
  const uri = new URL(this.client.config.endpoint + apiPath);
13369
15013
  const apiHeaders = {
@@ -13371,44 +15015,37 @@
13371
15015
  };
13372
15016
  return this.client.call('get', uri, apiHeaders, payload);
13373
15017
  }
13374
- update(paramsOrFirst, ...rest) {
15018
+ updatePipeline(paramsOrFirst, ...rest) {
13375
15019
  let params;
13376
15020
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
13377
15021
  params = (paramsOrFirst || {});
13378
15022
  }
13379
15023
  else {
13380
15024
  params = {
13381
- memoryId: paramsOrFirst,
13382
- version: rest[0],
13383
- content: rest[1],
13384
- metadata: rest[2],
13385
- retentionPolicy: rest[3]
15025
+ pipelineId: paramsOrFirst,
15026
+ expectedRevision: rest[0],
15027
+ config: rest[1]
13386
15028
  };
13387
15029
  }
13388
- const memoryId = params.memoryId;
13389
- const version = params.version;
13390
- const content = params.content;
13391
- const metadata = params.metadata;
13392
- const retentionPolicy = params.retentionPolicy;
13393
- if (typeof memoryId === 'undefined') {
13394
- throw new AgentbaseException('Missing required parameter: "memoryId"');
13395
- }
13396
- if (typeof version === 'undefined') {
13397
- throw new AgentbaseException('Missing required parameter: "version"');
15030
+ const pipelineId = params.pipelineId;
15031
+ const expectedRevision = params.expectedRevision;
15032
+ const config = params.config;
15033
+ if (typeof pipelineId === 'undefined') {
15034
+ throw new AgentbaseException('Missing required parameter: "pipelineId"');
13398
15035
  }
13399
- const apiPath = '/memory/memories/{memoryId}'.replace('{memoryId}', memoryId);
13400
- const payload = {};
13401
- if (typeof version !== 'undefined') {
13402
- payload['version'] = version;
15036
+ if (typeof expectedRevision === 'undefined') {
15037
+ throw new AgentbaseException('Missing required parameter: "expectedRevision"');
13403
15038
  }
13404
- if (typeof content !== 'undefined') {
13405
- payload['content'] = content;
15039
+ if (typeof config === 'undefined') {
15040
+ throw new AgentbaseException('Missing required parameter: "config"');
13406
15041
  }
13407
- if (typeof metadata !== 'undefined') {
13408
- payload['metadata'] = metadata;
15042
+ const apiPath = '/memory/pipelines/{pipelineId}'.replace('{pipelineId}', pipelineId);
15043
+ const payload = {};
15044
+ if (typeof expectedRevision !== 'undefined') {
15045
+ payload['expectedRevision'] = expectedRevision;
13409
15046
  }
13410
- if (typeof retentionPolicy !== 'undefined') {
13411
- payload['retentionPolicy'] = retentionPolicy;
15047
+ if (typeof config !== 'undefined') {
15048
+ payload['config'] = config;
13412
15049
  }
13413
15050
  const uri = new URL(this.client.config.endpoint + apiPath);
13414
15051
  const apiHeaders = {
@@ -13417,31 +15054,29 @@
13417
15054
  };
13418
15055
  return this.client.call('patch', uri, apiHeaders, payload);
13419
15056
  }
13420
- delete(paramsOrFirst, ...rest) {
15057
+ deletePipeline(paramsOrFirst, ...rest) {
13421
15058
  let params;
13422
15059
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
13423
15060
  params = (paramsOrFirst || {});
13424
15061
  }
13425
15062
  else {
13426
15063
  params = {
13427
- memoryId: paramsOrFirst,
13428
- reason: rest[0],
13429
- source: rest[1]
15064
+ pipelineId: paramsOrFirst,
15065
+ expectedRevision: rest[0]
13430
15066
  };
13431
15067
  }
13432
- const memoryId = params.memoryId;
13433
- const reason = params.reason;
13434
- const source = params.source;
13435
- if (typeof memoryId === 'undefined') {
13436
- throw new AgentbaseException('Missing required parameter: "memoryId"');
15068
+ const pipelineId = params.pipelineId;
15069
+ const expectedRevision = params.expectedRevision;
15070
+ if (typeof pipelineId === 'undefined') {
15071
+ throw new AgentbaseException('Missing required parameter: "pipelineId"');
13437
15072
  }
13438
- const apiPath = '/memory/memories/{memoryId}'.replace('{memoryId}', memoryId);
13439
- const payload = {};
13440
- if (typeof reason !== 'undefined') {
13441
- payload['reason'] = reason;
15073
+ if (typeof expectedRevision === 'undefined') {
15074
+ throw new AgentbaseException('Missing required parameter: "expectedRevision"');
13442
15075
  }
13443
- if (typeof source !== 'undefined') {
13444
- payload['source'] = source;
15076
+ const apiPath = '/memory/pipelines/{pipelineId}'.replace('{pipelineId}', pipelineId);
15077
+ const payload = {};
15078
+ if (typeof expectedRevision !== 'undefined') {
15079
+ payload['expectedRevision'] = expectedRevision;
13445
15080
  }
13446
15081
  const uri = new URL(this.client.config.endpoint + apiPath);
13447
15082
  const apiHeaders = {
@@ -13450,64 +15085,81 @@
13450
15085
  };
13451
15086
  return this.client.call('delete', uri, apiHeaders, payload);
13452
15087
  }
13453
- listShares(paramsOrFirst) {
15088
+ publishPipeline(paramsOrFirst, ...rest) {
13454
15089
  let params;
13455
15090
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
13456
15091
  params = (paramsOrFirst || {});
13457
15092
  }
13458
15093
  else {
13459
15094
  params = {
13460
- memoryId: paramsOrFirst
15095
+ pipelineId: paramsOrFirst,
15096
+ versionId: rest[0],
15097
+ expectedRevision: rest[1],
15098
+ makeDefault: rest[2]
13461
15099
  };
13462
15100
  }
13463
- const memoryId = params.memoryId;
13464
- if (typeof memoryId === 'undefined') {
13465
- throw new AgentbaseException('Missing required parameter: "memoryId"');
15101
+ const pipelineId = params.pipelineId;
15102
+ const versionId = params.versionId;
15103
+ const expectedRevision = params.expectedRevision;
15104
+ const makeDefault = params.makeDefault;
15105
+ if (typeof pipelineId === 'undefined') {
15106
+ throw new AgentbaseException('Missing required parameter: "pipelineId"');
13466
15107
  }
13467
- const apiPath = '/memory/memories/{memoryId}/shares'.replace('{memoryId}', memoryId);
15108
+ if (typeof versionId === 'undefined') {
15109
+ throw new AgentbaseException('Missing required parameter: "versionId"');
15110
+ }
15111
+ if (typeof expectedRevision === 'undefined') {
15112
+ throw new AgentbaseException('Missing required parameter: "expectedRevision"');
15113
+ }
15114
+ const apiPath = '/memory/pipelines/{pipelineId}/publish'.replace('{pipelineId}', pipelineId);
13468
15115
  const payload = {};
15116
+ if (typeof versionId !== 'undefined') {
15117
+ payload['versionId'] = versionId;
15118
+ }
15119
+ if (typeof expectedRevision !== 'undefined') {
15120
+ payload['expectedRevision'] = expectedRevision;
15121
+ }
15122
+ if (typeof makeDefault !== 'undefined') {
15123
+ payload['makeDefault'] = makeDefault;
15124
+ }
13469
15125
  const uri = new URL(this.client.config.endpoint + apiPath);
13470
15126
  const apiHeaders = {
13471
15127
  'X-Appwrite-Project': this.client.config.project,
15128
+ 'content-type': 'application/json',
13472
15129
  };
13473
- return this.client.call('get', uri, apiHeaders, payload);
15130
+ return this.client.call('post', uri, apiHeaders, payload);
13474
15131
  }
13475
- createShare(paramsOrFirst, ...rest) {
15132
+ rollbackPipeline(paramsOrFirst, ...rest) {
13476
15133
  let params;
13477
15134
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
13478
15135
  params = (paramsOrFirst || {});
13479
15136
  }
13480
15137
  else {
13481
15138
  params = {
13482
- memoryId: paramsOrFirst,
13483
- subjectType: rest[0],
13484
- subjectId: rest[1],
13485
- expiresAt: rest[2]
15139
+ pipelineId: paramsOrFirst,
15140
+ versionId: rest[0],
15141
+ expectedRevision: rest[1]
13486
15142
  };
13487
15143
  }
13488
- const memoryId = params.memoryId;
13489
- const subjectType = params.subjectType;
13490
- const subjectId = params.subjectId;
13491
- const expiresAt = params.expiresAt;
13492
- if (typeof memoryId === 'undefined') {
13493
- throw new AgentbaseException('Missing required parameter: "memoryId"');
15144
+ const pipelineId = params.pipelineId;
15145
+ const versionId = params.versionId;
15146
+ const expectedRevision = params.expectedRevision;
15147
+ if (typeof pipelineId === 'undefined') {
15148
+ throw new AgentbaseException('Missing required parameter: "pipelineId"');
13494
15149
  }
13495
- if (typeof subjectType === 'undefined') {
13496
- throw new AgentbaseException('Missing required parameter: "subjectType"');
15150
+ if (typeof versionId === 'undefined') {
15151
+ throw new AgentbaseException('Missing required parameter: "versionId"');
13497
15152
  }
13498
- if (typeof subjectId === 'undefined') {
13499
- throw new AgentbaseException('Missing required parameter: "subjectId"');
15153
+ if (typeof expectedRevision === 'undefined') {
15154
+ throw new AgentbaseException('Missing required parameter: "expectedRevision"');
13500
15155
  }
13501
- const apiPath = '/memory/memories/{memoryId}/shares'.replace('{memoryId}', memoryId);
15156
+ const apiPath = '/memory/pipelines/{pipelineId}/rollback'.replace('{pipelineId}', pipelineId);
13502
15157
  const payload = {};
13503
- if (typeof subjectType !== 'undefined') {
13504
- payload['subjectType'] = subjectType;
13505
- }
13506
- if (typeof subjectId !== 'undefined') {
13507
- payload['subjectId'] = subjectId;
15158
+ if (typeof versionId !== 'undefined') {
15159
+ payload['versionId'] = versionId;
13508
15160
  }
13509
- if (typeof expiresAt !== 'undefined') {
13510
- payload['expiresAt'] = expiresAt;
15161
+ if (typeof expectedRevision !== 'undefined') {
15162
+ payload['expectedRevision'] = expectedRevision;
13511
15163
  }
13512
15164
  const uri = new URL(this.client.config.endpoint + apiPath);
13513
15165
  const apiHeaders = {
@@ -13516,59 +15168,75 @@
13516
15168
  };
13517
15169
  return this.client.call('post', uri, apiHeaders, payload);
13518
15170
  }
13519
- deleteShare(paramsOrFirst, ...rest) {
15171
+ validatePipeline(paramsOrFirst, ...rest) {
13520
15172
  let params;
13521
15173
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
13522
15174
  params = (paramsOrFirst || {});
13523
15175
  }
13524
15176
  else {
13525
15177
  params = {
13526
- memoryId: paramsOrFirst,
13527
- shareId: rest[0]
15178
+ pipelineId: paramsOrFirst,
15179
+ versionId: rest[0],
15180
+ data: rest[1],
15181
+ scenario: rest[2]
13528
15182
  };
13529
15183
  }
13530
- const memoryId = params.memoryId;
13531
- const shareId = params.shareId;
13532
- if (typeof memoryId === 'undefined') {
13533
- throw new AgentbaseException('Missing required parameter: "memoryId"');
15184
+ const pipelineId = params.pipelineId;
15185
+ const versionId = params.versionId;
15186
+ const data = params.data;
15187
+ const scenario = params.scenario;
15188
+ if (typeof pipelineId === 'undefined') {
15189
+ throw new AgentbaseException('Missing required parameter: "pipelineId"');
13534
15190
  }
13535
- if (typeof shareId === 'undefined') {
13536
- throw new AgentbaseException('Missing required parameter: "shareId"');
15191
+ if (typeof versionId === 'undefined') {
15192
+ throw new AgentbaseException('Missing required parameter: "versionId"');
13537
15193
  }
13538
- const apiPath = '/memory/memories/{memoryId}/shares/{shareId}'.replace('{memoryId}', memoryId).replace('{shareId}', shareId);
15194
+ if (typeof data === 'undefined') {
15195
+ throw new AgentbaseException('Missing required parameter: "data"');
15196
+ }
15197
+ const apiPath = '/memory/pipelines/{pipelineId}/validate'.replace('{pipelineId}', pipelineId);
13539
15198
  const payload = {};
15199
+ if (typeof versionId !== 'undefined') {
15200
+ payload['versionId'] = versionId;
15201
+ }
15202
+ if (typeof scenario !== 'undefined') {
15203
+ payload['scenario'] = scenario;
15204
+ }
15205
+ if (typeof data !== 'undefined') {
15206
+ payload['data'] = data;
15207
+ }
13540
15208
  const uri = new URL(this.client.config.endpoint + apiPath);
13541
15209
  const apiHeaders = {
13542
15210
  'X-Appwrite-Project': this.client.config.project,
13543
15211
  'content-type': 'application/json',
13544
15212
  };
13545
- return this.client.call('delete', uri, apiHeaders, payload);
15213
+ return this.client.call('post', uri, apiHeaders, payload);
13546
15214
  }
13547
- listSources(paramsOrFirst, ...rest) {
15215
+ listPipelineVersions(paramsOrFirst, ...rest) {
13548
15216
  let params;
13549
15217
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
13550
15218
  params = (paramsOrFirst || {});
13551
15219
  }
13552
15220
  else {
13553
15221
  params = {
13554
- memoryId: paramsOrFirst,
13555
- cursor: rest[0],
13556
- limit: rest[1]
15222
+ pipelineId: paramsOrFirst,
15223
+ versionId: rest[0],
15224
+ beforeRevision: rest[1]
13557
15225
  };
13558
15226
  }
13559
- const memoryId = params.memoryId;
13560
- const cursor = params.cursor;
13561
- const limit = params.limit;
13562
- if (typeof memoryId === 'undefined') {
13563
- throw new AgentbaseException('Missing required parameter: "memoryId"');
15227
+ const pipelineId = params.pipelineId;
15228
+ const versionId = params.versionId;
15229
+ const beforeRevision = params.beforeRevision;
15230
+ if (typeof pipelineId === 'undefined') {
15231
+ throw new AgentbaseException('Missing required parameter: "pipelineId"');
13564
15232
  }
13565
- const apiPath = '/memory/memories/{memoryId}/sources'.replace('{memoryId}', memoryId);
15233
+ const apiPath = '/memory/pipelines/{pipelineId}/versions'.replace('{pipelineId}', pipelineId);
13566
15234
  const payload = {};
13567
- if (typeof cursor !== 'undefined') {
13568
- payload['cursor'] = cursor;
15235
+ if (typeof versionId !== 'undefined') {
15236
+ payload['versionId'] = versionId;
13569
15237
  }
13570
- if (typeof limit !== 'undefined') {
13571
- payload['limit'] = limit;
15238
+ if (typeof beforeRevision !== 'undefined') {
15239
+ payload['beforeRevision'] = beforeRevision;
13572
15240
  }
13573
15241
  const uri = new URL(this.client.config.endpoint + apiPath);
13574
15242
  const apiHeaders = {
@@ -17227,6 +18895,12 @@
17227
18895
  AuthenticationFactor["Recoverycode"] = "recoverycode";
17228
18896
  })(exports.AuthenticationFactor || (exports.AuthenticationFactor = {}));
17229
18897
 
18898
+ exports.Scene = void 0;
18899
+ (function (Scene) {
18900
+ Scene["Verify"] = "verify";
18901
+ Scene["AccountChange"] = "accountChange";
18902
+ })(exports.Scene || (exports.Scene = {}));
18903
+
17230
18904
  exports.OAuthProvider = void 0;
17231
18905
  (function (OAuthProvider) {
17232
18906
  OAuthProvider["Amazon"] = "amazon";
@@ -17291,6 +18965,12 @@
17291
18965
  Status["PartialFailed"] = "partial_failed";
17292
18966
  Status["Failed"] = "failed";
17293
18967
  Status["Dead"] = "dead";
18968
+ Status["Pending"] = "pending";
18969
+ Status["Approved"] = "approved";
18970
+ Status["Rejected"] = "rejected";
18971
+ Status["Superseded"] = "superseded";
18972
+ Status["Disabled"] = "disabled";
18973
+ Status["Error"] = "error";
17294
18974
  })(exports.Status || (exports.Status = {}));
17295
18975
 
17296
18976
  exports.Browser = void 0;
@@ -17760,6 +19440,7 @@
17760
19440
  Timezone["AsiaBaku"] = "asia/baku";
17761
19441
  Timezone["AsiaBangkok"] = "asia/bangkok";
17762
19442
  Timezone["AsiaBarnaul"] = "asia/barnaul";
19443
+ Timezone["AsiaBeijing"] = "asia/beijing";
17763
19444
  Timezone["AsiaBeirut"] = "asia/beirut";
17764
19445
  Timezone["AsiaBishkek"] = "asia/bishkek";
17765
19446
  Timezone["AsiaBrunei"] = "asia/brunei";
@@ -17995,6 +19676,23 @@
17995
19676
  ImageFormat["Gif"] = "gif";
17996
19677
  })(exports.ImageFormat || (exports.ImageFormat = {}));
17997
19678
 
19679
+ exports.PathMatch = void 0;
19680
+ (function (PathMatch) {
19681
+ PathMatch["Exact"] = "exact";
19682
+ PathMatch["Regex"] = "regex";
19683
+ })(exports.PathMatch || (exports.PathMatch = {}));
19684
+
19685
+ exports.Method = void 0;
19686
+ (function (Method) {
19687
+ Method["GET"] = "GET";
19688
+ Method["POST"] = "POST";
19689
+ Method["PUT"] = "PUT";
19690
+ Method["PATCH"] = "PATCH";
19691
+ Method["DELETE"] = "DELETE";
19692
+ Method["OPTIONS"] = "OPTIONS";
19693
+ Method["HEAD"] = "HEAD";
19694
+ })(exports.Method || (exports.Method = {}));
19695
+
17998
19696
  exports.ExecutionMethod = void 0;
17999
19697
  (function (ExecutionMethod) {
18000
19698
  ExecutionMethod["GET"] = "GET";
@@ -18119,6 +19817,12 @@
18119
19817
  VerificationSource["Toolresult"] = "tool-result";
18120
19818
  })(exports.VerificationSource || (exports.VerificationSource = {}));
18121
19819
 
19820
+ exports.ProfileType = void 0;
19821
+ (function (ProfileType) {
19822
+ ProfileType["Content"] = "content";
19823
+ ProfileType["Topics"] = "topics";
19824
+ })(exports.ProfileType || (exports.ProfileType = {}));
19825
+
18122
19826
  exports.Kinds = void 0;
18123
19827
  (function (Kinds) {
18124
19828
  Kinds["Memory"] = "memory";
@@ -18127,12 +19831,6 @@
18127
19831
  Kinds["Experience"] = "experience";
18128
19832
  })(exports.Kinds || (exports.Kinds = {}));
18129
19833
 
18130
- exports.ProfileType = void 0;
18131
- (function (ProfileType) {
18132
- ProfileType["Content"] = "content";
18133
- ProfileType["Topics"] = "topics";
18134
- })(exports.ProfileType || (exports.ProfileType = {}));
18135
-
18136
19834
  exports.ProfileExtractionMode = void 0;
18137
19835
  (function (ProfileExtractionMode) {
18138
19836
  ProfileExtractionMode["Incremental"] = "incremental";
@@ -18150,6 +19848,14 @@
18150
19848
  MemoryShareSubjectType["Group"] = "group";
18151
19849
  })(exports.MemoryShareSubjectType || (exports.MemoryShareSubjectType = {}));
18152
19850
 
19851
+ exports.Scenario = void 0;
19852
+ (function (Scenario) {
19853
+ Scenario["AddMemory"] = "add_memory";
19854
+ Scenario["Profile"] = "profile";
19855
+ Scenario["Distillation"] = "distillation";
19856
+ Scenario["Forgetting"] = "forgetting";
19857
+ })(exports.Scenario || (exports.Scenario = {}));
19858
+
18153
19859
  exports.OrganizationRole = void 0;
18154
19860
  (function (OrganizationRole) {
18155
19861
  OrganizationRole["Owner"] = "owner";
@@ -18194,6 +19900,12 @@
18194
19900
  TransactionAction["BulkDelete"] = "bulkDelete";
18195
19901
  })(exports.TransactionAction || (exports.TransactionAction = {}));
18196
19902
 
19903
+ exports.DataApiFilterLogic = void 0;
19904
+ (function (DataApiFilterLogic) {
19905
+ DataApiFilterLogic["And"] = "AND";
19906
+ DataApiFilterLogic["Or"] = "OR";
19907
+ })(exports.DataApiFilterLogic || (exports.DataApiFilterLogic = {}));
19908
+
18197
19909
  exports.MemoryMessageRole = void 0;
18198
19910
  (function (MemoryMessageRole) {
18199
19911
  MemoryMessageRole["User"] = "user";
@@ -18236,6 +19948,63 @@
18236
19948
  DistillationToolStatus["Failed"] = "failed";
18237
19949
  })(exports.DistillationToolStatus || (exports.DistillationToolStatus = {}));
18238
19950
 
19951
+ exports.DataApiOwnedBindingPrincipalType = void 0;
19952
+ (function (DataApiOwnedBindingPrincipalType) {
19953
+ DataApiOwnedBindingPrincipalType["USER"] = "USER";
19954
+ DataApiOwnedBindingPrincipalType["SERVICE"] = "SERVICE";
19955
+ })(exports.DataApiOwnedBindingPrincipalType || (exports.DataApiOwnedBindingPrincipalType = {}));
19956
+
19957
+ exports.DataApiOwnedBindingStatus = void 0;
19958
+ (function (DataApiOwnedBindingStatus) {
19959
+ DataApiOwnedBindingStatus["ACTIVE"] = "ACTIVE";
19960
+ DataApiOwnedBindingStatus["DISABLED"] = "DISABLED";
19961
+ })(exports.DataApiOwnedBindingStatus || (exports.DataApiOwnedBindingStatus = {}));
19962
+
19963
+ exports.DataApiCatalogDataSourceDatabaseType = void 0;
19964
+ (function (DataApiCatalogDataSourceDatabaseType) {
19965
+ DataApiCatalogDataSourceDatabaseType["OBMYSQL"] = "OB_MYSQL";
19966
+ DataApiCatalogDataSourceDatabaseType["OBORACLE"] = "OB_ORACLE";
19967
+ DataApiCatalogDataSourceDatabaseType["MYSQL"] = "MYSQL";
19968
+ DataApiCatalogDataSourceDatabaseType["ORACLE"] = "ORACLE";
19969
+ })(exports.DataApiCatalogDataSourceDatabaseType || (exports.DataApiCatalogDataSourceDatabaseType = {}));
19970
+
19971
+ exports.DataApiCatalogDataSourceVisibilitySource = void 0;
19972
+ (function (DataApiCatalogDataSourceVisibilitySource) {
19973
+ DataApiCatalogDataSourceVisibilitySource["ORGANIZATIONOWNER"] = "ORGANIZATION_OWNER";
19974
+ DataApiCatalogDataSourceVisibilitySource["PROJECTDATASOURCEGRANT"] = "PROJECT_DATA_SOURCE_GRANT";
19975
+ DataApiCatalogDataSourceVisibilitySource["CONTROLPLANEPOLICY"] = "CONTROL_PLANE_POLICY";
19976
+ DataApiCatalogDataSourceVisibilitySource["ACCESSBINDING"] = "ACCESS_BINDING";
19977
+ DataApiCatalogDataSourceVisibilitySource["BOTH"] = "BOTH";
19978
+ })(exports.DataApiCatalogDataSourceVisibilitySource || (exports.DataApiCatalogDataSourceVisibilitySource = {}));
19979
+
19980
+ exports.DataApiCatalogDatabaseClassification = void 0;
19981
+ (function (DataApiCatalogDatabaseClassification) {
19982
+ DataApiCatalogDatabaseClassification["USER"] = "USER";
19983
+ DataApiCatalogDatabaseClassification["SYSTEM"] = "SYSTEM";
19984
+ })(exports.DataApiCatalogDatabaseClassification || (exports.DataApiCatalogDatabaseClassification = {}));
19985
+
19986
+ exports.DataApiCatalogDatabaseStatus = void 0;
19987
+ (function (DataApiCatalogDatabaseStatus) {
19988
+ DataApiCatalogDatabaseStatus["VALID"] = "VALID";
19989
+ DataApiCatalogDatabaseStatus["INVALID"] = "INVALID";
19990
+ })(exports.DataApiCatalogDatabaseStatus || (exports.DataApiCatalogDatabaseStatus = {}));
19991
+
19992
+ exports.DataApiCatalogDatabaseAvailability = void 0;
19993
+ (function (DataApiCatalogDatabaseAvailability) {
19994
+ DataApiCatalogDatabaseAvailability["UNKNOWN"] = "UNKNOWN";
19995
+ DataApiCatalogDatabaseAvailability["AVAILABLE"] = "AVAILABLE";
19996
+ DataApiCatalogDatabaseAvailability["UNAVAILABLE"] = "UNAVAILABLE";
19997
+ })(exports.DataApiCatalogDatabaseAvailability || (exports.DataApiCatalogDatabaseAvailability = {}));
19998
+
19999
+ exports.DataApiCatalogDatabaseVisibilitySource = void 0;
20000
+ (function (DataApiCatalogDatabaseVisibilitySource) {
20001
+ DataApiCatalogDatabaseVisibilitySource["ORGANIZATIONOWNER"] = "ORGANIZATION_OWNER";
20002
+ DataApiCatalogDatabaseVisibilitySource["PROJECTDATASOURCEGRANT"] = "PROJECT_DATA_SOURCE_GRANT";
20003
+ DataApiCatalogDatabaseVisibilitySource["CONTROLPLANEPOLICY"] = "CONTROL_PLANE_POLICY";
20004
+ DataApiCatalogDatabaseVisibilitySource["ACCESSBINDING"] = "ACCESS_BINDING";
20005
+ DataApiCatalogDatabaseVisibilitySource["BOTH"] = "BOTH";
20006
+ })(exports.DataApiCatalogDatabaseVisibilitySource || (exports.DataApiCatalogDatabaseVisibilitySource = {}));
20007
+
18239
20008
  exports.ExecutionTrigger = void 0;
18240
20009
  (function (ExecutionTrigger) {
18241
20010
  ExecutionTrigger["Http"] = "http";
@@ -18290,6 +20059,28 @@
18290
20059
  MemoryBulkDeleteResponseStatus["PartialFailed"] = "partial_failed";
18291
20060
  })(exports.MemoryBulkDeleteResponseStatus || (exports.MemoryBulkDeleteResponseStatus = {}));
18292
20061
 
20062
+ exports.MemoryPipelineRunResultStatus = void 0;
20063
+ (function (MemoryPipelineRunResultStatus) {
20064
+ MemoryPipelineRunResultStatus["Completed"] = "completed";
20065
+ MemoryPipelineRunResultStatus["Failed"] = "failed";
20066
+ })(exports.MemoryPipelineRunResultStatus || (exports.MemoryPipelineRunResultStatus = {}));
20067
+
20068
+ exports.MemoryPipelineRunScenario = void 0;
20069
+ (function (MemoryPipelineRunScenario) {
20070
+ MemoryPipelineRunScenario["AddMemory"] = "add_memory";
20071
+ MemoryPipelineRunScenario["Profile"] = "profile";
20072
+ MemoryPipelineRunScenario["Distillation"] = "distillation";
20073
+ MemoryPipelineRunScenario["Forgetting"] = "forgetting";
20074
+ })(exports.MemoryPipelineRunScenario || (exports.MemoryPipelineRunScenario = {}));
20075
+
20076
+ exports.MemoryPipelineRunStatus = void 0;
20077
+ (function (MemoryPipelineRunStatus) {
20078
+ MemoryPipelineRunStatus["Queued"] = "queued";
20079
+ MemoryPipelineRunStatus["Running"] = "running";
20080
+ MemoryPipelineRunStatus["Completed"] = "completed";
20081
+ MemoryPipelineRunStatus["Failed"] = "failed";
20082
+ })(exports.MemoryPipelineRunStatus || (exports.MemoryPipelineRunStatus = {}));
20083
+
18293
20084
  exports.KnowledgeBaseDataSourceDocumentImportResultStatus = void 0;
18294
20085
  (function (KnowledgeBaseDataSourceDocumentImportResultStatus) {
18295
20086
  KnowledgeBaseDataSourceDocumentImportResultStatus["Accepted"] = "accepted";
@@ -18304,6 +20095,7 @@
18304
20095
  exports.Avatars = Avatars;
18305
20096
  exports.Channel = Channel;
18306
20097
  exports.Client = Client;
20098
+ exports.DataApi = DataApi;
18307
20099
  exports.Databases = Databases;
18308
20100
  exports.DocumentsDB = DocumentsDB;
18309
20101
  exports.Functions = Functions;