agentbase-web-sdk 2.9.0 → 2.10.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 +812 -69
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +813 -70
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +812 -69
- package/package.json +2 -2
- package/types/enums/method.d.ts +9 -0
- package/types/enums/path-match.d.ts +4 -0
- package/types/enums/scenario.d.ts +6 -0
- package/types/enums/status.d.ts +5 -1
- package/types/index.d.ts +4 -1
- package/types/services/functions.d.ts +33 -7
- package/types/services/memory.d.ts +488 -16
package/dist/esm/sdk.js
CHANGED
|
@@ -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.10.0',
|
|
616
616
|
'X-AppBase-SDK': 'true',
|
|
617
|
-
'X-Appwrite-Response-Format': '2.
|
|
617
|
+
'X-Appwrite-Response-Format': '2.10.0',
|
|
618
618
|
};
|
|
619
619
|
this.realtime = {
|
|
620
620
|
socket: undefined,
|
|
@@ -6315,13 +6315,19 @@ class Functions {
|
|
|
6315
6315
|
functionId: paramsOrFirst,
|
|
6316
6316
|
limit: rest[0],
|
|
6317
6317
|
offset: rest[1],
|
|
6318
|
-
total: rest[2]
|
|
6318
|
+
total: rest[2],
|
|
6319
|
+
xpath: rest[3],
|
|
6320
|
+
pathMatch: rest[4],
|
|
6321
|
+
method: rest[5]
|
|
6319
6322
|
};
|
|
6320
6323
|
}
|
|
6321
6324
|
const functionId = params.functionId;
|
|
6322
6325
|
const limit = params.limit;
|
|
6323
6326
|
const offset = params.offset;
|
|
6324
6327
|
const total = params.total;
|
|
6328
|
+
const xpath = params.xpath;
|
|
6329
|
+
const pathMatch = params.pathMatch;
|
|
6330
|
+
const method = params.method;
|
|
6325
6331
|
if (typeof functionId === 'undefined') {
|
|
6326
6332
|
throw new AgentbaseException('Missing required parameter: "functionId"');
|
|
6327
6333
|
}
|
|
@@ -6336,6 +6342,15 @@ class Functions {
|
|
|
6336
6342
|
if (typeof total !== 'undefined') {
|
|
6337
6343
|
payload['total'] = total;
|
|
6338
6344
|
}
|
|
6345
|
+
if (typeof xpath !== 'undefined') {
|
|
6346
|
+
payload['path'] = xpath;
|
|
6347
|
+
}
|
|
6348
|
+
if (typeof pathMatch !== 'undefined') {
|
|
6349
|
+
payload['pathMatch'] = pathMatch;
|
|
6350
|
+
}
|
|
6351
|
+
if (typeof method !== 'undefined') {
|
|
6352
|
+
payload['method'] = method;
|
|
6353
|
+
}
|
|
6339
6354
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
6340
6355
|
const apiHeaders = {
|
|
6341
6356
|
'X-Appwrite-Project': this.client.config.project,
|
|
@@ -6352,13 +6367,17 @@ class Functions {
|
|
|
6352
6367
|
functionId: paramsOrFirst,
|
|
6353
6368
|
xpath: rest[0],
|
|
6354
6369
|
queries: rest[1],
|
|
6355
|
-
total: rest[2]
|
|
6370
|
+
total: rest[2],
|
|
6371
|
+
pathMatch: rest[3],
|
|
6372
|
+
method: rest[4]
|
|
6356
6373
|
};
|
|
6357
6374
|
}
|
|
6358
6375
|
const functionId = params.functionId;
|
|
6359
6376
|
const xpath = params.xpath;
|
|
6360
6377
|
const queries = params.queries;
|
|
6361
6378
|
const total = params.total;
|
|
6379
|
+
const pathMatch = params.pathMatch;
|
|
6380
|
+
const method = params.method;
|
|
6362
6381
|
if (typeof functionId === 'undefined') {
|
|
6363
6382
|
throw new AgentbaseException('Missing required parameter: "functionId"');
|
|
6364
6383
|
}
|
|
@@ -6376,6 +6395,12 @@ class Functions {
|
|
|
6376
6395
|
if (typeof total !== 'undefined') {
|
|
6377
6396
|
payload['total'] = total;
|
|
6378
6397
|
}
|
|
6398
|
+
if (typeof pathMatch !== 'undefined') {
|
|
6399
|
+
payload['pathMatch'] = pathMatch;
|
|
6400
|
+
}
|
|
6401
|
+
if (typeof method !== 'undefined') {
|
|
6402
|
+
payload['method'] = method;
|
|
6403
|
+
}
|
|
6379
6404
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
6380
6405
|
const apiHeaders = {
|
|
6381
6406
|
'X-Appwrite-Project': this.client.config.project,
|
|
@@ -6391,12 +6416,18 @@ class Functions {
|
|
|
6391
6416
|
params = {
|
|
6392
6417
|
functionId: paramsOrFirst,
|
|
6393
6418
|
queries: rest[0],
|
|
6394
|
-
total: rest[1]
|
|
6419
|
+
total: rest[1],
|
|
6420
|
+
xpath: rest[2],
|
|
6421
|
+
pathMatch: rest[3],
|
|
6422
|
+
method: rest[4]
|
|
6395
6423
|
};
|
|
6396
6424
|
}
|
|
6397
6425
|
const functionId = params.functionId;
|
|
6398
6426
|
const queries = params.queries;
|
|
6399
6427
|
const total = params.total;
|
|
6428
|
+
const xpath = params.xpath;
|
|
6429
|
+
const pathMatch = params.pathMatch;
|
|
6430
|
+
const method = params.method;
|
|
6400
6431
|
if (typeof functionId === 'undefined') {
|
|
6401
6432
|
throw new AgentbaseException('Missing required parameter: "functionId"');
|
|
6402
6433
|
}
|
|
@@ -6408,6 +6439,15 @@ class Functions {
|
|
|
6408
6439
|
if (typeof total !== 'undefined') {
|
|
6409
6440
|
payload['total'] = total;
|
|
6410
6441
|
}
|
|
6442
|
+
if (typeof xpath !== 'undefined') {
|
|
6443
|
+
payload['path'] = xpath;
|
|
6444
|
+
}
|
|
6445
|
+
if (typeof pathMatch !== 'undefined') {
|
|
6446
|
+
payload['pathMatch'] = pathMatch;
|
|
6447
|
+
}
|
|
6448
|
+
if (typeof method !== 'undefined') {
|
|
6449
|
+
payload['method'] = method;
|
|
6450
|
+
}
|
|
6411
6451
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
6412
6452
|
const apiHeaders = {
|
|
6413
6453
|
'X-Appwrite-Project': this.client.config.project,
|
|
@@ -7273,25 +7313,29 @@ class Memory {
|
|
|
7273
7313
|
scope: rest[0],
|
|
7274
7314
|
memoryType: rest[1],
|
|
7275
7315
|
recordKind: rest[2],
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7316
|
+
pipelineId: rest[3],
|
|
7317
|
+
content: rest[4],
|
|
7318
|
+
messages: rest[5],
|
|
7319
|
+
media: rest[6],
|
|
7320
|
+
agentId: rest[7],
|
|
7321
|
+
runId: rest[8],
|
|
7322
|
+
sessionId: rest[9],
|
|
7323
|
+
sensitivity: rest[10],
|
|
7324
|
+
handlingPolicy: rest[11],
|
|
7325
|
+
metadata: rest[12],
|
|
7326
|
+
infer: rest[13],
|
|
7327
|
+
reRemember: rest[14],
|
|
7328
|
+
async: rest[15]
|
|
7287
7329
|
};
|
|
7288
7330
|
}
|
|
7289
7331
|
const userId = params.userId;
|
|
7290
7332
|
const scope = params.scope;
|
|
7291
7333
|
const memoryType = params.memoryType;
|
|
7292
7334
|
const recordKind = params.recordKind;
|
|
7335
|
+
const pipelineId = params.pipelineId;
|
|
7293
7336
|
const content = params.content;
|
|
7294
7337
|
const messages = params.messages;
|
|
7338
|
+
const media = params.media;
|
|
7295
7339
|
const agentId = params.agentId;
|
|
7296
7340
|
const runId = params.runId;
|
|
7297
7341
|
const sessionId = params.sessionId;
|
|
@@ -7315,12 +7359,18 @@ class Memory {
|
|
|
7315
7359
|
}
|
|
7316
7360
|
const apiPath = '/memory/memories';
|
|
7317
7361
|
const payload = {};
|
|
7362
|
+
if (typeof pipelineId !== 'undefined') {
|
|
7363
|
+
payload['pipelineId'] = pipelineId;
|
|
7364
|
+
}
|
|
7318
7365
|
if (typeof content !== 'undefined') {
|
|
7319
7366
|
payload['content'] = content;
|
|
7320
7367
|
}
|
|
7321
7368
|
if (typeof messages !== 'undefined') {
|
|
7322
7369
|
payload['messages'] = messages;
|
|
7323
7370
|
}
|
|
7371
|
+
if (typeof media !== 'undefined') {
|
|
7372
|
+
payload['media'] = media;
|
|
7373
|
+
}
|
|
7324
7374
|
if (typeof userId !== 'undefined') {
|
|
7325
7375
|
payload['userId'] = userId;
|
|
7326
7376
|
}
|
|
@@ -7375,12 +7425,14 @@ class Memory {
|
|
|
7375
7425
|
else {
|
|
7376
7426
|
params = {
|
|
7377
7427
|
userId: paramsOrFirst,
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
|
|
7428
|
+
memorySubStoreId: rest[0],
|
|
7429
|
+
limit: rest[1],
|
|
7430
|
+
reason: rest[2],
|
|
7431
|
+
source: rest[3]
|
|
7381
7432
|
};
|
|
7382
7433
|
}
|
|
7383
7434
|
const userId = params.userId;
|
|
7435
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
7384
7436
|
const limit = params.limit;
|
|
7385
7437
|
const reason = params.reason;
|
|
7386
7438
|
const source = params.source;
|
|
@@ -7389,6 +7441,9 @@ class Memory {
|
|
|
7389
7441
|
if (typeof userId !== 'undefined') {
|
|
7390
7442
|
payload['userId'] = userId;
|
|
7391
7443
|
}
|
|
7444
|
+
if (typeof memorySubStoreId !== 'undefined') {
|
|
7445
|
+
payload['memorySubStoreId'] = memorySubStoreId;
|
|
7446
|
+
}
|
|
7392
7447
|
if (typeof limit !== 'undefined') {
|
|
7393
7448
|
payload['limit'] = limit;
|
|
7394
7449
|
}
|
|
@@ -7916,7 +7971,7 @@ class Memory {
|
|
|
7916
7971
|
}
|
|
7917
7972
|
submitDistillation(paramsOrFirst, ...rest) {
|
|
7918
7973
|
let params;
|
|
7919
|
-
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))) {
|
|
7974
|
+
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))) {
|
|
7920
7975
|
params = (paramsOrFirst || {});
|
|
7921
7976
|
}
|
|
7922
7977
|
else {
|
|
@@ -7927,12 +7982,13 @@ class Memory {
|
|
|
7927
7982
|
sessionId: rest[2],
|
|
7928
7983
|
runId: rest[3],
|
|
7929
7984
|
memorySubStoreId: rest[4],
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7985
|
+
pipelineId: rest[5],
|
|
7986
|
+
sourceId: rest[6],
|
|
7987
|
+
sourceType: rest[7],
|
|
7988
|
+
messages: rest[8],
|
|
7989
|
+
toolEvents: rest[9],
|
|
7990
|
+
mode: rest[10],
|
|
7991
|
+
idempotencyKey: rest[11]
|
|
7936
7992
|
};
|
|
7937
7993
|
}
|
|
7938
7994
|
const scope = params.scope;
|
|
@@ -7941,6 +7997,7 @@ class Memory {
|
|
|
7941
7997
|
const sessionId = params.sessionId;
|
|
7942
7998
|
const runId = params.runId;
|
|
7943
7999
|
const memorySubStoreId = params.memorySubStoreId;
|
|
8000
|
+
const pipelineId = params.pipelineId;
|
|
7944
8001
|
const sourceId = params.sourceId;
|
|
7945
8002
|
const sourceType = params.sourceType;
|
|
7946
8003
|
const messages = params.messages;
|
|
@@ -7967,6 +8024,9 @@ class Memory {
|
|
|
7967
8024
|
if (typeof memorySubStoreId !== 'undefined') {
|
|
7968
8025
|
payload['memorySubStoreId'] = memorySubStoreId;
|
|
7969
8026
|
}
|
|
8027
|
+
if (typeof pipelineId !== 'undefined') {
|
|
8028
|
+
payload['pipelineId'] = pipelineId;
|
|
8029
|
+
}
|
|
7970
8030
|
if (typeof sourceId !== 'undefined') {
|
|
7971
8031
|
payload['sourceId'] = sourceId;
|
|
7972
8032
|
}
|
|
@@ -8560,13 +8620,15 @@ class Memory {
|
|
|
8560
8620
|
else {
|
|
8561
8621
|
params = {
|
|
8562
8622
|
userId: paramsOrFirst,
|
|
8563
|
-
|
|
8564
|
-
|
|
8565
|
-
|
|
8566
|
-
|
|
8623
|
+
pipelineId: rest[0],
|
|
8624
|
+
format: rest[1],
|
|
8625
|
+
data: rest[2],
|
|
8626
|
+
records: rest[3],
|
|
8627
|
+
dryRun: rest[4]
|
|
8567
8628
|
};
|
|
8568
8629
|
}
|
|
8569
8630
|
const userId = params.userId;
|
|
8631
|
+
const pipelineId = params.pipelineId;
|
|
8570
8632
|
const format = params.format;
|
|
8571
8633
|
const data = params.data;
|
|
8572
8634
|
const records = params.records;
|
|
@@ -8576,6 +8638,9 @@ class Memory {
|
|
|
8576
8638
|
}
|
|
8577
8639
|
const apiPath = '/memory/memories/imports';
|
|
8578
8640
|
const payload = {};
|
|
8641
|
+
if (typeof pipelineId !== 'undefined') {
|
|
8642
|
+
payload['pipelineId'] = pipelineId;
|
|
8643
|
+
}
|
|
8579
8644
|
if (typeof userId !== 'undefined') {
|
|
8580
8645
|
payload['userId'] = userId;
|
|
8581
8646
|
}
|
|
@@ -8620,6 +8685,125 @@ class Memory {
|
|
|
8620
8685
|
};
|
|
8621
8686
|
return this.client.call('get', uri, apiHeaders, payload);
|
|
8622
8687
|
}
|
|
8688
|
+
listKnowledgeReviews(paramsOrFirst, ...rest) {
|
|
8689
|
+
let params;
|
|
8690
|
+
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))) {
|
|
8691
|
+
params = (paramsOrFirst || {});
|
|
8692
|
+
}
|
|
8693
|
+
else {
|
|
8694
|
+
params = {
|
|
8695
|
+
scope: paramsOrFirst,
|
|
8696
|
+
userId: rest[0],
|
|
8697
|
+
agentId: rest[1],
|
|
8698
|
+
sessionId: rest[2],
|
|
8699
|
+
runId: rest[3],
|
|
8700
|
+
memorySubStoreId: rest[4],
|
|
8701
|
+
limit: rest[5],
|
|
8702
|
+
offset: rest[6],
|
|
8703
|
+
status: rest[7],
|
|
8704
|
+
knowledgeId: rest[8]
|
|
8705
|
+
};
|
|
8706
|
+
}
|
|
8707
|
+
const scope = params.scope;
|
|
8708
|
+
const userId = params.userId;
|
|
8709
|
+
const agentId = params.agentId;
|
|
8710
|
+
const sessionId = params.sessionId;
|
|
8711
|
+
const runId = params.runId;
|
|
8712
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
8713
|
+
const limit = params.limit;
|
|
8714
|
+
const offset = params.offset;
|
|
8715
|
+
const status = params.status;
|
|
8716
|
+
const knowledgeId = params.knowledgeId;
|
|
8717
|
+
const apiPath = '/memory/memories/knowledge/reviews';
|
|
8718
|
+
const payload = {};
|
|
8719
|
+
if (typeof scope !== 'undefined') {
|
|
8720
|
+
payload['scope'] = scope;
|
|
8721
|
+
}
|
|
8722
|
+
if (typeof userId !== 'undefined') {
|
|
8723
|
+
payload['userId'] = userId;
|
|
8724
|
+
}
|
|
8725
|
+
if (typeof agentId !== 'undefined') {
|
|
8726
|
+
payload['agentId'] = agentId;
|
|
8727
|
+
}
|
|
8728
|
+
if (typeof sessionId !== 'undefined') {
|
|
8729
|
+
payload['sessionId'] = sessionId;
|
|
8730
|
+
}
|
|
8731
|
+
if (typeof runId !== 'undefined') {
|
|
8732
|
+
payload['runId'] = runId;
|
|
8733
|
+
}
|
|
8734
|
+
if (typeof memorySubStoreId !== 'undefined') {
|
|
8735
|
+
payload['memorySubStoreId'] = memorySubStoreId;
|
|
8736
|
+
}
|
|
8737
|
+
if (typeof limit !== 'undefined') {
|
|
8738
|
+
payload['limit'] = limit;
|
|
8739
|
+
}
|
|
8740
|
+
if (typeof offset !== 'undefined') {
|
|
8741
|
+
payload['offset'] = offset;
|
|
8742
|
+
}
|
|
8743
|
+
if (typeof status !== 'undefined') {
|
|
8744
|
+
payload['status'] = status;
|
|
8745
|
+
}
|
|
8746
|
+
if (typeof knowledgeId !== 'undefined') {
|
|
8747
|
+
payload['knowledgeId'] = knowledgeId;
|
|
8748
|
+
}
|
|
8749
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
8750
|
+
const apiHeaders = {
|
|
8751
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
8752
|
+
};
|
|
8753
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
8754
|
+
}
|
|
8755
|
+
getKnowledgeReview(paramsOrFirst, ...rest) {
|
|
8756
|
+
let params;
|
|
8757
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
8758
|
+
params = (paramsOrFirst || {});
|
|
8759
|
+
}
|
|
8760
|
+
else {
|
|
8761
|
+
params = {
|
|
8762
|
+
reviewId: paramsOrFirst,
|
|
8763
|
+
scope: rest[0],
|
|
8764
|
+
userId: rest[1],
|
|
8765
|
+
agentId: rest[2],
|
|
8766
|
+
sessionId: rest[3],
|
|
8767
|
+
runId: rest[4],
|
|
8768
|
+
memorySubStoreId: rest[5]
|
|
8769
|
+
};
|
|
8770
|
+
}
|
|
8771
|
+
const reviewId = params.reviewId;
|
|
8772
|
+
const scope = params.scope;
|
|
8773
|
+
const userId = params.userId;
|
|
8774
|
+
const agentId = params.agentId;
|
|
8775
|
+
const sessionId = params.sessionId;
|
|
8776
|
+
const runId = params.runId;
|
|
8777
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
8778
|
+
if (typeof reviewId === 'undefined') {
|
|
8779
|
+
throw new AgentbaseException('Missing required parameter: "reviewId"');
|
|
8780
|
+
}
|
|
8781
|
+
const apiPath = '/memory/memories/knowledge/reviews/{reviewId}'.replace('{reviewId}', reviewId);
|
|
8782
|
+
const payload = {};
|
|
8783
|
+
if (typeof scope !== 'undefined') {
|
|
8784
|
+
payload['scope'] = scope;
|
|
8785
|
+
}
|
|
8786
|
+
if (typeof userId !== 'undefined') {
|
|
8787
|
+
payload['userId'] = userId;
|
|
8788
|
+
}
|
|
8789
|
+
if (typeof agentId !== 'undefined') {
|
|
8790
|
+
payload['agentId'] = agentId;
|
|
8791
|
+
}
|
|
8792
|
+
if (typeof sessionId !== 'undefined') {
|
|
8793
|
+
payload['sessionId'] = sessionId;
|
|
8794
|
+
}
|
|
8795
|
+
if (typeof runId !== 'undefined') {
|
|
8796
|
+
payload['runId'] = runId;
|
|
8797
|
+
}
|
|
8798
|
+
if (typeof memorySubStoreId !== 'undefined') {
|
|
8799
|
+
payload['memorySubStoreId'] = memorySubStoreId;
|
|
8800
|
+
}
|
|
8801
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
8802
|
+
const apiHeaders = {
|
|
8803
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
8804
|
+
};
|
|
8805
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
8806
|
+
}
|
|
8623
8807
|
updateKnowledge(paramsOrFirst, ...rest) {
|
|
8624
8808
|
let params;
|
|
8625
8809
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
@@ -8723,10 +8907,193 @@ class Memory {
|
|
|
8723
8907
|
if (typeof knowledgeId === 'undefined') {
|
|
8724
8908
|
throw new AgentbaseException('Missing required parameter: "knowledgeId"');
|
|
8725
8909
|
}
|
|
8726
|
-
if (typeof expectedVersion === 'undefined') {
|
|
8727
|
-
throw new AgentbaseException('Missing required parameter: "expectedVersion"');
|
|
8728
|
-
}
|
|
8729
|
-
const apiPath = '/memory/memories/knowledge/{knowledgeId}'.replace('{knowledgeId}', knowledgeId);
|
|
8910
|
+
if (typeof expectedVersion === 'undefined') {
|
|
8911
|
+
throw new AgentbaseException('Missing required parameter: "expectedVersion"');
|
|
8912
|
+
}
|
|
8913
|
+
const apiPath = '/memory/memories/knowledge/{knowledgeId}'.replace('{knowledgeId}', knowledgeId);
|
|
8914
|
+
const payload = {};
|
|
8915
|
+
if (typeof scope !== 'undefined') {
|
|
8916
|
+
payload['scope'] = scope;
|
|
8917
|
+
}
|
|
8918
|
+
if (typeof userId !== 'undefined') {
|
|
8919
|
+
payload['userId'] = userId;
|
|
8920
|
+
}
|
|
8921
|
+
if (typeof agentId !== 'undefined') {
|
|
8922
|
+
payload['agentId'] = agentId;
|
|
8923
|
+
}
|
|
8924
|
+
if (typeof sessionId !== 'undefined') {
|
|
8925
|
+
payload['sessionId'] = sessionId;
|
|
8926
|
+
}
|
|
8927
|
+
if (typeof runId !== 'undefined') {
|
|
8928
|
+
payload['runId'] = runId;
|
|
8929
|
+
}
|
|
8930
|
+
if (typeof memorySubStoreId !== 'undefined') {
|
|
8931
|
+
payload['memorySubStoreId'] = memorySubStoreId;
|
|
8932
|
+
}
|
|
8933
|
+
if (typeof expectedVersion !== 'undefined') {
|
|
8934
|
+
payload['expectedVersion'] = expectedVersion;
|
|
8935
|
+
}
|
|
8936
|
+
if (typeof reason !== 'undefined') {
|
|
8937
|
+
payload['reason'] = reason;
|
|
8938
|
+
}
|
|
8939
|
+
if (typeof source !== 'undefined') {
|
|
8940
|
+
payload['source'] = source;
|
|
8941
|
+
}
|
|
8942
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
8943
|
+
const apiHeaders = {
|
|
8944
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
8945
|
+
'content-type': 'application/json',
|
|
8946
|
+
};
|
|
8947
|
+
return this.client.call('delete', uri, apiHeaders, payload);
|
|
8948
|
+
}
|
|
8949
|
+
getKnowledgeDiff(paramsOrFirst, ...rest) {
|
|
8950
|
+
let params;
|
|
8951
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
8952
|
+
params = (paramsOrFirst || {});
|
|
8953
|
+
}
|
|
8954
|
+
else {
|
|
8955
|
+
params = {
|
|
8956
|
+
knowledgeId: paramsOrFirst,
|
|
8957
|
+
toRevisionId: rest[0],
|
|
8958
|
+
scope: rest[1],
|
|
8959
|
+
userId: rest[2],
|
|
8960
|
+
agentId: rest[3],
|
|
8961
|
+
sessionId: rest[4],
|
|
8962
|
+
runId: rest[5],
|
|
8963
|
+
memorySubStoreId: rest[6],
|
|
8964
|
+
fromRevisionId: rest[7]
|
|
8965
|
+
};
|
|
8966
|
+
}
|
|
8967
|
+
const knowledgeId = params.knowledgeId;
|
|
8968
|
+
const toRevisionId = params.toRevisionId;
|
|
8969
|
+
const scope = params.scope;
|
|
8970
|
+
const userId = params.userId;
|
|
8971
|
+
const agentId = params.agentId;
|
|
8972
|
+
const sessionId = params.sessionId;
|
|
8973
|
+
const runId = params.runId;
|
|
8974
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
8975
|
+
const fromRevisionId = params.fromRevisionId;
|
|
8976
|
+
if (typeof knowledgeId === 'undefined') {
|
|
8977
|
+
throw new AgentbaseException('Missing required parameter: "knowledgeId"');
|
|
8978
|
+
}
|
|
8979
|
+
if (typeof toRevisionId === 'undefined') {
|
|
8980
|
+
throw new AgentbaseException('Missing required parameter: "toRevisionId"');
|
|
8981
|
+
}
|
|
8982
|
+
const apiPath = '/memory/memories/knowledge/{knowledgeId}/diff'.replace('{knowledgeId}', knowledgeId);
|
|
8983
|
+
const payload = {};
|
|
8984
|
+
if (typeof scope !== 'undefined') {
|
|
8985
|
+
payload['scope'] = scope;
|
|
8986
|
+
}
|
|
8987
|
+
if (typeof userId !== 'undefined') {
|
|
8988
|
+
payload['userId'] = userId;
|
|
8989
|
+
}
|
|
8990
|
+
if (typeof agentId !== 'undefined') {
|
|
8991
|
+
payload['agentId'] = agentId;
|
|
8992
|
+
}
|
|
8993
|
+
if (typeof sessionId !== 'undefined') {
|
|
8994
|
+
payload['sessionId'] = sessionId;
|
|
8995
|
+
}
|
|
8996
|
+
if (typeof runId !== 'undefined') {
|
|
8997
|
+
payload['runId'] = runId;
|
|
8998
|
+
}
|
|
8999
|
+
if (typeof memorySubStoreId !== 'undefined') {
|
|
9000
|
+
payload['memorySubStoreId'] = memorySubStoreId;
|
|
9001
|
+
}
|
|
9002
|
+
if (typeof fromRevisionId !== 'undefined') {
|
|
9003
|
+
payload['fromRevisionId'] = fromRevisionId;
|
|
9004
|
+
}
|
|
9005
|
+
if (typeof toRevisionId !== 'undefined') {
|
|
9006
|
+
payload['toRevisionId'] = toRevisionId;
|
|
9007
|
+
}
|
|
9008
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
9009
|
+
const apiHeaders = {
|
|
9010
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
9011
|
+
};
|
|
9012
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
9013
|
+
}
|
|
9014
|
+
listKnowledgeEvents(paramsOrFirst, ...rest) {
|
|
9015
|
+
let params;
|
|
9016
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
9017
|
+
params = (paramsOrFirst || {});
|
|
9018
|
+
}
|
|
9019
|
+
else {
|
|
9020
|
+
params = {
|
|
9021
|
+
knowledgeId: paramsOrFirst,
|
|
9022
|
+
scope: rest[0],
|
|
9023
|
+
userId: rest[1],
|
|
9024
|
+
agentId: rest[2],
|
|
9025
|
+
sessionId: rest[3],
|
|
9026
|
+
runId: rest[4],
|
|
9027
|
+
memorySubStoreId: rest[5]
|
|
9028
|
+
};
|
|
9029
|
+
}
|
|
9030
|
+
const knowledgeId = params.knowledgeId;
|
|
9031
|
+
const scope = params.scope;
|
|
9032
|
+
const userId = params.userId;
|
|
9033
|
+
const agentId = params.agentId;
|
|
9034
|
+
const sessionId = params.sessionId;
|
|
9035
|
+
const runId = params.runId;
|
|
9036
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
9037
|
+
if (typeof knowledgeId === 'undefined') {
|
|
9038
|
+
throw new AgentbaseException('Missing required parameter: "knowledgeId"');
|
|
9039
|
+
}
|
|
9040
|
+
const apiPath = '/memory/memories/knowledge/{knowledgeId}/events'.replace('{knowledgeId}', knowledgeId);
|
|
9041
|
+
const payload = {};
|
|
9042
|
+
if (typeof scope !== 'undefined') {
|
|
9043
|
+
payload['scope'] = scope;
|
|
9044
|
+
}
|
|
9045
|
+
if (typeof userId !== 'undefined') {
|
|
9046
|
+
payload['userId'] = userId;
|
|
9047
|
+
}
|
|
9048
|
+
if (typeof agentId !== 'undefined') {
|
|
9049
|
+
payload['agentId'] = agentId;
|
|
9050
|
+
}
|
|
9051
|
+
if (typeof sessionId !== 'undefined') {
|
|
9052
|
+
payload['sessionId'] = sessionId;
|
|
9053
|
+
}
|
|
9054
|
+
if (typeof runId !== 'undefined') {
|
|
9055
|
+
payload['runId'] = runId;
|
|
9056
|
+
}
|
|
9057
|
+
if (typeof memorySubStoreId !== 'undefined') {
|
|
9058
|
+
payload['memorySubStoreId'] = memorySubStoreId;
|
|
9059
|
+
}
|
|
9060
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
9061
|
+
const apiHeaders = {
|
|
9062
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
9063
|
+
};
|
|
9064
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
9065
|
+
}
|
|
9066
|
+
listKnowledgeRevisions(paramsOrFirst, ...rest) {
|
|
9067
|
+
let params;
|
|
9068
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
9069
|
+
params = (paramsOrFirst || {});
|
|
9070
|
+
}
|
|
9071
|
+
else {
|
|
9072
|
+
params = {
|
|
9073
|
+
knowledgeId: paramsOrFirst,
|
|
9074
|
+
scope: rest[0],
|
|
9075
|
+
userId: rest[1],
|
|
9076
|
+
agentId: rest[2],
|
|
9077
|
+
sessionId: rest[3],
|
|
9078
|
+
runId: rest[4],
|
|
9079
|
+
memorySubStoreId: rest[5],
|
|
9080
|
+
limit: rest[6],
|
|
9081
|
+
offset: rest[7]
|
|
9082
|
+
};
|
|
9083
|
+
}
|
|
9084
|
+
const knowledgeId = params.knowledgeId;
|
|
9085
|
+
const scope = params.scope;
|
|
9086
|
+
const userId = params.userId;
|
|
9087
|
+
const agentId = params.agentId;
|
|
9088
|
+
const sessionId = params.sessionId;
|
|
9089
|
+
const runId = params.runId;
|
|
9090
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
9091
|
+
const limit = params.limit;
|
|
9092
|
+
const offset = params.offset;
|
|
9093
|
+
if (typeof knowledgeId === 'undefined') {
|
|
9094
|
+
throw new AgentbaseException('Missing required parameter: "knowledgeId"');
|
|
9095
|
+
}
|
|
9096
|
+
const apiPath = '/memory/memories/knowledge/{knowledgeId}/revisions'.replace('{knowledgeId}', knowledgeId);
|
|
8730
9097
|
const payload = {};
|
|
8731
9098
|
if (typeof scope !== 'undefined') {
|
|
8732
9099
|
payload['scope'] = scope;
|
|
@@ -8746,21 +9113,17 @@ class Memory {
|
|
|
8746
9113
|
if (typeof memorySubStoreId !== 'undefined') {
|
|
8747
9114
|
payload['memorySubStoreId'] = memorySubStoreId;
|
|
8748
9115
|
}
|
|
8749
|
-
if (typeof
|
|
8750
|
-
payload['
|
|
8751
|
-
}
|
|
8752
|
-
if (typeof reason !== 'undefined') {
|
|
8753
|
-
payload['reason'] = reason;
|
|
9116
|
+
if (typeof limit !== 'undefined') {
|
|
9117
|
+
payload['limit'] = limit;
|
|
8754
9118
|
}
|
|
8755
|
-
if (typeof
|
|
8756
|
-
payload['
|
|
9119
|
+
if (typeof offset !== 'undefined') {
|
|
9120
|
+
payload['offset'] = offset;
|
|
8757
9121
|
}
|
|
8758
9122
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
8759
9123
|
const apiHeaders = {
|
|
8760
9124
|
'X-Appwrite-Project': this.client.config.project,
|
|
8761
|
-
'content-type': 'application/json',
|
|
8762
9125
|
};
|
|
8763
|
-
return this.client.call('
|
|
9126
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
8764
9127
|
}
|
|
8765
9128
|
createKnowledgeObservation(paramsOrFirst, ...rest) {
|
|
8766
9129
|
let params;
|
|
@@ -8990,7 +9353,7 @@ class Memory {
|
|
|
8990
9353
|
}
|
|
8991
9354
|
search(paramsOrFirst, ...rest) {
|
|
8992
9355
|
let params;
|
|
8993
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
9356
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
8994
9357
|
params = (paramsOrFirst || {});
|
|
8995
9358
|
}
|
|
8996
9359
|
else {
|
|
@@ -8998,25 +9361,27 @@ class Memory {
|
|
|
8998
9361
|
query: paramsOrFirst,
|
|
8999
9362
|
searchMode: rest[0],
|
|
9000
9363
|
retrieval: rest[1],
|
|
9001
|
-
|
|
9002
|
-
|
|
9003
|
-
|
|
9004
|
-
|
|
9005
|
-
|
|
9006
|
-
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
|
|
9364
|
+
media: rest[2],
|
|
9365
|
+
userId: rest[3],
|
|
9366
|
+
agentId: rest[4],
|
|
9367
|
+
runId: rest[5],
|
|
9368
|
+
scope: rest[6],
|
|
9369
|
+
memoryType: rest[7],
|
|
9370
|
+
recordKind: rest[8],
|
|
9371
|
+
filter: rest[9],
|
|
9372
|
+
limit: rest[10],
|
|
9373
|
+
cursor: rest[11],
|
|
9374
|
+
sort: rest[12],
|
|
9375
|
+
memorySubStoreId: rest[13],
|
|
9376
|
+
sessionId: rest[14],
|
|
9377
|
+
groupId: rest[15],
|
|
9378
|
+
accessMode: rest[16]
|
|
9015
9379
|
};
|
|
9016
9380
|
}
|
|
9017
9381
|
const query = params.query;
|
|
9018
9382
|
const searchMode = params.searchMode;
|
|
9019
9383
|
const retrieval = params.retrieval;
|
|
9384
|
+
const media = params.media;
|
|
9020
9385
|
const userId = params.userId;
|
|
9021
9386
|
const agentId = params.agentId;
|
|
9022
9387
|
const runId = params.runId;
|
|
@@ -9031,9 +9396,6 @@ class Memory {
|
|
|
9031
9396
|
const sessionId = params.sessionId;
|
|
9032
9397
|
const groupId = params.groupId;
|
|
9033
9398
|
const accessMode = params.accessMode;
|
|
9034
|
-
if (typeof query === 'undefined') {
|
|
9035
|
-
throw new AgentbaseException('Missing required parameter: "query"');
|
|
9036
|
-
}
|
|
9037
9399
|
const apiPath = '/memory/memories/search';
|
|
9038
9400
|
const payload = {};
|
|
9039
9401
|
if (typeof query !== 'undefined') {
|
|
@@ -9045,6 +9407,9 @@ class Memory {
|
|
|
9045
9407
|
if (typeof retrieval !== 'undefined') {
|
|
9046
9408
|
payload['retrieval'] = retrieval;
|
|
9047
9409
|
}
|
|
9410
|
+
if (typeof media !== 'undefined') {
|
|
9411
|
+
payload['media'] = media;
|
|
9412
|
+
}
|
|
9048
9413
|
if (typeof userId !== 'undefined') {
|
|
9049
9414
|
payload['userId'] = userId;
|
|
9050
9415
|
}
|
|
@@ -9454,14 +9819,16 @@ class Memory {
|
|
|
9454
9819
|
else {
|
|
9455
9820
|
params = {
|
|
9456
9821
|
userId: paramsOrFirst,
|
|
9457
|
-
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
|
|
9461
|
-
|
|
9822
|
+
pipelineId: rest[0],
|
|
9823
|
+
profileType: rest[1],
|
|
9824
|
+
messages: rest[2],
|
|
9825
|
+
sourceMemoryIds: rest[3],
|
|
9826
|
+
sessionId: rest[4],
|
|
9827
|
+
mode: rest[5]
|
|
9462
9828
|
};
|
|
9463
9829
|
}
|
|
9464
9830
|
const userId = params.userId;
|
|
9831
|
+
const pipelineId = params.pipelineId;
|
|
9465
9832
|
const profileType = params.profileType;
|
|
9466
9833
|
const messages = params.messages;
|
|
9467
9834
|
const sourceMemoryIds = params.sourceMemoryIds;
|
|
@@ -9472,6 +9839,9 @@ class Memory {
|
|
|
9472
9839
|
}
|
|
9473
9840
|
const apiPath = '/memory/memories/users/{userId}/profile/extractions'.replace('{userId}', userId);
|
|
9474
9841
|
const payload = {};
|
|
9842
|
+
if (typeof pipelineId !== 'undefined') {
|
|
9843
|
+
payload['pipelineId'] = pipelineId;
|
|
9844
|
+
}
|
|
9475
9845
|
if (typeof profileType !== 'undefined') {
|
|
9476
9846
|
payload['profileType'] = profileType;
|
|
9477
9847
|
}
|
|
@@ -9502,16 +9872,21 @@ class Memory {
|
|
|
9502
9872
|
else {
|
|
9503
9873
|
params = {
|
|
9504
9874
|
userId: paramsOrFirst,
|
|
9505
|
-
|
|
9875
|
+
pipelineId: rest[0],
|
|
9876
|
+
profileType: rest[1]
|
|
9506
9877
|
};
|
|
9507
9878
|
}
|
|
9508
9879
|
const userId = params.userId;
|
|
9880
|
+
const pipelineId = params.pipelineId;
|
|
9509
9881
|
const profileType = params.profileType;
|
|
9510
9882
|
if (typeof userId === 'undefined') {
|
|
9511
9883
|
throw new AgentbaseException('Missing required parameter: "userId"');
|
|
9512
9884
|
}
|
|
9513
9885
|
const apiPath = '/memory/memories/users/{userId}/profile/rebuild'.replace('{userId}', userId);
|
|
9514
9886
|
const payload = {};
|
|
9887
|
+
if (typeof pipelineId !== 'undefined') {
|
|
9888
|
+
payload['pipelineId'] = pipelineId;
|
|
9889
|
+
}
|
|
9515
9890
|
if (typeof profileType !== 'undefined') {
|
|
9516
9891
|
payload['profileType'] = profileType;
|
|
9517
9892
|
}
|
|
@@ -9625,11 +10000,13 @@ class Memory {
|
|
|
9625
10000
|
else {
|
|
9626
10001
|
params = {
|
|
9627
10002
|
memoryId: paramsOrFirst,
|
|
9628
|
-
|
|
9629
|
-
|
|
10003
|
+
memorySubStoreId: rest[0],
|
|
10004
|
+
reason: rest[1],
|
|
10005
|
+
source: rest[2]
|
|
9630
10006
|
};
|
|
9631
10007
|
}
|
|
9632
10008
|
const memoryId = params.memoryId;
|
|
10009
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
9633
10010
|
const reason = params.reason;
|
|
9634
10011
|
const source = params.source;
|
|
9635
10012
|
if (typeof memoryId === 'undefined') {
|
|
@@ -9637,6 +10014,9 @@ class Memory {
|
|
|
9637
10014
|
}
|
|
9638
10015
|
const apiPath = '/memory/memories/{memoryId}'.replace('{memoryId}', memoryId);
|
|
9639
10016
|
const payload = {};
|
|
10017
|
+
if (typeof memorySubStoreId !== 'undefined') {
|
|
10018
|
+
payload['memorySubStoreId'] = memorySubStoreId;
|
|
10019
|
+
}
|
|
9640
10020
|
if (typeof reason !== 'undefined') {
|
|
9641
10021
|
payload['reason'] = reason;
|
|
9642
10022
|
}
|
|
@@ -9776,6 +10156,340 @@ class Memory {
|
|
|
9776
10156
|
};
|
|
9777
10157
|
return this.client.call('get', uri, apiHeaders, payload);
|
|
9778
10158
|
}
|
|
10159
|
+
listPipelines(paramsOrFirst) {
|
|
10160
|
+
let params;
|
|
10161
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('scenario' in paramsOrFirst))) {
|
|
10162
|
+
params = (paramsOrFirst || {});
|
|
10163
|
+
}
|
|
10164
|
+
else {
|
|
10165
|
+
params = {
|
|
10166
|
+
scenario: paramsOrFirst
|
|
10167
|
+
};
|
|
10168
|
+
}
|
|
10169
|
+
const scenario = params.scenario;
|
|
10170
|
+
const apiPath = '/memory/pipelines';
|
|
10171
|
+
const payload = {};
|
|
10172
|
+
if (typeof scenario !== 'undefined') {
|
|
10173
|
+
payload['scenario'] = scenario;
|
|
10174
|
+
}
|
|
10175
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
10176
|
+
const apiHeaders = {
|
|
10177
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
10178
|
+
};
|
|
10179
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
10180
|
+
}
|
|
10181
|
+
createPipeline(paramsOrFirst, ...rest) {
|
|
10182
|
+
let params;
|
|
10183
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('scenario' in paramsOrFirst || 'fromDefaults' in paramsOrFirst || 'config' in paramsOrFirst))) {
|
|
10184
|
+
params = (paramsOrFirst || {});
|
|
10185
|
+
}
|
|
10186
|
+
else {
|
|
10187
|
+
params = {
|
|
10188
|
+
scenario: paramsOrFirst,
|
|
10189
|
+
fromDefaults: rest[0],
|
|
10190
|
+
config: rest[1]
|
|
10191
|
+
};
|
|
10192
|
+
}
|
|
10193
|
+
const scenario = params.scenario;
|
|
10194
|
+
const fromDefaults = params.fromDefaults;
|
|
10195
|
+
const config = params.config;
|
|
10196
|
+
const apiPath = '/memory/pipelines';
|
|
10197
|
+
const payload = {};
|
|
10198
|
+
if (typeof scenario !== 'undefined') {
|
|
10199
|
+
payload['scenario'] = scenario;
|
|
10200
|
+
}
|
|
10201
|
+
if (typeof fromDefaults !== 'undefined') {
|
|
10202
|
+
payload['fromDefaults'] = fromDefaults;
|
|
10203
|
+
}
|
|
10204
|
+
if (typeof config !== 'undefined') {
|
|
10205
|
+
payload['config'] = config;
|
|
10206
|
+
}
|
|
10207
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
10208
|
+
const apiHeaders = {
|
|
10209
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
10210
|
+
'content-type': 'application/json',
|
|
10211
|
+
};
|
|
10212
|
+
return this.client.call('post', uri, apiHeaders, payload);
|
|
10213
|
+
}
|
|
10214
|
+
setDefaultPipeline(paramsOrFirst, ...rest) {
|
|
10215
|
+
let params;
|
|
10216
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('scenario' in paramsOrFirst || 'pipelineId' in paramsOrFirst || 'expectedRevision' in paramsOrFirst))) {
|
|
10217
|
+
params = (paramsOrFirst || {});
|
|
10218
|
+
}
|
|
10219
|
+
else {
|
|
10220
|
+
params = {
|
|
10221
|
+
scenario: paramsOrFirst,
|
|
10222
|
+
pipelineId: rest[0],
|
|
10223
|
+
expectedRevision: rest[1]
|
|
10224
|
+
};
|
|
10225
|
+
}
|
|
10226
|
+
const scenario = params.scenario;
|
|
10227
|
+
const pipelineId = params.pipelineId;
|
|
10228
|
+
const expectedRevision = params.expectedRevision;
|
|
10229
|
+
const apiPath = '/memory/pipelines/default';
|
|
10230
|
+
const payload = {};
|
|
10231
|
+
if (typeof scenario !== 'undefined') {
|
|
10232
|
+
payload['scenario'] = scenario;
|
|
10233
|
+
}
|
|
10234
|
+
if (typeof pipelineId !== 'undefined') {
|
|
10235
|
+
payload['pipelineId'] = pipelineId;
|
|
10236
|
+
}
|
|
10237
|
+
if (typeof expectedRevision !== 'undefined') {
|
|
10238
|
+
payload['expectedRevision'] = expectedRevision;
|
|
10239
|
+
}
|
|
10240
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
10241
|
+
const apiHeaders = {
|
|
10242
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
10243
|
+
'content-type': 'application/json',
|
|
10244
|
+
};
|
|
10245
|
+
return this.client.call('put', uri, apiHeaders, payload);
|
|
10246
|
+
}
|
|
10247
|
+
getPipeline(paramsOrFirst) {
|
|
10248
|
+
let params;
|
|
10249
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
10250
|
+
params = (paramsOrFirst || {});
|
|
10251
|
+
}
|
|
10252
|
+
else {
|
|
10253
|
+
params = {
|
|
10254
|
+
pipelineId: paramsOrFirst
|
|
10255
|
+
};
|
|
10256
|
+
}
|
|
10257
|
+
const pipelineId = params.pipelineId;
|
|
10258
|
+
if (typeof pipelineId === 'undefined') {
|
|
10259
|
+
throw new AgentbaseException('Missing required parameter: "pipelineId"');
|
|
10260
|
+
}
|
|
10261
|
+
const apiPath = '/memory/pipelines/{pipelineId}'.replace('{pipelineId}', pipelineId);
|
|
10262
|
+
const payload = {};
|
|
10263
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
10264
|
+
const apiHeaders = {
|
|
10265
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
10266
|
+
};
|
|
10267
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
10268
|
+
}
|
|
10269
|
+
updatePipeline(paramsOrFirst, ...rest) {
|
|
10270
|
+
let params;
|
|
10271
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
10272
|
+
params = (paramsOrFirst || {});
|
|
10273
|
+
}
|
|
10274
|
+
else {
|
|
10275
|
+
params = {
|
|
10276
|
+
pipelineId: paramsOrFirst,
|
|
10277
|
+
expectedRevision: rest[0],
|
|
10278
|
+
config: rest[1]
|
|
10279
|
+
};
|
|
10280
|
+
}
|
|
10281
|
+
const pipelineId = params.pipelineId;
|
|
10282
|
+
const expectedRevision = params.expectedRevision;
|
|
10283
|
+
const config = params.config;
|
|
10284
|
+
if (typeof pipelineId === 'undefined') {
|
|
10285
|
+
throw new AgentbaseException('Missing required parameter: "pipelineId"');
|
|
10286
|
+
}
|
|
10287
|
+
if (typeof expectedRevision === 'undefined') {
|
|
10288
|
+
throw new AgentbaseException('Missing required parameter: "expectedRevision"');
|
|
10289
|
+
}
|
|
10290
|
+
if (typeof config === 'undefined') {
|
|
10291
|
+
throw new AgentbaseException('Missing required parameter: "config"');
|
|
10292
|
+
}
|
|
10293
|
+
const apiPath = '/memory/pipelines/{pipelineId}'.replace('{pipelineId}', pipelineId);
|
|
10294
|
+
const payload = {};
|
|
10295
|
+
if (typeof expectedRevision !== 'undefined') {
|
|
10296
|
+
payload['expectedRevision'] = expectedRevision;
|
|
10297
|
+
}
|
|
10298
|
+
if (typeof config !== 'undefined') {
|
|
10299
|
+
payload['config'] = config;
|
|
10300
|
+
}
|
|
10301
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
10302
|
+
const apiHeaders = {
|
|
10303
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
10304
|
+
'content-type': 'application/json',
|
|
10305
|
+
};
|
|
10306
|
+
return this.client.call('patch', uri, apiHeaders, payload);
|
|
10307
|
+
}
|
|
10308
|
+
deletePipeline(paramsOrFirst, ...rest) {
|
|
10309
|
+
let params;
|
|
10310
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
10311
|
+
params = (paramsOrFirst || {});
|
|
10312
|
+
}
|
|
10313
|
+
else {
|
|
10314
|
+
params = {
|
|
10315
|
+
pipelineId: paramsOrFirst,
|
|
10316
|
+
expectedRevision: rest[0]
|
|
10317
|
+
};
|
|
10318
|
+
}
|
|
10319
|
+
const pipelineId = params.pipelineId;
|
|
10320
|
+
const expectedRevision = params.expectedRevision;
|
|
10321
|
+
if (typeof pipelineId === 'undefined') {
|
|
10322
|
+
throw new AgentbaseException('Missing required parameter: "pipelineId"');
|
|
10323
|
+
}
|
|
10324
|
+
if (typeof expectedRevision === 'undefined') {
|
|
10325
|
+
throw new AgentbaseException('Missing required parameter: "expectedRevision"');
|
|
10326
|
+
}
|
|
10327
|
+
const apiPath = '/memory/pipelines/{pipelineId}'.replace('{pipelineId}', pipelineId);
|
|
10328
|
+
const payload = {};
|
|
10329
|
+
if (typeof expectedRevision !== 'undefined') {
|
|
10330
|
+
payload['expectedRevision'] = expectedRevision;
|
|
10331
|
+
}
|
|
10332
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
10333
|
+
const apiHeaders = {
|
|
10334
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
10335
|
+
'content-type': 'application/json',
|
|
10336
|
+
};
|
|
10337
|
+
return this.client.call('delete', uri, apiHeaders, payload);
|
|
10338
|
+
}
|
|
10339
|
+
publishPipeline(paramsOrFirst, ...rest) {
|
|
10340
|
+
let params;
|
|
10341
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
10342
|
+
params = (paramsOrFirst || {});
|
|
10343
|
+
}
|
|
10344
|
+
else {
|
|
10345
|
+
params = {
|
|
10346
|
+
pipelineId: paramsOrFirst,
|
|
10347
|
+
versionId: rest[0],
|
|
10348
|
+
expectedRevision: rest[1],
|
|
10349
|
+
makeDefault: rest[2]
|
|
10350
|
+
};
|
|
10351
|
+
}
|
|
10352
|
+
const pipelineId = params.pipelineId;
|
|
10353
|
+
const versionId = params.versionId;
|
|
10354
|
+
const expectedRevision = params.expectedRevision;
|
|
10355
|
+
const makeDefault = params.makeDefault;
|
|
10356
|
+
if (typeof pipelineId === 'undefined') {
|
|
10357
|
+
throw new AgentbaseException('Missing required parameter: "pipelineId"');
|
|
10358
|
+
}
|
|
10359
|
+
if (typeof versionId === 'undefined') {
|
|
10360
|
+
throw new AgentbaseException('Missing required parameter: "versionId"');
|
|
10361
|
+
}
|
|
10362
|
+
if (typeof expectedRevision === 'undefined') {
|
|
10363
|
+
throw new AgentbaseException('Missing required parameter: "expectedRevision"');
|
|
10364
|
+
}
|
|
10365
|
+
const apiPath = '/memory/pipelines/{pipelineId}/publish'.replace('{pipelineId}', pipelineId);
|
|
10366
|
+
const payload = {};
|
|
10367
|
+
if (typeof versionId !== 'undefined') {
|
|
10368
|
+
payload['versionId'] = versionId;
|
|
10369
|
+
}
|
|
10370
|
+
if (typeof expectedRevision !== 'undefined') {
|
|
10371
|
+
payload['expectedRevision'] = expectedRevision;
|
|
10372
|
+
}
|
|
10373
|
+
if (typeof makeDefault !== 'undefined') {
|
|
10374
|
+
payload['makeDefault'] = makeDefault;
|
|
10375
|
+
}
|
|
10376
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
10377
|
+
const apiHeaders = {
|
|
10378
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
10379
|
+
'content-type': 'application/json',
|
|
10380
|
+
};
|
|
10381
|
+
return this.client.call('post', uri, apiHeaders, payload);
|
|
10382
|
+
}
|
|
10383
|
+
rollbackPipeline(paramsOrFirst, ...rest) {
|
|
10384
|
+
let params;
|
|
10385
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
10386
|
+
params = (paramsOrFirst || {});
|
|
10387
|
+
}
|
|
10388
|
+
else {
|
|
10389
|
+
params = {
|
|
10390
|
+
pipelineId: paramsOrFirst,
|
|
10391
|
+
versionId: rest[0],
|
|
10392
|
+
expectedRevision: rest[1]
|
|
10393
|
+
};
|
|
10394
|
+
}
|
|
10395
|
+
const pipelineId = params.pipelineId;
|
|
10396
|
+
const versionId = params.versionId;
|
|
10397
|
+
const expectedRevision = params.expectedRevision;
|
|
10398
|
+
if (typeof pipelineId === 'undefined') {
|
|
10399
|
+
throw new AgentbaseException('Missing required parameter: "pipelineId"');
|
|
10400
|
+
}
|
|
10401
|
+
if (typeof versionId === 'undefined') {
|
|
10402
|
+
throw new AgentbaseException('Missing required parameter: "versionId"');
|
|
10403
|
+
}
|
|
10404
|
+
if (typeof expectedRevision === 'undefined') {
|
|
10405
|
+
throw new AgentbaseException('Missing required parameter: "expectedRevision"');
|
|
10406
|
+
}
|
|
10407
|
+
const apiPath = '/memory/pipelines/{pipelineId}/rollback'.replace('{pipelineId}', pipelineId);
|
|
10408
|
+
const payload = {};
|
|
10409
|
+
if (typeof versionId !== 'undefined') {
|
|
10410
|
+
payload['versionId'] = versionId;
|
|
10411
|
+
}
|
|
10412
|
+
if (typeof expectedRevision !== 'undefined') {
|
|
10413
|
+
payload['expectedRevision'] = expectedRevision;
|
|
10414
|
+
}
|
|
10415
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
10416
|
+
const apiHeaders = {
|
|
10417
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
10418
|
+
'content-type': 'application/json',
|
|
10419
|
+
};
|
|
10420
|
+
return this.client.call('post', uri, apiHeaders, payload);
|
|
10421
|
+
}
|
|
10422
|
+
validatePipeline(paramsOrFirst, ...rest) {
|
|
10423
|
+
let params;
|
|
10424
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
10425
|
+
params = (paramsOrFirst || {});
|
|
10426
|
+
}
|
|
10427
|
+
else {
|
|
10428
|
+
params = {
|
|
10429
|
+
pipelineId: paramsOrFirst,
|
|
10430
|
+
versionId: rest[0],
|
|
10431
|
+
data: rest[1]
|
|
10432
|
+
};
|
|
10433
|
+
}
|
|
10434
|
+
const pipelineId = params.pipelineId;
|
|
10435
|
+
const versionId = params.versionId;
|
|
10436
|
+
const data = params.data;
|
|
10437
|
+
if (typeof pipelineId === 'undefined') {
|
|
10438
|
+
throw new AgentbaseException('Missing required parameter: "pipelineId"');
|
|
10439
|
+
}
|
|
10440
|
+
if (typeof versionId === 'undefined') {
|
|
10441
|
+
throw new AgentbaseException('Missing required parameter: "versionId"');
|
|
10442
|
+
}
|
|
10443
|
+
if (typeof data === 'undefined') {
|
|
10444
|
+
throw new AgentbaseException('Missing required parameter: "data"');
|
|
10445
|
+
}
|
|
10446
|
+
const apiPath = '/memory/pipelines/{pipelineId}/validate'.replace('{pipelineId}', pipelineId);
|
|
10447
|
+
const payload = {};
|
|
10448
|
+
if (typeof versionId !== 'undefined') {
|
|
10449
|
+
payload['versionId'] = versionId;
|
|
10450
|
+
}
|
|
10451
|
+
if (typeof data !== 'undefined') {
|
|
10452
|
+
payload['data'] = data;
|
|
10453
|
+
}
|
|
10454
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
10455
|
+
const apiHeaders = {
|
|
10456
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
10457
|
+
'content-type': 'application/json',
|
|
10458
|
+
};
|
|
10459
|
+
return this.client.call('post', uri, apiHeaders, payload);
|
|
10460
|
+
}
|
|
10461
|
+
listPipelineVersions(paramsOrFirst, ...rest) {
|
|
10462
|
+
let params;
|
|
10463
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
10464
|
+
params = (paramsOrFirst || {});
|
|
10465
|
+
}
|
|
10466
|
+
else {
|
|
10467
|
+
params = {
|
|
10468
|
+
pipelineId: paramsOrFirst,
|
|
10469
|
+
versionId: rest[0],
|
|
10470
|
+
beforeRevision: rest[1]
|
|
10471
|
+
};
|
|
10472
|
+
}
|
|
10473
|
+
const pipelineId = params.pipelineId;
|
|
10474
|
+
const versionId = params.versionId;
|
|
10475
|
+
const beforeRevision = params.beforeRevision;
|
|
10476
|
+
if (typeof pipelineId === 'undefined') {
|
|
10477
|
+
throw new AgentbaseException('Missing required parameter: "pipelineId"');
|
|
10478
|
+
}
|
|
10479
|
+
const apiPath = '/memory/pipelines/{pipelineId}/versions'.replace('{pipelineId}', pipelineId);
|
|
10480
|
+
const payload = {};
|
|
10481
|
+
if (typeof versionId !== 'undefined') {
|
|
10482
|
+
payload['versionId'] = versionId;
|
|
10483
|
+
}
|
|
10484
|
+
if (typeof beforeRevision !== 'undefined') {
|
|
10485
|
+
payload['beforeRevision'] = beforeRevision;
|
|
10486
|
+
}
|
|
10487
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
10488
|
+
const apiHeaders = {
|
|
10489
|
+
'X-Appwrite-Project': this.client.config.project,
|
|
10490
|
+
};
|
|
10491
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
10492
|
+
}
|
|
9779
10493
|
}
|
|
9780
10494
|
|
|
9781
10495
|
class Messaging {
|
|
@@ -13491,6 +14205,10 @@ var Status;
|
|
|
13491
14205
|
Status["PartialFailed"] = "partial_failed";
|
|
13492
14206
|
Status["Failed"] = "failed";
|
|
13493
14207
|
Status["Dead"] = "dead";
|
|
14208
|
+
Status["Pending"] = "pending";
|
|
14209
|
+
Status["Approved"] = "approved";
|
|
14210
|
+
Status["Rejected"] = "rejected";
|
|
14211
|
+
Status["Superseded"] = "superseded";
|
|
13494
14212
|
})(Status || (Status = {}));
|
|
13495
14213
|
|
|
13496
14214
|
var Browser;
|
|
@@ -14195,6 +14913,23 @@ var ImageFormat;
|
|
|
14195
14913
|
ImageFormat["Gif"] = "gif";
|
|
14196
14914
|
})(ImageFormat || (ImageFormat = {}));
|
|
14197
14915
|
|
|
14916
|
+
var PathMatch;
|
|
14917
|
+
(function (PathMatch) {
|
|
14918
|
+
PathMatch["Exact"] = "exact";
|
|
14919
|
+
PathMatch["Regex"] = "regex";
|
|
14920
|
+
})(PathMatch || (PathMatch = {}));
|
|
14921
|
+
|
|
14922
|
+
var Method;
|
|
14923
|
+
(function (Method) {
|
|
14924
|
+
Method["GET"] = "GET";
|
|
14925
|
+
Method["POST"] = "POST";
|
|
14926
|
+
Method["PUT"] = "PUT";
|
|
14927
|
+
Method["PATCH"] = "PATCH";
|
|
14928
|
+
Method["DELETE"] = "DELETE";
|
|
14929
|
+
Method["OPTIONS"] = "OPTIONS";
|
|
14930
|
+
Method["HEAD"] = "HEAD";
|
|
14931
|
+
})(Method || (Method = {}));
|
|
14932
|
+
|
|
14198
14933
|
var ExecutionMethod;
|
|
14199
14934
|
(function (ExecutionMethod) {
|
|
14200
14935
|
ExecutionMethod["GET"] = "GET";
|
|
@@ -14350,6 +15085,14 @@ var MemoryShareSubjectType;
|
|
|
14350
15085
|
MemoryShareSubjectType["Group"] = "group";
|
|
14351
15086
|
})(MemoryShareSubjectType || (MemoryShareSubjectType = {}));
|
|
14352
15087
|
|
|
15088
|
+
var Scenario;
|
|
15089
|
+
(function (Scenario) {
|
|
15090
|
+
Scenario["AddMemory"] = "add_memory";
|
|
15091
|
+
Scenario["Profile"] = "profile";
|
|
15092
|
+
Scenario["Distillation"] = "distillation";
|
|
15093
|
+
Scenario["Forgetting"] = "forgetting";
|
|
15094
|
+
})(Scenario || (Scenario = {}));
|
|
15095
|
+
|
|
14353
15096
|
var OrganizationRole;
|
|
14354
15097
|
(function (OrganizationRole) {
|
|
14355
15098
|
OrganizationRole["Owner"] = "owner";
|
|
@@ -14497,5 +15240,5 @@ var KnowledgeBaseDataSourceDocumentImportResultStatus;
|
|
|
14497
15240
|
KnowledgeBaseDataSourceDocumentImportResultStatus["Failed"] = "failed";
|
|
14498
15241
|
})(KnowledgeBaseDataSourceDocumentImportResultStatus || (KnowledgeBaseDataSourceDocumentImportResultStatus = {}));
|
|
14499
15242
|
|
|
14500
|
-
export { Account, AgentRuntime, AgentbaseException, AiGateway, AuthenticationFactor, AuthenticatorType, Avatars, Browser, BrowserPermission, Channel, Client, Condition, CreditCard, Databases, DistillationMessageRole, DistillationMode, DistillationToolStatus, DocumentsDB, ExecutionMethod, ExecutionStatus, ExecutionTrigger, ExportJobMode, ExportMode, FeedbackType, Flag, Format, Functions, Graphql, ID, ImageFormat, ImageGravity, Kind, Kinds, KnowledgeBaseDataSourceDocumentImportResultStatus, KnowledgeBases, LlmGateway, Locale, Memory, MemoryAccessMode, MemoryBatchOperation, MemoryBulkDeleteItemStatus, MemoryBulkDeleteResponseStatus, MemoryHandlingPolicy, MemoryMessageRole, MemoryRecordKind, MemoryRecordSensitivity, MemoryScope, MemorySensitivity, MemoryShareSubjectType, Messaging, OAuthProvider, Operator, OrganizationProjectDeletionDeletionStatus, OrganizationRole, OrganizationUsageRange, Outcome, Permission, ProfileExtractionMode, ProfileType, ProjectDeletionRestoreStatus, ProjectDeletionResultDeletionStatus, ProjectDeletionResultStatus, Projects, Query, Realtime, RecordKind, RetentionPolicy, Role, Scope, SelfHostedOrganizations, SourceType, Status, Storage, TablesDB, Teams, Theme, Timezone, TransactionAction, ValidationStatus, VectorsDB, VerificationSource };
|
|
15243
|
+
export { Account, AgentRuntime, AgentbaseException, AiGateway, AuthenticationFactor, AuthenticatorType, Avatars, Browser, BrowserPermission, Channel, Client, Condition, CreditCard, Databases, DistillationMessageRole, DistillationMode, DistillationToolStatus, DocumentsDB, ExecutionMethod, ExecutionStatus, ExecutionTrigger, ExportJobMode, ExportMode, FeedbackType, Flag, Format, Functions, Graphql, ID, ImageFormat, ImageGravity, Kind, Kinds, KnowledgeBaseDataSourceDocumentImportResultStatus, KnowledgeBases, LlmGateway, Locale, Memory, MemoryAccessMode, MemoryBatchOperation, MemoryBulkDeleteItemStatus, MemoryBulkDeleteResponseStatus, MemoryHandlingPolicy, MemoryMessageRole, MemoryRecordKind, MemoryRecordSensitivity, MemoryScope, MemorySensitivity, MemoryShareSubjectType, Messaging, Method, OAuthProvider, Operator, OrganizationProjectDeletionDeletionStatus, OrganizationRole, OrganizationUsageRange, Outcome, PathMatch, Permission, ProfileExtractionMode, ProfileType, ProjectDeletionRestoreStatus, ProjectDeletionResultDeletionStatus, ProjectDeletionResultStatus, Projects, Query, Realtime, RecordKind, RetentionPolicy, Role, Scenario, Scope, SelfHostedOrganizations, SourceType, Status, Storage, TablesDB, Teams, Theme, Timezone, TransactionAction, ValidationStatus, VectorsDB, VerificationSource };
|
|
14501
15244
|
//# sourceMappingURL=sdk.js.map
|