agentbase-web-sdk 2.7.2 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Agentbase Agentbase SDK
2
2
 
3
3
  ![License](https://img.shields.io/github/license/agentbase/agentbase-web-sdk.svg?style=flat-square)
4
- ![Version](https://img.shields.io/badge/api%20version-2.7.2-blue.svg?style=flat-square)
4
+ ![Version](https://img.shields.io/badge/api%20version-2.9.0-blue.svg?style=flat-square)
5
5
  [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
6
6
 
7
7
  Agentbase SDK for integrating your app with Agentbase APIs and tools.
@@ -28,7 +28,7 @@ import { Client, Account } from "agentbase-web-sdk";
28
28
  To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Agentbase services:
29
29
 
30
30
  ```html
31
- <script src="https://cdn.jsdelivr.net/npm/agentbase-web-sdk@2.7.2"></script>
31
+ <script src="https://cdn.jsdelivr.net/npm/agentbase-web-sdk@2.9.0"></script>
32
32
  ```
33
33
 
34
34
 
package/dist/cjs/sdk.js CHANGED
@@ -595,7 +595,7 @@ class Client {
595
595
  * Holds configuration such as project.
596
596
  */
597
597
  this.config = {
598
- endpoint: 'https://example.com[HOSTNAME]/v1',
598
+ endpoint: 'https://appbase.local/v1',
599
599
  endpointRealtime: '',
600
600
  project: '',
601
601
  organization: '',
@@ -614,9 +614,9 @@ class Client {
614
614
  'x-sdk-name': 'Agentbase',
615
615
  'x-sdk-platform': 'client',
616
616
  'x-sdk-language': 'web',
617
- 'x-sdk-version': '2.7.2',
617
+ 'x-sdk-version': '2.9.0',
618
618
  'X-AppBase-SDK': 'true',
619
- 'X-Appwrite-Response-Format': '2.7.2',
619
+ 'X-Appwrite-Response-Format': '2.9.0',
620
620
  };
621
621
  this.realtime = {
622
622
  socket: undefined,
@@ -4102,6 +4102,51 @@ class AiGateway {
4102
4102
  };
4103
4103
  return this.client.call('post', uri, apiHeaders, payload);
4104
4104
  }
4105
+ listLogicalModelMounts(paramsOrFirst) {
4106
+ let params;
4107
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
4108
+ params = (paramsOrFirst || {});
4109
+ }
4110
+ else {
4111
+ params = {
4112
+ id: paramsOrFirst
4113
+ };
4114
+ }
4115
+ const id = params.id;
4116
+ if (typeof id === 'undefined') {
4117
+ throw new AgentbaseException('Missing required parameter: "id"');
4118
+ }
4119
+ const apiPath = '/ai-gateway/resources/logical-models/{id}/mounts'.replace('{id}', id);
4120
+ const payload = {};
4121
+ const uri = new URL(this.client.config.endpoint + apiPath);
4122
+ const apiHeaders = {
4123
+ 'X-Appwrite-Project': this.client.config.project,
4124
+ };
4125
+ return this.client.call('get', uri, apiHeaders, payload);
4126
+ }
4127
+ replaceLogicalModelMounts(paramsOrFirst) {
4128
+ let params;
4129
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
4130
+ params = (paramsOrFirst || {});
4131
+ }
4132
+ else {
4133
+ params = {
4134
+ id: paramsOrFirst
4135
+ };
4136
+ }
4137
+ const id = params.id;
4138
+ if (typeof id === 'undefined') {
4139
+ throw new AgentbaseException('Missing required parameter: "id"');
4140
+ }
4141
+ const apiPath = '/ai-gateway/resources/logical-models/{id}/mounts'.replace('{id}', id);
4142
+ const payload = {};
4143
+ const uri = new URL(this.client.config.endpoint + apiPath);
4144
+ const apiHeaders = {
4145
+ 'X-Appwrite-Project': this.client.config.project,
4146
+ 'content-type': 'application/json',
4147
+ };
4148
+ return this.client.call('put', uri, apiHeaders, payload);
4149
+ }
4105
4150
  testModelDeployment(paramsOrFirst) {
4106
4151
  let params;
4107
4152
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -4683,6 +4728,29 @@ class AiGateway {
4683
4728
  };
4684
4729
  return this.client.call('delete', uri, apiHeaders, payload);
4685
4730
  }
4731
+ testToolConnection(paramsOrFirst) {
4732
+ let params;
4733
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
4734
+ params = (paramsOrFirst || {});
4735
+ }
4736
+ else {
4737
+ params = {
4738
+ id: paramsOrFirst
4739
+ };
4740
+ }
4741
+ const id = params.id;
4742
+ if (typeof id === 'undefined') {
4743
+ throw new AgentbaseException('Missing required parameter: "id"');
4744
+ }
4745
+ const apiPath = '/ai-gateway/tool-connections/{id}/test'.replace('{id}', id);
4746
+ const payload = {};
4747
+ const uri = new URL(this.client.config.endpoint + apiPath);
4748
+ const apiHeaders = {
4749
+ 'X-Appwrite-Project': this.client.config.project,
4750
+ 'content-type': 'application/json',
4751
+ };
4752
+ return this.client.call('post', uri, apiHeaders, payload);
4753
+ }
4686
4754
  }
4687
4755
 
4688
4756
  class Avatars {
@@ -6239,6 +6307,83 @@ class Functions {
6239
6307
  constructor(client) {
6240
6308
  this.client = client;
6241
6309
  }
6310
+ listExecutionPaths(paramsOrFirst, ...rest) {
6311
+ let params;
6312
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
6313
+ params = (paramsOrFirst || {});
6314
+ }
6315
+ else {
6316
+ params = {
6317
+ functionId: paramsOrFirst,
6318
+ limit: rest[0],
6319
+ offset: rest[1],
6320
+ total: rest[2]
6321
+ };
6322
+ }
6323
+ const functionId = params.functionId;
6324
+ const limit = params.limit;
6325
+ const offset = params.offset;
6326
+ const total = params.total;
6327
+ if (typeof functionId === 'undefined') {
6328
+ throw new AgentbaseException('Missing required parameter: "functionId"');
6329
+ }
6330
+ const apiPath = '/functions/{functionId}/execution-paths'.replace('{functionId}', functionId);
6331
+ const payload = {};
6332
+ if (typeof limit !== 'undefined') {
6333
+ payload['limit'] = limit;
6334
+ }
6335
+ if (typeof offset !== 'undefined') {
6336
+ payload['offset'] = offset;
6337
+ }
6338
+ if (typeof total !== 'undefined') {
6339
+ payload['total'] = total;
6340
+ }
6341
+ const uri = new URL(this.client.config.endpoint + apiPath);
6342
+ const apiHeaders = {
6343
+ 'X-Appwrite-Project': this.client.config.project,
6344
+ };
6345
+ return this.client.call('get', uri, apiHeaders, payload);
6346
+ }
6347
+ listExecutionsByPath(paramsOrFirst, ...rest) {
6348
+ let params;
6349
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
6350
+ params = (paramsOrFirst || {});
6351
+ }
6352
+ else {
6353
+ params = {
6354
+ functionId: paramsOrFirst,
6355
+ xpath: rest[0],
6356
+ queries: rest[1],
6357
+ total: rest[2]
6358
+ };
6359
+ }
6360
+ const functionId = params.functionId;
6361
+ const xpath = params.xpath;
6362
+ const queries = params.queries;
6363
+ const total = params.total;
6364
+ if (typeof functionId === 'undefined') {
6365
+ throw new AgentbaseException('Missing required parameter: "functionId"');
6366
+ }
6367
+ if (typeof xpath === 'undefined') {
6368
+ throw new AgentbaseException('Missing required parameter: "xpath"');
6369
+ }
6370
+ const apiPath = '/functions/{functionId}/execution-paths/executions'.replace('{functionId}', functionId);
6371
+ const payload = {};
6372
+ if (typeof xpath !== 'undefined') {
6373
+ payload['path'] = xpath;
6374
+ }
6375
+ if (typeof queries !== 'undefined') {
6376
+ payload['queries'] = queries;
6377
+ }
6378
+ if (typeof total !== 'undefined') {
6379
+ payload['total'] = total;
6380
+ }
6381
+ const uri = new URL(this.client.config.endpoint + apiPath);
6382
+ const apiHeaders = {
6383
+ 'X-Appwrite-Project': this.client.config.project,
6384
+ };
6385
+ return this.client.call('get', uri, apiHeaders, payload);
6386
+ }
6242
6387
  listExecutions(paramsOrFirst, ...rest) {
6243
6388
  let params;
6244
6389
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -6427,13 +6572,15 @@ class KnowledgeBases {
6427
6572
  knowledgeBaseId: paramsOrFirst,
6428
6573
  sessionId: rest[0],
6429
6574
  urls: rest[1],
6430
- idempotencyKey: rest[2]
6575
+ idempotencyKey: rest[2],
6576
+ versionId: rest[3]
6431
6577
  };
6432
6578
  }
6433
6579
  const knowledgeBaseId = params.knowledgeBaseId;
6434
6580
  const sessionId = params.sessionId;
6435
6581
  const urls = params.urls;
6436
6582
  const idempotencyKey = params.idempotencyKey;
6583
+ const versionId = params.versionId;
6437
6584
  if (typeof knowledgeBaseId === 'undefined') {
6438
6585
  throw new AgentbaseException('Missing required parameter: "knowledgeBaseId"');
6439
6586
  }
@@ -6454,6 +6601,9 @@ class KnowledgeBases {
6454
6601
  if (typeof idempotencyKey !== 'undefined') {
6455
6602
  payload['idempotencyKey'] = idempotencyKey;
6456
6603
  }
6604
+ if (typeof versionId !== 'undefined') {
6605
+ payload['versionId'] = versionId;
6606
+ }
6457
6607
  const uri = new URL(this.client.config.endpoint + apiPath);
6458
6608
  const apiHeaders = {
6459
6609
  'X-Appwrite-Project': this.client.config.project,
@@ -9309,13 +9459,15 @@ class Memory {
9309
9459
  profileType: rest[0],
9310
9460
  messages: rest[1],
9311
9461
  sourceMemoryIds: rest[2],
9312
- mode: rest[3]
9462
+ sessionId: rest[3],
9463
+ mode: rest[4]
9313
9464
  };
9314
9465
  }
9315
9466
  const userId = params.userId;
9316
9467
  const profileType = params.profileType;
9317
9468
  const messages = params.messages;
9318
9469
  const sourceMemoryIds = params.sourceMemoryIds;
9470
+ const sessionId = params.sessionId;
9319
9471
  const mode = params.mode;
9320
9472
  if (typeof userId === 'undefined') {
9321
9473
  throw new AgentbaseException('Missing required parameter: "userId"');
@@ -9331,6 +9483,9 @@ class Memory {
9331
9483
  if (typeof sourceMemoryIds !== 'undefined') {
9332
9484
  payload['sourceMemoryIds'] = sourceMemoryIds;
9333
9485
  }
9486
+ if (typeof sessionId !== 'undefined') {
9487
+ payload['sessionId'] = sessionId;
9488
+ }
9334
9489
  if (typeof mode !== 'undefined') {
9335
9490
  payload['mode'] = mode;
9336
9491
  }
@@ -13807,7 +13962,6 @@ exports.Timezone = void 0;
13807
13962
  Timezone["AsiaBaku"] = "asia/baku";
13808
13963
  Timezone["AsiaBangkok"] = "asia/bangkok";
13809
13964
  Timezone["AsiaBarnaul"] = "asia/barnaul";
13810
- Timezone["AsiaBeijing"] = "asia/beijing";
13811
13965
  Timezone["AsiaBeirut"] = "asia/beirut";
13812
13966
  Timezone["AsiaBishkek"] = "asia/bishkek";
13813
13967
  Timezone["AsiaBrunei"] = "asia/brunei";