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/dist/esm/sdk.js CHANGED
@@ -593,7 +593,7 @@ class Client {
593
593
  * Holds configuration such as project.
594
594
  */
595
595
  this.config = {
596
- endpoint: 'https://example.com[HOSTNAME]/v1',
596
+ endpoint: 'https://appbase.local/v1',
597
597
  endpointRealtime: '',
598
598
  project: '',
599
599
  organization: '',
@@ -612,9 +612,9 @@ class Client {
612
612
  'x-sdk-name': 'Agentbase',
613
613
  'x-sdk-platform': 'client',
614
614
  'x-sdk-language': 'web',
615
- 'x-sdk-version': '2.7.2',
615
+ 'x-sdk-version': '2.9.0',
616
616
  'X-AppBase-SDK': 'true',
617
- 'X-Appwrite-Response-Format': '2.7.2',
617
+ 'X-Appwrite-Response-Format': '2.9.0',
618
618
  };
619
619
  this.realtime = {
620
620
  socket: undefined,
@@ -4100,6 +4100,51 @@ class AiGateway {
4100
4100
  };
4101
4101
  return this.client.call('post', uri, apiHeaders, payload);
4102
4102
  }
4103
+ listLogicalModelMounts(paramsOrFirst) {
4104
+ let params;
4105
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
4106
+ params = (paramsOrFirst || {});
4107
+ }
4108
+ else {
4109
+ params = {
4110
+ id: paramsOrFirst
4111
+ };
4112
+ }
4113
+ const id = params.id;
4114
+ if (typeof id === 'undefined') {
4115
+ throw new AgentbaseException('Missing required parameter: "id"');
4116
+ }
4117
+ const apiPath = '/ai-gateway/resources/logical-models/{id}/mounts'.replace('{id}', id);
4118
+ const payload = {};
4119
+ const uri = new URL(this.client.config.endpoint + apiPath);
4120
+ const apiHeaders = {
4121
+ 'X-Appwrite-Project': this.client.config.project,
4122
+ };
4123
+ return this.client.call('get', uri, apiHeaders, payload);
4124
+ }
4125
+ replaceLogicalModelMounts(paramsOrFirst) {
4126
+ let params;
4127
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
4128
+ params = (paramsOrFirst || {});
4129
+ }
4130
+ else {
4131
+ params = {
4132
+ id: paramsOrFirst
4133
+ };
4134
+ }
4135
+ const id = params.id;
4136
+ if (typeof id === 'undefined') {
4137
+ throw new AgentbaseException('Missing required parameter: "id"');
4138
+ }
4139
+ const apiPath = '/ai-gateway/resources/logical-models/{id}/mounts'.replace('{id}', id);
4140
+ const payload = {};
4141
+ const uri = new URL(this.client.config.endpoint + apiPath);
4142
+ const apiHeaders = {
4143
+ 'X-Appwrite-Project': this.client.config.project,
4144
+ 'content-type': 'application/json',
4145
+ };
4146
+ return this.client.call('put', uri, apiHeaders, payload);
4147
+ }
4103
4148
  testModelDeployment(paramsOrFirst) {
4104
4149
  let params;
4105
4150
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -4681,6 +4726,29 @@ class AiGateway {
4681
4726
  };
4682
4727
  return this.client.call('delete', uri, apiHeaders, payload);
4683
4728
  }
4729
+ testToolConnection(paramsOrFirst) {
4730
+ let params;
4731
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
4732
+ params = (paramsOrFirst || {});
4733
+ }
4734
+ else {
4735
+ params = {
4736
+ id: paramsOrFirst
4737
+ };
4738
+ }
4739
+ const id = params.id;
4740
+ if (typeof id === 'undefined') {
4741
+ throw new AgentbaseException('Missing required parameter: "id"');
4742
+ }
4743
+ const apiPath = '/ai-gateway/tool-connections/{id}/test'.replace('{id}', id);
4744
+ const payload = {};
4745
+ const uri = new URL(this.client.config.endpoint + apiPath);
4746
+ const apiHeaders = {
4747
+ 'X-Appwrite-Project': this.client.config.project,
4748
+ 'content-type': 'application/json',
4749
+ };
4750
+ return this.client.call('post', uri, apiHeaders, payload);
4751
+ }
4684
4752
  }
4685
4753
 
