@salesforce/lds-adapters-service-einsteinllm 1.332.0-dev2 → 1.332.0-dev20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/es2018/service-einsteinllm.js +1071 -369
- package/dist/es/es2018/types/src/generated/adapters/getOutputLanguages.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/adapters/getPromptTemplate.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +2 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +5 -1
- package/dist/es/es2018/types/src/generated/resources/getEinsteinPromptTemplateOutputLanguagesByPromptTemplateDevName.d.ts +19 -0
- package/dist/es/es2018/types/src/generated/resources/getEinsteinPromptTemplatesByPromptTemplateDevName.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptRecordCollectionOutputRepresentation.d.ts +3 -3
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptRecordRepresentation.d.ts +6 -5
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateAttachmentRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateGenerationsRepresentation.d.ts +5 -1
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateSupportedLanguageErrorRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateSupportedLanguageRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateVersionOutputLanguagesRepresentation.d.ts +43 -0
- package/package.json +4 -4
- package/sfdc/index.js +1024 -302
- package/src/raml/api.raml +109 -2
- package/src/raml/luvio.raml +15 -0
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$4, StoreKeyMap, createResourceParams as createResourceParams$7, typeCheckConfig as typeCheckConfig$7 } 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$r(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$q(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$p(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$r(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$q(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$i = "5ed5ccc6fa6f15691ec0fc1080e41fe6";
|
|
279
|
+
function validate$o(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$p = function EinsteinLlmEmbeddingItemRepresentationSelect() {
|
|
301
301
|
return {
|
|
302
302
|
kind: 'Fragment',
|
|
303
|
-
version: VERSION$
|
|
303
|
+
version: VERSION$i,
|
|
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$i(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$6 = 100;
|
|
338
|
+
const VERSION$h = "d9873651f09d29764ef4d4231eb653d7";
|
|
339
|
+
function validate$n(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$o(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$6 = 'EinsteinLlmEmbeddingsRepresentation';
|
|
377
|
+
function normalize$6(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$o = function EinsteinLlmEmbeddingsRepresentationSelect() {
|
|
381
|
+
const { selections: EinsteinLlmEmbeddingItemRepresentation__selections, opaque: EinsteinLlmEmbeddingItemRepresentation__opaque, } = select$p();
|
|
382
382
|
return {
|
|
383
383
|
kind: 'Fragment',
|
|
384
|
-
version: VERSION$
|
|
384
|
+
version: VERSION$h,
|
|
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$h(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$i(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$6 = function EinsteinLlmEmbeddingsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
425
425
|
if (process.env.NODE_ENV !== 'production') {
|
|
426
|
-
const validateError = validate$
|
|
426
|
+
const validateError = validate$n(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$6;
|
|
433
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "EinsteinLLM", VERSION$h, RepresentationType$6, equals$h);
|
|
434
434
|
return createLink(key);
|
|
435
435
|
};
|
|
436
|
-
function getTypeCacheKeys$
|
|
436
|
+
function getTypeCacheKeys$6(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$6,
|
|
442
442
|
mergeable: false
|
|
443
443
|
});
|
|
444
444
|
}
|
|
445
445
|
|
|
446
|
-
function select$
|
|
447
|
-
return select$
|
|
446
|
+
function select$n(luvio, params) {
|
|
447
|
+
return select$o();
|
|
448
448
|
}
|
|
449
|
-
function keyBuilder$
|
|
449
|
+
function keyBuilder$a(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$6(storeKeyMap, luvio, resourceParams, response) {
|
|
453
|
+
getTypeCacheKeys$6(storeKeyMap, luvio, response, () => keyBuilder$a(luvio, resourceParams));
|
|
454
454
|
}
|
|
455
|
-
function ingestSuccess$
|
|
455
|
+
function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
|
|
456
456
|
const { body } = response;
|
|
457
|
-
const key = keyBuilder$
|
|
458
|
-
luvio.storeIngest(key, ingest$
|
|
457
|
+
const key = keyBuilder$a(luvio, resourceParams);
|
|
458
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
459
459
|
const snapshot = luvio.storeLookup({
|
|
460
460
|
recordId: key,
|
|
461
|
-
node: select$
|
|
461
|
+
node: select$n(),
|
|
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$3(luvio, params, error, snapshotRefresh) {
|
|
473
|
+
const key = keyBuilder$a(luvio, params);
|
|
474
474
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
475
475
|
const storeMetadataParams = {
|
|
476
|
-
ttl: TTL$
|
|
476
|
+
ttl: TTL$6,
|
|
477
477
|
namespace: keyPrefix,
|
|
478
|
-
version: VERSION$
|
|
479
|
-
representationName: RepresentationType$
|
|
478
|
+
version: VERSION$h,
|
|
479
|
+
representationName: RepresentationType$6
|
|
480
480
|
};
|
|
481
481
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
482
482
|
return errorSnapshot;
|
|
483
483
|
}
|
|
484
|
-
function createResourceRequest$
|
|
484
|
+
function createResourceRequest$6(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$6 = '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$6, createEmbeddings_ConfigPropertyMetadata);
|
|
503
|
+
const createResourceParams$6 = /*#__PURE__*/ createResourceParams$7(createEmbeddings_ConfigPropertyMetadata);
|
|
504
|
+
function keyBuilder$9(luvio, config) {
|
|
505
|
+
const resourceParams = createResourceParams$6(config);
|
|
506
|
+
return keyBuilder$a(luvio, resourceParams);
|
|
507
507
|
}
|
|
508
|
-
function typeCheckConfig$
|
|
508
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
509
509
|
const config = {};
|
|
510
510
|
const untrustedConfig_embeddingsInput = untrustedConfig.embeddingsInput;
|
|
511
|
-
const referenceEinsteinLlmEmbeddingsInputRepresentationValidationError = validate$
|
|
511
|
+
const referenceEinsteinLlmEmbeddingsInputRepresentationValidationError = validate$p(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$6(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$6(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$3(luvio, config) {
|
|
531
|
+
createResourceParams$6(config);
|
|
532
|
+
return select$n();
|
|
533
533
|
}
|
|
534
|
-
function onFetchResponseSuccess$
|
|
535
|
-
const snapshot = ingestSuccess$
|
|
534
|
+
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
535
|
+
const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
|
|
536
536
|
config,
|
|
537
|
-
resolve: () => buildNetworkSnapshot$
|
|
537
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
538
538
|
});
|
|
539
539
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
540
540
|
}
|
|
541
|
-
function onFetchResponseError$
|
|
542
|
-
const snapshot = ingestError$
|
|
541
|
+
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
542
|
+
const snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
543
543
|
config,
|
|
544
|
-
resolve: () => buildNetworkSnapshot$
|
|
544
|
+
resolve: () => buildNetworkSnapshot$6(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$6(luvio, config, options) {
|
|
549
|
+
const resourceParams = createResourceParams$6(config);
|
|
550
|
+
const request = createResourceRequest$6(resourceParams);
|
|
551
551
|
return luvio.dispatchResourceRequest(request, options)
|
|
552
552
|
.then((response) => {
|
|
553
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
553
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
|
|
554
554
|
const cache = new StoreKeyMap();
|
|
555
|
-
getResponseCacheKeys$
|
|
555
|
+
getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
|
|
556
556
|
return cache;
|
|
557
557
|
});
|
|
558
558
|
}, (response) => {
|
|
559
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
559
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
|
|
560
560
|
});
|
|
561
561
|
}
|
|
562
|
-
function buildNetworkSnapshotCachePolicy$
|
|
563
|
-
return buildNetworkSnapshotCachePolicy$
|
|
562
|
+
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
563
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, 'get', false);
|
|
564
564
|
}
|
|
565
|
-
function buildCachedSnapshotCachePolicy$
|
|
565
|
+
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
566
566
|
const { luvio, config } = context;
|
|
567
567
|
const selector = {
|
|
568
|
-
recordId: keyBuilder$
|
|
569
|
-
node: adapterFragment$
|
|
568
|
+
recordId: keyBuilder$9(luvio, config),
|
|
569
|
+
node: adapterFragment$3(luvio, config),
|
|
570
570
|
variables: {},
|
|
571
571
|
};
|
|
572
572
|
const cacheSnapshot = storeLookup(selector, {
|
|
573
573
|
config,
|
|
574
|
-
resolve: () => buildNetworkSnapshot$
|
|
574
|
+
resolve: () => buildNetworkSnapshot$6(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$6(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$3, buildNetworkSnapshotCachePolicy$3);
|
|
586
586
|
};
|
|
587
587
|
|
|
588
|
-
function validate$
|
|
588
|
+
function validate$m(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$5 = 100;
|
|
636
|
+
const VERSION$g = "4033328f65865dd5d80c68a7573a4522";
|
|
637
|
+
function validate$l(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$5 = 'EinsteinLlmFeedbackRepresentation';
|
|
651
|
+
function keyBuilder$8(luvio, config) {
|
|
652
|
+
return keyPrefix + '::' + RepresentationType$5 + ':' + 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$8(luvio, keyParams);
|
|
659
659
|
}
|
|
660
|
-
function normalize$
|
|
660
|
+
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
661
661
|
return input;
|
|
662
662
|
}
|
|
663
|
-
const select$
|
|
663
|
+
const select$m = function EinsteinLlmFeedbackRepresentationSelect() {
|
|
664
664
|
return {
|
|
665
665
|
kind: 'Fragment',
|
|
666
|
-
version: VERSION$
|
|
666
|
+
version: VERSION$g,
|
|
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$g(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$5 = function EinsteinLlmFeedbackRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
685
685
|
if (process.env.NODE_ENV !== 'production') {
|
|
686
|
-
const validateError = validate$
|
|
686
|
+
const validateError = validate$l(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$5;
|
|
693
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "EinsteinLLM", VERSION$g, RepresentationType$5, equals$g);
|
|
694
694
|
return createLink(key);
|
|
695
695
|
};
|
|
696
|
-
function getTypeCacheKeys$
|
|
696
|
+
function getTypeCacheKeys$5(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$5,
|
|
702
702
|
mergeable: false
|
|
703
703
|
});
|
|
704
704
|
}
|
|
705
705
|
|
|
706
|
-
function select$
|
|
707
|
-
return select$
|
|
706
|
+
function select$l(luvio, params) {
|
|
707
|
+
return select$m();
|
|
708
708
|
}
|
|
709
|
-
function getResponseCacheKeys$
|
|
710
|
-
getTypeCacheKeys$
|
|
709
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
710
|
+
getTypeCacheKeys$5(storeKeyMap, luvio, response);
|
|
711
711
|
}
|
|
712
|
-
function ingestSuccess$
|
|
712
|
+
function ingestSuccess$5(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$5, body);
|
|
716
716
|
const snapshot = luvio.storeLookup({
|
|
717
717
|
recordId: key,
|
|
718
|
-
node: select$
|
|
718
|
+
node: select$l(),
|
|
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$5(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$5 = '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$5, createFeedback_ConfigPropertyMetadata);
|
|
748
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$7(createFeedback_ConfigPropertyMetadata);
|
|
749
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
750
750
|
const config = {};
|
|
751
751
|
const untrustedConfig_feedbackInput = untrustedConfig.feedbackInput;
|
|
752
|
-
const referenceEinsteinLlmFeedbackInputRepresentationValidationError = validate$
|
|
752
|
+
const referenceEinsteinLlmFeedbackInputRepresentationValidationError = validate$m(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$5(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$5(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$5(luvio, config, options) {
|
|
772
|
+
const resourceParams = createResourceParams$5(config);
|
|
773
|
+
const request = createResourceRequest$5(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$5(luvio, resourceParams, response);
|
|
778
778
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
779
779
|
}, () => {
|
|
780
780
|
const cache = new StoreKeyMap();
|
|
781
|
-
getResponseCacheKeys$
|
|
781
|
+
getResponseCacheKeys$5(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$5(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$5(luvio, config);
|
|
797
797
|
};
|
|
798
798
|
};
|
|
799
799
|
|
|
800
|
-
function validate$
|
|
800
|
+
function validate$k(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$j(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$k(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$f = "9ebac74e6f964c363d5fd1913df363af";
|
|
915
|
+
function validate$i(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$k = function EinsteinLlmGenerationsContentQualityRepresentationSelect() {
|
|
952
952
|
return {
|
|
953
953
|
kind: 'Fragment',
|
|
954
|
-
version: VERSION$
|
|
954
|
+
version: VERSION$f,
|
|
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$f(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$e = "77af44a252cb5b45b4d9a8101368d2aa";
|
|
983
|
+
function validate$h(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$j = function EinsteinLlmGenerationsSafetyScoreRepresentationSelect() {
|
|
1188
1188
|
return {
|
|
1189
1189
|
kind: 'Fragment',
|
|
1190
|
-
version: VERSION$
|
|
1190
|
+
version: VERSION$e,
|
|
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$e(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$d = "4a07778ff6c595d91c575188146647a1";
|
|
1327
|
+
function validate$g(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$i(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$h(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$i = function EinsteinLlmGenerationItemRepresentationSelect() {
|
|
1420
|
+
const { selections: EinsteinLlmGenerationsContentQualityRepresentation__selections, opaque: EinsteinLlmGenerationsContentQualityRepresentation__opaque, } = select$k();
|
|
1421
|
+
const { selections: EinsteinLlmGenerationsSafetyScoreRepresentation__selections, opaque: EinsteinLlmGenerationsSafetyScoreRepresentation__opaque, } = select$j();
|
|
1422
1422
|
return {
|
|
1423
1423
|
kind: 'Fragment',
|
|
1424
|
-
version: VERSION$
|
|
1424
|
+
version: VERSION$d,
|
|
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$d(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$f(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$e(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$c = "4656c961c9d093a9e206c1db7d4de0b0";
|
|
1526
|
+
function validate$f(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$h = function WrappedMapSelect() {
|
|
1549
1549
|
return {
|
|
1550
1550
|
kind: 'Fragment',
|
|
1551
|
-
version: VERSION$
|
|
1551
|
+
version: VERSION$c,
|
|
1552
1552
|
private: [],
|
|
1553
1553
|
selections: []
|
|
1554
1554
|
};
|
|
1555
1555
|
};
|
|
1556
|
-
function equals$
|
|
1556
|
+
function equals$c(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$4 = 100;
|
|
1568
|
+
const VERSION$b = "d8abd72a42e842b253da1c38954dafbc";
|
|
1569
|
+
function validate$e(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$g(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$f(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$4 = 'EinsteinLlmGenerationsRepresentation';
|
|
1653
|
+
function keyBuilder$7(luvio, config) {
|
|
1654
|
+
return keyPrefix + '::' + RepresentationType$4 + ':' + 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$7(luvio, keyParams);
|
|
1661
1661
|
}
|
|
1662
|
-
function normalize$
|
|
1662
|
+
function normalize$4(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$g = function EinsteinLlmGenerationsRepresentationSelect() {
|
|
1666
|
+
const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$i();
|
|
1667
|
+
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$h();
|
|
1668
1668
|
return {
|
|
1669
1669
|
kind: 'Fragment',
|
|
1670
|
-
version: VERSION$
|
|
1670
|
+
version: VERSION$b,
|
|
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$b(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$d(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$c(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$4 = function EinsteinLlmGenerationsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1728
1728
|
if (process.env.NODE_ENV !== 'production') {
|
|
1729
|
-
const validateError = validate$
|
|
1729
|
+
const validateError = validate$e(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$4;
|
|
1736
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "EinsteinLLM", VERSION$b, RepresentationType$4, equals$b);
|
|
1737
1737
|
return createLink(key);
|
|
1738
1738
|
};
|
|
1739
|
-
function getTypeCacheKeys$
|
|
1739
|
+
function getTypeCacheKeys$4(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$4,
|
|
1745
1745
|
mergeable: false
|
|
1746
1746
|
});
|
|
1747
1747
|
}
|
|
1748
1748
|
|
|
1749
|
-
function select$
|
|
1750
|
-
return select$
|
|
1749
|
+
function select$f(luvio, params) {
|
|
1750
|
+
return select$g();
|
|
1751
1751
|
}
|
|
1752
|
-
function getResponseCacheKeys$
|
|
1753
|
-
getTypeCacheKeys$
|
|
1752
|
+
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
1753
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response);
|
|
1754
1754
|
}
|
|
1755
|
-
function ingestSuccess$
|
|
1755
|
+
function ingestSuccess$4(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$4, body);
|
|
1759
1759
|
const snapshot = luvio.storeLookup({
|
|
1760
1760
|
recordId: key,
|
|
1761
|
-
node: select$
|
|
1761
|
+
node: select$f(),
|
|
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$4(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$4 = '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$4, createGenerations_ConfigPropertyMetadata);
|
|
1791
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$7(createGenerations_ConfigPropertyMetadata);
|
|
1792
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
1793
1793
|
const config = {};
|
|
1794
1794
|
const untrustedConfig_generationsInput = untrustedConfig.generationsInput;
|
|
1795
|
-
const referenceEinsteinLlmGenerationsInputRepresentationValidationError = validate$
|
|
1795
|
+
const referenceEinsteinLlmGenerationsInputRepresentationValidationError = validate$j(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$4(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$4(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$4(luvio, config, options) {
|
|
1815
|
+
const resourceParams = createResourceParams$4(config);
|
|
1816
|
+
const request = createResourceRequest$4(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$4(luvio, resourceParams, response);
|
|
1821
1821
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1822
1822
|
}, () => {
|
|
1823
1823
|
const cache = new StoreKeyMap();
|
|
1824
|
-
getResponseCacheKeys$
|
|
1824
|
+
getResponseCacheKeys$4(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$4(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$4(luvio, config);
|
|
1840
1840
|
};
|
|
1841
1841
|
};
|
|
1842
1842
|
|
|
1843
|
-
function validate$
|
|
1843
|
+
function validate$d(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$c(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$k(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$d(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,86 @@ 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$a = "70b3261d05a4bf7da95cd5cabe9bd785";
|
|
1913
|
+
function validate$b(obj, path = 'EinsteinPromptTemplateAttachmentRepresentation') {
|
|
1914
|
+
const v_error = (() => {
|
|
1915
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1916
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1917
|
+
}
|
|
1918
|
+
const obj_fileExtension = obj.fileExtension;
|
|
1919
|
+
const path_fileExtension = path + '.fileExtension';
|
|
1920
|
+
if (typeof obj_fileExtension !== 'string') {
|
|
1921
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fileExtension + '" (at "' + path_fileExtension + '")');
|
|
1922
|
+
}
|
|
1923
|
+
const obj_id = obj.id;
|
|
1924
|
+
const path_id = path + '.id';
|
|
1925
|
+
if (typeof obj_id !== 'string') {
|
|
1926
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1927
|
+
}
|
|
1928
|
+
const obj_latestPublishedVersion = obj.latestPublishedVersion;
|
|
1929
|
+
const path_latestPublishedVersion = path + '.latestPublishedVersion';
|
|
1930
|
+
if (typeof obj_latestPublishedVersion !== 'string') {
|
|
1931
|
+
return new TypeError('Expected "string" but received "' + typeof obj_latestPublishedVersion + '" (at "' + path_latestPublishedVersion + '")');
|
|
1932
|
+
}
|
|
1933
|
+
const obj_title = obj.title;
|
|
1934
|
+
const path_title = path + '.title';
|
|
1935
|
+
if (typeof obj_title !== 'string') {
|
|
1936
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
1937
|
+
}
|
|
1938
|
+
})();
|
|
1939
|
+
return v_error === undefined ? null : v_error;
|
|
1940
|
+
}
|
|
1941
|
+
const select$e = function EinsteinPromptTemplateAttachmentRepresentationSelect() {
|
|
1942
|
+
return {
|
|
1943
|
+
kind: 'Fragment',
|
|
1944
|
+
version: VERSION$a,
|
|
1945
|
+
private: [],
|
|
1946
|
+
selections: [
|
|
1947
|
+
{
|
|
1948
|
+
name: 'fileExtension',
|
|
1949
|
+
kind: 'Scalar'
|
|
1950
|
+
},
|
|
1951
|
+
{
|
|
1952
|
+
name: 'id',
|
|
1953
|
+
kind: 'Scalar'
|
|
1954
|
+
},
|
|
1955
|
+
{
|
|
1956
|
+
name: 'latestPublishedVersion',
|
|
1957
|
+
kind: 'Scalar'
|
|
1958
|
+
},
|
|
1959
|
+
{
|
|
1960
|
+
name: 'title',
|
|
1961
|
+
kind: 'Scalar'
|
|
1962
|
+
}
|
|
1963
|
+
]
|
|
1964
|
+
};
|
|
1965
|
+
};
|
|
1966
|
+
function equals$a(existing, incoming) {
|
|
1967
|
+
const existing_fileExtension = existing.fileExtension;
|
|
1968
|
+
const incoming_fileExtension = incoming.fileExtension;
|
|
1969
|
+
if (!(existing_fileExtension === incoming_fileExtension)) {
|
|
1970
|
+
return false;
|
|
1971
|
+
}
|
|
1972
|
+
const existing_id = existing.id;
|
|
1973
|
+
const incoming_id = incoming.id;
|
|
1974
|
+
if (!(existing_id === incoming_id)) {
|
|
1975
|
+
return false;
|
|
1976
|
+
}
|
|
1977
|
+
const existing_latestPublishedVersion = existing.latestPublishedVersion;
|
|
1978
|
+
const incoming_latestPublishedVersion = incoming.latestPublishedVersion;
|
|
1979
|
+
if (!(existing_latestPublishedVersion === incoming_latestPublishedVersion)) {
|
|
1980
|
+
return false;
|
|
1981
|
+
}
|
|
1982
|
+
const existing_title = existing.title;
|
|
1983
|
+
const incoming_title = incoming.title;
|
|
1984
|
+
if (!(existing_title === incoming_title)) {
|
|
1985
|
+
return false;
|
|
1986
|
+
}
|
|
1987
|
+
return true;
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
const VERSION$9 = "6458d624e5a1691821c764b6de0badb3";
|
|
1991
|
+
function validate$a(obj, path = 'EinsteinPromptTemplateGenerationsErrorRepresentation') {
|
|
1914
1992
|
const v_error = (() => {
|
|
1915
1993
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1916
1994
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1940,10 +2018,10 @@ function validate$7(obj, path = 'EinsteinPromptTemplateGenerationsErrorRepresent
|
|
|
1940
2018
|
})();
|
|
1941
2019
|
return v_error === undefined ? null : v_error;
|
|
1942
2020
|
}
|
|
1943
|
-
const select$
|
|
2021
|
+
const select$d = function EinsteinPromptTemplateGenerationsErrorRepresentationSelect() {
|
|
1944
2022
|
return {
|
|
1945
2023
|
kind: 'Fragment',
|
|
1946
|
-
version: VERSION$
|
|
2024
|
+
version: VERSION$9,
|
|
1947
2025
|
private: [],
|
|
1948
2026
|
selections: [
|
|
1949
2027
|
{
|
|
@@ -1966,7 +2044,7 @@ const select$7 = function EinsteinPromptTemplateGenerationsErrorRepresentationSe
|
|
|
1966
2044
|
]
|
|
1967
2045
|
};
|
|
1968
2046
|
};
|
|
1969
|
-
function equals$
|
|
2047
|
+
function equals$9(existing, incoming) {
|
|
1970
2048
|
const existing_errorMessage = existing.errorMessage;
|
|
1971
2049
|
const incoming_errorMessage = incoming.errorMessage;
|
|
1972
2050
|
if (!(existing_errorMessage === incoming_errorMessage)) {
|
|
@@ -1998,8 +2076,8 @@ function equals$5(existing, incoming) {
|
|
|
1998
2076
|
return true;
|
|
1999
2077
|
}
|
|
2000
2078
|
|
|
2001
|
-
const VERSION$
|
|
2002
|
-
function validate$
|
|
2079
|
+
const VERSION$8 = "7c417ce44e4bc05dfcc454e6825590e8";
|
|
2080
|
+
function validate$9(obj, path = 'EinsteinPromptTemplateMaskSettingsRepresentation') {
|
|
2003
2081
|
const v_error = (() => {
|
|
2004
2082
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2005
2083
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -2012,10 +2090,10 @@ function validate$6(obj, path = 'EinsteinPromptTemplateMaskSettingsRepresentatio
|
|
|
2012
2090
|
})();
|
|
2013
2091
|
return v_error === undefined ? null : v_error;
|
|
2014
2092
|
}
|
|
2015
|
-
const select$
|
|
2093
|
+
const select$c = function EinsteinPromptTemplateMaskSettingsRepresentationSelect() {
|
|
2016
2094
|
return {
|
|
2017
2095
|
kind: 'Fragment',
|
|
2018
|
-
version: VERSION$
|
|
2096
|
+
version: VERSION$8,
|
|
2019
2097
|
private: [],
|
|
2020
2098
|
selections: [
|
|
2021
2099
|
{
|
|
@@ -2025,7 +2103,7 @@ const select$6 = function EinsteinPromptTemplateMaskSettingsRepresentationSelect
|
|
|
2025
2103
|
]
|
|
2026
2104
|
};
|
|
2027
2105
|
};
|
|
2028
|
-
function equals$
|
|
2106
|
+
function equals$8(existing, incoming) {
|
|
2029
2107
|
const existing_enableModeration = existing.enableModeration;
|
|
2030
2108
|
const incoming_enableModeration = incoming.enableModeration;
|
|
2031
2109
|
if (!(existing_enableModeration === incoming_enableModeration)) {
|
|
@@ -2034,8 +2112,8 @@ function equals$4(existing, incoming) {
|
|
|
2034
2112
|
return true;
|
|
2035
2113
|
}
|
|
2036
2114
|
|
|
2037
|
-
const VERSION$
|
|
2038
|
-
function validate$
|
|
2115
|
+
const VERSION$7 = "92ad1abd0e2a60bc36941409cadda7e2";
|
|
2116
|
+
function validate$8(obj, path = 'EinsteinPromptTemplateMaskContentRepresentation') {
|
|
2039
2117
|
const v_error = (() => {
|
|
2040
2118
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2041
2119
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -2050,7 +2128,7 @@ function validate$5(obj, path = 'EinsteinPromptTemplateMaskContentRepresentation
|
|
|
2050
2128
|
const path_moderationSettings = path + '.moderationSettings';
|
|
2051
2129
|
let obj_moderationSettings_union0 = null;
|
|
2052
2130
|
const obj_moderationSettings_union0_error = (() => {
|
|
2053
|
-
const referencepath_moderationSettingsValidationError = validate$
|
|
2131
|
+
const referencepath_moderationSettingsValidationError = validate$9(obj_moderationSettings, path_moderationSettings);
|
|
2054
2132
|
if (referencepath_moderationSettingsValidationError !== null) {
|
|
2055
2133
|
let message = 'Object doesn\'t match EinsteinPromptTemplateMaskSettingsRepresentation (at "' + path_moderationSettings + '")\n';
|
|
2056
2134
|
message += referencepath_moderationSettingsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2086,11 +2164,11 @@ function validate$5(obj, path = 'EinsteinPromptTemplateMaskContentRepresentation
|
|
|
2086
2164
|
})();
|
|
2087
2165
|
return v_error === undefined ? null : v_error;
|
|
2088
2166
|
}
|
|
2089
|
-
const select$
|
|
2090
|
-
const { selections: EinsteinPromptTemplateMaskSettingsRepresentation__selections, opaque: EinsteinPromptTemplateMaskSettingsRepresentation__opaque, } = select$
|
|
2167
|
+
const select$b = function EinsteinPromptTemplateMaskContentRepresentationSelect() {
|
|
2168
|
+
const { selections: EinsteinPromptTemplateMaskSettingsRepresentation__selections, opaque: EinsteinPromptTemplateMaskSettingsRepresentation__opaque, } = select$c();
|
|
2091
2169
|
return {
|
|
2092
2170
|
kind: 'Fragment',
|
|
2093
|
-
version: VERSION$
|
|
2171
|
+
version: VERSION$7,
|
|
2094
2172
|
private: [],
|
|
2095
2173
|
selections: [
|
|
2096
2174
|
{
|
|
@@ -2112,7 +2190,7 @@ const select$5 = function EinsteinPromptTemplateMaskContentRepresentationSelect(
|
|
|
2112
2190
|
]
|
|
2113
2191
|
};
|
|
2114
2192
|
};
|
|
2115
|
-
function equals$
|
|
2193
|
+
function equals$7(existing, incoming) {
|
|
2116
2194
|
const existing_content = existing.content;
|
|
2117
2195
|
const incoming_content = incoming.content;
|
|
2118
2196
|
if (!(existing_content === incoming_content)) {
|
|
@@ -2143,15 +2221,15 @@ function equals$3(existing, incoming) {
|
|
|
2143
2221
|
if (!(existing_moderationSettings === incoming_moderationSettings
|
|
2144
2222
|
|| (existing_moderationSettings != null &&
|
|
2145
2223
|
incoming_moderationSettings != null &&
|
|
2146
|
-
equals$
|
|
2224
|
+
equals$8(existing_moderationSettings, incoming_moderationSettings)))) {
|
|
2147
2225
|
return false;
|
|
2148
2226
|
}
|
|
2149
2227
|
}
|
|
2150
2228
|
return true;
|
|
2151
2229
|
}
|
|
2152
2230
|
|
|
2153
|
-
const VERSION$
|
|
2154
|
-
function validate$
|
|
2231
|
+
const VERSION$6 = "507a815605f8d30ae9b52b0ec513d25e";
|
|
2232
|
+
function validate$7(obj, path = 'EinsteinPromptTemplateMaskDataRepresentation') {
|
|
2155
2233
|
const v_error = (() => {
|
|
2156
2234
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2157
2235
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -2181,10 +2259,10 @@ function validate$4(obj, path = 'EinsteinPromptTemplateMaskDataRepresentation')
|
|
|
2181
2259
|
})();
|
|
2182
2260
|
return v_error === undefined ? null : v_error;
|
|
2183
2261
|
}
|
|
2184
|
-
const select$
|
|
2262
|
+
const select$a = function EinsteinPromptTemplateMaskDataRepresentationSelect() {
|
|
2185
2263
|
return {
|
|
2186
2264
|
kind: 'Fragment',
|
|
2187
|
-
version: VERSION$
|
|
2265
|
+
version: VERSION$6,
|
|
2188
2266
|
private: [],
|
|
2189
2267
|
selections: [
|
|
2190
2268
|
{
|
|
@@ -2203,7 +2281,7 @@ const select$4 = function EinsteinPromptTemplateMaskDataRepresentationSelect() {
|
|
|
2203
2281
|
]
|
|
2204
2282
|
};
|
|
2205
2283
|
};
|
|
2206
|
-
function equals$
|
|
2284
|
+
function equals$6(existing, incoming) {
|
|
2207
2285
|
const existing_originalValue = existing.originalValue;
|
|
2208
2286
|
const incoming_originalValue = incoming.originalValue;
|
|
2209
2287
|
if (!(existing_originalValue === incoming_originalValue)) {
|
|
@@ -2227,13 +2305,30 @@ function equals$2(existing, incoming) {
|
|
|
2227
2305
|
return true;
|
|
2228
2306
|
}
|
|
2229
2307
|
|
|
2230
|
-
const TTL$
|
|
2231
|
-
const VERSION$
|
|
2232
|
-
function validate$
|
|
2308
|
+
const TTL$3 = 100;
|
|
2309
|
+
const VERSION$5 = "1beba5cc950346499a8f4810c77e2b03";
|
|
2310
|
+
function validate$6(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation') {
|
|
2233
2311
|
const v_error = (() => {
|
|
2234
2312
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2235
2313
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2236
2314
|
}
|
|
2315
|
+
if (obj.fileData !== undefined) {
|
|
2316
|
+
const obj_fileData = obj.fileData;
|
|
2317
|
+
const path_fileData = path + '.fileData';
|
|
2318
|
+
if (!ArrayIsArray(obj_fileData)) {
|
|
2319
|
+
return new TypeError('Expected "array" but received "' + typeof obj_fileData + '" (at "' + path_fileData + '")');
|
|
2320
|
+
}
|
|
2321
|
+
for (let i = 0; i < obj_fileData.length; i++) {
|
|
2322
|
+
const obj_fileData_item = obj_fileData[i];
|
|
2323
|
+
const path_fileData_item = path_fileData + '[' + i + ']';
|
|
2324
|
+
const referencepath_fileData_itemValidationError = validate$b(obj_fileData_item, path_fileData_item);
|
|
2325
|
+
if (referencepath_fileData_itemValidationError !== null) {
|
|
2326
|
+
let message = 'Object doesn\'t match EinsteinPromptTemplateAttachmentRepresentation (at "' + path_fileData_item + '")\n';
|
|
2327
|
+
message += referencepath_fileData_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2328
|
+
return new TypeError(message);
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2237
2332
|
if (obj.generationErrors !== undefined) {
|
|
2238
2333
|
const obj_generationErrors = obj.generationErrors;
|
|
2239
2334
|
const path_generationErrors = path + '.generationErrors';
|
|
@@ -2243,7 +2338,7 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2243
2338
|
for (let i = 0; i < obj_generationErrors.length; i++) {
|
|
2244
2339
|
const obj_generationErrors_item = obj_generationErrors[i];
|
|
2245
2340
|
const path_generationErrors_item = path_generationErrors + '[' + i + ']';
|
|
2246
|
-
const referencepath_generationErrors_itemValidationError = validate$
|
|
2341
|
+
const referencepath_generationErrors_itemValidationError = validate$a(obj_generationErrors_item, path_generationErrors_item);
|
|
2247
2342
|
if (referencepath_generationErrors_itemValidationError !== null) {
|
|
2248
2343
|
let message = 'Object doesn\'t match EinsteinPromptTemplateGenerationsErrorRepresentation (at "' + path_generationErrors_item + '")\n';
|
|
2249
2344
|
message += referencepath_generationErrors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2259,7 +2354,7 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2259
2354
|
for (let i = 0; i < obj_generations.length; i++) {
|
|
2260
2355
|
const obj_generations_item = obj_generations[i];
|
|
2261
2356
|
const path_generations_item = path_generations + '[' + i + ']';
|
|
2262
|
-
const referencepath_generations_itemValidationError = validate$
|
|
2357
|
+
const referencepath_generations_itemValidationError = validate$g(obj_generations_item, path_generations_item);
|
|
2263
2358
|
if (referencepath_generations_itemValidationError !== null) {
|
|
2264
2359
|
let message = 'Object doesn\'t match EinsteinLlmGenerationItemRepresentation (at "' + path_generations_item + '")\n';
|
|
2265
2360
|
message += referencepath_generations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2270,7 +2365,7 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2270
2365
|
const path_parameters = path + '.parameters';
|
|
2271
2366
|
let obj_parameters_union0 = null;
|
|
2272
2367
|
const obj_parameters_union0_error = (() => {
|
|
2273
|
-
const referencepath_parametersValidationError = validate$
|
|
2368
|
+
const referencepath_parametersValidationError = validate$f(obj_parameters, path_parameters);
|
|
2274
2369
|
if (referencepath_parametersValidationError !== null) {
|
|
2275
2370
|
let message = 'Object doesn\'t match WrappedMap (at "' + path_parameters + '")\n';
|
|
2276
2371
|
message += referencepath_parametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2340,7 +2435,7 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2340
2435
|
for (let i = 0; i < obj_requestMessages.length; i++) {
|
|
2341
2436
|
const obj_requestMessages_item = obj_requestMessages[i];
|
|
2342
2437
|
const path_requestMessages_item = path_requestMessages + '[' + i + ']';
|
|
2343
|
-
const referencepath_requestMessages_itemValidationError = validate$
|
|
2438
|
+
const referencepath_requestMessages_itemValidationError = validate$8(obj_requestMessages_item, path_requestMessages_item);
|
|
2344
2439
|
if (referencepath_requestMessages_itemValidationError !== null) {
|
|
2345
2440
|
let message = 'Object doesn\'t match EinsteinPromptTemplateMaskContentRepresentation (at "' + path_requestMessages_item + '")\n';
|
|
2346
2441
|
message += referencepath_requestMessages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2357,7 +2452,7 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2357
2452
|
for (let i = 0; i < obj_responseMessages.length; i++) {
|
|
2358
2453
|
const obj_responseMessages_item = obj_responseMessages[i];
|
|
2359
2454
|
const path_responseMessages_item = path_responseMessages + '[' + i + ']';
|
|
2360
|
-
const referencepath_responseMessages_itemValidationError = validate$
|
|
2455
|
+
const referencepath_responseMessages_itemValidationError = validate$8(obj_responseMessages_item, path_responseMessages_item);
|
|
2361
2456
|
if (referencepath_responseMessages_itemValidationError !== null) {
|
|
2362
2457
|
let message = 'Object doesn\'t match EinsteinPromptTemplateMaskContentRepresentation (at "' + path_responseMessages_item + '")\n';
|
|
2363
2458
|
message += referencepath_responseMessages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2374,7 +2469,7 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2374
2469
|
for (let i = 0; i < obj_slotsMaskingInformation.length; i++) {
|
|
2375
2470
|
const obj_slotsMaskingInformation_item = obj_slotsMaskingInformation[i];
|
|
2376
2471
|
const path_slotsMaskingInformation_item = path_slotsMaskingInformation + '[' + i + ']';
|
|
2377
|
-
const referencepath_slotsMaskingInformation_itemValidationError = validate$
|
|
2472
|
+
const referencepath_slotsMaskingInformation_itemValidationError = validate$7(obj_slotsMaskingInformation_item, path_slotsMaskingInformation_item);
|
|
2378
2473
|
if (referencepath_slotsMaskingInformation_itemValidationError !== null) {
|
|
2379
2474
|
let message = 'Object doesn\'t match EinsteinPromptTemplateMaskDataRepresentation (at "' + path_slotsMaskingInformation_item + '")\n';
|
|
2380
2475
|
message += referencepath_slotsMaskingInformation_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2385,30 +2480,38 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2385
2480
|
})();
|
|
2386
2481
|
return v_error === undefined ? null : v_error;
|
|
2387
2482
|
}
|
|
2388
|
-
const RepresentationType$
|
|
2389
|
-
function keyBuilder$
|
|
2390
|
-
return keyPrefix + '::' + RepresentationType$
|
|
2483
|
+
const RepresentationType$3 = 'EinsteinPromptTemplateGenerationsRepresentation';
|
|
2484
|
+
function keyBuilder$6(luvio, config) {
|
|
2485
|
+
return keyPrefix + '::' + RepresentationType$3 + ':' + config.requestId;
|
|
2391
2486
|
}
|
|
2392
2487
|
function keyBuilderFromType(luvio, object) {
|
|
2393
2488
|
const keyParams = {
|
|
2394
2489
|
requestId: object.requestId
|
|
2395
2490
|
};
|
|
2396
|
-
return keyBuilder$
|
|
2491
|
+
return keyBuilder$6(luvio, keyParams);
|
|
2397
2492
|
}
|
|
2398
|
-
function normalize$
|
|
2493
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
2399
2494
|
return input;
|
|
2400
2495
|
}
|
|
2401
|
-
const select$
|
|
2402
|
-
const { selections:
|
|
2403
|
-
const { selections:
|
|
2404
|
-
const { selections:
|
|
2405
|
-
const { selections:
|
|
2406
|
-
const { selections:
|
|
2496
|
+
const select$9 = function EinsteinPromptTemplateGenerationsRepresentationSelect() {
|
|
2497
|
+
const { selections: EinsteinPromptTemplateAttachmentRepresentation__selections, opaque: EinsteinPromptTemplateAttachmentRepresentation__opaque, } = select$e();
|
|
2498
|
+
const { selections: EinsteinPromptTemplateGenerationsErrorRepresentation__selections, opaque: EinsteinPromptTemplateGenerationsErrorRepresentation__opaque, } = select$d();
|
|
2499
|
+
const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$i();
|
|
2500
|
+
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$h();
|
|
2501
|
+
const { selections: EinsteinPromptTemplateMaskContentRepresentation__selections, opaque: EinsteinPromptTemplateMaskContentRepresentation__opaque, } = select$b();
|
|
2502
|
+
const { selections: EinsteinPromptTemplateMaskDataRepresentation__selections, opaque: EinsteinPromptTemplateMaskDataRepresentation__opaque, } = select$a();
|
|
2407
2503
|
return {
|
|
2408
2504
|
kind: 'Fragment',
|
|
2409
|
-
version: VERSION$
|
|
2505
|
+
version: VERSION$5,
|
|
2410
2506
|
private: [],
|
|
2411
2507
|
selections: [
|
|
2508
|
+
{
|
|
2509
|
+
name: 'fileData',
|
|
2510
|
+
kind: 'Object',
|
|
2511
|
+
plural: true,
|
|
2512
|
+
selections: EinsteinPromptTemplateAttachmentRepresentation__selections,
|
|
2513
|
+
required: false
|
|
2514
|
+
},
|
|
2412
2515
|
{
|
|
2413
2516
|
name: 'generationErrors',
|
|
2414
2517
|
kind: 'Object',
|
|
@@ -2464,7 +2567,7 @@ const select$3 = function EinsteinPromptTemplateGenerationsRepresentationSelect(
|
|
|
2464
2567
|
]
|
|
2465
2568
|
};
|
|
2466
2569
|
};
|
|
2467
|
-
function equals$
|
|
2570
|
+
function equals$5(existing, incoming) {
|
|
2468
2571
|
const existing_promptTemplateDevName = existing.promptTemplateDevName;
|
|
2469
2572
|
const incoming_promptTemplateDevName = incoming.promptTemplateDevName;
|
|
2470
2573
|
if (!(existing_promptTemplateDevName === incoming_promptTemplateDevName)) {
|
|
@@ -2475,6 +2578,24 @@ function equals$1(existing, incoming) {
|
|
|
2475
2578
|
if (!(existing_requestId === incoming_requestId)) {
|
|
2476
2579
|
return false;
|
|
2477
2580
|
}
|
|
2581
|
+
const existing_fileData = existing.fileData;
|
|
2582
|
+
const incoming_fileData = incoming.fileData;
|
|
2583
|
+
// if at least one of these optionals is defined
|
|
2584
|
+
if (existing_fileData !== undefined || incoming_fileData !== undefined) {
|
|
2585
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2586
|
+
// not equal
|
|
2587
|
+
if (existing_fileData === undefined || incoming_fileData === undefined) {
|
|
2588
|
+
return false;
|
|
2589
|
+
}
|
|
2590
|
+
const equals_fileData_items = equalsArray(existing_fileData, incoming_fileData, (existing_fileData_item, incoming_fileData_item) => {
|
|
2591
|
+
if (!(equals$a(existing_fileData_item, incoming_fileData_item))) {
|
|
2592
|
+
return false;
|
|
2593
|
+
}
|
|
2594
|
+
});
|
|
2595
|
+
if (equals_fileData_items === false) {
|
|
2596
|
+
return false;
|
|
2597
|
+
}
|
|
2598
|
+
}
|
|
2478
2599
|
const existing_generationErrors = existing.generationErrors;
|
|
2479
2600
|
const incoming_generationErrors = incoming.generationErrors;
|
|
2480
2601
|
// if at least one of these optionals is defined
|
|
@@ -2485,7 +2606,7 @@ function equals$1(existing, incoming) {
|
|
|
2485
2606
|
return false;
|
|
2486
2607
|
}
|
|
2487
2608
|
const equals_generationErrors_items = equalsArray(existing_generationErrors, incoming_generationErrors, (existing_generationErrors_item, incoming_generationErrors_item) => {
|
|
2488
|
-
if (!(equals$
|
|
2609
|
+
if (!(equals$9(existing_generationErrors_item, incoming_generationErrors_item))) {
|
|
2489
2610
|
return false;
|
|
2490
2611
|
}
|
|
2491
2612
|
});
|
|
@@ -2496,7 +2617,7 @@ function equals$1(existing, incoming) {
|
|
|
2496
2617
|
const existing_generations = existing.generations;
|
|
2497
2618
|
const incoming_generations = incoming.generations;
|
|
2498
2619
|
const equals_generations_items = equalsArray(existing_generations, incoming_generations, (existing_generations_item, incoming_generations_item) => {
|
|
2499
|
-
if (!(equals$
|
|
2620
|
+
if (!(equals$d(existing_generations_item, incoming_generations_item))) {
|
|
2500
2621
|
return false;
|
|
2501
2622
|
}
|
|
2502
2623
|
});
|
|
@@ -2508,7 +2629,7 @@ function equals$1(existing, incoming) {
|
|
|
2508
2629
|
if (!(existing_parameters === incoming_parameters
|
|
2509
2630
|
|| (existing_parameters != null &&
|
|
2510
2631
|
incoming_parameters != null &&
|
|
2511
|
-
equals$
|
|
2632
|
+
equals$c(existing_parameters, incoming_parameters)))) {
|
|
2512
2633
|
return false;
|
|
2513
2634
|
}
|
|
2514
2635
|
const existing_prompt = existing.prompt;
|
|
@@ -2526,7 +2647,7 @@ function equals$1(existing, incoming) {
|
|
|
2526
2647
|
return false;
|
|
2527
2648
|
}
|
|
2528
2649
|
const equals_requestMessages_items = equalsArray(existing_requestMessages, incoming_requestMessages, (existing_requestMessages_item, incoming_requestMessages_item) => {
|
|
2529
|
-
if (!(equals$
|
|
2650
|
+
if (!(equals$7(existing_requestMessages_item, incoming_requestMessages_item))) {
|
|
2530
2651
|
return false;
|
|
2531
2652
|
}
|
|
2532
2653
|
});
|
|
@@ -2544,7 +2665,7 @@ function equals$1(existing, incoming) {
|
|
|
2544
2665
|
return false;
|
|
2545
2666
|
}
|
|
2546
2667
|
const equals_responseMessages_items = equalsArray(existing_responseMessages, incoming_responseMessages, (existing_responseMessages_item, incoming_responseMessages_item) => {
|
|
2547
|
-
if (!(equals$
|
|
2668
|
+
if (!(equals$7(existing_responseMessages_item, incoming_responseMessages_item))) {
|
|
2548
2669
|
return false;
|
|
2549
2670
|
}
|
|
2550
2671
|
});
|
|
@@ -2562,7 +2683,7 @@ function equals$1(existing, incoming) {
|
|
|
2562
2683
|
return false;
|
|
2563
2684
|
}
|
|
2564
2685
|
const equals_slotsMaskingInformation_items = equalsArray(existing_slotsMaskingInformation, incoming_slotsMaskingInformation, (existing_slotsMaskingInformation_item, incoming_slotsMaskingInformation_item) => {
|
|
2565
|
-
if (!(equals$
|
|
2686
|
+
if (!(equals$6(existing_slotsMaskingInformation_item, incoming_slotsMaskingInformation_item))) {
|
|
2566
2687
|
return false;
|
|
2567
2688
|
}
|
|
2568
2689
|
});
|
|
@@ -2572,41 +2693,41 @@ function equals$1(existing, incoming) {
|
|
|
2572
2693
|
}
|
|
2573
2694
|
return true;
|
|
2574
2695
|
}
|
|
2575
|
-
const ingest$
|
|
2696
|
+
const ingest$3 = function EinsteinPromptTemplateGenerationsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2576
2697
|
if (process.env.NODE_ENV !== 'production') {
|
|
2577
|
-
const validateError = validate$
|
|
2698
|
+
const validateError = validate$6(input);
|
|
2578
2699
|
if (validateError !== null) {
|
|
2579
2700
|
throw validateError;
|
|
2580
2701
|
}
|
|
2581
2702
|
}
|
|
2582
2703
|
const key = keyBuilderFromType(luvio, input);
|
|
2583
|
-
const ttlToUse = TTL$
|
|
2584
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
2704
|
+
const ttlToUse = TTL$3;
|
|
2705
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "EinsteinLLM", VERSION$5, RepresentationType$3, equals$5);
|
|
2585
2706
|
return createLink(key);
|
|
2586
2707
|
};
|
|
2587
|
-
function getTypeCacheKeys$
|
|
2708
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
2588
2709
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2589
2710
|
const rootKey = keyBuilderFromType(luvio, input);
|
|
2590
2711
|
rootKeySet.set(rootKey, {
|
|
2591
2712
|
namespace: keyPrefix,
|
|
2592
|
-
representationName: RepresentationType$
|
|
2713
|
+
representationName: RepresentationType$3,
|
|
2593
2714
|
mergeable: false
|
|
2594
2715
|
});
|
|
2595
2716
|
}
|
|
2596
2717
|
|
|
2597
|
-
function select$
|
|
2598
|
-
return select$
|
|
2718
|
+
function select$8(luvio, params) {
|
|
2719
|
+
return select$9();
|
|
2599
2720
|
}
|
|
2600
|
-
function getResponseCacheKeys$
|
|
2601
|
-
getTypeCacheKeys$
|
|
2721
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
2722
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response);
|
|
2602
2723
|
}
|
|
2603
|
-
function ingestSuccess$
|
|
2724
|
+
function ingestSuccess$3(luvio, resourceParams, response) {
|
|
2604
2725
|
const { body } = response;
|
|
2605
2726
|
const key = keyBuilderFromType(luvio, body);
|
|
2606
|
-
luvio.storeIngest(key, ingest$
|
|
2727
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
2607
2728
|
const snapshot = luvio.storeLookup({
|
|
2608
2729
|
recordId: key,
|
|
2609
|
-
node: select$
|
|
2730
|
+
node: select$8(),
|
|
2610
2731
|
variables: {},
|
|
2611
2732
|
});
|
|
2612
2733
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2617,7 +2738,7 @@ function ingestSuccess$1(luvio, resourceParams, response) {
|
|
|
2617
2738
|
deepFreeze(snapshot.data);
|
|
2618
2739
|
return snapshot;
|
|
2619
2740
|
}
|
|
2620
|
-
function createResourceRequest$
|
|
2741
|
+
function createResourceRequest$3(config) {
|
|
2621
2742
|
const headers = {};
|
|
2622
2743
|
return {
|
|
2623
2744
|
baseUri: '/services/data/v63.0',
|
|
@@ -2631,48 +2752,48 @@ function createResourceRequest$1(config) {
|
|
|
2631
2752
|
};
|
|
2632
2753
|
}
|
|
2633
2754
|
|
|
2634
|
-
const adapterName$
|
|
2755
|
+
const adapterName$3 = 'createGenerationsForPromptTemplate';
|
|
2635
2756
|
const createGenerationsForPromptTemplate_ConfigPropertyMetadata = [
|
|
2636
2757
|
generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2637
2758
|
generateParamConfigMetadata('versionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2638
2759
|
generateParamConfigMetadata('promptTemplateGenerationsInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
2639
2760
|
];
|
|
2640
|
-
const createGenerationsForPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
2641
|
-
const createResourceParams$
|
|
2642
|
-
function typeCheckConfig$
|
|
2761
|
+
const createGenerationsForPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
|
|
2762
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$7(createGenerationsForPromptTemplate_ConfigPropertyMetadata);
|
|
2763
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
2643
2764
|
const config = {};
|
|
2644
|
-
typeCheckConfig$
|
|
2765
|
+
typeCheckConfig$7(untrustedConfig, config, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
|
|
2645
2766
|
const untrustedConfig_promptTemplateGenerationsInput = untrustedConfig.promptTemplateGenerationsInput;
|
|
2646
|
-
const referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError = validate$
|
|
2767
|
+
const referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError = validate$c(untrustedConfig_promptTemplateGenerationsInput);
|
|
2647
2768
|
if (referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError === null) {
|
|
2648
2769
|
config.promptTemplateGenerationsInput = untrustedConfig_promptTemplateGenerationsInput;
|
|
2649
2770
|
}
|
|
2650
2771
|
return config;
|
|
2651
2772
|
}
|
|
2652
|
-
function validateAdapterConfig$
|
|
2773
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
2653
2774
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
2654
2775
|
return null;
|
|
2655
2776
|
}
|
|
2656
2777
|
if (process.env.NODE_ENV !== 'production') {
|
|
2657
2778
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
2658
2779
|
}
|
|
2659
|
-
const config = typeCheckConfig$
|
|
2780
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
2660
2781
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2661
2782
|
return null;
|
|
2662
2783
|
}
|
|
2663
2784
|
return config;
|
|
2664
2785
|
}
|
|
2665
|
-
function buildNetworkSnapshot$
|
|
2666
|
-
const resourceParams = createResourceParams$
|
|
2667
|
-
const request = createResourceRequest$
|
|
2786
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
2787
|
+
const resourceParams = createResourceParams$3(config);
|
|
2788
|
+
const request = createResourceRequest$3(resourceParams);
|
|
2668
2789
|
return luvio.dispatchResourceRequest(request, options)
|
|
2669
2790
|
.then((response) => {
|
|
2670
2791
|
return luvio.handleSuccessResponse(() => {
|
|
2671
|
-
const snapshot = ingestSuccess$
|
|
2792
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response);
|
|
2672
2793
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
2673
2794
|
}, () => {
|
|
2674
2795
|
const cache = new StoreKeyMap();
|
|
2675
|
-
getResponseCacheKeys$
|
|
2796
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
2676
2797
|
return cache;
|
|
2677
2798
|
});
|
|
2678
2799
|
}, (response) => {
|
|
@@ -2682,37 +2803,431 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
2682
2803
|
}
|
|
2683
2804
|
const createGenerationsForPromptTemplateAdapterFactory = (luvio) => {
|
|
2684
2805
|
return function createGenerationsForPromptTemplate(untrustedConfig) {
|
|
2685
|
-
const config = validateAdapterConfig$
|
|
2806
|
+
const config = validateAdapterConfig$3(untrustedConfig, createGenerationsForPromptTemplate_ConfigPropertyNames);
|
|
2686
2807
|
// Invalid or incomplete config
|
|
2687
2808
|
if (config === null) {
|
|
2688
2809
|
throw new Error('Invalid config for "createGenerationsForPromptTemplate"');
|
|
2689
2810
|
}
|
|
2690
|
-
return buildNetworkSnapshot$
|
|
2811
|
+
return buildNetworkSnapshot$3(luvio, config);
|
|
2691
2812
|
};
|
|
2692
2813
|
};
|
|
2693
2814
|
|
|
2694
|
-
|
|
2815
|
+
const VERSION$4 = "b513bbac1672327d8eaaf120660e94b5";
|
|
2816
|
+
function validate$5(obj, path = 'EinsteinPromptTemplateSupportedLanguageErrorRepresentation') {
|
|
2695
2817
|
const v_error = (() => {
|
|
2696
2818
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2697
2819
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2698
2820
|
}
|
|
2699
|
-
const
|
|
2700
|
-
const
|
|
2701
|
-
if (typeof
|
|
2702
|
-
return new TypeError('Expected "string" but received "' + typeof
|
|
2703
|
-
}
|
|
2704
|
-
const obj_value = obj.value;
|
|
2705
|
-
const path_value = path + '.value';
|
|
2706
|
-
let obj_value_union0 = null;
|
|
2707
|
-
const obj_value_union0_error = (() => {
|
|
2708
|
-
if (typeof obj_value !== 'boolean') {
|
|
2709
|
-
return new TypeError('Expected "boolean" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
2710
|
-
}
|
|
2711
|
-
})();
|
|
2712
|
-
if (obj_value_union0_error != null) {
|
|
2713
|
-
obj_value_union0 = obj_value_union0_error.message;
|
|
2821
|
+
const obj_errorMessage = obj.errorMessage;
|
|
2822
|
+
const path_errorMessage = path + '.errorMessage';
|
|
2823
|
+
if (typeof obj_errorMessage !== 'string') {
|
|
2824
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
|
|
2714
2825
|
}
|
|
2715
|
-
|
|
2826
|
+
const obj_messageCode = obj.messageCode;
|
|
2827
|
+
const path_messageCode = path + '.messageCode';
|
|
2828
|
+
if (typeof obj_messageCode !== 'string') {
|
|
2829
|
+
return new TypeError('Expected "string" but received "' + typeof obj_messageCode + '" (at "' + path_messageCode + '")');
|
|
2830
|
+
}
|
|
2831
|
+
})();
|
|
2832
|
+
return v_error === undefined ? null : v_error;
|
|
2833
|
+
}
|
|
2834
|
+
const select$7 = function EinsteinPromptTemplateSupportedLanguageErrorRepresentationSelect() {
|
|
2835
|
+
return {
|
|
2836
|
+
kind: 'Fragment',
|
|
2837
|
+
version: VERSION$4,
|
|
2838
|
+
private: [],
|
|
2839
|
+
selections: [
|
|
2840
|
+
{
|
|
2841
|
+
name: 'errorMessage',
|
|
2842
|
+
kind: 'Scalar'
|
|
2843
|
+
},
|
|
2844
|
+
{
|
|
2845
|
+
name: 'messageCode',
|
|
2846
|
+
kind: 'Scalar'
|
|
2847
|
+
}
|
|
2848
|
+
]
|
|
2849
|
+
};
|
|
2850
|
+
};
|
|
2851
|
+
function equals$4(existing, incoming) {
|
|
2852
|
+
const existing_errorMessage = existing.errorMessage;
|
|
2853
|
+
const incoming_errorMessage = incoming.errorMessage;
|
|
2854
|
+
if (!(existing_errorMessage === incoming_errorMessage)) {
|
|
2855
|
+
return false;
|
|
2856
|
+
}
|
|
2857
|
+
const existing_messageCode = existing.messageCode;
|
|
2858
|
+
const incoming_messageCode = incoming.messageCode;
|
|
2859
|
+
if (!(existing_messageCode === incoming_messageCode)) {
|
|
2860
|
+
return false;
|
|
2861
|
+
}
|
|
2862
|
+
return true;
|
|
2863
|
+
}
|
|
2864
|
+
|
|
2865
|
+
const VERSION$3 = "65a17d345c28eeca91872a73d8ffe9fd";
|
|
2866
|
+
function validate$4(obj, path = 'EinsteinPromptTemplateSupportedLanguageRepresentation') {
|
|
2867
|
+
const v_error = (() => {
|
|
2868
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2869
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2870
|
+
}
|
|
2871
|
+
const obj_languageCode = obj.languageCode;
|
|
2872
|
+
const path_languageCode = path + '.languageCode';
|
|
2873
|
+
if (typeof obj_languageCode !== 'string') {
|
|
2874
|
+
return new TypeError('Expected "string" but received "' + typeof obj_languageCode + '" (at "' + path_languageCode + '")');
|
|
2875
|
+
}
|
|
2876
|
+
const obj_languageDisplayName = obj.languageDisplayName;
|
|
2877
|
+
const path_languageDisplayName = path + '.languageDisplayName';
|
|
2878
|
+
if (typeof obj_languageDisplayName !== 'string') {
|
|
2879
|
+
return new TypeError('Expected "string" but received "' + typeof obj_languageDisplayName + '" (at "' + path_languageDisplayName + '")');
|
|
2880
|
+
}
|
|
2881
|
+
})();
|
|
2882
|
+
return v_error === undefined ? null : v_error;
|
|
2883
|
+
}
|
|
2884
|
+
const select$6 = function EinsteinPromptTemplateSupportedLanguageRepresentationSelect() {
|
|
2885
|
+
return {
|
|
2886
|
+
kind: 'Fragment',
|
|
2887
|
+
version: VERSION$3,
|
|
2888
|
+
private: [],
|
|
2889
|
+
selections: [
|
|
2890
|
+
{
|
|
2891
|
+
name: 'languageCode',
|
|
2892
|
+
kind: 'Scalar'
|
|
2893
|
+
},
|
|
2894
|
+
{
|
|
2895
|
+
name: 'languageDisplayName',
|
|
2896
|
+
kind: 'Scalar'
|
|
2897
|
+
}
|
|
2898
|
+
]
|
|
2899
|
+
};
|
|
2900
|
+
};
|
|
2901
|
+
function equals$3(existing, incoming) {
|
|
2902
|
+
const existing_languageCode = existing.languageCode;
|
|
2903
|
+
const incoming_languageCode = incoming.languageCode;
|
|
2904
|
+
if (!(existing_languageCode === incoming_languageCode)) {
|
|
2905
|
+
return false;
|
|
2906
|
+
}
|
|
2907
|
+
const existing_languageDisplayName = existing.languageDisplayName;
|
|
2908
|
+
const incoming_languageDisplayName = incoming.languageDisplayName;
|
|
2909
|
+
if (!(existing_languageDisplayName === incoming_languageDisplayName)) {
|
|
2910
|
+
return false;
|
|
2911
|
+
}
|
|
2912
|
+
return true;
|
|
2913
|
+
}
|
|
2914
|
+
|
|
2915
|
+
const TTL$2 = 100;
|
|
2916
|
+
const VERSION$2 = "c635f260bce9a11f7c3bf31d60f42b53";
|
|
2917
|
+
function validate$3(obj, path = 'EinsteinPromptTemplateVersionOutputLanguagesRepresentation') {
|
|
2918
|
+
const v_error = (() => {
|
|
2919
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2920
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2921
|
+
}
|
|
2922
|
+
const obj_errors = obj.errors;
|
|
2923
|
+
const path_errors = path + '.errors';
|
|
2924
|
+
if (!ArrayIsArray(obj_errors)) {
|
|
2925
|
+
return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
|
|
2926
|
+
}
|
|
2927
|
+
for (let i = 0; i < obj_errors.length; i++) {
|
|
2928
|
+
const obj_errors_item = obj_errors[i];
|
|
2929
|
+
const path_errors_item = path_errors + '[' + i + ']';
|
|
2930
|
+
const referencepath_errors_itemValidationError = validate$5(obj_errors_item, path_errors_item);
|
|
2931
|
+
if (referencepath_errors_itemValidationError !== null) {
|
|
2932
|
+
let message = 'Object doesn\'t match EinsteinPromptTemplateSupportedLanguageErrorRepresentation (at "' + path_errors_item + '")\n';
|
|
2933
|
+
message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2934
|
+
return new TypeError(message);
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2937
|
+
const obj_isSuccess = obj.isSuccess;
|
|
2938
|
+
const path_isSuccess = path + '.isSuccess';
|
|
2939
|
+
if (typeof obj_isSuccess !== 'boolean') {
|
|
2940
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
|
|
2941
|
+
}
|
|
2942
|
+
const obj_promptTemplateDevName = obj.promptTemplateDevName;
|
|
2943
|
+
const path_promptTemplateDevName = path + '.promptTemplateDevName';
|
|
2944
|
+
if (typeof obj_promptTemplateDevName !== 'string') {
|
|
2945
|
+
return new TypeError('Expected "string" but received "' + typeof obj_promptTemplateDevName + '" (at "' + path_promptTemplateDevName + '")');
|
|
2946
|
+
}
|
|
2947
|
+
const obj_supportedLanguages = obj.supportedLanguages;
|
|
2948
|
+
const path_supportedLanguages = path + '.supportedLanguages';
|
|
2949
|
+
if (!ArrayIsArray(obj_supportedLanguages)) {
|
|
2950
|
+
return new TypeError('Expected "array" but received "' + typeof obj_supportedLanguages + '" (at "' + path_supportedLanguages + '")');
|
|
2951
|
+
}
|
|
2952
|
+
for (let i = 0; i < obj_supportedLanguages.length; i++) {
|
|
2953
|
+
const obj_supportedLanguages_item = obj_supportedLanguages[i];
|
|
2954
|
+
const path_supportedLanguages_item = path_supportedLanguages + '[' + i + ']';
|
|
2955
|
+
const referencepath_supportedLanguages_itemValidationError = validate$4(obj_supportedLanguages_item, path_supportedLanguages_item);
|
|
2956
|
+
if (referencepath_supportedLanguages_itemValidationError !== null) {
|
|
2957
|
+
let message = 'Object doesn\'t match EinsteinPromptTemplateSupportedLanguageRepresentation (at "' + path_supportedLanguages_item + '")\n';
|
|
2958
|
+
message += referencepath_supportedLanguages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2959
|
+
return new TypeError(message);
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2962
|
+
const obj_versionId = obj.versionId;
|
|
2963
|
+
const path_versionId = path + '.versionId';
|
|
2964
|
+
if (typeof obj_versionId !== 'string') {
|
|
2965
|
+
return new TypeError('Expected "string" but received "' + typeof obj_versionId + '" (at "' + path_versionId + '")');
|
|
2966
|
+
}
|
|
2967
|
+
})();
|
|
2968
|
+
return v_error === undefined ? null : v_error;
|
|
2969
|
+
}
|
|
2970
|
+
const RepresentationType$2 = 'EinsteinPromptTemplateVersionOutputLanguagesRepresentation';
|
|
2971
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
2972
|
+
return input;
|
|
2973
|
+
}
|
|
2974
|
+
const select$5 = function EinsteinPromptTemplateVersionOutputLanguagesRepresentationSelect() {
|
|
2975
|
+
const { selections: EinsteinPromptTemplateSupportedLanguageErrorRepresentation__selections, opaque: EinsteinPromptTemplateSupportedLanguageErrorRepresentation__opaque, } = select$7();
|
|
2976
|
+
const { selections: EinsteinPromptTemplateSupportedLanguageRepresentation__selections, opaque: EinsteinPromptTemplateSupportedLanguageRepresentation__opaque, } = select$6();
|
|
2977
|
+
return {
|
|
2978
|
+
kind: 'Fragment',
|
|
2979
|
+
version: VERSION$2,
|
|
2980
|
+
private: [],
|
|
2981
|
+
selections: [
|
|
2982
|
+
{
|
|
2983
|
+
name: 'errors',
|
|
2984
|
+
kind: 'Object',
|
|
2985
|
+
plural: true,
|
|
2986
|
+
selections: EinsteinPromptTemplateSupportedLanguageErrorRepresentation__selections
|
|
2987
|
+
},
|
|
2988
|
+
{
|
|
2989
|
+
name: 'isSuccess',
|
|
2990
|
+
kind: 'Scalar'
|
|
2991
|
+
},
|
|
2992
|
+
{
|
|
2993
|
+
name: 'promptTemplateDevName',
|
|
2994
|
+
kind: 'Scalar'
|
|
2995
|
+
},
|
|
2996
|
+
{
|
|
2997
|
+
name: 'supportedLanguages',
|
|
2998
|
+
kind: 'Object',
|
|
2999
|
+
plural: true,
|
|
3000
|
+
selections: EinsteinPromptTemplateSupportedLanguageRepresentation__selections
|
|
3001
|
+
},
|
|
3002
|
+
{
|
|
3003
|
+
name: 'versionId',
|
|
3004
|
+
kind: 'Scalar'
|
|
3005
|
+
}
|
|
3006
|
+
]
|
|
3007
|
+
};
|
|
3008
|
+
};
|
|
3009
|
+
function equals$2(existing, incoming) {
|
|
3010
|
+
const existing_isSuccess = existing.isSuccess;
|
|
3011
|
+
const incoming_isSuccess = incoming.isSuccess;
|
|
3012
|
+
if (!(existing_isSuccess === incoming_isSuccess)) {
|
|
3013
|
+
return false;
|
|
3014
|
+
}
|
|
3015
|
+
const existing_promptTemplateDevName = existing.promptTemplateDevName;
|
|
3016
|
+
const incoming_promptTemplateDevName = incoming.promptTemplateDevName;
|
|
3017
|
+
if (!(existing_promptTemplateDevName === incoming_promptTemplateDevName)) {
|
|
3018
|
+
return false;
|
|
3019
|
+
}
|
|
3020
|
+
const existing_versionId = existing.versionId;
|
|
3021
|
+
const incoming_versionId = incoming.versionId;
|
|
3022
|
+
if (!(existing_versionId === incoming_versionId)) {
|
|
3023
|
+
return false;
|
|
3024
|
+
}
|
|
3025
|
+
const existing_errors = existing.errors;
|
|
3026
|
+
const incoming_errors = incoming.errors;
|
|
3027
|
+
const equals_errors_items = equalsArray(existing_errors, incoming_errors, (existing_errors_item, incoming_errors_item) => {
|
|
3028
|
+
if (!(equals$4(existing_errors_item, incoming_errors_item))) {
|
|
3029
|
+
return false;
|
|
3030
|
+
}
|
|
3031
|
+
});
|
|
3032
|
+
if (equals_errors_items === false) {
|
|
3033
|
+
return false;
|
|
3034
|
+
}
|
|
3035
|
+
const existing_supportedLanguages = existing.supportedLanguages;
|
|
3036
|
+
const incoming_supportedLanguages = incoming.supportedLanguages;
|
|
3037
|
+
const equals_supportedLanguages_items = equalsArray(existing_supportedLanguages, incoming_supportedLanguages, (existing_supportedLanguages_item, incoming_supportedLanguages_item) => {
|
|
3038
|
+
if (!(equals$3(existing_supportedLanguages_item, incoming_supportedLanguages_item))) {
|
|
3039
|
+
return false;
|
|
3040
|
+
}
|
|
3041
|
+
});
|
|
3042
|
+
if (equals_supportedLanguages_items === false) {
|
|
3043
|
+
return false;
|
|
3044
|
+
}
|
|
3045
|
+
return true;
|
|
3046
|
+
}
|
|
3047
|
+
const ingest$2 = function EinsteinPromptTemplateVersionOutputLanguagesRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
3048
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3049
|
+
const validateError = validate$3(input);
|
|
3050
|
+
if (validateError !== null) {
|
|
3051
|
+
throw validateError;
|
|
3052
|
+
}
|
|
3053
|
+
}
|
|
3054
|
+
const key = path.fullPath;
|
|
3055
|
+
const ttlToUse = TTL$2;
|
|
3056
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "EinsteinLLM", VERSION$2, RepresentationType$2, equals$2);
|
|
3057
|
+
return createLink(key);
|
|
3058
|
+
};
|
|
3059
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
3060
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
3061
|
+
const rootKey = fullPathFactory();
|
|
3062
|
+
rootKeySet.set(rootKey, {
|
|
3063
|
+
namespace: keyPrefix,
|
|
3064
|
+
representationName: RepresentationType$2,
|
|
3065
|
+
mergeable: false
|
|
3066
|
+
});
|
|
3067
|
+
}
|
|
3068
|
+
|
|
3069
|
+
function select$4(luvio, params) {
|
|
3070
|
+
return select$5();
|
|
3071
|
+
}
|
|
3072
|
+
function keyBuilder$5(luvio, params) {
|
|
3073
|
+
return keyPrefix + '::EinsteinPromptTemplateVersionOutputLanguagesRepresentation:(' + 'useStandardVersion:' + params.queryParams.useStandardVersion + ',' + 'versionId:' + params.queryParams.versionId + ',' + 'promptTemplateDevName:' + params.urlParams.promptTemplateDevName + ')';
|
|
3074
|
+
}
|
|
3075
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
3076
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$5(luvio, resourceParams));
|
|
3077
|
+
}
|
|
3078
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
3079
|
+
const { body } = response;
|
|
3080
|
+
const key = keyBuilder$5(luvio, resourceParams);
|
|
3081
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
3082
|
+
const snapshot = luvio.storeLookup({
|
|
3083
|
+
recordId: key,
|
|
3084
|
+
node: select$4(),
|
|
3085
|
+
variables: {},
|
|
3086
|
+
}, snapshotRefresh);
|
|
3087
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3088
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
3089
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
3090
|
+
}
|
|
3091
|
+
}
|
|
3092
|
+
deepFreeze(snapshot.data);
|
|
3093
|
+
return snapshot;
|
|
3094
|
+
}
|
|
3095
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
3096
|
+
const key = keyBuilder$5(luvio, params);
|
|
3097
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
3098
|
+
const storeMetadataParams = {
|
|
3099
|
+
ttl: TTL$2,
|
|
3100
|
+
namespace: keyPrefix,
|
|
3101
|
+
version: VERSION$2,
|
|
3102
|
+
representationName: RepresentationType$2
|
|
3103
|
+
};
|
|
3104
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
3105
|
+
return errorSnapshot;
|
|
3106
|
+
}
|
|
3107
|
+
function createResourceRequest$2(config) {
|
|
3108
|
+
const headers = {};
|
|
3109
|
+
return {
|
|
3110
|
+
baseUri: '/services/data/v63.0',
|
|
3111
|
+
basePath: '/einstein/prompt-template/' + config.urlParams.promptTemplateDevName + '/output-languages',
|
|
3112
|
+
method: 'get',
|
|
3113
|
+
body: null,
|
|
3114
|
+
urlParams: config.urlParams,
|
|
3115
|
+
queryParams: config.queryParams,
|
|
3116
|
+
headers,
|
|
3117
|
+
priority: 'normal',
|
|
3118
|
+
};
|
|
3119
|
+
}
|
|
3120
|
+
|
|
3121
|
+
const adapterName$2 = 'getOutputLanguages';
|
|
3122
|
+
const getOutputLanguages_ConfigPropertyMetadata = [
|
|
3123
|
+
generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
3124
|
+
generateParamConfigMetadata('useStandardVersion', false, 1 /* QueryParameter */, 1 /* Boolean */),
|
|
3125
|
+
generateParamConfigMetadata('versionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
3126
|
+
];
|
|
3127
|
+
const getOutputLanguages_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getOutputLanguages_ConfigPropertyMetadata);
|
|
3128
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$7(getOutputLanguages_ConfigPropertyMetadata);
|
|
3129
|
+
function keyBuilder$4(luvio, config) {
|
|
3130
|
+
const resourceParams = createResourceParams$2(config);
|
|
3131
|
+
return keyBuilder$5(luvio, resourceParams);
|
|
3132
|
+
}
|
|
3133
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
3134
|
+
const config = {};
|
|
3135
|
+
typeCheckConfig$7(untrustedConfig, config, getOutputLanguages_ConfigPropertyMetadata);
|
|
3136
|
+
return config;
|
|
3137
|
+
}
|
|
3138
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
3139
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3140
|
+
return null;
|
|
3141
|
+
}
|
|
3142
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3143
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3144
|
+
}
|
|
3145
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
3146
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3147
|
+
return null;
|
|
3148
|
+
}
|
|
3149
|
+
return config;
|
|
3150
|
+
}
|
|
3151
|
+
function adapterFragment$2(luvio, config) {
|
|
3152
|
+
createResourceParams$2(config);
|
|
3153
|
+
return select$4();
|
|
3154
|
+
}
|
|
3155
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
3156
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
3157
|
+
config,
|
|
3158
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
3159
|
+
});
|
|
3160
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3161
|
+
}
|
|
3162
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
3163
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
3164
|
+
config,
|
|
3165
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
3166
|
+
});
|
|
3167
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3168
|
+
}
|
|
3169
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
3170
|
+
const resourceParams = createResourceParams$2(config);
|
|
3171
|
+
const request = createResourceRequest$2(resourceParams);
|
|
3172
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3173
|
+
.then((response) => {
|
|
3174
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
3175
|
+
const cache = new StoreKeyMap();
|
|
3176
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
3177
|
+
return cache;
|
|
3178
|
+
});
|
|
3179
|
+
}, (response) => {
|
|
3180
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
3181
|
+
});
|
|
3182
|
+
}
|
|
3183
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
3184
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
|
|
3185
|
+
}
|
|
3186
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
3187
|
+
const { luvio, config } = context;
|
|
3188
|
+
const selector = {
|
|
3189
|
+
recordId: keyBuilder$4(luvio, config),
|
|
3190
|
+
node: adapterFragment$2(luvio, config),
|
|
3191
|
+
variables: {},
|
|
3192
|
+
};
|
|
3193
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
3194
|
+
config,
|
|
3195
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
3196
|
+
});
|
|
3197
|
+
return cacheSnapshot;
|
|
3198
|
+
}
|
|
3199
|
+
const getOutputLanguagesAdapterFactory = (luvio) => function EinsteinLLM__getOutputLanguages(untrustedConfig, requestContext) {
|
|
3200
|
+
const config = validateAdapterConfig$2(untrustedConfig, getOutputLanguages_ConfigPropertyNames);
|
|
3201
|
+
// Invalid or incomplete config
|
|
3202
|
+
if (config === null) {
|
|
3203
|
+
return null;
|
|
3204
|
+
}
|
|
3205
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
3206
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
3207
|
+
};
|
|
3208
|
+
|
|
3209
|
+
function validate$2(obj, path = 'EinsteinPromptRecordFieldRepresentation') {
|
|
3210
|
+
const v_error = (() => {
|
|
3211
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3212
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3213
|
+
}
|
|
3214
|
+
const obj_displayValue = obj.displayValue;
|
|
3215
|
+
const path_displayValue = path + '.displayValue';
|
|
3216
|
+
if (typeof obj_displayValue !== 'string') {
|
|
3217
|
+
return new TypeError('Expected "string" but received "' + typeof obj_displayValue + '" (at "' + path_displayValue + '")');
|
|
3218
|
+
}
|
|
3219
|
+
const obj_value = obj.value;
|
|
3220
|
+
const path_value = path + '.value';
|
|
3221
|
+
let obj_value_union0 = null;
|
|
3222
|
+
const obj_value_union0_error = (() => {
|
|
3223
|
+
if (typeof obj_value !== 'boolean') {
|
|
3224
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
3225
|
+
}
|
|
3226
|
+
})();
|
|
3227
|
+
if (obj_value_union0_error != null) {
|
|
3228
|
+
obj_value_union0 = obj_value_union0_error.message;
|
|
3229
|
+
}
|
|
3230
|
+
let obj_value_union1 = null;
|
|
2716
3231
|
const obj_value_union1_error = (() => {
|
|
2717
3232
|
if (typeof obj_value !== 'number' || (typeof obj_value === 'number' && Math.floor(obj_value) !== obj_value)) {
|
|
2718
3233
|
return new TypeError('Expected "integer" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
@@ -2751,6 +3266,8 @@ function validate$2(obj, path = 'EinsteinPromptRecordFieldRepresentation') {
|
|
|
2751
3266
|
return v_error === undefined ? null : v_error;
|
|
2752
3267
|
}
|
|
2753
3268
|
|
|
3269
|
+
const TTL$1 = 100;
|
|
3270
|
+
const VERSION$1 = "2d1628544b54fc1701aa9b4eff05127b";
|
|
2754
3271
|
function validate$1(obj, path = 'EinsteinPromptRecordRepresentation') {
|
|
2755
3272
|
const v_error = (() => {
|
|
2756
3273
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
@@ -2774,11 +3291,18 @@ function validate$1(obj, path = 'EinsteinPromptRecordRepresentation') {
|
|
|
2774
3291
|
const key = obj_childRelationships_keys[i];
|
|
2775
3292
|
const obj_childRelationships_prop = obj_childRelationships[key];
|
|
2776
3293
|
const path_childRelationships_prop = path_childRelationships + '["' + key + '"]';
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
3294
|
+
if (!ArrayIsArray(obj_childRelationships_prop)) {
|
|
3295
|
+
return new TypeError('Expected "array" but received "' + typeof obj_childRelationships_prop + '" (at "' + path_childRelationships_prop + '")');
|
|
3296
|
+
}
|
|
3297
|
+
for (let i = 0; i < obj_childRelationships_prop.length; i++) {
|
|
3298
|
+
const obj_childRelationships_prop_item = obj_childRelationships_prop[i];
|
|
3299
|
+
const path_childRelationships_prop_item = path_childRelationships_prop + '[' + i + ']';
|
|
3300
|
+
const referencepath_childRelationships_prop_itemValidationError = validate$1(obj_childRelationships_prop_item, path_childRelationships_prop_item);
|
|
3301
|
+
if (referencepath_childRelationships_prop_itemValidationError !== null) {
|
|
3302
|
+
let message = 'Object doesn\'t match EinsteinPromptRecordRepresentation (at "' + path_childRelationships_prop_item + '")\n';
|
|
3303
|
+
message += referencepath_childRelationships_prop_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3304
|
+
return new TypeError(message);
|
|
3305
|
+
}
|
|
2782
3306
|
}
|
|
2783
3307
|
}
|
|
2784
3308
|
}
|
|
@@ -2811,9 +3335,187 @@ function validate$1(obj, path = 'EinsteinPromptRecordRepresentation') {
|
|
|
2811
3335
|
})();
|
|
2812
3336
|
return v_error === undefined ? null : v_error;
|
|
2813
3337
|
}
|
|
3338
|
+
const RepresentationType$1 = 'EinsteinPromptRecordRepresentation';
|
|
3339
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
3340
|
+
return input;
|
|
3341
|
+
}
|
|
3342
|
+
const select$3 = function EinsteinPromptRecordRepresentationSelect() {
|
|
3343
|
+
return {
|
|
3344
|
+
kind: 'Fragment',
|
|
3345
|
+
version: VERSION$1,
|
|
3346
|
+
private: [],
|
|
3347
|
+
opaque: true
|
|
3348
|
+
};
|
|
3349
|
+
};
|
|
3350
|
+
function equals$1(existing, incoming) {
|
|
3351
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
3352
|
+
return false;
|
|
3353
|
+
}
|
|
3354
|
+
return true;
|
|
3355
|
+
}
|
|
3356
|
+
const ingest$1 = function EinsteinPromptRecordRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
3357
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3358
|
+
const validateError = validate$1(input);
|
|
3359
|
+
if (validateError !== null) {
|
|
3360
|
+
throw validateError;
|
|
3361
|
+
}
|
|
3362
|
+
}
|
|
3363
|
+
const key = path.fullPath;
|
|
3364
|
+
const ttlToUse = TTL$1;
|
|
3365
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "EinsteinLLM", VERSION$1, RepresentationType$1, equals$1);
|
|
3366
|
+
return createLink(key);
|
|
3367
|
+
};
|
|
3368
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
3369
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
3370
|
+
const rootKey = fullPathFactory();
|
|
3371
|
+
rootKeySet.set(rootKey, {
|
|
3372
|
+
namespace: keyPrefix,
|
|
3373
|
+
representationName: RepresentationType$1,
|
|
3374
|
+
mergeable: false
|
|
3375
|
+
});
|
|
3376
|
+
}
|
|
3377
|
+
|
|
3378
|
+
function select$2(luvio, params) {
|
|
3379
|
+
return select$3();
|
|
3380
|
+
}
|
|
3381
|
+
function keyBuilder$3(luvio, params) {
|
|
3382
|
+
return keyPrefix + '::EinsteinPromptRecordRepresentation:(' + 'versionId:' + params.queryParams.versionId + ',' + 'promptTemplateDevName:' + params.urlParams.promptTemplateDevName + ')';
|
|
3383
|
+
}
|
|
3384
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
3385
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
|
|
3386
|
+
}
|
|
3387
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
3388
|
+
const { body } = response;
|
|
3389
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
3390
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
3391
|
+
const snapshot = luvio.storeLookup({
|
|
3392
|
+
recordId: key,
|
|
3393
|
+
node: select$2(),
|
|
3394
|
+
variables: {},
|
|
3395
|
+
}, snapshotRefresh);
|
|
3396
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3397
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
3398
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
3399
|
+
}
|
|
3400
|
+
}
|
|
3401
|
+
deepFreeze(snapshot.data);
|
|
3402
|
+
return snapshot;
|
|
3403
|
+
}
|
|
3404
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
3405
|
+
const key = keyBuilder$3(luvio, params);
|
|
3406
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
3407
|
+
const storeMetadataParams = {
|
|
3408
|
+
ttl: TTL$1,
|
|
3409
|
+
namespace: keyPrefix,
|
|
3410
|
+
version: VERSION$1,
|
|
3411
|
+
representationName: RepresentationType$1
|
|
3412
|
+
};
|
|
3413
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
3414
|
+
return errorSnapshot;
|
|
3415
|
+
}
|
|
3416
|
+
function createResourceRequest$1(config) {
|
|
3417
|
+
const headers = {};
|
|
3418
|
+
return {
|
|
3419
|
+
baseUri: '/services/data/v63.0',
|
|
3420
|
+
basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '',
|
|
3421
|
+
method: 'get',
|
|
3422
|
+
body: null,
|
|
3423
|
+
urlParams: config.urlParams,
|
|
3424
|
+
queryParams: config.queryParams,
|
|
3425
|
+
headers,
|
|
3426
|
+
priority: 'normal',
|
|
3427
|
+
};
|
|
3428
|
+
}
|
|
3429
|
+
|
|
3430
|
+
const adapterName$1 = 'getPromptTemplate';
|
|
3431
|
+
const getPromptTemplate_ConfigPropertyMetadata = [
|
|
3432
|
+
generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
3433
|
+
generateParamConfigMetadata('versionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
3434
|
+
];
|
|
3435
|
+
const getPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getPromptTemplate_ConfigPropertyMetadata);
|
|
3436
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$7(getPromptTemplate_ConfigPropertyMetadata);
|
|
3437
|
+
function keyBuilder$2(luvio, config) {
|
|
3438
|
+
const resourceParams = createResourceParams$1(config);
|
|
3439
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
3440
|
+
}
|
|
3441
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
3442
|
+
const config = {};
|
|
3443
|
+
typeCheckConfig$7(untrustedConfig, config, getPromptTemplate_ConfigPropertyMetadata);
|
|
3444
|
+
return config;
|
|
3445
|
+
}
|
|
3446
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
3447
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3448
|
+
return null;
|
|
3449
|
+
}
|
|
3450
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3451
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3452
|
+
}
|
|
3453
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
3454
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3455
|
+
return null;
|
|
3456
|
+
}
|
|
3457
|
+
return config;
|
|
3458
|
+
}
|
|
3459
|
+
function adapterFragment$1(luvio, config) {
|
|
3460
|
+
createResourceParams$1(config);
|
|
3461
|
+
return select$2();
|
|
3462
|
+
}
|
|
3463
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
3464
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
3465
|
+
config,
|
|
3466
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
3467
|
+
});
|
|
3468
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3469
|
+
}
|
|
3470
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
3471
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
3472
|
+
config,
|
|
3473
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
3474
|
+
});
|
|
3475
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3476
|
+
}
|
|
3477
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
3478
|
+
const resourceParams = createResourceParams$1(config);
|
|
3479
|
+
const request = createResourceRequest$1(resourceParams);
|
|
3480
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3481
|
+
.then((response) => {
|
|
3482
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
3483
|
+
const cache = new StoreKeyMap();
|
|
3484
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
3485
|
+
return cache;
|
|
3486
|
+
});
|
|
3487
|
+
}, (response) => {
|
|
3488
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
3489
|
+
});
|
|
3490
|
+
}
|
|
3491
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
3492
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
3493
|
+
}
|
|
3494
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
3495
|
+
const { luvio, config } = context;
|
|
3496
|
+
const selector = {
|
|
3497
|
+
recordId: keyBuilder$2(luvio, config),
|
|
3498
|
+
node: adapterFragment$1(luvio, config),
|
|
3499
|
+
variables: {},
|
|
3500
|
+
};
|
|
3501
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
3502
|
+
config,
|
|
3503
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
3504
|
+
});
|
|
3505
|
+
return cacheSnapshot;
|
|
3506
|
+
}
|
|
3507
|
+
const getPromptTemplateAdapterFactory = (luvio) => function EinsteinLLM__getPromptTemplate(untrustedConfig, requestContext) {
|
|
3508
|
+
const config = validateAdapterConfig$1(untrustedConfig, getPromptTemplate_ConfigPropertyNames);
|
|
3509
|
+
// Invalid or incomplete config
|
|
3510
|
+
if (config === null) {
|
|
3511
|
+
return null;
|
|
3512
|
+
}
|
|
3513
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
3514
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
3515
|
+
};
|
|
2814
3516
|
|
|
2815
3517
|
const TTL = 100;
|
|
2816
|
-
const VERSION = "
|
|
3518
|
+
const VERSION = "5fd7b8a03d155ba601bcb4ee725e0893";
|
|
2817
3519
|
function validate(obj, path = 'EinsteinPromptRecordCollectionOutputRepresentation') {
|
|
2818
3520
|
const v_error = (() => {
|
|
2819
3521
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
@@ -2953,14 +3655,14 @@ const getPromptTemplates_ConfigPropertyMetadata = [
|
|
|
2953
3655
|
generateParamConfigMetadata('sortBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2954
3656
|
];
|
|
2955
3657
|
const getPromptTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getPromptTemplates_ConfigPropertyMetadata);
|
|
2956
|
-
const createResourceParams = /*#__PURE__*/ createResourceParams$
|
|
3658
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$7(getPromptTemplates_ConfigPropertyMetadata);
|
|
2957
3659
|
function keyBuilder(luvio, config) {
|
|
2958
3660
|
const resourceParams = createResourceParams(config);
|
|
2959
3661
|
return keyBuilder$1(luvio, resourceParams);
|
|
2960
3662
|
}
|
|
2961
3663
|
function typeCheckConfig(untrustedConfig) {
|
|
2962
3664
|
const config = {};
|
|
2963
|
-
typeCheckConfig$
|
|
3665
|
+
typeCheckConfig$7(untrustedConfig, config, getPromptTemplates_ConfigPropertyMetadata);
|
|
2964
3666
|
return config;
|
|
2965
3667
|
}
|
|
2966
3668
|
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
@@ -3009,7 +3711,7 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
3009
3711
|
});
|
|
3010
3712
|
}
|
|
3011
3713
|
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
3012
|
-
return buildNetworkSnapshotCachePolicy$
|
|
3714
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
3013
3715
|
}
|
|
3014
3716
|
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
3015
3717
|
const { luvio, config } = context;
|
|
@@ -3038,12 +3740,22 @@ let createEmbeddings;
|
|
|
3038
3740
|
let createFeedback;
|
|
3039
3741
|
let createGenerations;
|
|
3040
3742
|
let createGenerationsForPromptTemplate;
|
|
3743
|
+
let getOutputLanguages;
|
|
3744
|
+
let getPromptTemplate;
|
|
3041
3745
|
let getPromptTemplates;
|
|
3042
3746
|
// Imperative GET Adapters
|
|
3043
3747
|
let createEmbeddings_imperative;
|
|
3748
|
+
let getOutputLanguages_imperative;
|
|
3749
|
+
let getPromptTemplate_imperative;
|
|
3044
3750
|
let getPromptTemplates_imperative;
|
|
3045
3751
|
// Adapter Metadata
|
|
3046
3752
|
const createEmbeddingsMetadata = { apiFamily: 'EinsteinLLM', name: 'createEmbeddings', ttl: 100 };
|
|
3753
|
+
const getOutputLanguagesMetadata = {
|
|
3754
|
+
apiFamily: 'EinsteinLLM',
|
|
3755
|
+
name: 'getOutputLanguages',
|
|
3756
|
+
ttl: 100,
|
|
3757
|
+
};
|
|
3758
|
+
const getPromptTemplateMetadata = { apiFamily: 'EinsteinLLM', name: 'getPromptTemplate', ttl: 100 };
|
|
3047
3759
|
const getPromptTemplatesMetadata = {
|
|
3048
3760
|
apiFamily: 'EinsteinLLM',
|
|
3049
3761
|
name: 'getPromptTemplates',
|
|
@@ -3053,6 +3765,8 @@ const getPromptTemplatesMetadata = {
|
|
|
3053
3765
|
function bindExportsTo(luvio) {
|
|
3054
3766
|
// LDS Adapters
|
|
3055
3767
|
const createEmbeddings_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'createEmbeddings', createEmbeddingsAdapterFactory), createEmbeddingsMetadata);
|
|
3768
|
+
const getOutputLanguages_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getOutputLanguages', getOutputLanguagesAdapterFactory), getOutputLanguagesMetadata);
|
|
3769
|
+
const getPromptTemplate_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getPromptTemplate', getPromptTemplateAdapterFactory), getPromptTemplateMetadata);
|
|
3056
3770
|
const getPromptTemplates_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getPromptTemplates', getPromptTemplatesAdapterFactory), getPromptTemplatesMetadata);
|
|
3057
3771
|
function unwrapSnapshotData(factory) {
|
|
3058
3772
|
const adapter = factory(luvio);
|
|
@@ -3063,9 +3777,13 @@ function bindExportsTo(luvio) {
|
|
|
3063
3777
|
createFeedback: unwrapSnapshotData(createFeedbackAdapterFactory),
|
|
3064
3778
|
createGenerations: unwrapSnapshotData(createGenerationsAdapterFactory),
|
|
3065
3779
|
createGenerationsForPromptTemplate: unwrapSnapshotData(createGenerationsForPromptTemplateAdapterFactory),
|
|
3780
|
+
getOutputLanguages: createWireAdapterConstructor(luvio, getOutputLanguages_ldsAdapter, getOutputLanguagesMetadata),
|
|
3781
|
+
getPromptTemplate: createWireAdapterConstructor(luvio, getPromptTemplate_ldsAdapter, getPromptTemplateMetadata),
|
|
3066
3782
|
getPromptTemplates: createWireAdapterConstructor(luvio, getPromptTemplates_ldsAdapter, getPromptTemplatesMetadata),
|
|
3067
3783
|
// Imperative GET Adapters
|
|
3068
3784
|
createEmbeddings_imperative: createImperativeAdapter(luvio, createEmbeddings_ldsAdapter, createEmbeddingsMetadata),
|
|
3785
|
+
getOutputLanguages_imperative: createImperativeAdapter(luvio, getOutputLanguages_ldsAdapter, getOutputLanguagesMetadata),
|
|
3786
|
+
getPromptTemplate_imperative: createImperativeAdapter(luvio, getPromptTemplate_ldsAdapter, getPromptTemplateMetadata),
|
|
3069
3787
|
getPromptTemplates_imperative: createImperativeAdapter(luvio, getPromptTemplates_ldsAdapter, getPromptTemplatesMetadata),
|
|
3070
3788
|
// Notify Update Availables
|
|
3071
3789
|
};
|
|
@@ -3076,11 +3794,15 @@ withDefaultLuvio((luvio) => {
|
|
|
3076
3794
|
createFeedback,
|
|
3077
3795
|
createGenerations,
|
|
3078
3796
|
createGenerationsForPromptTemplate,
|
|
3797
|
+
getOutputLanguages,
|
|
3798
|
+
getPromptTemplate,
|
|
3079
3799
|
getPromptTemplates,
|
|
3080
3800
|
createEmbeddings_imperative,
|
|
3801
|
+
getOutputLanguages_imperative,
|
|
3802
|
+
getPromptTemplate_imperative,
|
|
3081
3803
|
getPromptTemplates_imperative,
|
|
3082
3804
|
} = bindExportsTo(luvio));
|
|
3083
3805
|
});
|
|
3084
3806
|
|
|
3085
|
-
export { createEmbeddings, createEmbeddings_imperative, createFeedback, createGenerations, createGenerationsForPromptTemplate, getPromptTemplates, getPromptTemplates_imperative };
|
|
3086
|
-
// version: 1.332.0-
|
|
3807
|
+
export { createEmbeddings, createEmbeddings_imperative, createFeedback, createGenerations, createGenerationsForPromptTemplate, getOutputLanguages, getOutputLanguages_imperative, getPromptTemplate, getPromptTemplate_imperative, getPromptTemplates, getPromptTemplates_imperative };
|
|
3808
|
+
// version: 1.332.0-dev20-8600de247a
|