agentbase-web-sdk 2.7.1 → 2.8.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 +2 -2
- package/dist/cjs/sdk.js +83 -5
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +83 -5
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +83 -5
- package/package.json +5 -4
- package/types/index.d.ts +1 -1
- package/types/models.d.ts +4 -0
- package/types/services/ai-gateway.d.ts +57 -0
- package/types/services/knowledge-bases.d.ts +4 -1
- package/types/services/memory.d.ts +4 -1
- package/types/services/storage.d.ts +8 -2
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://
|
|
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.
|
|
615
|
+
'x-sdk-version': '2.8.0',
|
|
616
616
|
'X-AppBase-SDK': 'true',
|
|
617
|
-
'X-Appwrite-Response-Format': '2.
|
|
617
|
+
'X-Appwrite-Response-Format': '2.8.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 {
|
|
@@ -6425,13 +6493,15 @@ class KnowledgeBases {
|
|
|
6425
6493
|
knowledgeBaseId: paramsOrFirst,
|
|
6426
6494
|
sessionId: rest[0],
|
|
6427
6495
|
urls: rest[1],
|
|
6428
|
-
idempotencyKey: rest[2]
|
|
6496
|
+
idempotencyKey: rest[2],
|
|
6497
|
+
versionId: rest[3]
|
|
6429
6498
|
};
|
|
6430
6499
|
}
|
|
6431
6500
|
const knowledgeBaseId = params.knowledgeBaseId;
|
|
6432
6501
|
const sessionId = params.sessionId;
|
|
6433
6502
|
const urls = params.urls;
|
|
6434
6503
|
const idempotencyKey = params.idempotencyKey;
|
|
6504
|
+
const versionId = params.versionId;
|
|
6435
6505
|
if (typeof knowledgeBaseId === 'undefined') {
|
|
6436
6506
|
throw new AgentbaseException('Missing required parameter: "knowledgeBaseId"');
|
|
6437
6507
|
}
|
|
@@ -6452,6 +6522,9 @@ class KnowledgeBases {
|
|
|
6452
6522
|
if (typeof idempotencyKey !== 'undefined') {
|
|
6453
6523
|
payload['idempotencyKey'] = idempotencyKey;
|
|
6454
6524
|
}
|
|
6525
|
+
if (typeof versionId !== 'undefined') {
|
|
6526
|
+
payload['versionId'] = versionId;
|
|
6527
|
+
}
|
|
6455
6528
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
6456
6529
|
const apiHeaders = {
|
|
6457
6530
|
'X-Appwrite-Project': this.client.config.project,
|
|
@@ -9307,13 +9380,15 @@ class Memory {
|
|
|
9307
9380
|
profileType: rest[0],
|
|
9308
9381
|
messages: rest[1],
|
|
9309
9382
|
sourceMemoryIds: rest[2],
|
|
9310
|
-
|
|
9383
|
+
sessionId: rest[3],
|
|
9384
|
+
mode: rest[4]
|
|
9311
9385
|
};
|
|
9312
9386
|
}
|
|
9313
9387
|
const userId = params.userId;
|
|
9314
9388
|
const profileType = params.profileType;
|
|
9315
9389
|
const messages = params.messages;
|
|
9316
9390
|
const sourceMemoryIds = params.sourceMemoryIds;
|
|
9391
|
+
const sessionId = params.sessionId;
|
|
9317
9392
|
const mode = params.mode;
|
|
9318
9393
|
if (typeof userId === 'undefined') {
|
|
9319
9394
|
throw new AgentbaseException('Missing required parameter: "userId"');
|
|
@@ -9329,6 +9404,9 @@ class Memory {
|
|
|
9329
9404
|
if (typeof sourceMemoryIds !== 'undefined') {
|
|
9330
9405
|
payload['sourceMemoryIds'] = sourceMemoryIds;
|
|
9331
9406
|
}
|
|
9407
|
+
if (typeof sessionId !== 'undefined') {
|
|
9408
|
+
payload['sessionId'] = sessionId;
|
|
9409
|
+
}
|
|
9332
9410
|
if (typeof mode !== 'undefined') {
|
|
9333
9411
|
payload['mode'] = mode;
|
|
9334
9412
|
}
|