4686
4754
  class Avatars {
@@ -6237,6 +6305,83 @@ class Functions {
6237
6305
  constructor(client) {
6238
6306
  this.client = client;
6239
6307
  }
6308
+ listExecutionPaths(paramsOrFirst, ...rest) {
6309
+ let params;
6310
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
6311
+ params = (paramsOrFirst || {});
6312
+ }
6313
+ else {
6314
+ params = {
6315
+ functionId: paramsOrFirst,
6316
+ limit: rest[0],
6317
+ offset: rest[1],
6318
+ total: rest[2]
6319
+ };
6320
+ }
6321
+ const functionId = params.functionId;
6322
+ const limit = params.limit;
6323
+ const offset = params.offset;
6324
+ const total = params.total;
6325
+ if (typeof functionId === 'undefined') {
6326
+ throw new AgentbaseException('Missing required parameter: "functionId"');
6327
+ }
6328
+ const apiPath = '/functions/{functionId}/execution-paths'.replace('{functionId}', functionId);
6329
+ const payload = {};
6330
+ if (typeof limit !== 'undefined') {
6331
+ payload['limit'] = limit;
6332
+ }
6333
+ if (typeof offset !== 'undefined') {
6334
+ payload['offset'] = offset;
6335
+ }
6336
+ if (typeof total !== 'undefined') {
6337
+ payload['total'] = total;
6338
+ }
6339
+ const uri = new URL(this.client.config.endpoint + apiPath);
6340
+ const apiHeaders = {
6341
+ 'X-Appwrite-Project': this.client.config.project,
6342
+ };
6343
+ return this.client.call('get', uri, apiHeaders, payload);
6344
+ }
6345
+ listExecutionsByPath(paramsOrFirst, ...rest) {
6346
+ let params;
6347
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
6348
+ params = (paramsOrFirst || {});
6349
+ }
6350
+ else {
6351
+ params = {
6352
+ functionId: paramsOrFirst,
6353
+ xpath: rest[0],
6354
+ queries: rest[1],
6355
+ total: rest[2]
6356
+ };
6357
+ }
6358
+ const functionId = params.functionId;
6359
+ const xpath = params.xpath;
6360
+ const queries = params.queries;
6361
+ const total = params.total;
6362
+ if (typeof functionId === 'undefined') {
6363
+ throw new AgentbaseException('Missing required parameter: "functionId"');
6364
+ }
6365
+ if (typeof xpath === 'undefined') {
6366
+ throw new AgentbaseException('Missing required parameter: "xpath"');
6367
+ }
6368
+ const apiPath = '/functions/{functionId}/execution-paths/executions'.replace('{functionId}', functionId);
6369
+ const payload = {};
6370
+ if (typeof xpath !== 'undefined') {
6371
+ payload['path'] = xpath;
6372
+ }
6373
+ if (typeof queries !== 'undefined') {
6374
+ payload['queries'] = queries;
6375
+ }
6376
+ if (typeof total !== 'undefined') {
6377
+ payload['total'] = total;
6378
+ }
6379
+ const uri = new URL(this.client.config.endpoint + apiPath);
6380
+ const apiHeaders = {
6381
+ 'X-Appwrite-Project': this.client.config.project,
6382
+ };
6383
+ return this.client.call('get', uri, apiHeaders, payload);
6384
+ }
6240
6385
  listExecutions(paramsOrFirst, ...rest) {
6241
6386
  let params;
6242
6387
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -6425,13 +6570,15 @@ class KnowledgeBases {
6425
6570
  knowledgeBaseId: paramsOrFirst,
6426
6571
  sessionId: rest[0],
6427
6572
  urls: rest[1],
6428
- idempotencyKey: rest[2]
6573
+ idempotencyKey: rest[2],
6574
+ versionId: rest[3]
6429
6575
  };
6430
6576
  }
6431
6577
  const knowledgeBaseId = params.knowledgeBaseId;
6432
6578
  const sessionId = params.sessionId;
6433
6579
  const urls = params.urls;
6434
6580
  const idempotencyKey = params.idempotencyKey;
6581
+ const versionId = params.versionId;
6435
6582
  if (typeof knowledgeBaseId === 'undefined') {
6436
6583
  throw new AgentbaseException('Missing required parameter: "knowledgeBaseId"');
6437
6584
  }
@@ -6452,6 +6599,9 @@ class KnowledgeBases {
6452
6599
  if (typeof idempotencyKey !== 'undefined') {
6453
6600
  payload['idempotencyKey'] = idempotencyKey;
6454
6601
  }
6602
+ if (typeof versionId !== 'undefined') {
6603
+ payload['versionId'] = versionId;
6604
+ }
6455
6605
  const uri = new URL(this.client.config.endpoint + apiPath);
6456
6606
  const apiHeaders = {
6457
6607
  'X-Appwrite-Project': this.client.config.project,
@@ -9307,13 +9457,15 @@ class Memory {
9307
9457
  profileType: rest[0],
9308
9458
  messages: rest[1],
9309
9459
  sourceMemoryIds: rest[2],
9310
- mode: rest[3]
9460
+ sessionId: rest[3],
9461
+ mode: rest[4]
9311
9462
  };
9312
9463
  }
9313
9464
  const userId = params.userId;
9314
9465
  const profileType = params.profileType;
9315
9466
  const messages = params.messages;
9316
9467
  const sourceMemoryIds = params.sourceMemoryIds;
9468
+ const sessionId = params.sessionId;
9317
9469
  const mode = params.mode;
9318
9470
  if (typeof userId === 'undefined') {
9319
9471
  throw new AgentbaseException('Missing required parameter: "userId"');
@@ -9329,6 +9481,9 @@ class Memory {
9329
9481
  if (typeof sourceMemoryIds !== 'undefined') {
9330
9482
  payload['sourceMemoryIds'] = sourceMemoryIds;
9331
9483
  }
9484
+ if (typeof sessionId !== 'undefined') {
9485
+ payload['sessionId'] = sessionId;
9486
+ }
9332
9487
  if (typeof mode !== 'undefined') {
9333
9488
  payload['mode'] = mode;
9334
9489
  }
@@ -13805,7 +13960,6 @@ var Timezone;
13805
13960
  Timezone["AsiaBaku"] = "asia/baku";
13806
13961
  Timezone["AsiaBangkok"] = "asia/bangkok";
13807
13962
  Timezone["AsiaBarnaul"] = "asia/barnaul";
13808
- Timezone["AsiaBeijing"] = "asia/beijing";
13809
13963
  Timezone["AsiaBeirut"] = "asia/beirut";
13810
13964
  Timezone["AsiaBishkek"] = "asia/bishkek";
13811
13965
  Timezone["AsiaBrunei"] = "asia/brunei";