@salesforce/lds-adapters-service-einsteinllm 1.380.0-dev1 → 1.380.0-dev11
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 +2234 -491
- package/dist/es/es2018/types/src/generated/adapters/createPromptTemplate.d.ts +2 -3
- package/dist/es/es2018/types/src/generated/adapters/createPromptTemplateVersion.d.ts +2 -3
- package/dist/es/es2018/types/src/generated/adapters/getDataProviderInstanceConfig.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/adapters/getDataProviderTypeConfigs.d.ts +27 -0
- package/dist/es/es2018/types/src/generated/adapters/getDataProviders.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/adapters/getInputMappedDataProviders.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/adapters/getPromptTemplateVersion.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/adapters/getPromptTemplateVersions.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/adapters/putEinsteinPromptTemplateVersionStatus.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/adapters/updatePromptTemplateVersion.d.ts +2 -3
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +7 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +14 -1
- package/dist/es/es2018/types/src/generated/resources/getEinsteinPromptTemplatesDataProviderTypesByTemplateType.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/resources/getEinsteinPromptTemplatesDataProvidersByTemplateType.d.ts +19 -0
- package/dist/es/es2018/types/src/generated/resources/getEinsteinPromptTemplatesVersionsByPromptTemplateDevName.d.ts +19 -0
- package/dist/es/es2018/types/src/generated/resources/getEinsteinPromptTemplatesVersionsByPromptTemplateDevNameAndVersionId.d.ts +20 -0
- package/dist/es/es2018/types/src/generated/resources/postEinsteinPromptTemplates.d.ts +2 -3
- package/dist/es/es2018/types/src/generated/resources/postEinsteinPromptTemplatesDataProviderDescribe.d.ts +19 -0
- package/dist/es/es2018/types/src/generated/resources/postEinsteinPromptTemplatesDataProvidersMapped.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/resources/postEinsteinPromptTemplatesVersionsByPromptTemplateDevName.d.ts +2 -3
- package/dist/es/es2018/types/src/generated/resources/putEinsteinPromptTemplatesVersionsByPromptTemplateDevNameAndVersionId.d.ts +2 -3
- package/dist/es/es2018/types/src/generated/resources/putEinsteinPromptTemplatesVersionsStatusByPromptTemplateDevNameAndVersionId.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/types/EinsteinLlmGenerationCitationRepresentation.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/EinsteinLlmGenerationGenAiCitedReferenceRepresentation.d.ts +40 -0
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptRecordInputRepresentation.d.ts +5 -8
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateGenerationsRepresentation.d.ts +7 -1
- package/dist/es/es2018/types/src/generated/types/PromptTemplateDataProviderDiscoveryInputRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/PromptTemplateDataProviderInputParamRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/PromptTemplateDataProviderInstanceConfigCollectionRepresentation.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/types/PromptTemplateDataProviderInstanceConfigInputRepresentation.d.ts +38 -0
- package/dist/es/es2018/types/src/generated/types/PromptTemplateDataProviderInstanceConfigRepresentation.d.ts +77 -0
- package/dist/es/es2018/types/src/generated/types/PromptTemplateDataProviderOutputParamRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/PromptTemplateDataProviderTypeConfigCollectionRepresentation.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/types/PromptTemplateDataProviderTypeConfigRepresentation.d.ts +46 -0
- package/dist/es/es2018/types/src/generated/types/WrappedMap.d.ts +3 -3
- package/package.json +4 -4
- package/sfdc/index.js +2496 -682
- package/src/raml/api.raml +365 -10
- package/src/raml/luvio.raml +44 -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$a, StoreKeyMap, createResourceParams as createResourceParams$h, typeCheckConfig as typeCheckConfig$h } 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$B(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$t(obj, path = 'EinsteinLlmEmbeddingsAdditionalConfigInputRepre
|
|
|
222
222
|
return v_error === undefined ? null : v_error;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
function validate$
|
|
225
|
+
function validate$A(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$s(obj, path = 'WrappedListString') {
|
|
|
243
243
|
return v_error === undefined ? null : v_error;
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
function validate$
|
|
246
|
+
function validate$z(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$B(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$r(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$A(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$r(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$p = "5ed5ccc6fa6f15691ec0fc1080e41fe6";
|
|
279
|
+
function validate$y(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$q(obj, path = 'EinsteinLlmEmbeddingItemRepresentation') {
|
|
|
297
297
|
})();
|
|
298
298
|
return v_error === undefined ? null : v_error;
|
|
299
299
|
}
|
|
300
|
-
const select$
|
|
300
|
+
const select$G = function EinsteinLlmEmbeddingItemRepresentationSelect() {
|
|
301
301
|
return {
|
|
302
302
|
kind: 'Fragment',
|
|
303
|
-
version: VERSION$
|
|
303
|
+
version: VERSION$p,
|
|
304
304
|
private: [],
|
|
305
305
|
selections: [
|
|
306
306
|
{
|
|
@@ -315,7 +315,7 @@ const select$u = function EinsteinLlmEmbeddingItemRepresentationSelect() {
|
|
|
315
315
|
]
|
|
316
316
|
};
|
|
317
317
|
};
|
|
318
|
-
function equals$
|
|
318
|
+
function equals$p(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$k(existing, incoming) {
|
|
|
334
334
|
return true;
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
const TTL$
|
|
338
|
-
const VERSION$
|
|
339
|
-
function validate$
|
|
337
|
+
const TTL$a = 100;
|
|
338
|
+
const VERSION$o = "d9873651f09d29764ef4d4231eb653d7";
|
|
339
|
+
function validate$x(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$p(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$y(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$p(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$a = 'EinsteinLlmEmbeddingsRepresentation';
|
|
377
|
+
function normalize$a(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$F = function EinsteinLlmEmbeddingsRepresentationSelect() {
|
|
381
|
+
const { selections: EinsteinLlmEmbeddingItemRepresentation__selections, opaque: EinsteinLlmEmbeddingItemRepresentation__opaque, } = select$G();
|
|
382
382
|
return {
|
|
383
383
|
kind: 'Fragment',
|
|
384
|
-
version: VERSION$
|
|
384
|
+
version: VERSION$o,
|
|
385
385
|
private: [],
|
|
386
386
|
selections: [
|
|
387
387
|
{
|
|
@@ -398,11 +398,11 @@ const select$t = function EinsteinLlmEmbeddingsRepresentationSelect() {
|
|
|
398
398
|
]
|
|
399
399
|
};
|
|
400
400
|
};
|
|
401
|
-
function equals$
|
|
401
|
+
function equals$o(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$p(existing_embeddings_item, incoming_embeddings_item))) {
|
|
406
406
|
return false;
|
|
407
407
|
}
|
|
408
408
|
});
|
|
@@ -421,44 +421,44 @@ function equals$j(existing, incoming) {
|
|
|
421
421
|
}
|
|
422
422
|
return true;
|
|
423
423
|
}
|
|
424
|
-
const ingest$
|
|
424
|
+
const ingest$a = function EinsteinLlmEmbeddingsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
425
425
|
if (process.env.NODE_ENV !== 'production') {
|
|
426
|
-
const validateError = validate$
|
|
426
|
+
const validateError = validate$x(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$a;
|
|
433
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$a, "EinsteinLLM", VERSION$o, RepresentationType$a, equals$o);
|
|
434
434
|
return createLink(key);
|
|
435
435
|
};
|
|
436
|
-
function getTypeCacheKeys$
|
|
436
|
+
function getTypeCacheKeys$a(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$a,
|
|
442
442
|
mergeable: false
|
|
443
443
|
});
|
|
444
444
|
}
|
|
445
445
|
|
|
446
|
-
function select$
|
|
447
|
-
return select$
|
|
446
|
+
function select$E(luvio, params) {
|
|
447
|
+
return select$F();
|
|
448
448
|
}
|
|
449
|
-
function keyBuilder$
|
|
449
|
+
function keyBuilder$n(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$g(storeKeyMap, luvio, resourceParams, response) {
|
|
453
|
+
getTypeCacheKeys$a(storeKeyMap, luvio, response, () => keyBuilder$n(luvio, resourceParams));
|
|
454
454
|
}
|
|
455
|
-
function ingestSuccess$
|
|
455
|
+
function ingestSuccess$g(luvio, resourceParams, response, snapshotRefresh) {
|
|
456
456
|
const { body } = response;
|
|
457
|
-
const key = keyBuilder$
|
|
458
|
-
luvio.storeIngest(key, ingest$
|
|
457
|
+
const key = keyBuilder$n(luvio, resourceParams);
|
|
458
|
+
luvio.storeIngest(key, ingest$a, body);
|
|
459
459
|
const snapshot = luvio.storeLookup({
|
|
460
460
|
recordId: key,
|
|
461
|
-
node: select$
|
|
461
|
+
node: select$E(),
|
|
462
462
|
variables: {},
|
|
463
463
|
}, snapshotRefresh);
|
|
464
464
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -469,19 +469,19 @@ function ingestSuccess$9(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$9(luvio, params, error, snapshotRefresh) {
|
|
473
|
+
const key = keyBuilder$n(luvio, params);
|
|
474
474
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
475
475
|
const storeMetadataParams = {
|
|
476
|
-
ttl: TTL$
|
|
476
|
+
ttl: TTL$a,
|
|
477
477
|
namespace: keyPrefix,
|
|
478
|
-
version: VERSION$
|
|
479
|
-
representationName: RepresentationType$
|
|
478
|
+
version: VERSION$o,
|
|
479
|
+
representationName: RepresentationType$a
|
|
480
480
|
};
|
|
481
481
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
482
482
|
return errorSnapshot;
|
|
483
483
|
}
|
|
484
|
-
function createResourceRequest$
|
|
484
|
+
function createResourceRequest$g(config) {
|
|
485
485
|
const headers = {};
|
|
486
486
|
return {
|
|
487
487
|
baseUri: '/services/data/v65.0',
|
|
@@ -495,97 +495,97 @@ function createResourceRequest$9(config) {
|
|
|
495
495
|
};
|
|
496
496
|
}
|
|
497
497
|
|
|
498
|
-
const adapterName$
|
|
498
|
+
const adapterName$g = '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$g, createEmbeddings_ConfigPropertyMetadata);
|
|
503
|
+
const createResourceParams$g = /*#__PURE__*/ createResourceParams$h(createEmbeddings_ConfigPropertyMetadata);
|
|
504
|
+
function keyBuilder$m(luvio, config) {
|
|
505
|
+
const resourceParams = createResourceParams$g(config);
|
|
506
|
+
return keyBuilder$n(luvio, resourceParams);
|
|
507
507
|
}
|
|
508
|
-
function typeCheckConfig$
|
|
508
|
+
function typeCheckConfig$g(untrustedConfig) {
|
|
509
509
|
const config = {};
|
|
510
510
|
const untrustedConfig_embeddingsInput = untrustedConfig.embeddingsInput;
|
|
511
|
-
const referenceEinsteinLlmEmbeddingsInputRepresentationValidationError = validate$
|
|
511
|
+
const referenceEinsteinLlmEmbeddingsInputRepresentationValidationError = validate$z(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$g(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$g(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$9(luvio, config) {
|
|
531
|
+
createResourceParams$g(config);
|
|
532
|
+
return select$E();
|
|
533
533
|
}
|
|
534
|
-
function onFetchResponseSuccess$
|
|
535
|
-
const snapshot = ingestSuccess$
|
|
534
|
+
function onFetchResponseSuccess$9(luvio, config, resourceParams, response) {
|
|
535
|
+
const snapshot = ingestSuccess$g(luvio, resourceParams, response, {
|
|
536
536
|
config,
|
|
537
|
-
resolve: () => buildNetworkSnapshot$
|
|
537
|
+
resolve: () => buildNetworkSnapshot$g(luvio, config, snapshotRefreshOptions)
|
|
538
538
|
});
|
|
539
539
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
540
540
|
}
|
|
541
|
-
function onFetchResponseError$
|
|
542
|
-
const snapshot = ingestError$
|
|
541
|
+
function onFetchResponseError$9(luvio, config, resourceParams, response) {
|
|
542
|
+
const snapshot = ingestError$9(luvio, resourceParams, response, {
|
|
543
543
|
config,
|
|
544
|
-
resolve: () => buildNetworkSnapshot$
|
|
544
|
+
resolve: () => buildNetworkSnapshot$g(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$g(luvio, config, options) {
|
|
549
|
+
const resourceParams = createResourceParams$g(config);
|
|
550
|
+
const request = createResourceRequest$g(resourceParams);
|
|
551
551
|
return luvio.dispatchResourceRequest(request, options)
|
|
552
552
|
.then((response) => {
|
|
553
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
553
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$9(luvio, config, resourceParams, response), () => {
|
|
554
554
|
const cache = new StoreKeyMap();
|
|
555
|
-
getResponseCacheKeys$
|
|
555
|
+
getResponseCacheKeys$g(cache, luvio, resourceParams, response.body);
|
|
556
556
|
return cache;
|
|
557
557
|
});
|
|
558
558
|
}, (response) => {
|
|
559
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
559
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$9(luvio, config, resourceParams, response));
|
|
560
560
|
});
|
|
561
561
|
}
|
|
562
|
-
function buildNetworkSnapshotCachePolicy$
|
|
563
|
-
return buildNetworkSnapshotCachePolicy$
|
|
562
|
+
function buildNetworkSnapshotCachePolicy$9(context, coercedAdapterRequestContext) {
|
|
563
|
+
return buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext, buildNetworkSnapshot$g, 'get', false);
|
|
564
564
|
}
|
|
565
|
-
function buildCachedSnapshotCachePolicy$
|
|
565
|
+
function buildCachedSnapshotCachePolicy$9(context, storeLookup) {
|
|
566
566
|
const { luvio, config } = context;
|
|
567
567
|
const selector = {
|
|
568
|
-
recordId: keyBuilder$
|
|
569
|
-
node: adapterFragment$
|
|
568
|
+
recordId: keyBuilder$m(luvio, config),
|
|
569
|
+
node: adapterFragment$9(luvio, config),
|
|
570
570
|
variables: {},
|
|
571
571
|
};
|
|
572
572
|
const cacheSnapshot = storeLookup(selector, {
|
|
573
573
|
config,
|
|
574
|
-
resolve: () => buildNetworkSnapshot$
|
|
574
|
+
resolve: () => buildNetworkSnapshot$g(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$g(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$9, buildNetworkSnapshotCachePolicy$9);
|
|
586
586
|
};
|
|
587
587
|
|
|
588
|
-
function validate$
|
|
588
|
+
function validate$w(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$o(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$9 = 100;
|
|
636
|
+
const VERSION$n = "4033328f65865dd5d80c68a7573a4522";
|
|
637
|
+
function validate$v(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$n(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$9 = 'EinsteinLlmFeedbackRepresentation';
|
|
651
|
+
function keyBuilder$l(luvio, config) {
|
|
652
|
+
return keyPrefix + '::' + RepresentationType$9 + ':' + config.message;
|
|
653
653
|
}
|
|
654
654
|
function keyBuilderFromType$3(luvio, object) {
|
|
655
655
|
const keyParams = {
|
|
656
656
|
message: object.message
|
|
657
657
|
};
|
|
658
|
-
return keyBuilder$
|
|
658
|
+
return keyBuilder$l(luvio, keyParams);
|
|
659
659
|
}
|
|
660
|
-
function normalize$
|
|
660
|
+
function normalize$9(input, existing, path, luvio, store, timestamp) {
|
|
661
661
|
return input;
|
|
662
662
|
}
|
|
663
|
-
const select$
|
|
663
|
+
const select$D = function EinsteinLlmFeedbackRepresentationSelect() {
|
|
664
664
|
return {
|
|
665
665
|
kind: 'Fragment',
|
|
666
|
-
version: VERSION$
|
|
666
|
+
version: VERSION$n,
|
|
667
667
|
private: [],
|
|
668
668
|
selections: [
|
|
669
669
|
{
|
|
@@ -673,7 +673,7 @@ const select$r = function EinsteinLlmFeedbackRepresentationSelect() {
|
|
|
673
673
|
]
|
|
674
674
|
};
|
|
675
675
|
};
|
|
676
|
-
function equals$
|
|
676
|
+
function equals$n(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$i(existing, incoming) {
|
|
|
681
681
|
}
|
|
682
682
|
return true;
|
|
683
683
|
}
|
|
684
|
-
const ingest$
|
|
684
|
+
const ingest$9 = function EinsteinLlmFeedbackRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
685
685
|
if (process.env.NODE_ENV !== 'production') {
|
|
686
|
-
const validateError = validate$
|
|
686
|
+
const validateError = validate$v(input);
|
|
687
687
|
if (validateError !== null) {
|
|
688
688
|
throw validateError;
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
691
|
const key = keyBuilderFromType$3(luvio, input);
|
|
692
|
-
const ttlToUse = TTL$
|
|
693
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
692
|
+
const ttlToUse = TTL$9;
|
|
693
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$9, "EinsteinLLM", VERSION$n, RepresentationType$9, equals$n);
|
|
694
694
|
return createLink(key);
|
|
695
695
|
};
|
|
696
|
-
function getTypeCacheKeys$
|
|
696
|
+
function getTypeCacheKeys$9(rootKeySet, luvio, input, fullPathFactory) {
|
|
697
697
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
698
698
|
const rootKey = keyBuilderFromType$3(luvio, input);
|
|
699
699
|
rootKeySet.set(rootKey, {
|
|
700
700
|
namespace: keyPrefix,
|
|
701
|
-
representationName: RepresentationType$
|
|
701
|
+
representationName: RepresentationType$9,
|
|
702
702
|
mergeable: false
|
|
703
703
|
});
|
|
704
704
|
}
|
|
705
705
|
|
|
706
|
-
function select$
|
|
707
|
-
return select$
|
|
706
|
+
function select$C(luvio, params) {
|
|
707
|
+
return select$D();
|
|
708
708
|
}
|
|
709
|
-
function getResponseCacheKeys$
|
|
710
|
-
getTypeCacheKeys$
|
|
709
|
+
function getResponseCacheKeys$f(storeKeyMap, luvio, resourceParams, response) {
|
|
710
|
+
getTypeCacheKeys$9(storeKeyMap, luvio, response);
|
|
711
711
|
}
|
|
712
|
-
function ingestSuccess$
|
|
712
|
+
function ingestSuccess$f(luvio, resourceParams, response) {
|
|
713
713
|
const { body } = response;
|
|
714
714
|
const key = keyBuilderFromType$3(luvio, body);
|
|
715
|
-
luvio.storeIngest(key, ingest$
|
|
715
|
+
luvio.storeIngest(key, ingest$9, body);
|
|
716
716
|
const snapshot = luvio.storeLookup({
|
|
717
717
|
recordId: key,
|
|
718
|
-
node: select$
|
|
718
|
+
node: select$C(),
|
|
719
719
|
variables: {},
|
|
720
720
|
});
|
|
721
721
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -726,7 +726,7 @@ function ingestSuccess$8(luvio, resourceParams, response) {
|
|
|
726
726
|
deepFreeze(snapshot.data);
|
|
727
727
|
return snapshot;
|
|
728
728
|
}
|
|
729
|
-
function createResourceRequest$
|
|
729
|
+
function createResourceRequest$f(config) {
|
|
730
730
|
const headers = {};
|
|
731
731
|
return {
|
|
732
732
|
baseUri: '/services/data/v65.0',
|
|
@@ -740,45 +740,45 @@ function createResourceRequest$8(config) {
|
|
|
740
740
|
};
|
|
741
741
|
}
|
|
742
742
|
|
|
743
|
-
const adapterName$
|
|
743
|
+
const adapterName$f = '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$f, createFeedback_ConfigPropertyMetadata);
|
|
748
|
+
const createResourceParams$f = /*#__PURE__*/ createResourceParams$h(createFeedback_ConfigPropertyMetadata);
|
|
749
|
+
function typeCheckConfig$f(untrustedConfig) {
|
|
750
750
|
const config = {};
|
|
751
751
|
const untrustedConfig_feedbackInput = untrustedConfig.feedbackInput;
|
|
752
|
-
const referenceEinsteinLlmFeedbackInputRepresentationValidationError = validate$
|
|
752
|
+
const referenceEinsteinLlmFeedbackInputRepresentationValidationError = validate$w(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$f(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$f(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$f(luvio, config, options) {
|
|
772
|
+
const resourceParams = createResourceParams$f(config);
|
|
773
|
+
const request = createResourceRequest$f(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$f(luvio, resourceParams, response);
|
|
778
778
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
779
779
|
}, () => {
|
|
780
780
|
const cache = new StoreKeyMap();
|
|
781
|
-
getResponseCacheKeys$
|
|
781
|
+
getResponseCacheKeys$f(cache, luvio, resourceParams, response.body);
|
|
782
782
|
return cache;
|
|
783
783
|
});
|
|
784
784
|
}, (response) => {
|
|
@@ -788,16 +788,16 @@ function buildNetworkSnapshot$8(luvio, config, options) {
|
|
|
788
788
|
}
|
|
789
789
|
const createFeedbackAdapterFactory = (luvio) => {
|
|
790
790
|
return function createFeedback(untrustedConfig) {
|
|
791
|
-
const config = validateAdapterConfig$
|
|
791
|
+
const config = validateAdapterConfig$f(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$f(luvio, config);
|
|
797
797
|
};
|
|
798
798
|
};
|
|
799
799
|
|
|
800
|
-
function validate$
|
|
800
|
+
function validate$u(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$m(obj, path = 'EinsteinLlmAdditionalConfigInputRepresentation'
|
|
|
880
880
|
return v_error === undefined ? null : v_error;
|
|
881
881
|
}
|
|
882
882
|
|
|
883
|
-
function validate$
|
|
883
|
+
function validate$t(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$l(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$u(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$l(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$m = "9ebac74e6f964c363d5fd1913df363af";
|
|
915
|
+
function validate$s(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$k(obj, path = 'EinsteinLlmGenerationsContentQualityRepresentat
|
|
|
948
948
|
})();
|
|
949
949
|
return v_error === undefined ? null : v_error;
|
|
950
950
|
}
|
|
951
|
-
const select$
|
|
951
|
+
const select$B = function EinsteinLlmGenerationsContentQualityRepresentationSelect() {
|
|
952
952
|
return {
|
|
953
953
|
kind: 'Fragment',
|
|
954
|
-
version: VERSION$
|
|
954
|
+
version: VERSION$m,
|
|
955
955
|
private: [],
|
|
956
956
|
selections: [
|
|
957
957
|
{
|
|
@@ -962,7 +962,7 @@ const select$p = function EinsteinLlmGenerationsContentQualityRepresentationSele
|
|
|
962
962
|
]
|
|
963
963
|
};
|
|
964
964
|
};
|
|
965
|
-
function equals$
|
|
965
|
+
function equals$m(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$h(existing, incoming) {
|
|
|
979
979
|
return true;
|
|
980
980
|
}
|
|
981
981
|
|
|
982
|
-
const VERSION$
|
|
983
|
-
function validate$
|
|
982
|
+
const VERSION$l = "77af44a252cb5b45b4d9a8101368d2aa";
|
|
983
|
+
function validate$r(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$j(obj, path = 'EinsteinLlmGenerationsSafetyScoreRepresentation
|
|
|
1184
1184
|
})();
|
|
1185
1185
|
return v_error === undefined ? null : v_error;
|
|
1186
1186
|
}
|
|
1187
|
-
const select$
|
|
1187
|
+
const select$A = function EinsteinLlmGenerationsSafetyScoreRepresentationSelect() {
|
|
1188
1188
|
return {
|
|
1189
1189
|
kind: 'Fragment',
|
|
1190
|
-
version: VERSION$
|
|
1190
|
+
version: VERSION$l,
|
|
1191
1191
|
private: [],
|
|
1192
1192
|
selections: [
|
|
1193
1193
|
{
|
|
@@ -1228,7 +1228,7 @@ const select$o = function EinsteinLlmGenerationsSafetyScoreRepresentationSelect(
|
|
|
1228
1228
|
]
|
|
1229
1229
|
};
|
|
1230
1230
|
};
|
|
1231
|
-
function equals$
|
|
1231
|
+
function equals$l(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$g(existing, incoming) {
|
|
|
1323
1323
|
return true;
|
|
1324
1324
|
}
|
|
1325
1325
|
|
|
1326
|
-
const VERSION$
|
|
1327
|
-
function validate$
|
|
1326
|
+
const VERSION$k = "4a07778ff6c595d91c575188146647a1";
|
|
1327
|
+
function validate$q(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$i(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$s(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$i(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$r(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$i(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$z = function EinsteinLlmGenerationItemRepresentationSelect() {
|
|
1420
|
+
const { selections: EinsteinLlmGenerationsContentQualityRepresentation__selections, opaque: EinsteinLlmGenerationsContentQualityRepresentation__opaque, } = select$B();
|
|
1421
|
+
const { selections: EinsteinLlmGenerationsSafetyScoreRepresentation__selections, opaque: EinsteinLlmGenerationsSafetyScoreRepresentation__opaque, } = select$A();
|
|
1422
1422
|
return {
|
|
1423
1423
|
kind: 'Fragment',
|
|
1424
|
-
version: VERSION$
|
|
1424
|
+
version: VERSION$k,
|
|
1425
1425
|
private: [],
|
|
1426
1426
|
selections: [
|
|
1427
1427
|
{
|
|
@@ -1458,7 +1458,7 @@ const select$n = function EinsteinLlmGenerationItemRepresentationSelect() {
|
|
|
1458
1458
|
]
|
|
1459
1459
|
};
|
|
1460
1460
|
};
|
|
1461
|
-
function equals$
|
|
1461
|
+
function equals$k(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$f(existing, incoming) {
|
|
|
1499
1499
|
if (!(existing_contentQualityRepresentation === incoming_contentQualityRepresentation
|
|
1500
1500
|
|| (existing_contentQualityRepresentation != null &&
|
|
1501
1501
|
incoming_contentQualityRepresentation != null &&
|
|
1502
|
-
equals$
|
|
1502
|
+
equals$m(existing_contentQualityRepresentation, incoming_contentQualityRepresentation)))) {
|
|
1503
1503
|
return false;
|
|
1504
1504
|
}
|
|
1505
1505
|
}
|
|
@@ -1515,15 +1515,15 @@ function equals$f(existing, incoming) {
|
|
|
1515
1515
|
if (!(existing_safetyScoreRepresentation === incoming_safetyScoreRepresentation
|
|
1516
1516
|
|| (existing_safetyScoreRepresentation != null &&
|
|
1517
1517
|
incoming_safetyScoreRepresentation != null &&
|
|
1518
|
-
equals$
|
|
1518
|
+
equals$l(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$j = "379fd960d1a0118f506f458ab2c8dd7e";
|
|
1526
|
+
function validate$p(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 + '")');
|
|
@@ -1538,25 +1538,34 @@ function validate$h(obj, path = 'WrappedMap') {
|
|
|
1538
1538
|
const key = obj_wrappedMap_keys[i];
|
|
1539
1539
|
const obj_wrappedMap_prop = obj_wrappedMap[key];
|
|
1540
1540
|
const path_wrappedMap_prop = path_wrappedMap + '["' + key + '"]';
|
|
1541
|
-
if (
|
|
1542
|
-
return new TypeError('Expected "
|
|
1541
|
+
if (obj_wrappedMap_prop === undefined) {
|
|
1542
|
+
return new TypeError('Expected "defined" but received "' + typeof obj_wrappedMap_prop + '" (at "' + path_wrappedMap_prop + '")');
|
|
1543
1543
|
}
|
|
1544
1544
|
}
|
|
1545
1545
|
})();
|
|
1546
1546
|
return v_error === undefined ? null : v_error;
|
|
1547
1547
|
}
|
|
1548
|
-
const select$
|
|
1548
|
+
const select$y = function WrappedMapSelect() {
|
|
1549
1549
|
return {
|
|
1550
1550
|
kind: 'Fragment',
|
|
1551
|
-
version: VERSION$
|
|
1551
|
+
version: VERSION$j,
|
|
1552
1552
|
private: [],
|
|
1553
|
-
selections: [
|
|
1553
|
+
selections: [
|
|
1554
|
+
{
|
|
1555
|
+
name: 'wrappedMap',
|
|
1556
|
+
kind: 'Object',
|
|
1557
|
+
// any
|
|
1558
|
+
}
|
|
1559
|
+
]
|
|
1554
1560
|
};
|
|
1555
1561
|
};
|
|
1556
|
-
function equals$
|
|
1562
|
+
function equals$j(existing, incoming) {
|
|
1557
1563
|
const existing_wrappedMap = existing.wrappedMap;
|
|
1558
1564
|
const incoming_wrappedMap = incoming.wrappedMap;
|
|
1559
1565
|
const equals_wrappedMap_props = equalsObject(existing_wrappedMap, incoming_wrappedMap, (existing_wrappedMap_prop, incoming_wrappedMap_prop) => {
|
|
1566
|
+
if (JSONStringify(incoming_wrappedMap_prop) !== JSONStringify(existing_wrappedMap_prop)) {
|
|
1567
|
+
return false;
|
|
1568
|
+
}
|
|
1560
1569
|
});
|
|
1561
1570
|
if (equals_wrappedMap_props === false) {
|
|
1562
1571
|
return false;
|
|
@@ -1564,9 +1573,9 @@ function equals$e(existing, incoming) {
|
|
|
1564
1573
|
return true;
|
|
1565
1574
|
}
|
|
1566
1575
|
|
|
1567
|
-
const TTL$
|
|
1568
|
-
const VERSION$
|
|
1569
|
-
function validate$
|
|
1576
|
+
const TTL$8 = 100;
|
|
1577
|
+
const VERSION$i = "d8abd72a42e842b253da1c38954dafbc";
|
|
1578
|
+
function validate$o(obj, path = 'EinsteinLlmGenerationsRepresentation') {
|
|
1570
1579
|
const v_error = (() => {
|
|
1571
1580
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1572
1581
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1579,7 +1588,7 @@ function validate$g(obj, path = 'EinsteinLlmGenerationsRepresentation') {
|
|
|
1579
1588
|
for (let i = 0; i < obj_generations.length; i++) {
|
|
1580
1589
|
const obj_generations_item = obj_generations[i];
|
|
1581
1590
|
const path_generations_item = path_generations + '[' + i + ']';
|
|
1582
|
-
const referencepath_generations_itemValidationError = validate$
|
|
1591
|
+
const referencepath_generations_itemValidationError = validate$q(obj_generations_item, path_generations_item);
|
|
1583
1592
|
if (referencepath_generations_itemValidationError !== null) {
|
|
1584
1593
|
let message = 'Object doesn\'t match EinsteinLlmGenerationItemRepresentation (at "' + path_generations_item + '")\n';
|
|
1585
1594
|
message += referencepath_generations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1590,7 +1599,7 @@ function validate$g(obj, path = 'EinsteinLlmGenerationsRepresentation') {
|
|
|
1590
1599
|
const path_parameters = path + '.parameters';
|
|
1591
1600
|
let obj_parameters_union0 = null;
|
|
1592
1601
|
const obj_parameters_union0_error = (() => {
|
|
1593
|
-
const referencepath_parametersValidationError = validate$
|
|
1602
|
+
const referencepath_parametersValidationError = validate$p(obj_parameters, path_parameters);
|
|
1594
1603
|
if (referencepath_parametersValidationError !== null) {
|
|
1595
1604
|
let message = 'Object doesn\'t match WrappedMap (at "' + path_parameters + '")\n';
|
|
1596
1605
|
message += referencepath_parametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1649,25 +1658,25 @@ function validate$g(obj, path = 'EinsteinLlmGenerationsRepresentation') {
|
|
|
1649
1658
|
})();
|
|
1650
1659
|
return v_error === undefined ? null : v_error;
|
|
1651
1660
|
}
|
|
1652
|
-
const RepresentationType$
|
|
1653
|
-
function keyBuilder$
|
|
1654
|
-
return keyPrefix + '::' + RepresentationType$
|
|
1661
|
+
const RepresentationType$8 = 'EinsteinLlmGenerationsRepresentation';
|
|
1662
|
+
function keyBuilder$k(luvio, config) {
|
|
1663
|
+
return keyPrefix + '::' + RepresentationType$8 + ':' + config.requestId;
|
|
1655
1664
|
}
|
|
1656
1665
|
function keyBuilderFromType$2(luvio, object) {
|
|
1657
1666
|
const keyParams = {
|
|
1658
1667
|
requestId: object.requestId
|
|
1659
1668
|
};
|
|
1660
|
-
return keyBuilder$
|
|
1669
|
+
return keyBuilder$k(luvio, keyParams);
|
|
1661
1670
|
}
|
|
1662
|
-
function normalize$
|
|
1671
|
+
function normalize$8(input, existing, path, luvio, store, timestamp) {
|
|
1663
1672
|
return input;
|
|
1664
1673
|
}
|
|
1665
|
-
const select$
|
|
1666
|
-
const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$
|
|
1667
|
-
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$
|
|
1674
|
+
const select$x = function EinsteinLlmGenerationsRepresentationSelect() {
|
|
1675
|
+
const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$z();
|
|
1676
|
+
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$y();
|
|
1668
1677
|
return {
|
|
1669
1678
|
kind: 'Fragment',
|
|
1670
|
-
version: VERSION$
|
|
1679
|
+
version: VERSION$i,
|
|
1671
1680
|
private: [],
|
|
1672
1681
|
selections: [
|
|
1673
1682
|
{
|
|
@@ -1693,7 +1702,7 @@ const select$l = function EinsteinLlmGenerationsRepresentationSelect() {
|
|
|
1693
1702
|
]
|
|
1694
1703
|
};
|
|
1695
1704
|
};
|
|
1696
|
-
function equals$
|
|
1705
|
+
function equals$i(existing, incoming) {
|
|
1697
1706
|
const existing_requestId = existing.requestId;
|
|
1698
1707
|
const incoming_requestId = incoming.requestId;
|
|
1699
1708
|
if (!(existing_requestId === incoming_requestId)) {
|
|
@@ -1702,7 +1711,7 @@ function equals$d(existing, incoming) {
|
|
|
1702
1711
|
const existing_generations = existing.generations;
|
|
1703
1712
|
const incoming_generations = incoming.generations;
|
|
1704
1713
|
const equals_generations_items = equalsArray(existing_generations, incoming_generations, (existing_generations_item, incoming_generations_item) => {
|
|
1705
|
-
if (!(equals$
|
|
1714
|
+
if (!(equals$k(existing_generations_item, incoming_generations_item))) {
|
|
1706
1715
|
return false;
|
|
1707
1716
|
}
|
|
1708
1717
|
});
|
|
@@ -1714,7 +1723,7 @@ function equals$d(existing, incoming) {
|
|
|
1714
1723
|
if (!(existing_parameters === incoming_parameters
|
|
1715
1724
|
|| (existing_parameters != null &&
|
|
1716
1725
|
incoming_parameters != null &&
|
|
1717
|
-
equals$
|
|
1726
|
+
equals$j(existing_parameters, incoming_parameters)))) {
|
|
1718
1727
|
return false;
|
|
1719
1728
|
}
|
|
1720
1729
|
const existing_prompt = existing.prompt;
|
|
@@ -1724,41 +1733,41 @@ function equals$d(existing, incoming) {
|
|
|
1724
1733
|
}
|
|
1725
1734
|
return true;
|
|
1726
1735
|
}
|
|
1727
|
-
const ingest$
|
|
1736
|
+
const ingest$8 = function EinsteinLlmGenerationsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1728
1737
|
if (process.env.NODE_ENV !== 'production') {
|
|
1729
|
-
const validateError = validate$
|
|
1738
|
+
const validateError = validate$o(input);
|
|
1730
1739
|
if (validateError !== null) {
|
|
1731
1740
|
throw validateError;
|
|
1732
1741
|
}
|
|
1733
1742
|
}
|
|
1734
1743
|
const key = keyBuilderFromType$2(luvio, input);
|
|
1735
|
-
const ttlToUse = TTL$
|
|
1736
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
1744
|
+
const ttlToUse = TTL$8;
|
|
1745
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$8, "EinsteinLLM", VERSION$i, RepresentationType$8, equals$i);
|
|
1737
1746
|
return createLink(key);
|
|
1738
1747
|
};
|
|
1739
|
-
function getTypeCacheKeys$
|
|
1748
|
+
function getTypeCacheKeys$8(rootKeySet, luvio, input, fullPathFactory) {
|
|
1740
1749
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1741
1750
|
const rootKey = keyBuilderFromType$2(luvio, input);
|
|
1742
1751
|
rootKeySet.set(rootKey, {
|
|
1743
1752
|
namespace: keyPrefix,
|
|
1744
|
-
representationName: RepresentationType$
|
|
1753
|
+
representationName: RepresentationType$8,
|
|
1745
1754
|
mergeable: false
|
|
1746
1755
|
});
|
|
1747
1756
|
}
|
|
1748
1757
|
|
|
1749
|
-
function select$
|
|
1750
|
-
return select$
|
|
1758
|
+
function select$w(luvio, params) {
|
|
1759
|
+
return select$x();
|
|
1751
1760
|
}
|
|
1752
|
-
function getResponseCacheKeys$
|
|
1753
|
-
getTypeCacheKeys$
|
|
1761
|
+
function getResponseCacheKeys$e(storeKeyMap, luvio, resourceParams, response) {
|
|
1762
|
+
getTypeCacheKeys$8(storeKeyMap, luvio, response);
|
|
1754
1763
|
}
|
|
1755
|
-
function ingestSuccess$
|
|
1764
|
+
function ingestSuccess$e(luvio, resourceParams, response) {
|
|
1756
1765
|
const { body } = response;
|
|
1757
1766
|
const key = keyBuilderFromType$2(luvio, body);
|
|
1758
|
-
luvio.storeIngest(key, ingest$
|
|
1767
|
+
luvio.storeIngest(key, ingest$8, body);
|
|
1759
1768
|
const snapshot = luvio.storeLookup({
|
|
1760
1769
|
recordId: key,
|
|
1761
|
-
node: select$
|
|
1770
|
+
node: select$w(),
|
|
1762
1771
|
variables: {},
|
|
1763
1772
|
});
|
|
1764
1773
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1769,7 +1778,7 @@ function ingestSuccess$7(luvio, resourceParams, response) {
|
|
|
1769
1778
|
deepFreeze(snapshot.data);
|
|
1770
1779
|
return snapshot;
|
|
1771
1780
|
}
|
|
1772
|
-
function createResourceRequest$
|
|
1781
|
+
function createResourceRequest$e(config) {
|
|
1773
1782
|
const headers = {};
|
|
1774
1783
|
return {
|
|
1775
1784
|
baseUri: '/services/data/v65.0',
|
|
@@ -1783,45 +1792,45 @@ function createResourceRequest$7(config) {
|
|
|
1783
1792
|
};
|
|
1784
1793
|
}
|
|
1785
1794
|
|
|
1786
|
-
const adapterName$
|
|
1795
|
+
const adapterName$e = 'createGenerations';
|
|
1787
1796
|
const createGenerations_ConfigPropertyMetadata = [
|
|
1788
1797
|
generateParamConfigMetadata('generationsInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1789
1798
|
];
|
|
1790
|
-
const createGenerations_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
1791
|
-
const createResourceParams$
|
|
1792
|
-
function typeCheckConfig$
|
|
1799
|
+
const createGenerations_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$e, createGenerations_ConfigPropertyMetadata);
|
|
1800
|
+
const createResourceParams$e = /*#__PURE__*/ createResourceParams$h(createGenerations_ConfigPropertyMetadata);
|
|
1801
|
+
function typeCheckConfig$e(untrustedConfig) {
|
|
1793
1802
|
const config = {};
|
|
1794
1803
|
const untrustedConfig_generationsInput = untrustedConfig.generationsInput;
|
|
1795
|
-
const referenceEinsteinLlmGenerationsInputRepresentationValidationError = validate$
|
|
1804
|
+
const referenceEinsteinLlmGenerationsInputRepresentationValidationError = validate$t(untrustedConfig_generationsInput);
|
|
1796
1805
|
if (referenceEinsteinLlmGenerationsInputRepresentationValidationError === null) {
|
|
1797
1806
|
config.generationsInput = untrustedConfig_generationsInput;
|
|
1798
1807
|
}
|
|
1799
1808
|
return config;
|
|
1800
1809
|
}
|
|
1801
|
-
function validateAdapterConfig$
|
|
1810
|
+
function validateAdapterConfig$e(untrustedConfig, configPropertyNames) {
|
|
1802
1811
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1803
1812
|
return null;
|
|
1804
1813
|
}
|
|
1805
1814
|
if (process.env.NODE_ENV !== 'production') {
|
|
1806
1815
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1807
1816
|
}
|
|
1808
|
-
const config = typeCheckConfig$
|
|
1817
|
+
const config = typeCheckConfig$e(untrustedConfig);
|
|
1809
1818
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1810
1819
|
return null;
|
|
1811
1820
|
}
|
|
1812
1821
|
return config;
|
|
1813
1822
|
}
|
|
1814
|
-
function buildNetworkSnapshot$
|
|
1815
|
-
const resourceParams = createResourceParams$
|
|
1816
|
-
const request = createResourceRequest$
|
|
1823
|
+
function buildNetworkSnapshot$e(luvio, config, options) {
|
|
1824
|
+
const resourceParams = createResourceParams$e(config);
|
|
1825
|
+
const request = createResourceRequest$e(resourceParams);
|
|
1817
1826
|
return luvio.dispatchResourceRequest(request, options)
|
|
1818
1827
|
.then((response) => {
|
|
1819
1828
|
return luvio.handleSuccessResponse(() => {
|
|
1820
|
-
const snapshot = ingestSuccess$
|
|
1829
|
+
const snapshot = ingestSuccess$e(luvio, resourceParams, response);
|
|
1821
1830
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1822
1831
|
}, () => {
|
|
1823
1832
|
const cache = new StoreKeyMap();
|
|
1824
|
-
getResponseCacheKeys$
|
|
1833
|
+
getResponseCacheKeys$e(cache, luvio, resourceParams, response.body);
|
|
1825
1834
|
return cache;
|
|
1826
1835
|
});
|
|
1827
1836
|
}, (response) => {
|
|
@@ -1831,16 +1840,16 @@ function buildNetworkSnapshot$7(luvio, config, options) {
|
|
|
1831
1840
|
}
|
|
1832
1841
|
const createGenerationsAdapterFactory = (luvio) => {
|
|
1833
1842
|
return function createGenerations(untrustedConfig) {
|
|
1834
|
-
const config = validateAdapterConfig$
|
|
1843
|
+
const config = validateAdapterConfig$e(untrustedConfig, createGenerations_ConfigPropertyNames);
|
|
1835
1844
|
// Invalid or incomplete config
|
|
1836
1845
|
if (config === null) {
|
|
1837
1846
|
throw new Error('Invalid config for "createGenerations"');
|
|
1838
1847
|
}
|
|
1839
|
-
return buildNetworkSnapshot$
|
|
1848
|
+
return buildNetworkSnapshot$e(luvio, config);
|
|
1840
1849
|
};
|
|
1841
1850
|
};
|
|
1842
1851
|
|
|
1843
|
-
function validate$
|
|
1852
|
+
function validate$n(obj, path = 'WrappedValueMap') {
|
|
1844
1853
|
const v_error = (() => {
|
|
1845
1854
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1846
1855
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1863,7 +1872,7 @@ function validate$f(obj, path = 'WrappedValueMap') {
|
|
|
1863
1872
|
return v_error === undefined ? null : v_error;
|
|
1864
1873
|
}
|
|
1865
1874
|
|
|
1866
|
-
function validate$
|
|
1875
|
+
function validate$m(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresentation') {
|
|
1867
1876
|
const v_error = (() => {
|
|
1868
1877
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1869
1878
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1871,7 +1880,7 @@ function validate$e(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
|
|
|
1871
1880
|
if (obj.additionalConfig !== undefined) {
|
|
1872
1881
|
const obj_additionalConfig = obj.additionalConfig;
|
|
1873
1882
|
const path_additionalConfig = path + '.additionalConfig';
|
|
1874
|
-
const referencepath_additionalConfigValidationError = validate$
|
|
1883
|
+
const referencepath_additionalConfigValidationError = validate$u(obj_additionalConfig, path_additionalConfig);
|
|
1875
1884
|
if (referencepath_additionalConfigValidationError !== null) {
|
|
1876
1885
|
let message = 'Object doesn\'t match EinsteinLlmAdditionalConfigInputRepresentation (at "' + path_additionalConfig + '")\n';
|
|
1877
1886
|
message += referencepath_additionalConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1880,7 +1889,7 @@ function validate$e(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
|
|
|
1880
1889
|
}
|
|
1881
1890
|
const obj_inputParams = obj.inputParams;
|
|
1882
1891
|
const path_inputParams = path + '.inputParams';
|
|
1883
|
-
const referencepath_inputParamsValidationError = validate$
|
|
1892
|
+
const referencepath_inputParamsValidationError = validate$n(obj_inputParams, path_inputParams);
|
|
1884
1893
|
if (referencepath_inputParamsValidationError !== null) {
|
|
1885
1894
|
let message = 'Object doesn\'t match WrappedValueMap (at "' + path_inputParams + '")\n';
|
|
1886
1895
|
message += referencepath_inputParamsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1916,8 +1925,246 @@ function validate$e(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
|
|
|
1916
1925
|
return v_error === undefined ? null : v_error;
|
|
1917
1926
|
}
|
|
1918
1927
|
|
|
1919
|
-
const VERSION$
|
|
1920
|
-
function validate$
|
|
1928
|
+
const VERSION$h = "63584d83290e21bdff26b1bef3db119c";
|
|
1929
|
+
function validate$l(obj, path = 'EinsteinLlmGenerationGenAiCitedReferenceRepresentation') {
|
|
1930
|
+
const v_error = (() => {
|
|
1931
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1932
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1933
|
+
}
|
|
1934
|
+
if (obj.citationLocations !== undefined) {
|
|
1935
|
+
const obj_citationLocations = obj.citationLocations;
|
|
1936
|
+
const path_citationLocations = path + '.citationLocations';
|
|
1937
|
+
if (!ArrayIsArray(obj_citationLocations)) {
|
|
1938
|
+
return new TypeError('Expected "array" but received "' + typeof obj_citationLocations + '" (at "' + path_citationLocations + '")');
|
|
1939
|
+
}
|
|
1940
|
+
for (let i = 0; i < obj_citationLocations.length; i++) {
|
|
1941
|
+
const obj_citationLocations_item = obj_citationLocations[i];
|
|
1942
|
+
const path_citationLocations_item = path_citationLocations + '[' + i + ']';
|
|
1943
|
+
if (typeof obj_citationLocations_item !== 'number' || (typeof obj_citationLocations_item === 'number' && Math.floor(obj_citationLocations_item) !== obj_citationLocations_item)) {
|
|
1944
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_citationLocations_item + '" (at "' + path_citationLocations_item + '")');
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
if (obj.claims !== undefined) {
|
|
1949
|
+
const obj_claims = obj.claims;
|
|
1950
|
+
const path_claims = path + '.claims';
|
|
1951
|
+
if (!ArrayIsArray(obj_claims)) {
|
|
1952
|
+
return new TypeError('Expected "array" but received "' + typeof obj_claims + '" (at "' + path_claims + '")');
|
|
1953
|
+
}
|
|
1954
|
+
for (let i = 0; i < obj_claims.length; i++) {
|
|
1955
|
+
const obj_claims_item = obj_claims[i];
|
|
1956
|
+
const path_claims_item = path_claims + '[' + i + ']';
|
|
1957
|
+
if (typeof obj_claims_item !== 'string') {
|
|
1958
|
+
return new TypeError('Expected "string" but received "' + typeof obj_claims_item + '" (at "' + path_claims_item + '")');
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
if (obj.link !== undefined) {
|
|
1963
|
+
const obj_link = obj.link;
|
|
1964
|
+
const path_link = path + '.link';
|
|
1965
|
+
if (typeof obj_link !== 'string') {
|
|
1966
|
+
return new TypeError('Expected "string" but received "' + typeof obj_link + '" (at "' + path_link + '")');
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
if (obj.sourceObjectApiName !== undefined) {
|
|
1970
|
+
const obj_sourceObjectApiName = obj.sourceObjectApiName;
|
|
1971
|
+
const path_sourceObjectApiName = path + '.sourceObjectApiName';
|
|
1972
|
+
if (typeof obj_sourceObjectApiName !== 'string') {
|
|
1973
|
+
return new TypeError('Expected "string" but received "' + typeof obj_sourceObjectApiName + '" (at "' + path_sourceObjectApiName + '")');
|
|
1974
|
+
}
|
|
1975
|
+
}
|
|
1976
|
+
if (obj.sourceObjectRecordId !== undefined) {
|
|
1977
|
+
const obj_sourceObjectRecordId = obj.sourceObjectRecordId;
|
|
1978
|
+
const path_sourceObjectRecordId = path + '.sourceObjectRecordId';
|
|
1979
|
+
if (typeof obj_sourceObjectRecordId !== 'string') {
|
|
1980
|
+
return new TypeError('Expected "string" but received "' + typeof obj_sourceObjectRecordId + '" (at "' + path_sourceObjectRecordId + '")');
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
})();
|
|
1984
|
+
return v_error === undefined ? null : v_error;
|
|
1985
|
+
}
|
|
1986
|
+
const select$v = function EinsteinLlmGenerationGenAiCitedReferenceRepresentationSelect() {
|
|
1987
|
+
return {
|
|
1988
|
+
kind: 'Fragment',
|
|
1989
|
+
version: VERSION$h,
|
|
1990
|
+
private: [],
|
|
1991
|
+
selections: [
|
|
1992
|
+
{
|
|
1993
|
+
name: 'citationLocations',
|
|
1994
|
+
kind: 'Scalar',
|
|
1995
|
+
plural: true,
|
|
1996
|
+
required: false
|
|
1997
|
+
},
|
|
1998
|
+
{
|
|
1999
|
+
name: 'claims',
|
|
2000
|
+
kind: 'Scalar',
|
|
2001
|
+
plural: true,
|
|
2002
|
+
required: false
|
|
2003
|
+
},
|
|
2004
|
+
{
|
|
2005
|
+
name: 'link',
|
|
2006
|
+
kind: 'Scalar',
|
|
2007
|
+
required: false
|
|
2008
|
+
},
|
|
2009
|
+
{
|
|
2010
|
+
name: 'sourceObjectApiName',
|
|
2011
|
+
kind: 'Scalar',
|
|
2012
|
+
required: false
|
|
2013
|
+
},
|
|
2014
|
+
{
|
|
2015
|
+
name: 'sourceObjectRecordId',
|
|
2016
|
+
kind: 'Scalar',
|
|
2017
|
+
required: false
|
|
2018
|
+
}
|
|
2019
|
+
]
|
|
2020
|
+
};
|
|
2021
|
+
};
|
|
2022
|
+
function equals$h(existing, incoming) {
|
|
2023
|
+
const existing_link = existing.link;
|
|
2024
|
+
const incoming_link = incoming.link;
|
|
2025
|
+
// if at least one of these optionals is defined
|
|
2026
|
+
if (existing_link !== undefined || incoming_link !== undefined) {
|
|
2027
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2028
|
+
// not equal
|
|
2029
|
+
if (existing_link === undefined || incoming_link === undefined) {
|
|
2030
|
+
return false;
|
|
2031
|
+
}
|
|
2032
|
+
if (!(existing_link === incoming_link)) {
|
|
2033
|
+
return false;
|
|
2034
|
+
}
|
|
2035
|
+
}
|
|
2036
|
+
const existing_sourceObjectApiName = existing.sourceObjectApiName;
|
|
2037
|
+
const incoming_sourceObjectApiName = incoming.sourceObjectApiName;
|
|
2038
|
+
// if at least one of these optionals is defined
|
|
2039
|
+
if (existing_sourceObjectApiName !== undefined || incoming_sourceObjectApiName !== undefined) {
|
|
2040
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2041
|
+
// not equal
|
|
2042
|
+
if (existing_sourceObjectApiName === undefined || incoming_sourceObjectApiName === undefined) {
|
|
2043
|
+
return false;
|
|
2044
|
+
}
|
|
2045
|
+
if (!(existing_sourceObjectApiName === incoming_sourceObjectApiName)) {
|
|
2046
|
+
return false;
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
const existing_sourceObjectRecordId = existing.sourceObjectRecordId;
|
|
2050
|
+
const incoming_sourceObjectRecordId = incoming.sourceObjectRecordId;
|
|
2051
|
+
// if at least one of these optionals is defined
|
|
2052
|
+
if (existing_sourceObjectRecordId !== undefined || incoming_sourceObjectRecordId !== undefined) {
|
|
2053
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2054
|
+
// not equal
|
|
2055
|
+
if (existing_sourceObjectRecordId === undefined || incoming_sourceObjectRecordId === undefined) {
|
|
2056
|
+
return false;
|
|
2057
|
+
}
|
|
2058
|
+
if (!(existing_sourceObjectRecordId === incoming_sourceObjectRecordId)) {
|
|
2059
|
+
return false;
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
const existing_citationLocations = existing.citationLocations;
|
|
2063
|
+
const incoming_citationLocations = incoming.citationLocations;
|
|
2064
|
+
// if at least one of these optionals is defined
|
|
2065
|
+
if (existing_citationLocations !== undefined || incoming_citationLocations !== undefined) {
|
|
2066
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2067
|
+
// not equal
|
|
2068
|
+
if (existing_citationLocations === undefined || incoming_citationLocations === undefined) {
|
|
2069
|
+
return false;
|
|
2070
|
+
}
|
|
2071
|
+
const equals_citationLocations_items = equalsArray(existing_citationLocations, incoming_citationLocations, (existing_citationLocations_item, incoming_citationLocations_item) => {
|
|
2072
|
+
if (!(existing_citationLocations_item === incoming_citationLocations_item)) {
|
|
2073
|
+
return false;
|
|
2074
|
+
}
|
|
2075
|
+
});
|
|
2076
|
+
if (equals_citationLocations_items === false) {
|
|
2077
|
+
return false;
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
const existing_claims = existing.claims;
|
|
2081
|
+
const incoming_claims = incoming.claims;
|
|
2082
|
+
// if at least one of these optionals is defined
|
|
2083
|
+
if (existing_claims !== undefined || incoming_claims !== undefined) {
|
|
2084
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2085
|
+
// not equal
|
|
2086
|
+
if (existing_claims === undefined || incoming_claims === undefined) {
|
|
2087
|
+
return false;
|
|
2088
|
+
}
|
|
2089
|
+
const equals_claims_items = equalsArray(existing_claims, incoming_claims, (existing_claims_item, incoming_claims_item) => {
|
|
2090
|
+
if (!(existing_claims_item === incoming_claims_item)) {
|
|
2091
|
+
return false;
|
|
2092
|
+
}
|
|
2093
|
+
});
|
|
2094
|
+
if (equals_claims_items === false) {
|
|
2095
|
+
return false;
|
|
2096
|
+
}
|
|
2097
|
+
}
|
|
2098
|
+
return true;
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2101
|
+
const VERSION$g = "bcc0ea08323732f4187dd2b9f70fea6c";
|
|
2102
|
+
function validate$k(obj, path = 'EinsteinLlmGenerationCitationRepresentation') {
|
|
2103
|
+
const v_error = (() => {
|
|
2104
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2105
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2106
|
+
}
|
|
2107
|
+
if (obj.citedReferences !== undefined) {
|
|
2108
|
+
const obj_citedReferences = obj.citedReferences;
|
|
2109
|
+
const path_citedReferences = path + '.citedReferences';
|
|
2110
|
+
if (!ArrayIsArray(obj_citedReferences)) {
|
|
2111
|
+
return new TypeError('Expected "array" but received "' + typeof obj_citedReferences + '" (at "' + path_citedReferences + '")');
|
|
2112
|
+
}
|
|
2113
|
+
for (let i = 0; i < obj_citedReferences.length; i++) {
|
|
2114
|
+
const obj_citedReferences_item = obj_citedReferences[i];
|
|
2115
|
+
const path_citedReferences_item = path_citedReferences + '[' + i + ']';
|
|
2116
|
+
const referencepath_citedReferences_itemValidationError = validate$l(obj_citedReferences_item, path_citedReferences_item);
|
|
2117
|
+
if (referencepath_citedReferences_itemValidationError !== null) {
|
|
2118
|
+
let message = 'Object doesn\'t match EinsteinLlmGenerationGenAiCitedReferenceRepresentation (at "' + path_citedReferences_item + '")\n';
|
|
2119
|
+
message += referencepath_citedReferences_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2120
|
+
return new TypeError(message);
|
|
2121
|
+
}
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
})();
|
|
2125
|
+
return v_error === undefined ? null : v_error;
|
|
2126
|
+
}
|
|
2127
|
+
const select$u = function EinsteinLlmGenerationCitationRepresentationSelect() {
|
|
2128
|
+
const { selections: EinsteinLlmGenerationGenAiCitedReferenceRepresentation__selections, opaque: EinsteinLlmGenerationGenAiCitedReferenceRepresentation__opaque, } = select$v();
|
|
2129
|
+
return {
|
|
2130
|
+
kind: 'Fragment',
|
|
2131
|
+
version: VERSION$g,
|
|
2132
|
+
private: [],
|
|
2133
|
+
selections: [
|
|
2134
|
+
{
|
|
2135
|
+
name: 'citedReferences',
|
|
2136
|
+
kind: 'Object',
|
|
2137
|
+
plural: true,
|
|
2138
|
+
selections: EinsteinLlmGenerationGenAiCitedReferenceRepresentation__selections,
|
|
2139
|
+
required: false
|
|
2140
|
+
}
|
|
2141
|
+
]
|
|
2142
|
+
};
|
|
2143
|
+
};
|
|
2144
|
+
function equals$g(existing, incoming) {
|
|
2145
|
+
const existing_citedReferences = existing.citedReferences;
|
|
2146
|
+
const incoming_citedReferences = incoming.citedReferences;
|
|
2147
|
+
// if at least one of these optionals is defined
|
|
2148
|
+
if (existing_citedReferences !== undefined || incoming_citedReferences !== undefined) {
|
|
2149
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2150
|
+
// not equal
|
|
2151
|
+
if (existing_citedReferences === undefined || incoming_citedReferences === undefined) {
|
|
2152
|
+
return false;
|
|
2153
|
+
}
|
|
2154
|
+
const equals_citedReferences_items = equalsArray(existing_citedReferences, incoming_citedReferences, (existing_citedReferences_item, incoming_citedReferences_item) => {
|
|
2155
|
+
if (!(equals$h(existing_citedReferences_item, incoming_citedReferences_item))) {
|
|
2156
|
+
return false;
|
|
2157
|
+
}
|
|
2158
|
+
});
|
|
2159
|
+
if (equals_citedReferences_items === false) {
|
|
2160
|
+
return false;
|
|
2161
|
+
}
|
|
2162
|
+
}
|
|
2163
|
+
return true;
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
const VERSION$f = "f62ac44b024b123f079b57f349e05230";
|
|
2167
|
+
function validate$j(obj, path = 'EinsteinPromptTemplateAttachmentExclusionInfoRepresentation') {
|
|
1921
2168
|
const v_error = (() => {
|
|
1922
2169
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1923
2170
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1935,10 +2182,10 @@ function validate$d(obj, path = 'EinsteinPromptTemplateAttachmentExclusionInfoRe
|
|
|
1935
2182
|
})();
|
|
1936
2183
|
return v_error === undefined ? null : v_error;
|
|
1937
2184
|
}
|
|
1938
|
-
const select$
|
|
2185
|
+
const select$t = function EinsteinPromptTemplateAttachmentExclusionInfoRepresentationSelect() {
|
|
1939
2186
|
return {
|
|
1940
2187
|
kind: 'Fragment',
|
|
1941
|
-
version: VERSION$
|
|
2188
|
+
version: VERSION$f,
|
|
1942
2189
|
private: [],
|
|
1943
2190
|
selections: [
|
|
1944
2191
|
{
|
|
@@ -1952,7 +2199,7 @@ const select$j = function EinsteinPromptTemplateAttachmentExclusionInfoRepresent
|
|
|
1952
2199
|
]
|
|
1953
2200
|
};
|
|
1954
2201
|
};
|
|
1955
|
-
function equals$
|
|
2202
|
+
function equals$f(existing, incoming) {
|
|
1956
2203
|
const existing_isExcluded = existing.isExcluded;
|
|
1957
2204
|
const incoming_isExcluded = incoming.isExcluded;
|
|
1958
2205
|
if (!(existing_isExcluded === incoming_isExcluded)) {
|
|
@@ -1966,8 +2213,8 @@ function equals$c(existing, incoming) {
|
|
|
1966
2213
|
return true;
|
|
1967
2214
|
}
|
|
1968
2215
|
|
|
1969
|
-
const VERSION$
|
|
1970
|
-
function validate$
|
|
2216
|
+
const VERSION$e = "b85a5621c60125d9f1644af130f67680";
|
|
2217
|
+
function validate$i(obj, path = 'EinsteinPromptTemplateAttachmentRepresentation') {
|
|
1971
2218
|
const v_error = (() => {
|
|
1972
2219
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1973
2220
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1975,7 +2222,7 @@ function validate$c(obj, path = 'EinsteinPromptTemplateAttachmentRepresentation'
|
|
|
1975
2222
|
if (obj.exclusionInfo !== undefined) {
|
|
1976
2223
|
const obj_exclusionInfo = obj.exclusionInfo;
|
|
1977
2224
|
const path_exclusionInfo = path + '.exclusionInfo';
|
|
1978
|
-
const referencepath_exclusionInfoValidationError = validate$
|
|
2225
|
+
const referencepath_exclusionInfoValidationError = validate$j(obj_exclusionInfo, path_exclusionInfo);
|
|
1979
2226
|
if (referencepath_exclusionInfoValidationError !== null) {
|
|
1980
2227
|
let message = 'Object doesn\'t match EinsteinPromptTemplateAttachmentExclusionInfoRepresentation (at "' + path_exclusionInfo + '")\n';
|
|
1981
2228
|
message += referencepath_exclusionInfoValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2012,11 +2259,11 @@ function validate$c(obj, path = 'EinsteinPromptTemplateAttachmentRepresentation'
|
|
|
2012
2259
|
})();
|
|
2013
2260
|
return v_error === undefined ? null : v_error;
|
|
2014
2261
|
}
|
|
2015
|
-
const select$
|
|
2016
|
-
const { selections: EinsteinPromptTemplateAttachmentExclusionInfoRepresentation__selections, opaque: EinsteinPromptTemplateAttachmentExclusionInfoRepresentation__opaque, } = select$
|
|
2262
|
+
const select$s = function EinsteinPromptTemplateAttachmentRepresentationSelect() {
|
|
2263
|
+
const { selections: EinsteinPromptTemplateAttachmentExclusionInfoRepresentation__selections, opaque: EinsteinPromptTemplateAttachmentExclusionInfoRepresentation__opaque, } = select$t();
|
|
2017
2264
|
return {
|
|
2018
2265
|
kind: 'Fragment',
|
|
2019
|
-
version: VERSION$
|
|
2266
|
+
version: VERSION$e,
|
|
2020
2267
|
private: [],
|
|
2021
2268
|
selections: [
|
|
2022
2269
|
{
|
|
@@ -2049,7 +2296,7 @@ const select$i = function EinsteinPromptTemplateAttachmentRepresentationSelect()
|
|
|
2049
2296
|
]
|
|
2050
2297
|
};
|
|
2051
2298
|
};
|
|
2052
|
-
function equals$
|
|
2299
|
+
function equals$e(existing, incoming) {
|
|
2053
2300
|
const existing_fileExtension = existing.fileExtension;
|
|
2054
2301
|
const incoming_fileExtension = incoming.fileExtension;
|
|
2055
2302
|
if (!(existing_fileExtension === incoming_fileExtension)) {
|
|
@@ -2092,15 +2339,15 @@ function equals$b(existing, incoming) {
|
|
|
2092
2339
|
if (existing_exclusionInfo === undefined || incoming_exclusionInfo === undefined) {
|
|
2093
2340
|
return false;
|
|
2094
2341
|
}
|
|
2095
|
-
if (!(equals$
|
|
2342
|
+
if (!(equals$f(existing_exclusionInfo, incoming_exclusionInfo))) {
|
|
2096
2343
|
return false;
|
|
2097
2344
|
}
|
|
2098
2345
|
}
|
|
2099
2346
|
return true;
|
|
2100
2347
|
}
|
|
2101
2348
|
|
|
2102
|
-
const VERSION$
|
|
2103
|
-
function validate$
|
|
2349
|
+
const VERSION$d = "6458d624e5a1691821c764b6de0badb3";
|
|
2350
|
+
function validate$h(obj, path = 'EinsteinPromptTemplateGenerationsErrorRepresentation') {
|
|
2104
2351
|
const v_error = (() => {
|
|
2105
2352
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2106
2353
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -2130,10 +2377,10 @@ function validate$b(obj, path = 'EinsteinPromptTemplateGenerationsErrorRepresent
|
|
|
2130
2377
|
})();
|
|
2131
2378
|
return v_error === undefined ? null : v_error;
|
|
2132
2379
|
}
|
|
2133
|
-
const select$
|
|
2380
|
+
const select$r = function EinsteinPromptTemplateGenerationsErrorRepresentationSelect() {
|
|
2134
2381
|
return {
|
|
2135
2382
|
kind: 'Fragment',
|
|
2136
|
-
version: VERSION$
|
|
2383
|
+
version: VERSION$d,
|
|
2137
2384
|
private: [],
|
|
2138
2385
|
selections: [
|
|
2139
2386
|
{
|
|
@@ -2156,7 +2403,7 @@ const select$h = function EinsteinPromptTemplateGenerationsErrorRepresentationSe
|
|
|
2156
2403
|
]
|
|
2157
2404
|
};
|
|
2158
2405
|
};
|
|
2159
|
-
function equals$
|
|
2406
|
+
function equals$d(existing, incoming) {
|
|
2160
2407
|
const existing_errorMessage = existing.errorMessage;
|
|
2161
2408
|
const incoming_errorMessage = incoming.errorMessage;
|
|
2162
2409
|
if (!(existing_errorMessage === incoming_errorMessage)) {
|
|
@@ -2188,8 +2435,8 @@ function equals$a(existing, incoming) {
|
|
|
2188
2435
|
return true;
|
|
2189
2436
|
}
|
|
2190
2437
|
|
|
2191
|
-
const VERSION$
|
|
2192
|
-
function validate$
|
|
2438
|
+
const VERSION$c = "7c417ce44e4bc05dfcc454e6825590e8";
|
|
2439
|
+
function validate$g(obj, path = 'EinsteinPromptTemplateMaskSettingsRepresentation') {
|
|
2193
2440
|
const v_error = (() => {
|
|
2194
2441
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2195
2442
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -2202,10 +2449,10 @@ function validate$a(obj, path = 'EinsteinPromptTemplateMaskSettingsRepresentatio
|
|
|
2202
2449
|
})();
|
|
2203
2450
|
return v_error === undefined ? null : v_error;
|
|
2204
2451
|
}
|
|
2205
|
-
const select$
|
|
2452
|
+
const select$q = function EinsteinPromptTemplateMaskSettingsRepresentationSelect() {
|
|
2206
2453
|
return {
|
|
2207
2454
|
kind: 'Fragment',
|
|
2208
|
-
version: VERSION$
|
|
2455
|
+
version: VERSION$c,
|
|
2209
2456
|
private: [],
|
|
2210
2457
|
selections: [
|
|
2211
2458
|
{
|
|
@@ -2215,7 +2462,7 @@ const select$g = function EinsteinPromptTemplateMaskSettingsRepresentationSelect
|
|
|
2215
2462
|
]
|
|
2216
2463
|
};
|
|
2217
2464
|
};
|
|
2218
|
-
function equals$
|
|
2465
|
+
function equals$c(existing, incoming) {
|
|
2219
2466
|
const existing_enableModeration = existing.enableModeration;
|
|
2220
2467
|
const incoming_enableModeration = incoming.enableModeration;
|
|
2221
2468
|
if (!(existing_enableModeration === incoming_enableModeration)) {
|
|
@@ -2224,8 +2471,8 @@ function equals$9(existing, incoming) {
|
|
|
2224
2471
|
return true;
|
|
2225
2472
|
}
|
|
2226
2473
|
|
|
2227
|
-
const VERSION$
|
|
2228
|
-
function validate$
|
|
2474
|
+
const VERSION$b = "92ad1abd0e2a60bc36941409cadda7e2";
|
|
2475
|
+
function validate$f(obj, path = 'EinsteinPromptTemplateMaskContentRepresentation') {
|
|
2229
2476
|
const v_error = (() => {
|
|
2230
2477
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2231
2478
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -2240,7 +2487,7 @@ function validate$9(obj, path = 'EinsteinPromptTemplateMaskContentRepresentation
|
|
|
2240
2487
|
const path_moderationSettings = path + '.moderationSettings';
|
|
2241
2488
|
let obj_moderationSettings_union0 = null;
|
|
2242
2489
|
const obj_moderationSettings_union0_error = (() => {
|
|
2243
|
-
const referencepath_moderationSettingsValidationError = validate$
|
|
2490
|
+
const referencepath_moderationSettingsValidationError = validate$g(obj_moderationSettings, path_moderationSettings);
|
|
2244
2491
|
if (referencepath_moderationSettingsValidationError !== null) {
|
|
2245
2492
|
let message = 'Object doesn\'t match EinsteinPromptTemplateMaskSettingsRepresentation (at "' + path_moderationSettings + '")\n';
|
|
2246
2493
|
message += referencepath_moderationSettingsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2276,11 +2523,11 @@ function validate$9(obj, path = 'EinsteinPromptTemplateMaskContentRepresentation
|
|
|
2276
2523
|
})();
|
|
2277
2524
|
return v_error === undefined ? null : v_error;
|
|
2278
2525
|
}
|
|
2279
|
-
const select$
|
|
2280
|
-
const { selections: EinsteinPromptTemplateMaskSettingsRepresentation__selections, opaque: EinsteinPromptTemplateMaskSettingsRepresentation__opaque, } = select$
|
|
2526
|
+
const select$p = function EinsteinPromptTemplateMaskContentRepresentationSelect() {
|
|
2527
|
+
const { selections: EinsteinPromptTemplateMaskSettingsRepresentation__selections, opaque: EinsteinPromptTemplateMaskSettingsRepresentation__opaque, } = select$q();
|
|
2281
2528
|
return {
|
|
2282
2529
|
kind: 'Fragment',
|
|
2283
|
-
version: VERSION$
|
|
2530
|
+
version: VERSION$b,
|
|
2284
2531
|
private: [],
|
|
2285
2532
|
selections: [
|
|
2286
2533
|
{
|
|
@@ -2302,7 +2549,7 @@ const select$f = function EinsteinPromptTemplateMaskContentRepresentationSelect(
|
|
|
2302
2549
|
]
|
|
2303
2550
|
};
|
|
2304
2551
|
};
|
|
2305
|
-
function equals$
|
|
2552
|
+
function equals$b(existing, incoming) {
|
|
2306
2553
|
const existing_content = existing.content;
|
|
2307
2554
|
const incoming_content = incoming.content;
|
|
2308
2555
|
if (!(existing_content === incoming_content)) {
|
|
@@ -2333,15 +2580,15 @@ function equals$8(existing, incoming) {
|
|
|
2333
2580
|
if (!(existing_moderationSettings === incoming_moderationSettings
|
|
2334
2581
|
|| (existing_moderationSettings != null &&
|
|
2335
2582
|
incoming_moderationSettings != null &&
|
|
2336
|
-
equals$
|
|
2583
|
+
equals$c(existing_moderationSettings, incoming_moderationSettings)))) {
|
|
2337
2584
|
return false;
|
|
2338
2585
|
}
|
|
2339
2586
|
}
|
|
2340
2587
|
return true;
|
|
2341
2588
|
}
|
|
2342
2589
|
|
|
2343
|
-
const VERSION$
|
|
2344
|
-
function validate$
|
|
2590
|
+
const VERSION$a = "507a815605f8d30ae9b52b0ec513d25e";
|
|
2591
|
+
function validate$e(obj, path = 'EinsteinPromptTemplateMaskDataRepresentation') {
|
|
2345
2592
|
const v_error = (() => {
|
|
2346
2593
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2347
2594
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -2371,10 +2618,10 @@ function validate$8(obj, path = 'EinsteinPromptTemplateMaskDataRepresentation')
|
|
|
2371
2618
|
})();
|
|
2372
2619
|
return v_error === undefined ? null : v_error;
|
|
2373
2620
|
}
|
|
2374
|
-
const select$
|
|
2621
|
+
const select$o = function EinsteinPromptTemplateMaskDataRepresentationSelect() {
|
|
2375
2622
|
return {
|
|
2376
2623
|
kind: 'Fragment',
|
|
2377
|
-
version: VERSION$
|
|
2624
|
+
version: VERSION$a,
|
|
2378
2625
|
private: [],
|
|
2379
2626
|
selections: [
|
|
2380
2627
|
{
|
|
@@ -2393,7 +2640,7 @@ const select$e = function EinsteinPromptTemplateMaskDataRepresentationSelect() {
|
|
|
2393
2640
|
]
|
|
2394
2641
|
};
|
|
2395
2642
|
};
|
|
2396
|
-
function equals$
|
|
2643
|
+
function equals$a(existing, incoming) {
|
|
2397
2644
|
const existing_originalValue = existing.originalValue;
|
|
2398
2645
|
const incoming_originalValue = incoming.originalValue;
|
|
2399
2646
|
if (!(existing_originalValue === incoming_originalValue)) {
|
|
@@ -2417,13 +2664,23 @@ function equals$7(existing, incoming) {
|
|
|
2417
2664
|
return true;
|
|
2418
2665
|
}
|
|
2419
2666
|
|
|
2420
|
-
const TTL$
|
|
2421
|
-
const VERSION$
|
|
2422
|
-
function validate$
|
|
2667
|
+
const TTL$7 = 100;
|
|
2668
|
+
const VERSION$9 = "4f8799314eebcd45e3fca72dcdf7722d";
|
|
2669
|
+
function validate$d(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation') {
|
|
2423
2670
|
const v_error = (() => {
|
|
2424
2671
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2425
2672
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2426
2673
|
}
|
|
2674
|
+
if (obj.citations !== undefined) {
|
|
2675
|
+
const obj_citations = obj.citations;
|
|
2676
|
+
const path_citations = path + '.citations';
|
|
2677
|
+
const referencepath_citationsValidationError = validate$k(obj_citations, path_citations);
|
|
2678
|
+
if (referencepath_citationsValidationError !== null) {
|
|
2679
|
+
let message = 'Object doesn\'t match EinsteinLlmGenerationCitationRepresentation (at "' + path_citations + '")\n';
|
|
2680
|
+
message += referencepath_citationsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2681
|
+
return new TypeError(message);
|
|
2682
|
+
}
|
|
2683
|
+
}
|
|
2427
2684
|
if (obj.fileData !== undefined) {
|
|
2428
2685
|
const obj_fileData = obj.fileData;
|
|
2429
2686
|
const path_fileData = path + '.fileData';
|
|
@@ -2433,7 +2690,7 @@ function validate$7(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2433
2690
|
for (let i = 0; i < obj_fileData.length; i++) {
|
|
2434
2691
|
const obj_fileData_item = obj_fileData[i];
|
|
2435
2692
|
const path_fileData_item = path_fileData + '[' + i + ']';
|
|
2436
|
-
const referencepath_fileData_itemValidationError = validate$
|
|
2693
|
+
const referencepath_fileData_itemValidationError = validate$i(obj_fileData_item, path_fileData_item);
|
|
2437
2694
|
if (referencepath_fileData_itemValidationError !== null) {
|
|
2438
2695
|
let message = 'Object doesn\'t match EinsteinPromptTemplateAttachmentRepresentation (at "' + path_fileData_item + '")\n';
|
|
2439
2696
|
message += referencepath_fileData_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2450,7 +2707,7 @@ function validate$7(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2450
2707
|
for (let i = 0; i < obj_generationErrors.length; i++) {
|
|
2451
2708
|
const obj_generationErrors_item = obj_generationErrors[i];
|
|
2452
2709
|
const path_generationErrors_item = path_generationErrors + '[' + i + ']';
|
|
2453
|
-
const referencepath_generationErrors_itemValidationError = validate$
|
|
2710
|
+
const referencepath_generationErrors_itemValidationError = validate$h(obj_generationErrors_item, path_generationErrors_item);
|
|
2454
2711
|
if (referencepath_generationErrors_itemValidationError !== null) {
|
|
2455
2712
|
let message = 'Object doesn\'t match EinsteinPromptTemplateGenerationsErrorRepresentation (at "' + path_generationErrors_item + '")\n';
|
|
2456
2713
|
message += referencepath_generationErrors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2466,7 +2723,7 @@ function validate$7(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2466
2723
|
for (let i = 0; i < obj_generations.length; i++) {
|
|
2467
2724
|
const obj_generations_item = obj_generations[i];
|
|
2468
2725
|
const path_generations_item = path_generations + '[' + i + ']';
|
|
2469
|
-
const referencepath_generations_itemValidationError = validate$
|
|
2726
|
+
const referencepath_generations_itemValidationError = validate$q(obj_generations_item, path_generations_item);
|
|
2470
2727
|
if (referencepath_generations_itemValidationError !== null) {
|
|
2471
2728
|
let message = 'Object doesn\'t match EinsteinLlmGenerationItemRepresentation (at "' + path_generations_item + '")\n';
|
|
2472
2729
|
message += referencepath_generations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2493,7 +2750,7 @@ function validate$7(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2493
2750
|
const path_parameters = path + '.parameters';
|
|
2494
2751
|
let obj_parameters_union0 = null;
|
|
2495
2752
|
const obj_parameters_union0_error = (() => {
|
|
2496
|
-
const referencepath_parametersValidationError = validate$
|
|
2753
|
+
const referencepath_parametersValidationError = validate$p(obj_parameters, path_parameters);
|
|
2497
2754
|
if (referencepath_parametersValidationError !== null) {
|
|
2498
2755
|
let message = 'Object doesn\'t match WrappedMap (at "' + path_parameters + '")\n';
|
|
2499
2756
|
message += referencepath_parametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2549,6 +2806,32 @@ function validate$7(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2549
2806
|
if (typeof obj_promptTemplateDevName !== 'string') {
|
|
2550
2807
|
return new TypeError('Expected "string" but received "' + typeof obj_promptTemplateDevName + '" (at "' + path_promptTemplateDevName + '")');
|
|
2551
2808
|
}
|
|
2809
|
+
const obj_rawPrompt = obj.rawPrompt;
|
|
2810
|
+
const path_rawPrompt = path + '.rawPrompt';
|
|
2811
|
+
let obj_rawPrompt_union0 = null;
|
|
2812
|
+
const obj_rawPrompt_union0_error = (() => {
|
|
2813
|
+
if (typeof obj_rawPrompt !== 'string') {
|
|
2814
|
+
return new TypeError('Expected "string" but received "' + typeof obj_rawPrompt + '" (at "' + path_rawPrompt + '")');
|
|
2815
|
+
}
|
|
2816
|
+
})();
|
|
2817
|
+
if (obj_rawPrompt_union0_error != null) {
|
|
2818
|
+
obj_rawPrompt_union0 = obj_rawPrompt_union0_error.message;
|
|
2819
|
+
}
|
|
2820
|
+
let obj_rawPrompt_union1 = null;
|
|
2821
|
+
const obj_rawPrompt_union1_error = (() => {
|
|
2822
|
+
if (obj_rawPrompt !== null) {
|
|
2823
|
+
return new TypeError('Expected "null" but received "' + typeof obj_rawPrompt + '" (at "' + path_rawPrompt + '")');
|
|
2824
|
+
}
|
|
2825
|
+
})();
|
|
2826
|
+
if (obj_rawPrompt_union1_error != null) {
|
|
2827
|
+
obj_rawPrompt_union1 = obj_rawPrompt_union1_error.message;
|
|
2828
|
+
}
|
|
2829
|
+
if (obj_rawPrompt_union0 && obj_rawPrompt_union1) {
|
|
2830
|
+
let message = 'Object doesn\'t match union (at "' + path_rawPrompt + '")';
|
|
2831
|
+
message += '\n' + obj_rawPrompt_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2832
|
+
message += '\n' + obj_rawPrompt_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2833
|
+
return new TypeError(message);
|
|
2834
|
+
}
|
|
2552
2835
|
const obj_requestId = obj.requestId;
|
|
2553
2836
|
const path_requestId = path + '.requestId';
|
|
2554
2837
|
if (typeof obj_requestId !== 'string') {
|
|
@@ -2563,7 +2846,7 @@ function validate$7(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2563
2846
|
for (let i = 0; i < obj_requestMessages.length; i++) {
|
|
2564
2847
|
const obj_requestMessages_item = obj_requestMessages[i];
|
|
2565
2848
|
const path_requestMessages_item = path_requestMessages + '[' + i + ']';
|
|
2566
|
-
const referencepath_requestMessages_itemValidationError = validate$
|
|
2849
|
+
const referencepath_requestMessages_itemValidationError = validate$f(obj_requestMessages_item, path_requestMessages_item);
|
|
2567
2850
|
if (referencepath_requestMessages_itemValidationError !== null) {
|
|
2568
2851
|
let message = 'Object doesn\'t match EinsteinPromptTemplateMaskContentRepresentation (at "' + path_requestMessages_item + '")\n';
|
|
2569
2852
|
message += referencepath_requestMessages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2580,7 +2863,7 @@ function validate$7(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2580
2863
|
for (let i = 0; i < obj_responseMessages.length; i++) {
|
|
2581
2864
|
const obj_responseMessages_item = obj_responseMessages[i];
|
|
2582
2865
|
const path_responseMessages_item = path_responseMessages + '[' + i + ']';
|
|
2583
|
-
const referencepath_responseMessages_itemValidationError = validate$
|
|
2866
|
+
const referencepath_responseMessages_itemValidationError = validate$f(obj_responseMessages_item, path_responseMessages_item);
|
|
2584
2867
|
if (referencepath_responseMessages_itemValidationError !== null) {
|
|
2585
2868
|
let message = 'Object doesn\'t match EinsteinPromptTemplateMaskContentRepresentation (at "' + path_responseMessages_item + '")\n';
|
|
2586
2869
|
message += referencepath_responseMessages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2597,7 +2880,7 @@ function validate$7(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2597
2880
|
for (let i = 0; i < obj_slotsMaskingInformation.length; i++) {
|
|
2598
2881
|
const obj_slotsMaskingInformation_item = obj_slotsMaskingInformation[i];
|
|
2599
2882
|
const path_slotsMaskingInformation_item = path_slotsMaskingInformation + '[' + i + ']';
|
|
2600
|
-
const referencepath_slotsMaskingInformation_itemValidationError = validate$
|
|
2883
|
+
const referencepath_slotsMaskingInformation_itemValidationError = validate$e(obj_slotsMaskingInformation_item, path_slotsMaskingInformation_item);
|
|
2601
2884
|
if (referencepath_slotsMaskingInformation_itemValidationError !== null) {
|
|
2602
2885
|
let message = 'Object doesn\'t match EinsteinPromptTemplateMaskDataRepresentation (at "' + path_slotsMaskingInformation_item + '")\n';
|
|
2603
2886
|
message += referencepath_slotsMaskingInformation_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -2608,31 +2891,38 @@ function validate$7(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
|
|
|
2608
2891
|
})();
|
|
2609
2892
|
return v_error === undefined ? null : v_error;
|
|
2610
2893
|
}
|
|
2611
|
-
const RepresentationType$
|
|
2612
|
-
function keyBuilder$
|
|
2613
|
-
return keyPrefix + '::' + RepresentationType$
|
|
2894
|
+
const RepresentationType$7 = 'EinsteinPromptTemplateGenerationsRepresentation';
|
|
2895
|
+
function keyBuilder$j(luvio, config) {
|
|
2896
|
+
return keyPrefix + '::' + RepresentationType$7 + ':' + config.requestId;
|
|
2614
2897
|
}
|
|
2615
2898
|
function keyBuilderFromType$1(luvio, object) {
|
|
2616
2899
|
const keyParams = {
|
|
2617
2900
|
requestId: object.requestId
|
|
2618
2901
|
};
|
|
2619
|
-
return keyBuilder$
|
|
2902
|
+
return keyBuilder$j(luvio, keyParams);
|
|
2620
2903
|
}
|
|
2621
|
-
function normalize$
|
|
2904
|
+
function normalize$7(input, existing, path, luvio, store, timestamp) {
|
|
2622
2905
|
return input;
|
|
2623
2906
|
}
|
|
2624
|
-
const select$
|
|
2625
|
-
const { selections:
|
|
2626
|
-
const { selections:
|
|
2627
|
-
const { selections:
|
|
2628
|
-
const { selections:
|
|
2629
|
-
const { selections:
|
|
2630
|
-
const { selections:
|
|
2907
|
+
const select$n = function EinsteinPromptTemplateGenerationsRepresentationSelect() {
|
|
2908
|
+
const { selections: EinsteinLlmGenerationCitationRepresentation__selections, opaque: EinsteinLlmGenerationCitationRepresentation__opaque, } = select$u();
|
|
2909
|
+
const { selections: EinsteinPromptTemplateAttachmentRepresentation__selections, opaque: EinsteinPromptTemplateAttachmentRepresentation__opaque, } = select$s();
|
|
2910
|
+
const { selections: EinsteinPromptTemplateGenerationsErrorRepresentation__selections, opaque: EinsteinPromptTemplateGenerationsErrorRepresentation__opaque, } = select$r();
|
|
2911
|
+
const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$z();
|
|
2912
|
+
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$y();
|
|
2913
|
+
const { selections: EinsteinPromptTemplateMaskContentRepresentation__selections, opaque: EinsteinPromptTemplateMaskContentRepresentation__opaque, } = select$p();
|
|
2914
|
+
const { selections: EinsteinPromptTemplateMaskDataRepresentation__selections, opaque: EinsteinPromptTemplateMaskDataRepresentation__opaque, } = select$o();
|
|
2631
2915
|
return {
|
|
2632
2916
|
kind: 'Fragment',
|
|
2633
|
-
version: VERSION$
|
|
2917
|
+
version: VERSION$9,
|
|
2634
2918
|
private: [],
|
|
2635
2919
|
selections: [
|
|
2920
|
+
{
|
|
2921
|
+
name: 'citations',
|
|
2922
|
+
kind: 'Object',
|
|
2923
|
+
selections: EinsteinLlmGenerationCitationRepresentation__selections,
|
|
2924
|
+
required: false
|
|
2925
|
+
},
|
|
2636
2926
|
{
|
|
2637
2927
|
name: 'fileData',
|
|
2638
2928
|
kind: 'Object',
|
|
@@ -2672,6 +2962,10 @@ const select$d = function EinsteinPromptTemplateGenerationsRepresentationSelect(
|
|
|
2672
2962
|
name: 'promptTemplateDevName',
|
|
2673
2963
|
kind: 'Scalar'
|
|
2674
2964
|
},
|
|
2965
|
+
{
|
|
2966
|
+
name: 'rawPrompt',
|
|
2967
|
+
kind: 'Scalar'
|
|
2968
|
+
},
|
|
2675
2969
|
{
|
|
2676
2970
|
name: 'requestId',
|
|
2677
2971
|
kind: 'Scalar'
|
|
@@ -2700,7 +2994,7 @@ const select$d = function EinsteinPromptTemplateGenerationsRepresentationSelect(
|
|
|
2700
2994
|
]
|
|
2701
2995
|
};
|
|
2702
2996
|
};
|
|
2703
|
-
function equals$
|
|
2997
|
+
function equals$9(existing, incoming) {
|
|
2704
2998
|
const existing_promptTemplateDevName = existing.promptTemplateDevName;
|
|
2705
2999
|
const incoming_promptTemplateDevName = incoming.promptTemplateDevName;
|
|
2706
3000
|
if (!(existing_promptTemplateDevName === incoming_promptTemplateDevName)) {
|
|
@@ -2711,6 +3005,19 @@ function equals$6(existing, incoming) {
|
|
|
2711
3005
|
if (!(existing_requestId === incoming_requestId)) {
|
|
2712
3006
|
return false;
|
|
2713
3007
|
}
|
|
3008
|
+
const existing_citations = existing.citations;
|
|
3009
|
+
const incoming_citations = incoming.citations;
|
|
3010
|
+
// if at least one of these optionals is defined
|
|
3011
|
+
if (existing_citations !== undefined || incoming_citations !== undefined) {
|
|
3012
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
3013
|
+
// not equal
|
|
3014
|
+
if (existing_citations === undefined || incoming_citations === undefined) {
|
|
3015
|
+
return false;
|
|
3016
|
+
}
|
|
3017
|
+
if (!(equals$g(existing_citations, incoming_citations))) {
|
|
3018
|
+
return false;
|
|
3019
|
+
}
|
|
3020
|
+
}
|
|
2714
3021
|
const existing_fileData = existing.fileData;
|
|
2715
3022
|
const incoming_fileData = incoming.fileData;
|
|
2716
3023
|
// if at least one of these optionals is defined
|
|
@@ -2721,7 +3028,7 @@ function equals$6(existing, incoming) {
|
|
|
2721
3028
|
return false;
|
|
2722
3029
|
}
|
|
2723
3030
|
const equals_fileData_items = equalsArray(existing_fileData, incoming_fileData, (existing_fileData_item, incoming_fileData_item) => {
|
|
2724
|
-
if (!(equals$
|
|
3031
|
+
if (!(equals$e(existing_fileData_item, incoming_fileData_item))) {
|
|
2725
3032
|
return false;
|
|
2726
3033
|
}
|
|
2727
3034
|
});
|
|
@@ -2739,7 +3046,7 @@ function equals$6(existing, incoming) {
|
|
|
2739
3046
|
return false;
|
|
2740
3047
|
}
|
|
2741
3048
|
const equals_generationErrors_items = equalsArray(existing_generationErrors, incoming_generationErrors, (existing_generationErrors_item, incoming_generationErrors_item) => {
|
|
2742
|
-
if (!(equals$
|
|
3049
|
+
if (!(equals$d(existing_generationErrors_item, incoming_generationErrors_item))) {
|
|
2743
3050
|
return false;
|
|
2744
3051
|
}
|
|
2745
3052
|
});
|
|
@@ -2750,7 +3057,7 @@ function equals$6(existing, incoming) {
|
|
|
2750
3057
|
const existing_generations = existing.generations;
|
|
2751
3058
|
const incoming_generations = incoming.generations;
|
|
2752
3059
|
const equals_generations_items = equalsArray(existing_generations, incoming_generations, (existing_generations_item, incoming_generations_item) => {
|
|
2753
|
-
if (!(equals$
|
|
3060
|
+
if (!(equals$k(existing_generations_item, incoming_generations_item))) {
|
|
2754
3061
|
return false;
|
|
2755
3062
|
}
|
|
2756
3063
|
});
|
|
@@ -2780,7 +3087,7 @@ function equals$6(existing, incoming) {
|
|
|
2780
3087
|
if (!(existing_parameters === incoming_parameters
|
|
2781
3088
|
|| (existing_parameters != null &&
|
|
2782
3089
|
incoming_parameters != null &&
|
|
2783
|
-
equals$
|
|
3090
|
+
equals$j(existing_parameters, incoming_parameters)))) {
|
|
2784
3091
|
return false;
|
|
2785
3092
|
}
|
|
2786
3093
|
const existing_prompt = existing.prompt;
|
|
@@ -2788,6 +3095,11 @@ function equals$6(existing, incoming) {
|
|
|
2788
3095
|
if (!(existing_prompt === incoming_prompt)) {
|
|
2789
3096
|
return false;
|
|
2790
3097
|
}
|
|
3098
|
+
const existing_rawPrompt = existing.rawPrompt;
|
|
3099
|
+
const incoming_rawPrompt = incoming.rawPrompt;
|
|
3100
|
+
if (!(existing_rawPrompt === incoming_rawPrompt)) {
|
|
3101
|
+
return false;
|
|
3102
|
+
}
|
|
2791
3103
|
const existing_requestMessages = existing.requestMessages;
|
|
2792
3104
|
const incoming_requestMessages = incoming.requestMessages;
|
|
2793
3105
|
// if at least one of these optionals is defined
|
|
@@ -2798,7 +3110,7 @@ function equals$6(existing, incoming) {
|
|
|
2798
3110
|
return false;
|
|
2799
3111
|
}
|
|
2800
3112
|
const equals_requestMessages_items = equalsArray(existing_requestMessages, incoming_requestMessages, (existing_requestMessages_item, incoming_requestMessages_item) => {
|
|
2801
|
-
if (!(equals$
|
|
3113
|
+
if (!(equals$b(existing_requestMessages_item, incoming_requestMessages_item))) {
|
|
2802
3114
|
return false;
|
|
2803
3115
|
}
|
|
2804
3116
|
});
|
|
@@ -2816,7 +3128,7 @@ function equals$6(existing, incoming) {
|
|
|
2816
3128
|
return false;
|
|
2817
3129
|
}
|
|
2818
3130
|
const equals_responseMessages_items = equalsArray(existing_responseMessages, incoming_responseMessages, (existing_responseMessages_item, incoming_responseMessages_item) => {
|
|
2819
|
-
if (!(equals$
|
|
3131
|
+
if (!(equals$b(existing_responseMessages_item, incoming_responseMessages_item))) {
|
|
2820
3132
|
return false;
|
|
2821
3133
|
}
|
|
2822
3134
|
});
|
|
@@ -2834,7 +3146,7 @@ function equals$6(existing, incoming) {
|
|
|
2834
3146
|
return false;
|
|
2835
3147
|
}
|
|
2836
3148
|
const equals_slotsMaskingInformation_items = equalsArray(existing_slotsMaskingInformation, incoming_slotsMaskingInformation, (existing_slotsMaskingInformation_item, incoming_slotsMaskingInformation_item) => {
|
|
2837
|
-
if (!(equals$
|
|
3149
|
+
if (!(equals$a(existing_slotsMaskingInformation_item, incoming_slotsMaskingInformation_item))) {
|
|
2838
3150
|
return false;
|
|
2839
3151
|
}
|
|
2840
3152
|
});
|
|
@@ -2844,41 +3156,41 @@ function equals$6(existing, incoming) {
|
|
|
2844
3156
|
}
|
|
2845
3157
|
return true;
|
|
2846
3158
|
}
|
|
2847
|
-
const ingest$
|
|
3159
|
+
const ingest$7 = function EinsteinPromptTemplateGenerationsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2848
3160
|
if (process.env.NODE_ENV !== 'production') {
|
|
2849
|
-
const validateError = validate$
|
|
3161
|
+
const validateError = validate$d(input);
|
|
2850
3162
|
if (validateError !== null) {
|
|
2851
3163
|
throw validateError;
|
|
2852
3164
|
}
|
|
2853
3165
|
}
|
|
2854
3166
|
const key = keyBuilderFromType$1(luvio, input);
|
|
2855
|
-
const ttlToUse = TTL$
|
|
2856
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
3167
|
+
const ttlToUse = TTL$7;
|
|
3168
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$7, "EinsteinLLM", VERSION$9, RepresentationType$7, equals$9);
|
|
2857
3169
|
return createLink(key);
|
|
2858
3170
|
};
|
|
2859
|
-
function getTypeCacheKeys$
|
|
3171
|
+
function getTypeCacheKeys$7(rootKeySet, luvio, input, fullPathFactory) {
|
|
2860
3172
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2861
3173
|
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
2862
3174
|
rootKeySet.set(rootKey, {
|
|
2863
3175
|
namespace: keyPrefix,
|
|
2864
|
-
representationName: RepresentationType$
|
|
3176
|
+
representationName: RepresentationType$7,
|
|
2865
3177
|
mergeable: false
|
|
2866
3178
|
});
|
|
2867
3179
|
}
|
|
2868
3180
|
|
|
2869
|
-
function select$
|
|
2870
|
-
return select$
|
|
3181
|
+
function select$m(luvio, params) {
|
|
3182
|
+
return select$n();
|
|
2871
3183
|
}
|
|
2872
|
-
function getResponseCacheKeys$
|
|
2873
|
-
getTypeCacheKeys$
|
|
3184
|
+
function getResponseCacheKeys$d(storeKeyMap, luvio, resourceParams, response) {
|
|
3185
|
+
getTypeCacheKeys$7(storeKeyMap, luvio, response);
|
|
2874
3186
|
}
|
|
2875
|
-
function ingestSuccess$
|
|
3187
|
+
function ingestSuccess$d(luvio, resourceParams, response) {
|
|
2876
3188
|
const { body } = response;
|
|
2877
3189
|
const key = keyBuilderFromType$1(luvio, body);
|
|
2878
|
-
luvio.storeIngest(key, ingest$
|
|
3190
|
+
luvio.storeIngest(key, ingest$7, body);
|
|
2879
3191
|
const snapshot = luvio.storeLookup({
|
|
2880
3192
|
recordId: key,
|
|
2881
|
-
node: select$
|
|
3193
|
+
node: select$m(),
|
|
2882
3194
|
variables: {},
|
|
2883
3195
|
});
|
|
2884
3196
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2889,7 +3201,7 @@ function ingestSuccess$6(luvio, resourceParams, response) {
|
|
|
2889
3201
|
deepFreeze(snapshot.data);
|
|
2890
3202
|
return snapshot;
|
|
2891
3203
|
}
|
|
2892
|
-
function createResourceRequest$
|
|
3204
|
+
function createResourceRequest$d(config) {
|
|
2893
3205
|
const headers = {};
|
|
2894
3206
|
return {
|
|
2895
3207
|
baseUri: '/services/data/v65.0',
|
|
@@ -2903,48 +3215,48 @@ function createResourceRequest$6(config) {
|
|
|
2903
3215
|
};
|
|
2904
3216
|
}
|
|
2905
3217
|
|
|
2906
|
-
const adapterName$
|
|
3218
|
+
const adapterName$d = 'createGenerationsForPromptTemplate';
|
|
2907
3219
|
const createGenerationsForPromptTemplate_ConfigPropertyMetadata = [
|
|
2908
3220
|
generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2909
3221
|
generateParamConfigMetadata('versionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2910
3222
|
generateParamConfigMetadata('promptTemplateGenerationsInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
2911
3223
|
];
|
|
2912
|
-
const createGenerationsForPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
2913
|
-
const createResourceParams$
|
|
2914
|
-
function typeCheckConfig$
|
|
3224
|
+
const createGenerationsForPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$d, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
|
|
3225
|
+
const createResourceParams$d = /*#__PURE__*/ createResourceParams$h(createGenerationsForPromptTemplate_ConfigPropertyMetadata);
|
|
3226
|
+
function typeCheckConfig$d(untrustedConfig) {
|
|
2915
3227
|
const config = {};
|
|
2916
|
-
typeCheckConfig$
|
|
3228
|
+
typeCheckConfig$h(untrustedConfig, config, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
|
|
2917
3229
|
const untrustedConfig_promptTemplateGenerationsInput = untrustedConfig.promptTemplateGenerationsInput;
|
|
2918
|
-
const referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError = validate$
|
|
3230
|
+
const referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError = validate$m(untrustedConfig_promptTemplateGenerationsInput);
|
|
2919
3231
|
if (referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError === null) {
|
|
2920
3232
|
config.promptTemplateGenerationsInput = untrustedConfig_promptTemplateGenerationsInput;
|
|
2921
3233
|
}
|
|
2922
3234
|
return config;
|
|
2923
3235
|
}
|
|
2924
|
-
function validateAdapterConfig$
|
|
3236
|
+
function validateAdapterConfig$d(untrustedConfig, configPropertyNames) {
|
|
2925
3237
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
2926
3238
|
return null;
|
|
2927
3239
|
}
|
|
2928
3240
|
if (process.env.NODE_ENV !== 'production') {
|
|
2929
3241
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
2930
3242
|
}
|
|
2931
|
-
const config = typeCheckConfig$
|
|
3243
|
+
const config = typeCheckConfig$d(untrustedConfig);
|
|
2932
3244
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2933
3245
|
return null;
|
|
2934
3246
|
}
|
|
2935
3247
|
return config;
|
|
2936
3248
|
}
|
|
2937
|
-
function buildNetworkSnapshot$
|
|
2938
|
-
const resourceParams = createResourceParams$
|
|
2939
|
-
const request = createResourceRequest$
|
|
3249
|
+
function buildNetworkSnapshot$d(luvio, config, options) {
|
|
3250
|
+
const resourceParams = createResourceParams$d(config);
|
|
3251
|
+
const request = createResourceRequest$d(resourceParams);
|
|
2940
3252
|
return luvio.dispatchResourceRequest(request, options)
|
|
2941
3253
|
.then((response) => {
|
|
2942
3254
|
return luvio.handleSuccessResponse(() => {
|
|
2943
|
-
const snapshot = ingestSuccess$
|
|
3255
|
+
const snapshot = ingestSuccess$d(luvio, resourceParams, response);
|
|
2944
3256
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
2945
3257
|
}, () => {
|
|
2946
3258
|
const cache = new StoreKeyMap();
|
|
2947
|
-
getResponseCacheKeys$
|
|
3259
|
+
getResponseCacheKeys$d(cache, luvio, resourceParams, response.body);
|
|
2948
3260
|
return cache;
|
|
2949
3261
|
});
|
|
2950
3262
|
}, (response) => {
|
|
@@ -2954,18 +3266,18 @@ function buildNetworkSnapshot$6(luvio, config, options) {
|
|
|
2954
3266
|
}
|
|
2955
3267
|
const createGenerationsForPromptTemplateAdapterFactory = (luvio) => {
|
|
2956
3268
|
return function createGenerationsForPromptTemplate(untrustedConfig) {
|
|
2957
|
-
const config = validateAdapterConfig$
|
|
3269
|
+
const config = validateAdapterConfig$d(untrustedConfig, createGenerationsForPromptTemplate_ConfigPropertyNames);
|
|
2958
3270
|
// Invalid or incomplete config
|
|
2959
3271
|
if (config === null) {
|
|
2960
3272
|
throw new Error('Invalid config for "createGenerationsForPromptTemplate"');
|
|
2961
3273
|
}
|
|
2962
|
-
return buildNetworkSnapshot$
|
|
3274
|
+
return buildNetworkSnapshot$d(luvio, config);
|
|
2963
3275
|
};
|
|
2964
3276
|
};
|
|
2965
3277
|
|
|
2966
|
-
const TTL$
|
|
2967
|
-
const VERSION$
|
|
2968
|
-
function validate$
|
|
3278
|
+
const TTL$6 = 100;
|
|
3279
|
+
const VERSION$8 = "a90a51578e2fdd7a9741d310bed22b1d";
|
|
3280
|
+
function validate$c(obj, path = 'EinsteinPromptTemplateRepresentation') {
|
|
2969
3281
|
const v_error = (() => {
|
|
2970
3282
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2971
3283
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -2973,7 +3285,7 @@ function validate$6(obj, path = 'EinsteinPromptTemplateRepresentation') {
|
|
|
2973
3285
|
if (obj.additionalData !== undefined) {
|
|
2974
3286
|
const obj_additionalData = obj.additionalData;
|
|
2975
3287
|
const path_additionalData = path + '.additionalData';
|
|
2976
|
-
const referencepath_additionalDataValidationError = validate$
|
|
3288
|
+
const referencepath_additionalDataValidationError = validate$p(obj_additionalData, path_additionalData);
|
|
2977
3289
|
if (referencepath_additionalDataValidationError !== null) {
|
|
2978
3290
|
let message = 'Object doesn\'t match WrappedMap (at "' + path_additionalData + '")\n';
|
|
2979
3291
|
message += referencepath_additionalDataValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -3041,24 +3353,24 @@ function validate$6(obj, path = 'EinsteinPromptTemplateRepresentation') {
|
|
|
3041
3353
|
})();
|
|
3042
3354
|
return v_error === undefined ? null : v_error;
|
|
3043
3355
|
}
|
|
3044
|
-
const RepresentationType$
|
|
3045
|
-
function keyBuilder$
|
|
3046
|
-
return keyPrefix + '::' + RepresentationType$
|
|
3356
|
+
const RepresentationType$6 = 'EinsteinPromptTemplateRepresentation';
|
|
3357
|
+
function keyBuilder$i(luvio, config) {
|
|
3358
|
+
return keyPrefix + '::' + RepresentationType$6 + ':' + config.versionId;
|
|
3047
3359
|
}
|
|
3048
3360
|
function keyBuilderFromType(luvio, object) {
|
|
3049
3361
|
const keyParams = {
|
|
3050
3362
|
versionId: object.versionId
|
|
3051
3363
|
};
|
|
3052
|
-
return keyBuilder$
|
|
3364
|
+
return keyBuilder$i(luvio, keyParams);
|
|
3053
3365
|
}
|
|
3054
|
-
function normalize$
|
|
3366
|
+
function normalize$6(input, existing, path, luvio, store, timestamp) {
|
|
3055
3367
|
return input;
|
|
3056
3368
|
}
|
|
3057
|
-
const select$
|
|
3058
|
-
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$
|
|
3369
|
+
const select$l = function EinsteinPromptTemplateRepresentationSelect() {
|
|
3370
|
+
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$y();
|
|
3059
3371
|
return {
|
|
3060
3372
|
kind: 'Fragment',
|
|
3061
|
-
version: VERSION$
|
|
3373
|
+
version: VERSION$8,
|
|
3062
3374
|
private: [],
|
|
3063
3375
|
selections: [
|
|
3064
3376
|
{
|
|
@@ -3106,7 +3418,7 @@ const select$b = function EinsteinPromptTemplateRepresentationSelect() {
|
|
|
3106
3418
|
]
|
|
3107
3419
|
};
|
|
3108
3420
|
};
|
|
3109
|
-
function equals$
|
|
3421
|
+
function equals$8(existing, incoming) {
|
|
3110
3422
|
const existing_hasWarning = existing.hasWarning;
|
|
3111
3423
|
const incoming_hasWarning = incoming.hasWarning;
|
|
3112
3424
|
if (!(existing_hasWarning === incoming_hasWarning)) {
|
|
@@ -3162,7 +3474,7 @@ function equals$5(existing, incoming) {
|
|
|
3162
3474
|
if (existing_additionalData === undefined || incoming_additionalData === undefined) {
|
|
3163
3475
|
return false;
|
|
3164
3476
|
}
|
|
3165
|
-
if (!(equals$
|
|
3477
|
+
if (!(equals$j(existing_additionalData, incoming_additionalData))) {
|
|
3166
3478
|
return false;
|
|
3167
3479
|
}
|
|
3168
3480
|
}
|
|
@@ -3188,41 +3500,41 @@ function equals$5(existing, incoming) {
|
|
|
3188
3500
|
}
|
|
3189
3501
|
return true;
|
|
3190
3502
|
}
|
|
3191
|
-
const ingest$
|
|
3503
|
+
const ingest$6 = function EinsteinPromptTemplateRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
3192
3504
|
if (process.env.NODE_ENV !== 'production') {
|
|
3193
|
-
const validateError = validate$
|
|
3505
|
+
const validateError = validate$c(input);
|
|
3194
3506
|
if (validateError !== null) {
|
|
3195
3507
|
throw validateError;
|
|
3196
3508
|
}
|
|
3197
3509
|
}
|
|
3198
3510
|
const key = keyBuilderFromType(luvio, input);
|
|
3199
|
-
const ttlToUse = TTL$
|
|
3200
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
3511
|
+
const ttlToUse = TTL$6;
|
|
3512
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "EinsteinLLM", VERSION$8, RepresentationType$6, equals$8);
|
|
3201
3513
|
return createLink(key);
|
|
3202
3514
|
};
|
|
3203
|
-
function getTypeCacheKeys$
|
|
3515
|
+
function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
|
|
3204
3516
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
3205
3517
|
const rootKey = keyBuilderFromType(luvio, input);
|
|
3206
3518
|
rootKeySet.set(rootKey, {
|
|
3207
3519
|
namespace: keyPrefix,
|
|
3208
|
-
representationName: RepresentationType$
|
|
3520
|
+
representationName: RepresentationType$6,
|
|
3209
3521
|
mergeable: false
|
|
3210
3522
|
});
|
|
3211
3523
|
}
|
|
3212
3524
|
|
|
3213
|
-
function select$
|
|
3214
|
-
return select$
|
|
3525
|
+
function select$k(luvio, params) {
|
|
3526
|
+
return select$l();
|
|
3215
3527
|
}
|
|
3216
|
-
function getResponseCacheKeys$
|
|
3217
|
-
getTypeCacheKeys$
|
|
3528
|
+
function getResponseCacheKeys$c(storeKeyMap, luvio, resourceParams, response) {
|
|
3529
|
+
getTypeCacheKeys$6(storeKeyMap, luvio, response);
|
|
3218
3530
|
}
|
|
3219
|
-
function ingestSuccess$
|
|
3531
|
+
function ingestSuccess$c(luvio, resourceParams, response) {
|
|
3220
3532
|
const { body } = response;
|
|
3221
3533
|
const key = keyBuilderFromType(luvio, body);
|
|
3222
|
-
luvio.storeIngest(key, ingest$
|
|
3534
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
3223
3535
|
const snapshot = luvio.storeLookup({
|
|
3224
3536
|
recordId: key,
|
|
3225
|
-
node: select$
|
|
3537
|
+
node: select$k(),
|
|
3226
3538
|
variables: {},
|
|
3227
3539
|
});
|
|
3228
3540
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -3233,7 +3545,7 @@ function ingestSuccess$5(luvio, resourceParams, response) {
|
|
|
3233
3545
|
deepFreeze(snapshot.data);
|
|
3234
3546
|
return snapshot;
|
|
3235
3547
|
}
|
|
3236
|
-
function createResourceRequest$
|
|
3548
|
+
function createResourceRequest$c(config) {
|
|
3237
3549
|
const headers = {};
|
|
3238
3550
|
return {
|
|
3239
3551
|
baseUri: '/services/data/v65.0',
|
|
@@ -3247,19 +3559,18 @@ function createResourceRequest$5(config) {
|
|
|
3247
3559
|
};
|
|
3248
3560
|
}
|
|
3249
3561
|
|
|
3250
|
-
const adapterName$
|
|
3562
|
+
const adapterName$c = 'createPromptTemplate';
|
|
3251
3563
|
const createPromptTemplate_ConfigPropertyMetadata = [
|
|
3252
3564
|
generateParamConfigMetadata('apiName', true, 2 /* Body */, 0 /* String */),
|
|
3253
3565
|
generateParamConfigMetadata('childRelationships', true, 2 /* Body */, 4 /* Unsupported */),
|
|
3254
|
-
generateParamConfigMetadata('fields', true, 2 /* Body */, 4 /* Unsupported
|
|
3566
|
+
generateParamConfigMetadata('fields', true, 2 /* Body */, 4 /* Unsupported */),
|
|
3255
3567
|
generateParamConfigMetadata('id', false, 2 /* Body */, 0 /* String */),
|
|
3256
|
-
generateParamConfigMetadata('isStandard', true, 2 /* Body */, 1 /* Boolean */),
|
|
3257
3568
|
];
|
|
3258
|
-
const createPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
3259
|
-
const createResourceParams$
|
|
3260
|
-
function typeCheckConfig$
|
|
3569
|
+
const createPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$c, createPromptTemplate_ConfigPropertyMetadata);
|
|
3570
|
+
const createResourceParams$c = /*#__PURE__*/ createResourceParams$h(createPromptTemplate_ConfigPropertyMetadata);
|
|
3571
|
+
function typeCheckConfig$c(untrustedConfig) {
|
|
3261
3572
|
const config = {};
|
|
3262
|
-
typeCheckConfig$
|
|
3573
|
+
typeCheckConfig$h(untrustedConfig, config, createPromptTemplate_ConfigPropertyMetadata);
|
|
3263
3574
|
const untrustedConfig_childRelationships = untrustedConfig.childRelationships;
|
|
3264
3575
|
if (untrustedIsObject(untrustedConfig_childRelationships)) {
|
|
3265
3576
|
const untrustedConfig_childRelationships_object = {};
|
|
@@ -3276,53 +3587,46 @@ function typeCheckConfig$5(untrustedConfig) {
|
|
|
3276
3587
|
}
|
|
3277
3588
|
}
|
|
3278
3589
|
const untrustedConfig_fields = untrustedConfig.fields;
|
|
3279
|
-
if (
|
|
3280
|
-
const
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
const key = untrustedConfig_fields_item_keys[i];
|
|
3288
|
-
const untrustedConfig_fields_item_prop = untrustedConfig_fields_item[key];
|
|
3289
|
-
if (untrustedConfig_fields_item_object !== undefined) {
|
|
3290
|
-
untrustedConfig_fields_item_object[key] = untrustedConfig_fields_item_prop;
|
|
3291
|
-
}
|
|
3292
|
-
}
|
|
3293
|
-
if (untrustedConfig_fields_item_object !== undefined && Object.keys(untrustedConfig_fields_item_object).length >= 0) {
|
|
3294
|
-
untrustedConfig_fields_array.push(untrustedConfig_fields_item_object);
|
|
3295
|
-
}
|
|
3590
|
+
if (untrustedIsObject(untrustedConfig_fields)) {
|
|
3591
|
+
const untrustedConfig_fields_object = {};
|
|
3592
|
+
const untrustedConfig_fields_keys = Object.keys(untrustedConfig_fields);
|
|
3593
|
+
for (let i = 0, arrayLength = untrustedConfig_fields_keys.length; i < arrayLength; i++) {
|
|
3594
|
+
const key = untrustedConfig_fields_keys[i];
|
|
3595
|
+
const untrustedConfig_fields_prop = untrustedConfig_fields[key];
|
|
3596
|
+
if (untrustedConfig_fields_object !== undefined) {
|
|
3597
|
+
untrustedConfig_fields_object[key] = untrustedConfig_fields_prop;
|
|
3296
3598
|
}
|
|
3297
3599
|
}
|
|
3298
|
-
|
|
3600
|
+
if (untrustedConfig_fields_object !== undefined && Object.keys(untrustedConfig_fields_object).length >= 0) {
|
|
3601
|
+
config.fields = untrustedConfig_fields_object;
|
|
3602
|
+
}
|
|
3299
3603
|
}
|
|
3300
3604
|
return config;
|
|
3301
3605
|
}
|
|
3302
|
-
function validateAdapterConfig$
|
|
3606
|
+
function validateAdapterConfig$c(untrustedConfig, configPropertyNames) {
|
|
3303
3607
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
3304
3608
|
return null;
|
|
3305
3609
|
}
|
|
3306
3610
|
if (process.env.NODE_ENV !== 'production') {
|
|
3307
3611
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
3308
3612
|
}
|
|
3309
|
-
const config = typeCheckConfig$
|
|
3613
|
+
const config = typeCheckConfig$c(untrustedConfig);
|
|
3310
3614
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3311
3615
|
return null;
|
|
3312
3616
|
}
|
|
3313
3617
|
return config;
|
|
3314
3618
|
}
|
|
3315
|
-
function buildNetworkSnapshot$
|
|
3316
|
-
const resourceParams = createResourceParams$
|
|
3317
|
-
const request = createResourceRequest$
|
|
3619
|
+
function buildNetworkSnapshot$c(luvio, config, options) {
|
|
3620
|
+
const resourceParams = createResourceParams$c(config);
|
|
3621
|
+
const request = createResourceRequest$c(resourceParams);
|
|
3318
3622
|
return luvio.dispatchResourceRequest(request, options)
|
|
3319
3623
|
.then((response) => {
|
|
3320
3624
|
return luvio.handleSuccessResponse(() => {
|
|
3321
|
-
const snapshot = ingestSuccess$
|
|
3625
|
+
const snapshot = ingestSuccess$c(luvio, resourceParams, response);
|
|
3322
3626
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
3323
3627
|
}, () => {
|
|
3324
3628
|
const cache = new StoreKeyMap();
|
|
3325
|
-
getResponseCacheKeys$
|
|
3629
|
+
getResponseCacheKeys$c(cache, luvio, resourceParams, response.body);
|
|
3326
3630
|
return cache;
|
|
3327
3631
|
});
|
|
3328
3632
|
}, (response) => {
|
|
@@ -3332,28 +3636,28 @@ function buildNetworkSnapshot$5(luvio, config, options) {
|
|
|
3332
3636
|
}
|
|
3333
3637
|
const createPromptTemplateAdapterFactory = (luvio) => {
|
|
3334
3638
|
return function createPromptTemplate(untrustedConfig) {
|
|
3335
|
-
const config = validateAdapterConfig$
|
|
3639
|
+
const config = validateAdapterConfig$c(untrustedConfig, createPromptTemplate_ConfigPropertyNames);
|
|
3336
3640
|
// Invalid or incomplete config
|
|
3337
3641
|
if (config === null) {
|
|
3338
3642
|
throw new Error('Invalid config for "createPromptTemplate"');
|
|
3339
3643
|
}
|
|
3340
|
-
return buildNetworkSnapshot$
|
|
3644
|
+
return buildNetworkSnapshot$c(luvio, config);
|
|
3341
3645
|
};
|
|
3342
3646
|
};
|
|
3343
3647
|
|
|
3344
|
-
function select$
|
|
3345
|
-
return select$
|
|
3648
|
+
function select$j(luvio, params) {
|
|
3649
|
+
return select$l();
|
|
3346
3650
|
}
|
|
3347
|
-
function getResponseCacheKeys$
|
|
3348
|
-
getTypeCacheKeys$
|
|
3651
|
+
function getResponseCacheKeys$b(storeKeyMap, luvio, resourceParams, response) {
|
|
3652
|
+
getTypeCacheKeys$6(storeKeyMap, luvio, response);
|
|
3349
3653
|
}
|
|
3350
|
-
function ingestSuccess$
|
|
3654
|
+
function ingestSuccess$b(luvio, resourceParams, response) {
|
|
3351
3655
|
const { body } = response;
|
|
3352
3656
|
const key = keyBuilderFromType(luvio, body);
|
|
3353
|
-
luvio.storeIngest(key, ingest$
|
|
3657
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
3354
3658
|
const snapshot = luvio.storeLookup({
|
|
3355
3659
|
recordId: key,
|
|
3356
|
-
node: select$
|
|
3660
|
+
node: select$j(),
|
|
3357
3661
|
variables: {},
|
|
3358
3662
|
});
|
|
3359
3663
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -3364,7 +3668,7 @@ function ingestSuccess$4(luvio, resourceParams, response) {
|
|
|
3364
3668
|
deepFreeze(snapshot.data);
|
|
3365
3669
|
return snapshot;
|
|
3366
3670
|
}
|
|
3367
|
-
function createResourceRequest$
|
|
3671
|
+
function createResourceRequest$b(config) {
|
|
3368
3672
|
const headers = {};
|
|
3369
3673
|
return {
|
|
3370
3674
|
baseUri: '/services/data/v65.0',
|
|
@@ -3378,20 +3682,19 @@ function createResourceRequest$4(config) {
|
|
|
3378
3682
|
};
|
|
3379
3683
|
}
|
|
3380
3684
|
|
|
3381
|
-
const adapterName$
|
|
3685
|
+
const adapterName$b = 'createPromptTemplateVersion';
|
|
3382
3686
|
const createPromptTemplateVersion_ConfigPropertyMetadata = [
|
|
3383
3687
|
generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
3384
3688
|
generateParamConfigMetadata('apiName', true, 2 /* Body */, 0 /* String */),
|
|
3385
3689
|
generateParamConfigMetadata('childRelationships', true, 2 /* Body */, 4 /* Unsupported */),
|
|
3386
|
-
generateParamConfigMetadata('fields', true, 2 /* Body */, 4 /* Unsupported
|
|
3690
|
+
generateParamConfigMetadata('fields', true, 2 /* Body */, 4 /* Unsupported */),
|
|
3387
3691
|
generateParamConfigMetadata('id', false, 2 /* Body */, 0 /* String */),
|
|
3388
|
-
generateParamConfigMetadata('isStandard', true, 2 /* Body */, 1 /* Boolean */),
|
|
3389
3692
|
];
|
|
3390
|
-
const createPromptTemplateVersion_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
3391
|
-
const createResourceParams$
|
|
3392
|
-
function typeCheckConfig$
|
|
3693
|
+
const createPromptTemplateVersion_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$b, createPromptTemplateVersion_ConfigPropertyMetadata);
|
|
3694
|
+
const createResourceParams$b = /*#__PURE__*/ createResourceParams$h(createPromptTemplateVersion_ConfigPropertyMetadata);
|
|
3695
|
+
function typeCheckConfig$b(untrustedConfig) {
|
|
3393
3696
|
const config = {};
|
|
3394
|
-
typeCheckConfig$
|
|
3697
|
+
typeCheckConfig$h(untrustedConfig, config, createPromptTemplateVersion_ConfigPropertyMetadata);
|
|
3395
3698
|
const untrustedConfig_childRelationships = untrustedConfig.childRelationships;
|
|
3396
3699
|
if (untrustedIsObject(untrustedConfig_childRelationships)) {
|
|
3397
3700
|
const untrustedConfig_childRelationships_object = {};
|
|
@@ -3408,53 +3711,46 @@ function typeCheckConfig$4(untrustedConfig) {
|
|
|
3408
3711
|
}
|
|
3409
3712
|
}
|
|
3410
3713
|
const untrustedConfig_fields = untrustedConfig.fields;
|
|
3411
|
-
if (
|
|
3412
|
-
const
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
const key = untrustedConfig_fields_item_keys[i];
|
|
3420
|
-
const untrustedConfig_fields_item_prop = untrustedConfig_fields_item[key];
|
|
3421
|
-
if (untrustedConfig_fields_item_object !== undefined) {
|
|
3422
|
-
untrustedConfig_fields_item_object[key] = untrustedConfig_fields_item_prop;
|
|
3423
|
-
}
|
|
3424
|
-
}
|
|
3425
|
-
if (untrustedConfig_fields_item_object !== undefined && Object.keys(untrustedConfig_fields_item_object).length >= 0) {
|
|
3426
|
-
untrustedConfig_fields_array.push(untrustedConfig_fields_item_object);
|
|
3427
|
-
}
|
|
3714
|
+
if (untrustedIsObject(untrustedConfig_fields)) {
|
|
3715
|
+
const untrustedConfig_fields_object = {};
|
|
3716
|
+
const untrustedConfig_fields_keys = Object.keys(untrustedConfig_fields);
|
|
3717
|
+
for (let i = 0, arrayLength = untrustedConfig_fields_keys.length; i < arrayLength; i++) {
|
|
3718
|
+
const key = untrustedConfig_fields_keys[i];
|
|
3719
|
+
const untrustedConfig_fields_prop = untrustedConfig_fields[key];
|
|
3720
|
+
if (untrustedConfig_fields_object !== undefined) {
|
|
3721
|
+
untrustedConfig_fields_object[key] = untrustedConfig_fields_prop;
|
|
3428
3722
|
}
|
|
3429
3723
|
}
|
|
3430
|
-
|
|
3724
|
+
if (untrustedConfig_fields_object !== undefined && Object.keys(untrustedConfig_fields_object).length >= 0) {
|
|
3725
|
+
config.fields = untrustedConfig_fields_object;
|
|
3726
|
+
}
|
|
3431
3727
|
}
|
|
3432
3728
|
return config;
|
|
3433
3729
|
}
|
|
3434
|
-
function validateAdapterConfig$
|
|
3730
|
+
function validateAdapterConfig$b(untrustedConfig, configPropertyNames) {
|
|
3435
3731
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
3436
3732
|
return null;
|
|
3437
3733
|
}
|
|
3438
3734
|
if (process.env.NODE_ENV !== 'production') {
|
|
3439
3735
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
3440
3736
|
}
|
|
3441
|
-
const config = typeCheckConfig$
|
|
3737
|
+
const config = typeCheckConfig$b(untrustedConfig);
|
|
3442
3738
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3443
3739
|
return null;
|
|
3444
3740
|
}
|
|
3445
3741
|
return config;
|
|
3446
3742
|
}
|
|
3447
|
-
function buildNetworkSnapshot$
|
|
3448
|
-
const resourceParams = createResourceParams$
|
|
3449
|
-
const request = createResourceRequest$
|
|
3743
|
+
function buildNetworkSnapshot$b(luvio, config, options) {
|
|
3744
|
+
const resourceParams = createResourceParams$b(config);
|
|
3745
|
+
const request = createResourceRequest$b(resourceParams);
|
|
3450
3746
|
return luvio.dispatchResourceRequest(request, options)
|
|
3451
3747
|
.then((response) => {
|
|
3452
3748
|
return luvio.handleSuccessResponse(() => {
|
|
3453
|
-
const snapshot = ingestSuccess$
|
|
3749
|
+
const snapshot = ingestSuccess$b(luvio, resourceParams, response);
|
|
3454
3750
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
3455
3751
|
}, () => {
|
|
3456
3752
|
const cache = new StoreKeyMap();
|
|
3457
|
-
getResponseCacheKeys$
|
|
3753
|
+
getResponseCacheKeys$b(cache, luvio, resourceParams, response.body);
|
|
3458
3754
|
return cache;
|
|
3459
3755
|
});
|
|
3460
3756
|
}, (response) => {
|
|
@@ -3464,177 +3760,1258 @@ function buildNetworkSnapshot$4(luvio, config, options) {
|
|
|
3464
3760
|
}
|
|
3465
3761
|
const createPromptTemplateVersionAdapterFactory = (luvio) => {
|
|
3466
3762
|
return function createPromptTemplateVersion(untrustedConfig) {
|
|
3467
|
-
const config = validateAdapterConfig$
|
|
3763
|
+
const config = validateAdapterConfig$b(untrustedConfig, createPromptTemplateVersion_ConfigPropertyNames);
|
|
3468
3764
|
// Invalid or incomplete config
|
|
3469
3765
|
if (config === null) {
|
|
3470
3766
|
throw new Error('Invalid config for "createPromptTemplateVersion"');
|
|
3471
3767
|
}
|
|
3472
|
-
return buildNetworkSnapshot$
|
|
3768
|
+
return buildNetworkSnapshot$b(luvio, config);
|
|
3473
3769
|
};
|
|
3474
3770
|
};
|
|
3475
3771
|
|
|
3476
|
-
|
|
3477
|
-
function validate$5(obj, path = 'EinsteinPromptTemplateSupportedLanguageErrorRepresentation') {
|
|
3772
|
+
function validate$b(obj, path = 'PromptTemplateDataProviderOutputParamRepresentation') {
|
|
3478
3773
|
const v_error = (() => {
|
|
3479
3774
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3480
3775
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3481
3776
|
}
|
|
3482
|
-
const
|
|
3483
|
-
const
|
|
3484
|
-
if (typeof
|
|
3485
|
-
return new TypeError('Expected "string" but received "' + typeof
|
|
3777
|
+
const obj_apiName = obj.apiName;
|
|
3778
|
+
const path_apiName = path + '.apiName';
|
|
3779
|
+
if (typeof obj_apiName !== 'string') {
|
|
3780
|
+
return new TypeError('Expected "string" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
|
|
3486
3781
|
}
|
|
3487
|
-
const
|
|
3488
|
-
const
|
|
3489
|
-
if (typeof
|
|
3490
|
-
return new TypeError('Expected "string" but received "' + typeof
|
|
3782
|
+
const obj_label = obj.label;
|
|
3783
|
+
const path_label = path + '.label';
|
|
3784
|
+
if (typeof obj_label !== 'string') {
|
|
3785
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
3786
|
+
}
|
|
3787
|
+
if (obj.type !== undefined) {
|
|
3788
|
+
const obj_type = obj.type;
|
|
3789
|
+
const path_type = path + '.type';
|
|
3790
|
+
if (typeof obj_type !== 'string') {
|
|
3791
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
3792
|
+
}
|
|
3491
3793
|
}
|
|
3492
3794
|
})();
|
|
3493
3795
|
return v_error === undefined ? null : v_error;
|
|
3494
3796
|
}
|
|
3495
|
-
const select$8 = function EinsteinPromptTemplateSupportedLanguageErrorRepresentationSelect() {
|
|
3496
|
-
return {
|
|
3497
|
-
kind: 'Fragment',
|
|
3498
|
-
version: VERSION$4,
|
|
3499
|
-
private: [],
|
|
3500
|
-
selections: [
|
|
3501
|
-
{
|
|
3502
|
-
name: 'errorMessage',
|
|
3503
|
-
kind: 'Scalar'
|
|
3504
|
-
},
|
|
3505
|
-
{
|
|
3506
|
-
name: 'messageCode',
|
|
3507
|
-
kind: 'Scalar'
|
|
3508
|
-
}
|
|
3509
|
-
]
|
|
3510
|
-
};
|
|
3511
|
-
};
|
|
3512
|
-
function equals$4(existing, incoming) {
|
|
3513
|
-
const existing_errorMessage = existing.errorMessage;
|
|
3514
|
-
const incoming_errorMessage = incoming.errorMessage;
|
|
3515
|
-
if (!(existing_errorMessage === incoming_errorMessage)) {
|
|
3516
|
-
return false;
|
|
3517
|
-
}
|
|
3518
|
-
const existing_messageCode = existing.messageCode;
|
|
3519
|
-
const incoming_messageCode = incoming.messageCode;
|
|
3520
|
-
if (!(existing_messageCode === incoming_messageCode)) {
|
|
3521
|
-
return false;
|
|
3522
|
-
}
|
|
3523
|
-
return true;
|
|
3524
|
-
}
|
|
3525
3797
|
|
|
3526
|
-
|
|
3527
|
-
function validate$4(obj, path = 'EinsteinPromptTemplateSupportedLanguageRepresentation') {
|
|
3798
|
+
function validate$a(obj, path = 'PromptTemplateDataProviderInputParamRepresentation') {
|
|
3528
3799
|
const v_error = (() => {
|
|
3529
3800
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3530
3801
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3531
3802
|
}
|
|
3532
|
-
const
|
|
3533
|
-
const
|
|
3534
|
-
if (typeof
|
|
3535
|
-
return new TypeError('Expected "string" but received "' + typeof
|
|
3803
|
+
const obj_apiName = obj.apiName;
|
|
3804
|
+
const path_apiName = path + '.apiName';
|
|
3805
|
+
if (typeof obj_apiName !== 'string') {
|
|
3806
|
+
return new TypeError('Expected "string" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
|
|
3536
3807
|
}
|
|
3537
|
-
const
|
|
3538
|
-
const
|
|
3539
|
-
if (typeof
|
|
3540
|
-
return new TypeError('Expected "string" but received "' + typeof
|
|
3808
|
+
const obj_label = obj.label;
|
|
3809
|
+
const path_label = path + '.label';
|
|
3810
|
+
if (typeof obj_label !== 'string') {
|
|
3811
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
3812
|
+
}
|
|
3813
|
+
const obj_required = obj.required;
|
|
3814
|
+
const path_required = path + '.required';
|
|
3815
|
+
if (typeof obj_required !== 'boolean') {
|
|
3816
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_required + '" (at "' + path_required + '")');
|
|
3817
|
+
}
|
|
3818
|
+
const obj_type = obj.type;
|
|
3819
|
+
const path_type = path + '.type';
|
|
3820
|
+
if (typeof obj_type !== 'string') {
|
|
3821
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
3541
3822
|
}
|
|
3542
3823
|
})();
|
|
3543
3824
|
return v_error === undefined ? null : v_error;
|
|
3544
3825
|
}
|
|
3545
|
-
const select$7 = function EinsteinPromptTemplateSupportedLanguageRepresentationSelect() {
|
|
3546
|
-
return {
|
|
3547
|
-
kind: 'Fragment',
|
|
3548
|
-
version: VERSION$3,
|
|
3549
|
-
private: [],
|
|
3550
|
-
selections: [
|
|
3551
|
-
{
|
|
3552
|
-
name: 'languageCode',
|
|
3553
|
-
kind: 'Scalar'
|
|
3554
|
-
},
|
|
3555
|
-
{
|
|
3556
|
-
name: 'languageDisplayName',
|
|
3557
|
-
kind: 'Scalar'
|
|
3558
|
-
}
|
|
3559
|
-
]
|
|
3560
|
-
};
|
|
3561
|
-
};
|
|
3562
|
-
function equals$3(existing, incoming) {
|
|
3563
|
-
const existing_languageCode = existing.languageCode;
|
|
3564
|
-
const incoming_languageCode = incoming.languageCode;
|
|
3565
|
-
if (!(existing_languageCode === incoming_languageCode)) {
|
|
3566
|
-
return false;
|
|
3567
|
-
}
|
|
3568
|
-
const existing_languageDisplayName = existing.languageDisplayName;
|
|
3569
|
-
const incoming_languageDisplayName = incoming.languageDisplayName;
|
|
3570
|
-
if (!(existing_languageDisplayName === incoming_languageDisplayName)) {
|
|
3571
|
-
return false;
|
|
3572
|
-
}
|
|
3573
|
-
return true;
|
|
3574
|
-
}
|
|
3575
3826
|
|
|
3576
|
-
const TTL$
|
|
3577
|
-
const VERSION$
|
|
3578
|
-
function validate$
|
|
3827
|
+
const TTL$5 = 300;
|
|
3828
|
+
const VERSION$7 = "d4824d8c6e7848df0de89295e6d9d434";
|
|
3829
|
+
function validate$9(obj, path = 'PromptTemplateDataProviderInstanceConfigRepresentation') {
|
|
3579
3830
|
const v_error = (() => {
|
|
3580
3831
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3581
3832
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3582
3833
|
}
|
|
3583
|
-
const
|
|
3584
|
-
const
|
|
3585
|
-
if (
|
|
3586
|
-
return new TypeError('Expected "
|
|
3834
|
+
const obj_apiName = obj.apiName;
|
|
3835
|
+
const path_apiName = path + '.apiName';
|
|
3836
|
+
if (typeof obj_apiName !== 'string') {
|
|
3837
|
+
return new TypeError('Expected "string" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
|
|
3838
|
+
}
|
|
3839
|
+
if (obj.dataProviderBundle !== undefined) {
|
|
3840
|
+
const obj_dataProviderBundle = obj.dataProviderBundle;
|
|
3841
|
+
const path_dataProviderBundle = path + '.dataProviderBundle';
|
|
3842
|
+
if (typeof obj_dataProviderBundle !== 'object' || ArrayIsArray(obj_dataProviderBundle) || obj_dataProviderBundle === null) {
|
|
3843
|
+
return new TypeError('Expected "object" but received "' + typeof obj_dataProviderBundle + '" (at "' + path_dataProviderBundle + '")');
|
|
3844
|
+
}
|
|
3845
|
+
const obj_dataProviderBundle_keys = ObjectKeys(obj_dataProviderBundle);
|
|
3846
|
+
for (let i = 0; i < obj_dataProviderBundle_keys.length; i++) {
|
|
3847
|
+
const key = obj_dataProviderBundle_keys[i];
|
|
3848
|
+
const obj_dataProviderBundle_prop = obj_dataProviderBundle[key];
|
|
3849
|
+
const path_dataProviderBundle_prop = path_dataProviderBundle + '["' + key + '"]';
|
|
3850
|
+
if (obj_dataProviderBundle_prop === undefined) {
|
|
3851
|
+
return new TypeError('Expected "defined" but received "' + typeof obj_dataProviderBundle_prop + '" (at "' + path_dataProviderBundle_prop + '")');
|
|
3852
|
+
}
|
|
3853
|
+
}
|
|
3587
3854
|
}
|
|
3588
|
-
|
|
3589
|
-
const
|
|
3590
|
-
const
|
|
3591
|
-
const
|
|
3592
|
-
if (
|
|
3593
|
-
let message = 'Object doesn\'t match
|
|
3594
|
-
message +=
|
|
3855
|
+
if (obj.defaultOutputParam !== undefined) {
|
|
3856
|
+
const obj_defaultOutputParam = obj.defaultOutputParam;
|
|
3857
|
+
const path_defaultOutputParam = path + '.defaultOutputParam';
|
|
3858
|
+
const referencepath_defaultOutputParamValidationError = validate$b(obj_defaultOutputParam, path_defaultOutputParam);
|
|
3859
|
+
if (referencepath_defaultOutputParamValidationError !== null) {
|
|
3860
|
+
let message = 'Object doesn\'t match PromptTemplateDataProviderOutputParamRepresentation (at "' + path_defaultOutputParam + '")\n';
|
|
3861
|
+
message += referencepath_defaultOutputParamValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3595
3862
|
return new TypeError(message);
|
|
3596
3863
|
}
|
|
3597
3864
|
}
|
|
3598
|
-
const
|
|
3599
|
-
const
|
|
3600
|
-
if (typeof
|
|
3601
|
-
return new TypeError('Expected "
|
|
3602
|
-
}
|
|
3603
|
-
const obj_promptTemplateDevName = obj.promptTemplateDevName;
|
|
3604
|
-
const path_promptTemplateDevName = path + '.promptTemplateDevName';
|
|
3605
|
-
if (typeof obj_promptTemplateDevName !== 'string') {
|
|
3606
|
-
return new TypeError('Expected "string" but received "' + typeof obj_promptTemplateDevName + '" (at "' + path_promptTemplateDevName + '")');
|
|
3607
|
-
}
|
|
3608
|
-
const obj_supportedLanguages = obj.supportedLanguages;
|
|
3609
|
-
const path_supportedLanguages = path + '.supportedLanguages';
|
|
3610
|
-
if (!ArrayIsArray(obj_supportedLanguages)) {
|
|
3611
|
-
return new TypeError('Expected "array" but received "' + typeof obj_supportedLanguages + '" (at "' + path_supportedLanguages + '")');
|
|
3865
|
+
const obj_definition = obj.definition;
|
|
3866
|
+
const path_definition = path + '.definition';
|
|
3867
|
+
if (typeof obj_definition !== 'string') {
|
|
3868
|
+
return new TypeError('Expected "string" but received "' + typeof obj_definition + '" (at "' + path_definition + '")');
|
|
3612
3869
|
}
|
|
3613
|
-
|
|
3614
|
-
const
|
|
3615
|
-
const
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3870
|
+
if (obj.description !== undefined) {
|
|
3871
|
+
const obj_description = obj.description;
|
|
3872
|
+
const path_description = path + '.description';
|
|
3873
|
+
let obj_description_union0 = null;
|
|
3874
|
+
const obj_description_union0_error = (() => {
|
|
3875
|
+
if (typeof obj_description !== 'string') {
|
|
3876
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
3877
|
+
}
|
|
3878
|
+
})();
|
|
3879
|
+
if (obj_description_union0_error != null) {
|
|
3880
|
+
obj_description_union0 = obj_description_union0_error.message;
|
|
3881
|
+
}
|
|
3882
|
+
let obj_description_union1 = null;
|
|
3883
|
+
const obj_description_union1_error = (() => {
|
|
3884
|
+
if (obj_description !== null) {
|
|
3885
|
+
return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
3886
|
+
}
|
|
3887
|
+
})();
|
|
3888
|
+
if (obj_description_union1_error != null) {
|
|
3889
|
+
obj_description_union1 = obj_description_union1_error.message;
|
|
3890
|
+
}
|
|
3891
|
+
if (obj_description_union0 && obj_description_union1) {
|
|
3892
|
+
let message = 'Object doesn\'t match union (at "' + path_description + '")';
|
|
3893
|
+
message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
3894
|
+
message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
3620
3895
|
return new TypeError(message);
|
|
3621
3896
|
}
|
|
3622
3897
|
}
|
|
3623
|
-
const
|
|
3624
|
-
const
|
|
3625
|
-
if (typeof
|
|
3626
|
-
return new TypeError('Expected "string" but received "' + typeof
|
|
3898
|
+
const obj_groupName = obj.groupName;
|
|
3899
|
+
const path_groupName = path + '.groupName';
|
|
3900
|
+
if (typeof obj_groupName !== 'string') {
|
|
3901
|
+
return new TypeError('Expected "string" but received "' + typeof obj_groupName + '" (at "' + path_groupName + '")');
|
|
3902
|
+
}
|
|
3903
|
+
if (obj.inputParams !== undefined) {
|
|
3904
|
+
const obj_inputParams = obj.inputParams;
|
|
3905
|
+
const path_inputParams = path + '.inputParams';
|
|
3906
|
+
if (!ArrayIsArray(obj_inputParams)) {
|
|
3907
|
+
return new TypeError('Expected "array" but received "' + typeof obj_inputParams + '" (at "' + path_inputParams + '")');
|
|
3908
|
+
}
|
|
3909
|
+
for (let i = 0; i < obj_inputParams.length; i++) {
|
|
3910
|
+
const obj_inputParams_item = obj_inputParams[i];
|
|
3911
|
+
const path_inputParams_item = path_inputParams + '[' + i + ']';
|
|
3912
|
+
const referencepath_inputParams_itemValidationError = validate$a(obj_inputParams_item, path_inputParams_item);
|
|
3913
|
+
if (referencepath_inputParams_itemValidationError !== null) {
|
|
3914
|
+
let message = 'Object doesn\'t match PromptTemplateDataProviderInputParamRepresentation (at "' + path_inputParams_item + '")\n';
|
|
3915
|
+
message += referencepath_inputParams_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3916
|
+
return new TypeError(message);
|
|
3917
|
+
}
|
|
3918
|
+
}
|
|
3627
3919
|
}
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3920
|
+
const obj_label = obj.label;
|
|
3921
|
+
const path_label = path + '.label';
|
|
3922
|
+
if (typeof obj_label !== 'string') {
|
|
3923
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
3924
|
+
}
|
|
3925
|
+
if (obj.mappedInputs !== undefined) {
|
|
3926
|
+
const obj_mappedInputs = obj.mappedInputs;
|
|
3927
|
+
const path_mappedInputs = path + '.mappedInputs';
|
|
3928
|
+
if (typeof obj_mappedInputs !== 'object' || ArrayIsArray(obj_mappedInputs) || obj_mappedInputs === null) {
|
|
3929
|
+
return new TypeError('Expected "object" but received "' + typeof obj_mappedInputs + '" (at "' + path_mappedInputs + '")');
|
|
3930
|
+
}
|
|
3931
|
+
const obj_mappedInputs_keys = ObjectKeys(obj_mappedInputs);
|
|
3932
|
+
for (let i = 0; i < obj_mappedInputs_keys.length; i++) {
|
|
3933
|
+
const key = obj_mappedInputs_keys[i];
|
|
3934
|
+
const obj_mappedInputs_prop = obj_mappedInputs[key];
|
|
3935
|
+
const path_mappedInputs_prop = path_mappedInputs + '["' + key + '"]';
|
|
3936
|
+
if (obj_mappedInputs_prop === undefined) {
|
|
3937
|
+
return new TypeError('Expected "defined" but received "' + typeof obj_mappedInputs_prop + '" (at "' + path_mappedInputs_prop + '")');
|
|
3938
|
+
}
|
|
3939
|
+
}
|
|
3940
|
+
}
|
|
3941
|
+
if (obj.nodeIcon !== undefined) {
|
|
3942
|
+
const obj_nodeIcon = obj.nodeIcon;
|
|
3943
|
+
const path_nodeIcon = path + '.nodeIcon';
|
|
3944
|
+
let obj_nodeIcon_union0 = null;
|
|
3945
|
+
const obj_nodeIcon_union0_error = (() => {
|
|
3946
|
+
if (typeof obj_nodeIcon !== 'string') {
|
|
3947
|
+
return new TypeError('Expected "string" but received "' + typeof obj_nodeIcon + '" (at "' + path_nodeIcon + '")');
|
|
3948
|
+
}
|
|
3949
|
+
})();
|
|
3950
|
+
if (obj_nodeIcon_union0_error != null) {
|
|
3951
|
+
obj_nodeIcon_union0 = obj_nodeIcon_union0_error.message;
|
|
3952
|
+
}
|
|
3953
|
+
let obj_nodeIcon_union1 = null;
|
|
3954
|
+
const obj_nodeIcon_union1_error = (() => {
|
|
3955
|
+
if (obj_nodeIcon !== null) {
|
|
3956
|
+
return new TypeError('Expected "null" but received "' + typeof obj_nodeIcon + '" (at "' + path_nodeIcon + '")');
|
|
3957
|
+
}
|
|
3958
|
+
})();
|
|
3959
|
+
if (obj_nodeIcon_union1_error != null) {
|
|
3960
|
+
obj_nodeIcon_union1 = obj_nodeIcon_union1_error.message;
|
|
3961
|
+
}
|
|
3962
|
+
if (obj_nodeIcon_union0 && obj_nodeIcon_union1) {
|
|
3963
|
+
let message = 'Object doesn\'t match union (at "' + path_nodeIcon + '")';
|
|
3964
|
+
message += '\n' + obj_nodeIcon_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
3965
|
+
message += '\n' + obj_nodeIcon_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
3966
|
+
return new TypeError(message);
|
|
3967
|
+
}
|
|
3968
|
+
}
|
|
3969
|
+
if (obj.outputParams !== undefined) {
|
|
3970
|
+
const obj_outputParams = obj.outputParams;
|
|
3971
|
+
const path_outputParams = path + '.outputParams';
|
|
3972
|
+
if (!ArrayIsArray(obj_outputParams)) {
|
|
3973
|
+
return new TypeError('Expected "array" but received "' + typeof obj_outputParams + '" (at "' + path_outputParams + '")');
|
|
3974
|
+
}
|
|
3975
|
+
for (let i = 0; i < obj_outputParams.length; i++) {
|
|
3976
|
+
const obj_outputParams_item = obj_outputParams[i];
|
|
3977
|
+
const path_outputParams_item = path_outputParams + '[' + i + ']';
|
|
3978
|
+
const referencepath_outputParams_itemValidationError = validate$b(obj_outputParams_item, path_outputParams_item);
|
|
3979
|
+
if (referencepath_outputParams_itemValidationError !== null) {
|
|
3980
|
+
let message = 'Object doesn\'t match PromptTemplateDataProviderOutputParamRepresentation (at "' + path_outputParams_item + '")\n';
|
|
3981
|
+
message += referencepath_outputParams_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3982
|
+
return new TypeError(message);
|
|
3983
|
+
}
|
|
3984
|
+
}
|
|
3985
|
+
}
|
|
3986
|
+
const obj_referenceName = obj.referenceName;
|
|
3987
|
+
const path_referenceName = path + '.referenceName';
|
|
3988
|
+
if (typeof obj_referenceName !== 'string') {
|
|
3989
|
+
return new TypeError('Expected "string" but received "' + typeof obj_referenceName + '" (at "' + path_referenceName + '")');
|
|
3990
|
+
}
|
|
3991
|
+
if (obj.scopedToTarget !== undefined) {
|
|
3992
|
+
const obj_scopedToTarget = obj.scopedToTarget;
|
|
3993
|
+
const path_scopedToTarget = path + '.scopedToTarget';
|
|
3994
|
+
let obj_scopedToTarget_union0 = null;
|
|
3995
|
+
const obj_scopedToTarget_union0_error = (() => {
|
|
3996
|
+
if (typeof obj_scopedToTarget !== 'string') {
|
|
3997
|
+
return new TypeError('Expected "string" but received "' + typeof obj_scopedToTarget + '" (at "' + path_scopedToTarget + '")');
|
|
3998
|
+
}
|
|
3999
|
+
})();
|
|
4000
|
+
if (obj_scopedToTarget_union0_error != null) {
|
|
4001
|
+
obj_scopedToTarget_union0 = obj_scopedToTarget_union0_error.message;
|
|
4002
|
+
}
|
|
4003
|
+
let obj_scopedToTarget_union1 = null;
|
|
4004
|
+
const obj_scopedToTarget_union1_error = (() => {
|
|
4005
|
+
if (obj_scopedToTarget !== null) {
|
|
4006
|
+
return new TypeError('Expected "null" but received "' + typeof obj_scopedToTarget + '" (at "' + path_scopedToTarget + '")');
|
|
4007
|
+
}
|
|
4008
|
+
})();
|
|
4009
|
+
if (obj_scopedToTarget_union1_error != null) {
|
|
4010
|
+
obj_scopedToTarget_union1 = obj_scopedToTarget_union1_error.message;
|
|
4011
|
+
}
|
|
4012
|
+
if (obj_scopedToTarget_union0 && obj_scopedToTarget_union1) {
|
|
4013
|
+
let message = 'Object doesn\'t match union (at "' + path_scopedToTarget + '")';
|
|
4014
|
+
message += '\n' + obj_scopedToTarget_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
4015
|
+
message += '\n' + obj_scopedToTarget_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
4016
|
+
return new TypeError(message);
|
|
4017
|
+
}
|
|
4018
|
+
}
|
|
4019
|
+
if (obj.subGroup !== undefined) {
|
|
4020
|
+
const obj_subGroup = obj.subGroup;
|
|
4021
|
+
const path_subGroup = path + '.subGroup';
|
|
4022
|
+
let obj_subGroup_union0 = null;
|
|
4023
|
+
const obj_subGroup_union0_error = (() => {
|
|
4024
|
+
if (typeof obj_subGroup !== 'string') {
|
|
4025
|
+
return new TypeError('Expected "string" but received "' + typeof obj_subGroup + '" (at "' + path_subGroup + '")');
|
|
4026
|
+
}
|
|
4027
|
+
})();
|
|
4028
|
+
if (obj_subGroup_union0_error != null) {
|
|
4029
|
+
obj_subGroup_union0 = obj_subGroup_union0_error.message;
|
|
4030
|
+
}
|
|
4031
|
+
let obj_subGroup_union1 = null;
|
|
4032
|
+
const obj_subGroup_union1_error = (() => {
|
|
4033
|
+
if (obj_subGroup !== null) {
|
|
4034
|
+
return new TypeError('Expected "null" but received "' + typeof obj_subGroup + '" (at "' + path_subGroup + '")');
|
|
4035
|
+
}
|
|
4036
|
+
})();
|
|
4037
|
+
if (obj_subGroup_union1_error != null) {
|
|
4038
|
+
obj_subGroup_union1 = obj_subGroup_union1_error.message;
|
|
4039
|
+
}
|
|
4040
|
+
if (obj_subGroup_union0 && obj_subGroup_union1) {
|
|
4041
|
+
let message = 'Object doesn\'t match union (at "' + path_subGroup + '")';
|
|
4042
|
+
message += '\n' + obj_subGroup_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
4043
|
+
message += '\n' + obj_subGroup_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
4044
|
+
return new TypeError(message);
|
|
4045
|
+
}
|
|
4046
|
+
}
|
|
4047
|
+
})();
|
|
4048
|
+
return v_error === undefined ? null : v_error;
|
|
4049
|
+
}
|
|
4050
|
+
const RepresentationType$5 = 'PromptTemplateDataProviderInstanceConfigRepresentation';
|
|
4051
|
+
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
4052
|
+
return input;
|
|
4053
|
+
}
|
|
4054
|
+
const select$i = function PromptTemplateDataProviderInstanceConfigRepresentationSelect() {
|
|
4055
|
+
return {
|
|
4056
|
+
kind: 'Fragment',
|
|
4057
|
+
version: VERSION$7,
|
|
4058
|
+
private: [],
|
|
4059
|
+
opaque: true
|
|
4060
|
+
};
|
|
4061
|
+
};
|
|
4062
|
+
function equals$7(existing, incoming) {
|
|
4063
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
4064
|
+
return false;
|
|
4065
|
+
}
|
|
4066
|
+
return true;
|
|
4067
|
+
}
|
|
4068
|
+
const ingest$5 = function PromptTemplateDataProviderInstanceConfigRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
4069
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4070
|
+
const validateError = validate$9(input);
|
|
4071
|
+
if (validateError !== null) {
|
|
4072
|
+
throw validateError;
|
|
4073
|
+
}
|
|
4074
|
+
}
|
|
4075
|
+
const key = path.fullPath;
|
|
4076
|
+
const ttlToUse = TTL$5;
|
|
4077
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "EinsteinLLM", VERSION$7, RepresentationType$5, equals$7);
|
|
4078
|
+
return createLink(key);
|
|
4079
|
+
};
|
|
4080
|
+
function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
|
|
4081
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
4082
|
+
const rootKey = fullPathFactory();
|
|
4083
|
+
rootKeySet.set(rootKey, {
|
|
4084
|
+
namespace: keyPrefix,
|
|
4085
|
+
representationName: RepresentationType$5,
|
|
4086
|
+
mergeable: false
|
|
4087
|
+
});
|
|
4088
|
+
}
|
|
4089
|
+
|
|
4090
|
+
function select$h(luvio, params) {
|
|
4091
|
+
return select$i();
|
|
4092
|
+
}
|
|
4093
|
+
function keyBuilder$h(luvio, params) {
|
|
4094
|
+
return keyPrefix + '::PromptTemplateDataProviderInstanceConfigRepresentation:(' + stableJSONStringify(params.body.additionalParam) + '::' + 'definition:' + params.body.definition + '::' + 'groupName:' + params.body.groupName + ')';
|
|
4095
|
+
}
|
|
4096
|
+
function getResponseCacheKeys$a(storeKeyMap, luvio, resourceParams, response) {
|
|
4097
|
+
getTypeCacheKeys$5(storeKeyMap, luvio, response, () => keyBuilder$h(luvio, resourceParams));
|
|
4098
|
+
}
|
|
4099
|
+
function ingestSuccess$a(luvio, resourceParams, response, snapshotRefresh) {
|
|
4100
|
+
const { body } = response;
|
|
4101
|
+
const key = keyBuilder$h(luvio, resourceParams);
|
|
4102
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
4103
|
+
const snapshot = luvio.storeLookup({
|
|
4104
|
+
recordId: key,
|
|
4105
|
+
node: select$h(),
|
|
4106
|
+
variables: {},
|
|
4107
|
+
}, snapshotRefresh);
|
|
4108
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4109
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
4110
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
4111
|
+
}
|
|
4112
|
+
}
|
|
4113
|
+
deepFreeze(snapshot.data);
|
|
4114
|
+
return snapshot;
|
|
4115
|
+
}
|
|
4116
|
+
function ingestError$8(luvio, params, error, snapshotRefresh) {
|
|
4117
|
+
const key = keyBuilder$h(luvio, params);
|
|
4118
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
4119
|
+
const storeMetadataParams = {
|
|
4120
|
+
ttl: TTL$5,
|
|
4121
|
+
namespace: keyPrefix,
|
|
4122
|
+
version: VERSION$7,
|
|
4123
|
+
representationName: RepresentationType$5
|
|
4124
|
+
};
|
|
4125
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
4126
|
+
return errorSnapshot;
|
|
4127
|
+
}
|
|
4128
|
+
function createResourceRequest$a(config) {
|
|
4129
|
+
const headers = {};
|
|
4130
|
+
return {
|
|
4131
|
+
baseUri: '/services/data/v65.0',
|
|
4132
|
+
basePath: '/einstein/prompt-templates/data-provider/describe',
|
|
4133
|
+
method: 'post',
|
|
4134
|
+
body: config.body,
|
|
4135
|
+
urlParams: {},
|
|
4136
|
+
queryParams: {},
|
|
4137
|
+
headers,
|
|
4138
|
+
priority: 'normal',
|
|
4139
|
+
};
|
|
4140
|
+
}
|
|
4141
|
+
|
|
4142
|
+
const adapterName$a = 'getDataProviderInstanceConfig';
|
|
4143
|
+
const getDataProviderInstanceConfig_ConfigPropertyMetadata = [
|
|
4144
|
+
generateParamConfigMetadata('additionalParam', false, 2 /* Body */, 4 /* Unsupported */),
|
|
4145
|
+
generateParamConfigMetadata('definition', true, 2 /* Body */, 0 /* String */),
|
|
4146
|
+
generateParamConfigMetadata('groupName', true, 2 /* Body */, 0 /* String */),
|
|
4147
|
+
];
|
|
4148
|
+
const getDataProviderInstanceConfig_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$a, getDataProviderInstanceConfig_ConfigPropertyMetadata);
|
|
4149
|
+
const createResourceParams$a = /*#__PURE__*/ createResourceParams$h(getDataProviderInstanceConfig_ConfigPropertyMetadata);
|
|
4150
|
+
function keyBuilder$g(luvio, config) {
|
|
4151
|
+
const resourceParams = createResourceParams$a(config);
|
|
4152
|
+
return keyBuilder$h(luvio, resourceParams);
|
|
4153
|
+
}
|
|
4154
|
+
function typeCheckConfig$a(untrustedConfig) {
|
|
4155
|
+
const config = {};
|
|
4156
|
+
typeCheckConfig$h(untrustedConfig, config, getDataProviderInstanceConfig_ConfigPropertyMetadata);
|
|
4157
|
+
const untrustedConfig_additionalParam = untrustedConfig.additionalParam;
|
|
4158
|
+
if (untrustedIsObject(untrustedConfig_additionalParam)) {
|
|
4159
|
+
const untrustedConfig_additionalParam_object = {};
|
|
4160
|
+
const untrustedConfig_additionalParam_keys = Object.keys(untrustedConfig_additionalParam);
|
|
4161
|
+
for (let i = 0, arrayLength = untrustedConfig_additionalParam_keys.length; i < arrayLength; i++) {
|
|
4162
|
+
const key = untrustedConfig_additionalParam_keys[i];
|
|
4163
|
+
const untrustedConfig_additionalParam_prop = untrustedConfig_additionalParam[key];
|
|
4164
|
+
if (untrustedConfig_additionalParam_object !== undefined) {
|
|
4165
|
+
untrustedConfig_additionalParam_object[key] = untrustedConfig_additionalParam_prop;
|
|
4166
|
+
}
|
|
4167
|
+
}
|
|
4168
|
+
if (untrustedConfig_additionalParam_object !== undefined && Object.keys(untrustedConfig_additionalParam_object).length >= 0) {
|
|
4169
|
+
config.additionalParam = untrustedConfig_additionalParam_object;
|
|
4170
|
+
}
|
|
4171
|
+
}
|
|
4172
|
+
return config;
|
|
4173
|
+
}
|
|
4174
|
+
function validateAdapterConfig$a(untrustedConfig, configPropertyNames) {
|
|
4175
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
4176
|
+
return null;
|
|
4177
|
+
}
|
|
4178
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4179
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
4180
|
+
}
|
|
4181
|
+
const config = typeCheckConfig$a(untrustedConfig);
|
|
4182
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
4183
|
+
return null;
|
|
4184
|
+
}
|
|
4185
|
+
return config;
|
|
4186
|
+
}
|
|
4187
|
+
function adapterFragment$8(luvio, config) {
|
|
4188
|
+
createResourceParams$a(config);
|
|
4189
|
+
return select$h();
|
|
4190
|
+
}
|
|
4191
|
+
function onFetchResponseSuccess$8(luvio, config, resourceParams, response) {
|
|
4192
|
+
const snapshot = ingestSuccess$a(luvio, resourceParams, response, {
|
|
4193
|
+
config,
|
|
4194
|
+
resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
|
|
4195
|
+
});
|
|
4196
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
4197
|
+
}
|
|
4198
|
+
function onFetchResponseError$8(luvio, config, resourceParams, response) {
|
|
4199
|
+
const snapshot = ingestError$8(luvio, resourceParams, response, {
|
|
4200
|
+
config,
|
|
4201
|
+
resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
|
|
4202
|
+
});
|
|
4203
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
4204
|
+
}
|
|
4205
|
+
function buildNetworkSnapshot$a(luvio, config, options) {
|
|
4206
|
+
const resourceParams = createResourceParams$a(config);
|
|
4207
|
+
const request = createResourceRequest$a(resourceParams);
|
|
4208
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
4209
|
+
.then((response) => {
|
|
4210
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$8(luvio, config, resourceParams, response), () => {
|
|
4211
|
+
const cache = new StoreKeyMap();
|
|
4212
|
+
getResponseCacheKeys$a(cache, luvio, resourceParams, response.body);
|
|
4213
|
+
return cache;
|
|
4214
|
+
});
|
|
4215
|
+
}, (response) => {
|
|
4216
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$8(luvio, config, resourceParams, response));
|
|
4217
|
+
});
|
|
4218
|
+
}
|
|
4219
|
+
function buildNetworkSnapshotCachePolicy$8(context, coercedAdapterRequestContext) {
|
|
4220
|
+
return buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext, buildNetworkSnapshot$a, 'get', false);
|
|
4221
|
+
}
|
|
4222
|
+
function buildCachedSnapshotCachePolicy$8(context, storeLookup) {
|
|
4223
|
+
const { luvio, config } = context;
|
|
4224
|
+
const selector = {
|
|
4225
|
+
recordId: keyBuilder$g(luvio, config),
|
|
4226
|
+
node: adapterFragment$8(luvio, config),
|
|
4227
|
+
variables: {},
|
|
4228
|
+
};
|
|
4229
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
4230
|
+
config,
|
|
4231
|
+
resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
|
|
4232
|
+
});
|
|
4233
|
+
return cacheSnapshot;
|
|
4234
|
+
}
|
|
4235
|
+
const getDataProviderInstanceConfigAdapterFactory = (luvio) => function EinsteinLLM__getDataProviderInstanceConfig(untrustedConfig, requestContext) {
|
|
4236
|
+
const config = validateAdapterConfig$a(untrustedConfig, getDataProviderInstanceConfig_ConfigPropertyNames);
|
|
4237
|
+
// Invalid or incomplete config
|
|
4238
|
+
if (config === null) {
|
|
4239
|
+
return null;
|
|
4240
|
+
}
|
|
4241
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
4242
|
+
buildCachedSnapshotCachePolicy$8, buildNetworkSnapshotCachePolicy$8);
|
|
4243
|
+
};
|
|
4244
|
+
|
|
4245
|
+
function validate$8(obj, path = 'PromptTemplateDataProviderTypeConfigRepresentation') {
|
|
4246
|
+
const v_error = (() => {
|
|
4247
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
4248
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
4249
|
+
}
|
|
4250
|
+
if (obj.description !== undefined) {
|
|
4251
|
+
const obj_description = obj.description;
|
|
4252
|
+
const path_description = path + '.description';
|
|
4253
|
+
if (typeof obj_description !== 'string') {
|
|
4254
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
4255
|
+
}
|
|
4256
|
+
}
|
|
4257
|
+
const obj_groupName = obj.groupName;
|
|
4258
|
+
const path_groupName = path + '.groupName';
|
|
4259
|
+
if (typeof obj_groupName !== 'string') {
|
|
4260
|
+
return new TypeError('Expected "string" but received "' + typeof obj_groupName + '" (at "' + path_groupName + '")');
|
|
4261
|
+
}
|
|
4262
|
+
const obj_icon = obj.icon;
|
|
4263
|
+
const path_icon = path + '.icon';
|
|
4264
|
+
if (typeof obj_icon !== 'string') {
|
|
4265
|
+
return new TypeError('Expected "string" but received "' + typeof obj_icon + '" (at "' + path_icon + '")');
|
|
4266
|
+
}
|
|
4267
|
+
const obj_isTopLevel = obj.isTopLevel;
|
|
4268
|
+
const path_isTopLevel = path + '.isTopLevel';
|
|
4269
|
+
if (typeof obj_isTopLevel !== 'boolean') {
|
|
4270
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isTopLevel + '" (at "' + path_isTopLevel + '")');
|
|
4271
|
+
}
|
|
4272
|
+
const obj_label = obj.label;
|
|
4273
|
+
const path_label = path + '.label';
|
|
4274
|
+
if (typeof obj_label !== 'string') {
|
|
4275
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
4276
|
+
}
|
|
4277
|
+
if (obj.parentNode !== undefined) {
|
|
4278
|
+
const obj_parentNode = obj.parentNode;
|
|
4279
|
+
const path_parentNode = path + '.parentNode';
|
|
4280
|
+
if (typeof obj_parentNode !== 'string') {
|
|
4281
|
+
return new TypeError('Expected "string" but received "' + typeof obj_parentNode + '" (at "' + path_parentNode + '")');
|
|
4282
|
+
}
|
|
4283
|
+
}
|
|
4284
|
+
if (obj.scope !== undefined) {
|
|
4285
|
+
const obj_scope = obj.scope;
|
|
4286
|
+
const path_scope = path + '.scope';
|
|
4287
|
+
if (obj_scope === undefined) {
|
|
4288
|
+
return new TypeError('Expected "defined" but received "' + typeof obj_scope + '" (at "' + path_scope + '")');
|
|
4289
|
+
}
|
|
4290
|
+
}
|
|
4291
|
+
})();
|
|
4292
|
+
return v_error === undefined ? null : v_error;
|
|
4293
|
+
}
|
|
4294
|
+
|
|
4295
|
+
const TTL$4 = 300;
|
|
4296
|
+
const VERSION$6 = "212332dac1decc071b476742df3440fb";
|
|
4297
|
+
function validate$7(obj, path = 'PromptTemplateDataProviderTypeConfigCollectionRepresentation') {
|
|
4298
|
+
const v_error = (() => {
|
|
4299
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
4300
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
4301
|
+
}
|
|
4302
|
+
const obj_dataProviderTypeConfigs = obj.dataProviderTypeConfigs;
|
|
4303
|
+
const path_dataProviderTypeConfigs = path + '.dataProviderTypeConfigs';
|
|
4304
|
+
if (!ArrayIsArray(obj_dataProviderTypeConfigs)) {
|
|
4305
|
+
return new TypeError('Expected "array" but received "' + typeof obj_dataProviderTypeConfigs + '" (at "' + path_dataProviderTypeConfigs + '")');
|
|
4306
|
+
}
|
|
4307
|
+
for (let i = 0; i < obj_dataProviderTypeConfigs.length; i++) {
|
|
4308
|
+
const obj_dataProviderTypeConfigs_item = obj_dataProviderTypeConfigs[i];
|
|
4309
|
+
const path_dataProviderTypeConfigs_item = path_dataProviderTypeConfigs + '[' + i + ']';
|
|
4310
|
+
const referencepath_dataProviderTypeConfigs_itemValidationError = validate$8(obj_dataProviderTypeConfigs_item, path_dataProviderTypeConfigs_item);
|
|
4311
|
+
if (referencepath_dataProviderTypeConfigs_itemValidationError !== null) {
|
|
4312
|
+
let message = 'Object doesn\'t match PromptTemplateDataProviderTypeConfigRepresentation (at "' + path_dataProviderTypeConfigs_item + '")\n';
|
|
4313
|
+
message += referencepath_dataProviderTypeConfigs_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
4314
|
+
return new TypeError(message);
|
|
4315
|
+
}
|
|
4316
|
+
}
|
|
4317
|
+
})();
|
|
4318
|
+
return v_error === undefined ? null : v_error;
|
|
4319
|
+
}
|
|
4320
|
+
const RepresentationType$4 = 'PromptTemplateDataProviderTypeConfigCollectionRepresentation';
|
|
4321
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
4322
|
+
return input;
|
|
4323
|
+
}
|
|
4324
|
+
const select$g = function PromptTemplateDataProviderTypeConfigCollectionRepresentationSelect() {
|
|
4325
|
+
return {
|
|
4326
|
+
kind: 'Fragment',
|
|
4327
|
+
version: VERSION$6,
|
|
4328
|
+
private: [],
|
|
4329
|
+
opaque: true
|
|
4330
|
+
};
|
|
4331
|
+
};
|
|
4332
|
+
function equals$6(existing, incoming) {
|
|
4333
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
4334
|
+
return false;
|
|
4335
|
+
}
|
|
4336
|
+
return true;
|
|
4337
|
+
}
|
|
4338
|
+
const ingest$4 = function PromptTemplateDataProviderTypeConfigCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
4339
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4340
|
+
const validateError = validate$7(input);
|
|
4341
|
+
if (validateError !== null) {
|
|
4342
|
+
throw validateError;
|
|
4343
|
+
}
|
|
4344
|
+
}
|
|
4345
|
+
const key = path.fullPath;
|
|
4346
|
+
const ttlToUse = TTL$4;
|
|
4347
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "EinsteinLLM", VERSION$6, RepresentationType$4, equals$6);
|
|
4348
|
+
return createLink(key);
|
|
4349
|
+
};
|
|
4350
|
+
function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
|
|
4351
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
4352
|
+
const rootKey = fullPathFactory();
|
|
4353
|
+
rootKeySet.set(rootKey, {
|
|
4354
|
+
namespace: keyPrefix,
|
|
4355
|
+
representationName: RepresentationType$4,
|
|
4356
|
+
mergeable: false
|
|
4357
|
+
});
|
|
4358
|
+
}
|
|
4359
|
+
|
|
4360
|
+
function select$f(luvio, params) {
|
|
4361
|
+
return select$g();
|
|
4362
|
+
}
|
|
4363
|
+
function keyBuilder$f(luvio, params) {
|
|
4364
|
+
return keyPrefix + '::PromptTemplateDataProviderTypeConfigCollectionRepresentation:(' + 'templateType:' + params.urlParams.templateType + ')';
|
|
4365
|
+
}
|
|
4366
|
+
function getResponseCacheKeys$9(storeKeyMap, luvio, resourceParams, response) {
|
|
4367
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$f(luvio, resourceParams));
|
|
4368
|
+
}
|
|
4369
|
+
function ingestSuccess$9(luvio, resourceParams, response, snapshotRefresh) {
|
|
4370
|
+
const { body } = response;
|
|
4371
|
+
const key = keyBuilder$f(luvio, resourceParams);
|
|
4372
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
4373
|
+
const snapshot = luvio.storeLookup({
|
|
4374
|
+
recordId: key,
|
|
4375
|
+
node: select$f(),
|
|
4376
|
+
variables: {},
|
|
4377
|
+
}, snapshotRefresh);
|
|
4378
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4379
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
4380
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
4381
|
+
}
|
|
4382
|
+
}
|
|
4383
|
+
deepFreeze(snapshot.data);
|
|
4384
|
+
return snapshot;
|
|
4385
|
+
}
|
|
4386
|
+
function ingestError$7(luvio, params, error, snapshotRefresh) {
|
|
4387
|
+
const key = keyBuilder$f(luvio, params);
|
|
4388
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
4389
|
+
const storeMetadataParams = {
|
|
4390
|
+
ttl: TTL$4,
|
|
4391
|
+
namespace: keyPrefix,
|
|
4392
|
+
version: VERSION$6,
|
|
4393
|
+
representationName: RepresentationType$4
|
|
4394
|
+
};
|
|
4395
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
4396
|
+
return errorSnapshot;
|
|
4397
|
+
}
|
|
4398
|
+
function createResourceRequest$9(config) {
|
|
4399
|
+
const headers = {};
|
|
4400
|
+
return {
|
|
4401
|
+
baseUri: '/services/data/v65.0',
|
|
4402
|
+
basePath: '/einstein/prompt-templates/data-provider-types/' + config.urlParams.templateType + '',
|
|
4403
|
+
method: 'get',
|
|
4404
|
+
body: null,
|
|
4405
|
+
urlParams: config.urlParams,
|
|
4406
|
+
queryParams: {},
|
|
4407
|
+
headers,
|
|
4408
|
+
priority: 'normal',
|
|
4409
|
+
};
|
|
4410
|
+
}
|
|
4411
|
+
|
|
4412
|
+
const adapterName$9 = 'getDataProviderTypeConfigs';
|
|
4413
|
+
const getDataProviderTypeConfigs_ConfigPropertyMetadata = [
|
|
4414
|
+
generateParamConfigMetadata('templateType', true, 0 /* UrlParameter */, 0 /* String */),
|
|
4415
|
+
];
|
|
4416
|
+
const getDataProviderTypeConfigs_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$9, getDataProviderTypeConfigs_ConfigPropertyMetadata);
|
|
4417
|
+
const createResourceParams$9 = /*#__PURE__*/ createResourceParams$h(getDataProviderTypeConfigs_ConfigPropertyMetadata);
|
|
4418
|
+
function keyBuilder$e(luvio, config) {
|
|
4419
|
+
const resourceParams = createResourceParams$9(config);
|
|
4420
|
+
return keyBuilder$f(luvio, resourceParams);
|
|
4421
|
+
}
|
|
4422
|
+
function typeCheckConfig$9(untrustedConfig) {
|
|
4423
|
+
const config = {};
|
|
4424
|
+
typeCheckConfig$h(untrustedConfig, config, getDataProviderTypeConfigs_ConfigPropertyMetadata);
|
|
4425
|
+
return config;
|
|
4426
|
+
}
|
|
4427
|
+
function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
|
|
4428
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
4429
|
+
return null;
|
|
4430
|
+
}
|
|
4431
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4432
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
4433
|
+
}
|
|
4434
|
+
const config = typeCheckConfig$9(untrustedConfig);
|
|
4435
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
4436
|
+
return null;
|
|
4437
|
+
}
|
|
4438
|
+
return config;
|
|
4439
|
+
}
|
|
4440
|
+
function adapterFragment$7(luvio, config) {
|
|
4441
|
+
createResourceParams$9(config);
|
|
4442
|
+
return select$f();
|
|
4443
|
+
}
|
|
4444
|
+
function onFetchResponseSuccess$7(luvio, config, resourceParams, response) {
|
|
4445
|
+
const snapshot = ingestSuccess$9(luvio, resourceParams, response, {
|
|
4446
|
+
config,
|
|
4447
|
+
resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
|
|
4448
|
+
});
|
|
4449
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
4450
|
+
}
|
|
4451
|
+
function onFetchResponseError$7(luvio, config, resourceParams, response) {
|
|
4452
|
+
const snapshot = ingestError$7(luvio, resourceParams, response, {
|
|
4453
|
+
config,
|
|
4454
|
+
resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
|
|
4455
|
+
});
|
|
4456
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
4457
|
+
}
|
|
4458
|
+
function buildNetworkSnapshot$9(luvio, config, options) {
|
|
4459
|
+
const resourceParams = createResourceParams$9(config);
|
|
4460
|
+
const request = createResourceRequest$9(resourceParams);
|
|
4461
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
4462
|
+
.then((response) => {
|
|
4463
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$7(luvio, config, resourceParams, response), () => {
|
|
4464
|
+
const cache = new StoreKeyMap();
|
|
4465
|
+
getResponseCacheKeys$9(cache, luvio, resourceParams, response.body);
|
|
4466
|
+
return cache;
|
|
4467
|
+
});
|
|
4468
|
+
}, (response) => {
|
|
4469
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$7(luvio, config, resourceParams, response));
|
|
4470
|
+
});
|
|
4471
|
+
}
|
|
4472
|
+
function buildNetworkSnapshotCachePolicy$7(context, coercedAdapterRequestContext) {
|
|
4473
|
+
return buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext, buildNetworkSnapshot$9, undefined, false);
|
|
4474
|
+
}
|
|
4475
|
+
function buildCachedSnapshotCachePolicy$7(context, storeLookup) {
|
|
4476
|
+
const { luvio, config } = context;
|
|
4477
|
+
const selector = {
|
|
4478
|
+
recordId: keyBuilder$e(luvio, config),
|
|
4479
|
+
node: adapterFragment$7(luvio, config),
|
|
4480
|
+
variables: {},
|
|
4481
|
+
};
|
|
4482
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
4483
|
+
config,
|
|
4484
|
+
resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
|
|
4485
|
+
});
|
|
4486
|
+
return cacheSnapshot;
|
|
4487
|
+
}
|
|
4488
|
+
const getDataProviderTypeConfigsAdapterFactory = (luvio) => function EinsteinLLM__getDataProviderTypeConfigs(untrustedConfig, requestContext) {
|
|
4489
|
+
const config = validateAdapterConfig$9(untrustedConfig, getDataProviderTypeConfigs_ConfigPropertyNames);
|
|
4490
|
+
// Invalid or incomplete config
|
|
4491
|
+
if (config === null) {
|
|
4492
|
+
return null;
|
|
4493
|
+
}
|
|
4494
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
4495
|
+
buildCachedSnapshotCachePolicy$7, buildNetworkSnapshotCachePolicy$7);
|
|
4496
|
+
};
|
|
4497
|
+
|
|
4498
|
+
const TTL$3 = 300;
|
|
4499
|
+
const VERSION$5 = "3a6ecdfe18eb2af8f8f6aaa1a30b194c";
|
|
4500
|
+
function validate$6(obj, path = 'PromptTemplateDataProviderInstanceConfigCollectionRepresentation') {
|
|
4501
|
+
const v_error = (() => {
|
|
4502
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
4503
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
4504
|
+
}
|
|
4505
|
+
const obj_dataProviderInstanceConfigs = obj.dataProviderInstanceConfigs;
|
|
4506
|
+
const path_dataProviderInstanceConfigs = path + '.dataProviderInstanceConfigs';
|
|
4507
|
+
if (!ArrayIsArray(obj_dataProviderInstanceConfigs)) {
|
|
4508
|
+
return new TypeError('Expected "array" but received "' + typeof obj_dataProviderInstanceConfigs + '" (at "' + path_dataProviderInstanceConfigs + '")');
|
|
4509
|
+
}
|
|
4510
|
+
for (let i = 0; i < obj_dataProviderInstanceConfigs.length; i++) {
|
|
4511
|
+
const obj_dataProviderInstanceConfigs_item = obj_dataProviderInstanceConfigs[i];
|
|
4512
|
+
const path_dataProviderInstanceConfigs_item = path_dataProviderInstanceConfigs + '[' + i + ']';
|
|
4513
|
+
const referencepath_dataProviderInstanceConfigs_itemValidationError = validate$9(obj_dataProviderInstanceConfigs_item, path_dataProviderInstanceConfigs_item);
|
|
4514
|
+
if (referencepath_dataProviderInstanceConfigs_itemValidationError !== null) {
|
|
4515
|
+
let message = 'Object doesn\'t match PromptTemplateDataProviderInstanceConfigRepresentation (at "' + path_dataProviderInstanceConfigs_item + '")\n';
|
|
4516
|
+
message += referencepath_dataProviderInstanceConfigs_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
4517
|
+
return new TypeError(message);
|
|
4518
|
+
}
|
|
4519
|
+
}
|
|
4520
|
+
})();
|
|
4521
|
+
return v_error === undefined ? null : v_error;
|
|
4522
|
+
}
|
|
4523
|
+
const RepresentationType$3 = 'PromptTemplateDataProviderInstanceConfigCollectionRepresentation';
|
|
4524
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
4525
|
+
return input;
|
|
4526
|
+
}
|
|
4527
|
+
const select$e = function PromptTemplateDataProviderInstanceConfigCollectionRepresentationSelect() {
|
|
4528
|
+
return {
|
|
4529
|
+
kind: 'Fragment',
|
|
4530
|
+
version: VERSION$5,
|
|
4531
|
+
private: [],
|
|
4532
|
+
opaque: true
|
|
4533
|
+
};
|
|
4534
|
+
};
|
|
4535
|
+
function equals$5(existing, incoming) {
|
|
4536
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
4537
|
+
return false;
|
|
4538
|
+
}
|
|
4539
|
+
return true;
|
|
4540
|
+
}
|
|
4541
|
+
const ingest$3 = function PromptTemplateDataProviderInstanceConfigCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
4542
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4543
|
+
const validateError = validate$6(input);
|
|
4544
|
+
if (validateError !== null) {
|
|
4545
|
+
throw validateError;
|
|
4546
|
+
}
|
|
4547
|
+
}
|
|
4548
|
+
const key = path.fullPath;
|
|
4549
|
+
const ttlToUse = TTL$3;
|
|
4550
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "EinsteinLLM", VERSION$5, RepresentationType$3, equals$5);
|
|
4551
|
+
return createLink(key);
|
|
4552
|
+
};
|
|
4553
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
4554
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
4555
|
+
const rootKey = fullPathFactory();
|
|
4556
|
+
rootKeySet.set(rootKey, {
|
|
4557
|
+
namespace: keyPrefix,
|
|
4558
|
+
representationName: RepresentationType$3,
|
|
4559
|
+
mergeable: false
|
|
4560
|
+
});
|
|
4561
|
+
}
|
|
4562
|
+
|
|
4563
|
+
function select$d(luvio, params) {
|
|
4564
|
+
return select$e();
|
|
4565
|
+
}
|
|
4566
|
+
function keyBuilder$d(luvio, params) {
|
|
4567
|
+
return keyPrefix + '::PromptTemplateDataProviderInstanceConfigCollectionRepresentation:(' + 'groupNames:' + params.queryParams.groupNames + ',' + 'targets:' + params.queryParams.targets + ',' + 'templateType:' + params.urlParams.templateType + ')';
|
|
4568
|
+
}
|
|
4569
|
+
function getResponseCacheKeys$8(storeKeyMap, luvio, resourceParams, response) {
|
|
4570
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$d(luvio, resourceParams));
|
|
4571
|
+
}
|
|
4572
|
+
function ingestSuccess$8(luvio, resourceParams, response, snapshotRefresh) {
|
|
4573
|
+
const { body } = response;
|
|
4574
|
+
const key = keyBuilder$d(luvio, resourceParams);
|
|
4575
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
4576
|
+
const snapshot = luvio.storeLookup({
|
|
4577
|
+
recordId: key,
|
|
4578
|
+
node: select$d(),
|
|
4579
|
+
variables: {},
|
|
4580
|
+
}, snapshotRefresh);
|
|
4581
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4582
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
4583
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
4584
|
+
}
|
|
4585
|
+
}
|
|
4586
|
+
deepFreeze(snapshot.data);
|
|
4587
|
+
return snapshot;
|
|
4588
|
+
}
|
|
4589
|
+
function ingestError$6(luvio, params, error, snapshotRefresh) {
|
|
4590
|
+
const key = keyBuilder$d(luvio, params);
|
|
4591
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
4592
|
+
const storeMetadataParams = {
|
|
4593
|
+
ttl: TTL$3,
|
|
4594
|
+
namespace: keyPrefix,
|
|
4595
|
+
version: VERSION$5,
|
|
4596
|
+
representationName: RepresentationType$3
|
|
4597
|
+
};
|
|
4598
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
4599
|
+
return errorSnapshot;
|
|
4600
|
+
}
|
|
4601
|
+
function createResourceRequest$8(config) {
|
|
4602
|
+
const headers = {};
|
|
4603
|
+
return {
|
|
4604
|
+
baseUri: '/services/data/v65.0',
|
|
4605
|
+
basePath: '/einstein/prompt-templates/data-providers/' + config.urlParams.templateType + '',
|
|
4606
|
+
method: 'get',
|
|
4607
|
+
body: null,
|
|
4608
|
+
urlParams: config.urlParams,
|
|
4609
|
+
queryParams: config.queryParams,
|
|
4610
|
+
headers,
|
|
4611
|
+
priority: 'normal',
|
|
4612
|
+
};
|
|
4613
|
+
}
|
|
4614
|
+
|
|
4615
|
+
const adapterName$8 = 'getDataProviders';
|
|
4616
|
+
const getDataProviders_ConfigPropertyMetadata = [
|
|
4617
|
+
generateParamConfigMetadata('templateType', true, 0 /* UrlParameter */, 0 /* String */),
|
|
4618
|
+
generateParamConfigMetadata('groupNames', false, 1 /* QueryParameter */, 0 /* String */, true),
|
|
4619
|
+
generateParamConfigMetadata('targets', false, 1 /* QueryParameter */, 0 /* String */, true),
|
|
4620
|
+
];
|
|
4621
|
+
const getDataProviders_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$8, getDataProviders_ConfigPropertyMetadata);
|
|
4622
|
+
const createResourceParams$8 = /*#__PURE__*/ createResourceParams$h(getDataProviders_ConfigPropertyMetadata);
|
|
4623
|
+
function keyBuilder$c(luvio, config) {
|
|
4624
|
+
const resourceParams = createResourceParams$8(config);
|
|
4625
|
+
return keyBuilder$d(luvio, resourceParams);
|
|
4626
|
+
}
|
|
4627
|
+
function typeCheckConfig$8(untrustedConfig) {
|
|
4628
|
+
const config = {};
|
|
4629
|
+
typeCheckConfig$h(untrustedConfig, config, getDataProviders_ConfigPropertyMetadata);
|
|
4630
|
+
return config;
|
|
4631
|
+
}
|
|
4632
|
+
function validateAdapterConfig$8(untrustedConfig, configPropertyNames) {
|
|
4633
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
4634
|
+
return null;
|
|
4635
|
+
}
|
|
4636
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4637
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
4638
|
+
}
|
|
4639
|
+
const config = typeCheckConfig$8(untrustedConfig);
|
|
4640
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
4641
|
+
return null;
|
|
4642
|
+
}
|
|
4643
|
+
return config;
|
|
4644
|
+
}
|
|
4645
|
+
function adapterFragment$6(luvio, config) {
|
|
4646
|
+
createResourceParams$8(config);
|
|
4647
|
+
return select$d();
|
|
4648
|
+
}
|
|
4649
|
+
function onFetchResponseSuccess$6(luvio, config, resourceParams, response) {
|
|
4650
|
+
const snapshot = ingestSuccess$8(luvio, resourceParams, response, {
|
|
4651
|
+
config,
|
|
4652
|
+
resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
|
|
4653
|
+
});
|
|
4654
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
4655
|
+
}
|
|
4656
|
+
function onFetchResponseError$6(luvio, config, resourceParams, response) {
|
|
4657
|
+
const snapshot = ingestError$6(luvio, resourceParams, response, {
|
|
4658
|
+
config,
|
|
4659
|
+
resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
|
|
4660
|
+
});
|
|
4661
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
4662
|
+
}
|
|
4663
|
+
function buildNetworkSnapshot$8(luvio, config, options) {
|
|
4664
|
+
const resourceParams = createResourceParams$8(config);
|
|
4665
|
+
const request = createResourceRequest$8(resourceParams);
|
|
4666
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
4667
|
+
.then((response) => {
|
|
4668
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$6(luvio, config, resourceParams, response), () => {
|
|
4669
|
+
const cache = new StoreKeyMap();
|
|
4670
|
+
getResponseCacheKeys$8(cache, luvio, resourceParams, response.body);
|
|
4671
|
+
return cache;
|
|
4672
|
+
});
|
|
4673
|
+
}, (response) => {
|
|
4674
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$6(luvio, config, resourceParams, response));
|
|
4675
|
+
});
|
|
4676
|
+
}
|
|
4677
|
+
function buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext) {
|
|
4678
|
+
return buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext, buildNetworkSnapshot$8, undefined, false);
|
|
4679
|
+
}
|
|
4680
|
+
function buildCachedSnapshotCachePolicy$6(context, storeLookup) {
|
|
4681
|
+
const { luvio, config } = context;
|
|
4682
|
+
const selector = {
|
|
4683
|
+
recordId: keyBuilder$c(luvio, config),
|
|
4684
|
+
node: adapterFragment$6(luvio, config),
|
|
4685
|
+
variables: {},
|
|
4686
|
+
};
|
|
4687
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
4688
|
+
config,
|
|
4689
|
+
resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
|
|
4690
|
+
});
|
|
4691
|
+
return cacheSnapshot;
|
|
4692
|
+
}
|
|
4693
|
+
const getDataProvidersAdapterFactory = (luvio) => function EinsteinLLM__getDataProviders(untrustedConfig, requestContext) {
|
|
4694
|
+
const config = validateAdapterConfig$8(untrustedConfig, getDataProviders_ConfigPropertyNames);
|
|
4695
|
+
// Invalid or incomplete config
|
|
4696
|
+
if (config === null) {
|
|
4697
|
+
return null;
|
|
4698
|
+
}
|
|
4699
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
4700
|
+
buildCachedSnapshotCachePolicy$6, buildNetworkSnapshotCachePolicy$6);
|
|
4701
|
+
};
|
|
4702
|
+
|
|
4703
|
+
function select$c(luvio, params) {
|
|
4704
|
+
return select$e();
|
|
4705
|
+
}
|
|
4706
|
+
function keyBuilder$b(luvio, params) {
|
|
4707
|
+
return keyPrefix + '::PromptTemplateDataProviderInstanceConfigCollectionRepresentation:(' + (params.body.groupName === undefined ? 'groupName' : 'groupName:' + params.body.groupName) + '::' + (params.body.target === undefined ? 'target' : 'target:' + params.body.target) + '::' + 'templateInputs:' + params.body.templateInputs + '::' + 'templateTypeName:' + params.body.templateTypeName + ')';
|
|
4708
|
+
}
|
|
4709
|
+
function getResponseCacheKeys$7(storeKeyMap, luvio, resourceParams, response) {
|
|
4710
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$b(luvio, resourceParams));
|
|
4711
|
+
}
|
|
4712
|
+
function ingestSuccess$7(luvio, resourceParams, response, snapshotRefresh) {
|
|
4713
|
+
const { body } = response;
|
|
4714
|
+
const key = keyBuilder$b(luvio, resourceParams);
|
|
4715
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
4716
|
+
const snapshot = luvio.storeLookup({
|
|
4717
|
+
recordId: key,
|
|
4718
|
+
node: select$c(),
|
|
4719
|
+
variables: {},
|
|
4720
|
+
}, snapshotRefresh);
|
|
4721
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4722
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
4723
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
4724
|
+
}
|
|
4725
|
+
}
|
|
4726
|
+
deepFreeze(snapshot.data);
|
|
4727
|
+
return snapshot;
|
|
4728
|
+
}
|
|
4729
|
+
function ingestError$5(luvio, params, error, snapshotRefresh) {
|
|
4730
|
+
const key = keyBuilder$b(luvio, params);
|
|
4731
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
4732
|
+
const storeMetadataParams = {
|
|
4733
|
+
ttl: TTL$3,
|
|
4734
|
+
namespace: keyPrefix,
|
|
4735
|
+
version: VERSION$5,
|
|
4736
|
+
representationName: RepresentationType$3
|
|
4737
|
+
};
|
|
4738
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
4739
|
+
return errorSnapshot;
|
|
4740
|
+
}
|
|
4741
|
+
function createResourceRequest$7(config) {
|
|
4742
|
+
const headers = {};
|
|
4743
|
+
return {
|
|
4744
|
+
baseUri: '/services/data/v65.0',
|
|
4745
|
+
basePath: '/einstein/prompt-templates/data-providers/mapped',
|
|
4746
|
+
method: 'post',
|
|
4747
|
+
body: config.body,
|
|
4748
|
+
urlParams: {},
|
|
4749
|
+
queryParams: {},
|
|
4750
|
+
headers,
|
|
4751
|
+
priority: 'normal',
|
|
4752
|
+
};
|
|
4753
|
+
}
|
|
4754
|
+
|
|
4755
|
+
const adapterName$7 = 'getInputMappedDataProviders';
|
|
4756
|
+
const getInputMappedDataProviders_ConfigPropertyMetadata = [
|
|
4757
|
+
generateParamConfigMetadata('groupName', false, 2 /* Body */, 0 /* String */),
|
|
4758
|
+
generateParamConfigMetadata('target', false, 2 /* Body */, 0 /* String */),
|
|
4759
|
+
generateParamConfigMetadata('templateInputs', true, 2 /* Body */, 4 /* Unsupported */, true),
|
|
4760
|
+
generateParamConfigMetadata('templateTypeName', true, 2 /* Body */, 0 /* String */),
|
|
4761
|
+
];
|
|
4762
|
+
const getInputMappedDataProviders_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$7, getInputMappedDataProviders_ConfigPropertyMetadata);
|
|
4763
|
+
const createResourceParams$7 = /*#__PURE__*/ createResourceParams$h(getInputMappedDataProviders_ConfigPropertyMetadata);
|
|
4764
|
+
function keyBuilder$a(luvio, config) {
|
|
4765
|
+
const resourceParams = createResourceParams$7(config);
|
|
4766
|
+
return keyBuilder$b(luvio, resourceParams);
|
|
4767
|
+
}
|
|
4768
|
+
function typeCheckConfig$7(untrustedConfig) {
|
|
4769
|
+
const config = {};
|
|
4770
|
+
typeCheckConfig$h(untrustedConfig, config, getInputMappedDataProviders_ConfigPropertyMetadata);
|
|
4771
|
+
const untrustedConfig_templateInputs = untrustedConfig.templateInputs;
|
|
4772
|
+
if (ArrayIsArray$1(untrustedConfig_templateInputs)) {
|
|
4773
|
+
const untrustedConfig_templateInputs_array = [];
|
|
4774
|
+
for (let i = 0, arrayLength = untrustedConfig_templateInputs.length; i < arrayLength; i++) {
|
|
4775
|
+
const untrustedConfig_templateInputs_item = untrustedConfig_templateInputs[i];
|
|
4776
|
+
untrustedConfig_templateInputs_array.push(untrustedConfig_templateInputs_item);
|
|
4777
|
+
}
|
|
4778
|
+
config.templateInputs = untrustedConfig_templateInputs_array;
|
|
4779
|
+
}
|
|
4780
|
+
return config;
|
|
4781
|
+
}
|
|
4782
|
+
function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
|
|
4783
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
4784
|
+
return null;
|
|
4785
|
+
}
|
|
4786
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4787
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
4788
|
+
}
|
|
4789
|
+
const config = typeCheckConfig$7(untrustedConfig);
|
|
4790
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
4791
|
+
return null;
|
|
4792
|
+
}
|
|
4793
|
+
return config;
|
|
4794
|
+
}
|
|
4795
|
+
function adapterFragment$5(luvio, config) {
|
|
4796
|
+
createResourceParams$7(config);
|
|
4797
|
+
return select$c();
|
|
4798
|
+
}
|
|
4799
|
+
function onFetchResponseSuccess$5(luvio, config, resourceParams, response) {
|
|
4800
|
+
const snapshot = ingestSuccess$7(luvio, resourceParams, response, {
|
|
4801
|
+
config,
|
|
4802
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
4803
|
+
});
|
|
4804
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
4805
|
+
}
|
|
4806
|
+
function onFetchResponseError$5(luvio, config, resourceParams, response) {
|
|
4807
|
+
const snapshot = ingestError$5(luvio, resourceParams, response, {
|
|
4808
|
+
config,
|
|
4809
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
4810
|
+
});
|
|
4811
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
4812
|
+
}
|
|
4813
|
+
function buildNetworkSnapshot$7(luvio, config, options) {
|
|
4814
|
+
const resourceParams = createResourceParams$7(config);
|
|
4815
|
+
const request = createResourceRequest$7(resourceParams);
|
|
4816
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
4817
|
+
.then((response) => {
|
|
4818
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$5(luvio, config, resourceParams, response), () => {
|
|
4819
|
+
const cache = new StoreKeyMap();
|
|
4820
|
+
getResponseCacheKeys$7(cache, luvio, resourceParams, response.body);
|
|
4821
|
+
return cache;
|
|
4822
|
+
});
|
|
4823
|
+
}, (response) => {
|
|
4824
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$5(luvio, config, resourceParams, response));
|
|
4825
|
+
});
|
|
4826
|
+
}
|
|
4827
|
+
function buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext) {
|
|
4828
|
+
return buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext, buildNetworkSnapshot$7, 'get', false);
|
|
4829
|
+
}
|
|
4830
|
+
function buildCachedSnapshotCachePolicy$5(context, storeLookup) {
|
|
4831
|
+
const { luvio, config } = context;
|
|
4832
|
+
const selector = {
|
|
4833
|
+
recordId: keyBuilder$a(luvio, config),
|
|
4834
|
+
node: adapterFragment$5(luvio, config),
|
|
4835
|
+
variables: {},
|
|
4836
|
+
};
|
|
4837
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
4838
|
+
config,
|
|
4839
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
4840
|
+
});
|
|
4841
|
+
return cacheSnapshot;
|
|
4842
|
+
}
|
|
4843
|
+
const getInputMappedDataProvidersAdapterFactory = (luvio) => function EinsteinLLM__getInputMappedDataProviders(untrustedConfig, requestContext) {
|
|
4844
|
+
const config = validateAdapterConfig$7(untrustedConfig, getInputMappedDataProviders_ConfigPropertyNames);
|
|
4845
|
+
// Invalid or incomplete config
|
|
4846
|
+
if (config === null) {
|
|
4847
|
+
return null;
|
|
4848
|
+
}
|
|
4849
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
4850
|
+
buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$5);
|
|
4851
|
+
};
|
|
4852
|
+
|
|
4853
|
+
const VERSION$4 = "b513bbac1672327d8eaaf120660e94b5";
|
|
4854
|
+
function validate$5(obj, path = 'EinsteinPromptTemplateSupportedLanguageErrorRepresentation') {
|
|
4855
|
+
const v_error = (() => {
|
|
4856
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
4857
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
4858
|
+
}
|
|
4859
|
+
const obj_errorMessage = obj.errorMessage;
|
|
4860
|
+
const path_errorMessage = path + '.errorMessage';
|
|
4861
|
+
if (typeof obj_errorMessage !== 'string') {
|
|
4862
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
|
|
4863
|
+
}
|
|
4864
|
+
const obj_messageCode = obj.messageCode;
|
|
4865
|
+
const path_messageCode = path + '.messageCode';
|
|
4866
|
+
if (typeof obj_messageCode !== 'string') {
|
|
4867
|
+
return new TypeError('Expected "string" but received "' + typeof obj_messageCode + '" (at "' + path_messageCode + '")');
|
|
4868
|
+
}
|
|
4869
|
+
})();
|
|
4870
|
+
return v_error === undefined ? null : v_error;
|
|
4871
|
+
}
|
|
4872
|
+
const select$b = function EinsteinPromptTemplateSupportedLanguageErrorRepresentationSelect() {
|
|
4873
|
+
return {
|
|
4874
|
+
kind: 'Fragment',
|
|
4875
|
+
version: VERSION$4,
|
|
4876
|
+
private: [],
|
|
4877
|
+
selections: [
|
|
4878
|
+
{
|
|
4879
|
+
name: 'errorMessage',
|
|
4880
|
+
kind: 'Scalar'
|
|
4881
|
+
},
|
|
4882
|
+
{
|
|
4883
|
+
name: 'messageCode',
|
|
4884
|
+
kind: 'Scalar'
|
|
4885
|
+
}
|
|
4886
|
+
]
|
|
4887
|
+
};
|
|
4888
|
+
};
|
|
4889
|
+
function equals$4(existing, incoming) {
|
|
4890
|
+
const existing_errorMessage = existing.errorMessage;
|
|
4891
|
+
const incoming_errorMessage = incoming.errorMessage;
|
|
4892
|
+
if (!(existing_errorMessage === incoming_errorMessage)) {
|
|
4893
|
+
return false;
|
|
4894
|
+
}
|
|
4895
|
+
const existing_messageCode = existing.messageCode;
|
|
4896
|
+
const incoming_messageCode = incoming.messageCode;
|
|
4897
|
+
if (!(existing_messageCode === incoming_messageCode)) {
|
|
4898
|
+
return false;
|
|
4899
|
+
}
|
|
4900
|
+
return true;
|
|
4901
|
+
}
|
|
4902
|
+
|
|
4903
|
+
const VERSION$3 = "65a17d345c28eeca91872a73d8ffe9fd";
|
|
4904
|
+
function validate$4(obj, path = 'EinsteinPromptTemplateSupportedLanguageRepresentation') {
|
|
4905
|
+
const v_error = (() => {
|
|
4906
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
4907
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
4908
|
+
}
|
|
4909
|
+
const obj_languageCode = obj.languageCode;
|
|
4910
|
+
const path_languageCode = path + '.languageCode';
|
|
4911
|
+
if (typeof obj_languageCode !== 'string') {
|
|
4912
|
+
return new TypeError('Expected "string" but received "' + typeof obj_languageCode + '" (at "' + path_languageCode + '")');
|
|
4913
|
+
}
|
|
4914
|
+
const obj_languageDisplayName = obj.languageDisplayName;
|
|
4915
|
+
const path_languageDisplayName = path + '.languageDisplayName';
|
|
4916
|
+
if (typeof obj_languageDisplayName !== 'string') {
|
|
4917
|
+
return new TypeError('Expected "string" but received "' + typeof obj_languageDisplayName + '" (at "' + path_languageDisplayName + '")');
|
|
4918
|
+
}
|
|
4919
|
+
})();
|
|
4920
|
+
return v_error === undefined ? null : v_error;
|
|
4921
|
+
}
|
|
4922
|
+
const select$a = function EinsteinPromptTemplateSupportedLanguageRepresentationSelect() {
|
|
4923
|
+
return {
|
|
4924
|
+
kind: 'Fragment',
|
|
4925
|
+
version: VERSION$3,
|
|
4926
|
+
private: [],
|
|
4927
|
+
selections: [
|
|
4928
|
+
{
|
|
4929
|
+
name: 'languageCode',
|
|
4930
|
+
kind: 'Scalar'
|
|
4931
|
+
},
|
|
4932
|
+
{
|
|
4933
|
+
name: 'languageDisplayName',
|
|
4934
|
+
kind: 'Scalar'
|
|
4935
|
+
}
|
|
4936
|
+
]
|
|
4937
|
+
};
|
|
4938
|
+
};
|
|
4939
|
+
function equals$3(existing, incoming) {
|
|
4940
|
+
const existing_languageCode = existing.languageCode;
|
|
4941
|
+
const incoming_languageCode = incoming.languageCode;
|
|
4942
|
+
if (!(existing_languageCode === incoming_languageCode)) {
|
|
4943
|
+
return false;
|
|
4944
|
+
}
|
|
4945
|
+
const existing_languageDisplayName = existing.languageDisplayName;
|
|
4946
|
+
const incoming_languageDisplayName = incoming.languageDisplayName;
|
|
4947
|
+
if (!(existing_languageDisplayName === incoming_languageDisplayName)) {
|
|
4948
|
+
return false;
|
|
4949
|
+
}
|
|
4950
|
+
return true;
|
|
4951
|
+
}
|
|
4952
|
+
|
|
4953
|
+
const TTL$2 = 100;
|
|
4954
|
+
const VERSION$2 = "c635f260bce9a11f7c3bf31d60f42b53";
|
|
4955
|
+
function validate$3(obj, path = 'EinsteinPromptTemplateVersionOutputLanguagesRepresentation') {
|
|
4956
|
+
const v_error = (() => {
|
|
4957
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
4958
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
4959
|
+
}
|
|
4960
|
+
const obj_errors = obj.errors;
|
|
4961
|
+
const path_errors = path + '.errors';
|
|
4962
|
+
if (!ArrayIsArray(obj_errors)) {
|
|
4963
|
+
return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
|
|
4964
|
+
}
|
|
4965
|
+
for (let i = 0; i < obj_errors.length; i++) {
|
|
4966
|
+
const obj_errors_item = obj_errors[i];
|
|
4967
|
+
const path_errors_item = path_errors + '[' + i + ']';
|
|
4968
|
+
const referencepath_errors_itemValidationError = validate$5(obj_errors_item, path_errors_item);
|
|
4969
|
+
if (referencepath_errors_itemValidationError !== null) {
|
|
4970
|
+
let message = 'Object doesn\'t match EinsteinPromptTemplateSupportedLanguageErrorRepresentation (at "' + path_errors_item + '")\n';
|
|
4971
|
+
message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
4972
|
+
return new TypeError(message);
|
|
4973
|
+
}
|
|
4974
|
+
}
|
|
4975
|
+
const obj_isSuccess = obj.isSuccess;
|
|
4976
|
+
const path_isSuccess = path + '.isSuccess';
|
|
4977
|
+
if (typeof obj_isSuccess !== 'boolean') {
|
|
4978
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
|
|
4979
|
+
}
|
|
4980
|
+
const obj_promptTemplateDevName = obj.promptTemplateDevName;
|
|
4981
|
+
const path_promptTemplateDevName = path + '.promptTemplateDevName';
|
|
4982
|
+
if (typeof obj_promptTemplateDevName !== 'string') {
|
|
4983
|
+
return new TypeError('Expected "string" but received "' + typeof obj_promptTemplateDevName + '" (at "' + path_promptTemplateDevName + '")');
|
|
4984
|
+
}
|
|
4985
|
+
const obj_supportedLanguages = obj.supportedLanguages;
|
|
4986
|
+
const path_supportedLanguages = path + '.supportedLanguages';
|
|
4987
|
+
if (!ArrayIsArray(obj_supportedLanguages)) {
|
|
4988
|
+
return new TypeError('Expected "array" but received "' + typeof obj_supportedLanguages + '" (at "' + path_supportedLanguages + '")');
|
|
4989
|
+
}
|
|
4990
|
+
for (let i = 0; i < obj_supportedLanguages.length; i++) {
|
|
4991
|
+
const obj_supportedLanguages_item = obj_supportedLanguages[i];
|
|
4992
|
+
const path_supportedLanguages_item = path_supportedLanguages + '[' + i + ']';
|
|
4993
|
+
const referencepath_supportedLanguages_itemValidationError = validate$4(obj_supportedLanguages_item, path_supportedLanguages_item);
|
|
4994
|
+
if (referencepath_supportedLanguages_itemValidationError !== null) {
|
|
4995
|
+
let message = 'Object doesn\'t match EinsteinPromptTemplateSupportedLanguageRepresentation (at "' + path_supportedLanguages_item + '")\n';
|
|
4996
|
+
message += referencepath_supportedLanguages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
4997
|
+
return new TypeError(message);
|
|
4998
|
+
}
|
|
4999
|
+
}
|
|
5000
|
+
const obj_versionId = obj.versionId;
|
|
5001
|
+
const path_versionId = path + '.versionId';
|
|
5002
|
+
if (typeof obj_versionId !== 'string') {
|
|
5003
|
+
return new TypeError('Expected "string" but received "' + typeof obj_versionId + '" (at "' + path_versionId + '")');
|
|
5004
|
+
}
|
|
5005
|
+
})();
|
|
5006
|
+
return v_error === undefined ? null : v_error;
|
|
5007
|
+
}
|
|
5008
|
+
const RepresentationType$2 = 'EinsteinPromptTemplateVersionOutputLanguagesRepresentation';
|
|
3632
5009
|
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
3633
5010
|
return input;
|
|
3634
5011
|
}
|
|
3635
|
-
const select$
|
|
3636
|
-
const { selections: EinsteinPromptTemplateSupportedLanguageErrorRepresentation__selections, opaque: EinsteinPromptTemplateSupportedLanguageErrorRepresentation__opaque, } = select$
|
|
3637
|
-
const { selections: EinsteinPromptTemplateSupportedLanguageRepresentation__selections, opaque: EinsteinPromptTemplateSupportedLanguageRepresentation__opaque, } = select$
|
|
5012
|
+
const select$9 = function EinsteinPromptTemplateVersionOutputLanguagesRepresentationSelect() {
|
|
5013
|
+
const { selections: EinsteinPromptTemplateSupportedLanguageErrorRepresentation__selections, opaque: EinsteinPromptTemplateSupportedLanguageErrorRepresentation__opaque, } = select$b();
|
|
5014
|
+
const { selections: EinsteinPromptTemplateSupportedLanguageRepresentation__selections, opaque: EinsteinPromptTemplateSupportedLanguageRepresentation__opaque, } = select$a();
|
|
3638
5015
|
return {
|
|
3639
5016
|
kind: 'Fragment',
|
|
3640
5017
|
version: VERSION$2,
|
|
@@ -3727,22 +5104,22 @@ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
|
3727
5104
|
});
|
|
3728
5105
|
}
|
|
3729
5106
|
|
|
3730
|
-
function select$
|
|
3731
|
-
return select$
|
|
5107
|
+
function select$8(luvio, params) {
|
|
5108
|
+
return select$9();
|
|
3732
5109
|
}
|
|
3733
|
-
function keyBuilder$
|
|
5110
|
+
function keyBuilder$9(luvio, params) {
|
|
3734
5111
|
return keyPrefix + '::EinsteinPromptTemplateVersionOutputLanguagesRepresentation:(' + 'useStandardVersion:' + params.queryParams.useStandardVersion + ',' + 'versionId:' + params.queryParams.versionId + ',' + 'promptTemplateDevName:' + params.urlParams.promptTemplateDevName + ')';
|
|
3735
5112
|
}
|
|
3736
|
-
function getResponseCacheKeys$
|
|
3737
|
-
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$
|
|
5113
|
+
function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
|
|
5114
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$9(luvio, resourceParams));
|
|
3738
5115
|
}
|
|
3739
|
-
function ingestSuccess$
|
|
5116
|
+
function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
|
|
3740
5117
|
const { body } = response;
|
|
3741
|
-
const key = keyBuilder$
|
|
5118
|
+
const key = keyBuilder$9(luvio, resourceParams);
|
|
3742
5119
|
luvio.storeIngest(key, ingest$2, body);
|
|
3743
5120
|
const snapshot = luvio.storeLookup({
|
|
3744
5121
|
recordId: key,
|
|
3745
|
-
node: select$
|
|
5122
|
+
node: select$8(),
|
|
3746
5123
|
variables: {},
|
|
3747
5124
|
}, snapshotRefresh);
|
|
3748
5125
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -3753,8 +5130,8 @@ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
3753
5130
|
deepFreeze(snapshot.data);
|
|
3754
5131
|
return snapshot;
|
|
3755
5132
|
}
|
|
3756
|
-
function ingestError$
|
|
3757
|
-
const key = keyBuilder$
|
|
5133
|
+
function ingestError$4(luvio, params, error, snapshotRefresh) {
|
|
5134
|
+
const key = keyBuilder$9(luvio, params);
|
|
3758
5135
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
3759
5136
|
const storeMetadataParams = {
|
|
3760
5137
|
ttl: TTL$2,
|
|
@@ -3765,7 +5142,7 @@ function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
|
3765
5142
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
3766
5143
|
return errorSnapshot;
|
|
3767
5144
|
}
|
|
3768
|
-
function createResourceRequest$
|
|
5145
|
+
function createResourceRequest$6(config) {
|
|
3769
5146
|
const headers = {};
|
|
3770
5147
|
return {
|
|
3771
5148
|
baseUri: '/services/data/v65.0',
|
|
@@ -3779,92 +5156,92 @@ function createResourceRequest$3(config) {
|
|
|
3779
5156
|
};
|
|
3780
5157
|
}
|
|
3781
5158
|
|
|
3782
|
-
const adapterName$
|
|
5159
|
+
const adapterName$6 = 'getOutputLanguages';
|
|
3783
5160
|
const getOutputLanguages_ConfigPropertyMetadata = [
|
|
3784
5161
|
generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
3785
5162
|
generateParamConfigMetadata('useStandardVersion', false, 1 /* QueryParameter */, 1 /* Boolean */),
|
|
3786
5163
|
generateParamConfigMetadata('versionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
3787
5164
|
];
|
|
3788
|
-
const getOutputLanguages_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
3789
|
-
const createResourceParams$
|
|
3790
|
-
function keyBuilder$
|
|
3791
|
-
const resourceParams = createResourceParams$
|
|
3792
|
-
return keyBuilder$
|
|
5165
|
+
const getOutputLanguages_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, getOutputLanguages_ConfigPropertyMetadata);
|
|
5166
|
+
const createResourceParams$6 = /*#__PURE__*/ createResourceParams$h(getOutputLanguages_ConfigPropertyMetadata);
|
|
5167
|
+
function keyBuilder$8(luvio, config) {
|
|
5168
|
+
const resourceParams = createResourceParams$6(config);
|
|
5169
|
+
return keyBuilder$9(luvio, resourceParams);
|
|
3793
5170
|
}
|
|
3794
|
-
function typeCheckConfig$
|
|
5171
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
3795
5172
|
const config = {};
|
|
3796
|
-
typeCheckConfig$
|
|
5173
|
+
typeCheckConfig$h(untrustedConfig, config, getOutputLanguages_ConfigPropertyMetadata);
|
|
3797
5174
|
return config;
|
|
3798
5175
|
}
|
|
3799
|
-
function validateAdapterConfig$
|
|
5176
|
+
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
3800
5177
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
3801
5178
|
return null;
|
|
3802
5179
|
}
|
|
3803
5180
|
if (process.env.NODE_ENV !== 'production') {
|
|
3804
5181
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
3805
5182
|
}
|
|
3806
|
-
const config = typeCheckConfig$
|
|
5183
|
+
const config = typeCheckConfig$6(untrustedConfig);
|
|
3807
5184
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3808
5185
|
return null;
|
|
3809
5186
|
}
|
|
3810
5187
|
return config;
|
|
3811
5188
|
}
|
|
3812
|
-
function adapterFragment$
|
|
3813
|
-
createResourceParams$
|
|
3814
|
-
return select$
|
|
5189
|
+
function adapterFragment$4(luvio, config) {
|
|
5190
|
+
createResourceParams$6(config);
|
|
5191
|
+
return select$8();
|
|
3815
5192
|
}
|
|
3816
|
-
function onFetchResponseSuccess$
|
|
3817
|
-
const snapshot = ingestSuccess$
|
|
5193
|
+
function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
|
|
5194
|
+
const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
|
|
3818
5195
|
config,
|
|
3819
|
-
resolve: () => buildNetworkSnapshot$
|
|
5196
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
3820
5197
|
});
|
|
3821
5198
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
3822
5199
|
}
|
|
3823
|
-
function onFetchResponseError$
|
|
3824
|
-
const snapshot = ingestError$
|
|
5200
|
+
function onFetchResponseError$4(luvio, config, resourceParams, response) {
|
|
5201
|
+
const snapshot = ingestError$4(luvio, resourceParams, response, {
|
|
3825
5202
|
config,
|
|
3826
|
-
resolve: () => buildNetworkSnapshot$
|
|
5203
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
3827
5204
|
});
|
|
3828
5205
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
3829
5206
|
}
|
|
3830
|
-
function buildNetworkSnapshot$
|
|
3831
|
-
const resourceParams = createResourceParams$
|
|
3832
|
-
const request = createResourceRequest$
|
|
5207
|
+
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
5208
|
+
const resourceParams = createResourceParams$6(config);
|
|
5209
|
+
const request = createResourceRequest$6(resourceParams);
|
|
3833
5210
|
return luvio.dispatchResourceRequest(request, options)
|
|
3834
5211
|
.then((response) => {
|
|
3835
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
5212
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => {
|
|
3836
5213
|
const cache = new StoreKeyMap();
|
|
3837
|
-
getResponseCacheKeys$
|
|
5214
|
+
getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
|
|
3838
5215
|
return cache;
|
|
3839
5216
|
});
|
|
3840
5217
|
}, (response) => {
|
|
3841
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
5218
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
|
|
3842
5219
|
});
|
|
3843
5220
|
}
|
|
3844
|
-
function buildNetworkSnapshotCachePolicy$
|
|
3845
|
-
return buildNetworkSnapshotCachePolicy$
|
|
5221
|
+
function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
|
|
5222
|
+
return buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, undefined, false);
|
|
3846
5223
|
}
|
|
3847
|
-
function buildCachedSnapshotCachePolicy$
|
|
5224
|
+
function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
|
|
3848
5225
|
const { luvio, config } = context;
|
|
3849
5226
|
const selector = {
|
|
3850
|
-
recordId: keyBuilder$
|
|
3851
|
-
node: adapterFragment$
|
|
5227
|
+
recordId: keyBuilder$8(luvio, config),
|
|
5228
|
+
node: adapterFragment$4(luvio, config),
|
|
3852
5229
|
variables: {},
|
|
3853
5230
|
};
|
|
3854
5231
|
const cacheSnapshot = storeLookup(selector, {
|
|
3855
5232
|
config,
|
|
3856
|
-
resolve: () => buildNetworkSnapshot$
|
|
5233
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
3857
5234
|
});
|
|
3858
5235
|
return cacheSnapshot;
|
|
3859
5236
|
}
|
|
3860
5237
|
const getOutputLanguagesAdapterFactory = (luvio) => function EinsteinLLM__getOutputLanguages(untrustedConfig, requestContext) {
|
|
3861
|
-
const config = validateAdapterConfig$
|
|
5238
|
+
const config = validateAdapterConfig$6(untrustedConfig, getOutputLanguages_ConfigPropertyNames);
|
|
3862
5239
|
// Invalid or incomplete config
|
|
3863
5240
|
if (config === null) {
|
|
3864
5241
|
return null;
|
|
3865
5242
|
}
|
|
3866
5243
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
3867
|
-
buildCachedSnapshotCachePolicy$
|
|
5244
|
+
buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
|
|
3868
5245
|
};
|
|
3869
5246
|
|
|
3870
5247
|
function validate$2(obj, path = 'EinsteinPromptRecordFieldRepresentation') {
|
|
@@ -4000,58 +5377,338 @@ const RepresentationType$1 = 'EinsteinPromptRecordRepresentation';
|
|
|
4000
5377
|
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
4001
5378
|
return input;
|
|
4002
5379
|
}
|
|
4003
|
-
const select$
|
|
4004
|
-
return {
|
|
4005
|
-
kind: 'Fragment',
|
|
4006
|
-
version: VERSION$1,
|
|
4007
|
-
private: [],
|
|
4008
|
-
opaque: true
|
|
4009
|
-
};
|
|
4010
|
-
};
|
|
4011
|
-
function equals$1(existing, incoming) {
|
|
4012
|
-
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
4013
|
-
return false;
|
|
5380
|
+
const select$7 = function EinsteinPromptRecordRepresentationSelect() {
|
|
5381
|
+
return {
|
|
5382
|
+
kind: 'Fragment',
|
|
5383
|
+
version: VERSION$1,
|
|
5384
|
+
private: [],
|
|
5385
|
+
opaque: true
|
|
5386
|
+
};
|
|
5387
|
+
};
|
|
5388
|
+
function equals$1(existing, incoming) {
|
|
5389
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
5390
|
+
return false;
|
|
5391
|
+
}
|
|
5392
|
+
return true;
|
|
5393
|
+
}
|
|
5394
|
+
const ingest$1 = function EinsteinPromptRecordRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
5395
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
5396
|
+
const validateError = validate$1(input);
|
|
5397
|
+
if (validateError !== null) {
|
|
5398
|
+
throw validateError;
|
|
5399
|
+
}
|
|
5400
|
+
}
|
|
5401
|
+
const key = path.fullPath;
|
|
5402
|
+
const ttlToUse = TTL$1;
|
|
5403
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "EinsteinLLM", VERSION$1, RepresentationType$1, equals$1);
|
|
5404
|
+
return createLink(key);
|
|
5405
|
+
};
|
|
5406
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
5407
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
5408
|
+
const rootKey = fullPathFactory();
|
|
5409
|
+
rootKeySet.set(rootKey, {
|
|
5410
|
+
namespace: keyPrefix,
|
|
5411
|
+
representationName: RepresentationType$1,
|
|
5412
|
+
mergeable: false
|
|
5413
|
+
});
|
|
5414
|
+
}
|
|
5415
|
+
|
|
5416
|
+
function select$6(luvio, params) {
|
|
5417
|
+
return select$7();
|
|
5418
|
+
}
|
|
5419
|
+
function keyBuilder$7(luvio, params) {
|
|
5420
|
+
return keyPrefix + '::EinsteinPromptRecordRepresentation:(' + 'versionId:' + params.queryParams.versionId + ',' + 'promptTemplateDevName:' + params.urlParams.promptTemplateDevName + ')';
|
|
5421
|
+
}
|
|
5422
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
5423
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$7(luvio, resourceParams));
|
|
5424
|
+
}
|
|
5425
|
+
function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
|
|
5426
|
+
const { body } = response;
|
|
5427
|
+
const key = keyBuilder$7(luvio, resourceParams);
|
|
5428
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
5429
|
+
const snapshot = luvio.storeLookup({
|
|
5430
|
+
recordId: key,
|
|
5431
|
+
node: select$6(),
|
|
5432
|
+
variables: {},
|
|
5433
|
+
}, snapshotRefresh);
|
|
5434
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
5435
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
5436
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
5437
|
+
}
|
|
5438
|
+
}
|
|
5439
|
+
deepFreeze(snapshot.data);
|
|
5440
|
+
return snapshot;
|
|
5441
|
+
}
|
|
5442
|
+
function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
5443
|
+
const key = keyBuilder$7(luvio, params);
|
|
5444
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
5445
|
+
const storeMetadataParams = {
|
|
5446
|
+
ttl: TTL$1,
|
|
5447
|
+
namespace: keyPrefix,
|
|
5448
|
+
version: VERSION$1,
|
|
5449
|
+
representationName: RepresentationType$1
|
|
5450
|
+
};
|
|
5451
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
5452
|
+
return errorSnapshot;
|
|
5453
|
+
}
|
|
5454
|
+
function createResourceRequest$5(config) {
|
|
5455
|
+
const headers = {};
|
|
5456
|
+
return {
|
|
5457
|
+
baseUri: '/services/data/v65.0',
|
|
5458
|
+
basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '',
|
|
5459
|
+
method: 'get',
|
|
5460
|
+
body: null,
|
|
5461
|
+
urlParams: config.urlParams,
|
|
5462
|
+
queryParams: config.queryParams,
|
|
5463
|
+
headers,
|
|
5464
|
+
priority: 'normal',
|
|
5465
|
+
};
|
|
5466
|
+
}
|
|
5467
|
+
|
|
5468
|
+
const adapterName$5 = 'getPromptTemplate';
|
|
5469
|
+
const getPromptTemplate_ConfigPropertyMetadata = [
|
|
5470
|
+
generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
5471
|
+
generateParamConfigMetadata('versionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
5472
|
+
];
|
|
5473
|
+
const getPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getPromptTemplate_ConfigPropertyMetadata);
|
|
5474
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$h(getPromptTemplate_ConfigPropertyMetadata);
|
|
5475
|
+
function keyBuilder$6(luvio, config) {
|
|
5476
|
+
const resourceParams = createResourceParams$5(config);
|
|
5477
|
+
return keyBuilder$7(luvio, resourceParams);
|
|
5478
|
+
}
|
|
5479
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
5480
|
+
const config = {};
|
|
5481
|
+
typeCheckConfig$h(untrustedConfig, config, getPromptTemplate_ConfigPropertyMetadata);
|
|
5482
|
+
return config;
|
|
5483
|
+
}
|
|
5484
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
5485
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
5486
|
+
return null;
|
|
5487
|
+
}
|
|
5488
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
5489
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
5490
|
+
}
|
|
5491
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
5492
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
5493
|
+
return null;
|
|
5494
|
+
}
|
|
5495
|
+
return config;
|
|
5496
|
+
}
|
|
5497
|
+
function adapterFragment$3(luvio, config) {
|
|
5498
|
+
createResourceParams$5(config);
|
|
5499
|
+
return select$6();
|
|
5500
|
+
}
|
|
5501
|
+
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
5502
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
|
|
5503
|
+
config,
|
|
5504
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
5505
|
+
});
|
|
5506
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
5507
|
+
}
|
|
5508
|
+
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
5509
|
+
const snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
5510
|
+
config,
|
|
5511
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
5512
|
+
});
|
|
5513
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
5514
|
+
}
|
|
5515
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
5516
|
+
const resourceParams = createResourceParams$5(config);
|
|
5517
|
+
const request = createResourceRequest$5(resourceParams);
|
|
5518
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
5519
|
+
.then((response) => {
|
|
5520
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
|
|
5521
|
+
const cache = new StoreKeyMap();
|
|
5522
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
5523
|
+
return cache;
|
|
5524
|
+
});
|
|
5525
|
+
}, (response) => {
|
|
5526
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
|
|
5527
|
+
});
|
|
5528
|
+
}
|
|
5529
|
+
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
5530
|
+
return buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, undefined, false);
|
|
5531
|
+
}
|
|
5532
|
+
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
5533
|
+
const { luvio, config } = context;
|
|
5534
|
+
const selector = {
|
|
5535
|
+
recordId: keyBuilder$6(luvio, config),
|
|
5536
|
+
node: adapterFragment$3(luvio, config),
|
|
5537
|
+
variables: {},
|
|
5538
|
+
};
|
|
5539
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
5540
|
+
config,
|
|
5541
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
5542
|
+
});
|
|
5543
|
+
return cacheSnapshot;
|
|
5544
|
+
}
|
|
5545
|
+
const getPromptTemplateAdapterFactory = (luvio) => function EinsteinLLM__getPromptTemplate(untrustedConfig, requestContext) {
|
|
5546
|
+
const config = validateAdapterConfig$5(untrustedConfig, getPromptTemplate_ConfigPropertyNames);
|
|
5547
|
+
// Invalid or incomplete config
|
|
5548
|
+
if (config === null) {
|
|
5549
|
+
return null;
|
|
5550
|
+
}
|
|
5551
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
5552
|
+
buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
|
|
5553
|
+
};
|
|
5554
|
+
|
|
5555
|
+
function select$5(luvio, params) {
|
|
5556
|
+
return select$7();
|
|
5557
|
+
}
|
|
5558
|
+
function keyBuilder$5(luvio, params) {
|
|
5559
|
+
return keyPrefix + '::EinsteinPromptRecordRepresentation:(' + 'includingContent:' + params.queryParams.includingContent + ',' + 'includingVersionDetail:' + params.queryParams.includingVersionDetail + ',' + 'promptTemplateDevName:' + params.urlParams.promptTemplateDevName + ',' + 'versionId:' + params.urlParams.versionId + ')';
|
|
5560
|
+
}
|
|
5561
|
+
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
5562
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$5(luvio, resourceParams));
|
|
5563
|
+
}
|
|
5564
|
+
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
5565
|
+
const { body } = response;
|
|
5566
|
+
const key = keyBuilder$5(luvio, resourceParams);
|
|
5567
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
5568
|
+
const snapshot = luvio.storeLookup({
|
|
5569
|
+
recordId: key,
|
|
5570
|
+
node: select$5(),
|
|
5571
|
+
variables: {},
|
|
5572
|
+
}, snapshotRefresh);
|
|
5573
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
5574
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
5575
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
5576
|
+
}
|
|
5577
|
+
}
|
|
5578
|
+
deepFreeze(snapshot.data);
|
|
5579
|
+
return snapshot;
|
|
5580
|
+
}
|
|
5581
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
5582
|
+
const key = keyBuilder$5(luvio, params);
|
|
5583
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
5584
|
+
const storeMetadataParams = {
|
|
5585
|
+
ttl: TTL$1,
|
|
5586
|
+
namespace: keyPrefix,
|
|
5587
|
+
version: VERSION$1,
|
|
5588
|
+
representationName: RepresentationType$1
|
|
5589
|
+
};
|
|
5590
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
5591
|
+
return errorSnapshot;
|
|
5592
|
+
}
|
|
5593
|
+
function createResourceRequest$4(config) {
|
|
5594
|
+
const headers = {};
|
|
5595
|
+
return {
|
|
5596
|
+
baseUri: '/services/data/v65.0',
|
|
5597
|
+
basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '/versions/' + config.urlParams.versionId + '',
|
|
5598
|
+
method: 'get',
|
|
5599
|
+
body: null,
|
|
5600
|
+
urlParams: config.urlParams,
|
|
5601
|
+
queryParams: config.queryParams,
|
|
5602
|
+
headers,
|
|
5603
|
+
priority: 'normal',
|
|
5604
|
+
};
|
|
5605
|
+
}
|
|
5606
|
+
|
|
5607
|
+
const adapterName$4 = 'getPromptTemplateVersion';
|
|
5608
|
+
const getPromptTemplateVersion_ConfigPropertyMetadata = [
|
|
5609
|
+
generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
5610
|
+
generateParamConfigMetadata('versionId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
5611
|
+
generateParamConfigMetadata('includingContent', false, 1 /* QueryParameter */, 1 /* Boolean */),
|
|
5612
|
+
generateParamConfigMetadata('includingVersionDetail', false, 1 /* QueryParameter */, 1 /* Boolean */),
|
|
5613
|
+
];
|
|
5614
|
+
const getPromptTemplateVersion_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getPromptTemplateVersion_ConfigPropertyMetadata);
|
|
5615
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$h(getPromptTemplateVersion_ConfigPropertyMetadata);
|
|
5616
|
+
function keyBuilder$4(luvio, config) {
|
|
5617
|
+
const resourceParams = createResourceParams$4(config);
|
|
5618
|
+
return keyBuilder$5(luvio, resourceParams);
|
|
5619
|
+
}
|
|
5620
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
5621
|
+
const config = {};
|
|
5622
|
+
typeCheckConfig$h(untrustedConfig, config, getPromptTemplateVersion_ConfigPropertyMetadata);
|
|
5623
|
+
return config;
|
|
5624
|
+
}
|
|
5625
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
5626
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
5627
|
+
return null;
|
|
4014
5628
|
}
|
|
4015
|
-
return true;
|
|
4016
|
-
}
|
|
4017
|
-
const ingest$1 = function EinsteinPromptRecordRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
4018
5629
|
if (process.env.NODE_ENV !== 'production') {
|
|
4019
|
-
|
|
4020
|
-
if (validateError !== null) {
|
|
4021
|
-
throw validateError;
|
|
4022
|
-
}
|
|
5630
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
4023
5631
|
}
|
|
4024
|
-
const
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
5632
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
5633
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
5634
|
+
return null;
|
|
5635
|
+
}
|
|
5636
|
+
return config;
|
|
5637
|
+
}
|
|
5638
|
+
function adapterFragment$2(luvio, config) {
|
|
5639
|
+
createResourceParams$4(config);
|
|
5640
|
+
return select$5();
|
|
5641
|
+
}
|
|
5642
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
5643
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
5644
|
+
config,
|
|
5645
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
5646
|
+
});
|
|
5647
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
5648
|
+
}
|
|
5649
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
5650
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
5651
|
+
config,
|
|
5652
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
5653
|
+
});
|
|
5654
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
5655
|
+
}
|
|
5656
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
5657
|
+
const resourceParams = createResourceParams$4(config);
|
|
5658
|
+
const request = createResourceRequest$4(resourceParams);
|
|
5659
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
5660
|
+
.then((response) => {
|
|
5661
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
5662
|
+
const cache = new StoreKeyMap();
|
|
5663
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
|
|
5664
|
+
return cache;
|
|
5665
|
+
});
|
|
5666
|
+
}, (response) => {
|
|
5667
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
5668
|
+
});
|
|
5669
|
+
}
|
|
5670
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
5671
|
+
return buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
|
|
5672
|
+
}
|
|
5673
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
5674
|
+
const { luvio, config } = context;
|
|
5675
|
+
const selector = {
|
|
5676
|
+
recordId: keyBuilder$4(luvio, config),
|
|
5677
|
+
node: adapterFragment$2(luvio, config),
|
|
5678
|
+
variables: {},
|
|
5679
|
+
};
|
|
5680
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
5681
|
+
config,
|
|
5682
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
4036
5683
|
});
|
|
5684
|
+
return cacheSnapshot;
|
|
4037
5685
|
}
|
|
5686
|
+
const getPromptTemplateVersionAdapterFactory = (luvio) => function EinsteinLLM__getPromptTemplateVersion(untrustedConfig, requestContext) {
|
|
5687
|
+
const config = validateAdapterConfig$4(untrustedConfig, getPromptTemplateVersion_ConfigPropertyNames);
|
|
5688
|
+
// Invalid or incomplete config
|
|
5689
|
+
if (config === null) {
|
|
5690
|
+
return null;
|
|
5691
|
+
}
|
|
5692
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
5693
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
5694
|
+
};
|
|
4038
5695
|
|
|
4039
|
-
function select$
|
|
4040
|
-
return select$
|
|
5696
|
+
function select$4(luvio, params) {
|
|
5697
|
+
return select$7();
|
|
4041
5698
|
}
|
|
4042
5699
|
function keyBuilder$3(luvio, params) {
|
|
4043
|
-
return keyPrefix + '::EinsteinPromptRecordRepresentation:(' + '
|
|
5700
|
+
return keyPrefix + '::EinsteinPromptRecordRepresentation:(' + 'includingContent:' + params.queryParams.includingContent + ',' + 'includingVersionDetail:' + params.queryParams.includingVersionDetail + ',' + 'promptTemplateDevName:' + params.urlParams.promptTemplateDevName + ')';
|
|
4044
5701
|
}
|
|
4045
|
-
function getResponseCacheKeys$
|
|
5702
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
4046
5703
|
getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
|
|
4047
5704
|
}
|
|
4048
|
-
function ingestSuccess$
|
|
5705
|
+
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
4049
5706
|
const { body } = response;
|
|
4050
5707
|
const key = keyBuilder$3(luvio, resourceParams);
|
|
4051
5708
|
luvio.storeIngest(key, ingest$1, body);
|
|
4052
5709
|
const snapshot = luvio.storeLookup({
|
|
4053
5710
|
recordId: key,
|
|
4054
|
-
node: select$
|
|
5711
|
+
node: select$4(),
|
|
4055
5712
|
variables: {},
|
|
4056
5713
|
}, snapshotRefresh);
|
|
4057
5714
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -4074,11 +5731,11 @@ function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
|
4074
5731
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
4075
5732
|
return errorSnapshot;
|
|
4076
5733
|
}
|
|
4077
|
-
function createResourceRequest$
|
|
5734
|
+
function createResourceRequest$3(config) {
|
|
4078
5735
|
const headers = {};
|
|
4079
5736
|
return {
|
|
4080
5737
|
baseUri: '/services/data/v65.0',
|
|
4081
|
-
basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '',
|
|
5738
|
+
basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '/versions',
|
|
4082
5739
|
method: 'get',
|
|
4083
5740
|
body: null,
|
|
4084
5741
|
urlParams: config.urlParams,
|
|
@@ -4088,61 +5745,62 @@ function createResourceRequest$2(config) {
|
|
|
4088
5745
|
};
|
|
4089
5746
|
}
|
|
4090
5747
|
|
|
4091
|
-
const adapterName$
|
|
4092
|
-
const
|
|
5748
|
+
const adapterName$3 = 'getPromptTemplateVersions';
|
|
5749
|
+
const getPromptTemplateVersions_ConfigPropertyMetadata = [
|
|
4093
5750
|
generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
4094
|
-
generateParamConfigMetadata('
|
|
5751
|
+
generateParamConfigMetadata('includingContent', false, 1 /* QueryParameter */, 1 /* Boolean */),
|
|
5752
|
+
generateParamConfigMetadata('includingVersionDetail', false, 1 /* QueryParameter */, 1 /* Boolean */),
|
|
4095
5753
|
];
|
|
4096
|
-
const
|
|
4097
|
-
const createResourceParams$
|
|
5754
|
+
const getPromptTemplateVersions_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getPromptTemplateVersions_ConfigPropertyMetadata);
|
|
5755
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$h(getPromptTemplateVersions_ConfigPropertyMetadata);
|
|
4098
5756
|
function keyBuilder$2(luvio, config) {
|
|
4099
|
-
const resourceParams = createResourceParams$
|
|
5757
|
+
const resourceParams = createResourceParams$3(config);
|
|
4100
5758
|
return keyBuilder$3(luvio, resourceParams);
|
|
4101
5759
|
}
|
|
4102
|
-
function typeCheckConfig$
|
|
5760
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
4103
5761
|
const config = {};
|
|
4104
|
-
typeCheckConfig$
|
|
5762
|
+
typeCheckConfig$h(untrustedConfig, config, getPromptTemplateVersions_ConfigPropertyMetadata);
|
|
4105
5763
|
return config;
|
|
4106
5764
|
}
|
|
4107
|
-
function validateAdapterConfig$
|
|
5765
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
4108
5766
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
4109
5767
|
return null;
|
|
4110
5768
|
}
|
|
4111
5769
|
if (process.env.NODE_ENV !== 'production') {
|
|
4112
5770
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
4113
5771
|
}
|
|
4114
|
-
const config = typeCheckConfig$
|
|
5772
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
4115
5773
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
4116
5774
|
return null;
|
|
4117
5775
|
}
|
|
4118
5776
|
return config;
|
|
4119
5777
|
}
|
|
4120
5778
|
function adapterFragment$1(luvio, config) {
|
|
4121
|
-
createResourceParams$
|
|
4122
|
-
return select$
|
|
5779
|
+
createResourceParams$3(config);
|
|
5780
|
+
return select$4();
|
|
4123
5781
|
}
|
|
4124
5782
|
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
4125
|
-
const snapshot = ingestSuccess$
|
|
5783
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
4126
5784
|
config,
|
|
4127
|
-
resolve: () => buildNetworkSnapshot$
|
|
5785
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
4128
5786
|
});
|
|
4129
5787
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
4130
5788
|
}
|
|
4131
5789
|
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
4132
5790
|
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
4133
5791
|
config,
|
|
4134
|
-
resolve: () => buildNetworkSnapshot$
|
|
5792
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
4135
5793
|
});
|
|
4136
5794
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
4137
5795
|
}
|
|
4138
|
-
function buildNetworkSnapshot$
|
|
4139
|
-
const resourceParams = createResourceParams$
|
|
4140
|
-
const request = createResourceRequest$
|
|
5796
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
5797
|
+
const resourceParams = createResourceParams$3(config);
|
|
5798
|
+
const request = createResourceRequest$3(resourceParams);
|
|
4141
5799
|
return luvio.dispatchResourceRequest(request, options)
|
|
4142
5800
|
.then((response) => {
|
|
4143
5801
|
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
4144
5802
|
const cache = new StoreKeyMap();
|
|
4145
|
-
getResponseCacheKeys$
|
|
5803
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
4146
5804
|
return cache;
|
|
4147
5805
|
});
|
|
4148
5806
|
}, (response) => {
|
|
@@ -4150,7 +5808,7 @@ function buildNetworkSnapshot$2(luvio, config, options) {
|
|
|
4150
5808
|
});
|
|
4151
5809
|
}
|
|
4152
5810
|
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
4153
|
-
return buildNetworkSnapshotCachePolicy$
|
|
5811
|
+
return buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
|
|
4154
5812
|
}
|
|
4155
5813
|
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
4156
5814
|
const { luvio, config } = context;
|
|
@@ -4161,12 +5819,12 @@ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
|
4161
5819
|
};
|
|
4162
5820
|
const cacheSnapshot = storeLookup(selector, {
|
|
4163
5821
|
config,
|
|
4164
|
-
resolve: () => buildNetworkSnapshot$
|
|
5822
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
4165
5823
|
});
|
|
4166
5824
|
return cacheSnapshot;
|
|
4167
5825
|
}
|
|
4168
|
-
const
|
|
4169
|
-
const config = validateAdapterConfig$
|
|
5826
|
+
const getPromptTemplateVersionsAdapterFactory = (luvio) => function EinsteinLLM__getPromptTemplateVersions(untrustedConfig, requestContext) {
|
|
5827
|
+
const config = validateAdapterConfig$3(untrustedConfig, getPromptTemplateVersions_ConfigPropertyNames);
|
|
4170
5828
|
// Invalid or incomplete config
|
|
4171
5829
|
if (config === null) {
|
|
4172
5830
|
return null;
|
|
@@ -4216,7 +5874,7 @@ const RepresentationType = 'EinsteinPromptRecordCollectionOutputRepresentation';
|
|
|
4216
5874
|
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
4217
5875
|
return input;
|
|
4218
5876
|
}
|
|
4219
|
-
const select$
|
|
5877
|
+
const select$3 = function EinsteinPromptRecordCollectionOutputRepresentationSelect() {
|
|
4220
5878
|
return {
|
|
4221
5879
|
kind: 'Fragment',
|
|
4222
5880
|
version: VERSION,
|
|
@@ -4252,22 +5910,22 @@ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
|
4252
5910
|
});
|
|
4253
5911
|
}
|
|
4254
5912
|
|
|
4255
|
-
function select$
|
|
4256
|
-
return select$
|
|
5913
|
+
function select$2(luvio, params) {
|
|
5914
|
+
return select$3();
|
|
4257
5915
|
}
|
|
4258
5916
|
function keyBuilder$1(luvio, params) {
|
|
4259
5917
|
return keyPrefix + '::EinsteinPromptRecordCollectionOutputRepresentation:(' + 'isActive:' + params.queryParams.isActive + ',' + 'fields:' + params.queryParams.fields + ',' + 'relatedEntity:' + params.queryParams.relatedEntity + ',' + 'offset:' + params.queryParams.offset + ',' + 'pageLimit:' + params.queryParams.pageLimit + ',' + 'type:' + params.queryParams.type + ',' + 'query:' + params.queryParams.query + ',' + 'sortBy:' + params.queryParams.sortBy + ')';
|
|
4260
5918
|
}
|
|
4261
|
-
function getResponseCacheKeys$
|
|
5919
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
4262
5920
|
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
4263
5921
|
}
|
|
4264
|
-
function ingestSuccess$
|
|
5922
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
4265
5923
|
const { body } = response;
|
|
4266
5924
|
const key = keyBuilder$1(luvio, resourceParams);
|
|
4267
5925
|
luvio.storeIngest(key, ingest, body);
|
|
4268
5926
|
const snapshot = luvio.storeLookup({
|
|
4269
5927
|
recordId: key,
|
|
4270
|
-
node: select$
|
|
5928
|
+
node: select$2(),
|
|
4271
5929
|
variables: {},
|
|
4272
5930
|
}, snapshotRefresh);
|
|
4273
5931
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -4290,7 +5948,7 @@ function ingestError(luvio, params, error, snapshotRefresh) {
|
|
|
4290
5948
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
4291
5949
|
return errorSnapshot;
|
|
4292
5950
|
}
|
|
4293
|
-
function createResourceRequest$
|
|
5951
|
+
function createResourceRequest$2(config) {
|
|
4294
5952
|
const headers = {};
|
|
4295
5953
|
return {
|
|
4296
5954
|
baseUri: '/services/data/v65.0',
|
|
@@ -4304,7 +5962,7 @@ function createResourceRequest$1(config) {
|
|
|
4304
5962
|
};
|
|
4305
5963
|
}
|
|
4306
5964
|
|
|
4307
|
-
const adapterName$
|
|
5965
|
+
const adapterName$2 = 'getPromptTemplates';
|
|
4308
5966
|
const getPromptTemplates_ConfigPropertyMetadata = [
|
|
4309
5967
|
generateParamConfigMetadata('isActive', false, 1 /* QueryParameter */, 1 /* Boolean */),
|
|
4310
5968
|
generateParamConfigMetadata('fields', false, 1 /* QueryParameter */, 0 /* String */, true),
|
|
@@ -4315,56 +5973,56 @@ const getPromptTemplates_ConfigPropertyMetadata = [
|
|
|
4315
5973
|
generateParamConfigMetadata('query', false, 1 /* QueryParameter */, 0 /* String */),
|
|
4316
5974
|
generateParamConfigMetadata('sortBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
4317
5975
|
];
|
|
4318
|
-
const getPromptTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
4319
|
-
const createResourceParams$
|
|
5976
|
+
const getPromptTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getPromptTemplates_ConfigPropertyMetadata);
|
|
5977
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$h(getPromptTemplates_ConfigPropertyMetadata);
|
|
4320
5978
|
function keyBuilder(luvio, config) {
|
|
4321
|
-
const resourceParams = createResourceParams$
|
|
5979
|
+
const resourceParams = createResourceParams$2(config);
|
|
4322
5980
|
return keyBuilder$1(luvio, resourceParams);
|
|
4323
5981
|
}
|
|
4324
|
-
function typeCheckConfig$
|
|
5982
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
4325
5983
|
const config = {};
|
|
4326
|
-
typeCheckConfig$
|
|
5984
|
+
typeCheckConfig$h(untrustedConfig, config, getPromptTemplates_ConfigPropertyMetadata);
|
|
4327
5985
|
return config;
|
|
4328
5986
|
}
|
|
4329
|
-
function validateAdapterConfig$
|
|
5987
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
4330
5988
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
4331
5989
|
return null;
|
|
4332
5990
|
}
|
|
4333
5991
|
if (process.env.NODE_ENV !== 'production') {
|
|
4334
5992
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
4335
5993
|
}
|
|
4336
|
-
const config = typeCheckConfig$
|
|
5994
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
4337
5995
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
4338
5996
|
return null;
|
|
4339
5997
|
}
|
|
4340
5998
|
return config;
|
|
4341
5999
|
}
|
|
4342
6000
|
function adapterFragment(luvio, config) {
|
|
4343
|
-
createResourceParams$
|
|
4344
|
-
return select$
|
|
6001
|
+
createResourceParams$2(config);
|
|
6002
|
+
return select$2();
|
|
4345
6003
|
}
|
|
4346
6004
|
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
4347
|
-
const snapshot = ingestSuccess$
|
|
6005
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
4348
6006
|
config,
|
|
4349
|
-
resolve: () => buildNetworkSnapshot$
|
|
6007
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
4350
6008
|
});
|
|
4351
6009
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
4352
6010
|
}
|
|
4353
6011
|
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
4354
6012
|
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
4355
6013
|
config,
|
|
4356
|
-
resolve: () => buildNetworkSnapshot$
|
|
6014
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
4357
6015
|
});
|
|
4358
6016
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
4359
6017
|
}
|
|
4360
|
-
function buildNetworkSnapshot$
|
|
4361
|
-
const resourceParams = createResourceParams$
|
|
4362
|
-
const request = createResourceRequest$
|
|
6018
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
6019
|
+
const resourceParams = createResourceParams$2(config);
|
|
6020
|
+
const request = createResourceRequest$2(resourceParams);
|
|
4363
6021
|
return luvio.dispatchResourceRequest(request, options)
|
|
4364
6022
|
.then((response) => {
|
|
4365
6023
|
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
4366
6024
|
const cache = new StoreKeyMap();
|
|
4367
|
-
getResponseCacheKeys$
|
|
6025
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
4368
6026
|
return cache;
|
|
4369
6027
|
});
|
|
4370
6028
|
}, (response) => {
|
|
@@ -4372,7 +6030,7 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
4372
6030
|
});
|
|
4373
6031
|
}
|
|
4374
6032
|
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
4375
|
-
return buildNetworkSnapshotCachePolicy$
|
|
6033
|
+
return buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
|
|
4376
6034
|
}
|
|
4377
6035
|
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
4378
6036
|
const { luvio, config } = context;
|
|
@@ -4383,12 +6041,12 @@ function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
|
4383
6041
|
};
|
|
4384
6042
|
const cacheSnapshot = storeLookup(selector, {
|
|
4385
6043
|
config,
|
|
4386
|
-
resolve: () => buildNetworkSnapshot$
|
|
6044
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
4387
6045
|
});
|
|
4388
6046
|
return cacheSnapshot;
|
|
4389
6047
|
}
|
|
4390
6048
|
const getPromptTemplatesAdapterFactory = (luvio) => function EinsteinLLM__getPromptTemplates(untrustedConfig, requestContext) {
|
|
4391
|
-
const config = validateAdapterConfig$
|
|
6049
|
+
const config = validateAdapterConfig$2(untrustedConfig, getPromptTemplates_ConfigPropertyNames);
|
|
4392
6050
|
// Invalid or incomplete config
|
|
4393
6051
|
if (config === null) {
|
|
4394
6052
|
return null;
|
|
@@ -4397,16 +6055,109 @@ const getPromptTemplatesAdapterFactory = (luvio) => function EinsteinLLM__getPro
|
|
|
4397
6055
|
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
4398
6056
|
};
|
|
4399
6057
|
|
|
6058
|
+
function select$1(luvio, params) {
|
|
6059
|
+
return select$l();
|
|
6060
|
+
}
|
|
6061
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
6062
|
+
getTypeCacheKeys$6(storeKeyMap, luvio, response);
|
|
6063
|
+
}
|
|
6064
|
+
function ingestSuccess$1(luvio, resourceParams, response) {
|
|
6065
|
+
const { body } = response;
|
|
6066
|
+
const key = keyBuilderFromType(luvio, body);
|
|
6067
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
6068
|
+
const snapshot = luvio.storeLookup({
|
|
6069
|
+
recordId: key,
|
|
6070
|
+
node: select$1(),
|
|
6071
|
+
variables: {},
|
|
6072
|
+
});
|
|
6073
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6074
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
6075
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
6076
|
+
}
|
|
6077
|
+
}
|
|
6078
|
+
deepFreeze(snapshot.data);
|
|
6079
|
+
return snapshot;
|
|
6080
|
+
}
|
|
6081
|
+
function createResourceRequest$1(config) {
|
|
6082
|
+
const headers = {};
|
|
6083
|
+
return {
|
|
6084
|
+
baseUri: '/services/data/v65.0',
|
|
6085
|
+
basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '/versions/' + config.urlParams.versionId + '/status',
|
|
6086
|
+
method: 'put',
|
|
6087
|
+
body: null,
|
|
6088
|
+
urlParams: config.urlParams,
|
|
6089
|
+
queryParams: config.queryParams,
|
|
6090
|
+
headers,
|
|
6091
|
+
priority: 'normal',
|
|
6092
|
+
};
|
|
6093
|
+
}
|
|
6094
|
+
|
|
6095
|
+
const adapterName$1 = 'putEinsteinPromptTemplateVersionStatus';
|
|
6096
|
+
const putEinsteinPromptTemplateVersionStatus_ConfigPropertyMetadata = [
|
|
6097
|
+
generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
6098
|
+
generateParamConfigMetadata('versionId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
6099
|
+
generateParamConfigMetadata('action', false, 1 /* QueryParameter */, 0 /* String */),
|
|
6100
|
+
generateParamConfigMetadata('ignoreWarnings', false, 1 /* QueryParameter */, 1 /* Boolean */),
|
|
6101
|
+
];
|
|
6102
|
+
const putEinsteinPromptTemplateVersionStatus_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, putEinsteinPromptTemplateVersionStatus_ConfigPropertyMetadata);
|
|
6103
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$h(putEinsteinPromptTemplateVersionStatus_ConfigPropertyMetadata);
|
|
6104
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
6105
|
+
const config = {};
|
|
6106
|
+
typeCheckConfig$h(untrustedConfig, config, putEinsteinPromptTemplateVersionStatus_ConfigPropertyMetadata);
|
|
6107
|
+
return config;
|
|
6108
|
+
}
|
|
6109
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
6110
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
6111
|
+
return null;
|
|
6112
|
+
}
|
|
6113
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6114
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
6115
|
+
}
|
|
6116
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
6117
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
6118
|
+
return null;
|
|
6119
|
+
}
|
|
6120
|
+
return config;
|
|
6121
|
+
}
|
|
6122
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
6123
|
+
const resourceParams = createResourceParams$1(config);
|
|
6124
|
+
const request = createResourceRequest$1(resourceParams);
|
|
6125
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
6126
|
+
.then((response) => {
|
|
6127
|
+
return luvio.handleSuccessResponse(() => {
|
|
6128
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response);
|
|
6129
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
6130
|
+
}, () => {
|
|
6131
|
+
const cache = new StoreKeyMap();
|
|
6132
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
6133
|
+
return cache;
|
|
6134
|
+
});
|
|
6135
|
+
}, (response) => {
|
|
6136
|
+
deepFreeze(response);
|
|
6137
|
+
throw response;
|
|
6138
|
+
});
|
|
6139
|
+
}
|
|
6140
|
+
const putEinsteinPromptTemplateVersionStatusAdapterFactory = (luvio) => {
|
|
6141
|
+
return function putEinsteinPromptTemplateVersionStatus(untrustedConfig) {
|
|
6142
|
+
const config = validateAdapterConfig$1(untrustedConfig, putEinsteinPromptTemplateVersionStatus_ConfigPropertyNames);
|
|
6143
|
+
// Invalid or incomplete config
|
|
6144
|
+
if (config === null) {
|
|
6145
|
+
throw new Error('Invalid config for "putEinsteinPromptTemplateVersionStatus"');
|
|
6146
|
+
}
|
|
6147
|
+
return buildNetworkSnapshot$1(luvio, config);
|
|
6148
|
+
};
|
|
6149
|
+
};
|
|
6150
|
+
|
|
4400
6151
|
function select(luvio, params) {
|
|
4401
|
-
return select$
|
|
6152
|
+
return select$l();
|
|
4402
6153
|
}
|
|
4403
6154
|
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
4404
|
-
getTypeCacheKeys$
|
|
6155
|
+
getTypeCacheKeys$6(storeKeyMap, luvio, response);
|
|
4405
6156
|
}
|
|
4406
6157
|
function ingestSuccess(luvio, resourceParams, response) {
|
|
4407
6158
|
const { body } = response;
|
|
4408
6159
|
const key = keyBuilderFromType(luvio, body);
|
|
4409
|
-
luvio.storeIngest(key, ingest$
|
|
6160
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
4410
6161
|
const snapshot = luvio.storeLookup({
|
|
4411
6162
|
recordId: key,
|
|
4412
6163
|
node: select(),
|
|
@@ -4440,15 +6191,14 @@ const updatePromptTemplateVersion_ConfigPropertyMetadata = [
|
|
|
4440
6191
|
generateParamConfigMetadata('versionId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
4441
6192
|
generateParamConfigMetadata('apiName', true, 2 /* Body */, 0 /* String */),
|
|
4442
6193
|
generateParamConfigMetadata('childRelationships', true, 2 /* Body */, 4 /* Unsupported */),
|
|
4443
|
-
generateParamConfigMetadata('fields', true, 2 /* Body */, 4 /* Unsupported
|
|
6194
|
+
generateParamConfigMetadata('fields', true, 2 /* Body */, 4 /* Unsupported */),
|
|
4444
6195
|
generateParamConfigMetadata('id', false, 2 /* Body */, 0 /* String */),
|
|
4445
|
-
generateParamConfigMetadata('isStandard', true, 2 /* Body */, 1 /* Boolean */),
|
|
4446
6196
|
];
|
|
4447
6197
|
const updatePromptTemplateVersion_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, updatePromptTemplateVersion_ConfigPropertyMetadata);
|
|
4448
|
-
const createResourceParams = /*#__PURE__*/ createResourceParams$
|
|
6198
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$h(updatePromptTemplateVersion_ConfigPropertyMetadata);
|
|
4449
6199
|
function typeCheckConfig(untrustedConfig) {
|
|
4450
6200
|
const config = {};
|
|
4451
|
-
typeCheckConfig$
|
|
6201
|
+
typeCheckConfig$h(untrustedConfig, config, updatePromptTemplateVersion_ConfigPropertyMetadata);
|
|
4452
6202
|
const untrustedConfig_childRelationships = untrustedConfig.childRelationships;
|
|
4453
6203
|
if (untrustedIsObject(untrustedConfig_childRelationships)) {
|
|
4454
6204
|
const untrustedConfig_childRelationships_object = {};
|
|
@@ -4465,26 +6215,19 @@ function typeCheckConfig(untrustedConfig) {
|
|
|
4465
6215
|
}
|
|
4466
6216
|
}
|
|
4467
6217
|
const untrustedConfig_fields = untrustedConfig.fields;
|
|
4468
|
-
if (
|
|
4469
|
-
const
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
const key = untrustedConfig_fields_item_keys[i];
|
|
4477
|
-
const untrustedConfig_fields_item_prop = untrustedConfig_fields_item[key];
|
|
4478
|
-
if (untrustedConfig_fields_item_object !== undefined) {
|
|
4479
|
-
untrustedConfig_fields_item_object[key] = untrustedConfig_fields_item_prop;
|
|
4480
|
-
}
|
|
4481
|
-
}
|
|
4482
|
-
if (untrustedConfig_fields_item_object !== undefined && Object.keys(untrustedConfig_fields_item_object).length >= 0) {
|
|
4483
|
-
untrustedConfig_fields_array.push(untrustedConfig_fields_item_object);
|
|
4484
|
-
}
|
|
6218
|
+
if (untrustedIsObject(untrustedConfig_fields)) {
|
|
6219
|
+
const untrustedConfig_fields_object = {};
|
|
6220
|
+
const untrustedConfig_fields_keys = Object.keys(untrustedConfig_fields);
|
|
6221
|
+
for (let i = 0, arrayLength = untrustedConfig_fields_keys.length; i < arrayLength; i++) {
|
|
6222
|
+
const key = untrustedConfig_fields_keys[i];
|
|
6223
|
+
const untrustedConfig_fields_prop = untrustedConfig_fields[key];
|
|
6224
|
+
if (untrustedConfig_fields_object !== undefined) {
|
|
6225
|
+
untrustedConfig_fields_object[key] = untrustedConfig_fields_prop;
|
|
4485
6226
|
}
|
|
4486
6227
|
}
|
|
4487
|
-
|
|
6228
|
+
if (untrustedConfig_fields_object !== undefined && Object.keys(untrustedConfig_fields_object).length >= 0) {
|
|
6229
|
+
config.fields = untrustedConfig_fields_object;
|
|
6230
|
+
}
|
|
4488
6231
|
}
|
|
4489
6232
|
return config;
|
|
4490
6233
|
}
|
|
@@ -4536,23 +6279,62 @@ let createGenerations;
|
|
|
4536
6279
|
let createGenerationsForPromptTemplate;
|
|
4537
6280
|
let createPromptTemplate;
|
|
4538
6281
|
let createPromptTemplateVersion;
|
|
6282
|
+
let getDataProviderInstanceConfig;
|
|
6283
|
+
let getDataProviderTypeConfigs;
|
|
6284
|
+
let getDataProviders;
|
|
6285
|
+
let getInputMappedDataProviders;
|
|
4539
6286
|
let getOutputLanguages;
|
|
4540
6287
|
let getPromptTemplate;
|
|
6288
|
+
let getPromptTemplateVersion;
|
|
6289
|
+
let getPromptTemplateVersions;
|
|
4541
6290
|
let getPromptTemplates;
|
|
6291
|
+
let putEinsteinPromptTemplateVersionStatus;
|
|
4542
6292
|
let updatePromptTemplateVersion;
|
|
4543
6293
|
// Imperative GET Adapters
|
|
4544
6294
|
let createEmbeddings_imperative;
|
|
6295
|
+
let getDataProviderInstanceConfig_imperative;
|
|
6296
|
+
let getDataProviderTypeConfigs_imperative;
|
|
6297
|
+
let getDataProviders_imperative;
|
|
6298
|
+
let getInputMappedDataProviders_imperative;
|
|
4545
6299
|
let getOutputLanguages_imperative;
|
|
4546
6300
|
let getPromptTemplate_imperative;
|
|
6301
|
+
let getPromptTemplateVersion_imperative;
|
|
6302
|
+
let getPromptTemplateVersions_imperative;
|
|
4547
6303
|
let getPromptTemplates_imperative;
|
|
4548
6304
|
// Adapter Metadata
|
|
4549
6305
|
const createEmbeddingsMetadata = { apiFamily: 'EinsteinLLM', name: 'createEmbeddings', ttl: 100 };
|
|
6306
|
+
const getDataProviderInstanceConfigMetadata = {
|
|
6307
|
+
apiFamily: 'EinsteinLLM',
|
|
6308
|
+
name: 'getDataProviderInstanceConfig',
|
|
6309
|
+
ttl: 300,
|
|
6310
|
+
};
|
|
6311
|
+
const getDataProviderTypeConfigsMetadata = {
|
|
6312
|
+
apiFamily: 'EinsteinLLM',
|
|
6313
|
+
name: 'getDataProviderTypeConfigs',
|
|
6314
|
+
ttl: 300,
|
|
6315
|
+
};
|
|
6316
|
+
const getDataProvidersMetadata = { apiFamily: 'EinsteinLLM', name: 'getDataProviders', ttl: 300 };
|
|
6317
|
+
const getInputMappedDataProvidersMetadata = {
|
|
6318
|
+
apiFamily: 'EinsteinLLM',
|
|
6319
|
+
name: 'getInputMappedDataProviders',
|
|
6320
|
+
ttl: 300,
|
|
6321
|
+
};
|
|
4550
6322
|
const getOutputLanguagesMetadata = {
|
|
4551
6323
|
apiFamily: 'EinsteinLLM',
|
|
4552
6324
|
name: 'getOutputLanguages',
|
|
4553
6325
|
ttl: 100,
|
|
4554
6326
|
};
|
|
4555
6327
|
const getPromptTemplateMetadata = { apiFamily: 'EinsteinLLM', name: 'getPromptTemplate', ttl: 100 };
|
|
6328
|
+
const getPromptTemplateVersionMetadata = {
|
|
6329
|
+
apiFamily: 'EinsteinLLM',
|
|
6330
|
+
name: 'getPromptTemplateVersion',
|
|
6331
|
+
ttl: 100,
|
|
6332
|
+
};
|
|
6333
|
+
const getPromptTemplateVersionsMetadata = {
|
|
6334
|
+
apiFamily: 'EinsteinLLM',
|
|
6335
|
+
name: 'getPromptTemplateVersions',
|
|
6336
|
+
ttl: 100,
|
|
6337
|
+
};
|
|
4556
6338
|
const getPromptTemplatesMetadata = {
|
|
4557
6339
|
apiFamily: 'EinsteinLLM',
|
|
4558
6340
|
name: 'getPromptTemplates',
|
|
@@ -4562,8 +6344,14 @@ const getPromptTemplatesMetadata = {
|
|
|
4562
6344
|
function bindExportsTo(luvio) {
|
|
4563
6345
|
// LDS Adapters
|
|
4564
6346
|
const createEmbeddings_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'createEmbeddings', createEmbeddingsAdapterFactory), createEmbeddingsMetadata);
|
|
6347
|
+
const getDataProviderInstanceConfig_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getDataProviderInstanceConfig', getDataProviderInstanceConfigAdapterFactory), getDataProviderInstanceConfigMetadata);
|
|
6348
|
+
const getDataProviderTypeConfigs_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getDataProviderTypeConfigs', getDataProviderTypeConfigsAdapterFactory), getDataProviderTypeConfigsMetadata);
|
|
6349
|
+
const getDataProviders_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getDataProviders', getDataProvidersAdapterFactory), getDataProvidersMetadata);
|
|
6350
|
+
const getInputMappedDataProviders_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getInputMappedDataProviders', getInputMappedDataProvidersAdapterFactory), getInputMappedDataProvidersMetadata);
|
|
4565
6351
|
const getOutputLanguages_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getOutputLanguages', getOutputLanguagesAdapterFactory), getOutputLanguagesMetadata);
|
|
4566
6352
|
const getPromptTemplate_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getPromptTemplate', getPromptTemplateAdapterFactory), getPromptTemplateMetadata);
|
|
6353
|
+
const getPromptTemplateVersion_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getPromptTemplateVersion', getPromptTemplateVersionAdapterFactory), getPromptTemplateVersionMetadata);
|
|
6354
|
+
const getPromptTemplateVersions_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getPromptTemplateVersions', getPromptTemplateVersionsAdapterFactory), getPromptTemplateVersionsMetadata);
|
|
4567
6355
|
const getPromptTemplates_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getPromptTemplates', getPromptTemplatesAdapterFactory), getPromptTemplatesMetadata);
|
|
4568
6356
|
function unwrapSnapshotData(factory) {
|
|
4569
6357
|
const adapter = factory(luvio);
|
|
@@ -4576,14 +6364,27 @@ function bindExportsTo(luvio) {
|
|
|
4576
6364
|
createGenerationsForPromptTemplate: unwrapSnapshotData(createGenerationsForPromptTemplateAdapterFactory),
|
|
4577
6365
|
createPromptTemplate: unwrapSnapshotData(createPromptTemplateAdapterFactory),
|
|
4578
6366
|
createPromptTemplateVersion: unwrapSnapshotData(createPromptTemplateVersionAdapterFactory),
|
|
6367
|
+
getDataProviderInstanceConfig: createWireAdapterConstructor(luvio, getDataProviderInstanceConfig_ldsAdapter, getDataProviderInstanceConfigMetadata),
|
|
6368
|
+
getDataProviderTypeConfigs: createWireAdapterConstructor(luvio, getDataProviderTypeConfigs_ldsAdapter, getDataProviderTypeConfigsMetadata),
|
|
6369
|
+
getDataProviders: createWireAdapterConstructor(luvio, getDataProviders_ldsAdapter, getDataProvidersMetadata),
|
|
6370
|
+
getInputMappedDataProviders: createWireAdapterConstructor(luvio, getInputMappedDataProviders_ldsAdapter, getInputMappedDataProvidersMetadata),
|
|
4579
6371
|
getOutputLanguages: createWireAdapterConstructor(luvio, getOutputLanguages_ldsAdapter, getOutputLanguagesMetadata),
|
|
4580
6372
|
getPromptTemplate: createWireAdapterConstructor(luvio, getPromptTemplate_ldsAdapter, getPromptTemplateMetadata),
|
|
6373
|
+
getPromptTemplateVersion: createWireAdapterConstructor(luvio, getPromptTemplateVersion_ldsAdapter, getPromptTemplateVersionMetadata),
|
|
6374
|
+
getPromptTemplateVersions: createWireAdapterConstructor(luvio, getPromptTemplateVersions_ldsAdapter, getPromptTemplateVersionsMetadata),
|
|
4581
6375
|
getPromptTemplates: createWireAdapterConstructor(luvio, getPromptTemplates_ldsAdapter, getPromptTemplatesMetadata),
|
|
6376
|
+
putEinsteinPromptTemplateVersionStatus: unwrapSnapshotData(putEinsteinPromptTemplateVersionStatusAdapterFactory),
|
|
4582
6377
|
updatePromptTemplateVersion: unwrapSnapshotData(updatePromptTemplateVersionAdapterFactory),
|
|
4583
6378
|
// Imperative GET Adapters
|
|
4584
6379
|
createEmbeddings_imperative: createImperativeAdapter(luvio, createEmbeddings_ldsAdapter, createEmbeddingsMetadata),
|
|
6380
|
+
getDataProviderInstanceConfig_imperative: createImperativeAdapter(luvio, getDataProviderInstanceConfig_ldsAdapter, getDataProviderInstanceConfigMetadata),
|
|
6381
|
+
getDataProviderTypeConfigs_imperative: createImperativeAdapter(luvio, getDataProviderTypeConfigs_ldsAdapter, getDataProviderTypeConfigsMetadata),
|
|
6382
|
+
getDataProviders_imperative: createImperativeAdapter(luvio, getDataProviders_ldsAdapter, getDataProvidersMetadata),
|
|
6383
|
+
getInputMappedDataProviders_imperative: createImperativeAdapter(luvio, getInputMappedDataProviders_ldsAdapter, getInputMappedDataProvidersMetadata),
|
|
4585
6384
|
getOutputLanguages_imperative: createImperativeAdapter(luvio, getOutputLanguages_ldsAdapter, getOutputLanguagesMetadata),
|
|
4586
6385
|
getPromptTemplate_imperative: createImperativeAdapter(luvio, getPromptTemplate_ldsAdapter, getPromptTemplateMetadata),
|
|
6386
|
+
getPromptTemplateVersion_imperative: createImperativeAdapter(luvio, getPromptTemplateVersion_ldsAdapter, getPromptTemplateVersionMetadata),
|
|
6387
|
+
getPromptTemplateVersions_imperative: createImperativeAdapter(luvio, getPromptTemplateVersions_ldsAdapter, getPromptTemplateVersionsMetadata),
|
|
4587
6388
|
getPromptTemplates_imperative: createImperativeAdapter(luvio, getPromptTemplates_ldsAdapter, getPromptTemplatesMetadata),
|
|
4588
6389
|
// Notify Update Availables
|
|
4589
6390
|
};
|
|
@@ -4596,16 +6397,29 @@ withDefaultLuvio((luvio) => {
|
|
|
4596
6397
|
createGenerationsForPromptTemplate,
|
|
4597
6398
|
createPromptTemplate,
|
|
4598
6399
|
createPromptTemplateVersion,
|
|
6400
|
+
getDataProviderInstanceConfig,
|
|
6401
|
+
getDataProviderTypeConfigs,
|
|
6402
|
+
getDataProviders,
|
|
6403
|
+
getInputMappedDataProviders,
|
|
4599
6404
|
getOutputLanguages,
|
|
4600
6405
|
getPromptTemplate,
|
|
6406
|
+
getPromptTemplateVersion,
|
|
6407
|
+
getPromptTemplateVersions,
|
|
4601
6408
|
getPromptTemplates,
|
|
6409
|
+
putEinsteinPromptTemplateVersionStatus,
|
|
4602
6410
|
updatePromptTemplateVersion,
|
|
4603
6411
|
createEmbeddings_imperative,
|
|
6412
|
+
getDataProviderInstanceConfig_imperative,
|
|
6413
|
+
getDataProviderTypeConfigs_imperative,
|
|
6414
|
+
getDataProviders_imperative,
|
|
6415
|
+
getInputMappedDataProviders_imperative,
|
|
4604
6416
|
getOutputLanguages_imperative,
|
|
4605
6417
|
getPromptTemplate_imperative,
|
|
6418
|
+
getPromptTemplateVersion_imperative,
|
|
6419
|
+
getPromptTemplateVersions_imperative,
|
|
4606
6420
|
getPromptTemplates_imperative,
|
|
4607
6421
|
} = bindExportsTo(luvio));
|
|
4608
6422
|
});
|
|
4609
6423
|
|
|
4610
|
-
export { createEmbeddings, createEmbeddings_imperative, createFeedback, createGenerations, createGenerationsForPromptTemplate, createPromptTemplate, createPromptTemplateVersion, getOutputLanguages, getOutputLanguages_imperative, getPromptTemplate, getPromptTemplate_imperative, getPromptTemplates, getPromptTemplates_imperative, updatePromptTemplateVersion };
|
|
4611
|
-
// version: 1.380.0-
|
|
6424
|
+
export { createEmbeddings, createEmbeddings_imperative, createFeedback, createGenerations, createGenerationsForPromptTemplate, createPromptTemplate, createPromptTemplateVersion, getDataProviderInstanceConfig, getDataProviderInstanceConfig_imperative, getDataProviderTypeConfigs, getDataProviderTypeConfigs_imperative, getDataProviders, getDataProviders_imperative, getInputMappedDataProviders, getInputMappedDataProviders_imperative, getOutputLanguages, getOutputLanguages_imperative, getPromptTemplate, getPromptTemplateVersion, getPromptTemplateVersion_imperative, getPromptTemplateVersions, getPromptTemplateVersions_imperative, getPromptTemplate_imperative, getPromptTemplates, getPromptTemplates_imperative, putEinsteinPromptTemplateVersionStatus, updatePromptTemplateVersion };
|
|
6425
|
+
// version: 1.380.0-dev11-54c448d29f
|