@salesforce/lds-adapters-service-einsteinllm 1.332.0-dev10 → 1.332.0-dev12
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/dist/es/es2018/service-einsteinllm.js +523 -260
- package/dist/es/es2018/types/src/generated/adapters/getPromptTemplate.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +1 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +3 -1
- package/dist/es/es2018/types/src/generated/resources/getEinsteinPromptTemplatesByPromptTemplateDevName.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptRecordCollectionOutputRepresentation.d.ts +3 -3
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptRecordRepresentation.d.ts +5 -4
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateAttachmentRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateGenerationsRepresentation.d.ts +4 -3
- package/package.json +4 -4
- package/sfdc/index.js +632 -361
- package/src/raml/api.raml +37 -3
- package/src/raml/luvio.raml +8 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$
|
|
7
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$4, StoreKeyMap, createResourceParams as createResourceParams$7, typeCheckConfig as typeCheckConfig$7 } from '@luvio/engine';
|
|
8
8
|
|
|
9
9
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
10
|
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
@@ -168,7 +168,7 @@ function createLink(ref) {
|
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
function validate$
|
|
171
|
+
function validate$r(obj, path = 'EinsteinLlmEmbeddingsAdditionalConfigInputRepresentation') {
|
|
172
172
|
const v_error = (() => {
|
|
173
173
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
174
174
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -212,7 +212,7 @@ function validate$q(obj, path = 'EinsteinLlmEmbeddingsAdditionalConfigInputRepre
|
|
|
212
212
|
return v_error === undefined ? null : v_error;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
function validate$
|
|
215
|
+
function validate$q(obj, path = 'WrappedListString') {
|
|
216
216
|
const v_error = (() => {
|
|
217
217
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
218
218
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -233,14 +233,14 @@ function validate$p(obj, path = 'WrappedListString') {
|
|
|
233
233
|
return v_error === undefined ? null : v_error;
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
function validate$
|
|
236
|
+
function validate$p(obj, path = 'EinsteinLlmEmbeddingsInputRepresentation') {
|
|
237
237
|
const v_error = (() => {
|
|
238
238
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
239
239
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
240
240
|
}
|
|
241
241
|
const obj_additionalConfig = obj.additionalConfig;
|
|
242
242
|
const path_additionalConfig = path + '.additionalConfig';
|
|
243
|
-
const referencepath_additionalConfigValidationError = validate$
|
|
243
|
+
const referencepath_additionalConfigValidationError = validate$r(obj_additionalConfig, path_additionalConfig);
|
|
244
244
|
if (referencepath_additionalConfigValidationError !== null) {
|
|
245
245
|
let message = 'Object doesn\'t match EinsteinLlmEmbeddingsAdditionalConfigInputRepresentation (at "' + path_additionalConfig + '")\n';
|
|
246
246
|
message += referencepath_additionalConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -248,7 +248,7 @@ function validate$o(obj, path = 'EinsteinLlmEmbeddingsInputRepresentation') {
|
|
|
248
248
|
}
|
|
249
249
|
const obj_prompts = obj.prompts;
|
|
250
250
|
const path_prompts = path + '.prompts';
|
|
251
|
-
const referencepath_promptsValidationError = validate$
|
|
251
|
+
const referencepath_promptsValidationError = validate$q(obj_prompts, path_prompts);
|
|
252
252
|
if (referencepath_promptsValidationError !== null) {
|
|
253
253
|
let message = 'Object doesn\'t match WrappedListString (at "' + path_prompts + '")\n';
|
|
254
254
|
message += referencepath_promptsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -265,8 +265,8 @@ function validate$o(obj, path = 'EinsteinLlmEmbeddingsInputRepresentation') {
|
|
|
265
265
|
return v_error === undefined ? null : v_error;
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
-
const VERSION$
|
|
269
|
-
function validate$
|
|
268
|
+
const VERSION$i = "5ed5ccc6fa6f15691ec0fc1080e41fe6";
|
|
269
|
+
function validate$o(obj, path = 'EinsteinLlmEmbeddingItemRepresentation') {
|
|
270
270
|
const v_error = (() => {
|
|
271
271
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
272
272
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -287,10 +287,10 @@ function validate$n(obj, path = 'EinsteinLlmEmbeddingItemRepresentation') {
|
|
|
287
287
|
})();
|
|
288
288
|
return v_error === undefined ? null : v_error;
|
|
289
289
|
}
|
|
290
|
-
const select$
|
|
290
|
+
const select$p = function EinsteinLlmEmbeddingItemRepresentationSelect() {
|
|
291
291
|
return {
|
|
292
292
|
kind: 'Fragment',
|
|
293
|
-
version: VERSION$
|
|
293
|
+
version: VERSION$i,
|
|
294
294
|
private: [],
|
|
295
295
|
selections: [
|
|
296
296
|
{
|
|
@@ -305,7 +305,7 @@ const select$m = function EinsteinLlmEmbeddingItemRepresentationSelect() {
|
|
|
305
305
|
]
|
|
306
306
|
};
|
|
307
307
|
};
|
|
308
|
-
function equals$
|
|
308
|
+
function equals$i(existing, incoming) {
|
|
309
309
|
const existing_index = existing.index;
|
|
310
310
|
const incoming_index = incoming.index;
|
|
311
311
|
if (!(existing_index === incoming_index)) {
|
|
@@ -324,9 +324,9 @@ function equals$g(existing, incoming) {
|
|
|
324
324
|
return true;
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
-
const TTL$
|
|
328
|
-
const VERSION$
|
|
329
|
-
function validate$
|
|
327
|
+
const TTL$6 = 100;
|
|
328
|
+
const VERSION$h = "d9873651f09d29764ef4d4231eb653d7";
|
|
329
|
+
function validate$n(obj, path = 'EinsteinLlmEmbeddingsRepresentation') {
|
|
330
330
|
const v_error = (() => {
|
|
331
331
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
332
332
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -339,7 +339,7 @@ function validate$m(obj, path = 'EinsteinLlmEmbeddingsRepresentation') {
|
|
|
339
339
|
for (let i = 0; i < obj_embeddings.length; i++) {
|
|
340
340
|
const obj_embeddings_item = obj_embeddings[i];
|
|
341
341
|
const path_embeddings_item = path_embeddings + '[' + i + ']';
|
|
342
|
-
const referencepath_embeddings_itemValidationError = validate$
|
|
342
|
+
const referencepath_embeddings_itemValidationError = validate$o(obj_embeddings_item, path_embeddings_item);
|
|
343
343
|
if (referencepath_embeddings_itemValidationError !== null) {
|
|
344
344
|
let message = 'Object doesn\'t match EinsteinLlmEmbeddingItemRepresentation (at "' + path_embeddings_item + '")\n';
|
|
345
345
|
message += referencepath_embeddings_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -363,15 +363,15 @@ function validate$m(obj, path = 'EinsteinLlmEmbeddingsRepresentation') {
|
|
|
363
363
|
})();
|
|
364
364
|
return v_error === undefined ? null : v_error;
|
|
365
365
|
}
|
|
366
|
-
const RepresentationType$
|
|
367
|
-
function normalize$
|
|
366
|
+
const RepresentationType$6 = 'EinsteinLlmEmbeddingsRepresentation';
|
|
367
|
+
function normalize$6(input, existing, path, luvio, store, timestamp) {
|
|
368
368
|
return input;
|
|
369
369
|
}
|
|
370
|
-
const select$
|
|
371
|
-
const { selections: EinsteinLlmEmbeddingItemRepresentation__selections, opaque: EinsteinLlmEmbeddingItemRepresentation__opaque, } = select$
|
|
370
|
+
const select$o = function EinsteinLlmEmbeddingsRepresentationSelect() {
|
|
371
|
+
const { selections: EinsteinLlmEmbeddingItemRepresentation__selections, opaque: EinsteinLlmEmbeddingItemRepresentation__opaque, } = select$p();
|
|
372
372
|
return {
|
|
373
373
|
kind: 'Fragment',
|
|
374
|
-
version: VERSION$
|
|
374
|
+
version: VERSION$h,
|
|
375
375
|
private: [],
|
|
376
376
|
selections: [
|
|
377
377
|
{
|
|
@@ -388,11 +388,11 @@ const select$l = function EinsteinLlmEmbeddingsRepresentationSelect() {
|
|
|
388
388
|
]
|
|
389
389
|
};
|
|
390
390
|
};
|
|
391
|
-
function equals$
|
|
391
|
+
function equals$h(existing, incoming) {
|
|
392
392
|
const existing_embeddings = existing.embeddings;
|
|
393
393
|
const incoming_embeddings = incoming.embeddings;
|
|
394
394
|
const equals_embeddings_items = equalsArray(existing_embeddings, incoming_embeddings, (existing_embeddings_item, incoming_embeddings_item) => {
|
|
395
|
-
if (!(equals$
|
|
395
|
+
if (!(equals$i(existing_embeddings_item, incoming_embeddings_item))) {
|
|
396
396
|
return false;
|
|
397
397
|
}
|
|
398
398
|
});
|
|
@@ -411,44 +411,44 @@ function equals$f(existing, incoming) {
|
|
|
411
411
|
}
|
|
412
412
|
return true;
|
|
413
413
|
}
|
|
414
|
-
const ingest$
|
|
414
|
+
const ingest$6 = function EinsteinLlmEmbeddingsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
415
415
|
if (process.env.NODE_ENV !== 'production') {
|
|
416
|
-
const validateError = validate$
|
|
416
|
+
const validateError = validate$n(input);
|
|
417
417
|
if (validateError !== null) {
|
|
418
418
|
throw validateError;
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
const key = path.fullPath;
|
|
422
|
-
const ttlToUse = TTL$
|
|
423
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
422
|
+
const ttlToUse = TTL$6;
|
|
423
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "EinsteinLLM", VERSION$h, RepresentationType$6, equals$h);
|
|
424
424
|
return createLink(key);
|
|
425
425
|
};
|
|
426
|
-
function getTypeCacheKeys$
|
|
426
|
+
function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
|
|
427
427
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
428
428
|
const rootKey = fullPathFactory();
|
|
429
429
|
rootKeySet.set(rootKey, {
|
|
430
430
|
namespace: keyPrefix,
|
|
431
|
-
representationName: RepresentationType$
|
|
431
|
+
representationName: RepresentationType$6,
|
|
432
432
|
mergeable: false
|
|
433
433
|
});
|
|
434
434
|
}
|
|
435
435
|
|
|
436
|
-
function select$
|
|
437
|
-
return select$
|
|
436
|
+
function select$n(luvio, params) {
|
|
437
|
+
return select$o();
|
|
438
438
|
}
|
|
439
|
-
function keyBuilder$
|
|
439
|
+
function keyBuilder$a(luvio, params) {
|
|
440
440
|
return keyPrefix + '::EinsteinLlmEmbeddingsRepresentation:(' + stableJSONStringify(params.body.embeddingsInput.additionalConfig.additionalParameters) + '::' + 'embeddingsInput.additionalConfig.applicationName:' + params.body.embeddingsInput.additionalConfig.applicationName + '::' + (params.body.embeddingsInput.additionalConfig.enablePiiMasking === undefined ? 'embeddingsInput.additionalConfig.enablePiiMasking' : 'embeddingsInput.additionalConfig.enablePiiMasking:' + params.body.embeddingsInput.additionalConfig.enablePiiMasking) + '::' + (params.body.embeddingsInput.additionalConfig.model === undefined ? 'embeddingsInput.additionalConfig.model' : 'embeddingsInput.additionalConfig.model:' + params.body.embeddingsInput.additionalConfig.model) + '::' + 'embeddingsInput.prompts.wrappedListString:' + params.body.embeddingsInput.prompts.wrappedListString + '::' + (params.body.embeddingsInput.provider === undefined ? 'embeddingsInput.provider' : 'embeddingsInput.provider:' + params.body.embeddingsInput.provider) + ')';
|
|
441
441
|
}
|
|
442
|
-
function getResponseCacheKeys$
|
|
443
|
-
getTypeCacheKeys$
|
|
442
|
+
function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
|
|
443
|
+
getTypeCacheKeys$6(storeKeyMap, luvio, response, () => keyBuilder$a(luvio, resourceParams));
|
|
444
444
|
}
|
|
445
|
-
function ingestSuccess$
|
|
445
|
+
function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
|
|
446
446
|
const { body } = response;
|
|
447
|
-
const key = keyBuilder$
|
|
448
|
-
luvio.storeIngest(key, ingest$
|
|
447
|
+
const key = keyBuilder$a(luvio, resourceParams);
|
|
448
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
449
449
|
const snapshot = luvio.storeLookup({
|
|
450
450
|
recordId: key,
|
|
451
|
-
node: select$
|
|
451
|
+
node: select$n(),
|
|
452
452
|
variables: {},
|
|
453
453
|
}, snapshotRefresh);
|
|
454
454
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -459,19 +459,19 @@ function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
459
459
|
deepFreeze(snapshot.data);
|
|
460
460
|
return snapshot;
|
|
461
461
|
}
|
|
462
|
-
function ingestError$
|
|
463
|
-
const key = keyBuilder$
|
|
462
|
+
function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
463
|
+
const key = keyBuilder$a(luvio, params);
|
|
464
464
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
465
465
|
const storeMetadataParams = {
|
|
466
|
-
ttl: TTL$
|
|
466
|
+
ttl: TTL$6,
|
|
467
467
|
namespace: keyPrefix,
|
|
468
|
-
version: VERSION$
|
|
469
|
-
representationName: RepresentationType$
|
|
468
|
+
version: VERSION$h,
|
|
469
|
+
representationName: RepresentationType$6
|
|
470
470
|
};
|
|
471
471
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
472
472
|
return errorSnapshot;
|
|
473
473
|
}
|
|
474
|
-
function createResourceRequest$
|
|
474
|
+
function createResourceRequest$6(config) {
|
|
475
475
|
const headers = {};
|
|
476
476
|
return {
|
|
477
477
|
baseUri: '/services/data/v63.0',
|
|
@@ -485,97 +485,97 @@ function createResourceRequest$5(config) {
|
|
|
485
485
|
};
|
|
486
486
|
}
|
|
487
487
|
|
|
488
|
-
const adapterName$
|
|
488
|
+
const adapterName$6 = 'createEmbeddings';
|
|
489
489
|
const createEmbeddings_ConfigPropertyMetadata = [
|
|
490
490
|
generateParamConfigMetadata('embeddingsInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
491
491
|
];
|
|
492
|
-
const createEmbeddings_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
493
|
-
const createResourceParams$
|
|
494
|
-
function keyBuilder$
|
|
495
|
-
const resourceParams = createResourceParams$
|
|
496
|
-
return keyBuilder$
|
|
492
|
+
const createEmbeddings_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, createEmbeddings_ConfigPropertyMetadata);
|
|
493
|
+
const createResourceParams$6 = /*#__PURE__*/ createResourceParams$7(createEmbeddings_ConfigPropertyMetadata);
|
|
494
|
+
function keyBuilder$9(luvio, config) {
|
|
495
|
+
const resourceParams = createResourceParams$6(config);
|
|
496
|
+
return keyBuilder$a(luvio, resourceParams);
|
|
497
497
|
}
|
|
498
|
-
function typeCheckConfig$
|
|
498
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
499
499
|
const config = {};
|
|
500
500
|
const untrustedConfig_embeddingsInput = untrustedConfig.embeddingsInput;
|
|
501
|
-
const referenceEinsteinLlmEmbeddingsInputRepresentationValidationError = validate$
|
|
501
|
+
const referenceEinsteinLlmEmbeddingsInputRepresentationValidationError = validate$p(untrustedConfig_embeddingsInput);
|
|
502
502
|
if (referenceEinsteinLlmEmbeddingsInputRepresentationValidationError === null) {
|
|
503
503
|
config.embeddingsInput = untrustedConfig_embeddingsInput;
|
|
504
504
|
}
|
|
505
505
|
return config;
|
|
506
506
|
}
|
|
507
|
-
function validateAdapterConfig$
|
|
507
|
+
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
508
508
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
509
509
|
return null;
|
|
510
510
|
}
|
|
511
511
|
if (process.env.NODE_ENV !== 'production') {
|
|
512
512
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
513
513
|
}
|
|
514
|
-
const config = typeCheckConfig$
|
|
514
|
+
const config = typeCheckConfig$6(untrustedConfig);
|
|
515
515
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
516
516
|
return null;
|
|
517
517
|
}
|
|
518
518
|
return config;
|
|
519
519
|
}
|
|
520
|
-
function adapterFragment$
|
|
521
|
-
createResourceParams$
|
|
522
|
-
return select$
|
|
520
|
+
function adapterFragment$3(luvio, config) {
|
|
521
|
+
createResourceParams$6(config);
|
|
522
|
+
return select$n();
|
|
523
523
|
}
|
|
524
|
-
function onFetchResponseSuccess$
|
|
525
|
-
const snapshot = ingestSuccess$
|
|
524
|
+
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
525
|
+
const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
|
|
526
526
|
config,
|
|
527
|
-
resolve: () => buildNetworkSnapshot$
|
|
527
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
528
528
|
});
|
|
529
529
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
530
530
|
}
|
|
531
|
-
function onFetchResponseError$
|
|
532
|
-
const snapshot = ingestError$
|
|
531
|
+
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
532
|
+
const snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
533
533
|
config,
|
|
534
|
-
resolve: () => buildNetworkSnapshot$
|
|
534
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
535
535
|
});
|
|
536
536
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
537
537
|
}
|
|
538
|
-
function buildNetworkSnapshot$
|
|
539
|
-
const resourceParams = createResourceParams$
|
|
540
|
-
const request = createResourceRequest$
|
|
538
|
+
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
539
|
+
const resourceParams = createResourceParams$6(config);
|
|
540
|
+
const request = createResourceRequest$6(resourceParams);
|
|
541
541
|
return luvio.dispatchResourceRequest(request, options)
|
|
542
542
|
.then((response) => {
|
|
543
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
543
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
|
|
544
544
|
const cache = new StoreKeyMap();
|
|
545
|
-
getResponseCacheKeys$
|
|
545
|
+
getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
|
|
546
546
|
return cache;
|
|
547
547
|
});
|
|
548
548
|
}, (response) => {
|
|
549
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
549
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
|
|
550
550
|
});
|
|
551
551
|
}
|
|
552
|
-
function buildNetworkSnapshotCachePolicy$
|
|
553
|
-
return buildNetworkSnapshotCachePolicy$
|
|
552
|
+
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
553
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, 'get', false);
|
|
554
554
|
}
|
|
555
|
-
function buildCachedSnapshotCachePolicy$
|
|
555
|
+
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
556
556
|
const { luvio, config } = context;
|
|
557
557
|
const selector = {
|
|
558
|
-
recordId: keyBuilder$
|
|
559
|
-
node: adapterFragment$
|
|
558
|
+
recordId: keyBuilder$9(luvio, config),
|
|
559
|
+
node: adapterFragment$3(luvio, config),
|
|
560
560
|
variables: {},
|
|
561
561
|
};
|
|
562
562
|
const cacheSnapshot = storeLookup(selector, {
|
|
563
563
|
config,
|
|
564
|
-
resolve: () => buildNetworkSnapshot$
|
|
564
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
565
565
|
});
|
|
566
566
|
return cacheSnapshot;
|
|
567
567
|
}
|
|
568
568
|
const createEmbeddingsAdapterFactory = (luvio) => function EinsteinLLM__createEmbeddings(untrustedConfig, requestContext) {
|
|
569
|
-
const config = validateAdapterConfig$
|
|
569
|
+
const config = validateAdapterConfig$6(untrustedConfig, createEmbeddings_ConfigPropertyNames);
|
|
570
570
|
// Invalid or incomplete config
|
|
571
571
|
if (config === null) {
|
|
572
572
|
return null;
|
|
573
573
|
}
|
|
574
574
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
575
|
-
buildCachedSnapshotCachePolicy$
|
|
575
|
+
buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
|
|
576
576
|
};
|
|
577
577
|
|
|
578
|
-
function validate$
|
|
578
|
+
function validate$m(obj, path = 'EinsteinLlmFeedbackInputRepresentation') {
|
|
579
579
|
const v_error = (() => {
|
|
580
580
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
581
581
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -622,9 +622,9 @@ function validate$l(obj, path = 'EinsteinLlmFeedbackInputRepresentation') {
|
|
|
622
622
|
return v_error === undefined ? null : v_error;
|
|
623
623
|
}
|
|
624
624
|
|
|
625
|
-
const TTL$
|
|
626
|
-
const VERSION$
|
|
627
|
-
function validate$
|
|
625
|
+
const TTL$5 = 100;
|
|
626
|
+
const VERSION$g = "4033328f65865dd5d80c68a7573a4522";
|
|
627
|
+
function validate$l(obj, path = 'EinsteinLlmFeedbackRepresentation') {
|
|
628
628
|
const v_error = (() => {
|
|
629
629
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
630
630
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -637,23 +637,23 @@ function validate$k(obj, path = 'EinsteinLlmFeedbackRepresentation') {
|
|
|
637
637
|
})();
|
|
638
638
|
return v_error === undefined ? null : v_error;
|
|
639
639
|
}
|
|
640
|
-
const RepresentationType$
|
|
641
|
-
function keyBuilder$
|
|
642
|
-
return keyPrefix + '::' + RepresentationType$
|
|
640
|
+
const RepresentationType$5 = 'EinsteinLlmFeedbackRepresentation';
|
|
641
|
+
function keyBuilder$8(luvio, config) {
|
|
642
|
+
return keyPrefix + '::' + RepresentationType$5 + ':' + config.message;
|
|
643
643
|
}
|
|
644
644
|
function keyBuilderFromType$2(luvio, object) {
|
|
645
645
|
const keyParams = {
|
|
646
646
|
message: object.message
|
|
647
647
|
};
|
|
648
|
-
return keyBuilder$
|
|
648
|
+
return keyBuilder$8(luvio, keyParams);
|
|
649
649
|
}
|
|
650
|
-
function normalize$
|
|
650
|
+
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
651
651
|
return input;
|
|
652
652
|
}
|
|
653
|
-
const select$
|
|
653
|
+
const select$m = function EinsteinLlmFeedbackRepresentationSelect() {
|
|
654
654
|
return {
|
|
655
655
|
kind: 'Fragment',
|
|
656
|
-
version: VERSION$
|
|
656
|
+
version: VERSION$g,
|
|
657
657
|
private: [],
|
|
658
658
|
selections: [
|
|
659
659
|
{
|
|
@@ -663,7 +663,7 @@ const select$j = function EinsteinLlmFeedbackRepresentationSelect() {
|
|
|
663
663
|
]
|
|
664
664
|
};
|
|
665
665
|
};
|
|
666
|
-
function equals$
|
|
666
|
+
function equals$g(existing, incoming) {
|
|
667
667
|
const existing_message = existing.message;
|
|
668
668
|
const incoming_message = incoming.message;
|
|
669
669
|
if (!(existing_message === incoming_message)) {
|
|
@@ -671,41 +671,41 @@ function equals$e(existing, incoming) {
|
|
|
671
671
|
}
|
|
672
672
|
return true;
|
|
673
673
|
}
|
|
674
|
-
const ingest$
|
|
674
|
+
const ingest$5 = function EinsteinLlmFeedbackRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
675
675
|
if (process.env.NODE_ENV !== 'production') {
|
|
676
|
-
const validateError = validate$
|
|
676
|
+
const validateError = validate$l(input);
|
|
677
677
|
if (validateError !== null) {
|
|
678
678
|
throw validateError;
|
|
679
679
|
}
|
|
680
680
|
}
|
|
681
681
|
const key = keyBuilderFromType$2(luvio, input);
|
|
682
|
-
const ttlToUse = TTL$
|
|
683
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
682
|
+
const ttlToUse = TTL$5;
|
|
683
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "EinsteinLLM", VERSION$g, RepresentationType$5, equals$g);
|
|
684
684
|
return createLink(key);
|
|
685
685
|
};
|
|
686
|
-
function getTypeCacheKeys$
|
|
686
|
+
function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
|
|
687
687
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
688
688
|
const rootKey = keyBuilderFromType$2(luvio, input);
|
|
689
689
|
rootKeySet.set(rootKey, {
|
|
690
690
|
namespace: keyPrefix,
|
|
691
|
-
representationName: RepresentationType$
|
|
691
|
+
representationName: RepresentationType$5,
|
|
692
692
|
mergeable: false
|
|
693
693
|
});
|
|
694
694
|
}
|
|
695
695
|
|
|
696
|
-
function select$
|
|
697
|
-
return select$
|
|
696
|
+
function select$l(luvio, params) {
|
|
697
|
+
return select$m();
|
|
698
698
|
}
|
|
699
|
-
function getResponseCacheKeys$
|
|
700
|
-
getTypeCacheKeys$
|
|
699
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
700
|
+
getTypeCacheKeys$5(storeKeyMap, luvio, response);
|
|
701
701
|
}
|
|
702
|
-
function ingestSuccess$
|
|
702
|
+
function ingestSuccess$5(luvio, resourceParams, response) {
|
|
703
703
|
const { body } = response;
|
|
704
704
|
const key = keyBuilderFromType$2(luvio, body);
|
|
705
|
-
luvio.storeIngest(key, ingest$
|
|
705
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
706
706
|
const snapshot = luvio.storeLookup({
|
|
707
707
|
recordId: key,
|
|
708
|
-
node: select$
|
|
708
|
+
node: select$l(),
|
|
709
709
|
variables: {},
|
|
710
710
|
});
|
|
711
711
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -716,7 +716,7 @@ function ingestSuccess$4(luvio, resourceParams, response) {
|
|
|
716
716
|
deepFreeze(snapshot.data);
|
|
717
717
|
return snapshot;
|
|
718
718
|
}
|
|
719
|
-
function createResourceRequest$
|
|
719
|
+
function createResourceRequest$5(config) {
|
|
720
720
|
const headers = {};
|
|
721
721
|
return {
|
|
722
722
|
baseUri: '/services/data/v63.0',
|
|
@@ -730,45 +730,45 @@ function createResourceRequest$4(config) {
|
|
|
730
730
|
};
|
|
731
731
|
}
|
|
732
732
|
|
|
733
|
-
const adapterName$
|
|
733
|
+
const adapterName$5 = 'createFeedback';
|
|
734
734
|
const createFeedback_ConfigPropertyMetadata = [
|
|
735
735
|
generateParamConfigMetadata('feedbackInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
736
736
|
];
|
|
737
|
-
const createFeedback_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
738
|
-
const createResourceParams$
|
|
739
|
-
function typeCheckConfig$
|
|
737
|
+
const createFeedback_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, createFeedback_ConfigPropertyMetadata);
|
|
738
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$7(createFeedback_ConfigPropertyMetadata);
|
|
739
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
740
740
|
const config = {};
|
|
741
741
|
const untrustedConfig_feedbackInput = untrustedConfig.feedbackInput;
|
|
742
|
-
const referenceEinsteinLlmFeedbackInputRepresentationValidationError = validate$
|
|
742
|
+
const referenceEinsteinLlmFeedbackInputRepresentationValidationError = validate$m(untrustedConfig_feedbackInput);
|
|
743
743
|
if (referenceEinsteinLlmFeedbackInputRepresentationValidationError === null) {
|
|
744
744
|
config.feedbackInput = untrustedConfig_feedbackInput;
|
|
745
745
|
}
|
|
746
746
|
return config;
|
|
747
747
|
}
|
|
748
|
-
function validateAdapterConfig$
|
|
748
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
749
749
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
750
750
|
return null;
|
|
751
751
|
}
|
|
752
752
|
if (process.env.NODE_ENV !== 'production') {
|
|
753
753
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
754
754
|
}
|
|
755
|
-
const config = typeCheckConfig$
|
|
755
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
756
756
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
757
757
|
return null;
|
|
758
758
|
}
|
|
759
759
|
return config;
|
|
760
760
|
}
|
|
761
|
-
function buildNetworkSnapshot$
|
|
762
|
-
const resourceParams = createResourceParams$
|
|
763
|
-
const request = createResourceRequest$
|
|
761
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
762
|
+
const resourceParams = createResourceParams$5(config);
|
|
763
|
+
const request = createResourceRequest$5(resourceParams);
|
|
764
764
|
return luvio.dispatchResourceRequest(request, options)
|
|
765
765
|
.then((response) => {
|
|
766
766
|
return luvio.handleSuccessResponse(() => {
|
|
767
|
-
const snapshot = ingestSuccess$
|
|
767
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response);
|
|
768
768
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
769
769
|
}, () => {
|
|
770
770
|
const cache = new StoreKeyMap();
|
|
771
|
-
getResponseCacheKeys$
|
|
771
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
772
772
|
return cache;
|
|
773
773
|
});
|
|
774
774
|
}, (response) => {
|
|
@@ -778,16 +778,16 @@ function buildNetworkSnapshot$4(luvio, config, options) {
|
|
|
778
778
|
}
|
|
779
779
|
const createFeedbackAdapterFactory = (luvio) => {
|
|
780
780
|
return function createFeedback(untrustedConfig) {
|
|
781
|
-
const config = validateAdapterConfig$
|
|
781
|
+
const config = validateAdapterConfig$5(untrustedConfig, createFeedback_ConfigPropertyNames);
|
|
782
782
|
// Invalid or incomplete config
|
|
783
783
|
if (config === null) {
|
|
784
784
|
throw new Error('Invalid config for "createFeedback"');
|
|
785
785
|
}
|
|
786
|
-
return buildNetworkSnapshot$
|
|
786
|
+
return buildNetworkSnapshot$5(luvio, config);
|
|
787
787
|
};
|
|
788
788
|
};
|
|
789
789
|
|
|
790
|
-
function validate$
|
|
790
|
+
function validate$k(obj, path = 'EinsteinLlmAdditionalConfigInputRepresentation') {
|
|
791
791
|
const v_error = (() => {
|
|
792
792
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
793
793
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -870,7 +870,7 @@ function validate$j(obj, path = 'EinsteinLlmAdditionalConfigInputRepresentation'
|
|
|
870
870
|
return v_error === undefined ? null : v_error;
|
|
871
871
|
}
|
|
872
872
|
|
|
873
|
-
function validate$
|
|
873
|
+
function validate$j(obj, path = 'EinsteinLlmGenerationsInputRepresentation') {
|
|
874
874
|
const v_error = (() => {
|
|
875
875
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
876
876
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -878,7 +878,7 @@ function validate$i(obj, path = 'EinsteinLlmGenerationsInputRepresentation') {
|
|
|
878
878
|
if (obj.additionalConfig !== undefined) {
|
|
879
879
|
const obj_additionalConfig = obj.additionalConfig;
|
|
880
880
|
const path_additionalConfig = path + '.additionalConfig';
|
|
881
|
-
const referencepath_additionalConfigValidationError = validate$
|
|
881
|
+
const referencepath_additionalConfigValidationError = validate$k(obj_additionalConfig, path_additionalConfig);
|
|
882
882
|
if (referencepath_additionalConfigValidationError !== null) {
|
|
883
883
|
let message = 'Object doesn\'t match EinsteinLlmAdditionalConfigInputRepresentation (at "' + path_additionalConfig + '")\n';
|
|
884
884
|
message += referencepath_additionalConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -901,8 +901,8 @@ function validate$i(obj, path = 'EinsteinLlmGenerationsInputRepresentation') {
|
|
|
901
901
|
return v_error === undefined ? null : v_error;
|
|
902
902
|
}
|
|
903
903
|
|
|
904
|
-
const VERSION$
|
|
905
|
-
function validate$
|
|
904
|
+
const VERSION$f = "9ebac74e6f964c363d5fd1913df363af";
|
|
905
|
+
function validate$i(obj, path = 'EinsteinLlmGenerationsContentQualityRepresentation') {
|
|
906
906
|
const v_error = (() => {
|
|
907
907
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
908
908
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -938,10 +938,10 @@ function validate$h(obj, path = 'EinsteinLlmGenerationsContentQualityRepresentat
|
|
|
938
938
|
})();
|
|
939
939
|
return v_error === undefined ? null : v_error;
|
|
940
940
|
}
|
|
941
|
-
const select$
|
|
941
|
+
const select$k = function EinsteinLlmGenerationsContentQualityRepresentationSelect() {
|
|
942
942
|
return {
|
|
943
943
|
kind: 'Fragment',
|
|
944
|
-
version: VERSION$
|
|
944
|
+
version: VERSION$f,
|
|
945
945
|
private: [],
|
|
946
946
|
selections: [
|
|
947
947
|
{
|
|
@@ -952,7 +952,7 @@ const select$h = function EinsteinLlmGenerationsContentQualityRepresentationSele
|
|
|
952
952
|
]
|
|
953
953
|
};
|
|
954
954
|
};
|
|
955
|
-
function equals$
|
|
955
|
+
function equals$f(existing, incoming) {
|
|
956
956
|
const existing_isToxicityDetected = existing.isToxicityDetected;
|
|
957
957
|
const incoming_isToxicityDetected = incoming.isToxicityDetected;
|
|
958
958
|
// if at least one of these optionals is defined
|
|
@@ -969,8 +969,8 @@ function equals$d(existing, incoming) {
|
|
|
969
969
|
return true;
|
|
970
970
|
}
|
|
971
971
|
|
|
972
|
-
const VERSION$
|
|
973
|
-
function validate$
|
|
972
|
+
const VERSION$e = "77af44a252cb5b45b4d9a8101368d2aa";
|
|
973
|
+
function validate$h(obj, path = 'EinsteinLlmGenerationsSafetyScoreRepresentation') {
|
|
974
974
|
const v_error = (() => {
|
|
975
975
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
976
976
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1174,10 +1174,10 @@ function validate$g(obj, path = 'EinsteinLlmGenerationsSafetyScoreRepresentation
|
|
|
1174
1174
|
})();
|
|
1175
1175
|
return v_error === undefined ? null : v_error;
|
|
1176
1176
|
}
|
|
1177
|
-
const select$
|
|
1177
|
+
const select$j = function EinsteinLlmGenerationsSafetyScoreRepresentationSelect() {
|
|
1178
1178
|
return {
|
|
1179
1179
|
kind: 'Fragment',
|
|
1180
|
-
version: VERSION$
|
|
1180
|
+
version: VERSION$e,
|
|
1181
1181
|
private: [],
|
|
1182
1182
|
selections: [
|
|
1183
1183
|
{
|
|
@@ -1218,7 +1218,7 @@ const select$g = function EinsteinLlmGenerationsSafetyScoreRepresentationSelect(
|
|
|
1218
1218
|
]
|
|
1219
1219
|
};
|
|
1220
1220
|
};
|
|
1221
|
-
function equals$
|
|
1221
|
+
function equals$e(existing, incoming) {
|
|
1222
1222
|
const existing_hateScore = existing.hateScore;
|
|
1223
1223
|
const incoming_hateScore = incoming.hateScore;
|
|
1224
1224
|
// if at least one of these optionals is defined
|
|
@@ -1313,8 +1313,8 @@ function equals$c(existing, incoming) {
|
|
|
1313
1313
|
return true;
|
|
1314
1314
|
}
|
|
1315
1315
|
|
|
1316
|
-
const VERSION$
|
|
1317
|
-
function validate$
|
|
1316
|
+
const VERSION$d = "4a07778ff6c595d91c575188146647a1";
|
|
1317
|
+
function validate$g(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
|
|
1318
1318
|
const v_error = (() => {
|
|
1319
1319
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1320
1320
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1324,7 +1324,7 @@ function validate$f(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
|
|
|
1324
1324
|
const path_contentQualityRepresentation = path + '.contentQualityRepresentation';
|
|
1325
1325
|
let obj_contentQualityRepresentation_union0 = null;
|
|
1326
1326
|
const obj_contentQualityRepresentation_union0_error = (() => {
|
|
1327
|
-
const referencepath_contentQualityRepresentationValidationError = validate$
|
|
1327
|
+
const referencepath_contentQualityRepresentationValidationError = validate$i(obj_contentQualityRepresentation, path_contentQualityRepresentation);
|
|
1328
1328
|
if (referencepath_contentQualityRepresentationValidationError !== null) {
|
|
1329
1329
|
let message = 'Object doesn\'t match EinsteinLlmGenerationsContentQualityRepresentation (at "' + path_contentQualityRepresentation + '")\n';
|
|
1330
1330
|
message += referencepath_contentQualityRepresentationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1372,7 +1372,7 @@ function validate$f(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
|
|
|
1372
1372
|
const path_safetyScoreRepresentation = path + '.safetyScoreRepresentation';
|
|
1373
1373
|
let obj_safetyScoreRepresentation_union0 = null;
|
|
1374
1374
|
const obj_safetyScoreRepresentation_union0_error = (() => {
|
|
1375
|
-
const referencepath_safetyScoreRepresentationValidationError = validate$
|
|
1375
|
+
const referencepath_safetyScoreRepresentationValidationError = validate$h(obj_safetyScoreRepresentation, path_safetyScoreRepresentation);
|
|
1376
1376
|
if (referencepath_safetyScoreRepresentationValidationError !== null) {
|
|
1377
1377
|
let message = 'Object doesn\'t match EinsteinLlmGenerationsSafetyScoreRepresentation (at "' + path_safetyScoreRepresentation + '")\n';
|
|
1378
1378
|
message += referencepath_safetyScoreRepresentationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1406,12 +1406,12 @@ function validate$f(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
|
|
|
1406
1406
|
})();
|
|
1407
1407
|
return v_error === undefined ? null : v_error;
|
|
1408
1408
|
}
|
|
1409
|
-
const select$
|
|
1410
|
-
const { selections: EinsteinLlmGenerationsContentQualityRepresentation__selections, opaque: EinsteinLlmGenerationsContentQualityRepresentation__opaque, } = select$
|
|
1411
|
-
const { selections: EinsteinLlmGenerationsSafetyScoreRepresentation__selections, opaque: EinsteinLlmGenerationsSafetyScoreRepresentation__opaque, } = select$
|
|
1409
|
+
const select$i = function EinsteinLlmGenerationItemRepresentationSelect() {
|
|
1410
|
+
const { selections: EinsteinLlmGenerationsContentQualityRepresentation__selections, opaque: EinsteinLlmGenerationsContentQualityRepresentation__opaque, } = select$k();
|
|
1411
|
+
const { selections: EinsteinLlmGenerationsSafetyScoreRepresentation__selections, opaque: EinsteinLlmGenerationsSafetyScoreRepresentation__opaque, } = select$j();
|
|
1412
1412
|
return {
|
|
1413
1413
|
kind: 'Fragment',
|
|
1414
|
-
version: VERSION$
|
|
1414
|
+
version: VERSION$d,
|
|
1415
1415
|
private: [],
|
|
1416
1416
|
selections: [
|
|
1417
1417
|
{
|
|
@@ -1448,7 +1448,7 @@ const select$f = function EinsteinLlmGenerationItemRepresentationSelect() {
|
|
|
1448
1448
|
]
|
|
1449
1449
|
};
|
|
1450
1450
|
};
|
|
1451
|
-
function equals$
|
|
1451
|
+
function equals$d(existing, incoming) {
|
|
1452
1452
|
const existing_isSummarized = existing.isSummarized;
|
|
1453
1453
|
const incoming_isSummarized = incoming.isSummarized;
|
|
1454
1454
|
// if at least one of these optionals is defined
|
|
@@ -1489,7 +1489,7 @@ function equals$b(existing, incoming) {
|
|
|
1489
1489
|
if (!(existing_contentQualityRepresentation === incoming_contentQualityRepresentation
|
|
1490
1490
|
|| (existing_contentQualityRepresentation != null &&
|
|
1491
1491
|
incoming_contentQualityRepresentation != null &&
|
|
1492
|
-
equals$
|
|
1492
|
+
equals$f(existing_contentQualityRepresentation, incoming_contentQualityRepresentation)))) {
|
|
1493
1493
|
return false;
|
|
1494
1494
|
}
|
|
1495
1495
|
}
|
|
@@ -1505,15 +1505,15 @@ function equals$b(existing, incoming) {
|
|
|
1505
1505
|
if (!(existing_safetyScoreRepresentation === incoming_safetyScoreRepresentation
|
|
1506
1506
|
|| (existing_safetyScoreRepresentation != null &&
|
|
1507
1507
|
incoming_safetyScoreRepresentation != null &&
|
|
1508
|
-
equals$
|
|
1508
|
+
equals$e(existing_safetyScoreRepresentation, incoming_safetyScoreRepresentation)))) {
|
|
1509
1509
|
return false;
|
|
1510
1510
|
}
|
|
1511
1511
|
}
|
|
1512
1512
|
return true;
|
|
1513
1513
|
}
|
|
1514
1514
|
|
|
1515
|
-
const VERSION$
|
|
1516
|
-
function validate$
|
|
1515
|
+
const VERSION$c = "4656c961c9d093a9e206c1db7d4de0b0";
|
|
1516
|
+
function validate$f(obj, path = 'WrappedMap') {
|
|
1517
1517
|
const v_error = (() => {
|
|
1518
1518
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1519
1519
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1535,15 +1535,15 @@ function validate$e(obj, path = 'WrappedMap') {
|
|
|
1535
1535
|
})();
|
|
1536
1536
|
return v_error === undefined ? null : v_error;
|
|
1537
1537
|
}
|
|
1538
|
-
const select$
|
|
1538
|
+
const select$h = function WrappedMapSelect() {
|
|
1539
1539
|
return {
|
|
1540
1540
|
kind: 'Fragment',
|
|
1541
|
-
version: VERSION$
|
|
1541
|
+
version: VERSION$c,
|
|
1542
1542
|
private: [],
|
|
1543
1543
|
selections: []
|
|
1544
1544
|
};
|
|
1545
1545
|
};
|
|
1546
|
-
function equals$
|
|
1546
|
+
function equals$c(existing, incoming) {
|
|
1547
1547
|
const existing_wrappedMap = existing.wrappedMap;
|
|
1548
1548
|
const incoming_wrappedMap = incoming.wrappedMap;
|
|
1549
1549
|
const equals_wrappedMap_props = equalsObject(existing_wrappedMap, incoming_wrappedMap, (existing_wrappedMap_prop, incoming_wrappedMap_prop) => {
|
|
@@ -1554,9 +1554,9 @@ function equals$a(existing, incoming) {
|
|
|
1554
1554
|
return true;
|
|
1555
1555
|
}
|
|
1556
1556
|
|
|
1557
|
-
const TTL$
|
|
1558
|
-
const VERSION$
|
|
1559
|
-
function validate$
|
|
1557
|
+
const TTL$4 = 100;
|
|
1558
|
+
const VERSION$b = "d8abd72a42e842b253da1c38954dafbc";
|
|
1559
|
+
function validate$e(obj, path = 'EinsteinLlmGenerationsRepresentation') {
|
|
1560
1560
|
const v_error = (() => {
|
|
1561
1561
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1562
1562
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1569,7 +1569,7 @@ function validate$d(obj, path = 'EinsteinLlmGenerationsRepresentation') {
|
|
|
1569
1569
|
for (let i = 0; i < obj_generations.length; i++) {
|
|
1570
1570
|
const obj_generations_item = obj_generations[i];
|
|
1571
1571
|
const path_generations_item = path_generations + '[' + i + ']';
|
|
1572
|
-
const referencepath_generations_itemValidationError = validate$
|
|
1572
|
+
const referencepath_generations_itemValidationError = validate$g(obj_generations_item, path_generations_item);
|
|
1573
1573
|
if (referencepath_generations_itemValidationError !== null) {
|
|
1574
1574
|
let message = 'Object doesn\'t match EinsteinLlmGenerationItemRepresentation (at "' + path_generations_item + '")\n';
|
|
1575
1575
|
message += referencepath_generations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1580,7 +1580,7 @@ function validate$d(obj, path = 'EinsteinLlmGenerationsRepresentation') {
|
|
|
1580
1580
|
const path_parameters = path + '.parameters';
|
|
1581
1581
|
let obj_parameters_union0 = null;
|
|
1582
1582
|
const obj_parameters_union0_error = (() => {
|
|
1583
|
-
const referencepath_parametersValidationError = validate$
|
|
1583
|
+
const referencepath_parametersValidationError = validate$f(obj_parameters, path_parameters);
|
|
1584
1584
|
if (referencepath_parametersValidationError !== null) {
|
|
1585
1585
|
let message = 'Object doesn\'t match WrappedMap (at "' + path_parameters + '")\n';
|
|
1586
1586
|
message += referencepath_parametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1639,25 +1639,25 @@ function validate$d(obj, path = 'EinsteinLlmGenerationsRepresentation') {
|
|
|
1639
1639
|
})();
|
|
1640
1640
|
return v_error === undefined ? null : v_error;
|
|
1641
1641
|
}
|
|
1642
|
-
const RepresentationType$
|
|
1643
|
-
function keyBuilder$
|
|
1644
|
-
return keyPrefix + '::' + RepresentationType$
|
|
1642
|
+
const RepresentationType$4 = 'EinsteinLlmGenerationsRepresentation';
|
|
1643
|
+
function keyBuilder$7(luvio, config) {
|
|
1644
|
+
return keyPrefix + '::' + RepresentationType$4 + ':' + config.requestId;
|
|
1645
1645
|
}
|
|
1646
1646
|
function keyBuilderFromType$1(luvio, object) {
|
|
1647
1647
|
const keyParams = {
|
|
1648
1648
|
requestId: object.requestId
|
|
1649
1649
|
};
|
|
1650
|
-
return keyBuilder$
|
|
1650
|
+
return keyBuilder$7(luvio, keyParams);
|
|
1651
1651
|
}
|
|
1652
|
-
function normalize$
|
|
1652
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
1653
1653
|
return input;
|
|
1654
1654
|
}
|
|
1655
|
-
const select$
|
|
1656
|
-
const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$
|
|
1657
|
-
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$
|
|
1655
|
+
const select$g = function EinsteinLlmGenerationsRepresentationSelect() {
|
|
1656
|
+
const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$i();
|
|
1657
|
+
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$h();
|
|
1658
1658
|
return {
|
|
1659
1659
|
kind: 'Fragment',
|
|
1660
|
-
version: VERSION$
|
|
1660
|
+
version: VERSION$b,
|
|
1661
1661
|
private: [],
|
|
1662
1662
|
selections: [
|
|
1663
1663
|
{
|
|
@@ -1683,7 +1683,7 @@ const select$d = function EinsteinLlmGenerationsRepresentationSelect() {
|
|
|
1683
1683
|
]
|
|
1684
1684
|
};
|
|
1685
1685
|
};
|
|
1686
|
-
function equals$
|
|
1686
|
+
function equals$b(existing, incoming) {
|
|
1687
1687
|
const existing_requestId = existing.requestId;
|
|
1688
1688
|
const incoming_requestId = incoming.requestId;
|
|
1689
1689
|
if (!(existing_requestId === incoming_requestId)) {
|
|
@@ -1692,7 +1692,7 @@ function equals$9(existing, incoming) {
|
|
|
1692
1692
|
const existing_generations = existing.generations;
|
|
1693
1693
|
const incoming_generations = incoming.generations;
|
|
1694
1694
|
const equals_generations_items = equalsArray(existing_generations, incoming_generations, (existing_generations_item, incoming_generations_item) => {
|
|
1695
|
-
if (!(equals$
|
|
1695
|
+
if (!(equals$d(existing_generations_item, incoming_generations_item))) {
|
|
1696
1696
|
return false;
|
|
1697
1697
|
}
|
|
1698
1698
|
});
|
|
@@ -1704,7 +1704,7 @@ function equals$9(existing, incoming) {
|
|
|
1704
1704
|
if (!(existing_parameters === incoming_parameters
|
|
1705
1705
|
|| (existing_parameters != null &&
|
|
1706
1706
|
incoming_parameters != null &&
|
|
1707
|
-
equals$
|
|
1707
|
+
equals$c(existing_parameters, incoming_parameters)))) {
|
|
1708
1708
|
return false;
|
|
1709
1709
|
}
|
|
1710
1710
|
const existing_prompt = existing.prompt;
|
|
@@ -1714,41 +1714,41 @@ function equals$9(existing, incoming) {
|
|
|
1714
1714
|
}
|
|
1715
1715
|
return true;
|
|
1716
1716
|
}
|
|
1717
|
-
const ingest$
|
|
1717
|
+
const ingest$4 = function EinsteinLlmGenerationsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1718
1718
|
if (process.env.NODE_ENV !== 'production') {
|
|
1719
|
-
const validateError = validate$
|
|
1719
|
+
const validateError = validate$e(input);
|
|
1720
1720
|
if (validateError !== null) {
|
|
1721
1721
|
throw validateError;
|
|
1722
1722
|
}
|
|
1723
1723
|
}
|
|
1724
1724
|
const key = keyBuilderFromType$1(luvio, input);
|
|
1725
|
-
const ttlToUse = TTL$
|
|
1726
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
1725
|
+
const ttlToUse = TTL$4;
|
|
1726
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "EinsteinLLM", VERSION$b, RepresentationType$4, equals$b);
|
|
1727
1727
|
return createLink(key);
|
|
1728
1728
|
};
|
|
1729
|
-
function getTypeCacheKeys$
|
|
1729
|
+
function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
|
|
1730
1730
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1731
1731
|
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
1732
1732
|
rootKeySet.set(rootKey, {
|
|
1733
1733
|
namespace: keyPrefix,
|
|
1734
|
-
representationName: RepresentationType$
|
|
1734
|
+
representationName: RepresentationType$4,
|
|
1735
1735
|
mergeable: false
|
|
1736
1736
|
});
|
|
1737
1737
|
}
|
|
1738
1738
|
|
|
1739
|
-
function select$
|
|
1740
|
-
return select$
|
|
1739
|
+
function select$f(luvio, params) {
|
|
1740
|
+
return select$g();
|
|
1741
1741
|
}
|
|
1742
|
-
function getResponseCacheKeys$
|
|
1743
|
-
getTypeCacheKeys$
|
|
1742
|
+
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
1743
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response);
|
|
1744
1744
|
}
|
|
1745
|
-
function ingestSuccess$
|
|
1745
|
+
function ingestSuccess$4(luvio, resourceParams, response) {
|
|
1746
1746
|
const { body } = response;
|
|
1747
1747
|
const key = keyBuilderFromType$1(luvio, body);
|
|
1748
|
-
luvio.storeIngest(key, ingest$
|
|
1748
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
1749
1749
|
const snapshot = luvio.storeLookup({
|
|
1750
1750
|
recordId: key,
|
|
1751
|
-
node: select$
|
|
1751
|
+
node: select$f(),
|
|
1752
1752
|
variables: {},
|
|
1753
1753
|
});
|
|
1754
1754
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1759,7 +1759,7 @@ function ingestSuccess$3(luvio, resourceParams, response) {
|
|
|
1759
1759
|
deepFreeze(snapshot.data);
|
|
1760
1760
|
return snapshot;
|
|
1761
1761
|
}
|
|
1762
|
-
function createResourceRequest$
|
|
1762
|
+
function createResourceRequest$4(config) {
|
|
1763
1763
|
const headers = {};
|
|
1764
1764
|
return {
|
|
1765
1765
|
baseUri: '/services/data/v63.0',
|
|
@@ -1773,45 +1773,45 @@ function createResourceRequest$3(config) {
|
|
|
1773
1773
|
};
|
|
1774
1774
|
}
|
|
1775
1775
|
|
|
1776
|
-
const adapterName$
|
|
1776
|
+
const adapterName$4 = 'createGenerations';
|
|
1777
1777
|
const createGenerations_ConfigPropertyMetadata = [
|
|
1778
1778
|
generateParamConfigMetadata('generationsInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1779
1779
|
];
|
|
1780
|
-
const createGenerations_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
1781
|
-
const createResourceParams$
|
|
1782
|
-
function typeCheckConfig$
|
|
1780
|
+
const createGenerations_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, createGenerations_ConfigPropertyMetadata);
|
|
1781
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$7(createGenerations_ConfigPropertyMetadata);
|
|
1782
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
1783
1783
|
const config = {};
|
|
1784
1784
|
const untrustedConfig_generationsInput = untrustedConfig.generationsInput;
|
|
1785
|
-
const referenceEinsteinLlmGenerationsInputRepresentationValidationError = validate$
|
|
1785
|
+
const referenceEinsteinLlmGenerationsInputRepresentationValidationError = validate$j(untrustedConfig_generationsInput);
|
|
1786
1786
|
if (referenceEinsteinLlmGenerationsInputRepresentationValidationError === null) {
|
|
1787
1787
|
config.generationsInput = untrustedConfig_generationsInput;
|
|
1788
1788
|
}
|
|
1789
1789
|
return config;
|
|
1790
1790
|
}
|
|
1791
|
-
function validateAdapterConfig$
|
|
1791
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
1792
1792
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1793
1793
|
return null;
|
|
1794
1794
|
}
|
|
1795
1795
|
if (process.env.NODE_ENV !== 'production') {
|
|
1796
1796
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1797
1797
|
}
|
|
1798
|
-
const config = typeCheckConfig$
|
|
1798
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
1799
1799
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1800
1800
|
return null;
|
|
1801
1801
|
}
|
|
1802
1802
|
return config;
|
|
1803
1803
|
}
|
|
1804
|
-
function buildNetworkSnapshot$
|
|
1805
|
-
const resourceParams = createResourceParams$
|
|
1806
|
-
const request = createResourceRequest$
|
|
1804
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
1805
|
+
const resourceParams = createResourceParams$4(config);
|
|
1806
|
+
const request = createResourceRequest$4(resourceParams);
|
|
1807
1807
|
return luvio.dispatchResourceRequest(request, options)
|
|
1808
1808
|
.then((response) => {
|
|
1809
1809
|
return luvio.handleSuccessResponse(() => {
|
|
1810
|
-
const snapshot = ingestSuccess$
|
|
1810
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response);
|
|
1811
1811
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1812
1812
|
}, () => {
|
|
1813
1813
|
const cache = new StoreKeyMap();
|
|
1814
|
-
getResponseCacheKeys$
|
|
1814
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
|
|
1815
1815
|
return cache;
|
|
1816
1816
|
});
|
|
1817
1817
|
}, (response) => {
|
|
@@ -1821,16 +1821,16 @@ function buildNetworkSnapshot$3(luvio, config, options) {
|
|
|
1821
1821
|
}
|
|
1822
1822
|
const createGenerationsAdapterFactory = (luvio) => {
|
|
1823
1823
|
return function createGenerations(untrustedConfig) {
|
|
1824
|
-
const config = validateAdapterConfig$
|
|
1824
|
+
const config = validateAdapterConfig$4(untrustedConfig, createGenerations_ConfigPropertyNames);
|
|
1825
1825
|
// Invalid or incomplete config
|
|
1826
1826
|
if (config === null) {
|
|
1827
1827
|
throw new Error('Invalid config for "createGenerations"');
|
|
1828
1828
|
}
|
|
1829
|
-
return buildNetworkSnapshot$
|
|
1829
|
+
return buildNetworkSnapshot$4(luvio, config);
|
|
1830
1830
|
};
|
|
1831
1831
|
};
|
|
1832
1832
|
|
|
1833
|
-
function validate$
|
|
1833
|
+
function validate$d(obj, path = 'EinsteinPromptRecordFieldRepresentation') {
|
|
1834
1834
|
const v_error = (() => {
|
|
1835
1835
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1836
1836
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1890,7 +1890,9 @@ function validate$c(obj, path = 'EinsteinPromptRecordFieldRepresentation') {
|
|
|
1890
1890
|
return v_error === undefined ? null : v_error;
|
|
1891
1891
|
}
|
|
1892
1892
|
|
|
1893
|
-
|
|
1893
|
+
const TTL$3 = 100;
|
|
1894
|
+
const VERSION$a = "ade243411889bb9f3753d7f300fa3657";
|
|
1895
|
+
function validate$c(obj, path = 'EinsteinPromptRecordRepresentation') {
|
|
1894
1896
|
const v_error = (() => {
|
|
1895
1897
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1896
1898
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1913,7 +1915,7 @@ function validate$b(obj, path = 'EinsteinPromptRecordRepresentation') {
|
|
|
1913
1915
|
const key = obj_childRelationships_keys[i];
|
|
1914
1916
|
const obj_childRelationships_prop = obj_childRelationships[key];
|
|
1915
1917
|
const path_childRelationships_prop = path_childRelationships + '["' + key + '"]';
|
|
1916
|
-
const referencepath_childRelationships_propValidationError = validate$
|
|
1918
|
+
const referencepath_childRelationships_propValidationError = validate$c(obj_childRelationships_prop, path_childRelationships_prop);
|
|
1917
1919
|
if (referencepath_childRelationships_propValidationError !== null) {
|
|
1918
1920
|
let message = 'Object doesn\'t match EinsteinPromptRecordRepresentation (at "' + path_childRelationships_prop + '")\n';
|
|
1919
1921
|
message += referencepath_childRelationships_propValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1932,7 +1934,7 @@ function validate$b(obj, path = 'EinsteinPromptRecordRepresentation') {
|
|
|
1932
1934
|
const key = obj_fields_keys[i];
|
|
1933
1935
|
const obj_fields_prop = obj_fields[key];
|
|
1934
1936
|
const path_fields_prop = path_fields + '["' + key + '"]';
|
|
1935
|
-
const referencepath_fields_propValidationError = validate$
|
|
1937
|
+
const referencepath_fields_propValidationError = validate$d(obj_fields_prop, path_fields_prop);
|
|
1936
1938
|
if (referencepath_fields_propValidationError !== null) {
|
|
1937
1939
|
let message = 'Object doesn\'t match EinsteinPromptRecordFieldRepresentation (at "' + path_fields_prop + '")\n';
|
|
1938
1940
|
message += referencepath_fields_propValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1950,10 +1952,49 @@ function validate$b(obj, path = 'EinsteinPromptRecordRepresentation') {
|
|
|
1950
1952
|
})();
|
|
1951
1953
|
return v_error === undefined ? null : v_error;
|
|
1952
1954
|
}
|
|
1955
|
+
const RepresentationType$3 = 'EinsteinPromptRecordRepresentation';
|
|
1956
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
1957
|
+
return input;
|
|
1958
|
+
}
|
|
1959
|
+
const select$e = function EinsteinPromptRecordRepresentationSelect() {
|
|
1960
|
+
return {
|
|
1961
|
+
kind: 'Fragment',
|
|
1962
|
+
version: VERSION$a,
|
|
1963
|
+
private: [],
|
|
1964
|
+
opaque: true
|
|
1965
|
+
};
|
|
1966
|
+
};
|
|
1967
|
+
function equals$a(existing, incoming) {
|
|
1968
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
1969
|
+
return false;
|
|
1970
|
+
}
|
|
1971
|
+
return true;
|
|
1972
|
+
}
|
|
1973
|
+
const ingest$3 = function EinsteinPromptRecordRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1974
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1975
|
+
const validateError = validate$c(input);
|
|
1976
|
+
if (validateError !== null) {
|
|
1977
|
+
throw validateError;
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
const key = path.fullPath;
|
|
1981
|
+
const ttlToUse = TTL$3;
|
|
1982
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "EinsteinLLM", VERSION$a, RepresentationType$3, equals$a);
|
|
1983
|
+
return createLink(key);
|
|
1984
|
+
};
|
|
1985
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
1986
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1987
|
+
const rootKey = fullPathFactory();
|
|
1988
|
+
rootKeySet.set(rootKey, {
|
|
1989
|
+
namespace: keyPrefix,
|
|
1990
|
+
representationName: RepresentationType$3,
|
|
1991
|
+
mergeable: false
|
|
1992
|
+
});
|
|
1993
|
+
}
|
|
1953
1994
|
|
|
1954
1995
|
const TTL$2 = 100;
|
|
1955
|
-
const VERSION$
|
|
1956
|
-
function validate$
|
|
1996
|
+
const VERSION$9 = "5fd7b8a03d155ba601bcb4ee725e0893";
|
|
1997
|
+
function validate$b(obj, path = 'EinsteinPromptRecordCollectionOutputRepresentation') {
|
|
1957
1998
|
const v_error = (() => {
|
|
1958
1999
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1959
2000
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1972,7 +2013,7 @@ function validate$a(obj, path = 'EinsteinPromptRecordCollectionOutputRepresentat
|
|
|
1972
2013
|
for (let i = 0; i < obj_promptRecords.length; i++) {
|
|
1973
2014
|
const obj_promptRecords_item = obj_promptRecords[i];
|
|
1974
2015
|
const path_promptRecords_item = path_promptRecords + '[' + i + ']';
|
|
1975
|
-
const referencepath_promptRecords_itemValidationError = validate$
|
|
2016
|
+
const referencepath_promptRecords_itemValidationError = validate$c(obj_promptRecords_item, path_promptRecords_item);
|
|
1976
2017
|
if (referencepath_promptRecords_itemValidationError !== null) {
|
|
1977
2018
|
let message = 'Object doesn\'t match EinsteinPromptRecordRepresentation (at "' + path_promptRecords_item + '")\n';
|
|
1978
2019
|
message += referencepath_promptRecords_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1992,15 +2033,15 @@ const RepresentationType$2 = 'EinsteinPromptRecordCollectionOutputRepresentation
|
|
|
1992
2033
|
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
1993
2034
|
return input;
|
|
1994
2035
|
}
|
|
1995
|
-
const select$
|
|
2036
|
+
const select$d = function EinsteinPromptRecordCollectionOutputRepresentationSelect() {
|
|
1996
2037
|
return {
|
|
1997
2038
|
kind: 'Fragment',
|
|
1998
|
-
version: VERSION$
|
|
2039
|
+
version: VERSION$9,
|
|
1999
2040
|
private: [],
|
|
2000
2041
|
opaque: true
|
|
2001
2042
|
};
|
|
2002
2043
|
};
|
|
2003
|
-
function equals$
|
|
2044
|
+
function equals$9(existing, incoming) {
|
|
2004
2045
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
2005
2046
|
return false;
|
|
2006
2047
|
}
|
|
@@ -2008,14 +2049,14 @@ function equals$8(existing, incoming) {
|
|
|
2008
2049
|
}
|
|
2009
2050
|
const ingest$2 = function EinsteinPromptRecordCollectionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2010
2051
|
if (process.env.NODE_ENV !== 'production') {
|
|
2011
|
-
const validateError = validate$
|
|
2052
|
+
const validateError = validate$b(input);
|
|
2012
2053
|
if (validateError !== null) {
|
|
2013
2054
|
throw validateError;
|
|
2014
2055
|
}
|
|
2015
2056
|
}
|
|
2016
2057
|
const key = path.fullPath;
|
|
2017
2058
|
const ttlToUse = TTL$2;
|
|
2018
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "EinsteinLLM", VERSION$
|
|
2059
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "EinsteinLLM", VERSION$9, RepresentationType$2, equals$9);
|
|
2019
2060
|
return createLink(key);
|
|
2020
2061
|
};
|
|
2021
2062
|
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
@@ -2028,22 +2069,22 @@ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
|
2028
2069
|
});
|
|
2029
2070
|
}
|
|
2030
2071
|
|
|
2031
|
-
function select$
|
|
2032
|
-
return select$
|
|
2072
|
+
function select$c(luvio, params) {
|
|
2073
|
+
return select$d();
|
|
2033
2074
|
}
|
|
2034
|
-
function keyBuilder$
|
|
2075
|
+
function keyBuilder$6(luvio, params) {
|
|
2035
2076
|
return keyPrefix + '::EinsteinPromptRecordCollectionOutputRepresentation:(' + 'isActive:' + params.queryParams.isActive + ',' + 'fields:' + params.queryParams.fields + ',' + 'relatedEntity:' + params.queryParams.relatedEntity + ',' + 'offset:' + params.queryParams.offset + ',' + 'pageLimit:' + params.queryParams.pageLimit + ',' + 'type:' + params.queryParams.type + ',' + 'query:' + params.queryParams.query + ',' + 'sortBy:' + params.queryParams.sortBy + ')';
|
|
2036
2077
|
}
|
|
2037
|
-
function getResponseCacheKeys$
|
|
2038
|
-
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$
|
|
2078
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
2079
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$6(luvio, resourceParams));
|
|
2039
2080
|
}
|
|
2040
|
-
function ingestSuccess$
|
|
2081
|
+
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
2041
2082
|
const { body } = response;
|
|
2042
|
-
const key = keyBuilder$
|
|
2083
|
+
const key = keyBuilder$6(luvio, resourceParams);
|
|
2043
2084
|
luvio.storeIngest(key, ingest$2, body);
|
|
2044
2085
|
const snapshot = luvio.storeLookup({
|
|
2045
2086
|
recordId: key,
|
|
2046
|
-
node: select$
|
|
2087
|
+
node: select$c(),
|
|
2047
2088
|
variables: {},
|
|
2048
2089
|
}, snapshotRefresh);
|
|
2049
2090
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2054,19 +2095,19 @@ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
2054
2095
|
deepFreeze(snapshot.data);
|
|
2055
2096
|
return snapshot;
|
|
2056
2097
|
}
|
|
2057
|
-
function ingestError$
|
|
2058
|
-
const key = keyBuilder$
|
|
2098
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
2099
|
+
const key = keyBuilder$6(luvio, params);
|
|
2059
2100
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2060
2101
|
const storeMetadataParams = {
|
|
2061
2102
|
ttl: TTL$2,
|
|
2062
2103
|
namespace: keyPrefix,
|
|
2063
|
-
version: VERSION$
|
|
2104
|
+
version: VERSION$9,
|
|
2064
2105
|
representationName: RepresentationType$2
|
|
2065
2106
|
};
|
|
2066
2107
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2067
2108
|
return errorSnapshot;
|
|
2068
2109
|
}
|
|
2069
|
-
function createResourceRequest$
|
|
2110
|
+
function createResourceRequest$3(config) {
|
|
2070
2111
|
const headers = {};
|
|
2071
2112
|
return {
|
|
2072
2113
|
baseUri: '/services/data/v63.0',
|
|
@@ -2080,7 +2121,7 @@ function createResourceRequest$2(config) {
|
|
|
2080
2121
|
};
|
|
2081
2122
|
}
|
|
2082
2123
|
|
|
2083
|
-
const adapterName$
|
|
2124
|
+
const adapterName$3 = 'getPromptTemplates';
|
|
2084
2125
|
const getPromptTemplates_ConfigPropertyMetadata = [
|
|
2085
2126
|
generateParamConfigMetadata('isActive', false, 1 /* QueryParameter */, 1 /* Boolean */),
|
|
2086
2127
|
generateParamConfigMetadata('fields', false, 1 /* QueryParameter */, 0 /* String */, true),
|
|
@@ -2091,15 +2132,154 @@ const getPromptTemplates_ConfigPropertyMetadata = [
|
|
|
2091
2132
|
generateParamConfigMetadata('query', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2092
2133
|
generateParamConfigMetadata('sortBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2093
2134
|
];
|
|
2094
|
-
const getPromptTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
2095
|
-
const createResourceParams$
|
|
2135
|
+
const getPromptTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getPromptTemplates_ConfigPropertyMetadata);
|
|
2136
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$7(getPromptTemplates_ConfigPropertyMetadata);
|
|
2137
|
+
function keyBuilder$5(luvio, config) {
|
|
2138
|
+
const resourceParams = createResourceParams$3(config);
|
|
2139
|
+
return keyBuilder$6(luvio, resourceParams);
|
|
2140
|
+
}
|
|
2141
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
2142
|
+
const config = {};
|
|
2143
|
+
typeCheckConfig$7(untrustedConfig, config, getPromptTemplates_ConfigPropertyMetadata);
|
|
2144
|
+
return config;
|
|
2145
|
+
}
|
|
2146
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
2147
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2148
|
+
return null;
|
|
2149
|
+
}
|
|
2150
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2151
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2152
|
+
}
|
|
2153
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
2154
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2155
|
+
return null;
|
|
2156
|
+
}
|
|
2157
|
+
return config;
|
|
2158
|
+
}
|
|
2159
|
+
function adapterFragment$2(luvio, config) {
|
|
2160
|
+
createResourceParams$3(config);
|
|
2161
|
+
return select$c();
|
|
2162
|
+
}
|
|
2163
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
2164
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
2165
|
+
config,
|
|
2166
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
2167
|
+
});
|
|
2168
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2169
|
+
}
|
|
2170
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
2171
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
2172
|
+
config,
|
|
2173
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
2174
|
+
});
|
|
2175
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2176
|
+
}
|
|
2177
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
2178
|
+
const resourceParams = createResourceParams$3(config);
|
|
2179
|
+
const request = createResourceRequest$3(resourceParams);
|
|
2180
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2181
|
+
.then((response) => {
|
|
2182
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
2183
|
+
const cache = new StoreKeyMap();
|
|
2184
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
2185
|
+
return cache;
|
|
2186
|
+
});
|
|
2187
|
+
}, (response) => {
|
|
2188
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
2189
|
+
});
|
|
2190
|
+
}
|
|
2191
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
2192
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
|
|
2193
|
+
}
|
|
2194
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
2195
|
+
const { luvio, config } = context;
|
|
2196
|
+
const selector = {
|
|
2197
|
+
recordId: keyBuilder$5(luvio, config),
|
|
2198
|
+
node: adapterFragment$2(luvio, config),
|
|
2199
|
+
variables: {},
|
|
2200
|
+
};
|
|
2201
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2202
|
+
config,
|
|
2203
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
2204
|
+
});
|
|
2205
|
+
return cacheSnapshot;
|
|
2206
|
+
}
|
|
2207
|
+
const getPromptTemplatesAdapterFactory = (luvio) => function EinsteinLLM__getPromptTemplates(untrustedConfig, requestContext) {
|
|
2208
|
+
const config = validateAdapterConfig$3(untrustedConfig, getPromptTemplates_ConfigPropertyNames);
|
|
2209
|
+
// Invalid or incomplete config
|
|
2210
|
+
if (config === null) {
|
|
2211
|
+
return null;
|
|
2212
|
+
}
|
|
2213
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2214
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
2215
|
+
};
|
|
2216
|
+
|
|
2217
|
+
function select$b(luvio, params) {
|
|
2218
|
+
return select$e();
|
|
2219
|
+
}
|
|
2220
|
+
function keyBuilder$4(luvio, params) {
|
|
2221
|
+
return keyPrefix + '::EinsteinPromptRecordRepresentation:(' + 'versionId:' + params.queryParams.versionId + ',' + 'promptTemplateDevName:' + params.urlParams.promptTemplateDevName + ')';
|
|
2222
|
+
}
|
|
2223
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
2224
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$4(luvio, resourceParams));
|
|
2225
|
+
}
|
|
2226
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
2227
|
+
const { body } = response;
|
|
2228
|
+
const key = keyBuilder$4(luvio, resourceParams);
|
|
2229
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
2230
|
+
const snapshot = luvio.storeLookup({
|
|
2231
|
+
recordId: key,
|
|
2232
|
+
node: select$b(),
|
|
2233
|
+
variables: {},
|
|
2234
|
+
}, snapshotRefresh);
|
|
2235
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2236
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2237
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
deepFreeze(snapshot.data);
|
|
2241
|
+
return snapshot;
|
|
2242
|
+
}
|
|
2243
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
2244
|
+
const key = keyBuilder$4(luvio, params);
|
|
2245
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2246
|
+
const storeMetadataParams = {
|
|
2247
|
+
ttl: TTL$3,
|
|
2248
|
+
namespace: keyPrefix,
|
|
2249
|
+
version: VERSION$a,
|
|
2250
|
+
representationName: RepresentationType$3
|
|
2251
|
+
};
|
|
2252
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2253
|
+
return errorSnapshot;
|
|
2254
|
+
}
|
|
2255
|
+
function createResourceRequest$2(config) {
|
|
2256
|
+
const headers = {};
|
|
2257
|
+
return {
|
|
2258
|
+
baseUri: '/services/data/v63.0',
|
|
2259
|
+
basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '',
|
|
2260
|
+
method: 'get',
|
|
2261
|
+
body: null,
|
|
2262
|
+
urlParams: config.urlParams,
|
|
2263
|
+
queryParams: config.queryParams,
|
|
2264
|
+
headers,
|
|
2265
|
+
priority: 'normal',
|
|
2266
|
+
};
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
const adapterName$2 = 'getPromptTemplate';
|
|
2270
|
+
const getPromptTemplate_ConfigPropertyMetadata = [
|
|
2271
|
+
generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2272
|
+
generateParamConfigMetadata('versionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2273
|
+
];
|
|
2274
|
+
const getPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getPromptTemplate_ConfigPropertyMetadata);
|
|
2275
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$7(getPromptTemplate_ConfigPropertyMetadata);
|
|
2096
2276
|
function keyBuilder$3(luvio, config) {
|
|
2097
2277
|
const resourceParams = createResourceParams$2(config);
|
|
2098
2278
|
return keyBuilder$4(luvio, resourceParams);
|
|
2099
2279
|
}
|
|
2100
2280
|
function typeCheckConfig$2(untrustedConfig) {
|
|
2101
2281
|
const config = {};
|
|
2102
|
-
typeCheckConfig$
|
|
2282
|
+
typeCheckConfig$7(untrustedConfig, config, getPromptTemplate_ConfigPropertyMetadata);
|
|
2103
2283
|
return config;
|
|
2104
2284
|
}
|
|
2105
2285
|
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
@@ -2117,7 +2297,7 @@ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
|
2117
2297
|
}
|
|
2118
2298
|
function adapterFragment$1(luvio, config) {
|
|
2119
2299
|
createResourceParams$2(config);
|
|
2120
|
-
return select$
|
|
2300
|
+
return select$b();
|
|
2121
2301
|
}
|
|
2122
2302
|
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
2123
2303
|
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
@@ -2148,7 +2328,7 @@ function buildNetworkSnapshot$2(luvio, config, options) {
|
|
|
2148
2328
|
});
|
|
2149
2329
|
}
|
|
2150
2330
|
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
2151
|
-
return buildNetworkSnapshotCachePolicy$
|
|
2331
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
|
|
2152
2332
|
}
|
|
2153
2333
|
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
2154
2334
|
const { luvio, config } = context;
|
|
@@ -2163,8 +2343,8 @@ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
|
2163
2343
|
});
|
|
2164
2344
|
return cacheSnapshot;
|
|
2165
2345
|
}
|
|
2166
|
-
const
|
|
2167
|
-
const config = validateAdapterConfig$2(untrustedConfig,
|
|
2346
|
+
const getPromptTemplateAdapterFactory = (luvio) => function EinsteinLLM__getPromptTemplate(untrustedConfig, requestContext) {
|
|
2347
|
+
const config = validateAdapterConfig$2(untrustedConfig, getPromptTemplate_ConfigPropertyNames);
|
|
2168
2348
|
// Invalid or incomplete config
|
|
2169
2349
|
if (config === null) {
|
|
2170
2350
|
return null;
|
|
@@ -2173,7 +2353,7 @@ const getPromptTemplatesAdapterFactory = (luvio) => function EinsteinLLM__getPro
|
|
|
2173
2353
|
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
2174
2354
|
};
|
|
2175
2355
|
|
|
2176
|
-
function validate$
|
|
2356
|
+
function validate$a(obj, path = 'WrappedValueMap') {
|
|
2177
2357
|
const v_error = (() => {
|
|
2178
2358
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2179
2359
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -2196,7 +2376,7 @@ function validate$9(obj, path = 'WrappedValueMap') {
|
|
|
2196
2376
|
return v_error === undefined ? null : v_error;
|
|
2197
2377
|
}
|
|
2198
2378
|
|
|
2199
|
-
function validate$
|
|
2379
|
+
function validate$9(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresentation') {
|
|
2200
2380
|
const v_error = (() => {
|
|
2201
2381
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2202
2382
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -2204,7 +2384,7 @@ function validate$8(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
|
|
|
2204
2384
|
if (obj.additionalConfig !== undefined) {
|
|
2205
2385
|
const obj_additionalConfig = obj.additionalConfig;
|
|
2206
2386
|
const path_additionalConfig = path + '.additionalConfig';
|
|
2207
|
-
const referencepath_additionalConfigValidationError = validate$
|
|
2387
|
+
const referencepath_additionalConfigValidationError = validate$k(obj_additionalConfig, path_additionalConfig);
|
|
2208
2388
|
if (referencepath_additionalConfigValidationError !== null) {
|
|
2209
2389
|
let message = 'Object doesn\'t match EinsteinLlmAdditionalConfigInputRepresentation (at "' + path_additionalConfig + '")\n';
|
|
2210
2390
|
message += referencepath_additionalConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2213,7 +2393,7 @@ function validate$8(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
|
|
|
2213
2393
|
}
|
|
2214
2394
|
const obj_inputParams = obj.inputParams;
|
|
2215
2395
|
const path_inputParams = path + '.inputParams';
|
|
2216
|
-
const referencepath_inputParamsValidationError = validate$
|
|
2396
|
+
const referencepath_inputParamsValidationError = validate$a(obj_inputParams, path_inputParams);
|
|
2217
2397
|
if (referencepath_inputParamsValidationError !== null) {
|
|
2218
2398
|
let message = 'Object doesn\'t match WrappedValueMap (at "' + path_inputParams + '")\n';
|
|
2219
2399
|
message += referencepath_inputParamsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2242,6 +2422,84 @@ function validate$8(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
|
|
|
2242
2422
|
return v_error === undefined ? null : v_error;
|
|
2243
2423
|
}
|
|
2244
2424
|
|
|
2425
|
+
const VERSION$8 = "70b3261d05a4bf7da95cd5cabe9bd785";
|
|
2426
|
+
function validate$8(obj, path = 'EinsteinPromptTemplateAttachmentRepresentation') {
|
|
2427
|
+
const v_error = (() => {
|
|
2428
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2429
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2430
|
+
}
|
|
2431
|
+
const obj_fileExtension = obj.fileExtension;
|
|
2432
|
+
const path_fileExtension = path + '.fileExtension';
|
|
2433
|
+
if (typeof obj_fileExtension !== 'string') {
|
|
2434
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fileExtension + '" (at "' + path_fileExtension + '")');
|
|
2435
|
+
}
|
|
2436
|
+
const obj_id = obj.id;
|
|
2437
|
+
const path_id = path + '.id';
|
|
2438
|
+
if (typeof obj_id !== 'string') {
|
|
2439
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
2440
|
+
}
|
|
2441
|
+
const obj_latestPublishedVersion = obj.latestPublishedVersion;
|
|
2442
|
+
const path_latestPublishedVersion = path + '.latestPublishedVersion';
|
|
2443
|
+
if (typeof obj_latestPublishedVersion !== 'string') {
|
|
2444
|
+
return new TypeError('Expected "string" but received "' + typeof obj_latestPublishedVersion + '" (at "' + path_latestPublishedVersion + '")');
|
|
2445
|
+
}
|
|
2446
|
+
const obj_title = obj.title;
|
|
2447
|
+
const path_title = path + '.title';
|
|
2448
|
+
if (typeof obj_title !== 'string') {
|
|
2449
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
2450
|
+
}
|
|
2451
|
+
})();
|
|
2452
|
+
return v_error === undefined ? null : v_error;
|
|
2453
|
+
}
|
|
2454
|
+
const select$a = function EinsteinPromptTemplateAttachmentRepresentationSelect() {
|
|
2455
|
+
return {
|
|
2456
|
+
kind: 'Fragment',
|
|
2457
|
+
version: VERSION$8,
|
|
2458
|
+
private: [],
|
|
2459
|
+
selections: [
|
|
2460
|
+
{
|
|
2461
|
+
name: 'fileExtension',
|
|
2462
|
+
kind: 'Scalar'
|
|
2463
|
+
},
|
|
2464
|
+
{
|
|
2465
|
+
name: 'id',
|
|
2466
|
+
kind: 'Scalar'
|
|
2467
|
+
},
|
|
2468
|
+
{
|
|
2469
|
+
name: 'latestPublishedVersion',
|
|
2470
|
+
kind: 'Scalar'
|
|
2471
|
+
},
|
|
2472
|
+
{
|
|
2473
|
+
name: 'title',
|
|
2474
|
+
kind: 'Scalar'
|
|
2475
|
+
}
|
|
2476
|
+
]
|
|
2477
|
+
};
|
|
2478
|
+
};
|
|
2479
|
+
function equals$8(existing, incoming) {
|
|
2480
|
+
const existing_fileExtension = existing.fileExtension;
|
|
2481
|
+
const incoming_fileExtension = incoming.fileExtension;
|
|
2482
|
+
if (!(existing_fileExtension === incoming_fileExtension)) {
|
|
2483
|
+
return false;
|
|
2484
|
+
}
|
|
2485
|
+
const existing_id = existing.id;
|
|
2486
|
+
const incoming_id = incoming.id;
|
|
2487
|
+
if (!(existing_id === incoming_id)) {
|
|
2488
|
+
return false;
|
|
2489
|
+
}
|
|
2490
|
+
const existing_latestPublishedVersion = existing.latestPublishedVersion;
|
|
2491
|
+
const incoming_latestPublishedVersion = incoming.latestPublishedVersion;
|
|
2492
|
+
if (!(existing_latestPublishedVersion === incoming_latestPublishedVersion)) {
|
|
2493
|
+
return false;
|
|
2494
|
+
}
|
|
2495
|
+
const existing_title = existing.title;
|
|
2496
|
+
const incoming_title = incoming.title;
|
|
2497
|
+
if (!(existing_title === incoming_title)) {
|
|
2498
|
+
return false;
|
|
2499
|
+
}
|
|
2500
|
+
return true;
|
|
2501
|
+
}
|
|
2502
|
+
|
|
2245
2503
|
const VERSION$7 = "6458d624e5a1691821c764b6de0badb3";
|
|
2246
2504
|
function validate$7(obj, path = 'EinsteinPromptTemplateGenerationsErrorRepresentation') {
|
|
2247
2505
|
const v_error = (() => {
|
|
@@ -2561,23 +2819,26 @@ function equals$4(existing, incoming) {
|
|
|
2561
2819
|
}
|
|
2562
2820
|
|
|
2563
2821
|
const TTL$1 = 100;
|
|
2564
|
-
const VERSION$3 = "
|
|
2822
|
+
const VERSION$3 = "1beba5cc950346499a8f4810c77e2b03";
|
|
2565
2823
|
function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation') {
|
|
2566
2824
|
const v_error = (() => {
|
|
2567
2825
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2568
2826
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2569
2827
|
}
|
|
2570
|
-
if (obj.
|
|
2571
|
-
const
|
|
2572
|
-
const
|
|
2573
|
-
if (!ArrayIsArray(
|
|
2574
|
-
return new TypeError('Expected "array" but received "' + typeof
|
|
2575
|
-
}
|
|
2576
|
-
for (let i = 0; i <
|
|
2577
|
-
const
|
|
2578
|
-
const
|
|
2579
|
-
|
|
2580
|
-
|
|
2828
|
+
if (obj.fileData !== undefined) {
|
|
2829
|
+
const obj_fileData = obj.fileData;
|
|
2830
|
+
const path_fileData = path + '.fileData';
|
|
2831
|
+
if (!ArrayIsArray(obj_fileData)) {
|
|
2832
|
+
return new TypeError('Expected "array" but received "' + typeof obj_fileData + '" (at "' + path_fileData + '")');
|
|
2833
|
+
}
|
|
2834
|
+
for (let i = 0; i < obj_fileData.length; i++) {
|
|
2835
|
+
const obj_fileData_item = obj_fileData[i];
|
|
2836
|
+
const path_fileData_item = path_fileData + '[' + i + ']';
|
|
2837
|
+
const referencepath_fileData_itemValidationError = validate$8(obj_fileData_item, path_fileData_item);
|
|
2838
|
+
if (referencepath_fileData_itemValidationError !== null) {
|
|
2839
|
+
let message = 'Object doesn\'t match EinsteinPromptTemplateAttachmentRepresentation (at "' + path_fileData_item + '")\n';
|
|
2840
|
+
message += referencepath_fileData_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2841
|
+
return new TypeError(message);
|
|
2581
2842
|
}
|
|
2582
2843
|
}
|
|
2583
2844
|
}
|
|
@@ -2606,7 +2867,7 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2606
2867
|
for (let i = 0; i < obj_generations.length; i++) {
|
|
2607
2868
|
const obj_generations_item = obj_generations[i];
|
|
2608
2869
|
const path_generations_item = path_generations + '[' + i + ']';
|
|
2609
|
-
const referencepath_generations_itemValidationError = validate$
|
|
2870
|
+
const referencepath_generations_itemValidationError = validate$g(obj_generations_item, path_generations_item);
|
|
2610
2871
|
if (referencepath_generations_itemValidationError !== null) {
|
|
2611
2872
|
let message = 'Object doesn\'t match EinsteinLlmGenerationItemRepresentation (at "' + path_generations_item + '")\n';
|
|
2612
2873
|
message += referencepath_generations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2617,7 +2878,7 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2617
2878
|
const path_parameters = path + '.parameters';
|
|
2618
2879
|
let obj_parameters_union0 = null;
|
|
2619
2880
|
const obj_parameters_union0_error = (() => {
|
|
2620
|
-
const referencepath_parametersValidationError = validate$
|
|
2881
|
+
const referencepath_parametersValidationError = validate$f(obj_parameters, path_parameters);
|
|
2621
2882
|
if (referencepath_parametersValidationError !== null) {
|
|
2622
2883
|
let message = 'Object doesn\'t match WrappedMap (at "' + path_parameters + '")\n';
|
|
2623
2884
|
message += referencepath_parametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2746,9 +3007,10 @@ function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
|
2746
3007
|
return input;
|
|
2747
3008
|
}
|
|
2748
3009
|
const select$5 = function EinsteinPromptTemplateGenerationsRepresentationSelect() {
|
|
3010
|
+
const { selections: EinsteinPromptTemplateAttachmentRepresentation__selections, opaque: EinsteinPromptTemplateAttachmentRepresentation__opaque, } = select$a();
|
|
2749
3011
|
const { selections: EinsteinPromptTemplateGenerationsErrorRepresentation__selections, opaque: EinsteinPromptTemplateGenerationsErrorRepresentation__opaque, } = select$9();
|
|
2750
|
-
const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$
|
|
2751
|
-
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$
|
|
3012
|
+
const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$i();
|
|
3013
|
+
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$h();
|
|
2752
3014
|
const { selections: EinsteinPromptTemplateMaskContentRepresentation__selections, opaque: EinsteinPromptTemplateMaskContentRepresentation__opaque, } = select$7();
|
|
2753
3015
|
const { selections: EinsteinPromptTemplateMaskDataRepresentation__selections, opaque: EinsteinPromptTemplateMaskDataRepresentation__opaque, } = select$6();
|
|
2754
3016
|
return {
|
|
@@ -2757,9 +3019,10 @@ const select$5 = function EinsteinPromptTemplateGenerationsRepresentationSelect(
|
|
|
2757
3019
|
private: [],
|
|
2758
3020
|
selections: [
|
|
2759
3021
|
{
|
|
2760
|
-
name: '
|
|
2761
|
-
kind: '
|
|
3022
|
+
name: 'fileData',
|
|
3023
|
+
kind: 'Object',
|
|
2762
3024
|
plural: true,
|
|
3025
|
+
selections: EinsteinPromptTemplateAttachmentRepresentation__selections,
|
|
2763
3026
|
required: false
|
|
2764
3027
|
},
|
|
2765
3028
|
{
|
|
@@ -2828,21 +3091,21 @@ function equals$3(existing, incoming) {
|
|
|
2828
3091
|
if (!(existing_requestId === incoming_requestId)) {
|
|
2829
3092
|
return false;
|
|
2830
3093
|
}
|
|
2831
|
-
const
|
|
2832
|
-
const
|
|
3094
|
+
const existing_fileData = existing.fileData;
|
|
3095
|
+
const incoming_fileData = incoming.fileData;
|
|
2833
3096
|
// if at least one of these optionals is defined
|
|
2834
|
-
if (
|
|
3097
|
+
if (existing_fileData !== undefined || incoming_fileData !== undefined) {
|
|
2835
3098
|
// if one of these is not defined we know the other is defined and therefore
|
|
2836
3099
|
// not equal
|
|
2837
|
-
if (
|
|
3100
|
+
if (existing_fileData === undefined || incoming_fileData === undefined) {
|
|
2838
3101
|
return false;
|
|
2839
3102
|
}
|
|
2840
|
-
const
|
|
2841
|
-
if (!(
|
|
3103
|
+
const equals_fileData_items = equalsArray(existing_fileData, incoming_fileData, (existing_fileData_item, incoming_fileData_item) => {
|
|
3104
|
+
if (!(equals$8(existing_fileData_item, incoming_fileData_item))) {
|
|
2842
3105
|
return false;
|
|
2843
3106
|
}
|
|
2844
3107
|
});
|
|
2845
|
-
if (
|
|
3108
|
+
if (equals_fileData_items === false) {
|
|
2846
3109
|
return false;
|
|
2847
3110
|
}
|
|
2848
3111
|
}
|
|
@@ -2867,7 +3130,7 @@ function equals$3(existing, incoming) {
|
|
|
2867
3130
|
const existing_generations = existing.generations;
|
|
2868
3131
|
const incoming_generations = incoming.generations;
|
|
2869
3132
|
const equals_generations_items = equalsArray(existing_generations, incoming_generations, (existing_generations_item, incoming_generations_item) => {
|
|
2870
|
-
if (!(equals$
|
|
3133
|
+
if (!(equals$d(existing_generations_item, incoming_generations_item))) {
|
|
2871
3134
|
return false;
|
|
2872
3135
|
}
|
|
2873
3136
|
});
|
|
@@ -2879,7 +3142,7 @@ function equals$3(existing, incoming) {
|
|
|
2879
3142
|
if (!(existing_parameters === incoming_parameters
|
|
2880
3143
|
|| (existing_parameters != null &&
|
|
2881
3144
|
incoming_parameters != null &&
|
|
2882
|
-
equals$
|
|
3145
|
+
equals$c(existing_parameters, incoming_parameters)))) {
|
|
2883
3146
|
return false;
|
|
2884
3147
|
}
|
|
2885
3148
|
const existing_prompt = existing.prompt;
|
|
@@ -3009,12 +3272,12 @@ const createGenerationsForPromptTemplate_ConfigPropertyMetadata = [
|
|
|
3009
3272
|
generateParamConfigMetadata('promptTemplateGenerationsInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
3010
3273
|
];
|
|
3011
3274
|
const createGenerationsForPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
|
|
3012
|
-
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$
|
|
3275
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$7(createGenerationsForPromptTemplate_ConfigPropertyMetadata);
|
|
3013
3276
|
function typeCheckConfig$1(untrustedConfig) {
|
|
3014
3277
|
const config = {};
|
|
3015
|
-
typeCheckConfig$
|
|
3278
|
+
typeCheckConfig$7(untrustedConfig, config, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
|
|
3016
3279
|
const untrustedConfig_promptTemplateGenerationsInput = untrustedConfig.promptTemplateGenerationsInput;
|
|
3017
|
-
const referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError = validate$
|
|
3280
|
+
const referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError = validate$9(untrustedConfig_promptTemplateGenerationsInput);
|
|
3018
3281
|
if (referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError === null) {
|
|
3019
3282
|
config.promptTemplateGenerationsInput = untrustedConfig_promptTemplateGenerationsInput;
|
|
3020
3283
|
}
|
|
@@ -3375,14 +3638,14 @@ const getOutputLanguages_ConfigPropertyMetadata = [
|
|
|
3375
3638
|
generateParamConfigMetadata('versionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
3376
3639
|
];
|
|
3377
3640
|
const getOutputLanguages_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getOutputLanguages_ConfigPropertyMetadata);
|
|
3378
|
-
const createResourceParams = /*#__PURE__*/ createResourceParams$
|
|
3641
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$7(getOutputLanguages_ConfigPropertyMetadata);
|
|
3379
3642
|
function keyBuilder(luvio, config) {
|
|
3380
3643
|
const resourceParams = createResourceParams(config);
|
|
3381
3644
|
return keyBuilder$1(luvio, resourceParams);
|
|
3382
3645
|
}
|
|
3383
3646
|
function typeCheckConfig(untrustedConfig) {
|
|
3384
3647
|
const config = {};
|
|
3385
|
-
typeCheckConfig$
|
|
3648
|
+
typeCheckConfig$7(untrustedConfig, config, getOutputLanguages_ConfigPropertyMetadata);
|
|
3386
3649
|
return config;
|
|
3387
3650
|
}
|
|
3388
3651
|
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
@@ -3431,7 +3694,7 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
3431
3694
|
});
|
|
3432
3695
|
}
|
|
3433
3696
|
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
3434
|
-
return buildNetworkSnapshotCachePolicy$
|
|
3697
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
3435
3698
|
}
|
|
3436
3699
|
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
3437
3700
|
const { luvio, config } = context;
|
|
@@ -3456,4 +3719,4 @@ const getOutputLanguagesAdapterFactory = (luvio) => function EinsteinLLM__getOut
|
|
|
3456
3719
|
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
3457
3720
|
};
|
|
3458
3721
|
|
|
3459
|
-
export { createEmbeddingsAdapterFactory, createFeedbackAdapterFactory, createGenerationsAdapterFactory, createGenerationsForPromptTemplateAdapterFactory, getOutputLanguagesAdapterFactory, getPromptTemplatesAdapterFactory };
|
|
3722
|
+
export { createEmbeddingsAdapterFactory, createFeedbackAdapterFactory, createGenerationsAdapterFactory, createGenerationsForPromptTemplateAdapterFactory, getOutputLanguagesAdapterFactory, getPromptTemplateAdapterFactory, getPromptTemplatesAdapterFactory };
|