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/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Agentbase Agentbase SDK
|
|
2
2
|
|
|
3
3
|

|
|
4
|
-

|
|
5
5
|
[](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.
|
|
31
|
+
<script src="https://cdn.jsdelivr.net/npm/agentbase-web-sdk@2.8.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://
|
|
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.
|
|
617
|
+
'x-sdk-version': '2.8.0',
|
|
618
618
|
'X-AppBase-SDK': 'true',
|
|
619
|
-
'X-Appwrite-Response-Format': '2.
|
|
619
|
+
'X-Appwrite-Response-Format': '2.8.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 {
|
|
@@ -6427,13 +6495,15 @@ class KnowledgeBases {
|
|
|
6427
6495
|
knowledgeBaseId: paramsOrFirst,
|
|
6428
6496
|
sessionId: rest[0],
|
|
6429
6497
|
urls: rest[1],
|
|
6430
|
-
idempotencyKey: rest[2]
|
|
6498
|
+
idempotencyKey: rest[2],
|
|
6499
|
+
versionId: rest[3]
|
|
6431
6500
|
};
|
|
6432
6501
|
}
|
|
6433
6502
|
const knowledgeBaseId = params.knowledgeBaseId;
|
|
6434
6503
|
const sessionId = params.sessionId;
|
|
6435
6504
|
const urls = params.urls;
|
|
6436
6505
|
const idempotencyKey = params.idempotencyKey;
|
|
6506
|
+
const versionId = params.versionId;
|
|
6437
6507
|
if (typeof knowledgeBaseId === 'undefined') {
|
|
6438
6508
|
throw new AgentbaseException('Missing required parameter: "knowledgeBaseId"');
|
|
6439
6509
|
}
|
|
@@ -6454,6 +6524,9 @@ class KnowledgeBases {
|
|
|
6454
6524
|
if (typeof idempotencyKey !== 'undefined') {
|
|
6455
6525
|
payload['idempotencyKey'] = idempotencyKey;
|
|
6456
6526
|
}
|
|
6527
|
+
if (typeof versionId !== 'undefined') {
|
|
6528
|
+
payload['versionId'] = versionId;
|
|
6529
|
+
}
|
|
6457
6530
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
6458
6531
|
const apiHeaders = {
|
|
6459
6532
|
'X-Appwrite-Project': this.client.config.project,
|
|
@@ -9309,13 +9382,15 @@ class Memory {
|
|
|
9309
9382
|
profileType: rest[0],
|
|
9310
9383
|
messages: rest[1],
|
|
9311
9384
|
sourceMemoryIds: rest[2],
|
|
9312
|
-
|
|
9385
|
+
sessionId: rest[3],
|
|
9386
|
+
mode: rest[4]
|
|
9313
9387
|
};
|
|
9314
9388
|
}
|
|
9315
9389
|
const userId = params.userId;
|
|
9316
9390
|
const profileType = params.profileType;
|
|
9317
9391
|
const messages = params.messages;
|
|
9318
9392
|
const sourceMemoryIds = params.sourceMemoryIds;
|
|
9393
|
+
const sessionId = params.sessionId;
|
|
9319
9394
|
const mode = params.mode;
|
|
9320
9395
|
if (typeof userId === 'undefined') {
|
|
9321
9396
|
throw new AgentbaseException('Missing required parameter: "userId"');
|
|
@@ -9331,6 +9406,9 @@ class Memory {
|
|
|
9331
9406
|
if (typeof sourceMemoryIds !== 'undefined') {
|
|
9332
9407
|
payload['sourceMemoryIds'] = sourceMemoryIds;
|
|
9333
9408
|
}
|
|
9409
|
+
if (typeof sessionId !== 'undefined') {
|
|
9410
|
+
payload['sessionId'] = sessionId;
|
|
9411
|
+
}
|
|
9334
9412
|
if (typeof mode !== 'undefined') {
|
|
9335
9413
|
payload['mode'] = mode;
|
|
9336
9414
|
}
|