linkque-cli-v2 1.6.17 → 1.6.18
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/dataTransformWorker.js +3 -17
- package/dev/worker.js +37 -11
- package/linkquejs.js +471 -384
- package/package.json +1 -1
- package/vendor/linkque-agent-appwrite-integrate/data-transform/dataTransformWorker.js +3 -17
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-RSMGFPPK.js → chunk-3BH2PDL3.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-JMBJJF7P.js → chunk-KRE5FADB.js} +37 -11
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-EJB2EPNQ.js → chunk-L5WNKJ4W.js} +2852 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-7OYTZGOC.js → chunk-M6E4Y5HY.js} +2998 -2125
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{google-generative-ai-KD7MXONK.js → google-generative-ai-YD5ZGNXC.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{google-vertex-TREYA472.js → google-vertex-M34UDW4J.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{mistral-conversations-C43A6QIS.js → mistral-conversations-EIVAJAMW.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{otel-RUUFBBFE.js → otel-LQR5KPZ3.js} +578 -266
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/chat.js +770 -185
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/clientCapability.js +2 -3
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/protocol.js +2 -3
- package/worker.js +6093 -4380
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/chunk-EAODRPW4.js +0 -518
package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-EJB2EPNQ.js → chunk-L5WNKJ4W.js}
RENAMED
|
@@ -21,8 +21,9 @@ import {
|
|
|
21
21
|
McpPhoneAuthorizationRequiredError,
|
|
22
22
|
RUNTIME_CONFIG_DEFAULTS,
|
|
23
23
|
RuntimeConfigProvider,
|
|
24
|
+
getRunEmbeddedQuery,
|
|
24
25
|
isDebugLoggingEnabled
|
|
25
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-M6E4Y5HY.js";
|
|
26
27
|
import {
|
|
27
28
|
__commonJS,
|
|
28
29
|
__require,
|
|
@@ -7396,6 +7397,9 @@ var APPBASE_RUNTIME_CONFIG_DEFAULTS = Object.freeze({
|
|
|
7396
7397
|
LINKQUEGW_MCP_SIGN_ENDPOINT_PRE: `${LINKQUE_ENDPOINT_PRE}/api/mcp/signature`,
|
|
7397
7398
|
LINKQUE_OPEN_MCP_BASE_URL: "https://opengw.alipay.com",
|
|
7398
7399
|
LINKQUE_OPEN_MCP_BASE_URL_PRE: "https://opengw-pre.alipay.com",
|
|
7400
|
+
EXTERNAL_ACTION_DATABASE_ID: "linkque",
|
|
7401
|
+
EXTERNAL_ACTION_TABLE_ID: "linkque_external_actions",
|
|
7402
|
+
LINKQUE_EMBEDDED_QUERY_ENABLED: "false",
|
|
7399
7403
|
RUN_DATABASE_ID: "linkque",
|
|
7400
7404
|
RUN_TABLE_ID: "linkque_conversation_runs",
|
|
7401
7405
|
SESSION_DATABASE_ID: "linkque",
|
|
@@ -11430,6 +11434,2829 @@ var Databases = class {
|
|
|
11430
11434
|
}
|
|
11431
11435
|
};
|
|
11432
11436
|
|
|
11437
|
+
// ../../node_modules/@alipay/appbase-node-sdk/dist/services/memory.mjs
|
|
11438
|
+
var Memory = class {
|
|
11439
|
+
constructor(client) {
|
|
11440
|
+
this.client = client;
|
|
11441
|
+
}
|
|
11442
|
+
listAudits(paramsOrFirst, ...rest) {
|
|
11443
|
+
let params;
|
|
11444
|
+
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11445
|
+
params = paramsOrFirst || {};
|
|
11446
|
+
} else {
|
|
11447
|
+
params = {
|
|
11448
|
+
jobId: paramsOrFirst,
|
|
11449
|
+
query: rest[0],
|
|
11450
|
+
operation: rest[1],
|
|
11451
|
+
outcome: rest[2],
|
|
11452
|
+
limit: rest[3],
|
|
11453
|
+
cursor: rest[4]
|
|
11454
|
+
};
|
|
11455
|
+
}
|
|
11456
|
+
const jobId = params.jobId;
|
|
11457
|
+
const query = params.query;
|
|
11458
|
+
const operation = params.operation;
|
|
11459
|
+
const outcome = params.outcome;
|
|
11460
|
+
const limit = params.limit;
|
|
11461
|
+
const cursor = params.cursor;
|
|
11462
|
+
const apiPath = "/memory/audits";
|
|
11463
|
+
const payload = {};
|
|
11464
|
+
if (typeof jobId !== "undefined") {
|
|
11465
|
+
payload["jobId"] = jobId;
|
|
11466
|
+
}
|
|
11467
|
+
if (typeof query !== "undefined") {
|
|
11468
|
+
payload["query"] = query;
|
|
11469
|
+
}
|
|
11470
|
+
if (typeof operation !== "undefined") {
|
|
11471
|
+
payload["operation"] = operation;
|
|
11472
|
+
}
|
|
11473
|
+
if (typeof outcome !== "undefined") {
|
|
11474
|
+
payload["outcome"] = outcome;
|
|
11475
|
+
}
|
|
11476
|
+
if (typeof limit !== "undefined") {
|
|
11477
|
+
payload["limit"] = limit;
|
|
11478
|
+
}
|
|
11479
|
+
if (typeof cursor !== "undefined") {
|
|
11480
|
+
payload["cursor"] = cursor;
|
|
11481
|
+
}
|
|
11482
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11483
|
+
const apiHeaders = {};
|
|
11484
|
+
return this.client.call(
|
|
11485
|
+
"get",
|
|
11486
|
+
uri,
|
|
11487
|
+
apiHeaders,
|
|
11488
|
+
payload
|
|
11489
|
+
);
|
|
11490
|
+
}
|
|
11491
|
+
getJob(paramsOrFirst) {
|
|
11492
|
+
let params;
|
|
11493
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11494
|
+
params = paramsOrFirst || {};
|
|
11495
|
+
} else {
|
|
11496
|
+
params = {
|
|
11497
|
+
jobId: paramsOrFirst
|
|
11498
|
+
};
|
|
11499
|
+
}
|
|
11500
|
+
const jobId = params.jobId;
|
|
11501
|
+
if (typeof jobId === "undefined") {
|
|
11502
|
+
throw new AppBaseException('Missing required parameter: "jobId"');
|
|
11503
|
+
}
|
|
11504
|
+
const apiPath = "/memory/jobs/{jobId}".replace("{jobId}", jobId);
|
|
11505
|
+
const payload = {};
|
|
11506
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11507
|
+
const apiHeaders = {};
|
|
11508
|
+
return this.client.call(
|
|
11509
|
+
"get",
|
|
11510
|
+
uri,
|
|
11511
|
+
apiHeaders,
|
|
11512
|
+
payload
|
|
11513
|
+
);
|
|
11514
|
+
}
|
|
11515
|
+
list(paramsOrFirst, ...rest) {
|
|
11516
|
+
let params;
|
|
11517
|
+
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11518
|
+
params = paramsOrFirst || {};
|
|
11519
|
+
} else {
|
|
11520
|
+
params = {
|
|
11521
|
+
cursor: paramsOrFirst,
|
|
11522
|
+
limit: rest[0],
|
|
11523
|
+
filter: rest[1],
|
|
11524
|
+
queries: rest[2],
|
|
11525
|
+
userId: rest[3],
|
|
11526
|
+
accessMode: rest[4]
|
|
11527
|
+
};
|
|
11528
|
+
}
|
|
11529
|
+
const cursor = params.cursor;
|
|
11530
|
+
const limit = params.limit;
|
|
11531
|
+
const filter = params.filter;
|
|
11532
|
+
const queries = params.queries;
|
|
11533
|
+
const userId = params.userId;
|
|
11534
|
+
const accessMode = params.accessMode;
|
|
11535
|
+
const apiPath = "/memory/memories";
|
|
11536
|
+
const payload = {};
|
|
11537
|
+
if (typeof cursor !== "undefined") {
|
|
11538
|
+
payload["cursor"] = cursor;
|
|
11539
|
+
}
|
|
11540
|
+
if (typeof limit !== "undefined") {
|
|
11541
|
+
payload["limit"] = limit;
|
|
11542
|
+
}
|
|
11543
|
+
if (typeof filter !== "undefined") {
|
|
11544
|
+
payload["filter"] = filter;
|
|
11545
|
+
}
|
|
11546
|
+
if (typeof queries !== "undefined") {
|
|
11547
|
+
payload["queries"] = queries;
|
|
11548
|
+
}
|
|
11549
|
+
if (typeof userId !== "undefined") {
|
|
11550
|
+
payload["userId"] = userId;
|
|
11551
|
+
}
|
|
11552
|
+
if (typeof accessMode !== "undefined") {
|
|
11553
|
+
payload["accessMode"] = accessMode;
|
|
11554
|
+
}
|
|
11555
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11556
|
+
const apiHeaders = {};
|
|
11557
|
+
return this.client.call(
|
|
11558
|
+
"get",
|
|
11559
|
+
uri,
|
|
11560
|
+
apiHeaders,
|
|
11561
|
+
payload
|
|
11562
|
+
);
|
|
11563
|
+
}
|
|
11564
|
+
create(paramsOrFirst, ...rest) {
|
|
11565
|
+
let params;
|
|
11566
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11567
|
+
params = paramsOrFirst || {};
|
|
11568
|
+
} else {
|
|
11569
|
+
params = {
|
|
11570
|
+
userId: paramsOrFirst,
|
|
11571
|
+
scope: rest[0],
|
|
11572
|
+
memoryType: rest[1],
|
|
11573
|
+
recordKind: rest[2],
|
|
11574
|
+
content: rest[3],
|
|
11575
|
+
messages: rest[4],
|
|
11576
|
+
agentId: rest[5],
|
|
11577
|
+
runId: rest[6],
|
|
11578
|
+
sensitivity: rest[7],
|
|
11579
|
+
handlingPolicy: rest[8],
|
|
11580
|
+
metadata: rest[9],
|
|
11581
|
+
infer: rest[10],
|
|
11582
|
+
reRemember: rest[11],
|
|
11583
|
+
async: rest[12]
|
|
11584
|
+
};
|
|
11585
|
+
}
|
|
11586
|
+
const userId = params.userId;
|
|
11587
|
+
const scope = params.scope;
|
|
11588
|
+
const memoryType = params.memoryType;
|
|
11589
|
+
const recordKind = params.recordKind;
|
|
11590
|
+
const content = params.content;
|
|
11591
|
+
const messages = params.messages;
|
|
11592
|
+
const agentId = params.agentId;
|
|
11593
|
+
const runId = params.runId;
|
|
11594
|
+
const sensitivity = params.sensitivity;
|
|
11595
|
+
const handlingPolicy = params.handlingPolicy;
|
|
11596
|
+
const metadata = params.metadata;
|
|
11597
|
+
const infer = params.infer;
|
|
11598
|
+
const reRemember = params.reRemember;
|
|
11599
|
+
const async = params.async;
|
|
11600
|
+
if (typeof userId === "undefined") {
|
|
11601
|
+
throw new AppBaseException('Missing required parameter: "userId"');
|
|
11602
|
+
}
|
|
11603
|
+
if (typeof scope === "undefined") {
|
|
11604
|
+
throw new AppBaseException('Missing required parameter: "scope"');
|
|
11605
|
+
}
|
|
11606
|
+
if (typeof memoryType === "undefined") {
|
|
11607
|
+
throw new AppBaseException('Missing required parameter: "memoryType"');
|
|
11608
|
+
}
|
|
11609
|
+
if (typeof recordKind === "undefined") {
|
|
11610
|
+
throw new AppBaseException('Missing required parameter: "recordKind"');
|
|
11611
|
+
}
|
|
11612
|
+
const apiPath = "/memory/memories";
|
|
11613
|
+
const payload = {};
|
|
11614
|
+
if (typeof content !== "undefined") {
|
|
11615
|
+
payload["content"] = content;
|
|
11616
|
+
}
|
|
11617
|
+
if (typeof messages !== "undefined") {
|
|
11618
|
+
payload["messages"] = messages;
|
|
11619
|
+
}
|
|
11620
|
+
if (typeof userId !== "undefined") {
|
|
11621
|
+
payload["userId"] = userId;
|
|
11622
|
+
}
|
|
11623
|
+
if (typeof agentId !== "undefined") {
|
|
11624
|
+
payload["agentId"] = agentId;
|
|
11625
|
+
}
|
|
11626
|
+
if (typeof runId !== "undefined") {
|
|
11627
|
+
payload["runId"] = runId;
|
|
11628
|
+
}
|
|
11629
|
+
if (typeof scope !== "undefined") {
|
|
11630
|
+
payload["scope"] = scope;
|
|
11631
|
+
}
|
|
11632
|
+
if (typeof sensitivity !== "undefined") {
|
|
11633
|
+
payload["sensitivity"] = sensitivity;
|
|
11634
|
+
}
|
|
11635
|
+
if (typeof handlingPolicy !== "undefined") {
|
|
11636
|
+
payload["handlingPolicy"] = handlingPolicy;
|
|
11637
|
+
}
|
|
11638
|
+
if (typeof memoryType !== "undefined") {
|
|
11639
|
+
payload["memoryType"] = memoryType;
|
|
11640
|
+
}
|
|
11641
|
+
if (typeof recordKind !== "undefined") {
|
|
11642
|
+
payload["recordKind"] = recordKind;
|
|
11643
|
+
}
|
|
11644
|
+
if (typeof metadata !== "undefined") {
|
|
11645
|
+
payload["metadata"] = metadata;
|
|
11646
|
+
}
|
|
11647
|
+
if (typeof infer !== "undefined") {
|
|
11648
|
+
payload["infer"] = infer;
|
|
11649
|
+
}
|
|
11650
|
+
if (typeof reRemember !== "undefined") {
|
|
11651
|
+
payload["reRemember"] = reRemember;
|
|
11652
|
+
}
|
|
11653
|
+
if (typeof async !== "undefined") {
|
|
11654
|
+
payload["async"] = async;
|
|
11655
|
+
}
|
|
11656
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11657
|
+
const apiHeaders = {
|
|
11658
|
+
"content-type": "application/json"
|
|
11659
|
+
};
|
|
11660
|
+
return this.client.call(
|
|
11661
|
+
"post",
|
|
11662
|
+
uri,
|
|
11663
|
+
apiHeaders,
|
|
11664
|
+
payload
|
|
11665
|
+
);
|
|
11666
|
+
}
|
|
11667
|
+
deleteMany(paramsOrFirst, ...rest) {
|
|
11668
|
+
let params;
|
|
11669
|
+
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11670
|
+
params = paramsOrFirst || {};
|
|
11671
|
+
} else {
|
|
11672
|
+
params = {
|
|
11673
|
+
userId: paramsOrFirst,
|
|
11674
|
+
limit: rest[0],
|
|
11675
|
+
reason: rest[1],
|
|
11676
|
+
source: rest[2]
|
|
11677
|
+
};
|
|
11678
|
+
}
|
|
11679
|
+
const userId = params.userId;
|
|
11680
|
+
const limit = params.limit;
|
|
11681
|
+
const reason = params.reason;
|
|
11682
|
+
const source = params.source;
|
|
11683
|
+
const apiPath = "/memory/memories";
|
|
11684
|
+
const payload = {};
|
|
11685
|
+
if (typeof userId !== "undefined") {
|
|
11686
|
+
payload["userId"] = userId;
|
|
11687
|
+
}
|
|
11688
|
+
if (typeof limit !== "undefined") {
|
|
11689
|
+
payload["limit"] = limit;
|
|
11690
|
+
}
|
|
11691
|
+
if (typeof reason !== "undefined") {
|
|
11692
|
+
payload["reason"] = reason;
|
|
11693
|
+
}
|
|
11694
|
+
if (typeof source !== "undefined") {
|
|
11695
|
+
payload["source"] = source;
|
|
11696
|
+
}
|
|
11697
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11698
|
+
const apiHeaders = {
|
|
11699
|
+
"content-type": "application/json"
|
|
11700
|
+
};
|
|
11701
|
+
return this.client.call(
|
|
11702
|
+
"delete",
|
|
11703
|
+
uri,
|
|
11704
|
+
apiHeaders,
|
|
11705
|
+
payload
|
|
11706
|
+
);
|
|
11707
|
+
}
|
|
11708
|
+
createBatch(paramsOrFirst) {
|
|
11709
|
+
let params;
|
|
11710
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "items" in paramsOrFirst) {
|
|
11711
|
+
params = paramsOrFirst || {};
|
|
11712
|
+
} else {
|
|
11713
|
+
params = {
|
|
11714
|
+
items: paramsOrFirst
|
|
11715
|
+
};
|
|
11716
|
+
}
|
|
11717
|
+
const items = params.items;
|
|
11718
|
+
if (typeof items === "undefined") {
|
|
11719
|
+
throw new AppBaseException('Missing required parameter: "items"');
|
|
11720
|
+
}
|
|
11721
|
+
const apiPath = "/memory/memories/batch";
|
|
11722
|
+
const payload = {};
|
|
11723
|
+
if (typeof items !== "undefined") {
|
|
11724
|
+
payload["items"] = items;
|
|
11725
|
+
}
|
|
11726
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11727
|
+
const apiHeaders = {
|
|
11728
|
+
"content-type": "application/json"
|
|
11729
|
+
};
|
|
11730
|
+
return this.client.call(
|
|
11731
|
+
"post",
|
|
11732
|
+
uri,
|
|
11733
|
+
apiHeaders,
|
|
11734
|
+
payload
|
|
11735
|
+
);
|
|
11736
|
+
}
|
|
11737
|
+
listContexts(paramsOrFirst, ...rest) {
|
|
11738
|
+
let params;
|
|
11739
|
+
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 || "status" in paramsOrFirst || "kind" in paramsOrFirst || "cursor" in paramsOrFirst || "limit" in paramsOrFirst)) {
|
|
11740
|
+
params = paramsOrFirst || {};
|
|
11741
|
+
} else {
|
|
11742
|
+
params = {
|
|
11743
|
+
scope: paramsOrFirst,
|
|
11744
|
+
userId: rest[0],
|
|
11745
|
+
agentId: rest[1],
|
|
11746
|
+
sessionId: rest[2],
|
|
11747
|
+
runId: rest[3],
|
|
11748
|
+
memorySubStoreId: rest[4],
|
|
11749
|
+
status: rest[5],
|
|
11750
|
+
kind: rest[6],
|
|
11751
|
+
cursor: rest[7],
|
|
11752
|
+
limit: rest[8]
|
|
11753
|
+
};
|
|
11754
|
+
}
|
|
11755
|
+
const scope = params.scope;
|
|
11756
|
+
const userId = params.userId;
|
|
11757
|
+
const agentId = params.agentId;
|
|
11758
|
+
const sessionId = params.sessionId;
|
|
11759
|
+
const runId = params.runId;
|
|
11760
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
11761
|
+
const status = params.status;
|
|
11762
|
+
const kind = params.kind;
|
|
11763
|
+
const cursor = params.cursor;
|
|
11764
|
+
const limit = params.limit;
|
|
11765
|
+
const apiPath = "/memory/memories/contexts";
|
|
11766
|
+
const payload = {};
|
|
11767
|
+
if (typeof scope !== "undefined") {
|
|
11768
|
+
payload["scope"] = scope;
|
|
11769
|
+
}
|
|
11770
|
+
if (typeof userId !== "undefined") {
|
|
11771
|
+
payload["userId"] = userId;
|
|
11772
|
+
}
|
|
11773
|
+
if (typeof agentId !== "undefined") {
|
|
11774
|
+
payload["agentId"] = agentId;
|
|
11775
|
+
}
|
|
11776
|
+
if (typeof sessionId !== "undefined") {
|
|
11777
|
+
payload["sessionId"] = sessionId;
|
|
11778
|
+
}
|
|
11779
|
+
if (typeof runId !== "undefined") {
|
|
11780
|
+
payload["runId"] = runId;
|
|
11781
|
+
}
|
|
11782
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
11783
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
11784
|
+
}
|
|
11785
|
+
if (typeof status !== "undefined") {
|
|
11786
|
+
payload["status"] = status;
|
|
11787
|
+
}
|
|
11788
|
+
if (typeof kind !== "undefined") {
|
|
11789
|
+
payload["kind"] = kind;
|
|
11790
|
+
}
|
|
11791
|
+
if (typeof cursor !== "undefined") {
|
|
11792
|
+
payload["cursor"] = cursor;
|
|
11793
|
+
}
|
|
11794
|
+
if (typeof limit !== "undefined") {
|
|
11795
|
+
payload["limit"] = limit;
|
|
11796
|
+
}
|
|
11797
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11798
|
+
const apiHeaders = {};
|
|
11799
|
+
return this.client.call(
|
|
11800
|
+
"get",
|
|
11801
|
+
uri,
|
|
11802
|
+
apiHeaders,
|
|
11803
|
+
payload
|
|
11804
|
+
);
|
|
11805
|
+
}
|
|
11806
|
+
createContextRun(paramsOrFirst, ...rest) {
|
|
11807
|
+
let params;
|
|
11808
|
+
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)) {
|
|
11809
|
+
params = paramsOrFirst || {};
|
|
11810
|
+
} else {
|
|
11811
|
+
params = {
|
|
11812
|
+
scope: paramsOrFirst,
|
|
11813
|
+
userId: rest[0],
|
|
11814
|
+
agentId: rest[1],
|
|
11815
|
+
sessionId: rest[2],
|
|
11816
|
+
runId: rest[3],
|
|
11817
|
+
memorySubStoreId: rest[4]
|
|
11818
|
+
};
|
|
11819
|
+
}
|
|
11820
|
+
const scope = params.scope;
|
|
11821
|
+
const userId = params.userId;
|
|
11822
|
+
const agentId = params.agentId;
|
|
11823
|
+
const sessionId = params.sessionId;
|
|
11824
|
+
const runId = params.runId;
|
|
11825
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
11826
|
+
const apiPath = "/memory/memories/contexts/runs";
|
|
11827
|
+
const payload = {};
|
|
11828
|
+
if (typeof scope !== "undefined") {
|
|
11829
|
+
payload["scope"] = scope;
|
|
11830
|
+
}
|
|
11831
|
+
if (typeof userId !== "undefined") {
|
|
11832
|
+
payload["userId"] = userId;
|
|
11833
|
+
}
|
|
11834
|
+
if (typeof agentId !== "undefined") {
|
|
11835
|
+
payload["agentId"] = agentId;
|
|
11836
|
+
}
|
|
11837
|
+
if (typeof sessionId !== "undefined") {
|
|
11838
|
+
payload["sessionId"] = sessionId;
|
|
11839
|
+
}
|
|
11840
|
+
if (typeof runId !== "undefined") {
|
|
11841
|
+
payload["runId"] = runId;
|
|
11842
|
+
}
|
|
11843
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
11844
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
11845
|
+
}
|
|
11846
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11847
|
+
const apiHeaders = {
|
|
11848
|
+
"content-type": "application/json"
|
|
11849
|
+
};
|
|
11850
|
+
return this.client.call(
|
|
11851
|
+
"post",
|
|
11852
|
+
uri,
|
|
11853
|
+
apiHeaders,
|
|
11854
|
+
payload
|
|
11855
|
+
);
|
|
11856
|
+
}
|
|
11857
|
+
getContextStatus(paramsOrFirst, ...rest) {
|
|
11858
|
+
let params;
|
|
11859
|
+
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)) {
|
|
11860
|
+
params = paramsOrFirst || {};
|
|
11861
|
+
} else {
|
|
11862
|
+
params = {
|
|
11863
|
+
scope: paramsOrFirst,
|
|
11864
|
+
userId: rest[0],
|
|
11865
|
+
agentId: rest[1],
|
|
11866
|
+
sessionId: rest[2],
|
|
11867
|
+
runId: rest[3],
|
|
11868
|
+
memorySubStoreId: rest[4]
|
|
11869
|
+
};
|
|
11870
|
+
}
|
|
11871
|
+
const scope = params.scope;
|
|
11872
|
+
const userId = params.userId;
|
|
11873
|
+
const agentId = params.agentId;
|
|
11874
|
+
const sessionId = params.sessionId;
|
|
11875
|
+
const runId = params.runId;
|
|
11876
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
11877
|
+
const apiPath = "/memory/memories/contexts/status";
|
|
11878
|
+
const payload = {};
|
|
11879
|
+
if (typeof scope !== "undefined") {
|
|
11880
|
+
payload["scope"] = scope;
|
|
11881
|
+
}
|
|
11882
|
+
if (typeof userId !== "undefined") {
|
|
11883
|
+
payload["userId"] = userId;
|
|
11884
|
+
}
|
|
11885
|
+
if (typeof agentId !== "undefined") {
|
|
11886
|
+
payload["agentId"] = agentId;
|
|
11887
|
+
}
|
|
11888
|
+
if (typeof sessionId !== "undefined") {
|
|
11889
|
+
payload["sessionId"] = sessionId;
|
|
11890
|
+
}
|
|
11891
|
+
if (typeof runId !== "undefined") {
|
|
11892
|
+
payload["runId"] = runId;
|
|
11893
|
+
}
|
|
11894
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
11895
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
11896
|
+
}
|
|
11897
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11898
|
+
const apiHeaders = {};
|
|
11899
|
+
return this.client.call(
|
|
11900
|
+
"get",
|
|
11901
|
+
uri,
|
|
11902
|
+
apiHeaders,
|
|
11903
|
+
payload
|
|
11904
|
+
);
|
|
11905
|
+
}
|
|
11906
|
+
getContext(paramsOrFirst, ...rest) {
|
|
11907
|
+
let params;
|
|
11908
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11909
|
+
params = paramsOrFirst || {};
|
|
11910
|
+
} else {
|
|
11911
|
+
params = {
|
|
11912
|
+
contextId: paramsOrFirst,
|
|
11913
|
+
scope: rest[0],
|
|
11914
|
+
userId: rest[1],
|
|
11915
|
+
agentId: rest[2],
|
|
11916
|
+
sessionId: rest[3],
|
|
11917
|
+
runId: rest[4],
|
|
11918
|
+
memorySubStoreId: rest[5]
|
|
11919
|
+
};
|
|
11920
|
+
}
|
|
11921
|
+
const contextId = params.contextId;
|
|
11922
|
+
const scope = params.scope;
|
|
11923
|
+
const userId = params.userId;
|
|
11924
|
+
const agentId = params.agentId;
|
|
11925
|
+
const sessionId = params.sessionId;
|
|
11926
|
+
const runId = params.runId;
|
|
11927
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
11928
|
+
if (typeof contextId === "undefined") {
|
|
11929
|
+
throw new AppBaseException('Missing required parameter: "contextId"');
|
|
11930
|
+
}
|
|
11931
|
+
const apiPath = "/memory/memories/contexts/{contextId}".replace("{contextId}", contextId);
|
|
11932
|
+
const payload = {};
|
|
11933
|
+
if (typeof scope !== "undefined") {
|
|
11934
|
+
payload["scope"] = scope;
|
|
11935
|
+
}
|
|
11936
|
+
if (typeof userId !== "undefined") {
|
|
11937
|
+
payload["userId"] = userId;
|
|
11938
|
+
}
|
|
11939
|
+
if (typeof agentId !== "undefined") {
|
|
11940
|
+
payload["agentId"] = agentId;
|
|
11941
|
+
}
|
|
11942
|
+
if (typeof sessionId !== "undefined") {
|
|
11943
|
+
payload["sessionId"] = sessionId;
|
|
11944
|
+
}
|
|
11945
|
+
if (typeof runId !== "undefined") {
|
|
11946
|
+
payload["runId"] = runId;
|
|
11947
|
+
}
|
|
11948
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
11949
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
11950
|
+
}
|
|
11951
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11952
|
+
const apiHeaders = {};
|
|
11953
|
+
return this.client.call(
|
|
11954
|
+
"get",
|
|
11955
|
+
uri,
|
|
11956
|
+
apiHeaders,
|
|
11957
|
+
payload
|
|
11958
|
+
);
|
|
11959
|
+
}
|
|
11960
|
+
confirmContext(paramsOrFirst, ...rest) {
|
|
11961
|
+
let params;
|
|
11962
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11963
|
+
params = paramsOrFirst || {};
|
|
11964
|
+
} else {
|
|
11965
|
+
params = {
|
|
11966
|
+
contextId: paramsOrFirst,
|
|
11967
|
+
expectedVersion: rest[0],
|
|
11968
|
+
reason: rest[1],
|
|
11969
|
+
scope: rest[2],
|
|
11970
|
+
userId: rest[3],
|
|
11971
|
+
agentId: rest[4],
|
|
11972
|
+
sessionId: rest[5],
|
|
11973
|
+
runId: rest[6],
|
|
11974
|
+
memorySubStoreId: rest[7]
|
|
11975
|
+
};
|
|
11976
|
+
}
|
|
11977
|
+
const contextId = params.contextId;
|
|
11978
|
+
const expectedVersion = params.expectedVersion;
|
|
11979
|
+
const reason = params.reason;
|
|
11980
|
+
const scope = params.scope;
|
|
11981
|
+
const userId = params.userId;
|
|
11982
|
+
const agentId = params.agentId;
|
|
11983
|
+
const sessionId = params.sessionId;
|
|
11984
|
+
const runId = params.runId;
|
|
11985
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
11986
|
+
if (typeof contextId === "undefined") {
|
|
11987
|
+
throw new AppBaseException('Missing required parameter: "contextId"');
|
|
11988
|
+
}
|
|
11989
|
+
if (typeof expectedVersion === "undefined") {
|
|
11990
|
+
throw new AppBaseException('Missing required parameter: "expectedVersion"');
|
|
11991
|
+
}
|
|
11992
|
+
if (typeof reason === "undefined") {
|
|
11993
|
+
throw new AppBaseException('Missing required parameter: "reason"');
|
|
11994
|
+
}
|
|
11995
|
+
const apiPath = "/memory/memories/contexts/{contextId}/confirm".replace("{contextId}", contextId);
|
|
11996
|
+
const payload = {};
|
|
11997
|
+
if (typeof scope !== "undefined") {
|
|
11998
|
+
payload["scope"] = scope;
|
|
11999
|
+
}
|
|
12000
|
+
if (typeof userId !== "undefined") {
|
|
12001
|
+
payload["userId"] = userId;
|
|
12002
|
+
}
|
|
12003
|
+
if (typeof agentId !== "undefined") {
|
|
12004
|
+
payload["agentId"] = agentId;
|
|
12005
|
+
}
|
|
12006
|
+
if (typeof sessionId !== "undefined") {
|
|
12007
|
+
payload["sessionId"] = sessionId;
|
|
12008
|
+
}
|
|
12009
|
+
if (typeof runId !== "undefined") {
|
|
12010
|
+
payload["runId"] = runId;
|
|
12011
|
+
}
|
|
12012
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
12013
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
12014
|
+
}
|
|
12015
|
+
if (typeof expectedVersion !== "undefined") {
|
|
12016
|
+
payload["expectedVersion"] = expectedVersion;
|
|
12017
|
+
}
|
|
12018
|
+
if (typeof reason !== "undefined") {
|
|
12019
|
+
payload["reason"] = reason;
|
|
12020
|
+
}
|
|
12021
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
12022
|
+
const apiHeaders = {
|
|
12023
|
+
"content-type": "application/json"
|
|
12024
|
+
};
|
|
12025
|
+
return this.client.call(
|
|
12026
|
+
"post",
|
|
12027
|
+
uri,
|
|
12028
|
+
apiHeaders,
|
|
12029
|
+
payload
|
|
12030
|
+
);
|
|
12031
|
+
}
|
|
12032
|
+
rebuildContext(paramsOrFirst, ...rest) {
|
|
12033
|
+
let params;
|
|
12034
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
12035
|
+
params = paramsOrFirst || {};
|
|
12036
|
+
} else {
|
|
12037
|
+
params = {
|
|
12038
|
+
contextId: paramsOrFirst,
|
|
12039
|
+
reason: rest[0],
|
|
12040
|
+
scope: rest[1],
|
|
12041
|
+
userId: rest[2],
|
|
12042
|
+
agentId: rest[3],
|
|
12043
|
+
sessionId: rest[4],
|
|
12044
|
+
runId: rest[5],
|
|
12045
|
+
memorySubStoreId: rest[6]
|
|
12046
|
+
};
|
|
12047
|
+
}
|
|
12048
|
+
const contextId = params.contextId;
|
|
12049
|
+
const reason = params.reason;
|
|
12050
|
+
const scope = params.scope;
|
|
12051
|
+
const userId = params.userId;
|
|
12052
|
+
const agentId = params.agentId;
|
|
12053
|
+
const sessionId = params.sessionId;
|
|
12054
|
+
const runId = params.runId;
|
|
12055
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
12056
|
+
if (typeof contextId === "undefined") {
|
|
12057
|
+
throw new AppBaseException('Missing required parameter: "contextId"');
|
|
12058
|
+
}
|
|
12059
|
+
if (typeof reason === "undefined") {
|
|
12060
|
+
throw new AppBaseException('Missing required parameter: "reason"');
|
|
12061
|
+
}
|
|
12062
|
+
const apiPath = "/memory/memories/contexts/{contextId}/rebuild".replace("{contextId}", contextId);
|
|
12063
|
+
const payload = {};
|
|
12064
|
+
if (typeof scope !== "undefined") {
|
|
12065
|
+
payload["scope"] = scope;
|
|
12066
|
+
}
|
|
12067
|
+
if (typeof userId !== "undefined") {
|
|
12068
|
+
payload["userId"] = userId;
|
|
12069
|
+
}
|
|
12070
|
+
if (typeof agentId !== "undefined") {
|
|
12071
|
+
payload["agentId"] = agentId;
|
|
12072
|
+
}
|
|
12073
|
+
if (typeof sessionId !== "undefined") {
|
|
12074
|
+
payload["sessionId"] = sessionId;
|
|
12075
|
+
}
|
|
12076
|
+
if (typeof runId !== "undefined") {
|
|
12077
|
+
payload["runId"] = runId;
|
|
12078
|
+
}
|
|
12079
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
12080
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
12081
|
+
}
|
|
12082
|
+
if (typeof reason !== "undefined") {
|
|
12083
|
+
payload["reason"] = reason;
|
|
12084
|
+
}
|
|
12085
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
12086
|
+
const apiHeaders = {
|
|
12087
|
+
"content-type": "application/json"
|
|
12088
|
+
};
|
|
12089
|
+
return this.client.call(
|
|
12090
|
+
"post",
|
|
12091
|
+
uri,
|
|
12092
|
+
apiHeaders,
|
|
12093
|
+
payload
|
|
12094
|
+
);
|
|
12095
|
+
}
|
|
12096
|
+
rollbackContext(paramsOrFirst, ...rest) {
|
|
12097
|
+
let params;
|
|
12098
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
12099
|
+
params = paramsOrFirst || {};
|
|
12100
|
+
} else {
|
|
12101
|
+
params = {
|
|
12102
|
+
contextId: paramsOrFirst,
|
|
12103
|
+
expectedVersion: rest[0],
|
|
12104
|
+
targetRevision: rest[1],
|
|
12105
|
+
reason: rest[2],
|
|
12106
|
+
scope: rest[3],
|
|
12107
|
+
userId: rest[4],
|
|
12108
|
+
agentId: rest[5],
|
|
12109
|
+
sessionId: rest[6],
|
|
12110
|
+
runId: rest[7],
|
|
12111
|
+
memorySubStoreId: rest[8]
|
|
12112
|
+
};
|
|
12113
|
+
}
|
|
12114
|
+
const contextId = params.contextId;
|
|
12115
|
+
const expectedVersion = params.expectedVersion;
|
|
12116
|
+
const targetRevision = params.targetRevision;
|
|
12117
|
+
const reason = params.reason;
|
|
12118
|
+
const scope = params.scope;
|
|
12119
|
+
const userId = params.userId;
|
|
12120
|
+
const agentId = params.agentId;
|
|
12121
|
+
const sessionId = params.sessionId;
|
|
12122
|
+
const runId = params.runId;
|
|
12123
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
12124
|
+
if (typeof contextId === "undefined") {
|
|
12125
|
+
throw new AppBaseException('Missing required parameter: "contextId"');
|
|
12126
|
+
}
|
|
12127
|
+
if (typeof expectedVersion === "undefined") {
|
|
12128
|
+
throw new AppBaseException('Missing required parameter: "expectedVersion"');
|
|
12129
|
+
}
|
|
12130
|
+
if (typeof targetRevision === "undefined") {
|
|
12131
|
+
throw new AppBaseException('Missing required parameter: "targetRevision"');
|
|
12132
|
+
}
|
|
12133
|
+
if (typeof reason === "undefined") {
|
|
12134
|
+
throw new AppBaseException('Missing required parameter: "reason"');
|
|
12135
|
+
}
|
|
12136
|
+
const apiPath = "/memory/memories/contexts/{contextId}/rollback".replace("{contextId}", contextId);
|
|
12137
|
+
const payload = {};
|
|
12138
|
+
if (typeof scope !== "undefined") {
|
|
12139
|
+
payload["scope"] = scope;
|
|
12140
|
+
}
|
|
12141
|
+
if (typeof userId !== "undefined") {
|
|
12142
|
+
payload["userId"] = userId;
|
|
12143
|
+
}
|
|
12144
|
+
if (typeof agentId !== "undefined") {
|
|
12145
|
+
payload["agentId"] = agentId;
|
|
12146
|
+
}
|
|
12147
|
+
if (typeof sessionId !== "undefined") {
|
|
12148
|
+
payload["sessionId"] = sessionId;
|
|
12149
|
+
}
|
|
12150
|
+
if (typeof runId !== "undefined") {
|
|
12151
|
+
payload["runId"] = runId;
|
|
12152
|
+
}
|
|
12153
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
12154
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
12155
|
+
}
|
|
12156
|
+
if (typeof expectedVersion !== "undefined") {
|
|
12157
|
+
payload["expectedVersion"] = expectedVersion;
|
|
12158
|
+
}
|
|
12159
|
+
if (typeof targetRevision !== "undefined") {
|
|
12160
|
+
payload["targetRevision"] = targetRevision;
|
|
12161
|
+
}
|
|
12162
|
+
if (typeof reason !== "undefined") {
|
|
12163
|
+
payload["reason"] = reason;
|
|
12164
|
+
}
|
|
12165
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
12166
|
+
const apiHeaders = {
|
|
12167
|
+
"content-type": "application/json"
|
|
12168
|
+
};
|
|
12169
|
+
return this.client.call(
|
|
12170
|
+
"post",
|
|
12171
|
+
uri,
|
|
12172
|
+
apiHeaders,
|
|
12173
|
+
payload
|
|
12174
|
+
);
|
|
12175
|
+
}
|
|
12176
|
+
listDistillations(paramsOrFirst, ...rest) {
|
|
12177
|
+
let params;
|
|
12178
|
+
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 || "status" in paramsOrFirst || "cursor" in paramsOrFirst || "limit" in paramsOrFirst)) {
|
|
12179
|
+
params = paramsOrFirst || {};
|
|
12180
|
+
} else {
|
|
12181
|
+
params = {
|
|
12182
|
+
scope: paramsOrFirst,
|
|
12183
|
+
userId: rest[0],
|
|
12184
|
+
agentId: rest[1],
|
|
12185
|
+
sessionId: rest[2],
|
|
12186
|
+
runId: rest[3],
|
|
12187
|
+
memorySubStoreId: rest[4],
|
|
12188
|
+
status: rest[5],
|
|
12189
|
+
cursor: rest[6],
|
|
12190
|
+
limit: rest[7]
|
|
12191
|
+
};
|
|
12192
|
+
}
|
|
12193
|
+
const scope = params.scope;
|
|
12194
|
+
const userId = params.userId;
|
|
12195
|
+
const agentId = params.agentId;
|
|
12196
|
+
const sessionId = params.sessionId;
|
|
12197
|
+
const runId = params.runId;
|
|
12198
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
12199
|
+
const status = params.status;
|
|
12200
|
+
const cursor = params.cursor;
|
|
12201
|
+
const limit = params.limit;
|
|
12202
|
+
const apiPath = "/memory/memories/distillations";
|
|
12203
|
+
const payload = {};
|
|
12204
|
+
if (typeof scope !== "undefined") {
|
|
12205
|
+
payload["scope"] = scope;
|
|
12206
|
+
}
|
|
12207
|
+
if (typeof userId !== "undefined") {
|
|
12208
|
+
payload["userId"] = userId;
|
|
12209
|
+
}
|
|
12210
|
+
if (typeof agentId !== "undefined") {
|
|
12211
|
+
payload["agentId"] = agentId;
|
|
12212
|
+
}
|
|
12213
|
+
if (typeof sessionId !== "undefined") {
|
|
12214
|
+
payload["sessionId"] = sessionId;
|
|
12215
|
+
}
|
|
12216
|
+
if (typeof runId !== "undefined") {
|
|
12217
|
+
payload["runId"] = runId;
|
|
12218
|
+
}
|
|
12219
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
12220
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
12221
|
+
}
|
|
12222
|
+
if (typeof status !== "undefined") {
|
|
12223
|
+
payload["status"] = status;
|
|
12224
|
+
}
|
|
12225
|
+
if (typeof cursor !== "undefined") {
|
|
12226
|
+
payload["cursor"] = cursor;
|
|
12227
|
+
}
|
|
12228
|
+
if (typeof limit !== "undefined") {
|
|
12229
|
+
payload["limit"] = limit;
|
|
12230
|
+
}
|
|
12231
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
12232
|
+
const apiHeaders = {};
|
|
12233
|
+
return this.client.call(
|
|
12234
|
+
"get",
|
|
12235
|
+
uri,
|
|
12236
|
+
apiHeaders,
|
|
12237
|
+
payload
|
|
12238
|
+
);
|
|
12239
|
+
}
|
|
12240
|
+
submitDistillation(paramsOrFirst, ...rest) {
|
|
12241
|
+
let params;
|
|
12242
|
+
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)) {
|
|
12243
|
+
params = paramsOrFirst || {};
|
|
12244
|
+
} else {
|
|
12245
|
+
params = {
|
|
12246
|
+
scope: paramsOrFirst,
|
|
12247
|
+
userId: rest[0],
|
|
12248
|
+
agentId: rest[1],
|
|
12249
|
+
sessionId: rest[2],
|
|
12250
|
+
runId: rest[3],
|
|
12251
|
+
memorySubStoreId: rest[4],
|
|
12252
|
+
sourceId: rest[5],
|
|
12253
|
+
sourceType: rest[6],
|
|
12254
|
+
messages: rest[7],
|
|
12255
|
+
toolEvents: rest[8],
|
|
12256
|
+
mode: rest[9],
|
|
12257
|
+
idempotencyKey: rest[10]
|
|
12258
|
+
};
|
|
12259
|
+
}
|
|
12260
|
+
const scope = params.scope;
|
|
12261
|
+
const userId = params.userId;
|
|
12262
|
+
const agentId = params.agentId;
|
|
12263
|
+
const sessionId = params.sessionId;
|
|
12264
|
+
const runId = params.runId;
|
|
12265
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
12266
|
+
const sourceId = params.sourceId;
|
|
12267
|
+
const sourceType = params.sourceType;
|
|
12268
|
+
const messages = params.messages;
|
|
12269
|
+
const toolEvents = params.toolEvents;
|
|
12270
|
+
const mode = params.mode;
|
|
12271
|
+
const idempotencyKey = params.idempotencyKey;
|
|
12272
|
+
const apiPath = "/memory/memories/distillations";
|
|
12273
|
+
const payload = {};
|
|
12274
|
+
if (typeof scope !== "undefined") {
|
|
12275
|
+
payload["scope"] = scope;
|
|
12276
|
+
}
|
|
12277
|
+
if (typeof userId !== "undefined") {
|
|
12278
|
+
payload["userId"] = userId;
|
|
12279
|
+
}
|
|
12280
|
+
if (typeof agentId !== "undefined") {
|
|
12281
|
+
payload["agentId"] = agentId;
|
|
12282
|
+
}
|
|
12283
|
+
if (typeof sessionId !== "undefined") {
|
|
12284
|
+
payload["sessionId"] = sessionId;
|
|
12285
|
+
}
|
|
12286
|
+
if (typeof runId !== "undefined") {
|
|
12287
|
+
payload["runId"] = runId;
|
|
12288
|
+
}
|
|
12289
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
12290
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
12291
|
+
}
|
|
12292
|
+
if (typeof sourceId !== "undefined") {
|
|
12293
|
+
payload["sourceId"] = sourceId;
|
|
12294
|
+
}
|
|
12295
|
+
if (typeof sourceType !== "undefined") {
|
|
12296
|
+
payload["sourceType"] = sourceType;
|
|
12297
|
+
}
|
|
12298
|
+
if (typeof messages !== "undefined") {
|
|
12299
|
+
payload["messages"] = messages;
|
|
12300
|
+
}
|
|
12301
|
+
if (typeof toolEvents !== "undefined") {
|
|
12302
|
+
payload["toolEvents"] = toolEvents;
|
|
12303
|
+
}
|
|
12304
|
+
if (typeof mode !== "undefined") {
|
|
12305
|
+
payload["mode"] = mode;
|
|
12306
|
+
}
|
|
12307
|
+
if (typeof idempotencyKey !== "undefined") {
|
|
12308
|
+
payload["idempotencyKey"] = idempotencyKey;
|
|
12309
|
+
}
|
|
12310
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
12311
|
+
const apiHeaders = {
|
|
12312
|
+
"content-type": "application/json"
|
|
12313
|
+
};
|
|
12314
|
+
return this.client.call(
|
|
12315
|
+
"post",
|
|
12316
|
+
uri,
|
|
12317
|
+
apiHeaders,
|
|
12318
|
+
payload
|
|
12319
|
+
);
|
|
12320
|
+
}
|
|
12321
|
+
getDistillation(paramsOrFirst, ...rest) {
|
|
12322
|
+
let params;
|
|
12323
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
12324
|
+
params = paramsOrFirst || {};
|
|
12325
|
+
} else {
|
|
12326
|
+
params = {
|
|
12327
|
+
distillationId: paramsOrFirst,
|
|
12328
|
+
scope: rest[0],
|
|
12329
|
+
userId: rest[1],
|
|
12330
|
+
agentId: rest[2],
|
|
12331
|
+
sessionId: rest[3],
|
|
12332
|
+
runId: rest[4],
|
|
12333
|
+
memorySubStoreId: rest[5]
|
|
12334
|
+
};
|
|
12335
|
+
}
|
|
12336
|
+
const distillationId = params.distillationId;
|
|
12337
|
+
const scope = params.scope;
|
|
12338
|
+
const userId = params.userId;
|
|
12339
|
+
const agentId = params.agentId;
|
|
12340
|
+
const sessionId = params.sessionId;
|
|
12341
|
+
const runId = params.runId;
|
|
12342
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
12343
|
+
if (typeof distillationId === "undefined") {
|
|
12344
|
+
throw new AppBaseException('Missing required parameter: "distillationId"');
|
|
12345
|
+
}
|
|
12346
|
+
const apiPath = "/memory/memories/distillations/{distillationId}".replace("{distillationId}", distillationId);
|
|
12347
|
+
const payload = {};
|
|
12348
|
+
if (typeof scope !== "undefined") {
|
|
12349
|
+
payload["scope"] = scope;
|
|
12350
|
+
}
|
|
12351
|
+
if (typeof userId !== "undefined") {
|
|
12352
|
+
payload["userId"] = userId;
|
|
12353
|
+
}
|
|
12354
|
+
if (typeof agentId !== "undefined") {
|
|
12355
|
+
payload["agentId"] = agentId;
|
|
12356
|
+
}
|
|
12357
|
+
if (typeof sessionId !== "undefined") {
|
|
12358
|
+
payload["sessionId"] = sessionId;
|
|
12359
|
+
}
|
|
12360
|
+
if (typeof runId !== "undefined") {
|
|
12361
|
+
payload["runId"] = runId;
|
|
12362
|
+
}
|
|
12363
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
12364
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
12365
|
+
}
|
|
12366
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
12367
|
+
const apiHeaders = {};
|
|
12368
|
+
return this.client.call(
|
|
12369
|
+
"get",
|
|
12370
|
+
uri,
|
|
12371
|
+
apiHeaders,
|
|
12372
|
+
payload
|
|
12373
|
+
);
|
|
12374
|
+
}
|
|
12375
|
+
replayDistillation(paramsOrFirst, ...rest) {
|
|
12376
|
+
let params;
|
|
12377
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
12378
|
+
params = paramsOrFirst || {};
|
|
12379
|
+
} else {
|
|
12380
|
+
params = {
|
|
12381
|
+
distillationId: paramsOrFirst,
|
|
12382
|
+
scope: rest[0],
|
|
12383
|
+
userId: rest[1],
|
|
12384
|
+
agentId: rest[2],
|
|
12385
|
+
sessionId: rest[3],
|
|
12386
|
+
runId: rest[4],
|
|
12387
|
+
memorySubStoreId: rest[5]
|
|
12388
|
+
};
|
|
12389
|
+
}
|
|
12390
|
+
const distillationId = params.distillationId;
|
|
12391
|
+
const scope = params.scope;
|
|
12392
|
+
const userId = params.userId;
|
|
12393
|
+
const agentId = params.agentId;
|
|
12394
|
+
const sessionId = params.sessionId;
|
|
12395
|
+
const runId = params.runId;
|
|
12396
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
12397
|
+
if (typeof distillationId === "undefined") {
|
|
12398
|
+
throw new AppBaseException('Missing required parameter: "distillationId"');
|
|
12399
|
+
}
|
|
12400
|
+
const apiPath = "/memory/memories/distillations/{distillationId}/replay".replace("{distillationId}", distillationId);
|
|
12401
|
+
const payload = {};
|
|
12402
|
+
if (typeof scope !== "undefined") {
|
|
12403
|
+
payload["scope"] = scope;
|
|
12404
|
+
}
|
|
12405
|
+
if (typeof userId !== "undefined") {
|
|
12406
|
+
payload["userId"] = userId;
|
|
12407
|
+
}
|
|
12408
|
+
if (typeof agentId !== "undefined") {
|
|
12409
|
+
payload["agentId"] = agentId;
|
|
12410
|
+
}
|
|
12411
|
+
if (typeof sessionId !== "undefined") {
|
|
12412
|
+
payload["sessionId"] = sessionId;
|
|
12413
|
+
}
|
|
12414
|
+
if (typeof runId !== "undefined") {
|
|
12415
|
+
payload["runId"] = runId;
|
|
12416
|
+
}
|
|
12417
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
12418
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
12419
|
+
}
|
|
12420
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
12421
|
+
const apiHeaders = {
|
|
12422
|
+
"content-type": "application/json"
|
|
12423
|
+
};
|
|
12424
|
+
return this.client.call(
|
|
12425
|
+
"post",
|
|
12426
|
+
uri,
|
|
12427
|
+
apiHeaders,
|
|
12428
|
+
payload
|
|
12429
|
+
);
|
|
12430
|
+
}
|
|
12431
|
+
listExperiences(paramsOrFirst, ...rest) {
|
|
12432
|
+
let params;
|
|
12433
|
+
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 || "cursor" in paramsOrFirst || "limit" in paramsOrFirst)) {
|
|
12434
|
+
params = paramsOrFirst || {};
|
|
12435
|
+
} else {
|
|
12436
|
+
params = {
|
|
12437
|
+
scope: paramsOrFirst,
|
|
12438
|
+
userId: rest[0],
|
|
12439
|
+
agentId: rest[1],
|
|
12440
|
+
sessionId: rest[2],
|
|
12441
|
+
runId: rest[3],
|
|
12442
|
+
memorySubStoreId: rest[4],
|
|
12443
|
+
cursor: rest[5],
|
|
12444
|
+
limit: rest[6]
|
|
12445
|
+
};
|
|
12446
|
+
}
|
|
12447
|
+
const scope = params.scope;
|
|
12448
|
+
const userId = params.userId;
|
|
12449
|
+
const agentId = params.agentId;
|
|
12450
|
+
const sessionId = params.sessionId;
|
|
12451
|
+
const runId = params.runId;
|
|
12452
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
12453
|
+
const cursor = params.cursor;
|
|
12454
|
+
const limit = params.limit;
|
|
12455
|
+
const apiPath = "/memory/memories/experiences";
|
|
12456
|
+
const payload = {};
|
|
12457
|
+
if (typeof scope !== "undefined") {
|
|
12458
|
+
payload["scope"] = scope;
|
|
12459
|
+
}
|
|
12460
|
+
if (typeof userId !== "undefined") {
|
|
12461
|
+
payload["userId"] = userId;
|
|
12462
|
+
}
|
|
12463
|
+
if (typeof agentId !== "undefined") {
|
|
12464
|
+
payload["agentId"] = agentId;
|
|
12465
|
+
}
|
|
12466
|
+
if (typeof sessionId !== "undefined") {
|
|
12467
|
+
payload["sessionId"] = sessionId;
|
|
12468
|
+
}
|
|
12469
|
+
if (typeof runId !== "undefined") {
|
|
12470
|
+
payload["runId"] = runId;
|
|
12471
|
+
}
|
|
12472
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
12473
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
12474
|
+
}
|
|
12475
|
+
if (typeof cursor !== "undefined") {
|
|
12476
|
+
payload["cursor"] = cursor;
|
|
12477
|
+
}
|
|
12478
|
+
if (typeof limit !== "undefined") {
|
|
12479
|
+
payload["limit"] = limit;
|
|
12480
|
+
}
|
|
12481
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
12482
|
+
const apiHeaders = {};
|
|
12483
|
+
return this.client.call(
|
|
12484
|
+
"get",
|
|
12485
|
+
uri,
|
|
12486
|
+
apiHeaders,
|
|
12487
|
+
payload
|
|
12488
|
+
);
|
|
12489
|
+
}
|
|
12490
|
+
searchExperiences(paramsOrFirst, ...rest) {
|
|
12491
|
+
let params;
|
|
12492
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
12493
|
+
params = paramsOrFirst || {};
|
|
12494
|
+
} else {
|
|
12495
|
+
params = {
|
|
12496
|
+
query: paramsOrFirst,
|
|
12497
|
+
scope: rest[0],
|
|
12498
|
+
userId: rest[1],
|
|
12499
|
+
agentId: rest[2],
|
|
12500
|
+
sessionId: rest[3],
|
|
12501
|
+
runId: rest[4],
|
|
12502
|
+
memorySubStoreId: rest[5],
|
|
12503
|
+
cursor: rest[6],
|
|
12504
|
+
limit: rest[7],
|
|
12505
|
+
retrieval: rest[8]
|
|
12506
|
+
};
|
|
12507
|
+
}
|
|
12508
|
+
const query = params.query;
|
|
12509
|
+
const scope = params.scope;
|
|
12510
|
+
const userId = params.userId;
|
|
12511
|
+
const agentId = params.agentId;
|
|
12512
|
+
const sessionId = params.sessionId;
|
|
12513
|
+
const runId = params.runId;
|
|
12514
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
12515
|
+
const cursor = params.cursor;
|
|
12516
|
+
const limit = params.limit;
|
|
12517
|
+
const retrieval = params.retrieval;
|
|
12518
|
+
if (typeof query === "undefined") {
|
|
12519
|
+
throw new AppBaseException('Missing required parameter: "query"');
|
|
12520
|
+
}
|
|
12521
|
+
const apiPath = "/memory/memories/experiences/search";
|
|
12522
|
+
const payload = {};
|
|
12523
|
+
if (typeof scope !== "undefined") {
|
|
12524
|
+
payload["scope"] = scope;
|
|
12525
|
+
}
|
|
12526
|
+
if (typeof userId !== "undefined") {
|
|
12527
|
+
payload["userId"] = userId;
|
|
12528
|
+
}
|
|
12529
|
+
if (typeof agentId !== "undefined") {
|
|
12530
|
+
payload["agentId"] = agentId;
|
|
12531
|
+
}
|
|
12532
|
+
if (typeof sessionId !== "undefined") {
|
|
12533
|
+
payload["sessionId"] = sessionId;
|
|
12534
|
+
}
|
|
12535
|
+
if (typeof runId !== "undefined") {
|
|
12536
|
+
payload["runId"] = runId;
|
|
12537
|
+
}
|
|
12538
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
12539
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
12540
|
+
}
|
|
12541
|
+
if (typeof query !== "undefined") {
|
|
12542
|
+
payload["query"] = query;
|
|
12543
|
+
}
|
|
12544
|
+
if (typeof cursor !== "undefined") {
|
|
12545
|
+
payload["cursor"] = cursor;
|
|
12546
|
+
}
|
|
12547
|
+
if (typeof limit !== "undefined") {
|
|
12548
|
+
payload["limit"] = limit;
|
|
12549
|
+
}
|
|
12550
|
+
if (typeof retrieval !== "undefined") {
|
|
12551
|
+
payload["retrieval"] = retrieval;
|
|
12552
|
+
}
|
|
12553
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
12554
|
+
const apiHeaders = {
|
|
12555
|
+
"content-type": "application/json"
|
|
12556
|
+
};
|
|
12557
|
+
return this.client.call(
|
|
12558
|
+
"post",
|
|
12559
|
+
uri,
|
|
12560
|
+
apiHeaders,
|
|
12561
|
+
payload
|
|
12562
|
+
);
|
|
12563
|
+
}
|
|
12564
|
+
getExperience(paramsOrFirst, ...rest) {
|
|
12565
|
+
let params;
|
|
12566
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
12567
|
+
params = paramsOrFirst || {};
|
|
12568
|
+
} else {
|
|
12569
|
+
params = {
|
|
12570
|
+
knowledgeId: paramsOrFirst,
|
|
12571
|
+
scope: rest[0],
|
|
12572
|
+
userId: rest[1],
|
|
12573
|
+
agentId: rest[2],
|
|
12574
|
+
sessionId: rest[3],
|
|
12575
|
+
runId: rest[4],
|
|
12576
|
+
memorySubStoreId: rest[5]
|
|
12577
|
+
};
|
|
12578
|
+
}
|
|
12579
|
+
const knowledgeId = params.knowledgeId;
|
|
12580
|
+
const scope = params.scope;
|
|
12581
|
+
const userId = params.userId;
|
|
12582
|
+
const agentId = params.agentId;
|
|
12583
|
+
const sessionId = params.sessionId;
|
|
12584
|
+
const runId = params.runId;
|
|
12585
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
12586
|
+
if (typeof knowledgeId === "undefined") {
|
|
12587
|
+
throw new AppBaseException('Missing required parameter: "knowledgeId"');
|
|
12588
|
+
}
|
|
12589
|
+
const apiPath = "/memory/memories/experiences/{knowledgeId}".replace("{knowledgeId}", knowledgeId);
|
|
12590
|
+
const payload = {};
|
|
12591
|
+
if (typeof scope !== "undefined") {
|
|
12592
|
+
payload["scope"] = scope;
|
|
12593
|
+
}
|
|
12594
|
+
if (typeof userId !== "undefined") {
|
|
12595
|
+
payload["userId"] = userId;
|
|
12596
|
+
}
|
|
12597
|
+
if (typeof agentId !== "undefined") {
|
|
12598
|
+
payload["agentId"] = agentId;
|
|
12599
|
+
}
|
|
12600
|
+
if (typeof sessionId !== "undefined") {
|
|
12601
|
+
payload["sessionId"] = sessionId;
|
|
12602
|
+
}
|
|
12603
|
+
if (typeof runId !== "undefined") {
|
|
12604
|
+
payload["runId"] = runId;
|
|
12605
|
+
}
|
|
12606
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
12607
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
12608
|
+
}
|
|
12609
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
12610
|
+
const apiHeaders = {};
|
|
12611
|
+
return this.client.call(
|
|
12612
|
+
"get",
|
|
12613
|
+
uri,
|
|
12614
|
+
apiHeaders,
|
|
12615
|
+
payload
|
|
12616
|
+
);
|
|
12617
|
+
}
|
|
12618
|
+
listExperienceSources(paramsOrFirst, ...rest) {
|
|
12619
|
+
let params;
|
|
12620
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
12621
|
+
params = paramsOrFirst || {};
|
|
12622
|
+
} else {
|
|
12623
|
+
params = {
|
|
12624
|
+
knowledgeId: paramsOrFirst,
|
|
12625
|
+
scope: rest[0],
|
|
12626
|
+
userId: rest[1],
|
|
12627
|
+
agentId: rest[2],
|
|
12628
|
+
sessionId: rest[3],
|
|
12629
|
+
runId: rest[4],
|
|
12630
|
+
memorySubStoreId: rest[5],
|
|
12631
|
+
cursor: rest[6],
|
|
12632
|
+
limit: rest[7]
|
|
12633
|
+
};
|
|
12634
|
+
}
|
|
12635
|
+
const knowledgeId = params.knowledgeId;
|
|
12636
|
+
const scope = params.scope;
|
|
12637
|
+
const userId = params.userId;
|
|
12638
|
+
const agentId = params.agentId;
|
|
12639
|
+
const sessionId = params.sessionId;
|
|
12640
|
+
const runId = params.runId;
|
|
12641
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
12642
|
+
const cursor = params.cursor;
|
|
12643
|
+
const limit = params.limit;
|
|
12644
|
+
if (typeof knowledgeId === "undefined") {
|
|
12645
|
+
throw new AppBaseException('Missing required parameter: "knowledgeId"');
|
|
12646
|
+
}
|
|
12647
|
+
const apiPath = "/memory/memories/experiences/{knowledgeId}/sources".replace("{knowledgeId}", knowledgeId);
|
|
12648
|
+
const payload = {};
|
|
12649
|
+
if (typeof scope !== "undefined") {
|
|
12650
|
+
payload["scope"] = scope;
|
|
12651
|
+
}
|
|
12652
|
+
if (typeof userId !== "undefined") {
|
|
12653
|
+
payload["userId"] = userId;
|
|
12654
|
+
}
|
|
12655
|
+
if (typeof agentId !== "undefined") {
|
|
12656
|
+
payload["agentId"] = agentId;
|
|
12657
|
+
}
|
|
12658
|
+
if (typeof sessionId !== "undefined") {
|
|
12659
|
+
payload["sessionId"] = sessionId;
|
|
12660
|
+
}
|
|
12661
|
+
if (typeof runId !== "undefined") {
|
|
12662
|
+
payload["runId"] = runId;
|
|
12663
|
+
}
|
|
12664
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
12665
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
12666
|
+
}
|
|
12667
|
+
if (typeof cursor !== "undefined") {
|
|
12668
|
+
payload["cursor"] = cursor;
|
|
12669
|
+
}
|
|
12670
|
+
if (typeof limit !== "undefined") {
|
|
12671
|
+
payload["limit"] = limit;
|
|
12672
|
+
}
|
|
12673
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
12674
|
+
const apiHeaders = {};
|
|
12675
|
+
return this.client.call(
|
|
12676
|
+
"get",
|
|
12677
|
+
uri,
|
|
12678
|
+
apiHeaders,
|
|
12679
|
+
payload
|
|
12680
|
+
);
|
|
12681
|
+
}
|
|
12682
|
+
getExport(paramsOrFirst, ...rest) {
|
|
12683
|
+
let params;
|
|
12684
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
12685
|
+
params = paramsOrFirst || {};
|
|
12686
|
+
} else {
|
|
12687
|
+
params = {
|
|
12688
|
+
userId: paramsOrFirst,
|
|
12689
|
+
format: rest[0],
|
|
12690
|
+
mode: rest[1],
|
|
12691
|
+
includeForgotten: rest[2],
|
|
12692
|
+
includeVectors: rest[3],
|
|
12693
|
+
includeRawSources: rest[4]
|
|
12694
|
+
};
|
|
12695
|
+
}
|
|
12696
|
+
const userId = params.userId;
|
|
12697
|
+
const format = params.format;
|
|
12698
|
+
const mode = params.mode;
|
|
12699
|
+
const includeForgotten = params.includeForgotten;
|
|
12700
|
+
const includeVectors = params.includeVectors;
|
|
12701
|
+
const includeRawSources = params.includeRawSources;
|
|
12702
|
+
if (typeof userId === "undefined") {
|
|
12703
|
+
throw new AppBaseException('Missing required parameter: "userId"');
|
|
12704
|
+
}
|
|
12705
|
+
const apiPath = "/memory/memories/export";
|
|
12706
|
+
const payload = {};
|
|
12707
|
+
if (typeof userId !== "undefined") {
|
|
12708
|
+
payload["userId"] = userId;
|
|
12709
|
+
}
|
|
12710
|
+
if (typeof format !== "undefined") {
|
|
12711
|
+
payload["format"] = format;
|
|
12712
|
+
}
|
|
12713
|
+
if (typeof mode !== "undefined") {
|
|
12714
|
+
payload["mode"] = mode;
|
|
12715
|
+
}
|
|
12716
|
+
if (typeof includeForgotten !== "undefined") {
|
|
12717
|
+
payload["includeForgotten"] = includeForgotten;
|
|
12718
|
+
}
|
|
12719
|
+
if (typeof includeVectors !== "undefined") {
|
|
12720
|
+
payload["includeVectors"] = includeVectors;
|
|
12721
|
+
}
|
|
12722
|
+
if (typeof includeRawSources !== "undefined") {
|
|
12723
|
+
payload["includeRawSources"] = includeRawSources;
|
|
12724
|
+
}
|
|
12725
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
12726
|
+
const apiHeaders = {};
|
|
12727
|
+
return this.client.call(
|
|
12728
|
+
"get",
|
|
12729
|
+
uri,
|
|
12730
|
+
apiHeaders,
|
|
12731
|
+
payload
|
|
12732
|
+
);
|
|
12733
|
+
}
|
|
12734
|
+
createExport(paramsOrFirst, ...rest) {
|
|
12735
|
+
let params;
|
|
12736
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
12737
|
+
params = paramsOrFirst || {};
|
|
12738
|
+
} else {
|
|
12739
|
+
params = {
|
|
12740
|
+
userId: paramsOrFirst,
|
|
12741
|
+
format: rest[0],
|
|
12742
|
+
includeForgotten: rest[1],
|
|
12743
|
+
includeVectors: rest[2],
|
|
12744
|
+
includeRawSources: rest[3],
|
|
12745
|
+
mode: rest[4]
|
|
12746
|
+
};
|
|
12747
|
+
}
|
|
12748
|
+
const userId = params.userId;
|
|
12749
|
+
const format = params.format;
|
|
12750
|
+
const includeForgotten = params.includeForgotten;
|
|
12751
|
+
const includeVectors = params.includeVectors;
|
|
12752
|
+
const includeRawSources = params.includeRawSources;
|
|
12753
|
+
const mode = params.mode;
|
|
12754
|
+
if (typeof userId === "undefined") {
|
|
12755
|
+
throw new AppBaseException('Missing required parameter: "userId"');
|
|
12756
|
+
}
|
|
12757
|
+
const apiPath = "/memory/memories/exports";
|
|
12758
|
+
const payload = {};
|
|
12759
|
+
if (typeof userId !== "undefined") {
|
|
12760
|
+
payload["userId"] = userId;
|
|
12761
|
+
}
|
|
12762
|
+
if (typeof format !== "undefined") {
|
|
12763
|
+
payload["format"] = format;
|
|
12764
|
+
}
|
|
12765
|
+
if (typeof includeForgotten !== "undefined") {
|
|
12766
|
+
payload["includeForgotten"] = includeForgotten;
|
|
12767
|
+
}
|
|
12768
|
+
if (typeof includeVectors !== "undefined") {
|
|
12769
|
+
payload["includeVectors"] = includeVectors;
|
|
12770
|
+
}
|
|
12771
|
+
if (typeof includeRawSources !== "undefined") {
|
|
12772
|
+
payload["includeRawSources"] = includeRawSources;
|
|
12773
|
+
}
|
|
12774
|
+
if (typeof mode !== "undefined") {
|
|
12775
|
+
payload["mode"] = mode;
|
|
12776
|
+
}
|
|
12777
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
12778
|
+
const apiHeaders = {
|
|
12779
|
+
"content-type": "application/json"
|
|
12780
|
+
};
|
|
12781
|
+
return this.client.call(
|
|
12782
|
+
"post",
|
|
12783
|
+
uri,
|
|
12784
|
+
apiHeaders,
|
|
12785
|
+
payload
|
|
12786
|
+
);
|
|
12787
|
+
}
|
|
12788
|
+
getExportJob(paramsOrFirst) {
|
|
12789
|
+
let params;
|
|
12790
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
12791
|
+
params = paramsOrFirst || {};
|
|
12792
|
+
} else {
|
|
12793
|
+
params = {
|
|
12794
|
+
exportId: paramsOrFirst
|
|
12795
|
+
};
|
|
12796
|
+
}
|
|
12797
|
+
const exportId = params.exportId;
|
|
12798
|
+
if (typeof exportId === "undefined") {
|
|
12799
|
+
throw new AppBaseException('Missing required parameter: "exportId"');
|
|
12800
|
+
}
|
|
12801
|
+
const apiPath = "/memory/memories/exports/{exportId}".replace("{exportId}", exportId);
|
|
12802
|
+
const payload = {};
|
|
12803
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
12804
|
+
const apiHeaders = {};
|
|
12805
|
+
return this.client.call(
|
|
12806
|
+
"get",
|
|
12807
|
+
uri,
|
|
12808
|
+
apiHeaders,
|
|
12809
|
+
payload
|
|
12810
|
+
);
|
|
12811
|
+
}
|
|
12812
|
+
createKnowledgeFeedback(paramsOrFirst, ...rest) {
|
|
12813
|
+
let params;
|
|
12814
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
12815
|
+
params = paramsOrFirst || {};
|
|
12816
|
+
} else {
|
|
12817
|
+
params = {
|
|
12818
|
+
injectionId: paramsOrFirst,
|
|
12819
|
+
knowledgeId: rest[0],
|
|
12820
|
+
revision: rest[1],
|
|
12821
|
+
feedbackType: rest[2],
|
|
12822
|
+
scope: rest[3],
|
|
12823
|
+
userId: rest[4],
|
|
12824
|
+
agentId: rest[5],
|
|
12825
|
+
sessionId: rest[6],
|
|
12826
|
+
runId: rest[7],
|
|
12827
|
+
memorySubStoreId: rest[8],
|
|
12828
|
+
reasonCode: rest[9],
|
|
12829
|
+
idempotencyKey: rest[10]
|
|
12830
|
+
};
|
|
12831
|
+
}
|
|
12832
|
+
const injectionId = params.injectionId;
|
|
12833
|
+
const knowledgeId = params.knowledgeId;
|
|
12834
|
+
const revision = params.revision;
|
|
12835
|
+
const feedbackType = params.feedbackType;
|
|
12836
|
+
const scope = params.scope;
|
|
12837
|
+
const userId = params.userId;
|
|
12838
|
+
const agentId = params.agentId;
|
|
12839
|
+
const sessionId = params.sessionId;
|
|
12840
|
+
const runId = params.runId;
|
|
12841
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
12842
|
+
const reasonCode = params.reasonCode;
|
|
12843
|
+
const idempotencyKey = params.idempotencyKey;
|
|
12844
|
+
if (typeof injectionId === "undefined") {
|
|
12845
|
+
throw new AppBaseException('Missing required parameter: "injectionId"');
|
|
12846
|
+
}
|
|
12847
|
+
if (typeof knowledgeId === "undefined") {
|
|
12848
|
+
throw new AppBaseException('Missing required parameter: "knowledgeId"');
|
|
12849
|
+
}
|
|
12850
|
+
if (typeof revision === "undefined") {
|
|
12851
|
+
throw new AppBaseException('Missing required parameter: "revision"');
|
|
12852
|
+
}
|
|
12853
|
+
if (typeof feedbackType === "undefined") {
|
|
12854
|
+
throw new AppBaseException('Missing required parameter: "feedbackType"');
|
|
12855
|
+
}
|
|
12856
|
+
const apiPath = "/memory/memories/feedback";
|
|
12857
|
+
const payload = {};
|
|
12858
|
+
if (typeof scope !== "undefined") {
|
|
12859
|
+
payload["scope"] = scope;
|
|
12860
|
+
}
|
|
12861
|
+
if (typeof userId !== "undefined") {
|
|
12862
|
+
payload["userId"] = userId;
|
|
12863
|
+
}
|
|
12864
|
+
if (typeof agentId !== "undefined") {
|
|
12865
|
+
payload["agentId"] = agentId;
|
|
12866
|
+
}
|
|
12867
|
+
if (typeof sessionId !== "undefined") {
|
|
12868
|
+
payload["sessionId"] = sessionId;
|
|
12869
|
+
}
|
|
12870
|
+
if (typeof runId !== "undefined") {
|
|
12871
|
+
payload["runId"] = runId;
|
|
12872
|
+
}
|
|
12873
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
12874
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
12875
|
+
}
|
|
12876
|
+
if (typeof injectionId !== "undefined") {
|
|
12877
|
+
payload["injectionId"] = injectionId;
|
|
12878
|
+
}
|
|
12879
|
+
if (typeof knowledgeId !== "undefined") {
|
|
12880
|
+
payload["knowledgeId"] = knowledgeId;
|
|
12881
|
+
}
|
|
12882
|
+
if (typeof revision !== "undefined") {
|
|
12883
|
+
payload["revision"] = revision;
|
|
12884
|
+
}
|
|
12885
|
+
if (typeof feedbackType !== "undefined") {
|
|
12886
|
+
payload["feedbackType"] = feedbackType;
|
|
12887
|
+
}
|
|
12888
|
+
if (typeof reasonCode !== "undefined") {
|
|
12889
|
+
payload["reasonCode"] = reasonCode;
|
|
12890
|
+
}
|
|
12891
|
+
if (typeof idempotencyKey !== "undefined") {
|
|
12892
|
+
payload["idempotencyKey"] = idempotencyKey;
|
|
12893
|
+
}
|
|
12894
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
12895
|
+
const apiHeaders = {
|
|
12896
|
+
"content-type": "application/json"
|
|
12897
|
+
};
|
|
12898
|
+
return this.client.call(
|
|
12899
|
+
"post",
|
|
12900
|
+
uri,
|
|
12901
|
+
apiHeaders,
|
|
12902
|
+
payload
|
|
12903
|
+
);
|
|
12904
|
+
}
|
|
12905
|
+
createImport(paramsOrFirst, ...rest) {
|
|
12906
|
+
let params;
|
|
12907
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
12908
|
+
params = paramsOrFirst || {};
|
|
12909
|
+
} else {
|
|
12910
|
+
params = {
|
|
12911
|
+
userId: paramsOrFirst,
|
|
12912
|
+
format: rest[0],
|
|
12913
|
+
data: rest[1],
|
|
12914
|
+
records: rest[2],
|
|
12915
|
+
dryRun: rest[3]
|
|
12916
|
+
};
|
|
12917
|
+
}
|
|
12918
|
+
const userId = params.userId;
|
|
12919
|
+
const format = params.format;
|
|
12920
|
+
const data = params.data;
|
|
12921
|
+
const records = params.records;
|
|
12922
|
+
const dryRun = params.dryRun;
|
|
12923
|
+
if (typeof userId === "undefined") {
|
|
12924
|
+
throw new AppBaseException('Missing required parameter: "userId"');
|
|
12925
|
+
}
|
|
12926
|
+
const apiPath = "/memory/memories/imports";
|
|
12927
|
+
const payload = {};
|
|
12928
|
+
if (typeof userId !== "undefined") {
|
|
12929
|
+
payload["userId"] = userId;
|
|
12930
|
+
}
|
|
12931
|
+
if (typeof format !== "undefined") {
|
|
12932
|
+
payload["format"] = format;
|
|
12933
|
+
}
|
|
12934
|
+
if (typeof data !== "undefined") {
|
|
12935
|
+
payload["data"] = data;
|
|
12936
|
+
}
|
|
12937
|
+
if (typeof records !== "undefined") {
|
|
12938
|
+
payload["records"] = records;
|
|
12939
|
+
}
|
|
12940
|
+
if (typeof dryRun !== "undefined") {
|
|
12941
|
+
payload["dryRun"] = dryRun;
|
|
12942
|
+
}
|
|
12943
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
12944
|
+
const apiHeaders = {
|
|
12945
|
+
"content-type": "application/json"
|
|
12946
|
+
};
|
|
12947
|
+
return this.client.call(
|
|
12948
|
+
"post",
|
|
12949
|
+
uri,
|
|
12950
|
+
apiHeaders,
|
|
12951
|
+
payload
|
|
12952
|
+
);
|
|
12953
|
+
}
|
|
12954
|
+
getImport(paramsOrFirst) {
|
|
12955
|
+
let params;
|
|
12956
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
12957
|
+
params = paramsOrFirst || {};
|
|
12958
|
+
} else {
|
|
12959
|
+
params = {
|
|
12960
|
+
importId: paramsOrFirst
|
|
12961
|
+
};
|
|
12962
|
+
}
|
|
12963
|
+
const importId = params.importId;
|
|
12964
|
+
if (typeof importId === "undefined") {
|
|
12965
|
+
throw new AppBaseException('Missing required parameter: "importId"');
|
|
12966
|
+
}
|
|
12967
|
+
const apiPath = "/memory/memories/imports/{importId}".replace("{importId}", importId);
|
|
12968
|
+
const payload = {};
|
|
12969
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
12970
|
+
const apiHeaders = {};
|
|
12971
|
+
return this.client.call(
|
|
12972
|
+
"get",
|
|
12973
|
+
uri,
|
|
12974
|
+
apiHeaders,
|
|
12975
|
+
payload
|
|
12976
|
+
);
|
|
12977
|
+
}
|
|
12978
|
+
updateKnowledge(paramsOrFirst, ...rest) {
|
|
12979
|
+
let params;
|
|
12980
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
12981
|
+
params = paramsOrFirst || {};
|
|
12982
|
+
} else {
|
|
12983
|
+
params = {
|
|
12984
|
+
knowledgeId: paramsOrFirst,
|
|
12985
|
+
expectedVersion: rest[0],
|
|
12986
|
+
scope: rest[1],
|
|
12987
|
+
userId: rest[2],
|
|
12988
|
+
agentId: rest[3],
|
|
12989
|
+
sessionId: rest[4],
|
|
12990
|
+
runId: rest[5],
|
|
12991
|
+
memorySubStoreId: rest[6],
|
|
12992
|
+
status: rest[7],
|
|
12993
|
+
validationStatus: rest[8]
|
|
12994
|
+
};
|
|
12995
|
+
}
|
|
12996
|
+
const knowledgeId = params.knowledgeId;
|
|
12997
|
+
const expectedVersion = params.expectedVersion;
|
|
12998
|
+
const scope = params.scope;
|
|
12999
|
+
const userId = params.userId;
|
|
13000
|
+
const agentId = params.agentId;
|
|
13001
|
+
const sessionId = params.sessionId;
|
|
13002
|
+
const runId = params.runId;
|
|
13003
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
13004
|
+
const status = params.status;
|
|
13005
|
+
const validationStatus = params.validationStatus;
|
|
13006
|
+
if (typeof knowledgeId === "undefined") {
|
|
13007
|
+
throw new AppBaseException('Missing required parameter: "knowledgeId"');
|
|
13008
|
+
}
|
|
13009
|
+
if (typeof expectedVersion === "undefined") {
|
|
13010
|
+
throw new AppBaseException('Missing required parameter: "expectedVersion"');
|
|
13011
|
+
}
|
|
13012
|
+
const apiPath = "/memory/memories/knowledge/{knowledgeId}".replace("{knowledgeId}", knowledgeId);
|
|
13013
|
+
const payload = {};
|
|
13014
|
+
if (typeof scope !== "undefined") {
|
|
13015
|
+
payload["scope"] = scope;
|
|
13016
|
+
}
|
|
13017
|
+
if (typeof userId !== "undefined") {
|
|
13018
|
+
payload["userId"] = userId;
|
|
13019
|
+
}
|
|
13020
|
+
if (typeof agentId !== "undefined") {
|
|
13021
|
+
payload["agentId"] = agentId;
|
|
13022
|
+
}
|
|
13023
|
+
if (typeof sessionId !== "undefined") {
|
|
13024
|
+
payload["sessionId"] = sessionId;
|
|
13025
|
+
}
|
|
13026
|
+
if (typeof runId !== "undefined") {
|
|
13027
|
+
payload["runId"] = runId;
|
|
13028
|
+
}
|
|
13029
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
13030
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
13031
|
+
}
|
|
13032
|
+
if (typeof expectedVersion !== "undefined") {
|
|
13033
|
+
payload["expectedVersion"] = expectedVersion;
|
|
13034
|
+
}
|
|
13035
|
+
if (typeof status !== "undefined") {
|
|
13036
|
+
payload["status"] = status;
|
|
13037
|
+
}
|
|
13038
|
+
if (typeof validationStatus !== "undefined") {
|
|
13039
|
+
payload["validationStatus"] = validationStatus;
|
|
13040
|
+
}
|
|
13041
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
13042
|
+
const apiHeaders = {
|
|
13043
|
+
"content-type": "application/json"
|
|
13044
|
+
};
|
|
13045
|
+
return this.client.call(
|
|
13046
|
+
"patch",
|
|
13047
|
+
uri,
|
|
13048
|
+
apiHeaders,
|
|
13049
|
+
payload
|
|
13050
|
+
);
|
|
13051
|
+
}
|
|
13052
|
+
forgetKnowledge(paramsOrFirst, ...rest) {
|
|
13053
|
+
let params;
|
|
13054
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
13055
|
+
params = paramsOrFirst || {};
|
|
13056
|
+
} else {
|
|
13057
|
+
params = {
|
|
13058
|
+
knowledgeId: paramsOrFirst,
|
|
13059
|
+
expectedVersion: rest[0],
|
|
13060
|
+
scope: rest[1],
|
|
13061
|
+
userId: rest[2],
|
|
13062
|
+
agentId: rest[3],
|
|
13063
|
+
sessionId: rest[4],
|
|
13064
|
+
runId: rest[5],
|
|
13065
|
+
memorySubStoreId: rest[6],
|
|
13066
|
+
reason: rest[7],
|
|
13067
|
+
source: rest[8]
|
|
13068
|
+
};
|
|
13069
|
+
}
|
|
13070
|
+
const knowledgeId = params.knowledgeId;
|
|
13071
|
+
const expectedVersion = params.expectedVersion;
|
|
13072
|
+
const scope = params.scope;
|
|
13073
|
+
const userId = params.userId;
|
|
13074
|
+
const agentId = params.agentId;
|
|
13075
|
+
const sessionId = params.sessionId;
|
|
13076
|
+
const runId = params.runId;
|
|
13077
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
13078
|
+
const reason = params.reason;
|
|
13079
|
+
const source = params.source;
|
|
13080
|
+
if (typeof knowledgeId === "undefined") {
|
|
13081
|
+
throw new AppBaseException('Missing required parameter: "knowledgeId"');
|
|
13082
|
+
}
|
|
13083
|
+
if (typeof expectedVersion === "undefined") {
|
|
13084
|
+
throw new AppBaseException('Missing required parameter: "expectedVersion"');
|
|
13085
|
+
}
|
|
13086
|
+
const apiPath = "/memory/memories/knowledge/{knowledgeId}".replace("{knowledgeId}", knowledgeId);
|
|
13087
|
+
const payload = {};
|
|
13088
|
+
if (typeof scope !== "undefined") {
|
|
13089
|
+
payload["scope"] = scope;
|
|
13090
|
+
}
|
|
13091
|
+
if (typeof userId !== "undefined") {
|
|
13092
|
+
payload["userId"] = userId;
|
|
13093
|
+
}
|
|
13094
|
+
if (typeof agentId !== "undefined") {
|
|
13095
|
+
payload["agentId"] = agentId;
|
|
13096
|
+
}
|
|
13097
|
+
if (typeof sessionId !== "undefined") {
|
|
13098
|
+
payload["sessionId"] = sessionId;
|
|
13099
|
+
}
|
|
13100
|
+
if (typeof runId !== "undefined") {
|
|
13101
|
+
payload["runId"] = runId;
|
|
13102
|
+
}
|
|
13103
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
13104
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
13105
|
+
}
|
|
13106
|
+
if (typeof expectedVersion !== "undefined") {
|
|
13107
|
+
payload["expectedVersion"] = expectedVersion;
|
|
13108
|
+
}
|
|
13109
|
+
if (typeof reason !== "undefined") {
|
|
13110
|
+
payload["reason"] = reason;
|
|
13111
|
+
}
|
|
13112
|
+
if (typeof source !== "undefined") {
|
|
13113
|
+
payload["source"] = source;
|
|
13114
|
+
}
|
|
13115
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
13116
|
+
const apiHeaders = {
|
|
13117
|
+
"content-type": "application/json"
|
|
13118
|
+
};
|
|
13119
|
+
return this.client.call(
|
|
13120
|
+
"delete",
|
|
13121
|
+
uri,
|
|
13122
|
+
apiHeaders,
|
|
13123
|
+
payload
|
|
13124
|
+
);
|
|
13125
|
+
}
|
|
13126
|
+
createKnowledgeObservation(paramsOrFirst, ...rest) {
|
|
13127
|
+
let params;
|
|
13128
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
13129
|
+
params = paramsOrFirst || {};
|
|
13130
|
+
} else {
|
|
13131
|
+
params = {
|
|
13132
|
+
knowledgeId: paramsOrFirst,
|
|
13133
|
+
revision: rest[0],
|
|
13134
|
+
outcome: rest[1],
|
|
13135
|
+
evidence: rest[2],
|
|
13136
|
+
scope: rest[3],
|
|
13137
|
+
userId: rest[4],
|
|
13138
|
+
agentId: rest[5],
|
|
13139
|
+
sessionId: rest[6],
|
|
13140
|
+
runId: rest[7],
|
|
13141
|
+
memorySubStoreId: rest[8],
|
|
13142
|
+
sourceId: rest[9],
|
|
13143
|
+
injectionId: rest[10],
|
|
13144
|
+
verificationSource: rest[11],
|
|
13145
|
+
toolName: rest[12],
|
|
13146
|
+
toolVersion: rest[13],
|
|
13147
|
+
toolSchemaVersion: rest[14],
|
|
13148
|
+
errorFingerprint: rest[15],
|
|
13149
|
+
weight: rest[16],
|
|
13150
|
+
observedAt: rest[17],
|
|
13151
|
+
idempotencyKey: rest[18]
|
|
13152
|
+
};
|
|
13153
|
+
}
|
|
13154
|
+
const knowledgeId = params.knowledgeId;
|
|
13155
|
+
const revision = params.revision;
|
|
13156
|
+
const outcome = params.outcome;
|
|
13157
|
+
const evidence = params.evidence;
|
|
13158
|
+
const scope = params.scope;
|
|
13159
|
+
const userId = params.userId;
|
|
13160
|
+
const agentId = params.agentId;
|
|
13161
|
+
const sessionId = params.sessionId;
|
|
13162
|
+
const runId = params.runId;
|
|
13163
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
13164
|
+
const sourceId = params.sourceId;
|
|
13165
|
+
const injectionId = params.injectionId;
|
|
13166
|
+
const verificationSource = params.verificationSource;
|
|
13167
|
+
const toolName = params.toolName;
|
|
13168
|
+
const toolVersion = params.toolVersion;
|
|
13169
|
+
const toolSchemaVersion = params.toolSchemaVersion;
|
|
13170
|
+
const errorFingerprint = params.errorFingerprint;
|
|
13171
|
+
const weight = params.weight;
|
|
13172
|
+
const observedAt = params.observedAt;
|
|
13173
|
+
const idempotencyKey = params.idempotencyKey;
|
|
13174
|
+
if (typeof knowledgeId === "undefined") {
|
|
13175
|
+
throw new AppBaseException('Missing required parameter: "knowledgeId"');
|
|
13176
|
+
}
|
|
13177
|
+
if (typeof revision === "undefined") {
|
|
13178
|
+
throw new AppBaseException('Missing required parameter: "revision"');
|
|
13179
|
+
}
|
|
13180
|
+
if (typeof outcome === "undefined") {
|
|
13181
|
+
throw new AppBaseException('Missing required parameter: "outcome"');
|
|
13182
|
+
}
|
|
13183
|
+
if (typeof evidence === "undefined") {
|
|
13184
|
+
throw new AppBaseException('Missing required parameter: "evidence"');
|
|
13185
|
+
}
|
|
13186
|
+
const apiPath = "/memory/memories/observations";
|
|
13187
|
+
const payload = {};
|
|
13188
|
+
if (typeof scope !== "undefined") {
|
|
13189
|
+
payload["scope"] = scope;
|
|
13190
|
+
}
|
|
13191
|
+
if (typeof userId !== "undefined") {
|
|
13192
|
+
payload["userId"] = userId;
|
|
13193
|
+
}
|
|
13194
|
+
if (typeof agentId !== "undefined") {
|
|
13195
|
+
payload["agentId"] = agentId;
|
|
13196
|
+
}
|
|
13197
|
+
if (typeof sessionId !== "undefined") {
|
|
13198
|
+
payload["sessionId"] = sessionId;
|
|
13199
|
+
}
|
|
13200
|
+
if (typeof runId !== "undefined") {
|
|
13201
|
+
payload["runId"] = runId;
|
|
13202
|
+
}
|
|
13203
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
13204
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
13205
|
+
}
|
|
13206
|
+
if (typeof knowledgeId !== "undefined") {
|
|
13207
|
+
payload["knowledgeId"] = knowledgeId;
|
|
13208
|
+
}
|
|
13209
|
+
if (typeof revision !== "undefined") {
|
|
13210
|
+
payload["revision"] = revision;
|
|
13211
|
+
}
|
|
13212
|
+
if (typeof sourceId !== "undefined") {
|
|
13213
|
+
payload["sourceId"] = sourceId;
|
|
13214
|
+
}
|
|
13215
|
+
if (typeof injectionId !== "undefined") {
|
|
13216
|
+
payload["injectionId"] = injectionId;
|
|
13217
|
+
}
|
|
13218
|
+
if (typeof outcome !== "undefined") {
|
|
13219
|
+
payload["outcome"] = outcome;
|
|
13220
|
+
}
|
|
13221
|
+
if (typeof verificationSource !== "undefined") {
|
|
13222
|
+
payload["verificationSource"] = verificationSource;
|
|
13223
|
+
}
|
|
13224
|
+
if (typeof toolName !== "undefined") {
|
|
13225
|
+
payload["toolName"] = toolName;
|
|
13226
|
+
}
|
|
13227
|
+
if (typeof toolVersion !== "undefined") {
|
|
13228
|
+
payload["toolVersion"] = toolVersion;
|
|
13229
|
+
}
|
|
13230
|
+
if (typeof toolSchemaVersion !== "undefined") {
|
|
13231
|
+
payload["toolSchemaVersion"] = toolSchemaVersion;
|
|
13232
|
+
}
|
|
13233
|
+
if (typeof errorFingerprint !== "undefined") {
|
|
13234
|
+
payload["errorFingerprint"] = errorFingerprint;
|
|
13235
|
+
}
|
|
13236
|
+
if (typeof evidence !== "undefined") {
|
|
13237
|
+
payload["evidence"] = evidence;
|
|
13238
|
+
}
|
|
13239
|
+
if (typeof weight !== "undefined") {
|
|
13240
|
+
payload["weight"] = weight;
|
|
13241
|
+
}
|
|
13242
|
+
if (typeof observedAt !== "undefined") {
|
|
13243
|
+
payload["observedAt"] = observedAt;
|
|
13244
|
+
}
|
|
13245
|
+
if (typeof idempotencyKey !== "undefined") {
|
|
13246
|
+
payload["idempotencyKey"] = idempotencyKey;
|
|
13247
|
+
}
|
|
13248
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
13249
|
+
const apiHeaders = {
|
|
13250
|
+
"content-type": "application/json"
|
|
13251
|
+
};
|
|
13252
|
+
return this.client.call(
|
|
13253
|
+
"post",
|
|
13254
|
+
uri,
|
|
13255
|
+
apiHeaders,
|
|
13256
|
+
payload
|
|
13257
|
+
);
|
|
13258
|
+
}
|
|
13259
|
+
createProjectionRebuild(paramsOrFirst, ...rest) {
|
|
13260
|
+
let params;
|
|
13261
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("routes" in paramsOrFirst || "cursor" in paramsOrFirst || "limit" in paramsOrFirst || "dryRun" in paramsOrFirst)) {
|
|
13262
|
+
params = paramsOrFirst || {};
|
|
13263
|
+
} else {
|
|
13264
|
+
params = {
|
|
13265
|
+
routes: paramsOrFirst,
|
|
13266
|
+
cursor: rest[0],
|
|
13267
|
+
limit: rest[1],
|
|
13268
|
+
dryRun: rest[2]
|
|
13269
|
+
};
|
|
13270
|
+
}
|
|
13271
|
+
const routes = params.routes;
|
|
13272
|
+
const cursor = params.cursor;
|
|
13273
|
+
const limit = params.limit;
|
|
13274
|
+
const dryRun = params.dryRun;
|
|
13275
|
+
if (typeof routes === "undefined") {
|
|
13276
|
+
throw new AppBaseException('Missing required parameter: "routes"');
|
|
13277
|
+
}
|
|
13278
|
+
const apiPath = "/memory/memories/projections/rebuild";
|
|
13279
|
+
const payload = {};
|
|
13280
|
+
if (typeof routes !== "undefined") {
|
|
13281
|
+
payload["routes"] = routes;
|
|
13282
|
+
}
|
|
13283
|
+
if (typeof cursor !== "undefined") {
|
|
13284
|
+
payload["cursor"] = cursor;
|
|
13285
|
+
}
|
|
13286
|
+
if (typeof limit !== "undefined") {
|
|
13287
|
+
payload["limit"] = limit;
|
|
13288
|
+
}
|
|
13289
|
+
if (typeof dryRun !== "undefined") {
|
|
13290
|
+
payload["dryRun"] = dryRun;
|
|
13291
|
+
}
|
|
13292
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
13293
|
+
const apiHeaders = {
|
|
13294
|
+
"content-type": "application/json"
|
|
13295
|
+
};
|
|
13296
|
+
return this.client.call(
|
|
13297
|
+
"post",
|
|
13298
|
+
uri,
|
|
13299
|
+
apiHeaders,
|
|
13300
|
+
payload
|
|
13301
|
+
);
|
|
13302
|
+
}
|
|
13303
|
+
/**
|
|
13304
|
+
* Get project memory projection recovery verification.
|
|
13305
|
+
*
|
|
13306
|
+
* @throws {AppBaseException}
|
|
13307
|
+
* @returns {Promise<{}>}
|
|
13308
|
+
*/
|
|
13309
|
+
getProjectionVerification() {
|
|
13310
|
+
const apiPath = "/memory/memories/projections/verification";
|
|
13311
|
+
const payload = {};
|
|
13312
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
13313
|
+
const apiHeaders = {};
|
|
13314
|
+
return this.client.call(
|
|
13315
|
+
"get",
|
|
13316
|
+
uri,
|
|
13317
|
+
apiHeaders,
|
|
13318
|
+
payload
|
|
13319
|
+
);
|
|
13320
|
+
}
|
|
13321
|
+
/**
|
|
13322
|
+
* Get a memory quality report.
|
|
13323
|
+
*
|
|
13324
|
+
* @throws {AppBaseException}
|
|
13325
|
+
* @returns {Promise<{}>}
|
|
13326
|
+
*/
|
|
13327
|
+
getQuality() {
|
|
13328
|
+
const apiPath = "/memory/memories/quality";
|
|
13329
|
+
const payload = {};
|
|
13330
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
13331
|
+
const apiHeaders = {};
|
|
13332
|
+
return this.client.call(
|
|
13333
|
+
"get",
|
|
13334
|
+
uri,
|
|
13335
|
+
apiHeaders,
|
|
13336
|
+
payload
|
|
13337
|
+
);
|
|
13338
|
+
}
|
|
13339
|
+
recallKnowledge(paramsOrFirst, ...rest) {
|
|
13340
|
+
let params;
|
|
13341
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
13342
|
+
params = paramsOrFirst || {};
|
|
13343
|
+
} else {
|
|
13344
|
+
params = {
|
|
13345
|
+
query: paramsOrFirst,
|
|
13346
|
+
scope: rest[0],
|
|
13347
|
+
userId: rest[1],
|
|
13348
|
+
agentId: rest[2],
|
|
13349
|
+
sessionId: rest[3],
|
|
13350
|
+
runId: rest[4],
|
|
13351
|
+
memorySubStoreId: rest[5],
|
|
13352
|
+
kinds: rest[6],
|
|
13353
|
+
limit: rest[7],
|
|
13354
|
+
tokenBudget: rest[8],
|
|
13355
|
+
retrieval: rest[9],
|
|
13356
|
+
accessMode: rest[10]
|
|
13357
|
+
};
|
|
13358
|
+
}
|
|
13359
|
+
const query = params.query;
|
|
13360
|
+
const scope = params.scope;
|
|
13361
|
+
const userId = params.userId;
|
|
13362
|
+
const agentId = params.agentId;
|
|
13363
|
+
const sessionId = params.sessionId;
|
|
13364
|
+
const runId = params.runId;
|
|
13365
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
13366
|
+
const kinds = params.kinds;
|
|
13367
|
+
const limit = params.limit;
|
|
13368
|
+
const tokenBudget = params.tokenBudget;
|
|
13369
|
+
const retrieval = params.retrieval;
|
|
13370
|
+
const accessMode = params.accessMode;
|
|
13371
|
+
if (typeof query === "undefined") {
|
|
13372
|
+
throw new AppBaseException('Missing required parameter: "query"');
|
|
13373
|
+
}
|
|
13374
|
+
const apiPath = "/memory/memories/recall";
|
|
13375
|
+
const payload = {};
|
|
13376
|
+
if (typeof scope !== "undefined") {
|
|
13377
|
+
payload["scope"] = scope;
|
|
13378
|
+
}
|
|
13379
|
+
if (typeof userId !== "undefined") {
|
|
13380
|
+
payload["userId"] = userId;
|
|
13381
|
+
}
|
|
13382
|
+
if (typeof agentId !== "undefined") {
|
|
13383
|
+
payload["agentId"] = agentId;
|
|
13384
|
+
}
|
|
13385
|
+
if (typeof sessionId !== "undefined") {
|
|
13386
|
+
payload["sessionId"] = sessionId;
|
|
13387
|
+
}
|
|
13388
|
+
if (typeof runId !== "undefined") {
|
|
13389
|
+
payload["runId"] = runId;
|
|
13390
|
+
}
|
|
13391
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
13392
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
13393
|
+
}
|
|
13394
|
+
if (typeof query !== "undefined") {
|
|
13395
|
+
payload["query"] = query;
|
|
13396
|
+
}
|
|
13397
|
+
if (typeof kinds !== "undefined") {
|
|
13398
|
+
payload["kinds"] = kinds;
|
|
13399
|
+
}
|
|
13400
|
+
if (typeof limit !== "undefined") {
|
|
13401
|
+
payload["limit"] = limit;
|
|
13402
|
+
}
|
|
13403
|
+
if (typeof tokenBudget !== "undefined") {
|
|
13404
|
+
payload["tokenBudget"] = tokenBudget;
|
|
13405
|
+
}
|
|
13406
|
+
if (typeof retrieval !== "undefined") {
|
|
13407
|
+
payload["retrieval"] = retrieval;
|
|
13408
|
+
}
|
|
13409
|
+
if (typeof accessMode !== "undefined") {
|
|
13410
|
+
payload["accessMode"] = accessMode;
|
|
13411
|
+
}
|
|
13412
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
13413
|
+
const apiHeaders = {
|
|
13414
|
+
"content-type": "application/json"
|
|
13415
|
+
};
|
|
13416
|
+
return this.client.call(
|
|
13417
|
+
"post",
|
|
13418
|
+
uri,
|
|
13419
|
+
apiHeaders,
|
|
13420
|
+
payload
|
|
13421
|
+
);
|
|
13422
|
+
}
|
|
13423
|
+
search(paramsOrFirst, ...rest) {
|
|
13424
|
+
let params;
|
|
13425
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
13426
|
+
params = paramsOrFirst || {};
|
|
13427
|
+
} else {
|
|
13428
|
+
params = {
|
|
13429
|
+
query: paramsOrFirst,
|
|
13430
|
+
searchMode: rest[0],
|
|
13431
|
+
retrieval: rest[1],
|
|
13432
|
+
userId: rest[2],
|
|
13433
|
+
agentId: rest[3],
|
|
13434
|
+
runId: rest[4],
|
|
13435
|
+
scope: rest[5],
|
|
13436
|
+
memoryType: rest[6],
|
|
13437
|
+
recordKind: rest[7],
|
|
13438
|
+
filter: rest[8],
|
|
13439
|
+
limit: rest[9],
|
|
13440
|
+
cursor: rest[10],
|
|
13441
|
+
sort: rest[11],
|
|
13442
|
+
memorySubStoreId: rest[12],
|
|
13443
|
+
sessionId: rest[13],
|
|
13444
|
+
groupId: rest[14],
|
|
13445
|
+
accessMode: rest[15]
|
|
13446
|
+
};
|
|
13447
|
+
}
|
|
13448
|
+
const query = params.query;
|
|
13449
|
+
const searchMode = params.searchMode;
|
|
13450
|
+
const retrieval = params.retrieval;
|
|
13451
|
+
const userId = params.userId;
|
|
13452
|
+
const agentId = params.agentId;
|
|
13453
|
+
const runId = params.runId;
|
|
13454
|
+
const scope = params.scope;
|
|
13455
|
+
const memoryType = params.memoryType;
|
|
13456
|
+
const recordKind = params.recordKind;
|
|
13457
|
+
const filter = params.filter;
|
|
13458
|
+
const limit = params.limit;
|
|
13459
|
+
const cursor = params.cursor;
|
|
13460
|
+
const sort = params.sort;
|
|
13461
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
13462
|
+
const sessionId = params.sessionId;
|
|
13463
|
+
const groupId = params.groupId;
|
|
13464
|
+
const accessMode = params.accessMode;
|
|
13465
|
+
if (typeof query === "undefined") {
|
|
13466
|
+
throw new AppBaseException('Missing required parameter: "query"');
|
|
13467
|
+
}
|
|
13468
|
+
const apiPath = "/memory/memories/search";
|
|
13469
|
+
const payload = {};
|
|
13470
|
+
if (typeof query !== "undefined") {
|
|
13471
|
+
payload["query"] = query;
|
|
13472
|
+
}
|
|
13473
|
+
if (typeof searchMode !== "undefined") {
|
|
13474
|
+
payload["searchMode"] = searchMode;
|
|
13475
|
+
}
|
|
13476
|
+
if (typeof retrieval !== "undefined") {
|
|
13477
|
+
payload["retrieval"] = retrieval;
|
|
13478
|
+
}
|
|
13479
|
+
if (typeof userId !== "undefined") {
|
|
13480
|
+
payload["userId"] = userId;
|
|
13481
|
+
}
|
|
13482
|
+
if (typeof agentId !== "undefined") {
|
|
13483
|
+
payload["agentId"] = agentId;
|
|
13484
|
+
}
|
|
13485
|
+
if (typeof runId !== "undefined") {
|
|
13486
|
+
payload["runId"] = runId;
|
|
13487
|
+
}
|
|
13488
|
+
if (typeof scope !== "undefined") {
|
|
13489
|
+
payload["scope"] = scope;
|
|
13490
|
+
}
|
|
13491
|
+
if (typeof memoryType !== "undefined") {
|
|
13492
|
+
payload["memoryType"] = memoryType;
|
|
13493
|
+
}
|
|
13494
|
+
if (typeof recordKind !== "undefined") {
|
|
13495
|
+
payload["recordKind"] = recordKind;
|
|
13496
|
+
}
|
|
13497
|
+
if (typeof filter !== "undefined") {
|
|
13498
|
+
payload["filter"] = filter;
|
|
13499
|
+
}
|
|
13500
|
+
if (typeof limit !== "undefined") {
|
|
13501
|
+
payload["limit"] = limit;
|
|
13502
|
+
}
|
|
13503
|
+
if (typeof cursor !== "undefined") {
|
|
13504
|
+
payload["cursor"] = cursor;
|
|
13505
|
+
}
|
|
13506
|
+
if (typeof sort !== "undefined") {
|
|
13507
|
+
payload["sort"] = sort;
|
|
13508
|
+
}
|
|
13509
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
13510
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
13511
|
+
}
|
|
13512
|
+
if (typeof sessionId !== "undefined") {
|
|
13513
|
+
payload["sessionId"] = sessionId;
|
|
13514
|
+
}
|
|
13515
|
+
if (typeof groupId !== "undefined") {
|
|
13516
|
+
payload["groupId"] = groupId;
|
|
13517
|
+
}
|
|
13518
|
+
if (typeof accessMode !== "undefined") {
|
|
13519
|
+
payload["accessMode"] = accessMode;
|
|
13520
|
+
}
|
|
13521
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
13522
|
+
const apiHeaders = {
|
|
13523
|
+
"content-type": "application/json"
|
|
13524
|
+
};
|
|
13525
|
+
return this.client.call(
|
|
13526
|
+
"post",
|
|
13527
|
+
uri,
|
|
13528
|
+
apiHeaders,
|
|
13529
|
+
payload
|
|
13530
|
+
);
|
|
13531
|
+
}
|
|
13532
|
+
/**
|
|
13533
|
+
* Get memory session aggregates.
|
|
13534
|
+
*
|
|
13535
|
+
* @throws {AppBaseException}
|
|
13536
|
+
* @returns {Promise<{}>}
|
|
13537
|
+
*/
|
|
13538
|
+
getSessions() {
|
|
13539
|
+
const apiPath = "/memory/memories/sessions";
|
|
13540
|
+
const payload = {};
|
|
13541
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
13542
|
+
const apiHeaders = {};
|
|
13543
|
+
return this.client.call(
|
|
13544
|
+
"get",
|
|
13545
|
+
uri,
|
|
13546
|
+
apiHeaders,
|
|
13547
|
+
payload
|
|
13548
|
+
);
|
|
13549
|
+
}
|
|
13550
|
+
listSkills(paramsOrFirst, ...rest) {
|
|
13551
|
+
let params;
|
|
13552
|
+
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 || "cursor" in paramsOrFirst || "limit" in paramsOrFirst)) {
|
|
13553
|
+
params = paramsOrFirst || {};
|
|
13554
|
+
} else {
|
|
13555
|
+
params = {
|
|
13556
|
+
scope: paramsOrFirst,
|
|
13557
|
+
userId: rest[0],
|
|
13558
|
+
agentId: rest[1],
|
|
13559
|
+
sessionId: rest[2],
|
|
13560
|
+
runId: rest[3],
|
|
13561
|
+
memorySubStoreId: rest[4],
|
|
13562
|
+
cursor: rest[5],
|
|
13563
|
+
limit: rest[6]
|
|
13564
|
+
};
|
|
13565
|
+
}
|
|
13566
|
+
const scope = params.scope;
|
|
13567
|
+
const userId = params.userId;
|
|
13568
|
+
const agentId = params.agentId;
|
|
13569
|
+
const sessionId = params.sessionId;
|
|
13570
|
+
const runId = params.runId;
|
|
13571
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
13572
|
+
const cursor = params.cursor;
|
|
13573
|
+
const limit = params.limit;
|
|
13574
|
+
const apiPath = "/memory/memories/skills";
|
|
13575
|
+
const payload = {};
|
|
13576
|
+
if (typeof scope !== "undefined") {
|
|
13577
|
+
payload["scope"] = scope;
|
|
13578
|
+
}
|
|
13579
|
+
if (typeof userId !== "undefined") {
|
|
13580
|
+
payload["userId"] = userId;
|
|
13581
|
+
}
|
|
13582
|
+
if (typeof agentId !== "undefined") {
|
|
13583
|
+
payload["agentId"] = agentId;
|
|
13584
|
+
}
|
|
13585
|
+
if (typeof sessionId !== "undefined") {
|
|
13586
|
+
payload["sessionId"] = sessionId;
|
|
13587
|
+
}
|
|
13588
|
+
if (typeof runId !== "undefined") {
|
|
13589
|
+
payload["runId"] = runId;
|
|
13590
|
+
}
|
|
13591
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
13592
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
13593
|
+
}
|
|
13594
|
+
if (typeof cursor !== "undefined") {
|
|
13595
|
+
payload["cursor"] = cursor;
|
|
13596
|
+
}
|
|
13597
|
+
if (typeof limit !== "undefined") {
|
|
13598
|
+
payload["limit"] = limit;
|
|
13599
|
+
}
|
|
13600
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
13601
|
+
const apiHeaders = {};
|
|
13602
|
+
return this.client.call(
|
|
13603
|
+
"get",
|
|
13604
|
+
uri,
|
|
13605
|
+
apiHeaders,
|
|
13606
|
+
payload
|
|
13607
|
+
);
|
|
13608
|
+
}
|
|
13609
|
+
searchSkills(paramsOrFirst, ...rest) {
|
|
13610
|
+
let params;
|
|
13611
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
13612
|
+
params = paramsOrFirst || {};
|
|
13613
|
+
} else {
|
|
13614
|
+
params = {
|
|
13615
|
+
query: paramsOrFirst,
|
|
13616
|
+
scope: rest[0],
|
|
13617
|
+
userId: rest[1],
|
|
13618
|
+
agentId: rest[2],
|
|
13619
|
+
sessionId: rest[3],
|
|
13620
|
+
runId: rest[4],
|
|
13621
|
+
memorySubStoreId: rest[5],
|
|
13622
|
+
cursor: rest[6],
|
|
13623
|
+
limit: rest[7],
|
|
13624
|
+
retrieval: rest[8]
|
|
13625
|
+
};
|
|
13626
|
+
}
|
|
13627
|
+
const query = params.query;
|
|
13628
|
+
const scope = params.scope;
|
|
13629
|
+
const userId = params.userId;
|
|
13630
|
+
const agentId = params.agentId;
|
|
13631
|
+
const sessionId = params.sessionId;
|
|
13632
|
+
const runId = params.runId;
|
|
13633
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
13634
|
+
const cursor = params.cursor;
|
|
13635
|
+
const limit = params.limit;
|
|
13636
|
+
const retrieval = params.retrieval;
|
|
13637
|
+
if (typeof query === "undefined") {
|
|
13638
|
+
throw new AppBaseException('Missing required parameter: "query"');
|
|
13639
|
+
}
|
|
13640
|
+
const apiPath = "/memory/memories/skills/search";
|
|
13641
|
+
const payload = {};
|
|
13642
|
+
if (typeof scope !== "undefined") {
|
|
13643
|
+
payload["scope"] = scope;
|
|
13644
|
+
}
|
|
13645
|
+
if (typeof userId !== "undefined") {
|
|
13646
|
+
payload["userId"] = userId;
|
|
13647
|
+
}
|
|
13648
|
+
if (typeof agentId !== "undefined") {
|
|
13649
|
+
payload["agentId"] = agentId;
|
|
13650
|
+
}
|
|
13651
|
+
if (typeof sessionId !== "undefined") {
|
|
13652
|
+
payload["sessionId"] = sessionId;
|
|
13653
|
+
}
|
|
13654
|
+
if (typeof runId !== "undefined") {
|
|
13655
|
+
payload["runId"] = runId;
|
|
13656
|
+
}
|
|
13657
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
13658
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
13659
|
+
}
|
|
13660
|
+
if (typeof query !== "undefined") {
|
|
13661
|
+
payload["query"] = query;
|
|
13662
|
+
}
|
|
13663
|
+
if (typeof cursor !== "undefined") {
|
|
13664
|
+
payload["cursor"] = cursor;
|
|
13665
|
+
}
|
|
13666
|
+
if (typeof limit !== "undefined") {
|
|
13667
|
+
payload["limit"] = limit;
|
|
13668
|
+
}
|
|
13669
|
+
if (typeof retrieval !== "undefined") {
|
|
13670
|
+
payload["retrieval"] = retrieval;
|
|
13671
|
+
}
|
|
13672
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
13673
|
+
const apiHeaders = {
|
|
13674
|
+
"content-type": "application/json"
|
|
13675
|
+
};
|
|
13676
|
+
return this.client.call(
|
|
13677
|
+
"post",
|
|
13678
|
+
uri,
|
|
13679
|
+
apiHeaders,
|
|
13680
|
+
payload
|
|
13681
|
+
);
|
|
13682
|
+
}
|
|
13683
|
+
getSkill(paramsOrFirst, ...rest) {
|
|
13684
|
+
let params;
|
|
13685
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
13686
|
+
params = paramsOrFirst || {};
|
|
13687
|
+
} else {
|
|
13688
|
+
params = {
|
|
13689
|
+
knowledgeId: paramsOrFirst,
|
|
13690
|
+
scope: rest[0],
|
|
13691
|
+
userId: rest[1],
|
|
13692
|
+
agentId: rest[2],
|
|
13693
|
+
sessionId: rest[3],
|
|
13694
|
+
runId: rest[4],
|
|
13695
|
+
memorySubStoreId: rest[5]
|
|
13696
|
+
};
|
|
13697
|
+
}
|
|
13698
|
+
const knowledgeId = params.knowledgeId;
|
|
13699
|
+
const scope = params.scope;
|
|
13700
|
+
const userId = params.userId;
|
|
13701
|
+
const agentId = params.agentId;
|
|
13702
|
+
const sessionId = params.sessionId;
|
|
13703
|
+
const runId = params.runId;
|
|
13704
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
13705
|
+
if (typeof knowledgeId === "undefined") {
|
|
13706
|
+
throw new AppBaseException('Missing required parameter: "knowledgeId"');
|
|
13707
|
+
}
|
|
13708
|
+
const apiPath = "/memory/memories/skills/{knowledgeId}".replace("{knowledgeId}", knowledgeId);
|
|
13709
|
+
const payload = {};
|
|
13710
|
+
if (typeof scope !== "undefined") {
|
|
13711
|
+
payload["scope"] = scope;
|
|
13712
|
+
}
|
|
13713
|
+
if (typeof userId !== "undefined") {
|
|
13714
|
+
payload["userId"] = userId;
|
|
13715
|
+
}
|
|
13716
|
+
if (typeof agentId !== "undefined") {
|
|
13717
|
+
payload["agentId"] = agentId;
|
|
13718
|
+
}
|
|
13719
|
+
if (typeof sessionId !== "undefined") {
|
|
13720
|
+
payload["sessionId"] = sessionId;
|
|
13721
|
+
}
|
|
13722
|
+
if (typeof runId !== "undefined") {
|
|
13723
|
+
payload["runId"] = runId;
|
|
13724
|
+
}
|
|
13725
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
13726
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
13727
|
+
}
|
|
13728
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
13729
|
+
const apiHeaders = {};
|
|
13730
|
+
return this.client.call(
|
|
13731
|
+
"get",
|
|
13732
|
+
uri,
|
|
13733
|
+
apiHeaders,
|
|
13734
|
+
payload
|
|
13735
|
+
);
|
|
13736
|
+
}
|
|
13737
|
+
listSkillSources(paramsOrFirst, ...rest) {
|
|
13738
|
+
let params;
|
|
13739
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
13740
|
+
params = paramsOrFirst || {};
|
|
13741
|
+
} else {
|
|
13742
|
+
params = {
|
|
13743
|
+
knowledgeId: paramsOrFirst,
|
|
13744
|
+
scope: rest[0],
|
|
13745
|
+
userId: rest[1],
|
|
13746
|
+
agentId: rest[2],
|
|
13747
|
+
sessionId: rest[3],
|
|
13748
|
+
runId: rest[4],
|
|
13749
|
+
memorySubStoreId: rest[5],
|
|
13750
|
+
cursor: rest[6],
|
|
13751
|
+
limit: rest[7]
|
|
13752
|
+
};
|
|
13753
|
+
}
|
|
13754
|
+
const knowledgeId = params.knowledgeId;
|
|
13755
|
+
const scope = params.scope;
|
|
13756
|
+
const userId = params.userId;
|
|
13757
|
+
const agentId = params.agentId;
|
|
13758
|
+
const sessionId = params.sessionId;
|
|
13759
|
+
const runId = params.runId;
|
|
13760
|
+
const memorySubStoreId = params.memorySubStoreId;
|
|
13761
|
+
const cursor = params.cursor;
|
|
13762
|
+
const limit = params.limit;
|
|
13763
|
+
if (typeof knowledgeId === "undefined") {
|
|
13764
|
+
throw new AppBaseException('Missing required parameter: "knowledgeId"');
|
|
13765
|
+
}
|
|
13766
|
+
const apiPath = "/memory/memories/skills/{knowledgeId}/sources".replace("{knowledgeId}", knowledgeId);
|
|
13767
|
+
const payload = {};
|
|
13768
|
+
if (typeof scope !== "undefined") {
|
|
13769
|
+
payload["scope"] = scope;
|
|
13770
|
+
}
|
|
13771
|
+
if (typeof userId !== "undefined") {
|
|
13772
|
+
payload["userId"] = userId;
|
|
13773
|
+
}
|
|
13774
|
+
if (typeof agentId !== "undefined") {
|
|
13775
|
+
payload["agentId"] = agentId;
|
|
13776
|
+
}
|
|
13777
|
+
if (typeof sessionId !== "undefined") {
|
|
13778
|
+
payload["sessionId"] = sessionId;
|
|
13779
|
+
}
|
|
13780
|
+
if (typeof runId !== "undefined") {
|
|
13781
|
+
payload["runId"] = runId;
|
|
13782
|
+
}
|
|
13783
|
+
if (typeof memorySubStoreId !== "undefined") {
|
|
13784
|
+
payload["memorySubStoreId"] = memorySubStoreId;
|
|
13785
|
+
}
|
|
13786
|
+
if (typeof cursor !== "undefined") {
|
|
13787
|
+
payload["cursor"] = cursor;
|
|
13788
|
+
}
|
|
13789
|
+
if (typeof limit !== "undefined") {
|
|
13790
|
+
payload["limit"] = limit;
|
|
13791
|
+
}
|
|
13792
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
13793
|
+
const apiHeaders = {};
|
|
13794
|
+
return this.client.call(
|
|
13795
|
+
"get",
|
|
13796
|
+
uri,
|
|
13797
|
+
apiHeaders,
|
|
13798
|
+
payload
|
|
13799
|
+
);
|
|
13800
|
+
}
|
|
13801
|
+
/**
|
|
13802
|
+
* Get memory statistics visible to the current caller.
|
|
13803
|
+
*
|
|
13804
|
+
* @throws {AppBaseException}
|
|
13805
|
+
* @returns {Promise<{}>}
|
|
13806
|
+
*/
|
|
13807
|
+
getStats() {
|
|
13808
|
+
const apiPath = "/memory/memories/stats";
|
|
13809
|
+
const payload = {};
|
|
13810
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
13811
|
+
const apiHeaders = {};
|
|
13812
|
+
return this.client.call(
|
|
13813
|
+
"get",
|
|
13814
|
+
uri,
|
|
13815
|
+
apiHeaders,
|
|
13816
|
+
payload
|
|
13817
|
+
);
|
|
13818
|
+
}
|
|
13819
|
+
/**
|
|
13820
|
+
* Get a memory activity timeline.
|
|
13821
|
+
*
|
|
13822
|
+
* @throws {AppBaseException}
|
|
13823
|
+
* @returns {Promise<{}>}
|
|
13824
|
+
*/
|
|
13825
|
+
getTimeline() {
|
|
13826
|
+
const apiPath = "/memory/memories/timeline";
|
|
13827
|
+
const payload = {};
|
|
13828
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
13829
|
+
const apiHeaders = {};
|
|
13830
|
+
return this.client.call(
|
|
13831
|
+
"get",
|
|
13832
|
+
uri,
|
|
13833
|
+
apiHeaders,
|
|
13834
|
+
payload
|
|
13835
|
+
);
|
|
13836
|
+
}
|
|
13837
|
+
getProfile(paramsOrFirst, ...rest) {
|
|
13838
|
+
let params;
|
|
13839
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
13840
|
+
params = paramsOrFirst || {};
|
|
13841
|
+
} else {
|
|
13842
|
+
params = {
|
|
13843
|
+
userId: paramsOrFirst,
|
|
13844
|
+
profileType: rest[0]
|
|
13845
|
+
};
|
|
13846
|
+
}
|
|
13847
|
+
const userId = params.userId;
|
|
13848
|
+
const profileType = params.profileType;
|
|
13849
|
+
if (typeof userId === "undefined") {
|
|
13850
|
+
throw new AppBaseException('Missing required parameter: "userId"');
|
|
13851
|
+
}
|
|
13852
|
+
const apiPath = "/memory/memories/users/{userId}/profile".replace("{userId}", userId);
|
|
13853
|
+
const payload = {};
|
|
13854
|
+
if (typeof profileType !== "undefined") {
|
|
13855
|
+
payload["profileType"] = profileType;
|
|
13856
|
+
}
|
|
13857
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
13858
|
+
const apiHeaders = {};
|
|
13859
|
+
return this.client.call(
|
|
13860
|
+
"get",
|
|
13861
|
+
uri,
|
|
13862
|
+
apiHeaders,
|
|
13863
|
+
payload
|
|
13864
|
+
);
|
|
13865
|
+
}
|
|
13866
|
+
deleteProfile(paramsOrFirst, ...rest) {
|
|
13867
|
+
let params;
|
|
13868
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
13869
|
+
params = paramsOrFirst || {};
|
|
13870
|
+
} else {
|
|
13871
|
+
params = {
|
|
13872
|
+
userId: paramsOrFirst,
|
|
13873
|
+
profileType: rest[0],
|
|
13874
|
+
reason: rest[1],
|
|
13875
|
+
source: rest[2]
|
|
13876
|
+
};
|
|
13877
|
+
}
|
|
13878
|
+
const userId = params.userId;
|
|
13879
|
+
const profileType = params.profileType;
|
|
13880
|
+
const reason = params.reason;
|
|
13881
|
+
const source = params.source;
|
|
13882
|
+
if (typeof userId === "undefined") {
|
|
13883
|
+
throw new AppBaseException('Missing required parameter: "userId"');
|
|
13884
|
+
}
|
|
13885
|
+
const apiPath = "/memory/memories/users/{userId}/profile".replace("{userId}", userId);
|
|
13886
|
+
const payload = {};
|
|
13887
|
+
if (typeof profileType !== "undefined") {
|
|
13888
|
+
payload["profileType"] = profileType;
|
|
13889
|
+
}
|
|
13890
|
+
if (typeof reason !== "undefined") {
|
|
13891
|
+
payload["reason"] = reason;
|
|
13892
|
+
}
|
|
13893
|
+
if (typeof source !== "undefined") {
|
|
13894
|
+
payload["source"] = source;
|
|
13895
|
+
}
|
|
13896
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
13897
|
+
const apiHeaders = {
|
|
13898
|
+
"content-type": "application/json"
|
|
13899
|
+
};
|
|
13900
|
+
return this.client.call(
|
|
13901
|
+
"delete",
|
|
13902
|
+
uri,
|
|
13903
|
+
apiHeaders,
|
|
13904
|
+
payload
|
|
13905
|
+
);
|
|
13906
|
+
}
|
|
13907
|
+
createProfileExtraction(paramsOrFirst, ...rest) {
|
|
13908
|
+
let params;
|
|
13909
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
13910
|
+
params = paramsOrFirst || {};
|
|
13911
|
+
} else {
|
|
13912
|
+
params = {
|
|
13913
|
+
userId: paramsOrFirst,
|
|
13914
|
+
profileType: rest[0],
|
|
13915
|
+
messages: rest[1],
|
|
13916
|
+
sourceMemoryIds: rest[2],
|
|
13917
|
+
mode: rest[3]
|
|
13918
|
+
};
|
|
13919
|
+
}
|
|
13920
|
+
const userId = params.userId;
|
|
13921
|
+
const profileType = params.profileType;
|
|
13922
|
+
const messages = params.messages;
|
|
13923
|
+
const sourceMemoryIds = params.sourceMemoryIds;
|
|
13924
|
+
const mode = params.mode;
|
|
13925
|
+
if (typeof userId === "undefined") {
|
|
13926
|
+
throw new AppBaseException('Missing required parameter: "userId"');
|
|
13927
|
+
}
|
|
13928
|
+
const apiPath = "/memory/memories/users/{userId}/profile/extractions".replace("{userId}", userId);
|
|
13929
|
+
const payload = {};
|
|
13930
|
+
if (typeof profileType !== "undefined") {
|
|
13931
|
+
payload["profileType"] = profileType;
|
|
13932
|
+
}
|
|
13933
|
+
if (typeof messages !== "undefined") {
|
|
13934
|
+
payload["messages"] = messages;
|
|
13935
|
+
}
|
|
13936
|
+
if (typeof sourceMemoryIds !== "undefined") {
|
|
13937
|
+
payload["sourceMemoryIds"] = sourceMemoryIds;
|
|
13938
|
+
}
|
|
13939
|
+
if (typeof mode !== "undefined") {
|
|
13940
|
+
payload["mode"] = mode;
|
|
13941
|
+
}
|
|
13942
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
13943
|
+
const apiHeaders = {
|
|
13944
|
+
"content-type": "application/json"
|
|
13945
|
+
};
|
|
13946
|
+
return this.client.call(
|
|
13947
|
+
"post",
|
|
13948
|
+
uri,
|
|
13949
|
+
apiHeaders,
|
|
13950
|
+
payload
|
|
13951
|
+
);
|
|
13952
|
+
}
|
|
13953
|
+
createProfileRebuild(paramsOrFirst, ...rest) {
|
|
13954
|
+
let params;
|
|
13955
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
13956
|
+
params = paramsOrFirst || {};
|
|
13957
|
+
} else {
|
|
13958
|
+
params = {
|
|
13959
|
+
userId: paramsOrFirst,
|
|
13960
|
+
profileType: rest[0]
|
|
13961
|
+
};
|
|
13962
|
+
}
|
|
13963
|
+
const userId = params.userId;
|
|
13964
|
+
const profileType = params.profileType;
|
|
13965
|
+
if (typeof userId === "undefined") {
|
|
13966
|
+
throw new AppBaseException('Missing required parameter: "userId"');
|
|
13967
|
+
}
|
|
13968
|
+
const apiPath = "/memory/memories/users/{userId}/profile/rebuild".replace("{userId}", userId);
|
|
13969
|
+
const payload = {};
|
|
13970
|
+
if (typeof profileType !== "undefined") {
|
|
13971
|
+
payload["profileType"] = profileType;
|
|
13972
|
+
}
|
|
13973
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
13974
|
+
const apiHeaders = {
|
|
13975
|
+
"content-type": "application/json"
|
|
13976
|
+
};
|
|
13977
|
+
return this.client.call(
|
|
13978
|
+
"post",
|
|
13979
|
+
uri,
|
|
13980
|
+
apiHeaders,
|
|
13981
|
+
payload
|
|
13982
|
+
);
|
|
13983
|
+
}
|
|
13984
|
+
listProfileSources(paramsOrFirst, ...rest) {
|
|
13985
|
+
let params;
|
|
13986
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
13987
|
+
params = paramsOrFirst || {};
|
|
13988
|
+
} else {
|
|
13989
|
+
params = {
|
|
13990
|
+
userId: paramsOrFirst,
|
|
13991
|
+
profileType: rest[0]
|
|
13992
|
+
};
|
|
13993
|
+
}
|
|
13994
|
+
const userId = params.userId;
|
|
13995
|
+
const profileType = params.profileType;
|
|
13996
|
+
if (typeof userId === "undefined") {
|
|
13997
|
+
throw new AppBaseException('Missing required parameter: "userId"');
|
|
13998
|
+
}
|
|
13999
|
+
const apiPath = "/memory/memories/users/{userId}/profile/sources".replace("{userId}", userId);
|
|
14000
|
+
const payload = {};
|
|
14001
|
+
if (typeof profileType !== "undefined") {
|
|
14002
|
+
payload["profileType"] = profileType;
|
|
14003
|
+
}
|
|
14004
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
14005
|
+
const apiHeaders = {};
|
|
14006
|
+
return this.client.call(
|
|
14007
|
+
"get",
|
|
14008
|
+
uri,
|
|
14009
|
+
apiHeaders,
|
|
14010
|
+
payload
|
|
14011
|
+
);
|
|
14012
|
+
}
|
|
14013
|
+
get(paramsOrFirst) {
|
|
14014
|
+
let params;
|
|
14015
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
14016
|
+
params = paramsOrFirst || {};
|
|
14017
|
+
} else {
|
|
14018
|
+
params = {
|
|
14019
|
+
memoryId: paramsOrFirst
|
|
14020
|
+
};
|
|
14021
|
+
}
|
|
14022
|
+
const memoryId = params.memoryId;
|
|
14023
|
+
if (typeof memoryId === "undefined") {
|
|
14024
|
+
throw new AppBaseException('Missing required parameter: "memoryId"');
|
|
14025
|
+
}
|
|
14026
|
+
const apiPath = "/memory/memories/{memoryId}".replace("{memoryId}", memoryId);
|
|
14027
|
+
const payload = {};
|
|
14028
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
14029
|
+
const apiHeaders = {};
|
|
14030
|
+
return this.client.call(
|
|
14031
|
+
"get",
|
|
14032
|
+
uri,
|
|
14033
|
+
apiHeaders,
|
|
14034
|
+
payload
|
|
14035
|
+
);
|
|
14036
|
+
}
|
|
14037
|
+
update(paramsOrFirst, ...rest) {
|
|
14038
|
+
let params;
|
|
14039
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
14040
|
+
params = paramsOrFirst || {};
|
|
14041
|
+
} else {
|
|
14042
|
+
params = {
|
|
14043
|
+
memoryId: paramsOrFirst,
|
|
14044
|
+
version: rest[0],
|
|
14045
|
+
content: rest[1],
|
|
14046
|
+
metadata: rest[2],
|
|
14047
|
+
retentionPolicy: rest[3]
|
|
14048
|
+
};
|
|
14049
|
+
}
|
|
14050
|
+
const memoryId = params.memoryId;
|
|
14051
|
+
const version = params.version;
|
|
14052
|
+
const content = params.content;
|
|
14053
|
+
const metadata = params.metadata;
|
|
14054
|
+
const retentionPolicy = params.retentionPolicy;
|
|
14055
|
+
if (typeof memoryId === "undefined") {
|
|
14056
|
+
throw new AppBaseException('Missing required parameter: "memoryId"');
|
|
14057
|
+
}
|
|
14058
|
+
if (typeof version === "undefined") {
|
|
14059
|
+
throw new AppBaseException('Missing required parameter: "version"');
|
|
14060
|
+
}
|
|
14061
|
+
const apiPath = "/memory/memories/{memoryId}".replace("{memoryId}", memoryId);
|
|
14062
|
+
const payload = {};
|
|
14063
|
+
if (typeof version !== "undefined") {
|
|
14064
|
+
payload["version"] = version;
|
|
14065
|
+
}
|
|
14066
|
+
if (typeof content !== "undefined") {
|
|
14067
|
+
payload["content"] = content;
|
|
14068
|
+
}
|
|
14069
|
+
if (typeof metadata !== "undefined") {
|
|
14070
|
+
payload["metadata"] = metadata;
|
|
14071
|
+
}
|
|
14072
|
+
if (typeof retentionPolicy !== "undefined") {
|
|
14073
|
+
payload["retentionPolicy"] = retentionPolicy;
|
|
14074
|
+
}
|
|
14075
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
14076
|
+
const apiHeaders = {
|
|
14077
|
+
"content-type": "application/json"
|
|
14078
|
+
};
|
|
14079
|
+
return this.client.call(
|
|
14080
|
+
"patch",
|
|
14081
|
+
uri,
|
|
14082
|
+
apiHeaders,
|
|
14083
|
+
payload
|
|
14084
|
+
);
|
|
14085
|
+
}
|
|
14086
|
+
delete(paramsOrFirst, ...rest) {
|
|
14087
|
+
let params;
|
|
14088
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
14089
|
+
params = paramsOrFirst || {};
|
|
14090
|
+
} else {
|
|
14091
|
+
params = {
|
|
14092
|
+
memoryId: paramsOrFirst,
|
|
14093
|
+
reason: rest[0],
|
|
14094
|
+
source: rest[1]
|
|
14095
|
+
};
|
|
14096
|
+
}
|
|
14097
|
+
const memoryId = params.memoryId;
|
|
14098
|
+
const reason = params.reason;
|
|
14099
|
+
const source = params.source;
|
|
14100
|
+
if (typeof memoryId === "undefined") {
|
|
14101
|
+
throw new AppBaseException('Missing required parameter: "memoryId"');
|
|
14102
|
+
}
|
|
14103
|
+
const apiPath = "/memory/memories/{memoryId}".replace("{memoryId}", memoryId);
|
|
14104
|
+
const payload = {};
|
|
14105
|
+
if (typeof reason !== "undefined") {
|
|
14106
|
+
payload["reason"] = reason;
|
|
14107
|
+
}
|
|
14108
|
+
if (typeof source !== "undefined") {
|
|
14109
|
+
payload["source"] = source;
|
|
14110
|
+
}
|
|
14111
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
14112
|
+
const apiHeaders = {
|
|
14113
|
+
"content-type": "application/json"
|
|
14114
|
+
};
|
|
14115
|
+
return this.client.call(
|
|
14116
|
+
"delete",
|
|
14117
|
+
uri,
|
|
14118
|
+
apiHeaders,
|
|
14119
|
+
payload
|
|
14120
|
+
);
|
|
14121
|
+
}
|
|
14122
|
+
listShares(paramsOrFirst) {
|
|
14123
|
+
let params;
|
|
14124
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
14125
|
+
params = paramsOrFirst || {};
|
|
14126
|
+
} else {
|
|
14127
|
+
params = {
|
|
14128
|
+
memoryId: paramsOrFirst
|
|
14129
|
+
};
|
|
14130
|
+
}
|
|
14131
|
+
const memoryId = params.memoryId;
|
|
14132
|
+
if (typeof memoryId === "undefined") {
|
|
14133
|
+
throw new AppBaseException('Missing required parameter: "memoryId"');
|
|
14134
|
+
}
|
|
14135
|
+
const apiPath = "/memory/memories/{memoryId}/shares".replace("{memoryId}", memoryId);
|
|
14136
|
+
const payload = {};
|
|
14137
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
14138
|
+
const apiHeaders = {};
|
|
14139
|
+
return this.client.call(
|
|
14140
|
+
"get",
|
|
14141
|
+
uri,
|
|
14142
|
+
apiHeaders,
|
|
14143
|
+
payload
|
|
14144
|
+
);
|
|
14145
|
+
}
|
|
14146
|
+
createShare(paramsOrFirst, ...rest) {
|
|
14147
|
+
let params;
|
|
14148
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
14149
|
+
params = paramsOrFirst || {};
|
|
14150
|
+
} else {
|
|
14151
|
+
params = {
|
|
14152
|
+
memoryId: paramsOrFirst,
|
|
14153
|
+
subjectType: rest[0],
|
|
14154
|
+
subjectId: rest[1],
|
|
14155
|
+
expiresAt: rest[2]
|
|
14156
|
+
};
|
|
14157
|
+
}
|
|
14158
|
+
const memoryId = params.memoryId;
|
|
14159
|
+
const subjectType = params.subjectType;
|
|
14160
|
+
const subjectId = params.subjectId;
|
|
14161
|
+
const expiresAt = params.expiresAt;
|
|
14162
|
+
if (typeof memoryId === "undefined") {
|
|
14163
|
+
throw new AppBaseException('Missing required parameter: "memoryId"');
|
|
14164
|
+
}
|
|
14165
|
+
if (typeof subjectType === "undefined") {
|
|
14166
|
+
throw new AppBaseException('Missing required parameter: "subjectType"');
|
|
14167
|
+
}
|
|
14168
|
+
if (typeof subjectId === "undefined") {
|
|
14169
|
+
throw new AppBaseException('Missing required parameter: "subjectId"');
|
|
14170
|
+
}
|
|
14171
|
+
const apiPath = "/memory/memories/{memoryId}/shares".replace("{memoryId}", memoryId);
|
|
14172
|
+
const payload = {};
|
|
14173
|
+
if (typeof subjectType !== "undefined") {
|
|
14174
|
+
payload["subjectType"] = subjectType;
|
|
14175
|
+
}
|
|
14176
|
+
if (typeof subjectId !== "undefined") {
|
|
14177
|
+
payload["subjectId"] = subjectId;
|
|
14178
|
+
}
|
|
14179
|
+
if (typeof expiresAt !== "undefined") {
|
|
14180
|
+
payload["expiresAt"] = expiresAt;
|
|
14181
|
+
}
|
|
14182
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
14183
|
+
const apiHeaders = {
|
|
14184
|
+
"content-type": "application/json"
|
|
14185
|
+
};
|
|
14186
|
+
return this.client.call(
|
|
14187
|
+
"post",
|
|
14188
|
+
uri,
|
|
14189
|
+
apiHeaders,
|
|
14190
|
+
payload
|
|
14191
|
+
);
|
|
14192
|
+
}
|
|
14193
|
+
deleteShare(paramsOrFirst, ...rest) {
|
|
14194
|
+
let params;
|
|
14195
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
14196
|
+
params = paramsOrFirst || {};
|
|
14197
|
+
} else {
|
|
14198
|
+
params = {
|
|
14199
|
+
memoryId: paramsOrFirst,
|
|
14200
|
+
shareId: rest[0]
|
|
14201
|
+
};
|
|
14202
|
+
}
|
|
14203
|
+
const memoryId = params.memoryId;
|
|
14204
|
+
const shareId = params.shareId;
|
|
14205
|
+
if (typeof memoryId === "undefined") {
|
|
14206
|
+
throw new AppBaseException('Missing required parameter: "memoryId"');
|
|
14207
|
+
}
|
|
14208
|
+
if (typeof shareId === "undefined") {
|
|
14209
|
+
throw new AppBaseException('Missing required parameter: "shareId"');
|
|
14210
|
+
}
|
|
14211
|
+
const apiPath = "/memory/memories/{memoryId}/shares/{shareId}".replace("{memoryId}", memoryId).replace("{shareId}", shareId);
|
|
14212
|
+
const payload = {};
|
|
14213
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
14214
|
+
const apiHeaders = {
|
|
14215
|
+
"content-type": "application/json"
|
|
14216
|
+
};
|
|
14217
|
+
return this.client.call(
|
|
14218
|
+
"delete",
|
|
14219
|
+
uri,
|
|
14220
|
+
apiHeaders,
|
|
14221
|
+
payload
|
|
14222
|
+
);
|
|
14223
|
+
}
|
|
14224
|
+
listSources(paramsOrFirst, ...rest) {
|
|
14225
|
+
let params;
|
|
14226
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
14227
|
+
params = paramsOrFirst || {};
|
|
14228
|
+
} else {
|
|
14229
|
+
params = {
|
|
14230
|
+
memoryId: paramsOrFirst,
|
|
14231
|
+
cursor: rest[0],
|
|
14232
|
+
limit: rest[1]
|
|
14233
|
+
};
|
|
14234
|
+
}
|
|
14235
|
+
const memoryId = params.memoryId;
|
|
14236
|
+
const cursor = params.cursor;
|
|
14237
|
+
const limit = params.limit;
|
|
14238
|
+
if (typeof memoryId === "undefined") {
|
|
14239
|
+
throw new AppBaseException('Missing required parameter: "memoryId"');
|
|
14240
|
+
}
|
|
14241
|
+
const apiPath = "/memory/memories/{memoryId}/sources".replace("{memoryId}", memoryId);
|
|
14242
|
+
const payload = {};
|
|
14243
|
+
if (typeof cursor !== "undefined") {
|
|
14244
|
+
payload["cursor"] = cursor;
|
|
14245
|
+
}
|
|
14246
|
+
if (typeof limit !== "undefined") {
|
|
14247
|
+
payload["limit"] = limit;
|
|
14248
|
+
}
|
|
14249
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
14250
|
+
const apiHeaders = {};
|
|
14251
|
+
return this.client.call(
|
|
14252
|
+
"get",
|
|
14253
|
+
uri,
|
|
14254
|
+
apiHeaders,
|
|
14255
|
+
payload
|
|
14256
|
+
);
|
|
14257
|
+
}
|
|
14258
|
+
};
|
|
14259
|
+
|
|
11433
14260
|
// ../../node_modules/@alipay/appbase-node-sdk/dist/services/tables-db.mjs
|
|
11434
14261
|
var TablesDB = class {
|
|
11435
14262
|
constructor(client) {
|
|
@@ -15251,6 +18078,24 @@ _Operator.dateAddDays = (days) => new _Operator("dateAddDays", [days]).toString(
|
|
|
15251
18078
|
_Operator.dateSubDays = (days) => new _Operator("dateSubDays", [days]).toString();
|
|
15252
18079
|
_Operator.dateSetNow = () => new _Operator("dateSetNow", []).toString();
|
|
15253
18080
|
|
|
18081
|
+
// ../../node_modules/@alipay/appbase-node-sdk/dist/enums/memory-scope.mjs
|
|
18082
|
+
var MemoryScope = /* @__PURE__ */ ((MemoryScope2) => {
|
|
18083
|
+
MemoryScope2["Private"] = "private";
|
|
18084
|
+
MemoryScope2["StrictPrivate"] = "strict_private";
|
|
18085
|
+
MemoryScope2["User"] = "user";
|
|
18086
|
+
MemoryScope2["Group"] = "group";
|
|
18087
|
+
MemoryScope2["Project"] = "project";
|
|
18088
|
+
return MemoryScope2;
|
|
18089
|
+
})(MemoryScope || {});
|
|
18090
|
+
|
|
18091
|
+
// ../../node_modules/@alipay/appbase-node-sdk/dist/enums/memory-record-kind.mjs
|
|
18092
|
+
var MemoryRecordKind = /* @__PURE__ */ ((MemoryRecordKind2) => {
|
|
18093
|
+
MemoryRecordKind2["Conversation"] = "conversation";
|
|
18094
|
+
MemoryRecordKind2["Fact"] = "fact";
|
|
18095
|
+
MemoryRecordKind2["Action"] = "action";
|
|
18096
|
+
return MemoryRecordKind2;
|
|
18097
|
+
})(MemoryRecordKind || {});
|
|
18098
|
+
|
|
15254
18099
|
// ../linkque-agent-appwrite-integrate/dist/esm/runtime/runStorage.js
|
|
15255
18100
|
var ENDPOINT_SOURCES = [
|
|
15256
18101
|
"APPWRITE_FUNCTION_API_ENDPOINT",
|
|
@@ -15676,14 +18521,17 @@ function resolveBodyJSON(req) {
|
|
|
15676
18521
|
}
|
|
15677
18522
|
}
|
|
15678
18523
|
function toAgentRunMessages(request) {
|
|
18524
|
+
const embedded = getRunEmbeddedQuery(request);
|
|
15679
18525
|
let lastUserIndex = -1;
|
|
15680
18526
|
request.messages.forEach((message, index) => {
|
|
15681
18527
|
if (message.role === "user")
|
|
15682
18528
|
lastUserIndex = index;
|
|
15683
18529
|
});
|
|
15684
18530
|
return request.messages.map((m, index) => ({
|
|
18531
|
+
...embedded?.messageId === m.id ? { id: m.id } : {},
|
|
15685
18532
|
role: m.role,
|
|
15686
18533
|
content: m.content,
|
|
18534
|
+
...embedded?.messageId === m.id && embedded.context ? { inputContext: embedded.context } : {},
|
|
15687
18535
|
...m.name !== void 0 && { name: m.name },
|
|
15688
18536
|
...index === lastUserIndex && request.attachments.length > 0 && {
|
|
15689
18537
|
attachments: request.attachments.map((attachment) => ({
|
|
@@ -15961,7 +18809,10 @@ function nonEmpty(value) {
|
|
|
15961
18809
|
|
|
15962
18810
|
export {
|
|
15963
18811
|
Query,
|
|
18812
|
+
Memory,
|
|
15964
18813
|
TablesDB,
|
|
18814
|
+
MemoryScope,
|
|
18815
|
+
MemoryRecordKind,
|
|
15965
18816
|
AUTHORIZATION_CHECKPOINT_TABLE,
|
|
15966
18817
|
LINKQUE_ENDPOINT_PRE,
|
|
15967
18818
|
APPBASE_RUNTIME_CONFIG_DEFAULTS,
|