linkque-cli-v2 1.6.16 → 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 +161 -89
- package/dev/worker.js +37 -11
- package/linkquejs.js +27708 -9430
- package/package.json +1 -1
- package/vendor/linkque-agent-appwrite-integrate/data-transform/dataTransformWorker.js +161 -89
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-2O5AZ546.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-ZQGBHENQ.js → chunk-L5WNKJ4W.js} +3147 -229
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-ZK7HXMMY.js → chunk-M6E4Y5HY.js} +40001 -20775
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-DNTEEBEH.js → chunk-SICWMO5Y.js} +1 -0
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{getMachineId-bsd-JGCLGHFY.js → getMachineId-bsd-NYGVHXGN.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{getMachineId-darwin-COHLFNXH.js → getMachineId-darwin-OPTJOAYC.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{getMachineId-linux-XV3Z5FQG.js → getMachineId-linux-5SQRYTUJ.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{getMachineId-unsupported-FCRKLIZL.js → getMachineId-unsupported-OJE7WPEH.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{getMachineId-win-A4WRNVV6.js → getMachineId-win-SLTTCNXU.js} +1 -1
- 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-OEOTQWE5.js → mistral-conversations-EIVAJAMW.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{otel-WGS5CC2J.js → otel-LQR5KPZ3.js} +579 -267
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/chat.js +2299 -339
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/clientCapability.js +3 -4
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/protocol.js +3 -4
- package/vendor/linkque-agent-appwrite-integrate/package.json +1 -1
- package/worker.js +46299 -26114
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/chunk-EAODRPW4.js +0 -518
package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-ZQGBHENQ.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,
|
|
@@ -7336,6 +7337,47 @@ var require_agent = __commonJS({
|
|
|
7336
7337
|
}
|
|
7337
7338
|
});
|
|
7338
7339
|
|
|
7340
|
+
// ../linkque-agent-appwrite-integrate/dist/esm/runtime/authorizationSchemaDefinition.js
|
|
7341
|
+
var AUTHORIZATION_CHECKPOINT_TABLE = "linkque_authorization_checkpoints";
|
|
7342
|
+
var AUTHORIZATION_CHECKPOINT_COLUMNS = [
|
|
7343
|
+
...[
|
|
7344
|
+
"ownerId",
|
|
7345
|
+
"agentId",
|
|
7346
|
+
"runId",
|
|
7347
|
+
"threadId",
|
|
7348
|
+
"itemId",
|
|
7349
|
+
"authorizationRequestId",
|
|
7350
|
+
"authSessionId",
|
|
7351
|
+
"expiresAt",
|
|
7352
|
+
"status",
|
|
7353
|
+
"protocolHash"
|
|
7354
|
+
].map((key) => ({
|
|
7355
|
+
key,
|
|
7356
|
+
type: "varchar",
|
|
7357
|
+
size: key === "authSessionId" ? 256 : 128,
|
|
7358
|
+
required: true,
|
|
7359
|
+
array: false,
|
|
7360
|
+
default: null
|
|
7361
|
+
})),
|
|
7362
|
+
...["requestJson", "checkpointJson", "presentationJson"].map((key) => ({
|
|
7363
|
+
key,
|
|
7364
|
+
type: "longtext",
|
|
7365
|
+
size: 0,
|
|
7366
|
+
required: false,
|
|
7367
|
+
array: false,
|
|
7368
|
+
default: null
|
|
7369
|
+
})),
|
|
7370
|
+
{
|
|
7371
|
+
key: "nextSeqIndex",
|
|
7372
|
+
type: "integer",
|
|
7373
|
+
size: 0,
|
|
7374
|
+
required: true,
|
|
7375
|
+
array: false,
|
|
7376
|
+
default: null,
|
|
7377
|
+
min: 0
|
|
7378
|
+
}
|
|
7379
|
+
];
|
|
7380
|
+
|
|
7339
7381
|
// ../linkque-agent-appwrite-integrate/dist/esm/runtime/appbaseRuntimeConfigProvider.js
|
|
7340
7382
|
var LINKQUE_ENDPOINT_PRE = "https://linkquegw-pre.alipay.com";
|
|
7341
7383
|
var APPBASE_RUNTIME_CONFIG_DEFAULTS = Object.freeze({
|
|
@@ -7355,6 +7397,9 @@ var APPBASE_RUNTIME_CONFIG_DEFAULTS = Object.freeze({
|
|
|
7355
7397
|
LINKQUEGW_MCP_SIGN_ENDPOINT_PRE: `${LINKQUE_ENDPOINT_PRE}/api/mcp/signature`,
|
|
7356
7398
|
LINKQUE_OPEN_MCP_BASE_URL: "https://opengw.alipay.com",
|
|
7357
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",
|
|
7358
7403
|
RUN_DATABASE_ID: "linkque",
|
|
7359
7404
|
RUN_TABLE_ID: "linkque_conversation_runs",
|
|
7360
7405
|
SESSION_DATABASE_ID: "linkque",
|
|
@@ -10995,156 +11040,3037 @@ var Databases = class {
|
|
|
10995
11040
|
if (typeof permissions !== "undefined") {
|
|
10996
11041
|
payload["permissions"] = permissions;
|
|
10997
11042
|
}
|
|
10998
|
-
if (typeof transactionId !== "undefined") {
|
|
10999
|
-
payload["transactionId"] = transactionId;
|
|
11043
|
+
if (typeof transactionId !== "undefined") {
|
|
11044
|
+
payload["transactionId"] = transactionId;
|
|
11045
|
+
}
|
|
11046
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11047
|
+
const apiHeaders = {
|
|
11048
|
+
"content-type": "application/json"
|
|
11049
|
+
};
|
|
11050
|
+
return this.client.call(
|
|
11051
|
+
"put",
|
|
11052
|
+
uri,
|
|
11053
|
+
apiHeaders,
|
|
11054
|
+
payload
|
|
11055
|
+
);
|
|
11056
|
+
}
|
|
11057
|
+
updateDocument(paramsOrFirst, ...rest) {
|
|
11058
|
+
let params;
|
|
11059
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11060
|
+
params = paramsOrFirst || {};
|
|
11061
|
+
} else {
|
|
11062
|
+
params = {
|
|
11063
|
+
databaseId: paramsOrFirst,
|
|
11064
|
+
collectionId: rest[0],
|
|
11065
|
+
documentId: rest[1],
|
|
11066
|
+
data: rest[2],
|
|
11067
|
+
permissions: rest[3],
|
|
11068
|
+
transactionId: rest[4]
|
|
11069
|
+
};
|
|
11070
|
+
}
|
|
11071
|
+
const databaseId = params.databaseId;
|
|
11072
|
+
const collectionId = params.collectionId;
|
|
11073
|
+
const documentId = params.documentId;
|
|
11074
|
+
const data = params.data;
|
|
11075
|
+
const permissions = params.permissions;
|
|
11076
|
+
const transactionId = params.transactionId;
|
|
11077
|
+
if (typeof databaseId === "undefined") {
|
|
11078
|
+
throw new AppBaseException('Missing required parameter: "databaseId"');
|
|
11079
|
+
}
|
|
11080
|
+
if (typeof collectionId === "undefined") {
|
|
11081
|
+
throw new AppBaseException('Missing required parameter: "collectionId"');
|
|
11082
|
+
}
|
|
11083
|
+
if (typeof documentId === "undefined") {
|
|
11084
|
+
throw new AppBaseException('Missing required parameter: "documentId"');
|
|
11085
|
+
}
|
|
11086
|
+
const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{documentId}", documentId);
|
|
11087
|
+
const payload = {};
|
|
11088
|
+
if (typeof data !== "undefined") {
|
|
11089
|
+
payload["data"] = data;
|
|
11090
|
+
}
|
|
11091
|
+
if (typeof permissions !== "undefined") {
|
|
11092
|
+
payload["permissions"] = permissions;
|
|
11093
|
+
}
|
|
11094
|
+
if (typeof transactionId !== "undefined") {
|
|
11095
|
+
payload["transactionId"] = transactionId;
|
|
11096
|
+
}
|
|
11097
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11098
|
+
const apiHeaders = {
|
|
11099
|
+
"content-type": "application/json"
|
|
11100
|
+
};
|
|
11101
|
+
return this.client.call(
|
|
11102
|
+
"patch",
|
|
11103
|
+
uri,
|
|
11104
|
+
apiHeaders,
|
|
11105
|
+
payload
|
|
11106
|
+
);
|
|
11107
|
+
}
|
|
11108
|
+
deleteDocument(paramsOrFirst, ...rest) {
|
|
11109
|
+
let params;
|
|
11110
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11111
|
+
params = paramsOrFirst || {};
|
|
11112
|
+
} else {
|
|
11113
|
+
params = {
|
|
11114
|
+
databaseId: paramsOrFirst,
|
|
11115
|
+
collectionId: rest[0],
|
|
11116
|
+
documentId: rest[1],
|
|
11117
|
+
transactionId: rest[2]
|
|
11118
|
+
};
|
|
11119
|
+
}
|
|
11120
|
+
const databaseId = params.databaseId;
|
|
11121
|
+
const collectionId = params.collectionId;
|
|
11122
|
+
const documentId = params.documentId;
|
|
11123
|
+
const transactionId = params.transactionId;
|
|
11124
|
+
if (typeof databaseId === "undefined") {
|
|
11125
|
+
throw new AppBaseException('Missing required parameter: "databaseId"');
|
|
11126
|
+
}
|
|
11127
|
+
if (typeof collectionId === "undefined") {
|
|
11128
|
+
throw new AppBaseException('Missing required parameter: "collectionId"');
|
|
11129
|
+
}
|
|
11130
|
+
if (typeof documentId === "undefined") {
|
|
11131
|
+
throw new AppBaseException('Missing required parameter: "documentId"');
|
|
11132
|
+
}
|
|
11133
|
+
const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{documentId}", documentId);
|
|
11134
|
+
const payload = {};
|
|
11135
|
+
if (typeof transactionId !== "undefined") {
|
|
11136
|
+
payload["transactionId"] = transactionId;
|
|
11137
|
+
}
|
|
11138
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11139
|
+
const apiHeaders = {
|
|
11140
|
+
"content-type": "application/json"
|
|
11141
|
+
};
|
|
11142
|
+
return this.client.call(
|
|
11143
|
+
"delete",
|
|
11144
|
+
uri,
|
|
11145
|
+
apiHeaders,
|
|
11146
|
+
payload
|
|
11147
|
+
);
|
|
11148
|
+
}
|
|
11149
|
+
decrementDocumentAttribute(paramsOrFirst, ...rest) {
|
|
11150
|
+
let params;
|
|
11151
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11152
|
+
params = paramsOrFirst || {};
|
|
11153
|
+
} else {
|
|
11154
|
+
params = {
|
|
11155
|
+
databaseId: paramsOrFirst,
|
|
11156
|
+
collectionId: rest[0],
|
|
11157
|
+
documentId: rest[1],
|
|
11158
|
+
attribute: rest[2],
|
|
11159
|
+
value: rest[3],
|
|
11160
|
+
min: rest[4],
|
|
11161
|
+
transactionId: rest[5]
|
|
11162
|
+
};
|
|
11163
|
+
}
|
|
11164
|
+
const databaseId = params.databaseId;
|
|
11165
|
+
const collectionId = params.collectionId;
|
|
11166
|
+
const documentId = params.documentId;
|
|
11167
|
+
const attribute = params.attribute;
|
|
11168
|
+
const value = params.value;
|
|
11169
|
+
const min = params.min;
|
|
11170
|
+
const transactionId = params.transactionId;
|
|
11171
|
+
if (typeof databaseId === "undefined") {
|
|
11172
|
+
throw new AppBaseException('Missing required parameter: "databaseId"');
|
|
11173
|
+
}
|
|
11174
|
+
if (typeof collectionId === "undefined") {
|
|
11175
|
+
throw new AppBaseException('Missing required parameter: "collectionId"');
|
|
11176
|
+
}
|
|
11177
|
+
if (typeof documentId === "undefined") {
|
|
11178
|
+
throw new AppBaseException('Missing required parameter: "documentId"');
|
|
11179
|
+
}
|
|
11180
|
+
if (typeof attribute === "undefined") {
|
|
11181
|
+
throw new AppBaseException('Missing required parameter: "attribute"');
|
|
11182
|
+
}
|
|
11183
|
+
const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{documentId}", documentId).replace("{attribute}", attribute);
|
|
11184
|
+
const payload = {};
|
|
11185
|
+
if (typeof value !== "undefined") {
|
|
11186
|
+
payload["value"] = value;
|
|
11187
|
+
}
|
|
11188
|
+
if (typeof min !== "undefined") {
|
|
11189
|
+
payload["min"] = min;
|
|
11190
|
+
}
|
|
11191
|
+
if (typeof transactionId !== "undefined") {
|
|
11192
|
+
payload["transactionId"] = transactionId;
|
|
11193
|
+
}
|
|
11194
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11195
|
+
const apiHeaders = {
|
|
11196
|
+
"content-type": "application/json"
|
|
11197
|
+
};
|
|
11198
|
+
return this.client.call(
|
|
11199
|
+
"patch",
|
|
11200
|
+
uri,
|
|
11201
|
+
apiHeaders,
|
|
11202
|
+
payload
|
|
11203
|
+
);
|
|
11204
|
+
}
|
|
11205
|
+
incrementDocumentAttribute(paramsOrFirst, ...rest) {
|
|
11206
|
+
let params;
|
|
11207
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11208
|
+
params = paramsOrFirst || {};
|
|
11209
|
+
} else {
|
|
11210
|
+
params = {
|
|
11211
|
+
databaseId: paramsOrFirst,
|
|
11212
|
+
collectionId: rest[0],
|
|
11213
|
+
documentId: rest[1],
|
|
11214
|
+
attribute: rest[2],
|
|
11215
|
+
value: rest[3],
|
|
11216
|
+
max: rest[4],
|
|
11217
|
+
transactionId: rest[5]
|
|
11218
|
+
};
|
|
11219
|
+
}
|
|
11220
|
+
const databaseId = params.databaseId;
|
|
11221
|
+
const collectionId = params.collectionId;
|
|
11222
|
+
const documentId = params.documentId;
|
|
11223
|
+
const attribute = params.attribute;
|
|
11224
|
+
const value = params.value;
|
|
11225
|
+
const max = params.max;
|
|
11226
|
+
const transactionId = params.transactionId;
|
|
11227
|
+
if (typeof databaseId === "undefined") {
|
|
11228
|
+
throw new AppBaseException('Missing required parameter: "databaseId"');
|
|
11229
|
+
}
|
|
11230
|
+
if (typeof collectionId === "undefined") {
|
|
11231
|
+
throw new AppBaseException('Missing required parameter: "collectionId"');
|
|
11232
|
+
}
|
|
11233
|
+
if (typeof documentId === "undefined") {
|
|
11234
|
+
throw new AppBaseException('Missing required parameter: "documentId"');
|
|
11235
|
+
}
|
|
11236
|
+
if (typeof attribute === "undefined") {
|
|
11237
|
+
throw new AppBaseException('Missing required parameter: "attribute"');
|
|
11238
|
+
}
|
|
11239
|
+
const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{documentId}", documentId).replace("{attribute}", attribute);
|
|
11240
|
+
const payload = {};
|
|
11241
|
+
if (typeof value !== "undefined") {
|
|
11242
|
+
payload["value"] = value;
|
|
11243
|
+
}
|
|
11244
|
+
if (typeof max !== "undefined") {
|
|
11245
|
+
payload["max"] = max;
|
|
11246
|
+
}
|
|
11247
|
+
if (typeof transactionId !== "undefined") {
|
|
11248
|
+
payload["transactionId"] = transactionId;
|
|
11249
|
+
}
|
|
11250
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11251
|
+
const apiHeaders = {
|
|
11252
|
+
"content-type": "application/json"
|
|
11253
|
+
};
|
|
11254
|
+
return this.client.call(
|
|
11255
|
+
"patch",
|
|
11256
|
+
uri,
|
|
11257
|
+
apiHeaders,
|
|
11258
|
+
payload
|
|
11259
|
+
);
|
|
11260
|
+
}
|
|
11261
|
+
listIndexes(paramsOrFirst, ...rest) {
|
|
11262
|
+
let params;
|
|
11263
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11264
|
+
params = paramsOrFirst || {};
|
|
11265
|
+
} else {
|
|
11266
|
+
params = {
|
|
11267
|
+
databaseId: paramsOrFirst,
|
|
11268
|
+
collectionId: rest[0],
|
|
11269
|
+
queries: rest[1],
|
|
11270
|
+
total: rest[2]
|
|
11271
|
+
};
|
|
11272
|
+
}
|
|
11273
|
+
const databaseId = params.databaseId;
|
|
11274
|
+
const collectionId = params.collectionId;
|
|
11275
|
+
const queries = params.queries;
|
|
11276
|
+
const total = params.total;
|
|
11277
|
+
if (typeof databaseId === "undefined") {
|
|
11278
|
+
throw new AppBaseException('Missing required parameter: "databaseId"');
|
|
11279
|
+
}
|
|
11280
|
+
if (typeof collectionId === "undefined") {
|
|
11281
|
+
throw new AppBaseException('Missing required parameter: "collectionId"');
|
|
11282
|
+
}
|
|
11283
|
+
const apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
|
|
11284
|
+
const payload = {};
|
|
11285
|
+
if (typeof queries !== "undefined") {
|
|
11286
|
+
payload["queries"] = queries;
|
|
11287
|
+
}
|
|
11288
|
+
if (typeof total !== "undefined") {
|
|
11289
|
+
payload["total"] = total;
|
|
11290
|
+
}
|
|
11291
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11292
|
+
const apiHeaders = {};
|
|
11293
|
+
return this.client.call(
|
|
11294
|
+
"get",
|
|
11295
|
+
uri,
|
|
11296
|
+
apiHeaders,
|
|
11297
|
+
payload
|
|
11298
|
+
);
|
|
11299
|
+
}
|
|
11300
|
+
createIndex(paramsOrFirst, ...rest) {
|
|
11301
|
+
let params;
|
|
11302
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11303
|
+
params = paramsOrFirst || {};
|
|
11304
|
+
} else {
|
|
11305
|
+
params = {
|
|
11306
|
+
databaseId: paramsOrFirst,
|
|
11307
|
+
collectionId: rest[0],
|
|
11308
|
+
key: rest[1],
|
|
11309
|
+
type: rest[2],
|
|
11310
|
+
attributes: rest[3],
|
|
11311
|
+
orders: rest[4],
|
|
11312
|
+
lengths: rest[5]
|
|
11313
|
+
};
|
|
11314
|
+
}
|
|
11315
|
+
const databaseId = params.databaseId;
|
|
11316
|
+
const collectionId = params.collectionId;
|
|
11317
|
+
const key = params.key;
|
|
11318
|
+
const type = params.type;
|
|
11319
|
+
const attributes = params.attributes;
|
|
11320
|
+
const orders = params.orders;
|
|
11321
|
+
const lengths = params.lengths;
|
|
11322
|
+
if (typeof databaseId === "undefined") {
|
|
11323
|
+
throw new AppBaseException('Missing required parameter: "databaseId"');
|
|
11324
|
+
}
|
|
11325
|
+
if (typeof collectionId === "undefined") {
|
|
11326
|
+
throw new AppBaseException('Missing required parameter: "collectionId"');
|
|
11327
|
+
}
|
|
11328
|
+
if (typeof key === "undefined") {
|
|
11329
|
+
throw new AppBaseException('Missing required parameter: "key"');
|
|
11330
|
+
}
|
|
11331
|
+
if (typeof type === "undefined") {
|
|
11332
|
+
throw new AppBaseException('Missing required parameter: "type"');
|
|
11333
|
+
}
|
|
11334
|
+
if (typeof attributes === "undefined") {
|
|
11335
|
+
throw new AppBaseException('Missing required parameter: "attributes"');
|
|
11336
|
+
}
|
|
11337
|
+
const apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
|
|
11338
|
+
const payload = {};
|
|
11339
|
+
if (typeof key !== "undefined") {
|
|
11340
|
+
payload["key"] = key;
|
|
11341
|
+
}
|
|
11342
|
+
if (typeof type !== "undefined") {
|
|
11343
|
+
payload["type"] = type;
|
|
11344
|
+
}
|
|
11345
|
+
if (typeof attributes !== "undefined") {
|
|
11346
|
+
payload["attributes"] = attributes;
|
|
11347
|
+
}
|
|
11348
|
+
if (typeof orders !== "undefined") {
|
|
11349
|
+
payload["orders"] = orders;
|
|
11350
|
+
}
|
|
11351
|
+
if (typeof lengths !== "undefined") {
|
|
11352
|
+
payload["lengths"] = lengths;
|
|
11353
|
+
}
|
|
11354
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11355
|
+
const apiHeaders = {
|
|
11356
|
+
"content-type": "application/json"
|
|
11357
|
+
};
|
|
11358
|
+
return this.client.call(
|
|
11359
|
+
"post",
|
|
11360
|
+
uri,
|
|
11361
|
+
apiHeaders,
|
|
11362
|
+
payload
|
|
11363
|
+
);
|
|
11364
|
+
}
|
|
11365
|
+
getIndex(paramsOrFirst, ...rest) {
|
|
11366
|
+
let params;
|
|
11367
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11368
|
+
params = paramsOrFirst || {};
|
|
11369
|
+
} else {
|
|
11370
|
+
params = {
|
|
11371
|
+
databaseId: paramsOrFirst,
|
|
11372
|
+
collectionId: rest[0],
|
|
11373
|
+
key: rest[1]
|
|
11374
|
+
};
|
|
11375
|
+
}
|
|
11376
|
+
const databaseId = params.databaseId;
|
|
11377
|
+
const collectionId = params.collectionId;
|
|
11378
|
+
const key = params.key;
|
|
11379
|
+
if (typeof databaseId === "undefined") {
|
|
11380
|
+
throw new AppBaseException('Missing required parameter: "databaseId"');
|
|
11381
|
+
}
|
|
11382
|
+
if (typeof collectionId === "undefined") {
|
|
11383
|
+
throw new AppBaseException('Missing required parameter: "collectionId"');
|
|
11384
|
+
}
|
|
11385
|
+
if (typeof key === "undefined") {
|
|
11386
|
+
throw new AppBaseException('Missing required parameter: "key"');
|
|
11387
|
+
}
|
|
11388
|
+
const apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
|
|
11389
|
+
const payload = {};
|
|
11390
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11391
|
+
const apiHeaders = {};
|
|
11392
|
+
return this.client.call(
|
|
11393
|
+
"get",
|
|
11394
|
+
uri,
|
|
11395
|
+
apiHeaders,
|
|
11396
|
+
payload
|
|
11397
|
+
);
|
|
11398
|
+
}
|
|
11399
|
+
deleteIndex(paramsOrFirst, ...rest) {
|
|
11400
|
+
let params;
|
|
11401
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11402
|
+
params = paramsOrFirst || {};
|
|
11403
|
+
} else {
|
|
11404
|
+
params = {
|
|
11405
|
+
databaseId: paramsOrFirst,
|
|
11406
|
+
collectionId: rest[0],
|
|
11407
|
+
key: rest[1]
|
|
11408
|
+
};
|
|
11409
|
+
}
|
|
11410
|
+
const databaseId = params.databaseId;
|
|
11411
|
+
const collectionId = params.collectionId;
|
|
11412
|
+
const key = params.key;
|
|
11413
|
+
if (typeof databaseId === "undefined") {
|
|
11414
|
+
throw new AppBaseException('Missing required parameter: "databaseId"');
|
|
11415
|
+
}
|
|
11416
|
+
if (typeof collectionId === "undefined") {
|
|
11417
|
+
throw new AppBaseException('Missing required parameter: "collectionId"');
|
|
11418
|
+
}
|
|
11419
|
+
if (typeof key === "undefined") {
|
|
11420
|
+
throw new AppBaseException('Missing required parameter: "key"');
|
|
11421
|
+
}
|
|
11422
|
+
const apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
|
|
11423
|
+
const payload = {};
|
|
11424
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11425
|
+
const apiHeaders = {
|
|
11426
|
+
"content-type": "application/json"
|
|
11427
|
+
};
|
|
11428
|
+
return this.client.call(
|
|
11429
|
+
"delete",
|
|
11430
|
+
uri,
|
|
11431
|
+
apiHeaders,
|
|
11432
|
+
payload
|
|
11433
|
+
);
|
|
11434
|
+
}
|
|
11435
|
+
};
|
|
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;
|
|
11000
13972
|
}
|
|
11001
13973
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11002
13974
|
const apiHeaders = {
|
|
11003
13975
|
"content-type": "application/json"
|
|
11004
13976
|
};
|
|
11005
13977
|
return this.client.call(
|
|
11006
|
-
"
|
|
13978
|
+
"post",
|
|
11007
13979
|
uri,
|
|
11008
13980
|
apiHeaders,
|
|
11009
13981
|
payload
|
|
11010
13982
|
);
|
|
11011
13983
|
}
|
|
11012
|
-
|
|
13984
|
+
listProfileSources(paramsOrFirst, ...rest) {
|
|
11013
13985
|
let params;
|
|
11014
13986
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11015
13987
|
params = paramsOrFirst || {};
|
|
11016
13988
|
} else {
|
|
11017
13989
|
params = {
|
|
11018
|
-
|
|
11019
|
-
|
|
11020
|
-
documentId: rest[1],
|
|
11021
|
-
data: rest[2],
|
|
11022
|
-
permissions: rest[3],
|
|
11023
|
-
transactionId: rest[4]
|
|
13990
|
+
userId: paramsOrFirst,
|
|
13991
|
+
profileType: rest[0]
|
|
11024
13992
|
};
|
|
11025
13993
|
}
|
|
11026
|
-
const
|
|
11027
|
-
const
|
|
11028
|
-
|
|
11029
|
-
|
|
11030
|
-
const permissions = params.permissions;
|
|
11031
|
-
const transactionId = params.transactionId;
|
|
11032
|
-
if (typeof databaseId === "undefined") {
|
|
11033
|
-
throw new AppBaseException('Missing required parameter: "databaseId"');
|
|
11034
|
-
}
|
|
11035
|
-
if (typeof collectionId === "undefined") {
|
|
11036
|
-
throw new AppBaseException('Missing required parameter: "collectionId"');
|
|
11037
|
-
}
|
|
11038
|
-
if (typeof documentId === "undefined") {
|
|
11039
|
-
throw new AppBaseException('Missing required parameter: "documentId"');
|
|
13994
|
+
const userId = params.userId;
|
|
13995
|
+
const profileType = params.profileType;
|
|
13996
|
+
if (typeof userId === "undefined") {
|
|
13997
|
+
throw new AppBaseException('Missing required parameter: "userId"');
|
|
11040
13998
|
}
|
|
11041
|
-
const apiPath = "/
|
|
13999
|
+
const apiPath = "/memory/memories/users/{userId}/profile/sources".replace("{userId}", userId);
|
|
11042
14000
|
const payload = {};
|
|
11043
|
-
if (typeof
|
|
11044
|
-
payload["
|
|
11045
|
-
}
|
|
11046
|
-
if (typeof permissions !== "undefined") {
|
|
11047
|
-
payload["permissions"] = permissions;
|
|
11048
|
-
}
|
|
11049
|
-
if (typeof transactionId !== "undefined") {
|
|
11050
|
-
payload["transactionId"] = transactionId;
|
|
14001
|
+
if (typeof profileType !== "undefined") {
|
|
14002
|
+
payload["profileType"] = profileType;
|
|
11051
14003
|
}
|
|
11052
14004
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11053
|
-
const apiHeaders = {
|
|
11054
|
-
"content-type": "application/json"
|
|
11055
|
-
};
|
|
14005
|
+
const apiHeaders = {};
|
|
11056
14006
|
return this.client.call(
|
|
11057
|
-
"
|
|
14007
|
+
"get",
|
|
11058
14008
|
uri,
|
|
11059
14009
|
apiHeaders,
|
|
11060
14010
|
payload
|
|
11061
14011
|
);
|
|
11062
14012
|
}
|
|
11063
|
-
|
|
14013
|
+
get(paramsOrFirst) {
|
|
11064
14014
|
let params;
|
|
11065
14015
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11066
14016
|
params = paramsOrFirst || {};
|
|
11067
14017
|
} else {
|
|
11068
14018
|
params = {
|
|
11069
|
-
|
|
11070
|
-
collectionId: rest[0],
|
|
11071
|
-
documentId: rest[1],
|
|
11072
|
-
transactionId: rest[2]
|
|
14019
|
+
memoryId: paramsOrFirst
|
|
11073
14020
|
};
|
|
11074
14021
|
}
|
|
11075
|
-
const
|
|
11076
|
-
|
|
11077
|
-
|
|
11078
|
-
const transactionId = params.transactionId;
|
|
11079
|
-
if (typeof databaseId === "undefined") {
|
|
11080
|
-
throw new AppBaseException('Missing required parameter: "databaseId"');
|
|
11081
|
-
}
|
|
11082
|
-
if (typeof collectionId === "undefined") {
|
|
11083
|
-
throw new AppBaseException('Missing required parameter: "collectionId"');
|
|
11084
|
-
}
|
|
11085
|
-
if (typeof documentId === "undefined") {
|
|
11086
|
-
throw new AppBaseException('Missing required parameter: "documentId"');
|
|
14022
|
+
const memoryId = params.memoryId;
|
|
14023
|
+
if (typeof memoryId === "undefined") {
|
|
14024
|
+
throw new AppBaseException('Missing required parameter: "memoryId"');
|
|
11087
14025
|
}
|
|
11088
|
-
const apiPath = "/
|
|
14026
|
+
const apiPath = "/memory/memories/{memoryId}".replace("{memoryId}", memoryId);
|
|
11089
14027
|
const payload = {};
|
|
11090
|
-
if (typeof transactionId !== "undefined") {
|
|
11091
|
-
payload["transactionId"] = transactionId;
|
|
11092
|
-
}
|
|
11093
14028
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11094
|
-
const apiHeaders = {
|
|
11095
|
-
"content-type": "application/json"
|
|
11096
|
-
};
|
|
14029
|
+
const apiHeaders = {};
|
|
11097
14030
|
return this.client.call(
|
|
11098
|
-
"
|
|
14031
|
+
"get",
|
|
11099
14032
|
uri,
|
|
11100
14033
|
apiHeaders,
|
|
11101
14034
|
payload
|
|
11102
14035
|
);
|
|
11103
14036
|
}
|
|
11104
|
-
|
|
14037
|
+
update(paramsOrFirst, ...rest) {
|
|
11105
14038
|
let params;
|
|
11106
14039
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11107
14040
|
params = paramsOrFirst || {};
|
|
11108
14041
|
} else {
|
|
11109
14042
|
params = {
|
|
11110
|
-
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
|
|
11114
|
-
|
|
11115
|
-
min: rest[4],
|
|
11116
|
-
transactionId: rest[5]
|
|
14043
|
+
memoryId: paramsOrFirst,
|
|
14044
|
+
version: rest[0],
|
|
14045
|
+
content: rest[1],
|
|
14046
|
+
metadata: rest[2],
|
|
14047
|
+
retentionPolicy: rest[3]
|
|
11117
14048
|
};
|
|
11118
14049
|
}
|
|
11119
|
-
const
|
|
11120
|
-
const
|
|
11121
|
-
const
|
|
11122
|
-
const
|
|
11123
|
-
const
|
|
11124
|
-
|
|
11125
|
-
|
|
11126
|
-
if (typeof databaseId === "undefined") {
|
|
11127
|
-
throw new AppBaseException('Missing required parameter: "databaseId"');
|
|
11128
|
-
}
|
|
11129
|
-
if (typeof collectionId === "undefined") {
|
|
11130
|
-
throw new AppBaseException('Missing required parameter: "collectionId"');
|
|
11131
|
-
}
|
|
11132
|
-
if (typeof documentId === "undefined") {
|
|
11133
|
-
throw new AppBaseException('Missing required parameter: "documentId"');
|
|
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"');
|
|
11134
14057
|
}
|
|
11135
|
-
if (typeof
|
|
11136
|
-
throw new AppBaseException('Missing required parameter: "
|
|
14058
|
+
if (typeof version === "undefined") {
|
|
14059
|
+
throw new AppBaseException('Missing required parameter: "version"');
|
|
11137
14060
|
}
|
|
11138
|
-
const apiPath = "/
|
|
14061
|
+
const apiPath = "/memory/memories/{memoryId}".replace("{memoryId}", memoryId);
|
|
11139
14062
|
const payload = {};
|
|
11140
|
-
if (typeof
|
|
11141
|
-
payload["
|
|
14063
|
+
if (typeof version !== "undefined") {
|
|
14064
|
+
payload["version"] = version;
|
|
11142
14065
|
}
|
|
11143
|
-
if (typeof
|
|
11144
|
-
payload["
|
|
14066
|
+
if (typeof content !== "undefined") {
|
|
14067
|
+
payload["content"] = content;
|
|
11145
14068
|
}
|
|
11146
|
-
if (typeof
|
|
11147
|
-
payload["
|
|
14069
|
+
if (typeof metadata !== "undefined") {
|
|
14070
|
+
payload["metadata"] = metadata;
|
|
14071
|
+
}
|
|
14072
|
+
if (typeof retentionPolicy !== "undefined") {
|
|
14073
|
+
payload["retentionPolicy"] = retentionPolicy;
|
|
11148
14074
|
}
|
|
11149
14075
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11150
14076
|
const apiHeaders = {
|
|
@@ -11157,92 +14083,57 @@ var Databases = class {
|
|
|
11157
14083
|
payload
|
|
11158
14084
|
);
|
|
11159
14085
|
}
|
|
11160
|
-
|
|
14086
|
+
delete(paramsOrFirst, ...rest) {
|
|
11161
14087
|
let params;
|
|
11162
14088
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11163
14089
|
params = paramsOrFirst || {};
|
|
11164
14090
|
} else {
|
|
11165
14091
|
params = {
|
|
11166
|
-
|
|
11167
|
-
|
|
11168
|
-
|
|
11169
|
-
attribute: rest[2],
|
|
11170
|
-
value: rest[3],
|
|
11171
|
-
max: rest[4],
|
|
11172
|
-
transactionId: rest[5]
|
|
14092
|
+
memoryId: paramsOrFirst,
|
|
14093
|
+
reason: rest[0],
|
|
14094
|
+
source: rest[1]
|
|
11173
14095
|
};
|
|
11174
14096
|
}
|
|
11175
|
-
const
|
|
11176
|
-
const
|
|
11177
|
-
const
|
|
11178
|
-
|
|
11179
|
-
|
|
11180
|
-
const max = params.max;
|
|
11181
|
-
const transactionId = params.transactionId;
|
|
11182
|
-
if (typeof databaseId === "undefined") {
|
|
11183
|
-
throw new AppBaseException('Missing required parameter: "databaseId"');
|
|
11184
|
-
}
|
|
11185
|
-
if (typeof collectionId === "undefined") {
|
|
11186
|
-
throw new AppBaseException('Missing required parameter: "collectionId"');
|
|
11187
|
-
}
|
|
11188
|
-
if (typeof documentId === "undefined") {
|
|
11189
|
-
throw new AppBaseException('Missing required parameter: "documentId"');
|
|
11190
|
-
}
|
|
11191
|
-
if (typeof attribute === "undefined") {
|
|
11192
|
-
throw new AppBaseException('Missing required parameter: "attribute"');
|
|
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"');
|
|
11193
14102
|
}
|
|
11194
|
-
const apiPath = "/
|
|
14103
|
+
const apiPath = "/memory/memories/{memoryId}".replace("{memoryId}", memoryId);
|
|
11195
14104
|
const payload = {};
|
|
11196
|
-
if (typeof
|
|
11197
|
-
payload["
|
|
11198
|
-
}
|
|
11199
|
-
if (typeof max !== "undefined") {
|
|
11200
|
-
payload["max"] = max;
|
|
14105
|
+
if (typeof reason !== "undefined") {
|
|
14106
|
+
payload["reason"] = reason;
|
|
11201
14107
|
}
|
|
11202
|
-
if (typeof
|
|
11203
|
-
payload["
|
|
14108
|
+
if (typeof source !== "undefined") {
|
|
14109
|
+
payload["source"] = source;
|
|
11204
14110
|
}
|
|
11205
14111
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11206
14112
|
const apiHeaders = {
|
|
11207
14113
|
"content-type": "application/json"
|
|
11208
14114
|
};
|
|
11209
14115
|
return this.client.call(
|
|
11210
|
-
"
|
|
14116
|
+
"delete",
|
|
11211
14117
|
uri,
|
|
11212
14118
|
apiHeaders,
|
|
11213
14119
|
payload
|
|
11214
14120
|
);
|
|
11215
14121
|
}
|
|
11216
|
-
|
|
14122
|
+
listShares(paramsOrFirst) {
|
|
11217
14123
|
let params;
|
|
11218
14124
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11219
14125
|
params = paramsOrFirst || {};
|
|
11220
14126
|
} else {
|
|
11221
14127
|
params = {
|
|
11222
|
-
|
|
11223
|
-
collectionId: rest[0],
|
|
11224
|
-
queries: rest[1],
|
|
11225
|
-
total: rest[2]
|
|
14128
|
+
memoryId: paramsOrFirst
|
|
11226
14129
|
};
|
|
11227
14130
|
}
|
|
11228
|
-
const
|
|
11229
|
-
|
|
11230
|
-
|
|
11231
|
-
const total = params.total;
|
|
11232
|
-
if (typeof databaseId === "undefined") {
|
|
11233
|
-
throw new AppBaseException('Missing required parameter: "databaseId"');
|
|
11234
|
-
}
|
|
11235
|
-
if (typeof collectionId === "undefined") {
|
|
11236
|
-
throw new AppBaseException('Missing required parameter: "collectionId"');
|
|
14131
|
+
const memoryId = params.memoryId;
|
|
14132
|
+
if (typeof memoryId === "undefined") {
|
|
14133
|
+
throw new AppBaseException('Missing required parameter: "memoryId"');
|
|
11237
14134
|
}
|
|
11238
|
-
const apiPath = "/
|
|
14135
|
+
const apiPath = "/memory/memories/{memoryId}/shares".replace("{memoryId}", memoryId);
|
|
11239
14136
|
const payload = {};
|
|
11240
|
-
if (typeof queries !== "undefined") {
|
|
11241
|
-
payload["queries"] = queries;
|
|
11242
|
-
}
|
|
11243
|
-
if (typeof total !== "undefined") {
|
|
11244
|
-
payload["total"] = total;
|
|
11245
|
-
}
|
|
11246
14137
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11247
14138
|
const apiHeaders = {};
|
|
11248
14139
|
return this.client.call(
|
|
@@ -11252,59 +14143,41 @@ var Databases = class {
|
|
|
11252
14143
|
payload
|
|
11253
14144
|
);
|
|
11254
14145
|
}
|
|
11255
|
-
|
|
14146
|
+
createShare(paramsOrFirst, ...rest) {
|
|
11256
14147
|
let params;
|
|
11257
14148
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11258
14149
|
params = paramsOrFirst || {};
|
|
11259
14150
|
} else {
|
|
11260
14151
|
params = {
|
|
11261
|
-
|
|
11262
|
-
|
|
11263
|
-
|
|
11264
|
-
|
|
11265
|
-
attributes: rest[3],
|
|
11266
|
-
orders: rest[4],
|
|
11267
|
-
lengths: rest[5]
|
|
14152
|
+
memoryId: paramsOrFirst,
|
|
14153
|
+
subjectType: rest[0],
|
|
14154
|
+
subjectId: rest[1],
|
|
14155
|
+
expiresAt: rest[2]
|
|
11268
14156
|
};
|
|
11269
14157
|
}
|
|
11270
|
-
const
|
|
11271
|
-
const
|
|
11272
|
-
const
|
|
11273
|
-
const
|
|
11274
|
-
|
|
11275
|
-
|
|
11276
|
-
const lengths = params.lengths;
|
|
11277
|
-
if (typeof databaseId === "undefined") {
|
|
11278
|
-
throw new AppBaseException('Missing required parameter: "databaseId"');
|
|
11279
|
-
}
|
|
11280
|
-
if (typeof collectionId === "undefined") {
|
|
11281
|
-
throw new AppBaseException('Missing required parameter: "collectionId"');
|
|
11282
|
-
}
|
|
11283
|
-
if (typeof key === "undefined") {
|
|
11284
|
-
throw new AppBaseException('Missing required parameter: "key"');
|
|
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"');
|
|
11285
14164
|
}
|
|
11286
|
-
if (typeof
|
|
11287
|
-
throw new AppBaseException('Missing required parameter: "
|
|
14165
|
+
if (typeof subjectType === "undefined") {
|
|
14166
|
+
throw new AppBaseException('Missing required parameter: "subjectType"');
|
|
11288
14167
|
}
|
|
11289
|
-
if (typeof
|
|
11290
|
-
throw new AppBaseException('Missing required parameter: "
|
|
14168
|
+
if (typeof subjectId === "undefined") {
|
|
14169
|
+
throw new AppBaseException('Missing required parameter: "subjectId"');
|
|
11291
14170
|
}
|
|
11292
|
-
const apiPath = "/
|
|
14171
|
+
const apiPath = "/memory/memories/{memoryId}/shares".replace("{memoryId}", memoryId);
|
|
11293
14172
|
const payload = {};
|
|
11294
|
-
if (typeof
|
|
11295
|
-
payload["
|
|
11296
|
-
}
|
|
11297
|
-
if (typeof type !== "undefined") {
|
|
11298
|
-
payload["type"] = type;
|
|
11299
|
-
}
|
|
11300
|
-
if (typeof attributes !== "undefined") {
|
|
11301
|
-
payload["attributes"] = attributes;
|
|
14173
|
+
if (typeof subjectType !== "undefined") {
|
|
14174
|
+
payload["subjectType"] = subjectType;
|
|
11302
14175
|
}
|
|
11303
|
-
if (typeof
|
|
11304
|
-
payload["
|
|
14176
|
+
if (typeof subjectId !== "undefined") {
|
|
14177
|
+
payload["subjectId"] = subjectId;
|
|
11305
14178
|
}
|
|
11306
|
-
if (typeof
|
|
11307
|
-
payload["
|
|
14179
|
+
if (typeof expiresAt !== "undefined") {
|
|
14180
|
+
payload["expiresAt"] = expiresAt;
|
|
11308
14181
|
}
|
|
11309
14182
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11310
14183
|
const apiHeaders = {
|
|
@@ -11317,71 +14190,66 @@ var Databases = class {
|
|
|
11317
14190
|
payload
|
|
11318
14191
|
);
|
|
11319
14192
|
}
|
|
11320
|
-
|
|
14193
|
+
deleteShare(paramsOrFirst, ...rest) {
|
|
11321
14194
|
let params;
|
|
11322
14195
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11323
14196
|
params = paramsOrFirst || {};
|
|
11324
14197
|
} else {
|
|
11325
14198
|
params = {
|
|
11326
|
-
|
|
11327
|
-
|
|
11328
|
-
key: rest[1]
|
|
14199
|
+
memoryId: paramsOrFirst,
|
|
14200
|
+
shareId: rest[0]
|
|
11329
14201
|
};
|
|
11330
14202
|
}
|
|
11331
|
-
const
|
|
11332
|
-
const
|
|
11333
|
-
|
|
11334
|
-
|
|
11335
|
-
throw new AppBaseException('Missing required parameter: "databaseId"');
|
|
11336
|
-
}
|
|
11337
|
-
if (typeof collectionId === "undefined") {
|
|
11338
|
-
throw new AppBaseException('Missing required parameter: "collectionId"');
|
|
14203
|
+
const memoryId = params.memoryId;
|
|
14204
|
+
const shareId = params.shareId;
|
|
14205
|
+
if (typeof memoryId === "undefined") {
|
|
14206
|
+
throw new AppBaseException('Missing required parameter: "memoryId"');
|
|
11339
14207
|
}
|
|
11340
|
-
if (typeof
|
|
11341
|
-
throw new AppBaseException('Missing required parameter: "
|
|
14208
|
+
if (typeof shareId === "undefined") {
|
|
14209
|
+
throw new AppBaseException('Missing required parameter: "shareId"');
|
|
11342
14210
|
}
|
|
11343
|
-
const apiPath = "/
|
|
14211
|
+
const apiPath = "/memory/memories/{memoryId}/shares/{shareId}".replace("{memoryId}", memoryId).replace("{shareId}", shareId);
|
|
11344
14212
|
const payload = {};
|
|
11345
14213
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11346
|
-
const apiHeaders = {
|
|
14214
|
+
const apiHeaders = {
|
|
14215
|
+
"content-type": "application/json"
|
|
14216
|
+
};
|
|
11347
14217
|
return this.client.call(
|
|
11348
|
-
"
|
|
14218
|
+
"delete",
|
|
11349
14219
|
uri,
|
|
11350
14220
|
apiHeaders,
|
|
11351
14221
|
payload
|
|
11352
14222
|
);
|
|
11353
14223
|
}
|
|
11354
|
-
|
|
14224
|
+
listSources(paramsOrFirst, ...rest) {
|
|
11355
14225
|
let params;
|
|
11356
14226
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
11357
14227
|
params = paramsOrFirst || {};
|
|
11358
14228
|
} else {
|
|
11359
14229
|
params = {
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
14230
|
+
memoryId: paramsOrFirst,
|
|
14231
|
+
cursor: rest[0],
|
|
14232
|
+
limit: rest[1]
|
|
11363
14233
|
};
|
|
11364
14234
|
}
|
|
11365
|
-
const
|
|
11366
|
-
const
|
|
11367
|
-
const
|
|
11368
|
-
if (typeof
|
|
11369
|
-
throw new AppBaseException('Missing required parameter: "
|
|
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"');
|
|
11370
14240
|
}
|
|
11371
|
-
|
|
11372
|
-
|
|
14241
|
+
const apiPath = "/memory/memories/{memoryId}/sources".replace("{memoryId}", memoryId);
|
|
14242
|
+
const payload = {};
|
|
14243
|
+
if (typeof cursor !== "undefined") {
|
|
14244
|
+
payload["cursor"] = cursor;
|
|
11373
14245
|
}
|
|
11374
|
-
if (typeof
|
|
11375
|
-
|
|
14246
|
+
if (typeof limit !== "undefined") {
|
|
14247
|
+
payload["limit"] = limit;
|
|
11376
14248
|
}
|
|
11377
|
-
const apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
|
|
11378
|
-
const payload = {};
|
|
11379
14249
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11380
|
-
const apiHeaders = {
|
|
11381
|
-
"content-type": "application/json"
|
|
11382
|
-
};
|
|
14250
|
+
const apiHeaders = {};
|
|
11383
14251
|
return this.client.call(
|
|
11384
|
-
"
|
|
14252
|
+
"get",
|
|
11385
14253
|
uri,
|
|
11386
14254
|
apiHeaders,
|
|
11387
14255
|
payload
|
|
@@ -15210,6 +18078,24 @@ _Operator.dateAddDays = (days) => new _Operator("dateAddDays", [days]).toString(
|
|
|
15210
18078
|
_Operator.dateSubDays = (days) => new _Operator("dateSubDays", [days]).toString();
|
|
15211
18079
|
_Operator.dateSetNow = () => new _Operator("dateSetNow", []).toString();
|
|
15212
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
|
+
|
|
15213
18099
|
// ../linkque-agent-appwrite-integrate/dist/esm/runtime/runStorage.js
|
|
15214
18100
|
var ENDPOINT_SOURCES = [
|
|
15215
18101
|
"APPWRITE_FUNCTION_API_ENDPOINT",
|
|
@@ -15635,14 +18521,17 @@ function resolveBodyJSON(req) {
|
|
|
15635
18521
|
}
|
|
15636
18522
|
}
|
|
15637
18523
|
function toAgentRunMessages(request) {
|
|
18524
|
+
const embedded = getRunEmbeddedQuery(request);
|
|
15638
18525
|
let lastUserIndex = -1;
|
|
15639
18526
|
request.messages.forEach((message, index) => {
|
|
15640
18527
|
if (message.role === "user")
|
|
15641
18528
|
lastUserIndex = index;
|
|
15642
18529
|
});
|
|
15643
18530
|
return request.messages.map((m, index) => ({
|
|
18531
|
+
...embedded?.messageId === m.id ? { id: m.id } : {},
|
|
15644
18532
|
role: m.role,
|
|
15645
18533
|
content: m.content,
|
|
18534
|
+
...embedded?.messageId === m.id && embedded.context ? { inputContext: embedded.context } : {},
|
|
15646
18535
|
...m.name !== void 0 && { name: m.name },
|
|
15647
18536
|
...index === lastUserIndex && request.attachments.length > 0 && {
|
|
15648
18537
|
attachments: request.attachments.map((attachment) => ({
|
|
@@ -15663,6 +18552,7 @@ var API_KEY_HEADER = "x-appwrite-key";
|
|
|
15663
18552
|
var TRIGGER_HEADER = "x-appwrite-trigger";
|
|
15664
18553
|
var ENV_SELECTOR_HEADER = "x-linkque-env";
|
|
15665
18554
|
var TRACE_ID_HEADER = "x-trace-id";
|
|
18555
|
+
var OTEL_TRACE_ID_HEADER = "x-linkque-otel-trace-id";
|
|
15666
18556
|
var FRONTEND_APP_ID_HEADER = "x-linkque-alipay-app-id";
|
|
15667
18557
|
var ALIPAY_AUTH_CODE_HEADER = "x-alipay-authcode";
|
|
15668
18558
|
var AUTH_UNAVAILABLE_HEADER = "x-linkque-phone-auth-unavailable";
|
|
@@ -15742,6 +18632,28 @@ function readTraceId(headers) {
|
|
|
15742
18632
|
}
|
|
15743
18633
|
return void 0;
|
|
15744
18634
|
}
|
|
18635
|
+
function readOtelTraceId(headers) {
|
|
18636
|
+
if (!headers)
|
|
18637
|
+
return { kind: "missing" };
|
|
18638
|
+
let found = Object.prototype.hasOwnProperty.call(headers, OTEL_TRACE_ID_HEADER);
|
|
18639
|
+
let value = found ? headers[OTEL_TRACE_ID_HEADER] : void 0;
|
|
18640
|
+
if (!found) {
|
|
18641
|
+
for (const [key, candidate] of Object.entries(headers)) {
|
|
18642
|
+
if (key.toLowerCase() === OTEL_TRACE_ID_HEADER) {
|
|
18643
|
+
found = true;
|
|
18644
|
+
value = candidate;
|
|
18645
|
+
break;
|
|
18646
|
+
}
|
|
18647
|
+
}
|
|
18648
|
+
}
|
|
18649
|
+
if (!found)
|
|
18650
|
+
return { kind: "missing" };
|
|
18651
|
+
const raw = headValue(value);
|
|
18652
|
+
if (!raw)
|
|
18653
|
+
return { kind: "invalid" };
|
|
18654
|
+
const traceId = raw.toLowerCase();
|
|
18655
|
+
return /^[0-9a-f]{32}$/u.test(traceId) && traceId !== "00000000000000000000000000000000" ? { kind: "valid", traceId } : { kind: "invalid" };
|
|
18656
|
+
}
|
|
15745
18657
|
function readFrontendAppId(headers) {
|
|
15746
18658
|
if (!headers)
|
|
15747
18659
|
return void 0;
|
|
@@ -15896,10 +18808,15 @@ function nonEmpty(value) {
|
|
|
15896
18808
|
}
|
|
15897
18809
|
|
|
15898
18810
|
export {
|
|
15899
|
-
APPBASE_RUNTIME_CONFIG_DEFAULTS,
|
|
15900
|
-
AppbaseRuntimeConfigProvider,
|
|
15901
18811
|
Query,
|
|
18812
|
+
Memory,
|
|
15902
18813
|
TablesDB,
|
|
18814
|
+
MemoryScope,
|
|
18815
|
+
MemoryRecordKind,
|
|
18816
|
+
AUTHORIZATION_CHECKPOINT_TABLE,
|
|
18817
|
+
LINKQUE_ENDPOINT_PRE,
|
|
18818
|
+
APPBASE_RUNTIME_CONFIG_DEFAULTS,
|
|
18819
|
+
AppbaseRuntimeConfigProvider,
|
|
15903
18820
|
resolveRunStorage,
|
|
15904
18821
|
createAppBaseClient,
|
|
15905
18822
|
withIsoTimestamp,
|
|
@@ -15916,6 +18833,7 @@ export {
|
|
|
15916
18833
|
mcpPhoneAuthorizationChallenge,
|
|
15917
18834
|
readEnvSelector,
|
|
15918
18835
|
readTraceId,
|
|
18836
|
+
readOtelTraceId,
|
|
15919
18837
|
readFrontendAppId,
|
|
15920
18838
|
readAuthenticatedUserId,
|
|
15921
18839
|
readAppwriteApiKey,
|