@salesforce/lds-adapters-service-einsteinllm 1.332.0-dev2 → 1.332.0-dev20
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 +1071 -369
- package/dist/es/es2018/types/src/generated/adapters/getOutputLanguages.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/adapters/getPromptTemplate.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +2 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +5 -1
- package/dist/es/es2018/types/src/generated/resources/getEinsteinPromptTemplateOutputLanguagesByPromptTemplateDevName.d.ts +19 -0
- 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 +6 -5
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateAttachmentRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateGenerationsRepresentation.d.ts +5 -1
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateSupportedLanguageErrorRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateSupportedLanguageRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateVersionOutputLanguagesRepresentation.d.ts +43 -0
- package/package.json +4 -4
- package/sfdc/index.js +1024 -302
- package/src/raml/api.raml +109 -2
- package/src/raml/luvio.raml +15 -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$n(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$m(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$l(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$l(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$k(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$i = 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$d(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$j(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$j(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$h = 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$c(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$4(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$4(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$i(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$h(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$f = 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$b(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$3(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$3(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$3(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$g(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$f(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$f(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$e(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$d = 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$a(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$d(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$c = 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$9(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$c(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$c(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$c(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$b = 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$8(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$8(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$b(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$7(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$a(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$a(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$a(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$9 = 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$6(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$6(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$6(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$2(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$2(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$2(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$9(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 = "2d1628544b54fc1701aa9b4eff05127b";
|
|
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,11 +1915,18 @@ function validate$8(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
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1918
|
+
if (!ArrayIsArray(obj_childRelationships_prop)) {
|
|
1919
|
+
return new TypeError('Expected "array" but received "' + typeof obj_childRelationships_prop + '" (at "' + path_childRelationships_prop + '")');
|
|
1920
|
+
}
|
|
1921
|
+
for (let i = 0; i < obj_childRelationships_prop.length; i++) {
|
|
1922
|
+
const obj_childRelationships_prop_item = obj_childRelationships_prop[i];
|
|
1923
|
+
const path_childRelationships_prop_item = path_childRelationships_prop + '[' + i + ']';
|
|
1924
|
+
const referencepath_childRelationships_prop_itemValidationError = validate$c(obj_childRelationships_prop_item, path_childRelationships_prop_item);
|
|
1925
|
+
if (referencepath_childRelationships_prop_itemValidationError !== null) {
|
|
1926
|
+
let message = 'Object doesn\'t match EinsteinPromptRecordRepresentation (at "' + path_childRelationships_prop_item + '")\n';
|
|
1927
|
+
message += referencepath_childRelationships_prop_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1928
|
+
return new TypeError(message);
|
|
1929
|
+
}
|
|
1921
1930
|
}
|
|
1922
1931
|
}
|
|
1923
1932
|
}
|
|
@@ -1932,7 +1941,7 @@ function validate$8(obj, path = 'EinsteinPromptRecordRepresentation') {
|
|
|
1932
1941
|
const key = obj_fields_keys[i];
|
|
1933
1942
|
const obj_fields_prop = obj_fields[key];
|
|
1934
1943
|
const path_fields_prop = path_fields + '["' + key + '"]';
|
|
1935
|
-
const referencepath_fields_propValidationError = validate$
|
|
1944
|
+
const referencepath_fields_propValidationError = validate$d(obj_fields_prop, path_fields_prop);
|
|
1936
1945
|
if (referencepath_fields_propValidationError !== null) {
|
|
1937
1946
|
let message = 'Object doesn\'t match EinsteinPromptRecordFieldRepresentation (at "' + path_fields_prop + '")\n';
|
|
1938
1947
|
message += referencepath_fields_propValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1950,10 +1959,49 @@ function validate$8(obj, path = 'EinsteinPromptRecordRepresentation') {
|
|
|
1950
1959
|
})();
|
|
1951
1960
|
return v_error === undefined ? null : v_error;
|
|
1952
1961
|
}
|
|
1962
|
+
const RepresentationType$3 = 'EinsteinPromptRecordRepresentation';
|
|
1963
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
1964
|
+
return input;
|
|
1965
|
+
}
|
|
1966
|
+
const select$e = function EinsteinPromptRecordRepresentationSelect() {
|
|
1967
|
+
return {
|
|
1968
|
+
kind: 'Fragment',
|
|
1969
|
+
version: VERSION$a,
|
|
1970
|
+
private: [],
|
|
1971
|
+
opaque: true
|
|
1972
|
+
};
|
|
1973
|
+
};
|
|
1974
|
+
function equals$a(existing, incoming) {
|
|
1975
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
1976
|
+
return false;
|
|
1977
|
+
}
|
|
1978
|
+
return true;
|
|
1979
|
+
}
|
|
1980
|
+
const ingest$3 = function EinsteinPromptRecordRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1981
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1982
|
+
const validateError = validate$c(input);
|
|
1983
|
+
if (validateError !== null) {
|
|
1984
|
+
throw validateError;
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
const key = path.fullPath;
|
|
1988
|
+
const ttlToUse = TTL$3;
|
|
1989
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "EinsteinLLM", VERSION$a, RepresentationType$3, equals$a);
|
|
1990
|
+
return createLink(key);
|
|
1991
|
+
};
|
|
1992
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
1993
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1994
|
+
const rootKey = fullPathFactory();
|
|
1995
|
+
rootKeySet.set(rootKey, {
|
|
1996
|
+
namespace: keyPrefix,
|
|
1997
|
+
representationName: RepresentationType$3,
|
|
1998
|
+
mergeable: false
|
|
1999
|
+
});
|
|
2000
|
+
}
|
|
1953
2001
|
|
|
1954
|
-
const TTL$
|
|
1955
|
-
const VERSION$
|
|
1956
|
-
function validate$
|
|
2002
|
+
const TTL$2 = 100;
|
|
2003
|
+
const VERSION$9 = "5fd7b8a03d155ba601bcb4ee725e0893";
|
|
2004
|
+
function validate$b(obj, path = 'EinsteinPromptRecordCollectionOutputRepresentation') {
|
|
1957
2005
|
const v_error = (() => {
|
|
1958
2006
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1959
2007
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1972,7 +2020,7 @@ function validate$7(obj, path = 'EinsteinPromptRecordCollectionOutputRepresentat
|
|
|
1972
2020
|
for (let i = 0; i < obj_promptRecords.length; i++) {
|
|
1973
2021
|
const obj_promptRecords_item = obj_promptRecords[i];
|
|
1974
2022
|
const path_promptRecords_item = path_promptRecords + '[' + i + ']';
|
|
1975
|
-
const referencepath_promptRecords_itemValidationError = validate$
|
|
2023
|
+
const referencepath_promptRecords_itemValidationError = validate$c(obj_promptRecords_item, path_promptRecords_item);
|
|
1976
2024
|
if (referencepath_promptRecords_itemValidationError !== null) {
|
|
1977
2025
|
let message = 'Object doesn\'t match EinsteinPromptRecordRepresentation (at "' + path_promptRecords_item + '")\n';
|
|
1978
2026
|
message += referencepath_promptRecords_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1988,62 +2036,62 @@ function validate$7(obj, path = 'EinsteinPromptRecordCollectionOutputRepresentat
|
|
|
1988
2036
|
})();
|
|
1989
2037
|
return v_error === undefined ? null : v_error;
|
|
1990
2038
|
}
|
|
1991
|
-
const RepresentationType$
|
|
1992
|
-
function normalize$
|
|
2039
|
+
const RepresentationType$2 = 'EinsteinPromptRecordCollectionOutputRepresentation';
|
|
2040
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
1993
2041
|
return input;
|
|
1994
2042
|
}
|
|
1995
|
-
const select$
|
|
2043
|
+
const select$d = function EinsteinPromptRecordCollectionOutputRepresentationSelect() {
|
|
1996
2044
|
return {
|
|
1997
2045
|
kind: 'Fragment',
|
|
1998
|
-
version: VERSION$
|
|
2046
|
+
version: VERSION$9,
|
|
1999
2047
|
private: [],
|
|
2000
2048
|
opaque: true
|
|
2001
2049
|
};
|
|
2002
2050
|
};
|
|
2003
|
-
function equals$
|
|
2051
|
+
function equals$9(existing, incoming) {
|
|
2004
2052
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
2005
2053
|
return false;
|
|
2006
2054
|
}
|
|
2007
2055
|
return true;
|
|
2008
2056
|
}
|
|
2009
|
-
const ingest$
|
|
2057
|
+
const ingest$2 = function EinsteinPromptRecordCollectionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2010
2058
|
if (process.env.NODE_ENV !== 'production') {
|
|
2011
|
-
const validateError = validate$
|
|
2059
|
+
const validateError = validate$b(input);
|
|
2012
2060
|
if (validateError !== null) {
|
|
2013
2061
|
throw validateError;
|
|
2014
2062
|
}
|
|
2015
2063
|
}
|
|
2016
2064
|
const key = path.fullPath;
|
|
2017
|
-
const ttlToUse = TTL$
|
|
2018
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
2065
|
+
const ttlToUse = TTL$2;
|
|
2066
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "EinsteinLLM", VERSION$9, RepresentationType$2, equals$9);
|
|
2019
2067
|
return createLink(key);
|
|
2020
2068
|
};
|
|
2021
|
-
function getTypeCacheKeys$
|
|
2069
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
2022
2070
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2023
2071
|
const rootKey = fullPathFactory();
|
|
2024
2072
|
rootKeySet.set(rootKey, {
|
|
2025
2073
|
namespace: keyPrefix,
|
|
2026
|
-
representationName: RepresentationType$
|
|
2074
|
+
representationName: RepresentationType$2,
|
|
2027
2075
|
mergeable: false
|
|
2028
2076
|
});
|
|
2029
2077
|
}
|
|
2030
2078
|
|
|
2031
|
-
function select$
|
|
2032
|
-
return select$
|
|
2079
|
+
function select$c(luvio, params) {
|
|
2080
|
+
return select$d();
|
|
2033
2081
|
}
|
|
2034
|
-
function keyBuilder$
|
|
2082
|
+
function keyBuilder$6(luvio, params) {
|
|
2035
2083
|
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
2084
|
}
|
|
2037
|
-
function getResponseCacheKeys$
|
|
2038
|
-
getTypeCacheKeys$
|
|
2085
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
2086
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$6(luvio, resourceParams));
|
|
2039
2087
|
}
|
|
2040
|
-
function ingestSuccess$
|
|
2088
|
+
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
2041
2089
|
const { body } = response;
|
|
2042
|
-
const key = keyBuilder$
|
|
2043
|
-
luvio.storeIngest(key, ingest$
|
|
2090
|
+
const key = keyBuilder$6(luvio, resourceParams);
|
|
2091
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
2044
2092
|
const snapshot = luvio.storeLookup({
|
|
2045
2093
|
recordId: key,
|
|
2046
|
-
node: select$
|
|
2094
|
+
node: select$c(),
|
|
2047
2095
|
variables: {},
|
|
2048
2096
|
}, snapshotRefresh);
|
|
2049
2097
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2054,19 +2102,19 @@ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
2054
2102
|
deepFreeze(snapshot.data);
|
|
2055
2103
|
return snapshot;
|
|
2056
2104
|
}
|
|
2057
|
-
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
2058
|
-
const key = keyBuilder$
|
|
2105
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
2106
|
+
const key = keyBuilder$6(luvio, params);
|
|
2059
2107
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2060
2108
|
const storeMetadataParams = {
|
|
2061
|
-
ttl: TTL$
|
|
2109
|
+
ttl: TTL$2,
|
|
2062
2110
|
namespace: keyPrefix,
|
|
2063
|
-
version: VERSION$
|
|
2064
|
-
representationName: RepresentationType$
|
|
2111
|
+
version: VERSION$9,
|
|
2112
|
+
representationName: RepresentationType$2
|
|
2065
2113
|
};
|
|
2066
2114
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2067
2115
|
return errorSnapshot;
|
|
2068
2116
|
}
|
|
2069
|
-
function createResourceRequest$
|
|
2117
|
+
function createResourceRequest$3(config) {
|
|
2070
2118
|
const headers = {};
|
|
2071
2119
|
return {
|
|
2072
2120
|
baseUri: '/services/data/v63.0',
|
|
@@ -2080,7 +2128,7 @@ function createResourceRequest$1(config) {
|
|
|
2080
2128
|
};
|
|
2081
2129
|
}
|
|
2082
2130
|
|
|
2083
|
-
const adapterName$
|
|
2131
|
+
const adapterName$3 = 'getPromptTemplates';
|
|
2084
2132
|
const getPromptTemplates_ConfigPropertyMetadata = [
|
|
2085
2133
|
generateParamConfigMetadata('isActive', false, 1 /* QueryParameter */, 1 /* Boolean */),
|
|
2086
2134
|
generateParamConfigMetadata('fields', false, 1 /* QueryParameter */, 0 /* String */, true),
|
|
@@ -2091,120 +2139,259 @@ const getPromptTemplates_ConfigPropertyMetadata = [
|
|
|
2091
2139
|
generateParamConfigMetadata('query', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2092
2140
|
generateParamConfigMetadata('sortBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2093
2141
|
];
|
|
2094
|
-
const getPromptTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
2095
|
-
const createResourceParams$
|
|
2096
|
-
function keyBuilder$
|
|
2097
|
-
const resourceParams = createResourceParams$
|
|
2098
|
-
return keyBuilder$
|
|
2142
|
+
const getPromptTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getPromptTemplates_ConfigPropertyMetadata);
|
|
2143
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$7(getPromptTemplates_ConfigPropertyMetadata);
|
|
2144
|
+
function keyBuilder$5(luvio, config) {
|
|
2145
|
+
const resourceParams = createResourceParams$3(config);
|
|
2146
|
+
return keyBuilder$6(luvio, resourceParams);
|
|
2099
2147
|
}
|
|
2100
|
-
function typeCheckConfig$
|
|
2148
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
2101
2149
|
const config = {};
|
|
2102
|
-
typeCheckConfig$
|
|
2150
|
+
typeCheckConfig$7(untrustedConfig, config, getPromptTemplates_ConfigPropertyMetadata);
|
|
2103
2151
|
return config;
|
|
2104
2152
|
}
|
|
2105
|
-
function validateAdapterConfig$
|
|
2153
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
2106
2154
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
2107
2155
|
return null;
|
|
2108
2156
|
}
|
|
2109
2157
|
if (process.env.NODE_ENV !== 'production') {
|
|
2110
2158
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
2111
2159
|
}
|
|
2112
|
-
const config = typeCheckConfig$
|
|
2160
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
2113
2161
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2114
2162
|
return null;
|
|
2115
2163
|
}
|
|
2116
2164
|
return config;
|
|
2117
2165
|
}
|
|
2118
|
-
function adapterFragment(luvio, config) {
|
|
2119
|
-
createResourceParams$
|
|
2120
|
-
return select$
|
|
2166
|
+
function adapterFragment$2(luvio, config) {
|
|
2167
|
+
createResourceParams$3(config);
|
|
2168
|
+
return select$c();
|
|
2121
2169
|
}
|
|
2122
|
-
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
2123
|
-
const snapshot = ingestSuccess$
|
|
2170
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
2171
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
2124
2172
|
config,
|
|
2125
|
-
resolve: () => buildNetworkSnapshot$
|
|
2173
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
2126
2174
|
});
|
|
2127
2175
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
2128
2176
|
}
|
|
2129
|
-
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
2130
|
-
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
2177
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
2178
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
2131
2179
|
config,
|
|
2132
|
-
resolve: () => buildNetworkSnapshot$
|
|
2180
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
2133
2181
|
});
|
|
2134
2182
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
2135
2183
|
}
|
|
2136
|
-
function buildNetworkSnapshot$
|
|
2137
|
-
const resourceParams = createResourceParams$
|
|
2138
|
-
const request = createResourceRequest$
|
|
2184
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
2185
|
+
const resourceParams = createResourceParams$3(config);
|
|
2186
|
+
const request = createResourceRequest$3(resourceParams);
|
|
2139
2187
|
return luvio.dispatchResourceRequest(request, options)
|
|
2140
2188
|
.then((response) => {
|
|
2141
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
2189
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
2142
2190
|
const cache = new StoreKeyMap();
|
|
2143
|
-
getResponseCacheKeys$
|
|
2191
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
2144
2192
|
return cache;
|
|
2145
2193
|
});
|
|
2146
2194
|
}, (response) => {
|
|
2147
|
-
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
2195
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
2148
2196
|
});
|
|
2149
2197
|
}
|
|
2150
|
-
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
2151
|
-
return buildNetworkSnapshotCachePolicy$
|
|
2198
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
2199
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
|
|
2152
2200
|
}
|
|
2153
|
-
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
2201
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
2154
2202
|
const { luvio, config } = context;
|
|
2155
2203
|
const selector = {
|
|
2156
|
-
recordId: keyBuilder$
|
|
2157
|
-
node: adapterFragment(luvio, config),
|
|
2204
|
+
recordId: keyBuilder$5(luvio, config),
|
|
2205
|
+
node: adapterFragment$2(luvio, config),
|
|
2158
2206
|
variables: {},
|
|
2159
2207
|
};
|
|
2160
2208
|
const cacheSnapshot = storeLookup(selector, {
|
|
2161
2209
|
config,
|
|
2162
|
-
resolve: () => buildNetworkSnapshot$
|
|
2210
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
2163
2211
|
});
|
|
2164
2212
|
return cacheSnapshot;
|
|
2165
2213
|
}
|
|
2166
2214
|
const getPromptTemplatesAdapterFactory = (luvio) => function EinsteinLLM__getPromptTemplates(untrustedConfig, requestContext) {
|
|
2167
|
-
const config = validateAdapterConfig$
|
|
2215
|
+
const config = validateAdapterConfig$3(untrustedConfig, getPromptTemplates_ConfigPropertyNames);
|
|
2168
2216
|
// Invalid or incomplete config
|
|
2169
2217
|
if (config === null) {
|
|
2170
2218
|
return null;
|
|
2171
2219
|
}
|
|
2172
2220
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2173
|
-
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
2221
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
2174
2222
|
};
|
|
2175
2223
|
|
|
2176
|
-
function
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2224
|
+
function select$b(luvio, params) {
|
|
2225
|
+
return select$e();
|
|
2226
|
+
}
|
|
2227
|
+
function keyBuilder$4(luvio, params) {
|
|
2228
|
+
return keyPrefix + '::EinsteinPromptRecordRepresentation:(' + 'versionId:' + params.queryParams.versionId + ',' + 'promptTemplateDevName:' + params.urlParams.promptTemplateDevName + ')';
|
|
2229
|
+
}
|
|
2230
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
2231
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$4(luvio, resourceParams));
|
|
2232
|
+
}
|
|
2233
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
2234
|
+
const { body } = response;
|
|
2235
|
+
const key = keyBuilder$4(luvio, resourceParams);
|
|
2236
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
2237
|
+
const snapshot = luvio.storeLookup({
|
|
2238
|
+
recordId: key,
|
|
2239
|
+
node: select$b(),
|
|
2240
|
+
variables: {},
|
|
2241
|
+
}, snapshotRefresh);
|
|
2242
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2243
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2244
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2194
2245
|
}
|
|
2195
|
-
}
|
|
2196
|
-
|
|
2246
|
+
}
|
|
2247
|
+
deepFreeze(snapshot.data);
|
|
2248
|
+
return snapshot;
|
|
2249
|
+
}
|
|
2250
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
2251
|
+
const key = keyBuilder$4(luvio, params);
|
|
2252
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2253
|
+
const storeMetadataParams = {
|
|
2254
|
+
ttl: TTL$3,
|
|
2255
|
+
namespace: keyPrefix,
|
|
2256
|
+
version: VERSION$a,
|
|
2257
|
+
representationName: RepresentationType$3
|
|
2258
|
+
};
|
|
2259
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2260
|
+
return errorSnapshot;
|
|
2261
|
+
}
|
|
2262
|
+
function createResourceRequest$2(config) {
|
|
2263
|
+
const headers = {};
|
|
2264
|
+
return {
|
|
2265
|
+
baseUri: '/services/data/v63.0',
|
|
2266
|
+
basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '',
|
|
2267
|
+
method: 'get',
|
|
2268
|
+
body: null,
|
|
2269
|
+
urlParams: config.urlParams,
|
|
2270
|
+
queryParams: config.queryParams,
|
|
2271
|
+
headers,
|
|
2272
|
+
priority: 'normal',
|
|
2273
|
+
};
|
|
2197
2274
|
}
|
|
2198
2275
|
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2276
|
+
const adapterName$2 = 'getPromptTemplate';
|
|
2277
|
+
const getPromptTemplate_ConfigPropertyMetadata = [
|
|
2278
|
+
generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2279
|
+
generateParamConfigMetadata('versionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2280
|
+
];
|
|
2281
|
+
const getPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getPromptTemplate_ConfigPropertyMetadata);
|
|
2282
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$7(getPromptTemplate_ConfigPropertyMetadata);
|
|
2283
|
+
function keyBuilder$3(luvio, config) {
|
|
2284
|
+
const resourceParams = createResourceParams$2(config);
|
|
2285
|
+
return keyBuilder$4(luvio, resourceParams);
|
|
2286
|
+
}
|
|
2287
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
2288
|
+
const config = {};
|
|
2289
|
+
typeCheckConfig$7(untrustedConfig, config, getPromptTemplate_ConfigPropertyMetadata);
|
|
2290
|
+
return config;
|
|
2291
|
+
}
|
|
2292
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
2293
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2294
|
+
return null;
|
|
2295
|
+
}
|
|
2296
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2297
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2298
|
+
}
|
|
2299
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
2300
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2301
|
+
return null;
|
|
2302
|
+
}
|
|
2303
|
+
return config;
|
|
2304
|
+
}
|
|
2305
|
+
function adapterFragment$1(luvio, config) {
|
|
2306
|
+
createResourceParams$2(config);
|
|
2307
|
+
return select$b();
|
|
2308
|
+
}
|
|
2309
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
2310
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
2311
|
+
config,
|
|
2312
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
2313
|
+
});
|
|
2314
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2315
|
+
}
|
|
2316
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
2317
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
2318
|
+
config,
|
|
2319
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
2320
|
+
});
|
|
2321
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2322
|
+
}
|
|
2323
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
2324
|
+
const resourceParams = createResourceParams$2(config);
|
|
2325
|
+
const request = createResourceRequest$2(resourceParams);
|
|
2326
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2327
|
+
.then((response) => {
|
|
2328
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
2329
|
+
const cache = new StoreKeyMap();
|
|
2330
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
2331
|
+
return cache;
|
|
2332
|
+
});
|
|
2333
|
+
}, (response) => {
|
|
2334
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
2335
|
+
});
|
|
2336
|
+
}
|
|
2337
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
2338
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
|
|
2339
|
+
}
|
|
2340
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
2341
|
+
const { luvio, config } = context;
|
|
2342
|
+
const selector = {
|
|
2343
|
+
recordId: keyBuilder$3(luvio, config),
|
|
2344
|
+
node: adapterFragment$1(luvio, config),
|
|
2345
|
+
variables: {},
|
|
2346
|
+
};
|
|
2347
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2348
|
+
config,
|
|
2349
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
2350
|
+
});
|
|
2351
|
+
return cacheSnapshot;
|
|
2352
|
+
}
|
|
2353
|
+
const getPromptTemplateAdapterFactory = (luvio) => function EinsteinLLM__getPromptTemplate(untrustedConfig, requestContext) {
|
|
2354
|
+
const config = validateAdapterConfig$2(untrustedConfig, getPromptTemplate_ConfigPropertyNames);
|
|
2355
|
+
// Invalid or incomplete config
|
|
2356
|
+
if (config === null) {
|
|
2357
|
+
return null;
|
|
2358
|
+
}
|
|
2359
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2360
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
2361
|
+
};
|
|
2362
|
+
|
|
2363
|
+
function validate$a(obj, path = 'WrappedValueMap') {
|
|
2364
|
+
const v_error = (() => {
|
|
2365
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2366
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2367
|
+
}
|
|
2368
|
+
const obj_valueMap = obj.valueMap;
|
|
2369
|
+
const path_valueMap = path + '.valueMap';
|
|
2370
|
+
if (typeof obj_valueMap !== 'object' || ArrayIsArray(obj_valueMap) || obj_valueMap === null) {
|
|
2371
|
+
return new TypeError('Expected "object" but received "' + typeof obj_valueMap + '" (at "' + path_valueMap + '")');
|
|
2372
|
+
}
|
|
2373
|
+
const obj_valueMap_keys = ObjectKeys(obj_valueMap);
|
|
2374
|
+
for (let i = 0; i < obj_valueMap_keys.length; i++) {
|
|
2375
|
+
const key = obj_valueMap_keys[i];
|
|
2376
|
+
const obj_valueMap_prop = obj_valueMap[key];
|
|
2377
|
+
const path_valueMap_prop = path_valueMap + '["' + key + '"]';
|
|
2378
|
+
if (typeof obj_valueMap_prop !== 'object' || ArrayIsArray(obj_valueMap_prop) || obj_valueMap_prop === null) {
|
|
2379
|
+
return new TypeError('Expected "object" but received "' + typeof obj_valueMap_prop + '" (at "' + path_valueMap_prop + '")');
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
})();
|
|
2383
|
+
return v_error === undefined ? null : v_error;
|
|
2384
|
+
}
|
|
2385
|
+
|
|
2386
|
+
function validate$9(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresentation') {
|
|
2387
|
+
const v_error = (() => {
|
|
2388
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2389
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2390
|
+
}
|
|
2204
2391
|
if (obj.additionalConfig !== undefined) {
|
|
2205
2392
|
const obj_additionalConfig = obj.additionalConfig;
|
|
2206
2393
|
const path_additionalConfig = path + '.additionalConfig';
|
|
2207
|
-
const referencepath_additionalConfigValidationError = validate$
|
|
2394
|
+
const referencepath_additionalConfigValidationError = validate$k(obj_additionalConfig, path_additionalConfig);
|
|
2208
2395
|
if (referencepath_additionalConfigValidationError !== null) {
|
|
2209
2396
|
let message = 'Object doesn\'t match EinsteinLlmAdditionalConfigInputRepresentation (at "' + path_additionalConfig + '")\n';
|
|
2210
2397
|
message += referencepath_additionalConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2213,7 +2400,7 @@ function validate$5(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
|
|
|
2213
2400
|
}
|
|
2214
2401
|
const obj_inputParams = obj.inputParams;
|
|
2215
2402
|
const path_inputParams = path + '.inputParams';
|
|
2216
|
-
const referencepath_inputParamsValidationError = validate$
|
|
2403
|
+
const referencepath_inputParamsValidationError = validate$a(obj_inputParams, path_inputParams);
|
|
2217
2404
|
if (referencepath_inputParamsValidationError !== null) {
|
|
2218
2405
|
let message = 'Object doesn\'t match WrappedValueMap (at "' + path_inputParams + '")\n';
|
|
2219
2406
|
message += referencepath_inputParamsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2242,8 +2429,86 @@ function validate$5(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
|
|
|
2242
2429
|
return v_error === undefined ? null : v_error;
|
|
2243
2430
|
}
|
|
2244
2431
|
|
|
2245
|
-
const VERSION$
|
|
2246
|
-
function validate$
|
|
2432
|
+
const VERSION$8 = "70b3261d05a4bf7da95cd5cabe9bd785";
|
|
2433
|
+
function validate$8(obj, path = 'EinsteinPromptTemplateAttachmentRepresentation') {
|
|
2434
|
+
const v_error = (() => {
|
|
2435
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2436
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2437
|
+
}
|
|
2438
|
+
const obj_fileExtension = obj.fileExtension;
|
|
2439
|
+
const path_fileExtension = path + '.fileExtension';
|
|
2440
|
+
if (typeof obj_fileExtension !== 'string') {
|
|
2441
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fileExtension + '" (at "' + path_fileExtension + '")');
|
|
2442
|
+
}
|
|
2443
|
+
const obj_id = obj.id;
|
|
2444
|
+
const path_id = path + '.id';
|
|
2445
|
+
if (typeof obj_id !== 'string') {
|
|
2446
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
2447
|
+
}
|
|
2448
|
+
const obj_latestPublishedVersion = obj.latestPublishedVersion;
|
|
2449
|
+
const path_latestPublishedVersion = path + '.latestPublishedVersion';
|
|
2450
|
+
if (typeof obj_latestPublishedVersion !== 'string') {
|
|
2451
|
+
return new TypeError('Expected "string" but received "' + typeof obj_latestPublishedVersion + '" (at "' + path_latestPublishedVersion + '")');
|
|
2452
|
+
}
|
|
2453
|
+
const obj_title = obj.title;
|
|
2454
|
+
const path_title = path + '.title';
|
|
2455
|
+
if (typeof obj_title !== 'string') {
|
|
2456
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
2457
|
+
}
|
|
2458
|
+
})();
|
|
2459
|
+
return v_error === undefined ? null : v_error;
|
|
2460
|
+
}
|
|
2461
|
+
const select$a = function EinsteinPromptTemplateAttachmentRepresentationSelect() {
|
|
2462
|
+
return {
|
|
2463
|
+
kind: 'Fragment',
|
|
2464
|
+
version: VERSION$8,
|
|
2465
|
+
private: [],
|
|
2466
|
+
selections: [
|
|
2467
|
+
{
|
|
2468
|
+
name: 'fileExtension',
|
|
2469
|
+
kind: 'Scalar'
|
|
2470
|
+
},
|
|
2471
|
+
{
|
|
2472
|
+
name: 'id',
|
|
2473
|
+
kind: 'Scalar'
|
|
2474
|
+
},
|
|
2475
|
+
{
|
|
2476
|
+
name: 'latestPublishedVersion',
|
|
2477
|
+
kind: 'Scalar'
|
|
2478
|
+
},
|
|
2479
|
+
{
|
|
2480
|
+
name: 'title',
|
|
2481
|
+
kind: 'Scalar'
|
|
2482
|
+
}
|
|
2483
|
+
]
|
|
2484
|
+
};
|
|
2485
|
+
};
|
|
2486
|
+
function equals$8(existing, incoming) {
|
|
2487
|
+
const existing_fileExtension = existing.fileExtension;
|
|
2488
|
+
const incoming_fileExtension = incoming.fileExtension;
|
|
2489
|
+
if (!(existing_fileExtension === incoming_fileExtension)) {
|
|
2490
|
+
return false;
|
|
2491
|
+
}
|
|
2492
|
+
const existing_id = existing.id;
|
|
2493
|
+
const incoming_id = incoming.id;
|
|
2494
|
+
if (!(existing_id === incoming_id)) {
|
|
2495
|
+
return false;
|
|
2496
|
+
}
|
|
2497
|
+
const existing_latestPublishedVersion = existing.latestPublishedVersion;
|
|
2498
|
+
const incoming_latestPublishedVersion = incoming.latestPublishedVersion;
|
|
2499
|
+
if (!(existing_latestPublishedVersion === incoming_latestPublishedVersion)) {
|
|
2500
|
+
return false;
|
|
2501
|
+
}
|
|
2502
|
+
const existing_title = existing.title;
|
|
2503
|
+
const incoming_title = incoming.title;
|
|
2504
|
+
if (!(existing_title === incoming_title)) {
|
|
2505
|
+
return false;
|
|
2506
|
+
}
|
|
2507
|
+
return true;
|
|
2508
|
+
}
|
|
2509
|
+
|
|
2510
|
+
const VERSION$7 = "6458d624e5a1691821c764b6de0badb3";
|
|
2511
|
+
function validate$7(obj, path = 'EinsteinPromptTemplateGenerationsErrorRepresentation') {
|
|
2247
2512
|
const v_error = (() => {
|
|
2248
2513
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2249
2514
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -2273,10 +2538,10 @@ function validate$4(obj, path = 'EinsteinPromptTemplateGenerationsErrorRepresent
|
|
|
2273
2538
|
})();
|
|
2274
2539
|
return v_error === undefined ? null : v_error;
|
|
2275
2540
|
}
|
|
2276
|
-
const select$
|
|
2541
|
+
const select$9 = function EinsteinPromptTemplateGenerationsErrorRepresentationSelect() {
|
|
2277
2542
|
return {
|
|
2278
2543
|
kind: 'Fragment',
|
|
2279
|
-
version: VERSION$
|
|
2544
|
+
version: VERSION$7,
|
|
2280
2545
|
private: [],
|
|
2281
2546
|
selections: [
|
|
2282
2547
|
{
|
|
@@ -2299,7 +2564,7 @@ const select$5 = function EinsteinPromptTemplateGenerationsErrorRepresentationSe
|
|
|
2299
2564
|
]
|
|
2300
2565
|
};
|
|
2301
2566
|
};
|
|
2302
|
-
function equals$
|
|
2567
|
+
function equals$7(existing, incoming) {
|
|
2303
2568
|
const existing_errorMessage = existing.errorMessage;
|
|
2304
2569
|
const incoming_errorMessage = incoming.errorMessage;
|
|
2305
2570
|
if (!(existing_errorMessage === incoming_errorMessage)) {
|
|
@@ -2331,8 +2596,8 @@ function equals$4(existing, incoming) {
|
|
|
2331
2596
|
return true;
|
|
2332
2597
|
}
|
|
2333
2598
|
|
|
2334
|
-
const VERSION$
|
|
2335
|
-
function validate$
|
|
2599
|
+
const VERSION$6 = "7c417ce44e4bc05dfcc454e6825590e8";
|
|
2600
|
+
function validate$6(obj, path = 'EinsteinPromptTemplateMaskSettingsRepresentation') {
|
|
2336
2601
|
const v_error = (() => {
|
|
2337
2602
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2338
2603
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -2345,10 +2610,10 @@ function validate$3(obj, path = 'EinsteinPromptTemplateMaskSettingsRepresentatio
|
|
|
2345
2610
|
})();
|
|
2346
2611
|
return v_error === undefined ? null : v_error;
|
|
2347
2612
|
}
|
|
2348
|
-
const select$
|
|
2613
|
+
const select$8 = function EinsteinPromptTemplateMaskSettingsRepresentationSelect() {
|
|
2349
2614
|
return {
|
|
2350
2615
|
kind: 'Fragment',
|
|
2351
|
-
version: VERSION$
|
|
2616
|
+
version: VERSION$6,
|
|
2352
2617
|
private: [],
|
|
2353
2618
|
selections: [
|
|
2354
2619
|
{
|
|
@@ -2358,7 +2623,7 @@ const select$4 = function EinsteinPromptTemplateMaskSettingsRepresentationSelect
|
|
|
2358
2623
|
]
|
|
2359
2624
|
};
|
|
2360
2625
|
};
|
|
2361
|
-
function equals$
|
|
2626
|
+
function equals$6(existing, incoming) {
|
|
2362
2627
|
const existing_enableModeration = existing.enableModeration;
|
|
2363
2628
|
const incoming_enableModeration = incoming.enableModeration;
|
|
2364
2629
|
if (!(existing_enableModeration === incoming_enableModeration)) {
|
|
@@ -2367,8 +2632,8 @@ function equals$3(existing, incoming) {
|
|
|
2367
2632
|
return true;
|
|
2368
2633
|
}
|
|
2369
2634
|
|
|
2370
|
-
const VERSION$
|
|
2371
|
-
function validate$
|
|
2635
|
+
const VERSION$5 = "92ad1abd0e2a60bc36941409cadda7e2";
|
|
2636
|
+
function validate$5(obj, path = 'EinsteinPromptTemplateMaskContentRepresentation') {
|
|
2372
2637
|
const v_error = (() => {
|
|
2373
2638
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2374
2639
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -2383,7 +2648,7 @@ function validate$2(obj, path = 'EinsteinPromptTemplateMaskContentRepresentation
|
|
|
2383
2648
|
const path_moderationSettings = path + '.moderationSettings';
|
|
2384
2649
|
let obj_moderationSettings_union0 = null;
|
|
2385
2650
|
const obj_moderationSettings_union0_error = (() => {
|
|
2386
|
-
const referencepath_moderationSettingsValidationError = validate$
|
|
2651
|
+
const referencepath_moderationSettingsValidationError = validate$6(obj_moderationSettings, path_moderationSettings);
|
|
2387
2652
|
if (referencepath_moderationSettingsValidationError !== null) {
|
|
2388
2653
|
let message = 'Object doesn\'t match EinsteinPromptTemplateMaskSettingsRepresentation (at "' + path_moderationSettings + '")\n';
|
|
2389
2654
|
message += referencepath_moderationSettingsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2419,11 +2684,11 @@ function validate$2(obj, path = 'EinsteinPromptTemplateMaskContentRepresentation
|
|
|
2419
2684
|
})();
|
|
2420
2685
|
return v_error === undefined ? null : v_error;
|
|
2421
2686
|
}
|
|
2422
|
-
const select$
|
|
2423
|
-
const { selections: EinsteinPromptTemplateMaskSettingsRepresentation__selections, opaque: EinsteinPromptTemplateMaskSettingsRepresentation__opaque, } = select$
|
|
2687
|
+
const select$7 = function EinsteinPromptTemplateMaskContentRepresentationSelect() {
|
|
2688
|
+
const { selections: EinsteinPromptTemplateMaskSettingsRepresentation__selections, opaque: EinsteinPromptTemplateMaskSettingsRepresentation__opaque, } = select$8();
|
|
2424
2689
|
return {
|
|
2425
2690
|
kind: 'Fragment',
|
|
2426
|
-
version: VERSION$
|
|
2691
|
+
version: VERSION$5,
|
|
2427
2692
|
private: [],
|
|
2428
2693
|
selections: [
|
|
2429
2694
|
{
|
|
@@ -2445,7 +2710,7 @@ const select$3 = function EinsteinPromptTemplateMaskContentRepresentationSelect(
|
|
|
2445
2710
|
]
|
|
2446
2711
|
};
|
|
2447
2712
|
};
|
|
2448
|
-
function equals$
|
|
2713
|
+
function equals$5(existing, incoming) {
|
|
2449
2714
|
const existing_content = existing.content;
|
|
2450
2715
|
const incoming_content = incoming.content;
|
|
2451
2716
|
if (!(existing_content === incoming_content)) {
|
|
@@ -2476,15 +2741,15 @@ function equals$2(existing, incoming) {
|
|
|
2476
2741
|
if (!(existing_moderationSettings === incoming_moderationSettings
|
|
2477
2742
|
|| (existing_moderationSettings != null &&
|
|
2478
2743
|
incoming_moderationSettings != null &&
|
|
2479
|
-
equals$
|
|
2744
|
+
equals$6(existing_moderationSettings, incoming_moderationSettings)))) {
|
|
2480
2745
|
return false;
|
|
2481
2746
|
}
|
|
2482
2747
|
}
|
|
2483
2748
|
return true;
|
|
2484
2749
|
}
|
|
2485
2750
|
|
|
2486
|
-
const VERSION$
|
|
2487
|
-
function validate$
|
|
2751
|
+
const VERSION$4 = "507a815605f8d30ae9b52b0ec513d25e";
|
|
2752
|
+
function validate$4(obj, path = 'EinsteinPromptTemplateMaskDataRepresentation') {
|
|
2488
2753
|
const v_error = (() => {
|
|
2489
2754
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2490
2755
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -2514,10 +2779,10 @@ function validate$1(obj, path = 'EinsteinPromptTemplateMaskDataRepresentation')
|
|
|
2514
2779
|
})();
|
|
2515
2780
|
return v_error === undefined ? null : v_error;
|
|
2516
2781
|
}
|
|
2517
|
-
const select$
|
|
2782
|
+
const select$6 = function EinsteinPromptTemplateMaskDataRepresentationSelect() {
|
|
2518
2783
|
return {
|
|
2519
2784
|
kind: 'Fragment',
|
|
2520
|
-
version: VERSION$
|
|
2785
|
+
version: VERSION$4,
|
|
2521
2786
|
private: [],
|
|
2522
2787
|
selections: [
|
|
2523
2788
|
{
|
|
@@ -2536,7 +2801,7 @@ const select$2 = function EinsteinPromptTemplateMaskDataRepresentationSelect() {
|
|
|
2536
2801
|
]
|
|
2537
2802
|
};
|
|
2538
2803
|
};
|
|
2539
|
-
function equals$
|
|
2804
|
+
function equals$4(existing, incoming) {
|
|
2540
2805
|
const existing_originalValue = existing.originalValue;
|
|
2541
2806
|
const incoming_originalValue = incoming.originalValue;
|
|
2542
2807
|
if (!(existing_originalValue === incoming_originalValue)) {
|
|
@@ -2560,13 +2825,30 @@ function equals$1(existing, incoming) {
|
|
|
2560
2825
|
return true;
|
|
2561
2826
|
}
|
|
2562
2827
|
|
|
2563
|
-
const TTL = 100;
|
|
2564
|
-
const VERSION = "
|
|
2565
|
-
function validate(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation') {
|
|
2828
|
+
const TTL$1 = 100;
|
|
2829
|
+
const VERSION$3 = "1beba5cc950346499a8f4810c77e2b03";
|
|
2830
|
+
function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation') {
|
|
2566
2831
|
const v_error = (() => {
|
|
2567
2832
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2568
2833
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2569
2834
|
}
|
|
2835
|
+
if (obj.fileData !== undefined) {
|
|
2836
|
+
const obj_fileData = obj.fileData;
|
|
2837
|
+
const path_fileData = path + '.fileData';
|
|
2838
|
+
if (!ArrayIsArray(obj_fileData)) {
|
|
2839
|
+
return new TypeError('Expected "array" but received "' + typeof obj_fileData + '" (at "' + path_fileData + '")');
|
|
2840
|
+
}
|
|
2841
|
+
for (let i = 0; i < obj_fileData.length; i++) {
|
|
2842
|
+
const obj_fileData_item = obj_fileData[i];
|
|
2843
|
+
const path_fileData_item = path_fileData + '[' + i + ']';
|
|
2844
|
+
const referencepath_fileData_itemValidationError = validate$8(obj_fileData_item, path_fileData_item);
|
|
2845
|
+
if (referencepath_fileData_itemValidationError !== null) {
|
|
2846
|
+
let message = 'Object doesn\'t match EinsteinPromptTemplateAttachmentRepresentation (at "' + path_fileData_item + '")\n';
|
|
2847
|
+
message += referencepath_fileData_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2848
|
+
return new TypeError(message);
|
|
2849
|
+
}
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2570
2852
|
if (obj.generationErrors !== undefined) {
|
|
2571
2853
|
const obj_generationErrors = obj.generationErrors;
|
|
2572
2854
|
const path_generationErrors = path + '.generationErrors';
|
|
@@ -2576,7 +2858,7 @@ function validate(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation')
|
|
|
2576
2858
|
for (let i = 0; i < obj_generationErrors.length; i++) {
|
|
2577
2859
|
const obj_generationErrors_item = obj_generationErrors[i];
|
|
2578
2860
|
const path_generationErrors_item = path_generationErrors + '[' + i + ']';
|
|
2579
|
-
const referencepath_generationErrors_itemValidationError = validate$
|
|
2861
|
+
const referencepath_generationErrors_itemValidationError = validate$7(obj_generationErrors_item, path_generationErrors_item);
|
|
2580
2862
|
if (referencepath_generationErrors_itemValidationError !== null) {
|
|
2581
2863
|
let message = 'Object doesn\'t match EinsteinPromptTemplateGenerationsErrorRepresentation (at "' + path_generationErrors_item + '")\n';
|
|
2582
2864
|
message += referencepath_generationErrors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2592,7 +2874,7 @@ function validate(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation')
|
|
|
2592
2874
|
for (let i = 0; i < obj_generations.length; i++) {
|
|
2593
2875
|
const obj_generations_item = obj_generations[i];
|
|
2594
2876
|
const path_generations_item = path_generations + '[' + i + ']';
|
|
2595
|
-
const referencepath_generations_itemValidationError = validate$
|
|
2877
|
+
const referencepath_generations_itemValidationError = validate$g(obj_generations_item, path_generations_item);
|
|
2596
2878
|
if (referencepath_generations_itemValidationError !== null) {
|
|
2597
2879
|
let message = 'Object doesn\'t match EinsteinLlmGenerationItemRepresentation (at "' + path_generations_item + '")\n';
|
|
2598
2880
|
message += referencepath_generations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2603,7 +2885,7 @@ function validate(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation')
|
|
|
2603
2885
|
const path_parameters = path + '.parameters';
|
|
2604
2886
|
let obj_parameters_union0 = null;
|
|
2605
2887
|
const obj_parameters_union0_error = (() => {
|
|
2606
|
-
const referencepath_parametersValidationError = validate$
|
|
2888
|
+
const referencepath_parametersValidationError = validate$f(obj_parameters, path_parameters);
|
|
2607
2889
|
if (referencepath_parametersValidationError !== null) {
|
|
2608
2890
|
let message = 'Object doesn\'t match WrappedMap (at "' + path_parameters + '")\n';
|
|
2609
2891
|
message += referencepath_parametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2673,7 +2955,7 @@ function validate(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation')
|
|
|
2673
2955
|
for (let i = 0; i < obj_requestMessages.length; i++) {
|
|
2674
2956
|
const obj_requestMessages_item = obj_requestMessages[i];
|
|
2675
2957
|
const path_requestMessages_item = path_requestMessages + '[' + i + ']';
|
|
2676
|
-
const referencepath_requestMessages_itemValidationError = validate$
|
|
2958
|
+
const referencepath_requestMessages_itemValidationError = validate$5(obj_requestMessages_item, path_requestMessages_item);
|
|
2677
2959
|
if (referencepath_requestMessages_itemValidationError !== null) {
|
|
2678
2960
|
let message = 'Object doesn\'t match EinsteinPromptTemplateMaskContentRepresentation (at "' + path_requestMessages_item + '")\n';
|
|
2679
2961
|
message += referencepath_requestMessages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2690,7 +2972,7 @@ function validate(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation')
|
|
|
2690
2972
|
for (let i = 0; i < obj_responseMessages.length; i++) {
|
|
2691
2973
|
const obj_responseMessages_item = obj_responseMessages[i];
|
|
2692
2974
|
const path_responseMessages_item = path_responseMessages + '[' + i + ']';
|
|
2693
|
-
const referencepath_responseMessages_itemValidationError = validate$
|
|
2975
|
+
const referencepath_responseMessages_itemValidationError = validate$5(obj_responseMessages_item, path_responseMessages_item);
|
|
2694
2976
|
if (referencepath_responseMessages_itemValidationError !== null) {
|
|
2695
2977
|
let message = 'Object doesn\'t match EinsteinPromptTemplateMaskContentRepresentation (at "' + path_responseMessages_item + '")\n';
|
|
2696
2978
|
message += referencepath_responseMessages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2707,7 +2989,7 @@ function validate(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation')
|
|
|
2707
2989
|
for (let i = 0; i < obj_slotsMaskingInformation.length; i++) {
|
|
2708
2990
|
const obj_slotsMaskingInformation_item = obj_slotsMaskingInformation[i];
|
|
2709
2991
|
const path_slotsMaskingInformation_item = path_slotsMaskingInformation + '[' + i + ']';
|
|
2710
|
-
const referencepath_slotsMaskingInformation_itemValidationError = validate$
|
|
2992
|
+
const referencepath_slotsMaskingInformation_itemValidationError = validate$4(obj_slotsMaskingInformation_item, path_slotsMaskingInformation_item);
|
|
2711
2993
|
if (referencepath_slotsMaskingInformation_itemValidationError !== null) {
|
|
2712
2994
|
let message = 'Object doesn\'t match EinsteinPromptTemplateMaskDataRepresentation (at "' + path_slotsMaskingInformation_item + '")\n';
|
|
2713
2995
|
message += referencepath_slotsMaskingInformation_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2718,30 +3000,38 @@ function validate(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation')
|
|
|
2718
3000
|
})();
|
|
2719
3001
|
return v_error === undefined ? null : v_error;
|
|
2720
3002
|
}
|
|
2721
|
-
const RepresentationType = 'EinsteinPromptTemplateGenerationsRepresentation';
|
|
2722
|
-
function keyBuilder(luvio, config) {
|
|
2723
|
-
return keyPrefix + '::' + RepresentationType + ':' + config.requestId;
|
|
3003
|
+
const RepresentationType$1 = 'EinsteinPromptTemplateGenerationsRepresentation';
|
|
3004
|
+
function keyBuilder$2(luvio, config) {
|
|
3005
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + config.requestId;
|
|
2724
3006
|
}
|
|
2725
3007
|
function keyBuilderFromType(luvio, object) {
|
|
2726
3008
|
const keyParams = {
|
|
2727
3009
|
requestId: object.requestId
|
|
2728
3010
|
};
|
|
2729
|
-
return keyBuilder(luvio, keyParams);
|
|
3011
|
+
return keyBuilder$2(luvio, keyParams);
|
|
2730
3012
|
}
|
|
2731
|
-
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
3013
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
2732
3014
|
return input;
|
|
2733
3015
|
}
|
|
2734
|
-
const select$
|
|
2735
|
-
const { selections:
|
|
2736
|
-
const { selections:
|
|
2737
|
-
const { selections:
|
|
2738
|
-
const { selections:
|
|
2739
|
-
const { selections:
|
|
3016
|
+
const select$5 = function EinsteinPromptTemplateGenerationsRepresentationSelect() {
|
|
3017
|
+
const { selections: EinsteinPromptTemplateAttachmentRepresentation__selections, opaque: EinsteinPromptTemplateAttachmentRepresentation__opaque, } = select$a();
|
|
3018
|
+
const { selections: EinsteinPromptTemplateGenerationsErrorRepresentation__selections, opaque: EinsteinPromptTemplateGenerationsErrorRepresentation__opaque, } = select$9();
|
|
3019
|
+
const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$i();
|
|
3020
|
+
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$h();
|
|
3021
|
+
const { selections: EinsteinPromptTemplateMaskContentRepresentation__selections, opaque: EinsteinPromptTemplateMaskContentRepresentation__opaque, } = select$7();
|
|
3022
|
+
const { selections: EinsteinPromptTemplateMaskDataRepresentation__selections, opaque: EinsteinPromptTemplateMaskDataRepresentation__opaque, } = select$6();
|
|
2740
3023
|
return {
|
|
2741
3024
|
kind: 'Fragment',
|
|
2742
|
-
version: VERSION,
|
|
3025
|
+
version: VERSION$3,
|
|
2743
3026
|
private: [],
|
|
2744
3027
|
selections: [
|
|
3028
|
+
{
|
|
3029
|
+
name: 'fileData',
|
|
3030
|
+
kind: 'Object',
|
|
3031
|
+
plural: true,
|
|
3032
|
+
selections: EinsteinPromptTemplateAttachmentRepresentation__selections,
|
|
3033
|
+
required: false
|
|
3034
|
+
},
|
|
2745
3035
|
{
|
|
2746
3036
|
name: 'generationErrors',
|
|
2747
3037
|
kind: 'Object',
|
|
@@ -2797,7 +3087,7 @@ const select$1 = function EinsteinPromptTemplateGenerationsRepresentationSelect(
|
|
|
2797
3087
|
]
|
|
2798
3088
|
};
|
|
2799
3089
|
};
|
|
2800
|
-
function equals(existing, incoming) {
|
|
3090
|
+
function equals$3(existing, incoming) {
|
|
2801
3091
|
const existing_promptTemplateDevName = existing.promptTemplateDevName;
|
|
2802
3092
|
const incoming_promptTemplateDevName = incoming.promptTemplateDevName;
|
|
2803
3093
|
if (!(existing_promptTemplateDevName === incoming_promptTemplateDevName)) {
|
|
@@ -2808,6 +3098,24 @@ function equals(existing, incoming) {
|
|
|
2808
3098
|
if (!(existing_requestId === incoming_requestId)) {
|
|
2809
3099
|
return false;
|
|
2810
3100
|
}
|
|
3101
|
+
const existing_fileData = existing.fileData;
|
|
3102
|
+
const incoming_fileData = incoming.fileData;
|
|
3103
|
+
// if at least one of these optionals is defined
|
|
3104
|
+
if (existing_fileData !== undefined || incoming_fileData !== undefined) {
|
|
3105
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
3106
|
+
// not equal
|
|
3107
|
+
if (existing_fileData === undefined || incoming_fileData === undefined) {
|
|
3108
|
+
return false;
|
|
3109
|
+
}
|
|
3110
|
+
const equals_fileData_items = equalsArray(existing_fileData, incoming_fileData, (existing_fileData_item, incoming_fileData_item) => {
|
|
3111
|
+
if (!(equals$8(existing_fileData_item, incoming_fileData_item))) {
|
|
3112
|
+
return false;
|
|
3113
|
+
}
|
|
3114
|
+
});
|
|
3115
|
+
if (equals_fileData_items === false) {
|
|
3116
|
+
return false;
|
|
3117
|
+
}
|
|
3118
|
+
}
|
|
2811
3119
|
const existing_generationErrors = existing.generationErrors;
|
|
2812
3120
|
const incoming_generationErrors = incoming.generationErrors;
|
|
2813
3121
|
// if at least one of these optionals is defined
|
|
@@ -2818,7 +3126,7 @@ function equals(existing, incoming) {
|
|
|
2818
3126
|
return false;
|
|
2819
3127
|
}
|
|
2820
3128
|
const equals_generationErrors_items = equalsArray(existing_generationErrors, incoming_generationErrors, (existing_generationErrors_item, incoming_generationErrors_item) => {
|
|
2821
|
-
if (!(equals$
|
|
3129
|
+
if (!(equals$7(existing_generationErrors_item, incoming_generationErrors_item))) {
|
|
2822
3130
|
return false;
|
|
2823
3131
|
}
|
|
2824
3132
|
});
|
|
@@ -2829,7 +3137,7 @@ function equals(existing, incoming) {
|
|
|
2829
3137
|
const existing_generations = existing.generations;
|
|
2830
3138
|
const incoming_generations = incoming.generations;
|
|
2831
3139
|
const equals_generations_items = equalsArray(existing_generations, incoming_generations, (existing_generations_item, incoming_generations_item) => {
|
|
2832
|
-
if (!(equals$
|
|
3140
|
+
if (!(equals$d(existing_generations_item, incoming_generations_item))) {
|
|
2833
3141
|
return false;
|
|
2834
3142
|
}
|
|
2835
3143
|
});
|
|
@@ -2841,7 +3149,7 @@ function equals(existing, incoming) {
|
|
|
2841
3149
|
if (!(existing_parameters === incoming_parameters
|
|
2842
3150
|
|| (existing_parameters != null &&
|
|
2843
3151
|
incoming_parameters != null &&
|
|
2844
|
-
equals$
|
|
3152
|
+
equals$c(existing_parameters, incoming_parameters)))) {
|
|
2845
3153
|
return false;
|
|
2846
3154
|
}
|
|
2847
3155
|
const existing_prompt = existing.prompt;
|
|
@@ -2859,7 +3167,7 @@ function equals(existing, incoming) {
|
|
|
2859
3167
|
return false;
|
|
2860
3168
|
}
|
|
2861
3169
|
const equals_requestMessages_items = equalsArray(existing_requestMessages, incoming_requestMessages, (existing_requestMessages_item, incoming_requestMessages_item) => {
|
|
2862
|
-
if (!(equals$
|
|
3170
|
+
if (!(equals$5(existing_requestMessages_item, incoming_requestMessages_item))) {
|
|
2863
3171
|
return false;
|
|
2864
3172
|
}
|
|
2865
3173
|
});
|
|
@@ -2877,7 +3185,7 @@ function equals(existing, incoming) {
|
|
|
2877
3185
|
return false;
|
|
2878
3186
|
}
|
|
2879
3187
|
const equals_responseMessages_items = equalsArray(existing_responseMessages, incoming_responseMessages, (existing_responseMessages_item, incoming_responseMessages_item) => {
|
|
2880
|
-
if (!(equals$
|
|
3188
|
+
if (!(equals$5(existing_responseMessages_item, incoming_responseMessages_item))) {
|
|
2881
3189
|
return false;
|
|
2882
3190
|
}
|
|
2883
3191
|
});
|
|
@@ -2895,7 +3203,7 @@ function equals(existing, incoming) {
|
|
|
2895
3203
|
return false;
|
|
2896
3204
|
}
|
|
2897
3205
|
const equals_slotsMaskingInformation_items = equalsArray(existing_slotsMaskingInformation, incoming_slotsMaskingInformation, (existing_slotsMaskingInformation_item, incoming_slotsMaskingInformation_item) => {
|
|
2898
|
-
if (!(equals$
|
|
3206
|
+
if (!(equals$4(existing_slotsMaskingInformation_item, incoming_slotsMaskingInformation_item))) {
|
|
2899
3207
|
return false;
|
|
2900
3208
|
}
|
|
2901
3209
|
});
|
|
@@ -2905,41 +3213,41 @@ function equals(existing, incoming) {
|
|
|
2905
3213
|
}
|
|
2906
3214
|
return true;
|
|
2907
3215
|
}
|
|
2908
|
-
const ingest = function EinsteinPromptTemplateGenerationsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
3216
|
+
const ingest$1 = function EinsteinPromptTemplateGenerationsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2909
3217
|
if (process.env.NODE_ENV !== 'production') {
|
|
2910
|
-
const validateError = validate(input);
|
|
3218
|
+
const validateError = validate$3(input);
|
|
2911
3219
|
if (validateError !== null) {
|
|
2912
3220
|
throw validateError;
|
|
2913
3221
|
}
|
|
2914
3222
|
}
|
|
2915
3223
|
const key = keyBuilderFromType(luvio, input);
|
|
2916
|
-
const ttlToUse = TTL;
|
|
2917
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "EinsteinLLM", VERSION, RepresentationType, equals);
|
|
3224
|
+
const ttlToUse = TTL$1;
|
|
3225
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "EinsteinLLM", VERSION$3, RepresentationType$1, equals$3);
|
|
2918
3226
|
return createLink(key);
|
|
2919
3227
|
};
|
|
2920
|
-
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
3228
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
2921
3229
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2922
3230
|
const rootKey = keyBuilderFromType(luvio, input);
|
|
2923
3231
|
rootKeySet.set(rootKey, {
|
|
2924
3232
|
namespace: keyPrefix,
|
|
2925
|
-
representationName: RepresentationType,
|
|
3233
|
+
representationName: RepresentationType$1,
|
|
2926
3234
|
mergeable: false
|
|
2927
3235
|
});
|
|
2928
3236
|
}
|
|
2929
3237
|
|
|
2930
|
-
function select(luvio, params) {
|
|
2931
|
-
return select$
|
|
3238
|
+
function select$4(luvio, params) {
|
|
3239
|
+
return select$5();
|
|
2932
3240
|
}
|
|
2933
|
-
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
2934
|
-
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
3241
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
3242
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
2935
3243
|
}
|
|
2936
|
-
function ingestSuccess(luvio, resourceParams, response) {
|
|
3244
|
+
function ingestSuccess$1(luvio, resourceParams, response) {
|
|
2937
3245
|
const { body } = response;
|
|
2938
3246
|
const key = keyBuilderFromType(luvio, body);
|
|
2939
|
-
luvio.storeIngest(key, ingest, body);
|
|
3247
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
2940
3248
|
const snapshot = luvio.storeLookup({
|
|
2941
3249
|
recordId: key,
|
|
2942
|
-
node: select(),
|
|
3250
|
+
node: select$4(),
|
|
2943
3251
|
variables: {},
|
|
2944
3252
|
});
|
|
2945
3253
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2950,7 +3258,7 @@ function ingestSuccess(luvio, resourceParams, response) {
|
|
|
2950
3258
|
deepFreeze(snapshot.data);
|
|
2951
3259
|
return snapshot;
|
|
2952
3260
|
}
|
|
2953
|
-
function createResourceRequest(config) {
|
|
3261
|
+
function createResourceRequest$1(config) {
|
|
2954
3262
|
const headers = {};
|
|
2955
3263
|
return {
|
|
2956
3264
|
baseUri: '/services/data/v63.0',
|
|
@@ -2964,48 +3272,48 @@ function createResourceRequest(config) {
|
|
|
2964
3272
|
};
|
|
2965
3273
|
}
|
|
2966
3274
|
|
|
2967
|
-
const adapterName = 'createGenerationsForPromptTemplate';
|
|
3275
|
+
const adapterName$1 = 'createGenerationsForPromptTemplate';
|
|
2968
3276
|
const createGenerationsForPromptTemplate_ConfigPropertyMetadata = [
|
|
2969
3277
|
generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2970
3278
|
generateParamConfigMetadata('versionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2971
3279
|
generateParamConfigMetadata('promptTemplateGenerationsInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
2972
3280
|
];
|
|
2973
|
-
const createGenerationsForPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
|
|
2974
|
-
const createResourceParams = /*#__PURE__*/ createResourceParams$
|
|
2975
|
-
function typeCheckConfig(untrustedConfig) {
|
|
3281
|
+
const createGenerationsForPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
|
|
3282
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$7(createGenerationsForPromptTemplate_ConfigPropertyMetadata);
|
|
3283
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
2976
3284
|
const config = {};
|
|
2977
|
-
typeCheckConfig$
|
|
3285
|
+
typeCheckConfig$7(untrustedConfig, config, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
|
|
2978
3286
|
const untrustedConfig_promptTemplateGenerationsInput = untrustedConfig.promptTemplateGenerationsInput;
|
|
2979
|
-
const referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError = validate$
|
|
3287
|
+
const referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError = validate$9(untrustedConfig_promptTemplateGenerationsInput);
|
|
2980
3288
|
if (referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError === null) {
|
|
2981
3289
|
config.promptTemplateGenerationsInput = untrustedConfig_promptTemplateGenerationsInput;
|
|
2982
3290
|
}
|
|
2983
3291
|
return config;
|
|
2984
3292
|
}
|
|
2985
|
-
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
3293
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
2986
3294
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
2987
3295
|
return null;
|
|
2988
3296
|
}
|
|
2989
3297
|
if (process.env.NODE_ENV !== 'production') {
|
|
2990
3298
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
2991
3299
|
}
|
|
2992
|
-
const config = typeCheckConfig(untrustedConfig);
|
|
3300
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
2993
3301
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2994
3302
|
return null;
|
|
2995
3303
|
}
|
|
2996
3304
|
return config;
|
|
2997
3305
|
}
|
|
2998
|
-
function buildNetworkSnapshot(luvio, config, options) {
|
|
2999
|
-
const resourceParams = createResourceParams(config);
|
|
3000
|
-
const request = createResourceRequest(resourceParams);
|
|
3306
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
3307
|
+
const resourceParams = createResourceParams$1(config);
|
|
3308
|
+
const request = createResourceRequest$1(resourceParams);
|
|
3001
3309
|
return luvio.dispatchResourceRequest(request, options)
|
|
3002
3310
|
.then((response) => {
|
|
3003
3311
|
return luvio.handleSuccessResponse(() => {
|
|
3004
|
-
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
3312
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response);
|
|
3005
3313
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
3006
3314
|
}, () => {
|
|
3007
3315
|
const cache = new StoreKeyMap();
|
|
3008
|
-
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
3316
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
3009
3317
|
return cache;
|
|
3010
3318
|
});
|
|
3011
3319
|
}, (response) => {
|
|
@@ -3015,13 +3323,407 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
3015
3323
|
}
|
|
3016
3324
|
const createGenerationsForPromptTemplateAdapterFactory = (luvio) => {
|
|
3017
3325
|
return function createGenerationsForPromptTemplate(untrustedConfig) {
|
|
3018
|
-
const config = validateAdapterConfig(untrustedConfig, createGenerationsForPromptTemplate_ConfigPropertyNames);
|
|
3326
|
+
const config = validateAdapterConfig$1(untrustedConfig, createGenerationsForPromptTemplate_ConfigPropertyNames);
|
|
3019
3327
|
// Invalid or incomplete config
|
|
3020
3328
|
if (config === null) {
|
|
3021
3329
|
throw new Error('Invalid config for "createGenerationsForPromptTemplate"');
|
|
3022
3330
|
}
|
|
3023
|
-
return buildNetworkSnapshot(luvio, config);
|
|
3331
|
+
return buildNetworkSnapshot$1(luvio, config);
|
|
3024
3332
|
};
|
|
3025
3333
|
};
|
|
3026
3334
|
|
|
3027
|
-
|
|
3335
|
+
const VERSION$2 = "b513bbac1672327d8eaaf120660e94b5";
|
|
3336
|
+
function validate$2(obj, path = 'EinsteinPromptTemplateSupportedLanguageErrorRepresentation') {
|
|
3337
|
+
const v_error = (() => {
|
|
3338
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3339
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3340
|
+
}
|
|
3341
|
+
const obj_errorMessage = obj.errorMessage;
|
|
3342
|
+
const path_errorMessage = path + '.errorMessage';
|
|
3343
|
+
if (typeof obj_errorMessage !== 'string') {
|
|
3344
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
|
|
3345
|
+
}
|
|
3346
|
+
const obj_messageCode = obj.messageCode;
|
|
3347
|
+
const path_messageCode = path + '.messageCode';
|
|
3348
|
+
if (typeof obj_messageCode !== 'string') {
|
|
3349
|
+
return new TypeError('Expected "string" but received "' + typeof obj_messageCode + '" (at "' + path_messageCode + '")');
|
|
3350
|
+
}
|
|
3351
|
+
})();
|
|
3352
|
+
return v_error === undefined ? null : v_error;
|
|
3353
|
+
}
|
|
3354
|
+
const select$3 = function EinsteinPromptTemplateSupportedLanguageErrorRepresentationSelect() {
|
|
3355
|
+
return {
|
|
3356
|
+
kind: 'Fragment',
|
|
3357
|
+
version: VERSION$2,
|
|
3358
|
+
private: [],
|
|
3359
|
+
selections: [
|
|
3360
|
+
{
|
|
3361
|
+
name: 'errorMessage',
|
|
3362
|
+
kind: 'Scalar'
|
|
3363
|
+
},
|
|
3364
|
+
{
|
|
3365
|
+
name: 'messageCode',
|
|
3366
|
+
kind: 'Scalar'
|
|
3367
|
+
}
|
|
3368
|
+
]
|
|
3369
|
+
};
|
|
3370
|
+
};
|
|
3371
|
+
function equals$2(existing, incoming) {
|
|
3372
|
+
const existing_errorMessage = existing.errorMessage;
|
|
3373
|
+
const incoming_errorMessage = incoming.errorMessage;
|
|
3374
|
+
if (!(existing_errorMessage === incoming_errorMessage)) {
|
|
3375
|
+
return false;
|
|
3376
|
+
}
|
|
3377
|
+
const existing_messageCode = existing.messageCode;
|
|
3378
|
+
const incoming_messageCode = incoming.messageCode;
|
|
3379
|
+
if (!(existing_messageCode === incoming_messageCode)) {
|
|
3380
|
+
return false;
|
|
3381
|
+
}
|
|
3382
|
+
return true;
|
|
3383
|
+
}
|
|
3384
|
+
|
|
3385
|
+
const VERSION$1 = "65a17d345c28eeca91872a73d8ffe9fd";
|
|
3386
|
+
function validate$1(obj, path = 'EinsteinPromptTemplateSupportedLanguageRepresentation') {
|
|
3387
|
+
const v_error = (() => {
|
|
3388
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3389
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3390
|
+
}
|
|
3391
|
+
const obj_languageCode = obj.languageCode;
|
|
3392
|
+
const path_languageCode = path + '.languageCode';
|
|
3393
|
+
if (typeof obj_languageCode !== 'string') {
|
|
3394
|
+
return new TypeError('Expected "string" but received "' + typeof obj_languageCode + '" (at "' + path_languageCode + '")');
|
|
3395
|
+
}
|
|
3396
|
+
const obj_languageDisplayName = obj.languageDisplayName;
|
|
3397
|
+
const path_languageDisplayName = path + '.languageDisplayName';
|
|
3398
|
+
if (typeof obj_languageDisplayName !== 'string') {
|
|
3399
|
+
return new TypeError('Expected "string" but received "' + typeof obj_languageDisplayName + '" (at "' + path_languageDisplayName + '")');
|
|
3400
|
+
}
|
|
3401
|
+
})();
|
|
3402
|
+
return v_error === undefined ? null : v_error;
|
|
3403
|
+
}
|
|
3404
|
+
const select$2 = function EinsteinPromptTemplateSupportedLanguageRepresentationSelect() {
|
|
3405
|
+
return {
|
|
3406
|
+
kind: 'Fragment',
|
|
3407
|
+
version: VERSION$1,
|
|
3408
|
+
private: [],
|
|
3409
|
+
selections: [
|
|
3410
|
+
{
|
|
3411
|
+
name: 'languageCode',
|
|
3412
|
+
kind: 'Scalar'
|
|
3413
|
+
},
|
|
3414
|
+
{
|
|
3415
|
+
name: 'languageDisplayName',
|
|
3416
|
+
kind: 'Scalar'
|
|
3417
|
+
}
|
|
3418
|
+
]
|
|
3419
|
+
};
|
|
3420
|
+
};
|
|
3421
|
+
function equals$1(existing, incoming) {
|
|
3422
|
+
const existing_languageCode = existing.languageCode;
|
|
3423
|
+
const incoming_languageCode = incoming.languageCode;
|
|
3424
|
+
if (!(existing_languageCode === incoming_languageCode)) {
|
|
3425
|
+
return false;
|
|
3426
|
+
}
|
|
3427
|
+
const existing_languageDisplayName = existing.languageDisplayName;
|
|
3428
|
+
const incoming_languageDisplayName = incoming.languageDisplayName;
|
|
3429
|
+
if (!(existing_languageDisplayName === incoming_languageDisplayName)) {
|
|
3430
|
+
return false;
|
|
3431
|
+
}
|
|
3432
|
+
return true;
|
|
3433
|
+
}
|
|
3434
|
+
|
|
3435
|
+
const TTL = 100;
|
|
3436
|
+
const VERSION = "c635f260bce9a11f7c3bf31d60f42b53";
|
|
3437
|
+
function validate(obj, path = 'EinsteinPromptTemplateVersionOutputLanguagesRepresentation') {
|
|
3438
|
+
const v_error = (() => {
|
|
3439
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3440
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3441
|
+
}
|
|
3442
|
+
const obj_errors = obj.errors;
|
|
3443
|
+
const path_errors = path + '.errors';
|
|
3444
|
+
if (!ArrayIsArray(obj_errors)) {
|
|
3445
|
+
return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
|
|
3446
|
+
}
|
|
3447
|
+
for (let i = 0; i < obj_errors.length; i++) {
|
|
3448
|
+
const obj_errors_item = obj_errors[i];
|
|
3449
|
+
const path_errors_item = path_errors + '[' + i + ']';
|
|
3450
|
+
const referencepath_errors_itemValidationError = validate$2(obj_errors_item, path_errors_item);
|
|
3451
|
+
if (referencepath_errors_itemValidationError !== null) {
|
|
3452
|
+
let message = 'Object doesn\'t match EinsteinPromptTemplateSupportedLanguageErrorRepresentation (at "' + path_errors_item + '")\n';
|
|
3453
|
+
message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3454
|
+
return new TypeError(message);
|
|
3455
|
+
}
|
|
3456
|
+
}
|
|
3457
|
+
const obj_isSuccess = obj.isSuccess;
|
|
3458
|
+
const path_isSuccess = path + '.isSuccess';
|
|
3459
|
+
if (typeof obj_isSuccess !== 'boolean') {
|
|
3460
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
|
|
3461
|
+
}
|
|
3462
|
+
const obj_promptTemplateDevName = obj.promptTemplateDevName;
|
|
3463
|
+
const path_promptTemplateDevName = path + '.promptTemplateDevName';
|
|
3464
|
+
if (typeof obj_promptTemplateDevName !== 'string') {
|
|
3465
|
+
return new TypeError('Expected "string" but received "' + typeof obj_promptTemplateDevName + '" (at "' + path_promptTemplateDevName + '")');
|
|
3466
|
+
}
|
|
3467
|
+
const obj_supportedLanguages = obj.supportedLanguages;
|
|
3468
|
+
const path_supportedLanguages = path + '.supportedLanguages';
|
|
3469
|
+
if (!ArrayIsArray(obj_supportedLanguages)) {
|
|
3470
|
+
return new TypeError('Expected "array" but received "' + typeof obj_supportedLanguages + '" (at "' + path_supportedLanguages + '")');
|
|
3471
|
+
}
|
|
3472
|
+
for (let i = 0; i < obj_supportedLanguages.length; i++) {
|
|
3473
|
+
const obj_supportedLanguages_item = obj_supportedLanguages[i];
|
|
3474
|
+
const path_supportedLanguages_item = path_supportedLanguages + '[' + i + ']';
|
|
3475
|
+
const referencepath_supportedLanguages_itemValidationError = validate$1(obj_supportedLanguages_item, path_supportedLanguages_item);
|
|
3476
|
+
if (referencepath_supportedLanguages_itemValidationError !== null) {
|
|
3477
|
+
let message = 'Object doesn\'t match EinsteinPromptTemplateSupportedLanguageRepresentation (at "' + path_supportedLanguages_item + '")\n';
|
|
3478
|
+
message += referencepath_supportedLanguages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3479
|
+
return new TypeError(message);
|
|
3480
|
+
}
|
|
3481
|
+
}
|
|
3482
|
+
const obj_versionId = obj.versionId;
|
|
3483
|
+
const path_versionId = path + '.versionId';
|
|
3484
|
+
if (typeof obj_versionId !== 'string') {
|
|
3485
|
+
return new TypeError('Expected "string" but received "' + typeof obj_versionId + '" (at "' + path_versionId + '")');
|
|
3486
|
+
}
|
|
3487
|
+
})();
|
|
3488
|
+
return v_error === undefined ? null : v_error;
|
|
3489
|
+
}
|
|
3490
|
+
const RepresentationType = 'EinsteinPromptTemplateVersionOutputLanguagesRepresentation';
|
|
3491
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
3492
|
+
return input;
|
|
3493
|
+
}
|
|
3494
|
+
const select$1 = function EinsteinPromptTemplateVersionOutputLanguagesRepresentationSelect() {
|
|
3495
|
+
const { selections: EinsteinPromptTemplateSupportedLanguageErrorRepresentation__selections, opaque: EinsteinPromptTemplateSupportedLanguageErrorRepresentation__opaque, } = select$3();
|
|
3496
|
+
const { selections: EinsteinPromptTemplateSupportedLanguageRepresentation__selections, opaque: EinsteinPromptTemplateSupportedLanguageRepresentation__opaque, } = select$2();
|
|
3497
|
+
return {
|
|
3498
|
+
kind: 'Fragment',
|
|
3499
|
+
version: VERSION,
|
|
3500
|
+
private: [],
|
|
3501
|
+
selections: [
|
|
3502
|
+
{
|
|
3503
|
+
name: 'errors',
|
|
3504
|
+
kind: 'Object',
|
|
3505
|
+
plural: true,
|
|
3506
|
+
selections: EinsteinPromptTemplateSupportedLanguageErrorRepresentation__selections
|
|
3507
|
+
},
|
|
3508
|
+
{
|
|
3509
|
+
name: 'isSuccess',
|
|
3510
|
+
kind: 'Scalar'
|
|
3511
|
+
},
|
|
3512
|
+
{
|
|
3513
|
+
name: 'promptTemplateDevName',
|
|
3514
|
+
kind: 'Scalar'
|
|
3515
|
+
},
|
|
3516
|
+
{
|
|
3517
|
+
name: 'supportedLanguages',
|
|
3518
|
+
kind: 'Object',
|
|
3519
|
+
plural: true,
|
|
3520
|
+
selections: EinsteinPromptTemplateSupportedLanguageRepresentation__selections
|
|
3521
|
+
},
|
|
3522
|
+
{
|
|
3523
|
+
name: 'versionId',
|
|
3524
|
+
kind: 'Scalar'
|
|
3525
|
+
}
|
|
3526
|
+
]
|
|
3527
|
+
};
|
|
3528
|
+
};
|
|
3529
|
+
function equals(existing, incoming) {
|
|
3530
|
+
const existing_isSuccess = existing.isSuccess;
|
|
3531
|
+
const incoming_isSuccess = incoming.isSuccess;
|
|
3532
|
+
if (!(existing_isSuccess === incoming_isSuccess)) {
|
|
3533
|
+
return false;
|
|
3534
|
+
}
|
|
3535
|
+
const existing_promptTemplateDevName = existing.promptTemplateDevName;
|
|
3536
|
+
const incoming_promptTemplateDevName = incoming.promptTemplateDevName;
|
|
3537
|
+
if (!(existing_promptTemplateDevName === incoming_promptTemplateDevName)) {
|
|
3538
|
+
return false;
|
|
3539
|
+
}
|
|
3540
|
+
const existing_versionId = existing.versionId;
|
|
3541
|
+
const incoming_versionId = incoming.versionId;
|
|
3542
|
+
if (!(existing_versionId === incoming_versionId)) {
|
|
3543
|
+
return false;
|
|
3544
|
+
}
|
|
3545
|
+
const existing_errors = existing.errors;
|
|
3546
|
+
const incoming_errors = incoming.errors;
|
|
3547
|
+
const equals_errors_items = equalsArray(existing_errors, incoming_errors, (existing_errors_item, incoming_errors_item) => {
|
|
3548
|
+
if (!(equals$2(existing_errors_item, incoming_errors_item))) {
|
|
3549
|
+
return false;
|
|
3550
|
+
}
|
|
3551
|
+
});
|
|
3552
|
+
if (equals_errors_items === false) {
|
|
3553
|
+
return false;
|
|
3554
|
+
}
|
|
3555
|
+
const existing_supportedLanguages = existing.supportedLanguages;
|
|
3556
|
+
const incoming_supportedLanguages = incoming.supportedLanguages;
|
|
3557
|
+
const equals_supportedLanguages_items = equalsArray(existing_supportedLanguages, incoming_supportedLanguages, (existing_supportedLanguages_item, incoming_supportedLanguages_item) => {
|
|
3558
|
+
if (!(equals$1(existing_supportedLanguages_item, incoming_supportedLanguages_item))) {
|
|
3559
|
+
return false;
|
|
3560
|
+
}
|
|
3561
|
+
});
|
|
3562
|
+
if (equals_supportedLanguages_items === false) {
|
|
3563
|
+
return false;
|
|
3564
|
+
}
|
|
3565
|
+
return true;
|
|
3566
|
+
}
|
|
3567
|
+
const ingest = function EinsteinPromptTemplateVersionOutputLanguagesRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
3568
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3569
|
+
const validateError = validate(input);
|
|
3570
|
+
if (validateError !== null) {
|
|
3571
|
+
throw validateError;
|
|
3572
|
+
}
|
|
3573
|
+
}
|
|
3574
|
+
const key = path.fullPath;
|
|
3575
|
+
const ttlToUse = TTL;
|
|
3576
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "EinsteinLLM", VERSION, RepresentationType, equals);
|
|
3577
|
+
return createLink(key);
|
|
3578
|
+
};
|
|
3579
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
3580
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
3581
|
+
const rootKey = fullPathFactory();
|
|
3582
|
+
rootKeySet.set(rootKey, {
|
|
3583
|
+
namespace: keyPrefix,
|
|
3584
|
+
representationName: RepresentationType,
|
|
3585
|
+
mergeable: false
|
|
3586
|
+
});
|
|
3587
|
+
}
|
|
3588
|
+
|
|
3589
|
+
function select(luvio, params) {
|
|
3590
|
+
return select$1();
|
|
3591
|
+
}
|
|
3592
|
+
function keyBuilder$1(luvio, params) {
|
|
3593
|
+
return keyPrefix + '::EinsteinPromptTemplateVersionOutputLanguagesRepresentation:(' + 'useStandardVersion:' + params.queryParams.useStandardVersion + ',' + 'versionId:' + params.queryParams.versionId + ',' + 'promptTemplateDevName:' + params.urlParams.promptTemplateDevName + ')';
|
|
3594
|
+
}
|
|
3595
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
3596
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
3597
|
+
}
|
|
3598
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
3599
|
+
const { body } = response;
|
|
3600
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
3601
|
+
luvio.storeIngest(key, ingest, body);
|
|
3602
|
+
const snapshot = luvio.storeLookup({
|
|
3603
|
+
recordId: key,
|
|
3604
|
+
node: select(),
|
|
3605
|
+
variables: {},
|
|
3606
|
+
}, snapshotRefresh);
|
|
3607
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3608
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
3609
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
3610
|
+
}
|
|
3611
|
+
}
|
|
3612
|
+
deepFreeze(snapshot.data);
|
|
3613
|
+
return snapshot;
|
|
3614
|
+
}
|
|
3615
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
3616
|
+
const key = keyBuilder$1(luvio, params);
|
|
3617
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
3618
|
+
const storeMetadataParams = {
|
|
3619
|
+
ttl: TTL,
|
|
3620
|
+
namespace: keyPrefix,
|
|
3621
|
+
version: VERSION,
|
|
3622
|
+
representationName: RepresentationType
|
|
3623
|
+
};
|
|
3624
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
3625
|
+
return errorSnapshot;
|
|
3626
|
+
}
|
|
3627
|
+
function createResourceRequest(config) {
|
|
3628
|
+
const headers = {};
|
|
3629
|
+
return {
|
|
3630
|
+
baseUri: '/services/data/v63.0',
|
|
3631
|
+
basePath: '/einstein/prompt-template/' + config.urlParams.promptTemplateDevName + '/output-languages',
|
|
3632
|
+
method: 'get',
|
|
3633
|
+
body: null,
|
|
3634
|
+
urlParams: config.urlParams,
|
|
3635
|
+
queryParams: config.queryParams,
|
|
3636
|
+
headers,
|
|
3637
|
+
priority: 'normal',
|
|
3638
|
+
};
|
|
3639
|
+
}
|
|
3640
|
+
|
|
3641
|
+
const adapterName = 'getOutputLanguages';
|
|
3642
|
+
const getOutputLanguages_ConfigPropertyMetadata = [
|
|
3643
|
+
generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
3644
|
+
generateParamConfigMetadata('useStandardVersion', false, 1 /* QueryParameter */, 1 /* Boolean */),
|
|
3645
|
+
generateParamConfigMetadata('versionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
3646
|
+
];
|
|
3647
|
+
const getOutputLanguages_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getOutputLanguages_ConfigPropertyMetadata);
|
|
3648
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$7(getOutputLanguages_ConfigPropertyMetadata);
|
|
3649
|
+
function keyBuilder(luvio, config) {
|
|
3650
|
+
const resourceParams = createResourceParams(config);
|
|
3651
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
3652
|
+
}
|
|
3653
|
+
function typeCheckConfig(untrustedConfig) {
|
|
3654
|
+
const config = {};
|
|
3655
|
+
typeCheckConfig$7(untrustedConfig, config, getOutputLanguages_ConfigPropertyMetadata);
|
|
3656
|
+
return config;
|
|
3657
|
+
}
|
|
3658
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
3659
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3660
|
+
return null;
|
|
3661
|
+
}
|
|
3662
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3663
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3664
|
+
}
|
|
3665
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
3666
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3667
|
+
return null;
|
|
3668
|
+
}
|
|
3669
|
+
return config;
|
|
3670
|
+
}
|
|
3671
|
+
function adapterFragment(luvio, config) {
|
|
3672
|
+
createResourceParams(config);
|
|
3673
|
+
return select();
|
|
3674
|
+
}
|
|
3675
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
3676
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
3677
|
+
config,
|
|
3678
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
3679
|
+
});
|
|
3680
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3681
|
+
}
|
|
3682
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
3683
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
3684
|
+
config,
|
|
3685
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
3686
|
+
});
|
|
3687
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3688
|
+
}
|
|
3689
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
3690
|
+
const resourceParams = createResourceParams(config);
|
|
3691
|
+
const request = createResourceRequest(resourceParams);
|
|
3692
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3693
|
+
.then((response) => {
|
|
3694
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
3695
|
+
const cache = new StoreKeyMap();
|
|
3696
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
3697
|
+
return cache;
|
|
3698
|
+
});
|
|
3699
|
+
}, (response) => {
|
|
3700
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
3701
|
+
});
|
|
3702
|
+
}
|
|
3703
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
3704
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
3705
|
+
}
|
|
3706
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
3707
|
+
const { luvio, config } = context;
|
|
3708
|
+
const selector = {
|
|
3709
|
+
recordId: keyBuilder(luvio, config),
|
|
3710
|
+
node: adapterFragment(luvio, config),
|
|
3711
|
+
variables: {},
|
|
3712
|
+
};
|
|
3713
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
3714
|
+
config,
|
|
3715
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
3716
|
+
});
|
|
3717
|
+
return cacheSnapshot;
|
|
3718
|
+
}
|
|
3719
|
+
const getOutputLanguagesAdapterFactory = (luvio) => function EinsteinLLM__getOutputLanguages(untrustedConfig, requestContext) {
|
|
3720
|
+
const config = validateAdapterConfig(untrustedConfig, getOutputLanguages_ConfigPropertyNames);
|
|
3721
|
+
// Invalid or incomplete config
|
|
3722
|
+
if (config === null) {
|
|
3723
|
+
return null;
|
|
3724
|
+
}
|
|
3725
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
3726
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
3727
|
+
};
|
|
3728
|
+
|
|
3729
|
+
export { createEmbeddingsAdapterFactory, createFeedbackAdapterFactory, createGenerationsAdapterFactory, createGenerationsForPromptTemplateAdapterFactory, getOutputLanguagesAdapterFactory, getPromptTemplateAdapterFactory, getPromptTemplatesAdapterFactory };
|