@salesforce/lds-adapters-service-einsteinllm 1.332.0-dev5 → 1.332.0-dev7
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 +736 -342
- package/dist/es/es2018/types/src/generated/adapters/getOutputLanguages.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +1 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +3 -1
- package/dist/es/es2018/types/src/generated/resources/getEinsteinPromptTemplateOutputLanguagesByPromptTemplateDevName.d.ts +19 -0
- 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 +685 -279
- package/src/raml/api.raml +65 -0
- package/src/raml/luvio.raml +7 -0
package/sfdc/index.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
/* proxy-compat-disable */
|
|
15
15
|
import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
|
|
16
16
|
import { withDefaultLuvio } from 'force/ldsEngine';
|
|
17
|
-
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$
|
|
17
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$3, StoreKeyMap, createResourceParams as createResourceParams$6, typeCheckConfig as typeCheckConfig$6 } from 'force/luvioEngine';
|
|
18
18
|
|
|
19
19
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
20
20
|
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
@@ -178,7 +178,7 @@ function createLink(ref) {
|
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
function validate$
|
|
181
|
+
function validate$q(obj, path = 'EinsteinLlmEmbeddingsAdditionalConfigInputRepresentation') {
|
|
182
182
|
const v_error = (() => {
|
|
183
183
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
184
184
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -222,7 +222,7 @@ function validate$n(obj, path = 'EinsteinLlmEmbeddingsAdditionalConfigInputRepre
|
|
|
222
222
|
return v_error === undefined ? null : v_error;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
function validate$
|
|
225
|
+
function validate$p(obj, path = 'WrappedListString') {
|
|
226
226
|
const v_error = (() => {
|
|
227
227
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
228
228
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -243,14 +243,14 @@ function validate$m(obj, path = 'WrappedListString') {
|
|
|
243
243
|
return v_error === undefined ? null : v_error;
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
function validate$
|
|
246
|
+
function validate$o(obj, path = 'EinsteinLlmEmbeddingsInputRepresentation') {
|
|
247
247
|
const v_error = (() => {
|
|
248
248
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
249
249
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
250
250
|
}
|
|
251
251
|
const obj_additionalConfig = obj.additionalConfig;
|
|
252
252
|
const path_additionalConfig = path + '.additionalConfig';
|
|
253
|
-
const referencepath_additionalConfigValidationError = validate$
|
|
253
|
+
const referencepath_additionalConfigValidationError = validate$q(obj_additionalConfig, path_additionalConfig);
|
|
254
254
|
if (referencepath_additionalConfigValidationError !== null) {
|
|
255
255
|
let message = 'Object doesn\'t match EinsteinLlmEmbeddingsAdditionalConfigInputRepresentation (at "' + path_additionalConfig + '")\n';
|
|
256
256
|
message += referencepath_additionalConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -258,7 +258,7 @@ function validate$l(obj, path = 'EinsteinLlmEmbeddingsInputRepresentation') {
|
|
|
258
258
|
}
|
|
259
259
|
const obj_prompts = obj.prompts;
|
|
260
260
|
const path_prompts = path + '.prompts';
|
|
261
|
-
const referencepath_promptsValidationError = validate$
|
|
261
|
+
const referencepath_promptsValidationError = validate$p(obj_prompts, path_prompts);
|
|
262
262
|
if (referencepath_promptsValidationError !== null) {
|
|
263
263
|
let message = 'Object doesn\'t match WrappedListString (at "' + path_prompts + '")\n';
|
|
264
264
|
message += referencepath_promptsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -275,8 +275,8 @@ function validate$l(obj, path = 'EinsteinLlmEmbeddingsInputRepresentation') {
|
|
|
275
275
|
return v_error === undefined ? null : v_error;
|
|
276
276
|
}
|
|
277
277
|
|
|
278
|
-
const VERSION$
|
|
279
|
-
function validate$
|
|
278
|
+
const VERSION$g = "5ed5ccc6fa6f15691ec0fc1080e41fe6";
|
|
279
|
+
function validate$n(obj, path = 'EinsteinLlmEmbeddingItemRepresentation') {
|
|
280
280
|
const v_error = (() => {
|
|
281
281
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
282
282
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -297,10 +297,10 @@ function validate$k(obj, path = 'EinsteinLlmEmbeddingItemRepresentation') {
|
|
|
297
297
|
})();
|
|
298
298
|
return v_error === undefined ? null : v_error;
|
|
299
299
|
}
|
|
300
|
-
const select$
|
|
300
|
+
const select$m = function EinsteinLlmEmbeddingItemRepresentationSelect() {
|
|
301
301
|
return {
|
|
302
302
|
kind: 'Fragment',
|
|
303
|
-
version: VERSION$
|
|
303
|
+
version: VERSION$g,
|
|
304
304
|
private: [],
|
|
305
305
|
selections: [
|
|
306
306
|
{
|
|
@@ -315,7 +315,7 @@ const select$i = function EinsteinLlmEmbeddingItemRepresentationSelect() {
|
|
|
315
315
|
]
|
|
316
316
|
};
|
|
317
317
|
};
|
|
318
|
-
function equals$
|
|
318
|
+
function equals$g(existing, incoming) {
|
|
319
319
|
const existing_index = existing.index;
|
|
320
320
|
const incoming_index = incoming.index;
|
|
321
321
|
if (!(existing_index === incoming_index)) {
|
|
@@ -334,9 +334,9 @@ function equals$d(existing, incoming) {
|
|
|
334
334
|
return true;
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
const TTL$
|
|
338
|
-
const VERSION$
|
|
339
|
-
function validate$
|
|
337
|
+
const TTL$5 = 100;
|
|
338
|
+
const VERSION$f = "d9873651f09d29764ef4d4231eb653d7";
|
|
339
|
+
function validate$m(obj, path = 'EinsteinLlmEmbeddingsRepresentation') {
|
|
340
340
|
const v_error = (() => {
|
|
341
341
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
342
342
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -349,7 +349,7 @@ function validate$j(obj, path = 'EinsteinLlmEmbeddingsRepresentation') {
|
|
|
349
349
|
for (let i = 0; i < obj_embeddings.length; i++) {
|
|
350
350
|
const obj_embeddings_item = obj_embeddings[i];
|
|
351
351
|
const path_embeddings_item = path_embeddings + '[' + i + ']';
|
|
352
|
-
const referencepath_embeddings_itemValidationError = validate$
|
|
352
|
+
const referencepath_embeddings_itemValidationError = validate$n(obj_embeddings_item, path_embeddings_item);
|
|
353
353
|
if (referencepath_embeddings_itemValidationError !== null) {
|
|
354
354
|
let message = 'Object doesn\'t match EinsteinLlmEmbeddingItemRepresentation (at "' + path_embeddings_item + '")\n';
|
|
355
355
|
message += referencepath_embeddings_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -373,15 +373,15 @@ function validate$j(obj, path = 'EinsteinLlmEmbeddingsRepresentation') {
|
|
|
373
373
|
})();
|
|
374
374
|
return v_error === undefined ? null : v_error;
|
|
375
375
|
}
|
|
376
|
-
const RepresentationType$
|
|
377
|
-
function normalize$
|
|
376
|
+
const RepresentationType$5 = 'EinsteinLlmEmbeddingsRepresentation';
|
|
377
|
+
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
378
378
|
return input;
|
|
379
379
|
}
|
|
380
|
-
const select$
|
|
381
|
-
const { selections: EinsteinLlmEmbeddingItemRepresentation__selections, opaque: EinsteinLlmEmbeddingItemRepresentation__opaque, } = select$
|
|
380
|
+
const select$l = function EinsteinLlmEmbeddingsRepresentationSelect() {
|
|
381
|
+
const { selections: EinsteinLlmEmbeddingItemRepresentation__selections, opaque: EinsteinLlmEmbeddingItemRepresentation__opaque, } = select$m();
|
|
382
382
|
return {
|
|
383
383
|
kind: 'Fragment',
|
|
384
|
-
version: VERSION$
|
|
384
|
+
version: VERSION$f,
|
|
385
385
|
private: [],
|
|
386
386
|
selections: [
|
|
387
387
|
{
|
|
@@ -398,11 +398,11 @@ const select$h = function EinsteinLlmEmbeddingsRepresentationSelect() {
|
|
|
398
398
|
]
|
|
399
399
|
};
|
|
400
400
|
};
|
|
401
|
-
function equals$
|
|
401
|
+
function equals$f(existing, incoming) {
|
|
402
402
|
const existing_embeddings = existing.embeddings;
|
|
403
403
|
const incoming_embeddings = incoming.embeddings;
|
|
404
404
|
const equals_embeddings_items = equalsArray(existing_embeddings, incoming_embeddings, (existing_embeddings_item, incoming_embeddings_item) => {
|
|
405
|
-
if (!(equals$
|
|
405
|
+
if (!(equals$g(existing_embeddings_item, incoming_embeddings_item))) {
|
|
406
406
|
return false;
|
|
407
407
|
}
|
|
408
408
|
});
|
|
@@ -421,44 +421,44 @@ function equals$c(existing, incoming) {
|
|
|
421
421
|
}
|
|
422
422
|
return true;
|
|
423
423
|
}
|
|
424
|
-
const ingest$
|
|
424
|
+
const ingest$5 = function EinsteinLlmEmbeddingsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
425
425
|
if (process.env.NODE_ENV !== 'production') {
|
|
426
|
-
const validateError = validate$
|
|
426
|
+
const validateError = validate$m(input);
|
|
427
427
|
if (validateError !== null) {
|
|
428
428
|
throw validateError;
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
const key = path.fullPath;
|
|
432
|
-
const ttlToUse = TTL$
|
|
433
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
432
|
+
const ttlToUse = TTL$5;
|
|
433
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "EinsteinLLM", VERSION$f, RepresentationType$5, equals$f);
|
|
434
434
|
return createLink(key);
|
|
435
435
|
};
|
|
436
|
-
function getTypeCacheKeys$
|
|
436
|
+
function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
|
|
437
437
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
438
438
|
const rootKey = fullPathFactory();
|
|
439
439
|
rootKeySet.set(rootKey, {
|
|
440
440
|
namespace: keyPrefix,
|
|
441
|
-
representationName: RepresentationType$
|
|
441
|
+
representationName: RepresentationType$5,
|
|
442
442
|
mergeable: false
|
|
443
443
|
});
|
|
444
444
|
}
|
|
445
445
|
|
|
446
|
-
function select$
|
|
447
|
-
return select$
|
|
446
|
+
function select$k(luvio, params) {
|
|
447
|
+
return select$l();
|
|
448
448
|
}
|
|
449
|
-
function keyBuilder$
|
|
449
|
+
function keyBuilder$8(luvio, params) {
|
|
450
450
|
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) + ')';
|
|
451
451
|
}
|
|
452
|
-
function getResponseCacheKeys$
|
|
453
|
-
getTypeCacheKeys$
|
|
452
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
453
|
+
getTypeCacheKeys$5(storeKeyMap, luvio, response, () => keyBuilder$8(luvio, resourceParams));
|
|
454
454
|
}
|
|
455
|
-
function ingestSuccess$
|
|
455
|
+
function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
|
|
456
456
|
const { body } = response;
|
|
457
|
-
const key = keyBuilder$
|
|
458
|
-
luvio.storeIngest(key, ingest$
|
|
457
|
+
const key = keyBuilder$8(luvio, resourceParams);
|
|
458
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
459
459
|
const snapshot = luvio.storeLookup({
|
|
460
460
|
recordId: key,
|
|
461
|
-
node: select$
|
|
461
|
+
node: select$k(),
|
|
462
462
|
variables: {},
|
|
463
463
|
}, snapshotRefresh);
|
|
464
464
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -469,19 +469,19 @@ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
469
469
|
deepFreeze(snapshot.data);
|
|
470
470
|
return snapshot;
|
|
471
471
|
}
|
|
472
|
-
function ingestError$
|
|
473
|
-
const key = keyBuilder$
|
|
472
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
473
|
+
const key = keyBuilder$8(luvio, params);
|
|
474
474
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
475
475
|
const storeMetadataParams = {
|
|
476
|
-
ttl: TTL$
|
|
476
|
+
ttl: TTL$5,
|
|
477
477
|
namespace: keyPrefix,
|
|
478
|
-
version: VERSION$
|
|
479
|
-
representationName: RepresentationType$
|
|
478
|
+
version: VERSION$f,
|
|
479
|
+
representationName: RepresentationType$5
|
|
480
480
|
};
|
|
481
481
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
482
482
|
return errorSnapshot;
|
|
483
483
|
}
|
|
484
|
-
function createResourceRequest$
|
|
484
|
+
function createResourceRequest$5(config) {
|
|
485
485
|
const headers = {};
|
|
486
486
|
return {
|
|
487
487
|
baseUri: '/services/data/v63.0',
|
|
@@ -495,97 +495,97 @@ function createResourceRequest$4(config) {
|
|
|
495
495
|
};
|
|
496
496
|
}
|
|
497
497
|
|
|
498
|
-
const adapterName$
|
|
498
|
+
const adapterName$5 = 'createEmbeddings';
|
|
499
499
|
const createEmbeddings_ConfigPropertyMetadata = [
|
|
500
500
|
generateParamConfigMetadata('embeddingsInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
501
501
|
];
|
|
502
|
-
const createEmbeddings_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
503
|
-
const createResourceParams$
|
|
504
|
-
function keyBuilder$
|
|
505
|
-
const resourceParams = createResourceParams$
|
|
506
|
-
return keyBuilder$
|
|
502
|
+
const createEmbeddings_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, createEmbeddings_ConfigPropertyMetadata);
|
|
503
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$6(createEmbeddings_ConfigPropertyMetadata);
|
|
504
|
+
function keyBuilder$7(luvio, config) {
|
|
505
|
+
const resourceParams = createResourceParams$5(config);
|
|
506
|
+
return keyBuilder$8(luvio, resourceParams);
|
|
507
507
|
}
|
|
508
|
-
function typeCheckConfig$
|
|
508
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
509
509
|
const config = {};
|
|
510
510
|
const untrustedConfig_embeddingsInput = untrustedConfig.embeddingsInput;
|
|
511
|
-
const referenceEinsteinLlmEmbeddingsInputRepresentationValidationError = validate$
|
|
511
|
+
const referenceEinsteinLlmEmbeddingsInputRepresentationValidationError = validate$o(untrustedConfig_embeddingsInput);
|
|
512
512
|
if (referenceEinsteinLlmEmbeddingsInputRepresentationValidationError === null) {
|
|
513
513
|
config.embeddingsInput = untrustedConfig_embeddingsInput;
|
|
514
514
|
}
|
|
515
515
|
return config;
|
|
516
516
|
}
|
|
517
|
-
function validateAdapterConfig$
|
|
517
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
518
518
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
519
519
|
return null;
|
|
520
520
|
}
|
|
521
521
|
if (process.env.NODE_ENV !== 'production') {
|
|
522
522
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
523
523
|
}
|
|
524
|
-
const config = typeCheckConfig$
|
|
524
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
525
525
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
526
526
|
return null;
|
|
527
527
|
}
|
|
528
528
|
return config;
|
|
529
529
|
}
|
|
530
|
-
function adapterFragment$
|
|
531
|
-
createResourceParams$
|
|
532
|
-
return select$
|
|
530
|
+
function adapterFragment$2(luvio, config) {
|
|
531
|
+
createResourceParams$5(config);
|
|
532
|
+
return select$k();
|
|
533
533
|
}
|
|
534
|
-
function onFetchResponseSuccess$
|
|
535
|
-
const snapshot = ingestSuccess$
|
|
534
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
535
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
|
|
536
536
|
config,
|
|
537
|
-
resolve: () => buildNetworkSnapshot$
|
|
537
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
538
538
|
});
|
|
539
539
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
540
540
|
}
|
|
541
|
-
function onFetchResponseError$
|
|
542
|
-
const snapshot = ingestError$
|
|
541
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
542
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
543
543
|
config,
|
|
544
|
-
resolve: () => buildNetworkSnapshot$
|
|
544
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
545
545
|
});
|
|
546
546
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
547
547
|
}
|
|
548
|
-
function buildNetworkSnapshot$
|
|
549
|
-
const resourceParams = createResourceParams$
|
|
550
|
-
const request = createResourceRequest$
|
|
548
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
549
|
+
const resourceParams = createResourceParams$5(config);
|
|
550
|
+
const request = createResourceRequest$5(resourceParams);
|
|
551
551
|
return luvio.dispatchResourceRequest(request, options)
|
|
552
552
|
.then((response) => {
|
|
553
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
553
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
554
554
|
const cache = new StoreKeyMap();
|
|
555
|
-
getResponseCacheKeys$
|
|
555
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
556
556
|
return cache;
|
|
557
557
|
});
|
|
558
558
|
}, (response) => {
|
|
559
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
559
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
560
560
|
});
|
|
561
561
|
}
|
|
562
|
-
function buildNetworkSnapshotCachePolicy$
|
|
563
|
-
return buildNetworkSnapshotCachePolicy$
|
|
562
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
563
|
+
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, 'get', false);
|
|
564
564
|
}
|
|
565
|
-
function buildCachedSnapshotCachePolicy$
|
|
565
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
566
566
|
const { luvio, config } = context;
|
|
567
567
|
const selector = {
|
|
568
|
-
recordId: keyBuilder$
|
|
569
|
-
node: adapterFragment$
|
|
568
|
+
recordId: keyBuilder$7(luvio, config),
|
|
569
|
+
node: adapterFragment$2(luvio, config),
|
|
570
570
|
variables: {},
|
|
571
571
|
};
|
|
572
572
|
const cacheSnapshot = storeLookup(selector, {
|
|
573
573
|
config,
|
|
574
|
-
resolve: () => buildNetworkSnapshot$
|
|
574
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
575
575
|
});
|
|
576
576
|
return cacheSnapshot;
|
|
577
577
|
}
|
|
578
578
|
const createEmbeddingsAdapterFactory = (luvio) => function EinsteinLLM__createEmbeddings(untrustedConfig, requestContext) {
|
|
579
|
-
const config = validateAdapterConfig$
|
|
579
|
+
const config = validateAdapterConfig$5(untrustedConfig, createEmbeddings_ConfigPropertyNames);
|
|
580
580
|
// Invalid or incomplete config
|
|
581
581
|
if (config === null) {
|
|
582
582
|
return null;
|
|
583
583
|
}
|
|
584
584
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
585
|
-
buildCachedSnapshotCachePolicy$
|
|
585
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
586
586
|
};
|
|
587
587
|
|
|
588
|
-
function validate$
|
|
588
|
+
function validate$l(obj, path = 'EinsteinLlmFeedbackInputRepresentation') {
|
|
589
589
|
const v_error = (() => {
|
|
590
590
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
591
591
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -632,9 +632,9 @@ function validate$i(obj, path = 'EinsteinLlmFeedbackInputRepresentation') {
|
|
|
632
632
|
return v_error === undefined ? null : v_error;
|
|
633
633
|
}
|
|
634
634
|
|
|
635
|
-
const TTL$
|
|
636
|
-
const VERSION$
|
|
637
|
-
function validate$
|
|
635
|
+
const TTL$4 = 100;
|
|
636
|
+
const VERSION$e = "4033328f65865dd5d80c68a7573a4522";
|
|
637
|
+
function validate$k(obj, path = 'EinsteinLlmFeedbackRepresentation') {
|
|
638
638
|
const v_error = (() => {
|
|
639
639
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
640
640
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -647,23 +647,23 @@ function validate$h(obj, path = 'EinsteinLlmFeedbackRepresentation') {
|
|
|
647
647
|
})();
|
|
648
648
|
return v_error === undefined ? null : v_error;
|
|
649
649
|
}
|
|
650
|
-
const RepresentationType$
|
|
651
|
-
function keyBuilder$
|
|
652
|
-
return keyPrefix + '::' + RepresentationType$
|
|
650
|
+
const RepresentationType$4 = 'EinsteinLlmFeedbackRepresentation';
|
|
651
|
+
function keyBuilder$6(luvio, config) {
|
|
652
|
+
return keyPrefix + '::' + RepresentationType$4 + ':' + config.message;
|
|
653
653
|
}
|
|
654
654
|
function keyBuilderFromType$2(luvio, object) {
|
|
655
655
|
const keyParams = {
|
|
656
656
|
message: object.message
|
|
657
657
|
};
|
|
658
|
-
return keyBuilder$
|
|
658
|
+
return keyBuilder$6(luvio, keyParams);
|
|
659
659
|
}
|
|
660
|
-
function normalize$
|
|
660
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
661
661
|
return input;
|
|
662
662
|
}
|
|
663
|
-
const select$
|
|
663
|
+
const select$j = function EinsteinLlmFeedbackRepresentationSelect() {
|
|
664
664
|
return {
|
|
665
665
|
kind: 'Fragment',
|
|
666
|
-
version: VERSION$
|
|
666
|
+
version: VERSION$e,
|
|
667
667
|
private: [],
|
|
668
668
|
selections: [
|
|
669
669
|
{
|
|
@@ -673,7 +673,7 @@ const select$f = function EinsteinLlmFeedbackRepresentationSelect() {
|
|
|
673
673
|
]
|
|
674
674
|
};
|
|
675
675
|
};
|
|
676
|
-
function equals$
|
|
676
|
+
function equals$e(existing, incoming) {
|
|
677
677
|
const existing_message = existing.message;
|
|
678
678
|
const incoming_message = incoming.message;
|
|
679
679
|
if (!(existing_message === incoming_message)) {
|
|
@@ -681,41 +681,41 @@ function equals$b(existing, incoming) {
|
|
|
681
681
|
}
|
|
682
682
|
return true;
|
|
683
683
|
}
|
|
684
|
-
const ingest$
|
|
684
|
+
const ingest$4 = function EinsteinLlmFeedbackRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
685
685
|
if (process.env.NODE_ENV !== 'production') {
|
|
686
|
-
const validateError = validate$
|
|
686
|
+
const validateError = validate$k(input);
|
|
687
687
|
if (validateError !== null) {
|
|
688
688
|
throw validateError;
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
691
|
const key = keyBuilderFromType$2(luvio, input);
|
|
692
|
-
const ttlToUse = TTL$
|
|
693
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
692
|
+
const ttlToUse = TTL$4;
|
|
693
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "EinsteinLLM", VERSION$e, RepresentationType$4, equals$e);
|
|
694
694
|
return createLink(key);
|
|
695
695
|
};
|
|
696
|
-
function getTypeCacheKeys$
|
|
696
|
+
function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
|
|
697
697
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
698
698
|
const rootKey = keyBuilderFromType$2(luvio, input);
|
|
699
699
|
rootKeySet.set(rootKey, {
|
|
700
700
|
namespace: keyPrefix,
|
|
701
|
-
representationName: RepresentationType$
|
|
701
|
+
representationName: RepresentationType$4,
|
|
702
702
|
mergeable: false
|
|
703
703
|
});
|
|
704
704
|
}
|
|
705
705
|
|
|
706
|
-
function select$
|
|
707
|
-
return select$
|
|
706
|
+
function select$i(luvio, params) {
|
|
707
|
+
return select$j();
|
|
708
708
|
}
|
|
709
|
-
function getResponseCacheKeys$
|
|
710
|
-
getTypeCacheKeys$
|
|
709
|
+
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
710
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response);
|
|
711
711
|
}
|
|
712
|
-
function ingestSuccess$
|
|
712
|
+
function ingestSuccess$4(luvio, resourceParams, response) {
|
|
713
713
|
const { body } = response;
|
|
714
714
|
const key = keyBuilderFromType$2(luvio, body);
|
|
715
|
-
luvio.storeIngest(key, ingest$
|
|
715
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
716
716
|
const snapshot = luvio.storeLookup({
|
|
717
717
|
recordId: key,
|
|
718
|
-
node: select$
|
|
718
|
+
node: select$i(),
|
|
719
719
|
variables: {},
|
|
720
720
|
});
|
|
721
721
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -726,7 +726,7 @@ function ingestSuccess$3(luvio, resourceParams, response) {
|
|
|
726
726
|
deepFreeze(snapshot.data);
|
|
727
727
|
return snapshot;
|
|
728
728
|
}
|
|
729
|
-
function createResourceRequest$
|
|
729
|
+
function createResourceRequest$4(config) {
|
|
730
730
|
const headers = {};
|
|
731
731
|
return {
|
|
732
732
|
baseUri: '/services/data/v63.0',
|
|
@@ -740,45 +740,45 @@ function createResourceRequest$3(config) {
|
|
|
740
740
|
};
|
|
741
741
|
}
|
|
742
742
|
|
|
743
|
-
const adapterName$
|
|
743
|
+
const adapterName$4 = 'createFeedback';
|
|
744
744
|
const createFeedback_ConfigPropertyMetadata = [
|
|
745
745
|
generateParamConfigMetadata('feedbackInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
746
746
|
];
|
|
747
|
-
const createFeedback_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
748
|
-
const createResourceParams$
|
|
749
|
-
function typeCheckConfig$
|
|
747
|
+
const createFeedback_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, createFeedback_ConfigPropertyMetadata);
|
|
748
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$6(createFeedback_ConfigPropertyMetadata);
|
|
749
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
750
750
|
const config = {};
|
|
751
751
|
const untrustedConfig_feedbackInput = untrustedConfig.feedbackInput;
|
|
752
|
-
const referenceEinsteinLlmFeedbackInputRepresentationValidationError = validate$
|
|
752
|
+
const referenceEinsteinLlmFeedbackInputRepresentationValidationError = validate$l(untrustedConfig_feedbackInput);
|
|
753
753
|
if (referenceEinsteinLlmFeedbackInputRepresentationValidationError === null) {
|
|
754
754
|
config.feedbackInput = untrustedConfig_feedbackInput;
|
|
755
755
|
}
|
|
756
756
|
return config;
|
|
757
757
|
}
|
|
758
|
-
function validateAdapterConfig$
|
|
758
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
759
759
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
760
760
|
return null;
|
|
761
761
|
}
|
|
762
762
|
if (process.env.NODE_ENV !== 'production') {
|
|
763
763
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
764
764
|
}
|
|
765
|
-
const config = typeCheckConfig$
|
|
765
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
766
766
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
767
767
|
return null;
|
|
768
768
|
}
|
|
769
769
|
return config;
|
|
770
770
|
}
|
|
771
|
-
function buildNetworkSnapshot$
|
|
772
|
-
const resourceParams = createResourceParams$
|
|
773
|
-
const request = createResourceRequest$
|
|
771
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
772
|
+
const resourceParams = createResourceParams$4(config);
|
|
773
|
+
const request = createResourceRequest$4(resourceParams);
|
|
774
774
|
return luvio.dispatchResourceRequest(request, options)
|
|
775
775
|
.then((response) => {
|
|
776
776
|
return luvio.handleSuccessResponse(() => {
|
|
777
|
-
const snapshot = ingestSuccess$
|
|
777
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response);
|
|
778
778
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
779
779
|
}, () => {
|
|
780
780
|
const cache = new StoreKeyMap();
|
|
781
|
-
getResponseCacheKeys$
|
|
781
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
|
|
782
782
|
return cache;
|
|
783
783
|
});
|
|
784
784
|
}, (response) => {
|
|
@@ -788,16 +788,16 @@ function buildNetworkSnapshot$3(luvio, config, options) {
|
|
|
788
788
|
}
|
|
789
789
|
const createFeedbackAdapterFactory = (luvio) => {
|
|
790
790
|
return function createFeedback(untrustedConfig) {
|
|
791
|
-
const config = validateAdapterConfig$
|
|
791
|
+
const config = validateAdapterConfig$4(untrustedConfig, createFeedback_ConfigPropertyNames);
|
|
792
792
|
// Invalid or incomplete config
|
|
793
793
|
if (config === null) {
|
|
794
794
|
throw new Error('Invalid config for "createFeedback"');
|
|
795
795
|
}
|
|
796
|
-
return buildNetworkSnapshot$
|
|
796
|
+
return buildNetworkSnapshot$4(luvio, config);
|
|
797
797
|
};
|
|
798
798
|
};
|
|
799
799
|
|
|
800
|
-
function validate$
|
|
800
|
+
function validate$j(obj, path = 'EinsteinLlmAdditionalConfigInputRepresentation') {
|
|
801
801
|
const v_error = (() => {
|
|
802
802
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
803
803
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -880,7 +880,7 @@ function validate$g(obj, path = 'EinsteinLlmAdditionalConfigInputRepresentation'
|
|
|
880
880
|
return v_error === undefined ? null : v_error;
|
|
881
881
|
}
|
|
882
882
|
|
|
883
|
-
function validate$
|
|
883
|
+
function validate$i(obj, path = 'EinsteinLlmGenerationsInputRepresentation') {
|
|
884
884
|
const v_error = (() => {
|
|
885
885
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
886
886
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -888,7 +888,7 @@ function validate$f(obj, path = 'EinsteinLlmGenerationsInputRepresentation') {
|
|
|
888
888
|
if (obj.additionalConfig !== undefined) {
|
|
889
889
|
const obj_additionalConfig = obj.additionalConfig;
|
|
890
890
|
const path_additionalConfig = path + '.additionalConfig';
|
|
891
|
-
const referencepath_additionalConfigValidationError = validate$
|
|
891
|
+
const referencepath_additionalConfigValidationError = validate$j(obj_additionalConfig, path_additionalConfig);
|
|
892
892
|
if (referencepath_additionalConfigValidationError !== null) {
|
|
893
893
|
let message = 'Object doesn\'t match EinsteinLlmAdditionalConfigInputRepresentation (at "' + path_additionalConfig + '")\n';
|
|
894
894
|
message += referencepath_additionalConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -911,8 +911,8 @@ function validate$f(obj, path = 'EinsteinLlmGenerationsInputRepresentation') {
|
|
|
911
911
|
return v_error === undefined ? null : v_error;
|
|
912
912
|
}
|
|
913
913
|
|
|
914
|
-
const VERSION$
|
|
915
|
-
function validate$
|
|
914
|
+
const VERSION$d = "9ebac74e6f964c363d5fd1913df363af";
|
|
915
|
+
function validate$h(obj, path = 'EinsteinLlmGenerationsContentQualityRepresentation') {
|
|
916
916
|
const v_error = (() => {
|
|
917
917
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
918
918
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -948,10 +948,10 @@ function validate$e(obj, path = 'EinsteinLlmGenerationsContentQualityRepresentat
|
|
|
948
948
|
})();
|
|
949
949
|
return v_error === undefined ? null : v_error;
|
|
950
950
|
}
|
|
951
|
-
const select$
|
|
951
|
+
const select$h = function EinsteinLlmGenerationsContentQualityRepresentationSelect() {
|
|
952
952
|
return {
|
|
953
953
|
kind: 'Fragment',
|
|
954
|
-
version: VERSION$
|
|
954
|
+
version: VERSION$d,
|
|
955
955
|
private: [],
|
|
956
956
|
selections: [
|
|
957
957
|
{
|
|
@@ -962,7 +962,7 @@ const select$d = function EinsteinLlmGenerationsContentQualityRepresentationSele
|
|
|
962
962
|
]
|
|
963
963
|
};
|
|
964
964
|
};
|
|
965
|
-
function equals$
|
|
965
|
+
function equals$d(existing, incoming) {
|
|
966
966
|
const existing_isToxicityDetected = existing.isToxicityDetected;
|
|
967
967
|
const incoming_isToxicityDetected = incoming.isToxicityDetected;
|
|
968
968
|
// if at least one of these optionals is defined
|
|
@@ -979,8 +979,8 @@ function equals$a(existing, incoming) {
|
|
|
979
979
|
return true;
|
|
980
980
|
}
|
|
981
981
|
|
|
982
|
-
const VERSION$
|
|
983
|
-
function validate$
|
|
982
|
+
const VERSION$c = "77af44a252cb5b45b4d9a8101368d2aa";
|
|
983
|
+
function validate$g(obj, path = 'EinsteinLlmGenerationsSafetyScoreRepresentation') {
|
|
984
984
|
const v_error = (() => {
|
|
985
985
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
986
986
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1184,10 +1184,10 @@ function validate$d(obj, path = 'EinsteinLlmGenerationsSafetyScoreRepresentation
|
|
|
1184
1184
|
})();
|
|
1185
1185
|
return v_error === undefined ? null : v_error;
|
|
1186
1186
|
}
|
|
1187
|
-
const select$
|
|
1187
|
+
const select$g = function EinsteinLlmGenerationsSafetyScoreRepresentationSelect() {
|
|
1188
1188
|
return {
|
|
1189
1189
|
kind: 'Fragment',
|
|
1190
|
-
version: VERSION$
|
|
1190
|
+
version: VERSION$c,
|
|
1191
1191
|
private: [],
|
|
1192
1192
|
selections: [
|
|
1193
1193
|
{
|
|
@@ -1228,7 +1228,7 @@ const select$c = function EinsteinLlmGenerationsSafetyScoreRepresentationSelect(
|
|
|
1228
1228
|
]
|
|
1229
1229
|
};
|
|
1230
1230
|
};
|
|
1231
|
-
function equals$
|
|
1231
|
+
function equals$c(existing, incoming) {
|
|
1232
1232
|
const existing_hateScore = existing.hateScore;
|
|
1233
1233
|
const incoming_hateScore = incoming.hateScore;
|
|
1234
1234
|
// if at least one of these optionals is defined
|
|
@@ -1323,8 +1323,8 @@ function equals$9(existing, incoming) {
|
|
|
1323
1323
|
return true;
|
|
1324
1324
|
}
|
|
1325
1325
|
|
|
1326
|
-
const VERSION$
|
|
1327
|
-
function validate$
|
|
1326
|
+
const VERSION$b = "4a07778ff6c595d91c575188146647a1";
|
|
1327
|
+
function validate$f(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
|
|
1328
1328
|
const v_error = (() => {
|
|
1329
1329
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1330
1330
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1334,7 +1334,7 @@ function validate$c(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
|
|
|
1334
1334
|
const path_contentQualityRepresentation = path + '.contentQualityRepresentation';
|
|
1335
1335
|
let obj_contentQualityRepresentation_union0 = null;
|
|
1336
1336
|
const obj_contentQualityRepresentation_union0_error = (() => {
|
|
1337
|
-
const referencepath_contentQualityRepresentationValidationError = validate$
|
|
1337
|
+
const referencepath_contentQualityRepresentationValidationError = validate$h(obj_contentQualityRepresentation, path_contentQualityRepresentation);
|
|
1338
1338
|
if (referencepath_contentQualityRepresentationValidationError !== null) {
|
|
1339
1339
|
let message = 'Object doesn\'t match EinsteinLlmGenerationsContentQualityRepresentation (at "' + path_contentQualityRepresentation + '")\n';
|
|
1340
1340
|
message += referencepath_contentQualityRepresentationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1382,7 +1382,7 @@ function validate$c(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
|
|
|
1382
1382
|
const path_safetyScoreRepresentation = path + '.safetyScoreRepresentation';
|
|
1383
1383
|
let obj_safetyScoreRepresentation_union0 = null;
|
|
1384
1384
|
const obj_safetyScoreRepresentation_union0_error = (() => {
|
|
1385
|
-
const referencepath_safetyScoreRepresentationValidationError = validate$
|
|
1385
|
+
const referencepath_safetyScoreRepresentationValidationError = validate$g(obj_safetyScoreRepresentation, path_safetyScoreRepresentation);
|
|
1386
1386
|
if (referencepath_safetyScoreRepresentationValidationError !== null) {
|
|
1387
1387
|
let message = 'Object doesn\'t match EinsteinLlmGenerationsSafetyScoreRepresentation (at "' + path_safetyScoreRepresentation + '")\n';
|
|
1388
1388
|
message += referencepath_safetyScoreRepresentationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1416,12 +1416,12 @@ function validate$c(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
|
|
|
1416
1416
|
})();
|
|
1417
1417
|
return v_error === undefined ? null : v_error;
|
|
1418
1418
|
}
|
|
1419
|
-
const select$
|
|
1420
|
-
const { selections: EinsteinLlmGenerationsContentQualityRepresentation__selections, opaque: EinsteinLlmGenerationsContentQualityRepresentation__opaque, } = select$
|
|
1421
|
-
const { selections: EinsteinLlmGenerationsSafetyScoreRepresentation__selections, opaque: EinsteinLlmGenerationsSafetyScoreRepresentation__opaque, } = select$
|
|
1419
|
+
const select$f = function EinsteinLlmGenerationItemRepresentationSelect() {
|
|
1420
|
+
const { selections: EinsteinLlmGenerationsContentQualityRepresentation__selections, opaque: EinsteinLlmGenerationsContentQualityRepresentation__opaque, } = select$h();
|
|
1421
|
+
const { selections: EinsteinLlmGenerationsSafetyScoreRepresentation__selections, opaque: EinsteinLlmGenerationsSafetyScoreRepresentation__opaque, } = select$g();
|
|
1422
1422
|
return {
|
|
1423
1423
|
kind: 'Fragment',
|
|
1424
|
-
version: VERSION$
|
|
1424
|
+
version: VERSION$b,
|
|
1425
1425
|
private: [],
|
|
1426
1426
|
selections: [
|
|
1427
1427
|
{
|
|
@@ -1458,7 +1458,7 @@ const select$b = function EinsteinLlmGenerationItemRepresentationSelect() {
|
|
|
1458
1458
|
]
|
|
1459
1459
|
};
|
|
1460
1460
|
};
|
|
1461
|
-
function equals$
|
|
1461
|
+
function equals$b(existing, incoming) {
|
|
1462
1462
|
const existing_isSummarized = existing.isSummarized;
|
|
1463
1463
|
const incoming_isSummarized = incoming.isSummarized;
|
|
1464
1464
|
// if at least one of these optionals is defined
|
|
@@ -1499,7 +1499,7 @@ function equals$8(existing, incoming) {
|
|
|
1499
1499
|
if (!(existing_contentQualityRepresentation === incoming_contentQualityRepresentation
|
|
1500
1500
|
|| (existing_contentQualityRepresentation != null &&
|
|
1501
1501
|
incoming_contentQualityRepresentation != null &&
|
|
1502
|
-
equals$
|
|
1502
|
+
equals$d(existing_contentQualityRepresentation, incoming_contentQualityRepresentation)))) {
|
|
1503
1503
|
return false;
|
|
1504
1504
|
}
|
|
1505
1505
|
}
|
|
@@ -1515,15 +1515,15 @@ function equals$8(existing, incoming) {
|
|
|
1515
1515
|
if (!(existing_safetyScoreRepresentation === incoming_safetyScoreRepresentation
|
|
1516
1516
|
|| (existing_safetyScoreRepresentation != null &&
|
|
1517
1517
|
incoming_safetyScoreRepresentation != null &&
|
|
1518
|
-
equals$
|
|
1518
|
+
equals$c(existing_safetyScoreRepresentation, incoming_safetyScoreRepresentation)))) {
|
|
1519
1519
|
return false;
|
|
1520
1520
|
}
|
|
1521
1521
|
}
|
|
1522
1522
|
return true;
|
|
1523
1523
|
}
|
|
1524
1524
|
|
|
1525
|
-
const VERSION$
|
|
1526
|
-
function validate$
|
|
1525
|
+
const VERSION$a = "4656c961c9d093a9e206c1db7d4de0b0";
|
|
1526
|
+
function validate$e(obj, path = 'WrappedMap') {
|
|
1527
1527
|
const v_error = (() => {
|
|
1528
1528
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1529
1529
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1545,15 +1545,15 @@ function validate$b(obj, path = 'WrappedMap') {
|
|
|
1545
1545
|
})();
|
|
1546
1546
|
return v_error === undefined ? null : v_error;
|
|
1547
1547
|
}
|
|
1548
|
-
const select$
|
|
1548
|
+
const select$e = function WrappedMapSelect() {
|
|
1549
1549
|
return {
|
|
1550
1550
|
kind: 'Fragment',
|
|
1551
|
-
version: VERSION$
|
|
1551
|
+
version: VERSION$a,
|
|
1552
1552
|
private: [],
|
|
1553
1553
|
selections: []
|
|
1554
1554
|
};
|
|
1555
1555
|
};
|
|
1556
|
-
function equals$
|
|
1556
|
+
function equals$a(existing, incoming) {
|
|
1557
1557
|
const existing_wrappedMap = existing.wrappedMap;
|
|
1558
1558
|
const incoming_wrappedMap = incoming.wrappedMap;
|
|
1559
1559
|
const equals_wrappedMap_props = equalsObject(existing_wrappedMap, incoming_wrappedMap, (existing_wrappedMap_prop, incoming_wrappedMap_prop) => {
|
|
@@ -1564,9 +1564,9 @@ function equals$7(existing, incoming) {
|
|
|
1564
1564
|
return true;
|
|
1565
1565
|
}
|
|
1566
1566
|
|
|
1567
|
-
const TTL$
|
|
1568
|
-
const VERSION$
|
|
1569
|
-
function validate$
|
|
1567
|
+
const TTL$3 = 100;
|
|
1568
|
+
const VERSION$9 = "d8abd72a42e842b253da1c38954dafbc";
|
|
1569
|
+
function validate$d(obj, path = 'EinsteinLlmGenerationsRepresentation') {
|
|
1570
1570
|
const v_error = (() => {
|
|
1571
1571
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1572
1572
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1579,7 +1579,7 @@ function validate$a(obj, path = 'EinsteinLlmGenerationsRepresentation') {
|
|
|
1579
1579
|
for (let i = 0; i < obj_generations.length; i++) {
|
|
1580
1580
|
const obj_generations_item = obj_generations[i];
|
|
1581
1581
|
const path_generations_item = path_generations + '[' + i + ']';
|
|
1582
|
-
const referencepath_generations_itemValidationError = validate$
|
|
1582
|
+
const referencepath_generations_itemValidationError = validate$f(obj_generations_item, path_generations_item);
|
|
1583
1583
|
if (referencepath_generations_itemValidationError !== null) {
|
|
1584
1584
|
let message = 'Object doesn\'t match EinsteinLlmGenerationItemRepresentation (at "' + path_generations_item + '")\n';
|
|
1585
1585
|
message += referencepath_generations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1590,7 +1590,7 @@ function validate$a(obj, path = 'EinsteinLlmGenerationsRepresentation') {
|
|
|
1590
1590
|
const path_parameters = path + '.parameters';
|
|
1591
1591
|
let obj_parameters_union0 = null;
|
|
1592
1592
|
const obj_parameters_union0_error = (() => {
|
|
1593
|
-
const referencepath_parametersValidationError = validate$
|
|
1593
|
+
const referencepath_parametersValidationError = validate$e(obj_parameters, path_parameters);
|
|
1594
1594
|
if (referencepath_parametersValidationError !== null) {
|
|
1595
1595
|
let message = 'Object doesn\'t match WrappedMap (at "' + path_parameters + '")\n';
|
|
1596
1596
|
message += referencepath_parametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1649,25 +1649,25 @@ function validate$a(obj, path = 'EinsteinLlmGenerationsRepresentation') {
|
|
|
1649
1649
|
})();
|
|
1650
1650
|
return v_error === undefined ? null : v_error;
|
|
1651
1651
|
}
|
|
1652
|
-
const RepresentationType$
|
|
1653
|
-
function keyBuilder$
|
|
1654
|
-
return keyPrefix + '::' + RepresentationType$
|
|
1652
|
+
const RepresentationType$3 = 'EinsteinLlmGenerationsRepresentation';
|
|
1653
|
+
function keyBuilder$5(luvio, config) {
|
|
1654
|
+
return keyPrefix + '::' + RepresentationType$3 + ':' + config.requestId;
|
|
1655
1655
|
}
|
|
1656
1656
|
function keyBuilderFromType$1(luvio, object) {
|
|
1657
1657
|
const keyParams = {
|
|
1658
1658
|
requestId: object.requestId
|
|
1659
1659
|
};
|
|
1660
|
-
return keyBuilder$
|
|
1660
|
+
return keyBuilder$5(luvio, keyParams);
|
|
1661
1661
|
}
|
|
1662
|
-
function normalize$
|
|
1662
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
1663
1663
|
return input;
|
|
1664
1664
|
}
|
|
1665
|
-
const select$
|
|
1666
|
-
const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$
|
|
1667
|
-
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$
|
|
1665
|
+
const select$d = function EinsteinLlmGenerationsRepresentationSelect() {
|
|
1666
|
+
const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$f();
|
|
1667
|
+
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$e();
|
|
1668
1668
|
return {
|
|
1669
1669
|
kind: 'Fragment',
|
|
1670
|
-
version: VERSION$
|
|
1670
|
+
version: VERSION$9,
|
|
1671
1671
|
private: [],
|
|
1672
1672
|
selections: [
|
|
1673
1673
|
{
|
|
@@ -1693,7 +1693,7 @@ const select$9 = function EinsteinLlmGenerationsRepresentationSelect() {
|
|
|
1693
1693
|
]
|
|
1694
1694
|
};
|
|
1695
1695
|
};
|
|
1696
|
-
function equals$
|
|
1696
|
+
function equals$9(existing, incoming) {
|
|
1697
1697
|
const existing_requestId = existing.requestId;
|
|
1698
1698
|
const incoming_requestId = incoming.requestId;
|
|
1699
1699
|
if (!(existing_requestId === incoming_requestId)) {
|
|
@@ -1702,7 +1702,7 @@ function equals$6(existing, incoming) {
|
|
|
1702
1702
|
const existing_generations = existing.generations;
|
|
1703
1703
|
const incoming_generations = incoming.generations;
|
|
1704
1704
|
const equals_generations_items = equalsArray(existing_generations, incoming_generations, (existing_generations_item, incoming_generations_item) => {
|
|
1705
|
-
if (!(equals$
|
|
1705
|
+
if (!(equals$b(existing_generations_item, incoming_generations_item))) {
|
|
1706
1706
|
return false;
|
|
1707
1707
|
}
|
|
1708
1708
|
});
|
|
@@ -1714,7 +1714,7 @@ function equals$6(existing, incoming) {
|
|
|
1714
1714
|
if (!(existing_parameters === incoming_parameters
|
|
1715
1715
|
|| (existing_parameters != null &&
|
|
1716
1716
|
incoming_parameters != null &&
|
|
1717
|
-
equals$
|
|
1717
|
+
equals$a(existing_parameters, incoming_parameters)))) {
|
|
1718
1718
|
return false;
|
|
1719
1719
|
}
|
|
1720
1720
|
const existing_prompt = existing.prompt;
|
|
@@ -1724,41 +1724,41 @@ function equals$6(existing, incoming) {
|
|
|
1724
1724
|
}
|
|
1725
1725
|
return true;
|
|
1726
1726
|
}
|
|
1727
|
-
const ingest$
|
|
1727
|
+
const ingest$3 = function EinsteinLlmGenerationsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1728
1728
|
if (process.env.NODE_ENV !== 'production') {
|
|
1729
|
-
const validateError = validate$
|
|
1729
|
+
const validateError = validate$d(input);
|
|
1730
1730
|
if (validateError !== null) {
|
|
1731
1731
|
throw validateError;
|
|
1732
1732
|
}
|
|
1733
1733
|
}
|
|
1734
1734
|
const key = keyBuilderFromType$1(luvio, input);
|
|
1735
|
-
const ttlToUse = TTL$
|
|
1736
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
1735
|
+
const ttlToUse = TTL$3;
|
|
1736
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "EinsteinLLM", VERSION$9, RepresentationType$3, equals$9);
|
|
1737
1737
|
return createLink(key);
|
|
1738
1738
|
};
|
|
1739
|
-
function getTypeCacheKeys$
|
|
1739
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
1740
1740
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1741
1741
|
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
1742
1742
|
rootKeySet.set(rootKey, {
|
|
1743
1743
|
namespace: keyPrefix,
|
|
1744
|
-
representationName: RepresentationType$
|
|
1744
|
+
representationName: RepresentationType$3,
|
|
1745
1745
|
mergeable: false
|
|
1746
1746
|
});
|
|
1747
1747
|
}
|
|
1748
1748
|
|
|
1749
|
-
function select$
|
|
1750
|
-
return select$
|
|
1749
|
+
function select$c(luvio, params) {
|
|
1750
|
+
return select$d();
|
|
1751
1751
|
}
|
|
1752
|
-
function getResponseCacheKeys$
|
|
1753
|
-
getTypeCacheKeys$
|
|
1752
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
1753
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response);
|
|
1754
1754
|
}
|
|
1755
|
-
function ingestSuccess$
|
|
1755
|
+
function ingestSuccess$3(luvio, resourceParams, response) {
|
|
1756
1756
|
const { body } = response;
|
|
1757
1757
|
const key = keyBuilderFromType$1(luvio, body);
|
|
1758
|
-
luvio.storeIngest(key, ingest$
|
|
1758
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
1759
1759
|
const snapshot = luvio.storeLookup({
|
|
1760
1760
|
recordId: key,
|
|
1761
|
-
node: select$
|
|
1761
|
+
node: select$c(),
|
|
1762
1762
|
variables: {},
|
|
1763
1763
|
});
|
|
1764
1764
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1769,7 +1769,7 @@ function ingestSuccess$2(luvio, resourceParams, response) {
|
|
|
1769
1769
|
deepFreeze(snapshot.data);
|
|
1770
1770
|
return snapshot;
|
|
1771
1771
|
}
|
|
1772
|
-
function createResourceRequest$
|
|
1772
|
+
function createResourceRequest$3(config) {
|
|
1773
1773
|
const headers = {};
|
|
1774
1774
|
return {
|
|
1775
1775
|
baseUri: '/services/data/v63.0',
|
|
@@ -1783,45 +1783,45 @@ function createResourceRequest$2(config) {
|
|
|
1783
1783
|
};
|
|
1784
1784
|
}
|
|
1785
1785
|
|
|
1786
|
-
const adapterName$
|
|
1786
|
+
const adapterName$3 = 'createGenerations';
|
|
1787
1787
|
const createGenerations_ConfigPropertyMetadata = [
|
|
1788
1788
|
generateParamConfigMetadata('generationsInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1789
1789
|
];
|
|
1790
|
-
const createGenerations_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
1791
|
-
const createResourceParams$
|
|
1792
|
-
function typeCheckConfig$
|
|
1790
|
+
const createGenerations_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, createGenerations_ConfigPropertyMetadata);
|
|
1791
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$6(createGenerations_ConfigPropertyMetadata);
|
|
1792
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
1793
1793
|
const config = {};
|
|
1794
1794
|
const untrustedConfig_generationsInput = untrustedConfig.generationsInput;
|
|
1795
|
-
const referenceEinsteinLlmGenerationsInputRepresentationValidationError = validate$
|
|
1795
|
+
const referenceEinsteinLlmGenerationsInputRepresentationValidationError = validate$i(untrustedConfig_generationsInput);
|
|
1796
1796
|
if (referenceEinsteinLlmGenerationsInputRepresentationValidationError === null) {
|
|
1797
1797
|
config.generationsInput = untrustedConfig_generationsInput;
|
|
1798
1798
|
}
|
|
1799
1799
|
return config;
|
|
1800
1800
|
}
|
|
1801
|
-
function validateAdapterConfig$
|
|
1801
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
1802
1802
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1803
1803
|
return null;
|
|
1804
1804
|
}
|
|
1805
1805
|
if (process.env.NODE_ENV !== 'production') {
|
|
1806
1806
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1807
1807
|
}
|
|
1808
|
-
const config = typeCheckConfig$
|
|
1808
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
1809
1809
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1810
1810
|
return null;
|
|
1811
1811
|
}
|
|
1812
1812
|
return config;
|
|
1813
1813
|
}
|
|
1814
|
-
function buildNetworkSnapshot$
|
|
1815
|
-
const resourceParams = createResourceParams$
|
|
1816
|
-
const request = createResourceRequest$
|
|
1814
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
1815
|
+
const resourceParams = createResourceParams$3(config);
|
|
1816
|
+
const request = createResourceRequest$3(resourceParams);
|
|
1817
1817
|
return luvio.dispatchResourceRequest(request, options)
|
|
1818
1818
|
.then((response) => {
|
|
1819
1819
|
return luvio.handleSuccessResponse(() => {
|
|
1820
|
-
const snapshot = ingestSuccess$
|
|
1820
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response);
|
|
1821
1821
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1822
1822
|
}, () => {
|
|
1823
1823
|
const cache = new StoreKeyMap();
|
|
1824
|
-
getResponseCacheKeys$
|
|
1824
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
1825
1825
|
return cache;
|
|
1826
1826
|
});
|
|
1827
1827
|
}, (response) => {
|
|
@@ -1831,16 +1831,16 @@ function buildNetworkSnapshot$2(luvio, config, options) {
|
|
|
1831
1831
|
}
|
|
1832
1832
|
const createGenerationsAdapterFactory = (luvio) => {
|
|
1833
1833
|
return function createGenerations(untrustedConfig) {
|
|
1834
|
-
const config = validateAdapterConfig$
|
|
1834
|
+
const config = validateAdapterConfig$3(untrustedConfig, createGenerations_ConfigPropertyNames);
|
|
1835
1835
|
// Invalid or incomplete config
|
|
1836
1836
|
if (config === null) {
|
|
1837
1837
|
throw new Error('Invalid config for "createGenerations"');
|
|
1838
1838
|
}
|
|
1839
|
-
return buildNetworkSnapshot$
|
|
1839
|
+
return buildNetworkSnapshot$3(luvio, config);
|
|
1840
1840
|
};
|
|
1841
1841
|
};
|
|
1842
1842
|
|
|
1843
|
-
function validate$
|
|
1843
|
+
function validate$c(obj, path = 'WrappedValueMap') {
|
|
1844
1844
|
const v_error = (() => {
|
|
1845
1845
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1846
1846
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1863,7 +1863,7 @@ function validate$9(obj, path = 'WrappedValueMap') {
|
|
|
1863
1863
|
return v_error === undefined ? null : v_error;
|
|
1864
1864
|
}
|
|
1865
1865
|
|
|
1866
|
-
function validate$
|
|
1866
|
+
function validate$b(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresentation') {
|
|
1867
1867
|
const v_error = (() => {
|
|
1868
1868
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1869
1869
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1871,7 +1871,7 @@ function validate$8(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
|
|
|
1871
1871
|
if (obj.additionalConfig !== undefined) {
|
|
1872
1872
|
const obj_additionalConfig = obj.additionalConfig;
|
|
1873
1873
|
const path_additionalConfig = path + '.additionalConfig';
|
|
1874
|
-
const referencepath_additionalConfigValidationError = validate$
|
|
1874
|
+
const referencepath_additionalConfigValidationError = validate$j(obj_additionalConfig, path_additionalConfig);
|
|
1875
1875
|
if (referencepath_additionalConfigValidationError !== null) {
|
|
1876
1876
|
let message = 'Object doesn\'t match EinsteinLlmAdditionalConfigInputRepresentation (at "' + path_additionalConfig + '")\n';
|
|
1877
1877
|
message += referencepath_additionalConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1880,7 +1880,7 @@ function validate$8(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
|
|
|
1880
1880
|
}
|
|
1881
1881
|
const obj_inputParams = obj.inputParams;
|
|
1882
1882
|
const path_inputParams = path + '.inputParams';
|
|
1883
|
-
const referencepath_inputParamsValidationError = validate$
|
|
1883
|
+
const referencepath_inputParamsValidationError = validate$c(obj_inputParams, path_inputParams);
|
|
1884
1884
|
if (referencepath_inputParamsValidationError !== null) {
|
|
1885
1885
|
let message = 'Object doesn\'t match WrappedValueMap (at "' + path_inputParams + '")\n';
|
|
1886
1886
|
message += referencepath_inputParamsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1909,8 +1909,8 @@ function validate$8(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
|
|
|
1909
1909
|
return v_error === undefined ? null : v_error;
|
|
1910
1910
|
}
|
|
1911
1911
|
|
|
1912
|
-
const VERSION$
|
|
1913
|
-
function validate$
|
|
1912
|
+
const VERSION$8 = "6458d624e5a1691821c764b6de0badb3";
|
|
1913
|
+
function validate$a(obj, path = 'EinsteinPromptTemplateGenerationsErrorRepresentation') {
|
|
1914
1914
|
const v_error = (() => {
|
|
1915
1915
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1916
1916
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1940,10 +1940,10 @@ function validate$7(obj, path = 'EinsteinPromptTemplateGenerationsErrorRepresent
|
|
|
1940
1940
|
})();
|
|
1941
1941
|
return v_error === undefined ? null : v_error;
|
|
1942
1942
|
}
|
|
1943
|
-
const select$
|
|
1943
|
+
const select$b = function EinsteinPromptTemplateGenerationsErrorRepresentationSelect() {
|
|
1944
1944
|
return {
|
|
1945
1945
|
kind: 'Fragment',
|
|
1946
|
-
version: VERSION$
|
|
1946
|
+
version: VERSION$8,
|
|
1947
1947
|
private: [],
|
|
1948
1948
|
selections: [
|
|
1949
1949
|
{
|
|
@@ -1966,7 +1966,7 @@ const select$7 = function EinsteinPromptTemplateGenerationsErrorRepresentationSe
|
|
|
1966
1966
|
]
|
|
1967
1967
|
};
|
|
1968
1968
|
};
|
|
1969
|
-
function equals$
|
|
1969
|
+
function equals$8(existing, incoming) {
|
|
1970
1970
|
const existing_errorMessage = existing.errorMessage;
|
|
1971
1971
|
const incoming_errorMessage = incoming.errorMessage;
|
|
1972
1972
|
if (!(existing_errorMessage === incoming_errorMessage)) {
|
|
@@ -1998,8 +1998,8 @@ function equals$5(existing, incoming) {
|
|
|
1998
1998
|
return true;
|
|
1999
1999
|
}
|
|
2000
2000
|
|
|
2001
|
-
const VERSION$
|
|
2002
|
-
function validate$
|
|
2001
|
+
const VERSION$7 = "7c417ce44e4bc05dfcc454e6825590e8";
|
|
2002
|
+
function validate$9(obj, path = 'EinsteinPromptTemplateMaskSettingsRepresentation') {
|
|
2003
2003
|
const v_error = (() => {
|
|
2004
2004
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2005
2005
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -2012,10 +2012,10 @@ function validate$6(obj, path = 'EinsteinPromptTemplateMaskSettingsRepresentatio
|
|
|
2012
2012
|
})();
|
|
2013
2013
|
return v_error === undefined ? null : v_error;
|
|
2014
2014
|
}
|
|
2015
|
-
const select$
|
|
2015
|
+
const select$a = function EinsteinPromptTemplateMaskSettingsRepresentationSelect() {
|
|
2016
2016
|
return {
|
|
2017
2017
|
kind: 'Fragment',
|
|
2018
|
-
version: VERSION$
|
|
2018
|
+
version: VERSION$7,
|
|
2019
2019
|
private: [],
|
|
2020
2020
|
selections: [
|
|
2021
2021
|
{
|
|
@@ -2025,7 +2025,7 @@ const select$6 = function EinsteinPromptTemplateMaskSettingsRepresentationSelect
|
|
|
2025
2025
|
]
|
|
2026
2026
|
};
|
|
2027
2027
|
};
|
|
2028
|
-
function equals$
|
|
2028
|
+
function equals$7(existing, incoming) {
|
|
2029
2029
|
const existing_enableModeration = existing.enableModeration;
|
|
2030
2030
|
const incoming_enableModeration = incoming.enableModeration;
|
|
2031
2031
|
if (!(existing_enableModeration === incoming_enableModeration)) {
|
|
@@ -2034,8 +2034,8 @@ function equals$4(existing, incoming) {
|
|
|
2034
2034
|
return true;
|
|
2035
2035
|
}
|
|
2036
2036
|
|
|
2037
|
-
const VERSION$
|
|
2038
|
-
function validate$
|
|
2037
|
+
const VERSION$6 = "92ad1abd0e2a60bc36941409cadda7e2";
|
|
2038
|
+
function validate$8(obj, path = 'EinsteinPromptTemplateMaskContentRepresentation') {
|
|
2039
2039
|
const v_error = (() => {
|
|
2040
2040
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2041
2041
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -2050,7 +2050,7 @@ function validate$5(obj, path = 'EinsteinPromptTemplateMaskContentRepresentation
|
|
|
2050
2050
|
const path_moderationSettings = path + '.moderationSettings';
|
|
2051
2051
|
let obj_moderationSettings_union0 = null;
|
|
2052
2052
|
const obj_moderationSettings_union0_error = (() => {
|
|
2053
|
-
const referencepath_moderationSettingsValidationError = validate$
|
|
2053
|
+
const referencepath_moderationSettingsValidationError = validate$9(obj_moderationSettings, path_moderationSettings);
|
|
2054
2054
|
if (referencepath_moderationSettingsValidationError !== null) {
|
|
2055
2055
|
let message = 'Object doesn\'t match EinsteinPromptTemplateMaskSettingsRepresentation (at "' + path_moderationSettings + '")\n';
|
|
2056
2056
|
message += referencepath_moderationSettingsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2086,11 +2086,11 @@ function validate$5(obj, path = 'EinsteinPromptTemplateMaskContentRepresentation
|
|
|
2086
2086
|
})();
|
|
2087
2087
|
return v_error === undefined ? null : v_error;
|
|
2088
2088
|
}
|
|
2089
|
-
const select$
|
|
2090
|
-
const { selections: EinsteinPromptTemplateMaskSettingsRepresentation__selections, opaque: EinsteinPromptTemplateMaskSettingsRepresentation__opaque, } = select$
|
|
2089
|
+
const select$9 = function EinsteinPromptTemplateMaskContentRepresentationSelect() {
|
|
2090
|
+
const { selections: EinsteinPromptTemplateMaskSettingsRepresentation__selections, opaque: EinsteinPromptTemplateMaskSettingsRepresentation__opaque, } = select$a();
|
|
2091
2091
|
return {
|
|
2092
2092
|
kind: 'Fragment',
|
|
2093
|
-
version: VERSION$
|
|
2093
|
+
version: VERSION$6,
|
|
2094
2094
|
private: [],
|
|
2095
2095
|
selections: [
|
|
2096
2096
|
{
|
|
@@ -2112,7 +2112,7 @@ const select$5 = function EinsteinPromptTemplateMaskContentRepresentationSelect(
|
|
|
2112
2112
|
]
|
|
2113
2113
|
};
|
|
2114
2114
|
};
|
|
2115
|
-
function equals$
|
|
2115
|
+
function equals$6(existing, incoming) {
|
|
2116
2116
|
const existing_content = existing.content;
|
|
2117
2117
|
const incoming_content = incoming.content;
|
|
2118
2118
|
if (!(existing_content === incoming_content)) {
|
|
@@ -2143,15 +2143,15 @@ function equals$3(existing, incoming) {
|
|
|
2143
2143
|
if (!(existing_moderationSettings === incoming_moderationSettings
|
|
2144
2144
|
|| (existing_moderationSettings != null &&
|
|
2145
2145
|
incoming_moderationSettings != null &&
|
|
2146
|
-
equals$
|
|
2146
|
+
equals$7(existing_moderationSettings, incoming_moderationSettings)))) {
|
|
2147
2147
|
return false;
|
|
2148
2148
|
}
|
|
2149
2149
|
}
|
|
2150
2150
|
return true;
|
|
2151
2151
|
}
|
|
2152
2152
|
|
|
2153
|
-
const VERSION$
|
|
2154
|
-
function validate$
|
|
2153
|
+
const VERSION$5 = "507a815605f8d30ae9b52b0ec513d25e";
|
|
2154
|
+
function validate$7(obj, path = 'EinsteinPromptTemplateMaskDataRepresentation') {
|
|
2155
2155
|
const v_error = (() => {
|
|
2156
2156
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2157
2157
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -2181,10 +2181,10 @@ function validate$4(obj, path = 'EinsteinPromptTemplateMaskDataRepresentation')
|
|
|
2181
2181
|
})();
|
|
2182
2182
|
return v_error === undefined ? null : v_error;
|
|
2183
2183
|
}
|
|
2184
|
-
const select$
|
|
2184
|
+
const select$8 = function EinsteinPromptTemplateMaskDataRepresentationSelect() {
|
|
2185
2185
|
return {
|
|
2186
2186
|
kind: 'Fragment',
|
|
2187
|
-
version: VERSION$
|
|
2187
|
+
version: VERSION$5,
|
|
2188
2188
|
private: [],
|
|
2189
2189
|
selections: [
|
|
2190
2190
|
{
|
|
@@ -2203,7 +2203,7 @@ const select$4 = function EinsteinPromptTemplateMaskDataRepresentationSelect() {
|
|
|
2203
2203
|
]
|
|
2204
2204
|
};
|
|
2205
2205
|
};
|
|
2206
|
-
function equals$
|
|
2206
|
+
function equals$5(existing, incoming) {
|
|
2207
2207
|
const existing_originalValue = existing.originalValue;
|
|
2208
2208
|
const incoming_originalValue = incoming.originalValue;
|
|
2209
2209
|
if (!(existing_originalValue === incoming_originalValue)) {
|
|
@@ -2227,9 +2227,9 @@ function equals$2(existing, incoming) {
|
|
|
2227
2227
|
return true;
|
|
2228
2228
|
}
|
|
2229
2229
|
|
|
2230
|
-
const TTL$
|
|
2231
|
-
const VERSION$
|
|
2232
|
-
function validate$
|
|
2230
|
+
const TTL$2 = 100;
|
|
2231
|
+
const VERSION$4 = "af7cfa8bd9d9cdd1923263da1734499c";
|
|
2232
|
+
function validate$6(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation') {
|
|
2233
2233
|
const v_error = (() => {
|
|
2234
2234
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2235
2235
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -2243,7 +2243,7 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2243
2243
|
for (let i = 0; i < obj_generationErrors.length; i++) {
|
|
2244
2244
|
const obj_generationErrors_item = obj_generationErrors[i];
|
|
2245
2245
|
const path_generationErrors_item = path_generationErrors + '[' + i + ']';
|
|
2246
|
-
const referencepath_generationErrors_itemValidationError = validate$
|
|
2246
|
+
const referencepath_generationErrors_itemValidationError = validate$a(obj_generationErrors_item, path_generationErrors_item);
|
|
2247
2247
|
if (referencepath_generationErrors_itemValidationError !== null) {
|
|
2248
2248
|
let message = 'Object doesn\'t match EinsteinPromptTemplateGenerationsErrorRepresentation (at "' + path_generationErrors_item + '")\n';
|
|
2249
2249
|
message += referencepath_generationErrors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2259,7 +2259,7 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2259
2259
|
for (let i = 0; i < obj_generations.length; i++) {
|
|
2260
2260
|
const obj_generations_item = obj_generations[i];
|
|
2261
2261
|
const path_generations_item = path_generations + '[' + i + ']';
|
|
2262
|
-
const referencepath_generations_itemValidationError = validate$
|
|
2262
|
+
const referencepath_generations_itemValidationError = validate$f(obj_generations_item, path_generations_item);
|
|
2263
2263
|
if (referencepath_generations_itemValidationError !== null) {
|
|
2264
2264
|
let message = 'Object doesn\'t match EinsteinLlmGenerationItemRepresentation (at "' + path_generations_item + '")\n';
|
|
2265
2265
|
message += referencepath_generations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2270,7 +2270,7 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2270
2270
|
const path_parameters = path + '.parameters';
|
|
2271
2271
|
let obj_parameters_union0 = null;
|
|
2272
2272
|
const obj_parameters_union0_error = (() => {
|
|
2273
|
-
const referencepath_parametersValidationError = validate$
|
|
2273
|
+
const referencepath_parametersValidationError = validate$e(obj_parameters, path_parameters);
|
|
2274
2274
|
if (referencepath_parametersValidationError !== null) {
|
|
2275
2275
|
let message = 'Object doesn\'t match WrappedMap (at "' + path_parameters + '")\n';
|
|
2276
2276
|
message += referencepath_parametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2340,7 +2340,7 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2340
2340
|
for (let i = 0; i < obj_requestMessages.length; i++) {
|
|
2341
2341
|
const obj_requestMessages_item = obj_requestMessages[i];
|
|
2342
2342
|
const path_requestMessages_item = path_requestMessages + '[' + i + ']';
|
|
2343
|
-
const referencepath_requestMessages_itemValidationError = validate$
|
|
2343
|
+
const referencepath_requestMessages_itemValidationError = validate$8(obj_requestMessages_item, path_requestMessages_item);
|
|
2344
2344
|
if (referencepath_requestMessages_itemValidationError !== null) {
|
|
2345
2345
|
let message = 'Object doesn\'t match EinsteinPromptTemplateMaskContentRepresentation (at "' + path_requestMessages_item + '")\n';
|
|
2346
2346
|
message += referencepath_requestMessages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2357,7 +2357,7 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2357
2357
|
for (let i = 0; i < obj_responseMessages.length; i++) {
|
|
2358
2358
|
const obj_responseMessages_item = obj_responseMessages[i];
|
|
2359
2359
|
const path_responseMessages_item = path_responseMessages + '[' + i + ']';
|
|
2360
|
-
const referencepath_responseMessages_itemValidationError = validate$
|
|
2360
|
+
const referencepath_responseMessages_itemValidationError = validate$8(obj_responseMessages_item, path_responseMessages_item);
|
|
2361
2361
|
if (referencepath_responseMessages_itemValidationError !== null) {
|
|
2362
2362
|
let message = 'Object doesn\'t match EinsteinPromptTemplateMaskContentRepresentation (at "' + path_responseMessages_item + '")\n';
|
|
2363
2363
|
message += referencepath_responseMessages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2374,7 +2374,7 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2374
2374
|
for (let i = 0; i < obj_slotsMaskingInformation.length; i++) {
|
|
2375
2375
|
const obj_slotsMaskingInformation_item = obj_slotsMaskingInformation[i];
|
|
2376
2376
|
const path_slotsMaskingInformation_item = path_slotsMaskingInformation + '[' + i + ']';
|
|
2377
|
-
const referencepath_slotsMaskingInformation_itemValidationError = validate$
|
|
2377
|
+
const referencepath_slotsMaskingInformation_itemValidationError = validate$7(obj_slotsMaskingInformation_item, path_slotsMaskingInformation_item);
|
|
2378
2378
|
if (referencepath_slotsMaskingInformation_itemValidationError !== null) {
|
|
2379
2379
|
let message = 'Object doesn\'t match EinsteinPromptTemplateMaskDataRepresentation (at "' + path_slotsMaskingInformation_item + '")\n';
|
|
2380
2380
|
message += referencepath_slotsMaskingInformation_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2385,28 +2385,28 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2385
2385
|
})();
|
|
2386
2386
|
return v_error === undefined ? null : v_error;
|
|
2387
2387
|
}
|
|
2388
|
-
const RepresentationType$
|
|
2389
|
-
function keyBuilder$
|
|
2390
|
-
return keyPrefix + '::' + RepresentationType$
|
|
2388
|
+
const RepresentationType$2 = 'EinsteinPromptTemplateGenerationsRepresentation';
|
|
2389
|
+
function keyBuilder$4(luvio, config) {
|
|
2390
|
+
return keyPrefix + '::' + RepresentationType$2 + ':' + config.requestId;
|
|
2391
2391
|
}
|
|
2392
2392
|
function keyBuilderFromType(luvio, object) {
|
|
2393
2393
|
const keyParams = {
|
|
2394
2394
|
requestId: object.requestId
|
|
2395
2395
|
};
|
|
2396
|
-
return keyBuilder$
|
|
2396
|
+
return keyBuilder$4(luvio, keyParams);
|
|
2397
2397
|
}
|
|
2398
|
-
function normalize$
|
|
2398
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
2399
2399
|
return input;
|
|
2400
2400
|
}
|
|
2401
|
-
const select$
|
|
2402
|
-
const { selections: EinsteinPromptTemplateGenerationsErrorRepresentation__selections, opaque: EinsteinPromptTemplateGenerationsErrorRepresentation__opaque, } = select$
|
|
2403
|
-
const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$
|
|
2404
|
-
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$
|
|
2405
|
-
const { selections: EinsteinPromptTemplateMaskContentRepresentation__selections, opaque: EinsteinPromptTemplateMaskContentRepresentation__opaque, } = select$
|
|
2406
|
-
const { selections: EinsteinPromptTemplateMaskDataRepresentation__selections, opaque: EinsteinPromptTemplateMaskDataRepresentation__opaque, } = select$
|
|
2401
|
+
const select$7 = function EinsteinPromptTemplateGenerationsRepresentationSelect() {
|
|
2402
|
+
const { selections: EinsteinPromptTemplateGenerationsErrorRepresentation__selections, opaque: EinsteinPromptTemplateGenerationsErrorRepresentation__opaque, } = select$b();
|
|
2403
|
+
const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$f();
|
|
2404
|
+
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$e();
|
|
2405
|
+
const { selections: EinsteinPromptTemplateMaskContentRepresentation__selections, opaque: EinsteinPromptTemplateMaskContentRepresentation__opaque, } = select$9();
|
|
2406
|
+
const { selections: EinsteinPromptTemplateMaskDataRepresentation__selections, opaque: EinsteinPromptTemplateMaskDataRepresentation__opaque, } = select$8();
|
|
2407
2407
|
return {
|
|
2408
2408
|
kind: 'Fragment',
|
|
2409
|
-
version: VERSION$
|
|
2409
|
+
version: VERSION$4,
|
|
2410
2410
|
private: [],
|
|
2411
2411
|
selections: [
|
|
2412
2412
|
{
|
|
@@ -2464,7 +2464,7 @@ const select$3 = function EinsteinPromptTemplateGenerationsRepresentationSelect(
|
|
|
2464
2464
|
]
|
|
2465
2465
|
};
|
|
2466
2466
|
};
|
|
2467
|
-
function equals$
|
|
2467
|
+
function equals$4(existing, incoming) {
|
|
2468
2468
|
const existing_promptTemplateDevName = existing.promptTemplateDevName;
|
|
2469
2469
|
const incoming_promptTemplateDevName = incoming.promptTemplateDevName;
|
|
2470
2470
|
if (!(existing_promptTemplateDevName === incoming_promptTemplateDevName)) {
|
|
@@ -2485,7 +2485,7 @@ function equals$1(existing, incoming) {
|
|
|
2485
2485
|
return false;
|
|
2486
2486
|
}
|
|
2487
2487
|
const equals_generationErrors_items = equalsArray(existing_generationErrors, incoming_generationErrors, (existing_generationErrors_item, incoming_generationErrors_item) => {
|
|
2488
|
-
if (!(equals$
|
|
2488
|
+
if (!(equals$8(existing_generationErrors_item, incoming_generationErrors_item))) {
|
|
2489
2489
|
return false;
|
|
2490
2490
|
}
|
|
2491
2491
|
});
|
|
@@ -2496,7 +2496,7 @@ function equals$1(existing, incoming) {
|
|
|
2496
2496
|
const existing_generations = existing.generations;
|
|
2497
2497
|
const incoming_generations = incoming.generations;
|
|
2498
2498
|
const equals_generations_items = equalsArray(existing_generations, incoming_generations, (existing_generations_item, incoming_generations_item) => {
|
|
2499
|
-
if (!(equals$
|
|
2499
|
+
if (!(equals$b(existing_generations_item, incoming_generations_item))) {
|
|
2500
2500
|
return false;
|
|
2501
2501
|
}
|
|
2502
2502
|
});
|
|
@@ -2508,7 +2508,7 @@ function equals$1(existing, incoming) {
|
|
|
2508
2508
|
if (!(existing_parameters === incoming_parameters
|
|
2509
2509
|
|| (existing_parameters != null &&
|
|
2510
2510
|
incoming_parameters != null &&
|
|
2511
|
-
equals$
|
|
2511
|
+
equals$a(existing_parameters, incoming_parameters)))) {
|
|
2512
2512
|
return false;
|
|
2513
2513
|
}
|
|
2514
2514
|
const existing_prompt = existing.prompt;
|
|
@@ -2526,7 +2526,7 @@ function equals$1(existing, incoming) {
|
|
|
2526
2526
|
return false;
|
|
2527
2527
|
}
|
|
2528
2528
|
const equals_requestMessages_items = equalsArray(existing_requestMessages, incoming_requestMessages, (existing_requestMessages_item, incoming_requestMessages_item) => {
|
|
2529
|
-
if (!(equals$
|
|
2529
|
+
if (!(equals$6(existing_requestMessages_item, incoming_requestMessages_item))) {
|
|
2530
2530
|
return false;
|
|
2531
2531
|
}
|
|
2532
2532
|
});
|
|
@@ -2544,7 +2544,7 @@ function equals$1(existing, incoming) {
|
|
|
2544
2544
|
return false;
|
|
2545
2545
|
}
|
|
2546
2546
|
const equals_responseMessages_items = equalsArray(existing_responseMessages, incoming_responseMessages, (existing_responseMessages_item, incoming_responseMessages_item) => {
|
|
2547
|
-
if (!(equals$
|
|
2547
|
+
if (!(equals$6(existing_responseMessages_item, incoming_responseMessages_item))) {
|
|
2548
2548
|
return false;
|
|
2549
2549
|
}
|
|
2550
2550
|
});
|
|
@@ -2562,7 +2562,7 @@ function equals$1(existing, incoming) {
|
|
|
2562
2562
|
return false;
|
|
2563
2563
|
}
|
|
2564
2564
|
const equals_slotsMaskingInformation_items = equalsArray(existing_slotsMaskingInformation, incoming_slotsMaskingInformation, (existing_slotsMaskingInformation_item, incoming_slotsMaskingInformation_item) => {
|
|
2565
|
-
if (!(equals$
|
|
2565
|
+
if (!(equals$5(existing_slotsMaskingInformation_item, incoming_slotsMaskingInformation_item))) {
|
|
2566
2566
|
return false;
|
|
2567
2567
|
}
|
|
2568
2568
|
});
|
|
@@ -2572,41 +2572,41 @@ function equals$1(existing, incoming) {
|
|
|
2572
2572
|
}
|
|
2573
2573
|
return true;
|
|
2574
2574
|
}
|
|
2575
|
-
const ingest$
|
|
2575
|
+
const ingest$2 = function EinsteinPromptTemplateGenerationsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2576
2576
|
if (process.env.NODE_ENV !== 'production') {
|
|
2577
|
-
const validateError = validate$
|
|
2577
|
+
const validateError = validate$6(input);
|
|
2578
2578
|
if (validateError !== null) {
|
|
2579
2579
|
throw validateError;
|
|
2580
2580
|
}
|
|
2581
2581
|
}
|
|
2582
2582
|
const key = keyBuilderFromType(luvio, input);
|
|
2583
|
-
const ttlToUse = TTL$
|
|
2584
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
2583
|
+
const ttlToUse = TTL$2;
|
|
2584
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "EinsteinLLM", VERSION$4, RepresentationType$2, equals$4);
|
|
2585
2585
|
return createLink(key);
|
|
2586
2586
|
};
|
|
2587
|
-
function getTypeCacheKeys$
|
|
2587
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
2588
2588
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2589
2589
|
const rootKey = keyBuilderFromType(luvio, input);
|
|
2590
2590
|
rootKeySet.set(rootKey, {
|
|
2591
2591
|
namespace: keyPrefix,
|
|
2592
|
-
representationName: RepresentationType$
|
|
2592
|
+
representationName: RepresentationType$2,
|
|
2593
2593
|
mergeable: false
|
|
2594
2594
|
});
|
|
2595
2595
|
}
|
|
2596
2596
|
|
|
2597
|
-
function select$
|
|
2598
|
-
return select$
|
|
2597
|
+
function select$6(luvio, params) {
|
|
2598
|
+
return select$7();
|
|
2599
2599
|
}
|
|
2600
|
-
function getResponseCacheKeys$
|
|
2601
|
-
getTypeCacheKeys$
|
|
2600
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
2601
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response);
|
|
2602
2602
|
}
|
|
2603
|
-
function ingestSuccess$
|
|
2603
|
+
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
2604
2604
|
const { body } = response;
|
|
2605
2605
|
const key = keyBuilderFromType(luvio, body);
|
|
2606
|
-
luvio.storeIngest(key, ingest$
|
|
2606
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
2607
2607
|
const snapshot = luvio.storeLookup({
|
|
2608
2608
|
recordId: key,
|
|
2609
|
-
node: select$
|
|
2609
|
+
node: select$6(),
|
|
2610
2610
|
variables: {},
|
|
2611
2611
|
});
|
|
2612
2612
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2617,7 +2617,7 @@ function ingestSuccess$1(luvio, resourceParams, response) {
|
|
|
2617
2617
|
deepFreeze(snapshot.data);
|
|
2618
2618
|
return snapshot;
|
|
2619
2619
|
}
|
|
2620
|
-
function createResourceRequest$
|
|
2620
|
+
function createResourceRequest$2(config) {
|
|
2621
2621
|
const headers = {};
|
|
2622
2622
|
return {
|
|
2623
2623
|
baseUri: '/services/data/v63.0',
|
|
@@ -2631,48 +2631,48 @@ function createResourceRequest$1(config) {
|
|
|
2631
2631
|
};
|
|
2632
2632
|
}
|
|
2633
2633
|
|
|
2634
|
-
const adapterName$
|
|
2634
|
+
const adapterName$2 = 'createGenerationsForPromptTemplate';
|
|
2635
2635
|
const createGenerationsForPromptTemplate_ConfigPropertyMetadata = [
|
|
2636
2636
|
generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2637
2637
|
generateParamConfigMetadata('versionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2638
2638
|
generateParamConfigMetadata('promptTemplateGenerationsInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
2639
2639
|
];
|
|
2640
|
-
const createGenerationsForPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
2641
|
-
const createResourceParams$
|
|
2642
|
-
function typeCheckConfig$
|
|
2640
|
+
const createGenerationsForPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
|
|
2641
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$6(createGenerationsForPromptTemplate_ConfigPropertyMetadata);
|
|
2642
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
2643
2643
|
const config = {};
|
|
2644
|
-
typeCheckConfig$
|
|
2644
|
+
typeCheckConfig$6(untrustedConfig, config, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
|
|
2645
2645
|
const untrustedConfig_promptTemplateGenerationsInput = untrustedConfig.promptTemplateGenerationsInput;
|
|
2646
|
-
const referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError = validate$
|
|
2646
|
+
const referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError = validate$b(untrustedConfig_promptTemplateGenerationsInput);
|
|
2647
2647
|
if (referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError === null) {
|
|
2648
2648
|
config.promptTemplateGenerationsInput = untrustedConfig_promptTemplateGenerationsInput;
|
|
2649
2649
|
}
|
|
2650
2650
|
return config;
|
|
2651
2651
|
}
|
|
2652
|
-
function validateAdapterConfig$
|
|
2652
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
2653
2653
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
2654
2654
|
return null;
|
|
2655
2655
|
}
|
|
2656
2656
|
if (process.env.NODE_ENV !== 'production') {
|
|
2657
2657
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
2658
2658
|
}
|
|
2659
|
-
const config = typeCheckConfig$
|
|
2659
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
2660
2660
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2661
2661
|
return null;
|
|
2662
2662
|
}
|
|
2663
2663
|
return config;
|
|
2664
2664
|
}
|
|
2665
|
-
function buildNetworkSnapshot$
|
|
2666
|
-
const resourceParams = createResourceParams$
|
|
2667
|
-
const request = createResourceRequest$
|
|
2665
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
2666
|
+
const resourceParams = createResourceParams$2(config);
|
|
2667
|
+
const request = createResourceRequest$2(resourceParams);
|
|
2668
2668
|
return luvio.dispatchResourceRequest(request, options)
|
|
2669
2669
|
.then((response) => {
|
|
2670
2670
|
return luvio.handleSuccessResponse(() => {
|
|
2671
|
-
const snapshot = ingestSuccess$
|
|
2671
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
2672
2672
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
2673
2673
|
}, () => {
|
|
2674
2674
|
const cache = new StoreKeyMap();
|
|
2675
|
-
getResponseCacheKeys$
|
|
2675
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
2676
2676
|
return cache;
|
|
2677
2677
|
});
|
|
2678
2678
|
}, (response) => {
|
|
@@ -2682,14 +2682,408 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
2682
2682
|
}
|
|
2683
2683
|
const createGenerationsForPromptTemplateAdapterFactory = (luvio) => {
|
|
2684
2684
|
return function createGenerationsForPromptTemplate(untrustedConfig) {
|
|
2685
|
-
const config = validateAdapterConfig$
|
|
2685
|
+
const config = validateAdapterConfig$2(untrustedConfig, createGenerationsForPromptTemplate_ConfigPropertyNames);
|
|
2686
2686
|
// Invalid or incomplete config
|
|
2687
2687
|
if (config === null) {
|
|
2688
2688
|
throw new Error('Invalid config for "createGenerationsForPromptTemplate"');
|
|
2689
2689
|
}
|
|
2690
|
-
return buildNetworkSnapshot$
|
|
2690
|
+
return buildNetworkSnapshot$2(luvio, config);
|
|
2691
|
+
};
|
|
2692
|
+
};
|
|
2693
|
+
|
|
2694
|
+
const VERSION$3 = "b513bbac1672327d8eaaf120660e94b5";
|
|
2695
|
+
function validate$5(obj, path = 'EinsteinPromptTemplateSupportedLanguageErrorRepresentation') {
|
|
2696
|
+
const v_error = (() => {
|
|
2697
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2698
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2699
|
+
}
|
|
2700
|
+
const obj_errorMessage = obj.errorMessage;
|
|
2701
|
+
const path_errorMessage = path + '.errorMessage';
|
|
2702
|
+
if (typeof obj_errorMessage !== 'string') {
|
|
2703
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
|
|
2704
|
+
}
|
|
2705
|
+
const obj_messageCode = obj.messageCode;
|
|
2706
|
+
const path_messageCode = path + '.messageCode';
|
|
2707
|
+
if (typeof obj_messageCode !== 'string') {
|
|
2708
|
+
return new TypeError('Expected "string" but received "' + typeof obj_messageCode + '" (at "' + path_messageCode + '")');
|
|
2709
|
+
}
|
|
2710
|
+
})();
|
|
2711
|
+
return v_error === undefined ? null : v_error;
|
|
2712
|
+
}
|
|
2713
|
+
const select$5 = function EinsteinPromptTemplateSupportedLanguageErrorRepresentationSelect() {
|
|
2714
|
+
return {
|
|
2715
|
+
kind: 'Fragment',
|
|
2716
|
+
version: VERSION$3,
|
|
2717
|
+
private: [],
|
|
2718
|
+
selections: [
|
|
2719
|
+
{
|
|
2720
|
+
name: 'errorMessage',
|
|
2721
|
+
kind: 'Scalar'
|
|
2722
|
+
},
|
|
2723
|
+
{
|
|
2724
|
+
name: 'messageCode',
|
|
2725
|
+
kind: 'Scalar'
|
|
2726
|
+
}
|
|
2727
|
+
]
|
|
2728
|
+
};
|
|
2729
|
+
};
|
|
2730
|
+
function equals$3(existing, incoming) {
|
|
2731
|
+
const existing_errorMessage = existing.errorMessage;
|
|
2732
|
+
const incoming_errorMessage = incoming.errorMessage;
|
|
2733
|
+
if (!(existing_errorMessage === incoming_errorMessage)) {
|
|
2734
|
+
return false;
|
|
2735
|
+
}
|
|
2736
|
+
const existing_messageCode = existing.messageCode;
|
|
2737
|
+
const incoming_messageCode = incoming.messageCode;
|
|
2738
|
+
if (!(existing_messageCode === incoming_messageCode)) {
|
|
2739
|
+
return false;
|
|
2740
|
+
}
|
|
2741
|
+
return true;
|
|
2742
|
+
}
|
|
2743
|
+
|
|
2744
|
+
const VERSION$2 = "65a17d345c28eeca91872a73d8ffe9fd";
|
|
2745
|
+
function validate$4(obj, path = 'EinsteinPromptTemplateSupportedLanguageRepresentation') {
|
|
2746
|
+
const v_error = (() => {
|
|
2747
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2748
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2749
|
+
}
|
|
2750
|
+
const obj_languageCode = obj.languageCode;
|
|
2751
|
+
const path_languageCode = path + '.languageCode';
|
|
2752
|
+
if (typeof obj_languageCode !== 'string') {
|
|
2753
|
+
return new TypeError('Expected "string" but received "' + typeof obj_languageCode + '" (at "' + path_languageCode + '")');
|
|
2754
|
+
}
|
|
2755
|
+
const obj_languageDisplayName = obj.languageDisplayName;
|
|
2756
|
+
const path_languageDisplayName = path + '.languageDisplayName';
|
|
2757
|
+
if (typeof obj_languageDisplayName !== 'string') {
|
|
2758
|
+
return new TypeError('Expected "string" but received "' + typeof obj_languageDisplayName + '" (at "' + path_languageDisplayName + '")');
|
|
2759
|
+
}
|
|
2760
|
+
})();
|
|
2761
|
+
return v_error === undefined ? null : v_error;
|
|
2762
|
+
}
|
|
2763
|
+
const select$4 = function EinsteinPromptTemplateSupportedLanguageRepresentationSelect() {
|
|
2764
|
+
return {
|
|
2765
|
+
kind: 'Fragment',
|
|
2766
|
+
version: VERSION$2,
|
|
2767
|
+
private: [],
|
|
2768
|
+
selections: [
|
|
2769
|
+
{
|
|
2770
|
+
name: 'languageCode',
|
|
2771
|
+
kind: 'Scalar'
|
|
2772
|
+
},
|
|
2773
|
+
{
|
|
2774
|
+
name: 'languageDisplayName',
|
|
2775
|
+
kind: 'Scalar'
|
|
2776
|
+
}
|
|
2777
|
+
]
|
|
2691
2778
|
};
|
|
2692
2779
|
};
|
|
2780
|
+
function equals$2(existing, incoming) {
|
|
2781
|
+
const existing_languageCode = existing.languageCode;
|
|
2782
|
+
const incoming_languageCode = incoming.languageCode;
|
|
2783
|
+
if (!(existing_languageCode === incoming_languageCode)) {
|
|
2784
|
+
return false;
|
|
2785
|
+
}
|
|
2786
|
+
const existing_languageDisplayName = existing.languageDisplayName;
|
|
2787
|
+
const incoming_languageDisplayName = incoming.languageDisplayName;
|
|
2788
|
+
if (!(existing_languageDisplayName === incoming_languageDisplayName)) {
|
|
2789
|
+
return false;
|
|
2790
|
+
}
|
|
2791
|
+
return true;
|
|
2792
|
+
}
|
|
2793
|
+
|
|
2794
|
+
const TTL$1 = 100;
|
|
2795
|
+
const VERSION$1 = "c635f260bce9a11f7c3bf31d60f42b53";
|
|
2796
|
+
function validate$3(obj, path = 'EinsteinPromptTemplateVersionOutputLanguagesRepresentation') {
|
|
2797
|
+
const v_error = (() => {
|
|
2798
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2799
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2800
|
+
}
|
|
2801
|
+
const obj_errors = obj.errors;
|
|
2802
|
+
const path_errors = path + '.errors';
|
|
2803
|
+
if (!ArrayIsArray(obj_errors)) {
|
|
2804
|
+
return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
|
|
2805
|
+
}
|
|
2806
|
+
for (let i = 0; i < obj_errors.length; i++) {
|
|
2807
|
+
const obj_errors_item = obj_errors[i];
|
|
2808
|
+
const path_errors_item = path_errors + '[' + i + ']';
|
|
2809
|
+
const referencepath_errors_itemValidationError = validate$5(obj_errors_item, path_errors_item);
|
|
2810
|
+
if (referencepath_errors_itemValidationError !== null) {
|
|
2811
|
+
let message = 'Object doesn\'t match EinsteinPromptTemplateSupportedLanguageErrorRepresentation (at "' + path_errors_item + '")\n';
|
|
2812
|
+
message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2813
|
+
return new TypeError(message);
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
2816
|
+
const obj_isSuccess = obj.isSuccess;
|
|
2817
|
+
const path_isSuccess = path + '.isSuccess';
|
|
2818
|
+
if (typeof obj_isSuccess !== 'boolean') {
|
|
2819
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
|
|
2820
|
+
}
|
|
2821
|
+
const obj_promptTemplateDevName = obj.promptTemplateDevName;
|
|
2822
|
+
const path_promptTemplateDevName = path + '.promptTemplateDevName';
|
|
2823
|
+
if (typeof obj_promptTemplateDevName !== 'string') {
|
|
2824
|
+
return new TypeError('Expected "string" but received "' + typeof obj_promptTemplateDevName + '" (at "' + path_promptTemplateDevName + '")');
|
|
2825
|
+
}
|
|
2826
|
+
const obj_supportedLanguages = obj.supportedLanguages;
|
|
2827
|
+
const path_supportedLanguages = path + '.supportedLanguages';
|
|
2828
|
+
if (!ArrayIsArray(obj_supportedLanguages)) {
|
|
2829
|
+
return new TypeError('Expected "array" but received "' + typeof obj_supportedLanguages + '" (at "' + path_supportedLanguages + '")');
|
|
2830
|
+
}
|
|
2831
|
+
for (let i = 0; i < obj_supportedLanguages.length; i++) {
|
|
2832
|
+
const obj_supportedLanguages_item = obj_supportedLanguages[i];
|
|
2833
|
+
const path_supportedLanguages_item = path_supportedLanguages + '[' + i + ']';
|
|
2834
|
+
const referencepath_supportedLanguages_itemValidationError = validate$4(obj_supportedLanguages_item, path_supportedLanguages_item);
|
|
2835
|
+
if (referencepath_supportedLanguages_itemValidationError !== null) {
|
|
2836
|
+
let message = 'Object doesn\'t match EinsteinPromptTemplateSupportedLanguageRepresentation (at "' + path_supportedLanguages_item + '")\n';
|
|
2837
|
+
message += referencepath_supportedLanguages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2838
|
+
return new TypeError(message);
|
|
2839
|
+
}
|
|
2840
|
+
}
|
|
2841
|
+
const obj_versionId = obj.versionId;
|
|
2842
|
+
const path_versionId = path + '.versionId';
|
|
2843
|
+
if (typeof obj_versionId !== 'string') {
|
|
2844
|
+
return new TypeError('Expected "string" but received "' + typeof obj_versionId + '" (at "' + path_versionId + '")');
|
|
2845
|
+
}
|
|
2846
|
+
})();
|
|
2847
|
+
return v_error === undefined ? null : v_error;
|
|
2848
|
+
}
|
|
2849
|
+
const RepresentationType$1 = 'EinsteinPromptTemplateVersionOutputLanguagesRepresentation';
|
|
2850
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
2851
|
+
return input;
|
|
2852
|
+
}
|
|
2853
|
+
const select$3 = function EinsteinPromptTemplateVersionOutputLanguagesRepresentationSelect() {
|
|
2854
|
+
const { selections: EinsteinPromptTemplateSupportedLanguageErrorRepresentation__selections, opaque: EinsteinPromptTemplateSupportedLanguageErrorRepresentation__opaque, } = select$5();
|
|
2855
|
+
const { selections: EinsteinPromptTemplateSupportedLanguageRepresentation__selections, opaque: EinsteinPromptTemplateSupportedLanguageRepresentation__opaque, } = select$4();
|
|
2856
|
+
return {
|
|
2857
|
+
kind: 'Fragment',
|
|
2858
|
+
version: VERSION$1,
|
|
2859
|
+
private: [],
|
|
2860
|
+
selections: [
|
|
2861
|
+
{
|
|
2862
|
+
name: 'errors',
|
|
2863
|
+
kind: 'Object',
|
|
2864
|
+
plural: true,
|
|
2865
|
+
selections: EinsteinPromptTemplateSupportedLanguageErrorRepresentation__selections
|
|
2866
|
+
},
|
|
2867
|
+
{
|
|
2868
|
+
name: 'isSuccess',
|
|
2869
|
+
kind: 'Scalar'
|
|
2870
|
+
},
|
|
2871
|
+
{
|
|
2872
|
+
name: 'promptTemplateDevName',
|
|
2873
|
+
kind: 'Scalar'
|
|
2874
|
+
},
|
|
2875
|
+
{
|
|
2876
|
+
name: 'supportedLanguages',
|
|
2877
|
+
kind: 'Object',
|
|
2878
|
+
plural: true,
|
|
2879
|
+
selections: EinsteinPromptTemplateSupportedLanguageRepresentation__selections
|
|
2880
|
+
},
|
|
2881
|
+
{
|
|
2882
|
+
name: 'versionId',
|
|
2883
|
+
kind: 'Scalar'
|
|
2884
|
+
}
|
|
2885
|
+
]
|
|
2886
|
+
};
|
|
2887
|
+
};
|
|
2888
|
+
function equals$1(existing, incoming) {
|
|
2889
|
+
const existing_isSuccess = existing.isSuccess;
|
|
2890
|
+
const incoming_isSuccess = incoming.isSuccess;
|
|
2891
|
+
if (!(existing_isSuccess === incoming_isSuccess)) {
|
|
2892
|
+
return false;
|
|
2893
|
+
}
|
|
2894
|
+
const existing_promptTemplateDevName = existing.promptTemplateDevName;
|
|
2895
|
+
const incoming_promptTemplateDevName = incoming.promptTemplateDevName;
|
|
2896
|
+
if (!(existing_promptTemplateDevName === incoming_promptTemplateDevName)) {
|
|
2897
|
+
return false;
|
|
2898
|
+
}
|
|
2899
|
+
const existing_versionId = existing.versionId;
|
|
2900
|
+
const incoming_versionId = incoming.versionId;
|
|
2901
|
+
if (!(existing_versionId === incoming_versionId)) {
|
|
2902
|
+
return false;
|
|
2903
|
+
}
|
|
2904
|
+
const existing_errors = existing.errors;
|
|
2905
|
+
const incoming_errors = incoming.errors;
|
|
2906
|
+
const equals_errors_items = equalsArray(existing_errors, incoming_errors, (existing_errors_item, incoming_errors_item) => {
|
|
2907
|
+
if (!(equals$3(existing_errors_item, incoming_errors_item))) {
|
|
2908
|
+
return false;
|
|
2909
|
+
}
|
|
2910
|
+
});
|
|
2911
|
+
if (equals_errors_items === false) {
|
|
2912
|
+
return false;
|
|
2913
|
+
}
|
|
2914
|
+
const existing_supportedLanguages = existing.supportedLanguages;
|
|
2915
|
+
const incoming_supportedLanguages = incoming.supportedLanguages;
|
|
2916
|
+
const equals_supportedLanguages_items = equalsArray(existing_supportedLanguages, incoming_supportedLanguages, (existing_supportedLanguages_item, incoming_supportedLanguages_item) => {
|
|
2917
|
+
if (!(equals$2(existing_supportedLanguages_item, incoming_supportedLanguages_item))) {
|
|
2918
|
+
return false;
|
|
2919
|
+
}
|
|
2920
|
+
});
|
|
2921
|
+
if (equals_supportedLanguages_items === false) {
|
|
2922
|
+
return false;
|
|
2923
|
+
}
|
|
2924
|
+
return true;
|
|
2925
|
+
}
|
|
2926
|
+
const ingest$1 = function EinsteinPromptTemplateVersionOutputLanguagesRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2927
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2928
|
+
const validateError = validate$3(input);
|
|
2929
|
+
if (validateError !== null) {
|
|
2930
|
+
throw validateError;
|
|
2931
|
+
}
|
|
2932
|
+
}
|
|
2933
|
+
const key = path.fullPath;
|
|
2934
|
+
const ttlToUse = TTL$1;
|
|
2935
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "EinsteinLLM", VERSION$1, RepresentationType$1, equals$1);
|
|
2936
|
+
return createLink(key);
|
|
2937
|
+
};
|
|
2938
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
2939
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2940
|
+
const rootKey = fullPathFactory();
|
|
2941
|
+
rootKeySet.set(rootKey, {
|
|
2942
|
+
namespace: keyPrefix,
|
|
2943
|
+
representationName: RepresentationType$1,
|
|
2944
|
+
mergeable: false
|
|
2945
|
+
});
|
|
2946
|
+
}
|
|
2947
|
+
|
|
2948
|
+
function select$2(luvio, params) {
|
|
2949
|
+
return select$3();
|
|
2950
|
+
}
|
|
2951
|
+
function keyBuilder$3(luvio, params) {
|
|
2952
|
+
return keyPrefix + '::EinsteinPromptTemplateVersionOutputLanguagesRepresentation:(' + 'useStandardVersion:' + params.queryParams.useStandardVersion + ',' + 'versionId:' + params.queryParams.versionId + ',' + 'promptTemplateDevName:' + params.urlParams.promptTemplateDevName + ')';
|
|
2953
|
+
}
|
|
2954
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
2955
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
|
|
2956
|
+
}
|
|
2957
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
2958
|
+
const { body } = response;
|
|
2959
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
2960
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
2961
|
+
const snapshot = luvio.storeLookup({
|
|
2962
|
+
recordId: key,
|
|
2963
|
+
node: select$2(),
|
|
2964
|
+
variables: {},
|
|
2965
|
+
}, snapshotRefresh);
|
|
2966
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2967
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2968
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2969
|
+
}
|
|
2970
|
+
}
|
|
2971
|
+
deepFreeze(snapshot.data);
|
|
2972
|
+
return snapshot;
|
|
2973
|
+
}
|
|
2974
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
2975
|
+
const key = keyBuilder$3(luvio, params);
|
|
2976
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2977
|
+
const storeMetadataParams = {
|
|
2978
|
+
ttl: TTL$1,
|
|
2979
|
+
namespace: keyPrefix,
|
|
2980
|
+
version: VERSION$1,
|
|
2981
|
+
representationName: RepresentationType$1
|
|
2982
|
+
};
|
|
2983
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2984
|
+
return errorSnapshot;
|
|
2985
|
+
}
|
|
2986
|
+
function createResourceRequest$1(config) {
|
|
2987
|
+
const headers = {};
|
|
2988
|
+
return {
|
|
2989
|
+
baseUri: '/services/data/v63.0',
|
|
2990
|
+
basePath: '/einstein/prompt-template/' + config.urlParams.promptTemplateDevName + '/output-languages',
|
|
2991
|
+
method: 'get',
|
|
2992
|
+
body: null,
|
|
2993
|
+
urlParams: config.urlParams,
|
|
2994
|
+
queryParams: config.queryParams,
|
|
2995
|
+
headers,
|
|
2996
|
+
priority: 'normal',
|
|
2997
|
+
};
|
|
2998
|
+
}
|
|
2999
|
+
|
|
3000
|
+
const adapterName$1 = 'getOutputLanguages';
|
|
3001
|
+
const getOutputLanguages_ConfigPropertyMetadata = [
|
|
3002
|
+
generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
3003
|
+
generateParamConfigMetadata('useStandardVersion', false, 1 /* QueryParameter */, 1 /* Boolean */),
|
|
3004
|
+
generateParamConfigMetadata('versionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
3005
|
+
];
|
|
3006
|
+
const getOutputLanguages_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getOutputLanguages_ConfigPropertyMetadata);
|
|
3007
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$6(getOutputLanguages_ConfigPropertyMetadata);
|
|
3008
|
+
function keyBuilder$2(luvio, config) {
|
|
3009
|
+
const resourceParams = createResourceParams$1(config);
|
|
3010
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
3011
|
+
}
|
|
3012
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
3013
|
+
const config = {};
|
|
3014
|
+
typeCheckConfig$6(untrustedConfig, config, getOutputLanguages_ConfigPropertyMetadata);
|
|
3015
|
+
return config;
|
|
3016
|
+
}
|
|
3017
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
3018
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3019
|
+
return null;
|
|
3020
|
+
}
|
|
3021
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3022
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3023
|
+
}
|
|
3024
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
3025
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3026
|
+
return null;
|
|
3027
|
+
}
|
|
3028
|
+
return config;
|
|
3029
|
+
}
|
|
3030
|
+
function adapterFragment$1(luvio, config) {
|
|
3031
|
+
createResourceParams$1(config);
|
|
3032
|
+
return select$2();
|
|
3033
|
+
}
|
|
3034
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
3035
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
3036
|
+
config,
|
|
3037
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
3038
|
+
});
|
|
3039
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3040
|
+
}
|
|
3041
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
3042
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
3043
|
+
config,
|
|
3044
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
3045
|
+
});
|
|
3046
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3047
|
+
}
|
|
3048
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
3049
|
+
const resourceParams = createResourceParams$1(config);
|
|
3050
|
+
const request = createResourceRequest$1(resourceParams);
|
|
3051
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3052
|
+
.then((response) => {
|
|
3053
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
3054
|
+
const cache = new StoreKeyMap();
|
|
3055
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
3056
|
+
return cache;
|
|
3057
|
+
});
|
|
3058
|
+
}, (response) => {
|
|
3059
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
3060
|
+
});
|
|
3061
|
+
}
|
|
3062
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
3063
|
+
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
3064
|
+
}
|
|
3065
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
3066
|
+
const { luvio, config } = context;
|
|
3067
|
+
const selector = {
|
|
3068
|
+
recordId: keyBuilder$2(luvio, config),
|
|
3069
|
+
node: adapterFragment$1(luvio, config),
|
|
3070
|
+
variables: {},
|
|
3071
|
+
};
|
|
3072
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
3073
|
+
config,
|
|
3074
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
3075
|
+
});
|
|
3076
|
+
return cacheSnapshot;
|
|
3077
|
+
}
|
|
3078
|
+
const getOutputLanguagesAdapterFactory = (luvio) => function EinsteinLLM__getOutputLanguages(untrustedConfig, requestContext) {
|
|
3079
|
+
const config = validateAdapterConfig$1(untrustedConfig, getOutputLanguages_ConfigPropertyNames);
|
|
3080
|
+
// Invalid or incomplete config
|
|
3081
|
+
if (config === null) {
|
|
3082
|
+
return null;
|
|
3083
|
+
}
|
|
3084
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
3085
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
3086
|
+
};
|
|
2693
3087
|
|
|
2694
3088
|
function validate$2(obj, path = 'EinsteinPromptRecordFieldRepresentation') {
|
|
2695
3089
|
const v_error = (() => {
|
|
@@ -2953,14 +3347,14 @@ const getPromptTemplates_ConfigPropertyMetadata = [
|
|
|
2953
3347
|
generateParamConfigMetadata('sortBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2954
3348
|
];
|
|
2955
3349
|
const getPromptTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getPromptTemplates_ConfigPropertyMetadata);
|
|
2956
|
-
const createResourceParams = /*#__PURE__*/ createResourceParams$
|
|
3350
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$6(getPromptTemplates_ConfigPropertyMetadata);
|
|
2957
3351
|
function keyBuilder(luvio, config) {
|
|
2958
3352
|
const resourceParams = createResourceParams(config);
|
|
2959
3353
|
return keyBuilder$1(luvio, resourceParams);
|
|
2960
3354
|
}
|
|
2961
3355
|
function typeCheckConfig(untrustedConfig) {
|
|
2962
3356
|
const config = {};
|
|
2963
|
-
typeCheckConfig$
|
|
3357
|
+
typeCheckConfig$6(untrustedConfig, config, getPromptTemplates_ConfigPropertyMetadata);
|
|
2964
3358
|
return config;
|
|
2965
3359
|
}
|
|
2966
3360
|
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
@@ -3009,7 +3403,7 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
3009
3403
|
});
|
|
3010
3404
|
}
|
|
3011
3405
|
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
3012
|
-
return buildNetworkSnapshotCachePolicy$
|
|
3406
|
+
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
3013
3407
|
}
|
|
3014
3408
|
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
3015
3409
|
const { luvio, config } = context;
|
|
@@ -3038,12 +3432,19 @@ let createEmbeddings;
|
|
|
3038
3432
|
let createFeedback;
|
|
3039
3433
|
let createGenerations;
|
|
3040
3434
|
let createGenerationsForPromptTemplate;
|
|
3435
|
+
let getOutputLanguages;
|
|
3041
3436
|
let getPromptTemplates;
|
|
3042
3437
|
// Imperative GET Adapters
|
|
3043
3438
|
let createEmbeddings_imperative;
|
|
3439
|
+
let getOutputLanguages_imperative;
|
|
3044
3440
|
let getPromptTemplates_imperative;
|
|
3045
3441
|
// Adapter Metadata
|
|
3046
3442
|
const createEmbeddingsMetadata = { apiFamily: 'EinsteinLLM', name: 'createEmbeddings', ttl: 100 };
|
|
3443
|
+
const getOutputLanguagesMetadata = {
|
|
3444
|
+
apiFamily: 'EinsteinLLM',
|
|
3445
|
+
name: 'getOutputLanguages',
|
|
3446
|
+
ttl: 100,
|
|
3447
|
+
};
|
|
3047
3448
|
const getPromptTemplatesMetadata = {
|
|
3048
3449
|
apiFamily: 'EinsteinLLM',
|
|
3049
3450
|
name: 'getPromptTemplates',
|
|
@@ -3053,6 +3454,7 @@ const getPromptTemplatesMetadata = {
|
|
|
3053
3454
|
function bindExportsTo(luvio) {
|
|
3054
3455
|
// LDS Adapters
|
|
3055
3456
|
const createEmbeddings_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'createEmbeddings', createEmbeddingsAdapterFactory), createEmbeddingsMetadata);
|
|
3457
|
+
const getOutputLanguages_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getOutputLanguages', getOutputLanguagesAdapterFactory), getOutputLanguagesMetadata);
|
|
3056
3458
|
const getPromptTemplates_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getPromptTemplates', getPromptTemplatesAdapterFactory), getPromptTemplatesMetadata);
|
|
3057
3459
|
function unwrapSnapshotData(factory) {
|
|
3058
3460
|
const adapter = factory(luvio);
|
|
@@ -3063,9 +3465,11 @@ function bindExportsTo(luvio) {
|
|
|
3063
3465
|
createFeedback: unwrapSnapshotData(createFeedbackAdapterFactory),
|
|
3064
3466
|
createGenerations: unwrapSnapshotData(createGenerationsAdapterFactory),
|
|
3065
3467
|
createGenerationsForPromptTemplate: unwrapSnapshotData(createGenerationsForPromptTemplateAdapterFactory),
|
|
3468
|
+
getOutputLanguages: createWireAdapterConstructor(luvio, getOutputLanguages_ldsAdapter, getOutputLanguagesMetadata),
|
|
3066
3469
|
getPromptTemplates: createWireAdapterConstructor(luvio, getPromptTemplates_ldsAdapter, getPromptTemplatesMetadata),
|
|
3067
3470
|
// Imperative GET Adapters
|
|
3068
3471
|
createEmbeddings_imperative: createImperativeAdapter(luvio, createEmbeddings_ldsAdapter, createEmbeddingsMetadata),
|
|
3472
|
+
getOutputLanguages_imperative: createImperativeAdapter(luvio, getOutputLanguages_ldsAdapter, getOutputLanguagesMetadata),
|
|
3069
3473
|
getPromptTemplates_imperative: createImperativeAdapter(luvio, getPromptTemplates_ldsAdapter, getPromptTemplatesMetadata),
|
|
3070
3474
|
// Notify Update Availables
|
|
3071
3475
|
};
|
|
@@ -3076,11 +3480,13 @@ withDefaultLuvio((luvio) => {
|
|
|
3076
3480
|
createFeedback,
|
|
3077
3481
|
createGenerations,
|
|
3078
3482
|
createGenerationsForPromptTemplate,
|
|
3483
|
+
getOutputLanguages,
|
|
3079
3484
|
getPromptTemplates,
|
|
3080
3485
|
createEmbeddings_imperative,
|
|
3486
|
+
getOutputLanguages_imperative,
|
|
3081
3487
|
getPromptTemplates_imperative,
|
|
3082
3488
|
} = bindExportsTo(luvio));
|
|
3083
3489
|
});
|
|
3084
3490
|
|
|
3085
|
-
export { createEmbeddings, createEmbeddings_imperative, createFeedback, createGenerations, createGenerationsForPromptTemplate, getPromptTemplates, getPromptTemplates_imperative };
|
|
3086
|
-
// version: 1.332.0-
|
|
3491
|
+
export { createEmbeddings, createEmbeddings_imperative, createFeedback, createGenerations, createGenerationsForPromptTemplate, getOutputLanguages, getOutputLanguages_imperative, getPromptTemplates, getPromptTemplates_imperative };
|
|
3492
|
+
// version: 1.332.0-dev7-84af9c7762
|