@salesforce/lds-adapters-service-einsteinllm 1.379.0 → 1.380.0-dev1

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.
@@ -4,7 +4,7 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
 
7
- import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$4, StoreKeyMap, createResourceParams as createResourceParams$7, typeCheckConfig as typeCheckConfig$7 } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$4, StoreKeyMap, createResourceParams as createResourceParams$a, typeCheckConfig as typeCheckConfig$a } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
10
  const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
@@ -168,7 +168,7 @@ function createLink(ref) {
168
168
  };
169
169
  }
170
170
 
171
- function validate$s(obj, path = 'EinsteinLlmEmbeddingsAdditionalConfigInputRepresentation') {
171
+ function validate$t(obj, path = 'EinsteinLlmEmbeddingsAdditionalConfigInputRepresentation') {
172
172
  const v_error = (() => {
173
173
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
174
174
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -212,7 +212,7 @@ function validate$s(obj, path = 'EinsteinLlmEmbeddingsAdditionalConfigInputRepre
212
212
  return v_error === undefined ? null : v_error;
213
213
  }
214
214
 
215
- function validate$r(obj, path = 'WrappedListString') {
215
+ function validate$s(obj, path = 'WrappedListString') {
216
216
  const v_error = (() => {
217
217
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
218
218
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -233,14 +233,14 @@ function validate$r(obj, path = 'WrappedListString') {
233
233
  return v_error === undefined ? null : v_error;
234
234
  }
235
235
 
236
- function validate$q(obj, path = 'EinsteinLlmEmbeddingsInputRepresentation') {
236
+ function validate$r(obj, path = 'EinsteinLlmEmbeddingsInputRepresentation') {
237
237
  const v_error = (() => {
238
238
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
239
239
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
240
240
  }
241
241
  const obj_additionalConfig = obj.additionalConfig;
242
242
  const path_additionalConfig = path + '.additionalConfig';
243
- const referencepath_additionalConfigValidationError = validate$s(obj_additionalConfig, path_additionalConfig);
243
+ const referencepath_additionalConfigValidationError = validate$t(obj_additionalConfig, path_additionalConfig);
244
244
  if (referencepath_additionalConfigValidationError !== null) {
245
245
  let message = 'Object doesn\'t match EinsteinLlmEmbeddingsAdditionalConfigInputRepresentation (at "' + path_additionalConfig + '")\n';
246
246
  message += referencepath_additionalConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -248,7 +248,7 @@ function validate$q(obj, path = 'EinsteinLlmEmbeddingsInputRepresentation') {
248
248
  }
249
249
  const obj_prompts = obj.prompts;
250
250
  const path_prompts = path + '.prompts';
251
- const referencepath_promptsValidationError = validate$r(obj_prompts, path_prompts);
251
+ const referencepath_promptsValidationError = validate$s(obj_prompts, path_prompts);
252
252
  if (referencepath_promptsValidationError !== null) {
253
253
  let message = 'Object doesn\'t match WrappedListString (at "' + path_prompts + '")\n';
254
254
  message += referencepath_promptsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -265,8 +265,8 @@ function validate$q(obj, path = 'EinsteinLlmEmbeddingsInputRepresentation') {
265
265
  return v_error === undefined ? null : v_error;
266
266
  }
267
267
 
268
- const VERSION$j = "5ed5ccc6fa6f15691ec0fc1080e41fe6";
269
- function validate$p(obj, path = 'EinsteinLlmEmbeddingItemRepresentation') {
268
+ const VERSION$k = "5ed5ccc6fa6f15691ec0fc1080e41fe6";
269
+ function validate$q(obj, path = 'EinsteinLlmEmbeddingItemRepresentation') {
270
270
  const v_error = (() => {
271
271
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
272
272
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -287,10 +287,10 @@ function validate$p(obj, path = 'EinsteinLlmEmbeddingItemRepresentation') {
287
287
  })();
288
288
  return v_error === undefined ? null : v_error;
289
289
  }
290
- const select$q = function EinsteinLlmEmbeddingItemRepresentationSelect() {
290
+ const select$u = function EinsteinLlmEmbeddingItemRepresentationSelect() {
291
291
  return {
292
292
  kind: 'Fragment',
293
- version: VERSION$j,
293
+ version: VERSION$k,
294
294
  private: [],
295
295
  selections: [
296
296
  {
@@ -305,7 +305,7 @@ const select$q = function EinsteinLlmEmbeddingItemRepresentationSelect() {
305
305
  ]
306
306
  };
307
307
  };
308
- function equals$j(existing, incoming) {
308
+ function equals$k(existing, incoming) {
309
309
  const existing_index = existing.index;
310
310
  const incoming_index = incoming.index;
311
311
  if (!(existing_index === incoming_index)) {
@@ -324,9 +324,9 @@ function equals$j(existing, incoming) {
324
324
  return true;
325
325
  }
326
326
 
327
- const TTL$6 = 100;
328
- const VERSION$i = "d9873651f09d29764ef4d4231eb653d7";
329
- function validate$o(obj, path = 'EinsteinLlmEmbeddingsRepresentation') {
327
+ const TTL$7 = 100;
328
+ const VERSION$j = "d9873651f09d29764ef4d4231eb653d7";
329
+ function validate$p(obj, path = 'EinsteinLlmEmbeddingsRepresentation') {
330
330
  const v_error = (() => {
331
331
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
332
332
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -339,7 +339,7 @@ function validate$o(obj, path = 'EinsteinLlmEmbeddingsRepresentation') {
339
339
  for (let i = 0; i < obj_embeddings.length; i++) {
340
340
  const obj_embeddings_item = obj_embeddings[i];
341
341
  const path_embeddings_item = path_embeddings + '[' + i + ']';
342
- const referencepath_embeddings_itemValidationError = validate$p(obj_embeddings_item, path_embeddings_item);
342
+ const referencepath_embeddings_itemValidationError = validate$q(obj_embeddings_item, path_embeddings_item);
343
343
  if (referencepath_embeddings_itemValidationError !== null) {
344
344
  let message = 'Object doesn\'t match EinsteinLlmEmbeddingItemRepresentation (at "' + path_embeddings_item + '")\n';
345
345
  message += referencepath_embeddings_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -363,15 +363,15 @@ function validate$o(obj, path = 'EinsteinLlmEmbeddingsRepresentation') {
363
363
  })();
364
364
  return v_error === undefined ? null : v_error;
365
365
  }
366
- const RepresentationType$6 = 'EinsteinLlmEmbeddingsRepresentation';
367
- function normalize$6(input, existing, path, luvio, store, timestamp) {
366
+ const RepresentationType$7 = 'EinsteinLlmEmbeddingsRepresentation';
367
+ function normalize$7(input, existing, path, luvio, store, timestamp) {
368
368
  return input;
369
369
  }
370
- const select$p = function EinsteinLlmEmbeddingsRepresentationSelect() {
371
- const { selections: EinsteinLlmEmbeddingItemRepresentation__selections, opaque: EinsteinLlmEmbeddingItemRepresentation__opaque, } = select$q();
370
+ const select$t = function EinsteinLlmEmbeddingsRepresentationSelect() {
371
+ const { selections: EinsteinLlmEmbeddingItemRepresentation__selections, opaque: EinsteinLlmEmbeddingItemRepresentation__opaque, } = select$u();
372
372
  return {
373
373
  kind: 'Fragment',
374
- version: VERSION$i,
374
+ version: VERSION$j,
375
375
  private: [],
376
376
  selections: [
377
377
  {
@@ -388,11 +388,11 @@ const select$p = function EinsteinLlmEmbeddingsRepresentationSelect() {
388
388
  ]
389
389
  };
390
390
  };
391
- function equals$i(existing, incoming) {
391
+ function equals$j(existing, incoming) {
392
392
  const existing_embeddings = existing.embeddings;
393
393
  const incoming_embeddings = incoming.embeddings;
394
394
  const equals_embeddings_items = equalsArray(existing_embeddings, incoming_embeddings, (existing_embeddings_item, incoming_embeddings_item) => {
395
- if (!(equals$j(existing_embeddings_item, incoming_embeddings_item))) {
395
+ if (!(equals$k(existing_embeddings_item, incoming_embeddings_item))) {
396
396
  return false;
397
397
  }
398
398
  });
@@ -411,44 +411,44 @@ function equals$i(existing, incoming) {
411
411
  }
412
412
  return true;
413
413
  }
414
- const ingest$6 = function EinsteinLlmEmbeddingsRepresentationIngest(input, path, luvio, store, timestamp) {
414
+ const ingest$7 = function EinsteinLlmEmbeddingsRepresentationIngest(input, path, luvio, store, timestamp) {
415
415
  if (process.env.NODE_ENV !== 'production') {
416
- const validateError = validate$o(input);
416
+ const validateError = validate$p(input);
417
417
  if (validateError !== null) {
418
418
  throw validateError;
419
419
  }
420
420
  }
421
421
  const key = path.fullPath;
422
- const ttlToUse = TTL$6;
423
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "EinsteinLLM", VERSION$i, RepresentationType$6, equals$i);
422
+ const ttlToUse = TTL$7;
423
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$7, "EinsteinLLM", VERSION$j, RepresentationType$7, equals$j);
424
424
  return createLink(key);
425
425
  };
426
- function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
426
+ function getTypeCacheKeys$7(rootKeySet, luvio, input, fullPathFactory) {
427
427
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
428
428
  const rootKey = fullPathFactory();
429
429
  rootKeySet.set(rootKey, {
430
430
  namespace: keyPrefix,
431
- representationName: RepresentationType$6,
431
+ representationName: RepresentationType$7,
432
432
  mergeable: false
433
433
  });
434
434
  }
435
435
 
436
- function select$o(luvio, params) {
437
- return select$p();
436
+ function select$s(luvio, params) {
437
+ return select$t();
438
438
  }
439
- function keyBuilder$a(luvio, params) {
439
+ function keyBuilder$b(luvio, params) {
440
440
  return keyPrefix + '::EinsteinLlmEmbeddingsRepresentation:(' + stableJSONStringify(params.body.embeddingsInput.additionalConfig.additionalParameters) + '::' + 'embeddingsInput.additionalConfig.applicationName:' + params.body.embeddingsInput.additionalConfig.applicationName + '::' + (params.body.embeddingsInput.additionalConfig.enablePiiMasking === undefined ? 'embeddingsInput.additionalConfig.enablePiiMasking' : 'embeddingsInput.additionalConfig.enablePiiMasking:' + params.body.embeddingsInput.additionalConfig.enablePiiMasking) + '::' + (params.body.embeddingsInput.additionalConfig.model === undefined ? 'embeddingsInput.additionalConfig.model' : 'embeddingsInput.additionalConfig.model:' + params.body.embeddingsInput.additionalConfig.model) + '::' + 'embeddingsInput.prompts.wrappedListString:' + params.body.embeddingsInput.prompts.wrappedListString + '::' + (params.body.embeddingsInput.provider === undefined ? 'embeddingsInput.provider' : 'embeddingsInput.provider:' + params.body.embeddingsInput.provider) + ')';
441
441
  }
442
- function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
443
- getTypeCacheKeys$6(storeKeyMap, luvio, response, () => keyBuilder$a(luvio, resourceParams));
442
+ function getResponseCacheKeys$9(storeKeyMap, luvio, resourceParams, response) {
443
+ getTypeCacheKeys$7(storeKeyMap, luvio, response, () => keyBuilder$b(luvio, resourceParams));
444
444
  }
445
- function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
445
+ function ingestSuccess$9(luvio, resourceParams, response, snapshotRefresh) {
446
446
  const { body } = response;
447
- const key = keyBuilder$a(luvio, resourceParams);
448
- luvio.storeIngest(key, ingest$6, body);
447
+ const key = keyBuilder$b(luvio, resourceParams);
448
+ luvio.storeIngest(key, ingest$7, body);
449
449
  const snapshot = luvio.storeLookup({
450
450
  recordId: key,
451
- node: select$o(),
451
+ node: select$s(),
452
452
  variables: {},
453
453
  }, snapshotRefresh);
454
454
  if (process.env.NODE_ENV !== 'production') {
@@ -460,18 +460,18 @@ function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
460
460
  return snapshot;
461
461
  }
462
462
  function ingestError$3(luvio, params, error, snapshotRefresh) {
463
- const key = keyBuilder$a(luvio, params);
463
+ const key = keyBuilder$b(luvio, params);
464
464
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
465
465
  const storeMetadataParams = {
466
- ttl: TTL$6,
466
+ ttl: TTL$7,
467
467
  namespace: keyPrefix,
468
- version: VERSION$i,
469
- representationName: RepresentationType$6
468
+ version: VERSION$j,
469
+ representationName: RepresentationType$7
470
470
  };
471
471
  luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
472
472
  return errorSnapshot;
473
473
  }
474
- function createResourceRequest$6(config) {
474
+ function createResourceRequest$9(config) {
475
475
  const headers = {};
476
476
  return {
477
477
  baseUri: '/services/data/v65.0',
@@ -485,64 +485,64 @@ function createResourceRequest$6(config) {
485
485
  };
486
486
  }
487
487
 
488
- const adapterName$6 = 'createEmbeddings';
488
+ const adapterName$9 = 'createEmbeddings';
489
489
  const createEmbeddings_ConfigPropertyMetadata = [
490
490
  generateParamConfigMetadata('embeddingsInput', true, 2 /* Body */, 4 /* Unsupported */),
491
491
  ];
492
- const createEmbeddings_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, createEmbeddings_ConfigPropertyMetadata);
493
- const createResourceParams$6 = /*#__PURE__*/ createResourceParams$7(createEmbeddings_ConfigPropertyMetadata);
494
- function keyBuilder$9(luvio, config) {
495
- const resourceParams = createResourceParams$6(config);
496
- return keyBuilder$a(luvio, resourceParams);
492
+ const createEmbeddings_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$9, createEmbeddings_ConfigPropertyMetadata);
493
+ const createResourceParams$9 = /*#__PURE__*/ createResourceParams$a(createEmbeddings_ConfigPropertyMetadata);
494
+ function keyBuilder$a(luvio, config) {
495
+ const resourceParams = createResourceParams$9(config);
496
+ return keyBuilder$b(luvio, resourceParams);
497
497
  }
498
- function typeCheckConfig$6(untrustedConfig) {
498
+ function typeCheckConfig$9(untrustedConfig) {
499
499
  const config = {};
500
500
  const untrustedConfig_embeddingsInput = untrustedConfig.embeddingsInput;
501
- const referenceEinsteinLlmEmbeddingsInputRepresentationValidationError = validate$q(untrustedConfig_embeddingsInput);
501
+ const referenceEinsteinLlmEmbeddingsInputRepresentationValidationError = validate$r(untrustedConfig_embeddingsInput);
502
502
  if (referenceEinsteinLlmEmbeddingsInputRepresentationValidationError === null) {
503
503
  config.embeddingsInput = untrustedConfig_embeddingsInput;
504
504
  }
505
505
  return config;
506
506
  }
507
- function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
507
+ function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
508
508
  if (!untrustedIsObject(untrustedConfig)) {
509
509
  return null;
510
510
  }
511
511
  if (process.env.NODE_ENV !== 'production') {
512
512
  validateConfig(untrustedConfig, configPropertyNames);
513
513
  }
514
- const config = typeCheckConfig$6(untrustedConfig);
514
+ const config = typeCheckConfig$9(untrustedConfig);
515
515
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
516
516
  return null;
517
517
  }
518
518
  return config;
519
519
  }
520
520
  function adapterFragment$3(luvio, config) {
521
- createResourceParams$6(config);
522
- return select$o();
521
+ createResourceParams$9(config);
522
+ return select$s();
523
523
  }
524
524
  function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
525
- const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
525
+ const snapshot = ingestSuccess$9(luvio, resourceParams, response, {
526
526
  config,
527
- resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
527
+ resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
528
528
  });
529
529
  return luvio.storeBroadcast().then(() => snapshot);
530
530
  }
531
531
  function onFetchResponseError$3(luvio, config, resourceParams, response) {
532
532
  const snapshot = ingestError$3(luvio, resourceParams, response, {
533
533
  config,
534
- resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
534
+ resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
535
535
  });
536
536
  return luvio.storeBroadcast().then(() => snapshot);
537
537
  }
538
- function buildNetworkSnapshot$6(luvio, config, options) {
539
- const resourceParams = createResourceParams$6(config);
540
- const request = createResourceRequest$6(resourceParams);
538
+ function buildNetworkSnapshot$9(luvio, config, options) {
539
+ const resourceParams = createResourceParams$9(config);
540
+ const request = createResourceRequest$9(resourceParams);
541
541
  return luvio.dispatchResourceRequest(request, options)
542
542
  .then((response) => {
543
543
  return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
544
544
  const cache = new StoreKeyMap();
545
- getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
545
+ getResponseCacheKeys$9(cache, luvio, resourceParams, response.body);
546
546
  return cache;
547
547
  });
548
548
  }, (response) => {
@@ -550,23 +550,23 @@ function buildNetworkSnapshot$6(luvio, config, options) {
550
550
  });
551
551
  }
552
552
  function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
553
- return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, 'get', false);
553
+ return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$9, 'get', false);
554
554
  }
555
555
  function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
556
556
  const { luvio, config } = context;
557
557
  const selector = {
558
- recordId: keyBuilder$9(luvio, config),
558
+ recordId: keyBuilder$a(luvio, config),
559
559
  node: adapterFragment$3(luvio, config),
560
560
  variables: {},
561
561
  };
562
562
  const cacheSnapshot = storeLookup(selector, {
563
563
  config,
564
- resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
564
+ resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
565
565
  });
566
566
  return cacheSnapshot;
567
567
  }
568
568
  const createEmbeddingsAdapterFactory = (luvio) => function EinsteinLLM__createEmbeddings(untrustedConfig, requestContext) {
569
- const config = validateAdapterConfig$6(untrustedConfig, createEmbeddings_ConfigPropertyNames);
569
+ const config = validateAdapterConfig$9(untrustedConfig, createEmbeddings_ConfigPropertyNames);
570
570
  // Invalid or incomplete config
571
571
  if (config === null) {
572
572
  return null;
@@ -575,7 +575,7 @@ const createEmbeddingsAdapterFactory = (luvio) => function EinsteinLLM__createEm
575
575
  buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
576
576
  };
577
577
 
578
- function validate$n(obj, path = 'EinsteinLlmFeedbackInputRepresentation') {
578
+ function validate$o(obj, path = 'EinsteinLlmFeedbackInputRepresentation') {
579
579
  const v_error = (() => {
580
580
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
581
581
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -622,9 +622,9 @@ function validate$n(obj, path = 'EinsteinLlmFeedbackInputRepresentation') {
622
622
  return v_error === undefined ? null : v_error;
623
623
  }
624
624
 
625
- const TTL$5 = 100;
626
- const VERSION$h = "4033328f65865dd5d80c68a7573a4522";
627
- function validate$m(obj, path = 'EinsteinLlmFeedbackRepresentation') {
625
+ const TTL$6 = 100;
626
+ const VERSION$i = "4033328f65865dd5d80c68a7573a4522";
627
+ function validate$n(obj, path = 'EinsteinLlmFeedbackRepresentation') {
628
628
  const v_error = (() => {
629
629
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
630
630
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -637,23 +637,23 @@ function validate$m(obj, path = 'EinsteinLlmFeedbackRepresentation') {
637
637
  })();
638
638
  return v_error === undefined ? null : v_error;
639
639
  }
640
- const RepresentationType$5 = 'EinsteinLlmFeedbackRepresentation';
641
- function keyBuilder$8(luvio, config) {
642
- return keyPrefix + '::' + RepresentationType$5 + ':' + config.message;
640
+ const RepresentationType$6 = 'EinsteinLlmFeedbackRepresentation';
641
+ function keyBuilder$9(luvio, config) {
642
+ return keyPrefix + '::' + RepresentationType$6 + ':' + config.message;
643
643
  }
644
- function keyBuilderFromType$2(luvio, object) {
644
+ function keyBuilderFromType$3(luvio, object) {
645
645
  const keyParams = {
646
646
  message: object.message
647
647
  };
648
- return keyBuilder$8(luvio, keyParams);
648
+ return keyBuilder$9(luvio, keyParams);
649
649
  }
650
- function normalize$5(input, existing, path, luvio, store, timestamp) {
650
+ function normalize$6(input, existing, path, luvio, store, timestamp) {
651
651
  return input;
652
652
  }
653
- const select$n = function EinsteinLlmFeedbackRepresentationSelect() {
653
+ const select$r = function EinsteinLlmFeedbackRepresentationSelect() {
654
654
  return {
655
655
  kind: 'Fragment',
656
- version: VERSION$h,
656
+ version: VERSION$i,
657
657
  private: [],
658
658
  selections: [
659
659
  {
@@ -663,7 +663,7 @@ const select$n = function EinsteinLlmFeedbackRepresentationSelect() {
663
663
  ]
664
664
  };
665
665
  };
666
- function equals$h(existing, incoming) {
666
+ function equals$i(existing, incoming) {
667
667
  const existing_message = existing.message;
668
668
  const incoming_message = incoming.message;
669
669
  if (!(existing_message === incoming_message)) {
@@ -671,41 +671,41 @@ function equals$h(existing, incoming) {
671
671
  }
672
672
  return true;
673
673
  }
674
- const ingest$5 = function EinsteinLlmFeedbackRepresentationIngest(input, path, luvio, store, timestamp) {
674
+ const ingest$6 = function EinsteinLlmFeedbackRepresentationIngest(input, path, luvio, store, timestamp) {
675
675
  if (process.env.NODE_ENV !== 'production') {
676
- const validateError = validate$m(input);
676
+ const validateError = validate$n(input);
677
677
  if (validateError !== null) {
678
678
  throw validateError;
679
679
  }
680
680
  }
681
- const key = keyBuilderFromType$2(luvio, input);
682
- const ttlToUse = TTL$5;
683
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "EinsteinLLM", VERSION$h, RepresentationType$5, equals$h);
681
+ const key = keyBuilderFromType$3(luvio, input);
682
+ const ttlToUse = TTL$6;
683
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "EinsteinLLM", VERSION$i, RepresentationType$6, equals$i);
684
684
  return createLink(key);
685
685
  };
686
- function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
686
+ function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
687
687
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
688
- const rootKey = keyBuilderFromType$2(luvio, input);
688
+ const rootKey = keyBuilderFromType$3(luvio, input);
689
689
  rootKeySet.set(rootKey, {
690
690
  namespace: keyPrefix,
691
- representationName: RepresentationType$5,
691
+ representationName: RepresentationType$6,
692
692
  mergeable: false
693
693
  });
694
694
  }
695
695
 
696
- function select$m(luvio, params) {
697
- return select$n();
696
+ function select$q(luvio, params) {
697
+ return select$r();
698
698
  }
699
- function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
700
- getTypeCacheKeys$5(storeKeyMap, luvio, response);
699
+ function getResponseCacheKeys$8(storeKeyMap, luvio, resourceParams, response) {
700
+ getTypeCacheKeys$6(storeKeyMap, luvio, response);
701
701
  }
702
- function ingestSuccess$5(luvio, resourceParams, response) {
702
+ function ingestSuccess$8(luvio, resourceParams, response) {
703
703
  const { body } = response;
704
- const key = keyBuilderFromType$2(luvio, body);
705
- luvio.storeIngest(key, ingest$5, body);
704
+ const key = keyBuilderFromType$3(luvio, body);
705
+ luvio.storeIngest(key, ingest$6, body);
706
706
  const snapshot = luvio.storeLookup({
707
707
  recordId: key,
708
- node: select$m(),
708
+ node: select$q(),
709
709
  variables: {},
710
710
  });
711
711
  if (process.env.NODE_ENV !== 'production') {
@@ -716,7 +716,7 @@ function ingestSuccess$5(luvio, resourceParams, response) {
716
716
  deepFreeze(snapshot.data);
717
717
  return snapshot;
718
718
  }
719
- function createResourceRequest$5(config) {
719
+ function createResourceRequest$8(config) {
720
720
  const headers = {};
721
721
  return {
722
722
  baseUri: '/services/data/v65.0',
@@ -730,45 +730,45 @@ function createResourceRequest$5(config) {
730
730
  };
731
731
  }
732
732
 
733
- const adapterName$5 = 'createFeedback';
733
+ const adapterName$8 = 'createFeedback';
734
734
  const createFeedback_ConfigPropertyMetadata = [
735
735
  generateParamConfigMetadata('feedbackInput', true, 2 /* Body */, 4 /* Unsupported */),
736
736
  ];
737
- const createFeedback_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, createFeedback_ConfigPropertyMetadata);
738
- const createResourceParams$5 = /*#__PURE__*/ createResourceParams$7(createFeedback_ConfigPropertyMetadata);
739
- function typeCheckConfig$5(untrustedConfig) {
737
+ const createFeedback_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$8, createFeedback_ConfigPropertyMetadata);
738
+ const createResourceParams$8 = /*#__PURE__*/ createResourceParams$a(createFeedback_ConfigPropertyMetadata);
739
+ function typeCheckConfig$8(untrustedConfig) {
740
740
  const config = {};
741
741
  const untrustedConfig_feedbackInput = untrustedConfig.feedbackInput;
742
- const referenceEinsteinLlmFeedbackInputRepresentationValidationError = validate$n(untrustedConfig_feedbackInput);
742
+ const referenceEinsteinLlmFeedbackInputRepresentationValidationError = validate$o(untrustedConfig_feedbackInput);
743
743
  if (referenceEinsteinLlmFeedbackInputRepresentationValidationError === null) {
744
744
  config.feedbackInput = untrustedConfig_feedbackInput;
745
745
  }
746
746
  return config;
747
747
  }
748
- function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
748
+ function validateAdapterConfig$8(untrustedConfig, configPropertyNames) {
749
749
  if (!untrustedIsObject(untrustedConfig)) {
750
750
  return null;
751
751
  }
752
752
  if (process.env.NODE_ENV !== 'production') {
753
753
  validateConfig(untrustedConfig, configPropertyNames);
754
754
  }
755
- const config = typeCheckConfig$5(untrustedConfig);
755
+ const config = typeCheckConfig$8(untrustedConfig);
756
756
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
757
757
  return null;
758
758
  }
759
759
  return config;
760
760
  }
761
- function buildNetworkSnapshot$5(luvio, config, options) {
762
- const resourceParams = createResourceParams$5(config);
763
- const request = createResourceRequest$5(resourceParams);
761
+ function buildNetworkSnapshot$8(luvio, config, options) {
762
+ const resourceParams = createResourceParams$8(config);
763
+ const request = createResourceRequest$8(resourceParams);
764
764
  return luvio.dispatchResourceRequest(request, options)
765
765
  .then((response) => {
766
766
  return luvio.handleSuccessResponse(() => {
767
- const snapshot = ingestSuccess$5(luvio, resourceParams, response);
767
+ const snapshot = ingestSuccess$8(luvio, resourceParams, response);
768
768
  return luvio.storeBroadcast().then(() => snapshot);
769
769
  }, () => {
770
770
  const cache = new StoreKeyMap();
771
- getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
771
+ getResponseCacheKeys$8(cache, luvio, resourceParams, response.body);
772
772
  return cache;
773
773
  });
774
774
  }, (response) => {
@@ -778,16 +778,16 @@ function buildNetworkSnapshot$5(luvio, config, options) {
778
778
  }
779
779
  const createFeedbackAdapterFactory = (luvio) => {
780
780
  return function createFeedback(untrustedConfig) {
781
- const config = validateAdapterConfig$5(untrustedConfig, createFeedback_ConfigPropertyNames);
781
+ const config = validateAdapterConfig$8(untrustedConfig, createFeedback_ConfigPropertyNames);
782
782
  // Invalid or incomplete config
783
783
  if (config === null) {
784
784
  throw new Error('Invalid config for "createFeedback"');
785
785
  }
786
- return buildNetworkSnapshot$5(luvio, config);
786
+ return buildNetworkSnapshot$8(luvio, config);
787
787
  };
788
788
  };
789
789
 
790
- function validate$l(obj, path = 'EinsteinLlmAdditionalConfigInputRepresentation') {
790
+ function validate$m(obj, path = 'EinsteinLlmAdditionalConfigInputRepresentation') {
791
791
  const v_error = (() => {
792
792
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
793
793
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -870,7 +870,7 @@ function validate$l(obj, path = 'EinsteinLlmAdditionalConfigInputRepresentation'
870
870
  return v_error === undefined ? null : v_error;
871
871
  }
872
872
 
873
- function validate$k(obj, path = 'EinsteinLlmGenerationsInputRepresentation') {
873
+ function validate$l(obj, path = 'EinsteinLlmGenerationsInputRepresentation') {
874
874
  const v_error = (() => {
875
875
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
876
876
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -878,7 +878,7 @@ function validate$k(obj, path = 'EinsteinLlmGenerationsInputRepresentation') {
878
878
  if (obj.additionalConfig !== undefined) {
879
879
  const obj_additionalConfig = obj.additionalConfig;
880
880
  const path_additionalConfig = path + '.additionalConfig';
881
- const referencepath_additionalConfigValidationError = validate$l(obj_additionalConfig, path_additionalConfig);
881
+ const referencepath_additionalConfigValidationError = validate$m(obj_additionalConfig, path_additionalConfig);
882
882
  if (referencepath_additionalConfigValidationError !== null) {
883
883
  let message = 'Object doesn\'t match EinsteinLlmAdditionalConfigInputRepresentation (at "' + path_additionalConfig + '")\n';
884
884
  message += referencepath_additionalConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -901,8 +901,8 @@ function validate$k(obj, path = 'EinsteinLlmGenerationsInputRepresentation') {
901
901
  return v_error === undefined ? null : v_error;
902
902
  }
903
903
 
904
- const VERSION$g = "9ebac74e6f964c363d5fd1913df363af";
905
- function validate$j(obj, path = 'EinsteinLlmGenerationsContentQualityRepresentation') {
904
+ const VERSION$h = "9ebac74e6f964c363d5fd1913df363af";
905
+ function validate$k(obj, path = 'EinsteinLlmGenerationsContentQualityRepresentation') {
906
906
  const v_error = (() => {
907
907
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
908
908
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -938,10 +938,10 @@ function validate$j(obj, path = 'EinsteinLlmGenerationsContentQualityRepresentat
938
938
  })();
939
939
  return v_error === undefined ? null : v_error;
940
940
  }
941
- const select$l = function EinsteinLlmGenerationsContentQualityRepresentationSelect() {
941
+ const select$p = function EinsteinLlmGenerationsContentQualityRepresentationSelect() {
942
942
  return {
943
943
  kind: 'Fragment',
944
- version: VERSION$g,
944
+ version: VERSION$h,
945
945
  private: [],
946
946
  selections: [
947
947
  {
@@ -952,7 +952,7 @@ const select$l = function EinsteinLlmGenerationsContentQualityRepresentationSele
952
952
  ]
953
953
  };
954
954
  };
955
- function equals$g(existing, incoming) {
955
+ function equals$h(existing, incoming) {
956
956
  const existing_isToxicityDetected = existing.isToxicityDetected;
957
957
  const incoming_isToxicityDetected = incoming.isToxicityDetected;
958
958
  // if at least one of these optionals is defined
@@ -969,8 +969,8 @@ function equals$g(existing, incoming) {
969
969
  return true;
970
970
  }
971
971
 
972
- const VERSION$f = "77af44a252cb5b45b4d9a8101368d2aa";
973
- function validate$i(obj, path = 'EinsteinLlmGenerationsSafetyScoreRepresentation') {
972
+ const VERSION$g = "77af44a252cb5b45b4d9a8101368d2aa";
973
+ function validate$j(obj, path = 'EinsteinLlmGenerationsSafetyScoreRepresentation') {
974
974
  const v_error = (() => {
975
975
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
976
976
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -1174,10 +1174,10 @@ function validate$i(obj, path = 'EinsteinLlmGenerationsSafetyScoreRepresentation
1174
1174
  })();
1175
1175
  return v_error === undefined ? null : v_error;
1176
1176
  }
1177
- const select$k = function EinsteinLlmGenerationsSafetyScoreRepresentationSelect() {
1177
+ const select$o = function EinsteinLlmGenerationsSafetyScoreRepresentationSelect() {
1178
1178
  return {
1179
1179
  kind: 'Fragment',
1180
- version: VERSION$f,
1180
+ version: VERSION$g,
1181
1181
  private: [],
1182
1182
  selections: [
1183
1183
  {
@@ -1218,7 +1218,7 @@ const select$k = function EinsteinLlmGenerationsSafetyScoreRepresentationSelect(
1218
1218
  ]
1219
1219
  };
1220
1220
  };
1221
- function equals$f(existing, incoming) {
1221
+ function equals$g(existing, incoming) {
1222
1222
  const existing_hateScore = existing.hateScore;
1223
1223
  const incoming_hateScore = incoming.hateScore;
1224
1224
  // if at least one of these optionals is defined
@@ -1313,8 +1313,8 @@ function equals$f(existing, incoming) {
1313
1313
  return true;
1314
1314
  }
1315
1315
 
1316
- const VERSION$e = "4a07778ff6c595d91c575188146647a1";
1317
- function validate$h(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
1316
+ const VERSION$f = "4a07778ff6c595d91c575188146647a1";
1317
+ function validate$i(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
1318
1318
  const v_error = (() => {
1319
1319
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1320
1320
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -1324,7 +1324,7 @@ function validate$h(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
1324
1324
  const path_contentQualityRepresentation = path + '.contentQualityRepresentation';
1325
1325
  let obj_contentQualityRepresentation_union0 = null;
1326
1326
  const obj_contentQualityRepresentation_union0_error = (() => {
1327
- const referencepath_contentQualityRepresentationValidationError = validate$j(obj_contentQualityRepresentation, path_contentQualityRepresentation);
1327
+ const referencepath_contentQualityRepresentationValidationError = validate$k(obj_contentQualityRepresentation, path_contentQualityRepresentation);
1328
1328
  if (referencepath_contentQualityRepresentationValidationError !== null) {
1329
1329
  let message = 'Object doesn\'t match EinsteinLlmGenerationsContentQualityRepresentation (at "' + path_contentQualityRepresentation + '")\n';
1330
1330
  message += referencepath_contentQualityRepresentationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -1372,7 +1372,7 @@ function validate$h(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
1372
1372
  const path_safetyScoreRepresentation = path + '.safetyScoreRepresentation';
1373
1373
  let obj_safetyScoreRepresentation_union0 = null;
1374
1374
  const obj_safetyScoreRepresentation_union0_error = (() => {
1375
- const referencepath_safetyScoreRepresentationValidationError = validate$i(obj_safetyScoreRepresentation, path_safetyScoreRepresentation);
1375
+ const referencepath_safetyScoreRepresentationValidationError = validate$j(obj_safetyScoreRepresentation, path_safetyScoreRepresentation);
1376
1376
  if (referencepath_safetyScoreRepresentationValidationError !== null) {
1377
1377
  let message = 'Object doesn\'t match EinsteinLlmGenerationsSafetyScoreRepresentation (at "' + path_safetyScoreRepresentation + '")\n';
1378
1378
  message += referencepath_safetyScoreRepresentationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -1406,12 +1406,12 @@ function validate$h(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
1406
1406
  })();
1407
1407
  return v_error === undefined ? null : v_error;
1408
1408
  }
1409
- const select$j = function EinsteinLlmGenerationItemRepresentationSelect() {
1410
- const { selections: EinsteinLlmGenerationsContentQualityRepresentation__selections, opaque: EinsteinLlmGenerationsContentQualityRepresentation__opaque, } = select$l();
1411
- const { selections: EinsteinLlmGenerationsSafetyScoreRepresentation__selections, opaque: EinsteinLlmGenerationsSafetyScoreRepresentation__opaque, } = select$k();
1409
+ const select$n = function EinsteinLlmGenerationItemRepresentationSelect() {
1410
+ const { selections: EinsteinLlmGenerationsContentQualityRepresentation__selections, opaque: EinsteinLlmGenerationsContentQualityRepresentation__opaque, } = select$p();
1411
+ const { selections: EinsteinLlmGenerationsSafetyScoreRepresentation__selections, opaque: EinsteinLlmGenerationsSafetyScoreRepresentation__opaque, } = select$o();
1412
1412
  return {
1413
1413
  kind: 'Fragment',
1414
- version: VERSION$e,
1414
+ version: VERSION$f,
1415
1415
  private: [],
1416
1416
  selections: [
1417
1417
  {
@@ -1448,7 +1448,7 @@ const select$j = function EinsteinLlmGenerationItemRepresentationSelect() {
1448
1448
  ]
1449
1449
  };
1450
1450
  };
1451
- function equals$e(existing, incoming) {
1451
+ function equals$f(existing, incoming) {
1452
1452
  const existing_isSummarized = existing.isSummarized;
1453
1453
  const incoming_isSummarized = incoming.isSummarized;
1454
1454
  // if at least one of these optionals is defined
@@ -1489,7 +1489,7 @@ function equals$e(existing, incoming) {
1489
1489
  if (!(existing_contentQualityRepresentation === incoming_contentQualityRepresentation
1490
1490
  || (existing_contentQualityRepresentation != null &&
1491
1491
  incoming_contentQualityRepresentation != null &&
1492
- equals$g(existing_contentQualityRepresentation, incoming_contentQualityRepresentation)))) {
1492
+ equals$h(existing_contentQualityRepresentation, incoming_contentQualityRepresentation)))) {
1493
1493
  return false;
1494
1494
  }
1495
1495
  }
@@ -1505,15 +1505,15 @@ function equals$e(existing, incoming) {
1505
1505
  if (!(existing_safetyScoreRepresentation === incoming_safetyScoreRepresentation
1506
1506
  || (existing_safetyScoreRepresentation != null &&
1507
1507
  incoming_safetyScoreRepresentation != null &&
1508
- equals$f(existing_safetyScoreRepresentation, incoming_safetyScoreRepresentation)))) {
1508
+ equals$g(existing_safetyScoreRepresentation, incoming_safetyScoreRepresentation)))) {
1509
1509
  return false;
1510
1510
  }
1511
1511
  }
1512
1512
  return true;
1513
1513
  }
1514
1514
 
1515
- const VERSION$d = "4656c961c9d093a9e206c1db7d4de0b0";
1516
- function validate$g(obj, path = 'WrappedMap') {
1515
+ const VERSION$e = "4656c961c9d093a9e206c1db7d4de0b0";
1516
+ function validate$h(obj, path = 'WrappedMap') {
1517
1517
  const v_error = (() => {
1518
1518
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1519
1519
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -1535,15 +1535,15 @@ function validate$g(obj, path = 'WrappedMap') {
1535
1535
  })();
1536
1536
  return v_error === undefined ? null : v_error;
1537
1537
  }
1538
- const select$i = function WrappedMapSelect() {
1538
+ const select$m = function WrappedMapSelect() {
1539
1539
  return {
1540
1540
  kind: 'Fragment',
1541
- version: VERSION$d,
1541
+ version: VERSION$e,
1542
1542
  private: [],
1543
1543
  selections: []
1544
1544
  };
1545
1545
  };
1546
- function equals$d(existing, incoming) {
1546
+ function equals$e(existing, incoming) {
1547
1547
  const existing_wrappedMap = existing.wrappedMap;
1548
1548
  const incoming_wrappedMap = incoming.wrappedMap;
1549
1549
  const equals_wrappedMap_props = equalsObject(existing_wrappedMap, incoming_wrappedMap, (existing_wrappedMap_prop, incoming_wrappedMap_prop) => {
@@ -1554,9 +1554,9 @@ function equals$d(existing, incoming) {
1554
1554
  return true;
1555
1555
  }
1556
1556
 
1557
- const TTL$4 = 100;
1558
- const VERSION$c = "d8abd72a42e842b253da1c38954dafbc";
1559
- function validate$f(obj, path = 'EinsteinLlmGenerationsRepresentation') {
1557
+ const TTL$5 = 100;
1558
+ const VERSION$d = "d8abd72a42e842b253da1c38954dafbc";
1559
+ function validate$g(obj, path = 'EinsteinLlmGenerationsRepresentation') {
1560
1560
  const v_error = (() => {
1561
1561
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1562
1562
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -1569,7 +1569,7 @@ function validate$f(obj, path = 'EinsteinLlmGenerationsRepresentation') {
1569
1569
  for (let i = 0; i < obj_generations.length; i++) {
1570
1570
  const obj_generations_item = obj_generations[i];
1571
1571
  const path_generations_item = path_generations + '[' + i + ']';
1572
- const referencepath_generations_itemValidationError = validate$h(obj_generations_item, path_generations_item);
1572
+ const referencepath_generations_itemValidationError = validate$i(obj_generations_item, path_generations_item);
1573
1573
  if (referencepath_generations_itemValidationError !== null) {
1574
1574
  let message = 'Object doesn\'t match EinsteinLlmGenerationItemRepresentation (at "' + path_generations_item + '")\n';
1575
1575
  message += referencepath_generations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -1580,7 +1580,7 @@ function validate$f(obj, path = 'EinsteinLlmGenerationsRepresentation') {
1580
1580
  const path_parameters = path + '.parameters';
1581
1581
  let obj_parameters_union0 = null;
1582
1582
  const obj_parameters_union0_error = (() => {
1583
- const referencepath_parametersValidationError = validate$g(obj_parameters, path_parameters);
1583
+ const referencepath_parametersValidationError = validate$h(obj_parameters, path_parameters);
1584
1584
  if (referencepath_parametersValidationError !== null) {
1585
1585
  let message = 'Object doesn\'t match WrappedMap (at "' + path_parameters + '")\n';
1586
1586
  message += referencepath_parametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -1639,25 +1639,25 @@ function validate$f(obj, path = 'EinsteinLlmGenerationsRepresentation') {
1639
1639
  })();
1640
1640
  return v_error === undefined ? null : v_error;
1641
1641
  }
1642
- const RepresentationType$4 = 'EinsteinLlmGenerationsRepresentation';
1643
- function keyBuilder$7(luvio, config) {
1644
- return keyPrefix + '::' + RepresentationType$4 + ':' + config.requestId;
1642
+ const RepresentationType$5 = 'EinsteinLlmGenerationsRepresentation';
1643
+ function keyBuilder$8(luvio, config) {
1644
+ return keyPrefix + '::' + RepresentationType$5 + ':' + config.requestId;
1645
1645
  }
1646
- function keyBuilderFromType$1(luvio, object) {
1646
+ function keyBuilderFromType$2(luvio, object) {
1647
1647
  const keyParams = {
1648
1648
  requestId: object.requestId
1649
1649
  };
1650
- return keyBuilder$7(luvio, keyParams);
1650
+ return keyBuilder$8(luvio, keyParams);
1651
1651
  }
1652
- function normalize$4(input, existing, path, luvio, store, timestamp) {
1652
+ function normalize$5(input, existing, path, luvio, store, timestamp) {
1653
1653
  return input;
1654
1654
  }
1655
- const select$h = function EinsteinLlmGenerationsRepresentationSelect() {
1656
- const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$j();
1657
- const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$i();
1655
+ const select$l = function EinsteinLlmGenerationsRepresentationSelect() {
1656
+ const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$n();
1657
+ const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$m();
1658
1658
  return {
1659
1659
  kind: 'Fragment',
1660
- version: VERSION$c,
1660
+ version: VERSION$d,
1661
1661
  private: [],
1662
1662
  selections: [
1663
1663
  {
@@ -1683,7 +1683,7 @@ const select$h = function EinsteinLlmGenerationsRepresentationSelect() {
1683
1683
  ]
1684
1684
  };
1685
1685
  };
1686
- function equals$c(existing, incoming) {
1686
+ function equals$d(existing, incoming) {
1687
1687
  const existing_requestId = existing.requestId;
1688
1688
  const incoming_requestId = incoming.requestId;
1689
1689
  if (!(existing_requestId === incoming_requestId)) {
@@ -1692,7 +1692,7 @@ function equals$c(existing, incoming) {
1692
1692
  const existing_generations = existing.generations;
1693
1693
  const incoming_generations = incoming.generations;
1694
1694
  const equals_generations_items = equalsArray(existing_generations, incoming_generations, (existing_generations_item, incoming_generations_item) => {
1695
- if (!(equals$e(existing_generations_item, incoming_generations_item))) {
1695
+ if (!(equals$f(existing_generations_item, incoming_generations_item))) {
1696
1696
  return false;
1697
1697
  }
1698
1698
  });
@@ -1704,7 +1704,7 @@ function equals$c(existing, incoming) {
1704
1704
  if (!(existing_parameters === incoming_parameters
1705
1705
  || (existing_parameters != null &&
1706
1706
  incoming_parameters != null &&
1707
- equals$d(existing_parameters, incoming_parameters)))) {
1707
+ equals$e(existing_parameters, incoming_parameters)))) {
1708
1708
  return false;
1709
1709
  }
1710
1710
  const existing_prompt = existing.prompt;
@@ -1714,41 +1714,41 @@ function equals$c(existing, incoming) {
1714
1714
  }
1715
1715
  return true;
1716
1716
  }
1717
- const ingest$4 = function EinsteinLlmGenerationsRepresentationIngest(input, path, luvio, store, timestamp) {
1717
+ const ingest$5 = function EinsteinLlmGenerationsRepresentationIngest(input, path, luvio, store, timestamp) {
1718
1718
  if (process.env.NODE_ENV !== 'production') {
1719
- const validateError = validate$f(input);
1719
+ const validateError = validate$g(input);
1720
1720
  if (validateError !== null) {
1721
1721
  throw validateError;
1722
1722
  }
1723
1723
  }
1724
- const key = keyBuilderFromType$1(luvio, input);
1725
- const ttlToUse = TTL$4;
1726
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "EinsteinLLM", VERSION$c, RepresentationType$4, equals$c);
1724
+ const key = keyBuilderFromType$2(luvio, input);
1725
+ const ttlToUse = TTL$5;
1726
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "EinsteinLLM", VERSION$d, RepresentationType$5, equals$d);
1727
1727
  return createLink(key);
1728
1728
  };
1729
- function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
1729
+ function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
1730
1730
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1731
- const rootKey = keyBuilderFromType$1(luvio, input);
1731
+ const rootKey = keyBuilderFromType$2(luvio, input);
1732
1732
  rootKeySet.set(rootKey, {
1733
1733
  namespace: keyPrefix,
1734
- representationName: RepresentationType$4,
1734
+ representationName: RepresentationType$5,
1735
1735
  mergeable: false
1736
1736
  });
1737
1737
  }
1738
1738
 
1739
- function select$g(luvio, params) {
1740
- return select$h();
1739
+ function select$k(luvio, params) {
1740
+ return select$l();
1741
1741
  }
1742
- function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
1743
- getTypeCacheKeys$4(storeKeyMap, luvio, response);
1742
+ function getResponseCacheKeys$7(storeKeyMap, luvio, resourceParams, response) {
1743
+ getTypeCacheKeys$5(storeKeyMap, luvio, response);
1744
1744
  }
1745
- function ingestSuccess$4(luvio, resourceParams, response) {
1745
+ function ingestSuccess$7(luvio, resourceParams, response) {
1746
1746
  const { body } = response;
1747
- const key = keyBuilderFromType$1(luvio, body);
1748
- luvio.storeIngest(key, ingest$4, body);
1747
+ const key = keyBuilderFromType$2(luvio, body);
1748
+ luvio.storeIngest(key, ingest$5, body);
1749
1749
  const snapshot = luvio.storeLookup({
1750
1750
  recordId: key,
1751
- node: select$g(),
1751
+ node: select$k(),
1752
1752
  variables: {},
1753
1753
  });
1754
1754
  if (process.env.NODE_ENV !== 'production') {
@@ -1759,7 +1759,7 @@ function ingestSuccess$4(luvio, resourceParams, response) {
1759
1759
  deepFreeze(snapshot.data);
1760
1760
  return snapshot;
1761
1761
  }
1762
- function createResourceRequest$4(config) {
1762
+ function createResourceRequest$7(config) {
1763
1763
  const headers = {};
1764
1764
  return {
1765
1765
  baseUri: '/services/data/v65.0',
@@ -1773,45 +1773,45 @@ function createResourceRequest$4(config) {
1773
1773
  };
1774
1774
  }
1775
1775
 
1776
- const adapterName$4 = 'createGenerations';
1776
+ const adapterName$7 = 'createGenerations';
1777
1777
  const createGenerations_ConfigPropertyMetadata = [
1778
1778
  generateParamConfigMetadata('generationsInput', true, 2 /* Body */, 4 /* Unsupported */),
1779
1779
  ];
1780
- const createGenerations_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, createGenerations_ConfigPropertyMetadata);
1781
- const createResourceParams$4 = /*#__PURE__*/ createResourceParams$7(createGenerations_ConfigPropertyMetadata);
1782
- function typeCheckConfig$4(untrustedConfig) {
1780
+ const createGenerations_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$7, createGenerations_ConfigPropertyMetadata);
1781
+ const createResourceParams$7 = /*#__PURE__*/ createResourceParams$a(createGenerations_ConfigPropertyMetadata);
1782
+ function typeCheckConfig$7(untrustedConfig) {
1783
1783
  const config = {};
1784
1784
  const untrustedConfig_generationsInput = untrustedConfig.generationsInput;
1785
- const referenceEinsteinLlmGenerationsInputRepresentationValidationError = validate$k(untrustedConfig_generationsInput);
1785
+ const referenceEinsteinLlmGenerationsInputRepresentationValidationError = validate$l(untrustedConfig_generationsInput);
1786
1786
  if (referenceEinsteinLlmGenerationsInputRepresentationValidationError === null) {
1787
1787
  config.generationsInput = untrustedConfig_generationsInput;
1788
1788
  }
1789
1789
  return config;
1790
1790
  }
1791
- function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
1791
+ function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
1792
1792
  if (!untrustedIsObject(untrustedConfig)) {
1793
1793
  return null;
1794
1794
  }
1795
1795
  if (process.env.NODE_ENV !== 'production') {
1796
1796
  validateConfig(untrustedConfig, configPropertyNames);
1797
1797
  }
1798
- const config = typeCheckConfig$4(untrustedConfig);
1798
+ const config = typeCheckConfig$7(untrustedConfig);
1799
1799
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
1800
1800
  return null;
1801
1801
  }
1802
1802
  return config;
1803
1803
  }
1804
- function buildNetworkSnapshot$4(luvio, config, options) {
1805
- const resourceParams = createResourceParams$4(config);
1806
- const request = createResourceRequest$4(resourceParams);
1804
+ function buildNetworkSnapshot$7(luvio, config, options) {
1805
+ const resourceParams = createResourceParams$7(config);
1806
+ const request = createResourceRequest$7(resourceParams);
1807
1807
  return luvio.dispatchResourceRequest(request, options)
1808
1808
  .then((response) => {
1809
1809
  return luvio.handleSuccessResponse(() => {
1810
- const snapshot = ingestSuccess$4(luvio, resourceParams, response);
1810
+ const snapshot = ingestSuccess$7(luvio, resourceParams, response);
1811
1811
  return luvio.storeBroadcast().then(() => snapshot);
1812
1812
  }, () => {
1813
1813
  const cache = new StoreKeyMap();
1814
- getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
1814
+ getResponseCacheKeys$7(cache, luvio, resourceParams, response.body);
1815
1815
  return cache;
1816
1816
  });
1817
1817
  }, (response) => {
@@ -1821,16 +1821,16 @@ function buildNetworkSnapshot$4(luvio, config, options) {
1821
1821
  }
1822
1822
  const createGenerationsAdapterFactory = (luvio) => {
1823
1823
  return function createGenerations(untrustedConfig) {
1824
- const config = validateAdapterConfig$4(untrustedConfig, createGenerations_ConfigPropertyNames);
1824
+ const config = validateAdapterConfig$7(untrustedConfig, createGenerations_ConfigPropertyNames);
1825
1825
  // Invalid or incomplete config
1826
1826
  if (config === null) {
1827
1827
  throw new Error('Invalid config for "createGenerations"');
1828
1828
  }
1829
- return buildNetworkSnapshot$4(luvio, config);
1829
+ return buildNetworkSnapshot$7(luvio, config);
1830
1830
  };
1831
1831
  };
1832
1832
 
1833
- function validate$e(obj, path = 'EinsteinPromptRecordFieldRepresentation') {
1833
+ function validate$f(obj, path = 'EinsteinPromptRecordFieldRepresentation') {
1834
1834
  const v_error = (() => {
1835
1835
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1836
1836
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -1890,9 +1890,9 @@ function validate$e(obj, path = 'EinsteinPromptRecordFieldRepresentation') {
1890
1890
  return v_error === undefined ? null : v_error;
1891
1891
  }
1892
1892
 
1893
- const TTL$3 = 100;
1894
- const VERSION$b = "2d1628544b54fc1701aa9b4eff05127b";
1895
- function validate$d(obj, path = 'EinsteinPromptRecordRepresentation') {
1893
+ const TTL$4 = 100;
1894
+ const VERSION$c = "2d1628544b54fc1701aa9b4eff05127b";
1895
+ function validate$e(obj, path = 'EinsteinPromptRecordRepresentation') {
1896
1896
  const v_error = (() => {
1897
1897
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1898
1898
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -1921,7 +1921,7 @@ function validate$d(obj, path = 'EinsteinPromptRecordRepresentation') {
1921
1921
  for (let i = 0; i < obj_childRelationships_prop.length; i++) {
1922
1922
  const obj_childRelationships_prop_item = obj_childRelationships_prop[i];
1923
1923
  const path_childRelationships_prop_item = path_childRelationships_prop + '[' + i + ']';
1924
- const referencepath_childRelationships_prop_itemValidationError = validate$d(obj_childRelationships_prop_item, path_childRelationships_prop_item);
1924
+ const referencepath_childRelationships_prop_itemValidationError = validate$e(obj_childRelationships_prop_item, path_childRelationships_prop_item);
1925
1925
  if (referencepath_childRelationships_prop_itemValidationError !== null) {
1926
1926
  let message = 'Object doesn\'t match EinsteinPromptRecordRepresentation (at "' + path_childRelationships_prop_item + '")\n';
1927
1927
  message += referencepath_childRelationships_prop_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -1941,7 +1941,7 @@ function validate$d(obj, path = 'EinsteinPromptRecordRepresentation') {
1941
1941
  const key = obj_fields_keys[i];
1942
1942
  const obj_fields_prop = obj_fields[key];
1943
1943
  const path_fields_prop = path_fields + '["' + key + '"]';
1944
- const referencepath_fields_propValidationError = validate$e(obj_fields_prop, path_fields_prop);
1944
+ const referencepath_fields_propValidationError = validate$f(obj_fields_prop, path_fields_prop);
1945
1945
  if (referencepath_fields_propValidationError !== null) {
1946
1946
  let message = 'Object doesn\'t match EinsteinPromptRecordFieldRepresentation (at "' + path_fields_prop + '")\n';
1947
1947
  message += referencepath_fields_propValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -1959,49 +1959,49 @@ function validate$d(obj, path = 'EinsteinPromptRecordRepresentation') {
1959
1959
  })();
1960
1960
  return v_error === undefined ? null : v_error;
1961
1961
  }
1962
- const RepresentationType$3 = 'EinsteinPromptRecordRepresentation';
1963
- function normalize$3(input, existing, path, luvio, store, timestamp) {
1962
+ const RepresentationType$4 = 'EinsteinPromptRecordRepresentation';
1963
+ function normalize$4(input, existing, path, luvio, store, timestamp) {
1964
1964
  return input;
1965
1965
  }
1966
- const select$f = function EinsteinPromptRecordRepresentationSelect() {
1966
+ const select$j = function EinsteinPromptRecordRepresentationSelect() {
1967
1967
  return {
1968
1968
  kind: 'Fragment',
1969
- version: VERSION$b,
1969
+ version: VERSION$c,
1970
1970
  private: [],
1971
1971
  opaque: true
1972
1972
  };
1973
1973
  };
1974
- function equals$b(existing, incoming) {
1974
+ function equals$c(existing, incoming) {
1975
1975
  if (JSONStringify(incoming) !== JSONStringify(existing)) {
1976
1976
  return false;
1977
1977
  }
1978
1978
  return true;
1979
1979
  }
1980
- const ingest$3 = function EinsteinPromptRecordRepresentationIngest(input, path, luvio, store, timestamp) {
1980
+ const ingest$4 = function EinsteinPromptRecordRepresentationIngest(input, path, luvio, store, timestamp) {
1981
1981
  if (process.env.NODE_ENV !== 'production') {
1982
- const validateError = validate$d(input);
1982
+ const validateError = validate$e(input);
1983
1983
  if (validateError !== null) {
1984
1984
  throw validateError;
1985
1985
  }
1986
1986
  }
1987
1987
  const key = path.fullPath;
1988
- const ttlToUse = TTL$3;
1989
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "EinsteinLLM", VERSION$b, RepresentationType$3, equals$b);
1988
+ const ttlToUse = TTL$4;
1989
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "EinsteinLLM", VERSION$c, RepresentationType$4, equals$c);
1990
1990
  return createLink(key);
1991
1991
  };
1992
- function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
1992
+ function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
1993
1993
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1994
1994
  const rootKey = fullPathFactory();
1995
1995
  rootKeySet.set(rootKey, {
1996
1996
  namespace: keyPrefix,
1997
- representationName: RepresentationType$3,
1997
+ representationName: RepresentationType$4,
1998
1998
  mergeable: false
1999
1999
  });
2000
2000
  }
2001
2001
 
2002
- const TTL$2 = 100;
2003
- const VERSION$a = "5fd7b8a03d155ba601bcb4ee725e0893";
2004
- function validate$c(obj, path = 'EinsteinPromptRecordCollectionOutputRepresentation') {
2002
+ const TTL$3 = 100;
2003
+ const VERSION$b = "5fd7b8a03d155ba601bcb4ee725e0893";
2004
+ function validate$d(obj, path = 'EinsteinPromptRecordCollectionOutputRepresentation') {
2005
2005
  const v_error = (() => {
2006
2006
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2007
2007
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -2020,7 +2020,7 @@ function validate$c(obj, path = 'EinsteinPromptRecordCollectionOutputRepresentat
2020
2020
  for (let i = 0; i < obj_promptRecords.length; i++) {
2021
2021
  const obj_promptRecords_item = obj_promptRecords[i];
2022
2022
  const path_promptRecords_item = path_promptRecords + '[' + i + ']';
2023
- const referencepath_promptRecords_itemValidationError = validate$d(obj_promptRecords_item, path_promptRecords_item);
2023
+ const referencepath_promptRecords_itemValidationError = validate$e(obj_promptRecords_item, path_promptRecords_item);
2024
2024
  if (referencepath_promptRecords_itemValidationError !== null) {
2025
2025
  let message = 'Object doesn\'t match EinsteinPromptRecordRepresentation (at "' + path_promptRecords_item + '")\n';
2026
2026
  message += referencepath_promptRecords_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -2036,62 +2036,62 @@ function validate$c(obj, path = 'EinsteinPromptRecordCollectionOutputRepresentat
2036
2036
  })();
2037
2037
  return v_error === undefined ? null : v_error;
2038
2038
  }
2039
- const RepresentationType$2 = 'EinsteinPromptRecordCollectionOutputRepresentation';
2040
- function normalize$2(input, existing, path, luvio, store, timestamp) {
2039
+ const RepresentationType$3 = 'EinsteinPromptRecordCollectionOutputRepresentation';
2040
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
2041
2041
  return input;
2042
2042
  }
2043
- const select$e = function EinsteinPromptRecordCollectionOutputRepresentationSelect() {
2043
+ const select$i = function EinsteinPromptRecordCollectionOutputRepresentationSelect() {
2044
2044
  return {
2045
2045
  kind: 'Fragment',
2046
- version: VERSION$a,
2046
+ version: VERSION$b,
2047
2047
  private: [],
2048
2048
  opaque: true
2049
2049
  };
2050
2050
  };
2051
- function equals$a(existing, incoming) {
2051
+ function equals$b(existing, incoming) {
2052
2052
  if (JSONStringify(incoming) !== JSONStringify(existing)) {
2053
2053
  return false;
2054
2054
  }
2055
2055
  return true;
2056
2056
  }
2057
- const ingest$2 = function EinsteinPromptRecordCollectionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
2057
+ const ingest$3 = function EinsteinPromptRecordCollectionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
2058
2058
  if (process.env.NODE_ENV !== 'production') {
2059
- const validateError = validate$c(input);
2059
+ const validateError = validate$d(input);
2060
2060
  if (validateError !== null) {
2061
2061
  throw validateError;
2062
2062
  }
2063
2063
  }
2064
2064
  const key = path.fullPath;
2065
- const ttlToUse = TTL$2;
2066
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "EinsteinLLM", VERSION$a, RepresentationType$2, equals$a);
2065
+ const ttlToUse = TTL$3;
2066
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "EinsteinLLM", VERSION$b, RepresentationType$3, equals$b);
2067
2067
  return createLink(key);
2068
2068
  };
2069
- function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
2069
+ function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
2070
2070
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2071
2071
  const rootKey = fullPathFactory();
2072
2072
  rootKeySet.set(rootKey, {
2073
2073
  namespace: keyPrefix,
2074
- representationName: RepresentationType$2,
2074
+ representationName: RepresentationType$3,
2075
2075
  mergeable: false
2076
2076
  });
2077
2077
  }
2078
2078
 
2079
- function select$d(luvio, params) {
2080
- return select$e();
2079
+ function select$h(luvio, params) {
2080
+ return select$i();
2081
2081
  }
2082
- function keyBuilder$6(luvio, params) {
2082
+ function keyBuilder$7(luvio, params) {
2083
2083
  return keyPrefix + '::EinsteinPromptRecordCollectionOutputRepresentation:(' + 'isActive:' + params.queryParams.isActive + ',' + 'fields:' + params.queryParams.fields + ',' + 'relatedEntity:' + params.queryParams.relatedEntity + ',' + 'offset:' + params.queryParams.offset + ',' + 'pageLimit:' + params.queryParams.pageLimit + ',' + 'type:' + params.queryParams.type + ',' + 'query:' + params.queryParams.query + ',' + 'sortBy:' + params.queryParams.sortBy + ')';
2084
2084
  }
2085
- function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
2086
- getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$6(luvio, resourceParams));
2085
+ function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
2086
+ getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$7(luvio, resourceParams));
2087
2087
  }
2088
- function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
2088
+ function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
2089
2089
  const { body } = response;
2090
- const key = keyBuilder$6(luvio, resourceParams);
2091
- luvio.storeIngest(key, ingest$2, body);
2090
+ const key = keyBuilder$7(luvio, resourceParams);
2091
+ luvio.storeIngest(key, ingest$3, body);
2092
2092
  const snapshot = luvio.storeLookup({
2093
2093
  recordId: key,
2094
- node: select$d(),
2094
+ node: select$h(),
2095
2095
  variables: {},
2096
2096
  }, snapshotRefresh);
2097
2097
  if (process.env.NODE_ENV !== 'production') {
@@ -2103,18 +2103,18 @@ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
2103
2103
  return snapshot;
2104
2104
  }
2105
2105
  function ingestError$2(luvio, params, error, snapshotRefresh) {
2106
- const key = keyBuilder$6(luvio, params);
2106
+ const key = keyBuilder$7(luvio, params);
2107
2107
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2108
2108
  const storeMetadataParams = {
2109
- ttl: TTL$2,
2109
+ ttl: TTL$3,
2110
2110
  namespace: keyPrefix,
2111
- version: VERSION$a,
2112
- representationName: RepresentationType$2
2111
+ version: VERSION$b,
2112
+ representationName: RepresentationType$3
2113
2113
  };
2114
2114
  luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
2115
2115
  return errorSnapshot;
2116
2116
  }
2117
- function createResourceRequest$3(config) {
2117
+ function createResourceRequest$6(config) {
2118
2118
  const headers = {};
2119
2119
  return {
2120
2120
  baseUri: '/services/data/v65.0',
@@ -2128,7 +2128,7 @@ function createResourceRequest$3(config) {
2128
2128
  };
2129
2129
  }
2130
2130
 
2131
- const adapterName$3 = 'getPromptTemplates';
2131
+ const adapterName$6 = 'getPromptTemplates';
2132
2132
  const getPromptTemplates_ConfigPropertyMetadata = [
2133
2133
  generateParamConfigMetadata('isActive', false, 1 /* QueryParameter */, 1 /* Boolean */),
2134
2134
  generateParamConfigMetadata('fields', false, 1 /* QueryParameter */, 0 /* String */, true),
@@ -2139,56 +2139,56 @@ const getPromptTemplates_ConfigPropertyMetadata = [
2139
2139
  generateParamConfigMetadata('query', false, 1 /* QueryParameter */, 0 /* String */),
2140
2140
  generateParamConfigMetadata('sortBy', false, 1 /* QueryParameter */, 0 /* String */),
2141
2141
  ];
2142
- const getPromptTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getPromptTemplates_ConfigPropertyMetadata);
2143
- const createResourceParams$3 = /*#__PURE__*/ createResourceParams$7(getPromptTemplates_ConfigPropertyMetadata);
2144
- function keyBuilder$5(luvio, config) {
2145
- const resourceParams = createResourceParams$3(config);
2146
- return keyBuilder$6(luvio, resourceParams);
2142
+ const getPromptTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, getPromptTemplates_ConfigPropertyMetadata);
2143
+ const createResourceParams$6 = /*#__PURE__*/ createResourceParams$a(getPromptTemplates_ConfigPropertyMetadata);
2144
+ function keyBuilder$6(luvio, config) {
2145
+ const resourceParams = createResourceParams$6(config);
2146
+ return keyBuilder$7(luvio, resourceParams);
2147
2147
  }
2148
- function typeCheckConfig$3(untrustedConfig) {
2148
+ function typeCheckConfig$6(untrustedConfig) {
2149
2149
  const config = {};
2150
- typeCheckConfig$7(untrustedConfig, config, getPromptTemplates_ConfigPropertyMetadata);
2150
+ typeCheckConfig$a(untrustedConfig, config, getPromptTemplates_ConfigPropertyMetadata);
2151
2151
  return config;
2152
2152
  }
2153
- function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
2153
+ function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
2154
2154
  if (!untrustedIsObject(untrustedConfig)) {
2155
2155
  return null;
2156
2156
  }
2157
2157
  if (process.env.NODE_ENV !== 'production') {
2158
2158
  validateConfig(untrustedConfig, configPropertyNames);
2159
2159
  }
2160
- const config = typeCheckConfig$3(untrustedConfig);
2160
+ const config = typeCheckConfig$6(untrustedConfig);
2161
2161
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
2162
2162
  return null;
2163
2163
  }
2164
2164
  return config;
2165
2165
  }
2166
2166
  function adapterFragment$2(luvio, config) {
2167
- createResourceParams$3(config);
2168
- return select$d();
2167
+ createResourceParams$6(config);
2168
+ return select$h();
2169
2169
  }
2170
2170
  function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
2171
- const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
2171
+ const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
2172
2172
  config,
2173
- resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
2173
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
2174
2174
  });
2175
2175
  return luvio.storeBroadcast().then(() => snapshot);
2176
2176
  }
2177
2177
  function onFetchResponseError$2(luvio, config, resourceParams, response) {
2178
2178
  const snapshot = ingestError$2(luvio, resourceParams, response, {
2179
2179
  config,
2180
- resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
2180
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
2181
2181
  });
2182
2182
  return luvio.storeBroadcast().then(() => snapshot);
2183
2183
  }
2184
- function buildNetworkSnapshot$3(luvio, config, options) {
2185
- const resourceParams = createResourceParams$3(config);
2186
- const request = createResourceRequest$3(resourceParams);
2184
+ function buildNetworkSnapshot$6(luvio, config, options) {
2185
+ const resourceParams = createResourceParams$6(config);
2186
+ const request = createResourceRequest$6(resourceParams);
2187
2187
  return luvio.dispatchResourceRequest(request, options)
2188
2188
  .then((response) => {
2189
2189
  return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
2190
2190
  const cache = new StoreKeyMap();
2191
- getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
2191
+ getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
2192
2192
  return cache;
2193
2193
  });
2194
2194
  }, (response) => {
@@ -2196,23 +2196,23 @@ function buildNetworkSnapshot$3(luvio, config, options) {
2196
2196
  });
2197
2197
  }
2198
2198
  function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
2199
- return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
2199
+ return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, undefined, false);
2200
2200
  }
2201
2201
  function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
2202
2202
  const { luvio, config } = context;
2203
2203
  const selector = {
2204
- recordId: keyBuilder$5(luvio, config),
2204
+ recordId: keyBuilder$6(luvio, config),
2205
2205
  node: adapterFragment$2(luvio, config),
2206
2206
  variables: {},
2207
2207
  };
2208
2208
  const cacheSnapshot = storeLookup(selector, {
2209
2209
  config,
2210
- resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
2210
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
2211
2211
  });
2212
2212
  return cacheSnapshot;
2213
2213
  }
2214
2214
  const getPromptTemplatesAdapterFactory = (luvio) => function EinsteinLLM__getPromptTemplates(untrustedConfig, requestContext) {
2215
- const config = validateAdapterConfig$3(untrustedConfig, getPromptTemplates_ConfigPropertyNames);
2215
+ const config = validateAdapterConfig$6(untrustedConfig, getPromptTemplates_ConfigPropertyNames);
2216
2216
  // Invalid or incomplete config
2217
2217
  if (config === null) {
2218
2218
  return null;
@@ -2221,45 +2221,423 @@ const getPromptTemplatesAdapterFactory = (luvio) => function EinsteinLLM__getPro
2221
2221
  buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
2222
2222
  };
2223
2223
 
2224
- function select$c(luvio, params) {
2225
- return select$f();
2226
- }
2227
- function keyBuilder$4(luvio, params) {
2228
- return keyPrefix + '::EinsteinPromptRecordRepresentation:(' + 'versionId:' + params.queryParams.versionId + ',' + 'promptTemplateDevName:' + params.urlParams.promptTemplateDevName + ')';
2229
- }
2230
- function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
2231
- getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$4(luvio, resourceParams));
2232
- }
2233
- function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
2234
- const { body } = response;
2235
- const key = keyBuilder$4(luvio, resourceParams);
2236
- luvio.storeIngest(key, ingest$3, body);
2237
- const snapshot = luvio.storeLookup({
2238
- recordId: key,
2239
- node: select$c(),
2240
- variables: {},
2241
- }, snapshotRefresh);
2242
- if (process.env.NODE_ENV !== 'production') {
2243
- if (snapshot.state !== 'Fulfilled') {
2244
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2224
+ const TTL$2 = 100;
2225
+ const VERSION$a = "a90a51578e2fdd7a9741d310bed22b1d";
2226
+ function validate$c(obj, path = 'EinsteinPromptTemplateRepresentation') {
2227
+ const v_error = (() => {
2228
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2229
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2245
2230
  }
2246
- }
2247
- deepFreeze(snapshot.data);
2248
- return snapshot;
2231
+ if (obj.additionalData !== undefined) {
2232
+ const obj_additionalData = obj.additionalData;
2233
+ const path_additionalData = path + '.additionalData';
2234
+ const referencepath_additionalDataValidationError = validate$h(obj_additionalData, path_additionalData);
2235
+ if (referencepath_additionalDataValidationError !== null) {
2236
+ let message = 'Object doesn\'t match WrappedMap (at "' + path_additionalData + '")\n';
2237
+ message += referencepath_additionalDataValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2238
+ return new TypeError(message);
2239
+ }
2240
+ }
2241
+ const obj_errorMessages = obj.errorMessages;
2242
+ const path_errorMessages = path + '.errorMessages';
2243
+ if (!ArrayIsArray(obj_errorMessages)) {
2244
+ return new TypeError('Expected "array" but received "' + typeof obj_errorMessages + '" (at "' + path_errorMessages + '")');
2245
+ }
2246
+ for (let i = 0; i < obj_errorMessages.length; i++) {
2247
+ const obj_errorMessages_item = obj_errorMessages[i];
2248
+ const path_errorMessages_item = path_errorMessages + '[' + i + ']';
2249
+ if (typeof obj_errorMessages_item !== 'string') {
2250
+ return new TypeError('Expected "string" but received "' + typeof obj_errorMessages_item + '" (at "' + path_errorMessages_item + '")');
2251
+ }
2252
+ }
2253
+ const obj_hasWarning = obj.hasWarning;
2254
+ const path_hasWarning = path + '.hasWarning';
2255
+ if (typeof obj_hasWarning !== 'boolean') {
2256
+ return new TypeError('Expected "boolean" but received "' + typeof obj_hasWarning + '" (at "' + path_hasWarning + '")');
2257
+ }
2258
+ const obj_isSuccessful = obj.isSuccessful;
2259
+ const path_isSuccessful = path + '.isSuccessful';
2260
+ if (typeof obj_isSuccessful !== 'boolean') {
2261
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccessful + '" (at "' + path_isSuccessful + '")');
2262
+ }
2263
+ if (obj.statusCode !== undefined) {
2264
+ const obj_statusCode = obj.statusCode;
2265
+ const path_statusCode = path + '.statusCode';
2266
+ if (typeof obj_statusCode !== 'string') {
2267
+ return new TypeError('Expected "string" but received "' + typeof obj_statusCode + '" (at "' + path_statusCode + '")');
2268
+ }
2269
+ }
2270
+ const obj_templateId = obj.templateId;
2271
+ const path_templateId = path + '.templateId';
2272
+ if (typeof obj_templateId !== 'string') {
2273
+ return new TypeError('Expected "string" but received "' + typeof obj_templateId + '" (at "' + path_templateId + '")');
2274
+ }
2275
+ if (obj.templateType !== undefined) {
2276
+ const obj_templateType = obj.templateType;
2277
+ const path_templateType = path + '.templateType';
2278
+ if (typeof obj_templateType !== 'string') {
2279
+ return new TypeError('Expected "string" but received "' + typeof obj_templateType + '" (at "' + path_templateType + '")');
2280
+ }
2281
+ }
2282
+ const obj_versionId = obj.versionId;
2283
+ const path_versionId = path + '.versionId';
2284
+ if (typeof obj_versionId !== 'string') {
2285
+ return new TypeError('Expected "string" but received "' + typeof obj_versionId + '" (at "' + path_versionId + '")');
2286
+ }
2287
+ const obj_warningMessages = obj.warningMessages;
2288
+ const path_warningMessages = path + '.warningMessages';
2289
+ if (!ArrayIsArray(obj_warningMessages)) {
2290
+ return new TypeError('Expected "array" but received "' + typeof obj_warningMessages + '" (at "' + path_warningMessages + '")');
2291
+ }
2292
+ for (let i = 0; i < obj_warningMessages.length; i++) {
2293
+ const obj_warningMessages_item = obj_warningMessages[i];
2294
+ const path_warningMessages_item = path_warningMessages + '[' + i + ']';
2295
+ if (typeof obj_warningMessages_item !== 'string') {
2296
+ return new TypeError('Expected "string" but received "' + typeof obj_warningMessages_item + '" (at "' + path_warningMessages_item + '")');
2297
+ }
2298
+ }
2299
+ })();
2300
+ return v_error === undefined ? null : v_error;
2249
2301
  }
2250
- function ingestError$1(luvio, params, error, snapshotRefresh) {
2251
- const key = keyBuilder$4(luvio, params);
2252
- const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2253
- const storeMetadataParams = {
2254
- ttl: TTL$3,
2255
- namespace: keyPrefix,
2256
- version: VERSION$b,
2257
- representationName: RepresentationType$3
2302
+ const RepresentationType$2 = 'EinsteinPromptTemplateRepresentation';
2303
+ function keyBuilder$5(luvio, config) {
2304
+ return keyPrefix + '::' + RepresentationType$2 + ':' + config.versionId;
2305
+ }
2306
+ function keyBuilderFromType$1(luvio, object) {
2307
+ const keyParams = {
2308
+ versionId: object.versionId
2258
2309
  };
2259
- luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
2260
- return errorSnapshot;
2310
+ return keyBuilder$5(luvio, keyParams);
2261
2311
  }
2262
- function createResourceRequest$2(config) {
2312
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
2313
+ return input;
2314
+ }
2315
+ const select$g = function EinsteinPromptTemplateRepresentationSelect() {
2316
+ const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$m();
2317
+ return {
2318
+ kind: 'Fragment',
2319
+ version: VERSION$a,
2320
+ private: [],
2321
+ selections: [
2322
+ {
2323
+ name: 'additionalData',
2324
+ kind: 'Object',
2325
+ selections: WrappedMap__selections,
2326
+ required: false
2327
+ },
2328
+ {
2329
+ name: 'errorMessages',
2330
+ kind: 'Scalar',
2331
+ plural: true
2332
+ },
2333
+ {
2334
+ name: 'hasWarning',
2335
+ kind: 'Scalar'
2336
+ },
2337
+ {
2338
+ name: 'isSuccessful',
2339
+ kind: 'Scalar'
2340
+ },
2341
+ {
2342
+ name: 'statusCode',
2343
+ kind: 'Scalar',
2344
+ required: false
2345
+ },
2346
+ {
2347
+ name: 'templateId',
2348
+ kind: 'Scalar'
2349
+ },
2350
+ {
2351
+ name: 'templateType',
2352
+ kind: 'Scalar',
2353
+ required: false
2354
+ },
2355
+ {
2356
+ name: 'versionId',
2357
+ kind: 'Scalar'
2358
+ },
2359
+ {
2360
+ name: 'warningMessages',
2361
+ kind: 'Scalar',
2362
+ plural: true
2363
+ }
2364
+ ]
2365
+ };
2366
+ };
2367
+ function equals$a(existing, incoming) {
2368
+ const existing_hasWarning = existing.hasWarning;
2369
+ const incoming_hasWarning = incoming.hasWarning;
2370
+ if (!(existing_hasWarning === incoming_hasWarning)) {
2371
+ return false;
2372
+ }
2373
+ const existing_isSuccessful = existing.isSuccessful;
2374
+ const incoming_isSuccessful = incoming.isSuccessful;
2375
+ if (!(existing_isSuccessful === incoming_isSuccessful)) {
2376
+ return false;
2377
+ }
2378
+ const existing_statusCode = existing.statusCode;
2379
+ const incoming_statusCode = incoming.statusCode;
2380
+ // if at least one of these optionals is defined
2381
+ if (existing_statusCode !== undefined || incoming_statusCode !== undefined) {
2382
+ // if one of these is not defined we know the other is defined and therefore
2383
+ // not equal
2384
+ if (existing_statusCode === undefined || incoming_statusCode === undefined) {
2385
+ return false;
2386
+ }
2387
+ if (!(existing_statusCode === incoming_statusCode)) {
2388
+ return false;
2389
+ }
2390
+ }
2391
+ const existing_templateId = existing.templateId;
2392
+ const incoming_templateId = incoming.templateId;
2393
+ if (!(existing_templateId === incoming_templateId)) {
2394
+ return false;
2395
+ }
2396
+ const existing_templateType = existing.templateType;
2397
+ const incoming_templateType = incoming.templateType;
2398
+ // if at least one of these optionals is defined
2399
+ if (existing_templateType !== undefined || incoming_templateType !== undefined) {
2400
+ // if one of these is not defined we know the other is defined and therefore
2401
+ // not equal
2402
+ if (existing_templateType === undefined || incoming_templateType === undefined) {
2403
+ return false;
2404
+ }
2405
+ if (!(existing_templateType === incoming_templateType)) {
2406
+ return false;
2407
+ }
2408
+ }
2409
+ const existing_versionId = existing.versionId;
2410
+ const incoming_versionId = incoming.versionId;
2411
+ if (!(existing_versionId === incoming_versionId)) {
2412
+ return false;
2413
+ }
2414
+ const existing_additionalData = existing.additionalData;
2415
+ const incoming_additionalData = incoming.additionalData;
2416
+ // if at least one of these optionals is defined
2417
+ if (existing_additionalData !== undefined || incoming_additionalData !== undefined) {
2418
+ // if one of these is not defined we know the other is defined and therefore
2419
+ // not equal
2420
+ if (existing_additionalData === undefined || incoming_additionalData === undefined) {
2421
+ return false;
2422
+ }
2423
+ if (!(equals$e(existing_additionalData, incoming_additionalData))) {
2424
+ return false;
2425
+ }
2426
+ }
2427
+ const existing_errorMessages = existing.errorMessages;
2428
+ const incoming_errorMessages = incoming.errorMessages;
2429
+ const equals_errorMessages_items = equalsArray(existing_errorMessages, incoming_errorMessages, (existing_errorMessages_item, incoming_errorMessages_item) => {
2430
+ if (!(existing_errorMessages_item === incoming_errorMessages_item)) {
2431
+ return false;
2432
+ }
2433
+ });
2434
+ if (equals_errorMessages_items === false) {
2435
+ return false;
2436
+ }
2437
+ const existing_warningMessages = existing.warningMessages;
2438
+ const incoming_warningMessages = incoming.warningMessages;
2439
+ const equals_warningMessages_items = equalsArray(existing_warningMessages, incoming_warningMessages, (existing_warningMessages_item, incoming_warningMessages_item) => {
2440
+ if (!(existing_warningMessages_item === incoming_warningMessages_item)) {
2441
+ return false;
2442
+ }
2443
+ });
2444
+ if (equals_warningMessages_items === false) {
2445
+ return false;
2446
+ }
2447
+ return true;
2448
+ }
2449
+ const ingest$2 = function EinsteinPromptTemplateRepresentationIngest(input, path, luvio, store, timestamp) {
2450
+ if (process.env.NODE_ENV !== 'production') {
2451
+ const validateError = validate$c(input);
2452
+ if (validateError !== null) {
2453
+ throw validateError;
2454
+ }
2455
+ }
2456
+ const key = keyBuilderFromType$1(luvio, input);
2457
+ const ttlToUse = TTL$2;
2458
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "EinsteinLLM", VERSION$a, RepresentationType$2, equals$a);
2459
+ return createLink(key);
2460
+ };
2461
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
2462
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2463
+ const rootKey = keyBuilderFromType$1(luvio, input);
2464
+ rootKeySet.set(rootKey, {
2465
+ namespace: keyPrefix,
2466
+ representationName: RepresentationType$2,
2467
+ mergeable: false
2468
+ });
2469
+ }
2470
+
2471
+ function select$f(luvio, params) {
2472
+ return select$g();
2473
+ }
2474
+ function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
2475
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
2476
+ }
2477
+ function ingestSuccess$5(luvio, resourceParams, response) {
2478
+ const { body } = response;
2479
+ const key = keyBuilderFromType$1(luvio, body);
2480
+ luvio.storeIngest(key, ingest$2, body);
2481
+ const snapshot = luvio.storeLookup({
2482
+ recordId: key,
2483
+ node: select$f(),
2484
+ variables: {},
2485
+ });
2486
+ if (process.env.NODE_ENV !== 'production') {
2487
+ if (snapshot.state !== 'Fulfilled') {
2488
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2489
+ }
2490
+ }
2491
+ deepFreeze(snapshot.data);
2492
+ return snapshot;
2493
+ }
2494
+ function createResourceRequest$5(config) {
2495
+ const headers = {};
2496
+ return {
2497
+ baseUri: '/services/data/v65.0',
2498
+ basePath: '/einstein/prompt-templates',
2499
+ method: 'post',
2500
+ body: config.body,
2501
+ urlParams: {},
2502
+ queryParams: {},
2503
+ headers,
2504
+ priority: 'normal',
2505
+ };
2506
+ }
2507
+
2508
+ const adapterName$5 = 'createPromptTemplate';
2509
+ const createPromptTemplate_ConfigPropertyMetadata = [
2510
+ generateParamConfigMetadata('apiName', true, 2 /* Body */, 0 /* String */),
2511
+ generateParamConfigMetadata('childRelationships', true, 2 /* Body */, 4 /* Unsupported */),
2512
+ generateParamConfigMetadata('fields', true, 2 /* Body */, 4 /* Unsupported */, true),
2513
+ generateParamConfigMetadata('id', false, 2 /* Body */, 0 /* String */),
2514
+ generateParamConfigMetadata('isStandard', true, 2 /* Body */, 1 /* Boolean */),
2515
+ ];
2516
+ const createPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, createPromptTemplate_ConfigPropertyMetadata);
2517
+ const createResourceParams$5 = /*#__PURE__*/ createResourceParams$a(createPromptTemplate_ConfigPropertyMetadata);
2518
+ function typeCheckConfig$5(untrustedConfig) {
2519
+ const config = {};
2520
+ typeCheckConfig$a(untrustedConfig, config, createPromptTemplate_ConfigPropertyMetadata);
2521
+ const untrustedConfig_childRelationships = untrustedConfig.childRelationships;
2522
+ if (untrustedIsObject(untrustedConfig_childRelationships)) {
2523
+ const untrustedConfig_childRelationships_object = {};
2524
+ const untrustedConfig_childRelationships_keys = Object.keys(untrustedConfig_childRelationships);
2525
+ for (let i = 0, arrayLength = untrustedConfig_childRelationships_keys.length; i < arrayLength; i++) {
2526
+ const key = untrustedConfig_childRelationships_keys[i];
2527
+ const untrustedConfig_childRelationships_prop = untrustedConfig_childRelationships[key];
2528
+ if (untrustedConfig_childRelationships_object !== undefined) {
2529
+ untrustedConfig_childRelationships_object[key] = untrustedConfig_childRelationships_prop;
2530
+ }
2531
+ }
2532
+ if (untrustedConfig_childRelationships_object !== undefined && Object.keys(untrustedConfig_childRelationships_object).length >= 0) {
2533
+ config.childRelationships = untrustedConfig_childRelationships_object;
2534
+ }
2535
+ }
2536
+ const untrustedConfig_fields = untrustedConfig.fields;
2537
+ if (ArrayIsArray$1(untrustedConfig_fields)) {
2538
+ const untrustedConfig_fields_array = [];
2539
+ for (let i = 0, arrayLength = untrustedConfig_fields.length; i < arrayLength; i++) {
2540
+ const untrustedConfig_fields_item = untrustedConfig_fields[i];
2541
+ if (untrustedIsObject(untrustedConfig_fields_item)) {
2542
+ const untrustedConfig_fields_item_object = {};
2543
+ const untrustedConfig_fields_item_keys = Object.keys(untrustedConfig_fields_item);
2544
+ for (let i = 0, arrayLength = untrustedConfig_fields_item_keys.length; i < arrayLength; i++) {
2545
+ const key = untrustedConfig_fields_item_keys[i];
2546
+ const untrustedConfig_fields_item_prop = untrustedConfig_fields_item[key];
2547
+ if (untrustedConfig_fields_item_object !== undefined) {
2548
+ untrustedConfig_fields_item_object[key] = untrustedConfig_fields_item_prop;
2549
+ }
2550
+ }
2551
+ if (untrustedConfig_fields_item_object !== undefined && Object.keys(untrustedConfig_fields_item_object).length >= 0) {
2552
+ untrustedConfig_fields_array.push(untrustedConfig_fields_item_object);
2553
+ }
2554
+ }
2555
+ }
2556
+ config.fields = untrustedConfig_fields_array;
2557
+ }
2558
+ return config;
2559
+ }
2560
+ function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
2561
+ if (!untrustedIsObject(untrustedConfig)) {
2562
+ return null;
2563
+ }
2564
+ if (process.env.NODE_ENV !== 'production') {
2565
+ validateConfig(untrustedConfig, configPropertyNames);
2566
+ }
2567
+ const config = typeCheckConfig$5(untrustedConfig);
2568
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2569
+ return null;
2570
+ }
2571
+ return config;
2572
+ }
2573
+ function buildNetworkSnapshot$5(luvio, config, options) {
2574
+ const resourceParams = createResourceParams$5(config);
2575
+ const request = createResourceRequest$5(resourceParams);
2576
+ return luvio.dispatchResourceRequest(request, options)
2577
+ .then((response) => {
2578
+ return luvio.handleSuccessResponse(() => {
2579
+ const snapshot = ingestSuccess$5(luvio, resourceParams, response);
2580
+ return luvio.storeBroadcast().then(() => snapshot);
2581
+ }, () => {
2582
+ const cache = new StoreKeyMap();
2583
+ getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
2584
+ return cache;
2585
+ });
2586
+ }, (response) => {
2587
+ deepFreeze(response);
2588
+ throw response;
2589
+ });
2590
+ }
2591
+ const createPromptTemplateAdapterFactory = (luvio) => {
2592
+ return function createPromptTemplate(untrustedConfig) {
2593
+ const config = validateAdapterConfig$5(untrustedConfig, createPromptTemplate_ConfigPropertyNames);
2594
+ // Invalid or incomplete config
2595
+ if (config === null) {
2596
+ throw new Error('Invalid config for "createPromptTemplate"');
2597
+ }
2598
+ return buildNetworkSnapshot$5(luvio, config);
2599
+ };
2600
+ };
2601
+
2602
+ function select$e(luvio, params) {
2603
+ return select$j();
2604
+ }
2605
+ function keyBuilder$4(luvio, params) {
2606
+ return keyPrefix + '::EinsteinPromptRecordRepresentation:(' + 'versionId:' + params.queryParams.versionId + ',' + 'promptTemplateDevName:' + params.urlParams.promptTemplateDevName + ')';
2607
+ }
2608
+ function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
2609
+ getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$4(luvio, resourceParams));
2610
+ }
2611
+ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
2612
+ const { body } = response;
2613
+ const key = keyBuilder$4(luvio, resourceParams);
2614
+ luvio.storeIngest(key, ingest$4, body);
2615
+ const snapshot = luvio.storeLookup({
2616
+ recordId: key,
2617
+ node: select$e(),
2618
+ variables: {},
2619
+ }, snapshotRefresh);
2620
+ if (process.env.NODE_ENV !== 'production') {
2621
+ if (snapshot.state !== 'Fulfilled') {
2622
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2623
+ }
2624
+ }
2625
+ deepFreeze(snapshot.data);
2626
+ return snapshot;
2627
+ }
2628
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
2629
+ const key = keyBuilder$4(luvio, params);
2630
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2631
+ const storeMetadataParams = {
2632
+ ttl: TTL$4,
2633
+ namespace: keyPrefix,
2634
+ version: VERSION$c,
2635
+ representationName: RepresentationType$4
2636
+ };
2637
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
2638
+ return errorSnapshot;
2639
+ }
2640
+ function createResourceRequest$4(config) {
2263
2641
  const headers = {};
2264
2642
  return {
2265
2643
  baseUri: '/services/data/v65.0',
@@ -2273,61 +2651,61 @@ function createResourceRequest$2(config) {
2273
2651
  };
2274
2652
  }
2275
2653
 
2276
- const adapterName$2 = 'getPromptTemplate';
2654
+ const adapterName$4 = 'getPromptTemplate';
2277
2655
  const getPromptTemplate_ConfigPropertyMetadata = [
2278
2656
  generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
2279
2657
  generateParamConfigMetadata('versionId', false, 1 /* QueryParameter */, 0 /* String */),
2280
2658
  ];
2281
- const getPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getPromptTemplate_ConfigPropertyMetadata);
2282
- const createResourceParams$2 = /*#__PURE__*/ createResourceParams$7(getPromptTemplate_ConfigPropertyMetadata);
2659
+ const getPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getPromptTemplate_ConfigPropertyMetadata);
2660
+ const createResourceParams$4 = /*#__PURE__*/ createResourceParams$a(getPromptTemplate_ConfigPropertyMetadata);
2283
2661
  function keyBuilder$3(luvio, config) {
2284
- const resourceParams = createResourceParams$2(config);
2662
+ const resourceParams = createResourceParams$4(config);
2285
2663
  return keyBuilder$4(luvio, resourceParams);
2286
2664
  }
2287
- function typeCheckConfig$2(untrustedConfig) {
2665
+ function typeCheckConfig$4(untrustedConfig) {
2288
2666
  const config = {};
2289
- typeCheckConfig$7(untrustedConfig, config, getPromptTemplate_ConfigPropertyMetadata);
2667
+ typeCheckConfig$a(untrustedConfig, config, getPromptTemplate_ConfigPropertyMetadata);
2290
2668
  return config;
2291
2669
  }
2292
- function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
2670
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
2293
2671
  if (!untrustedIsObject(untrustedConfig)) {
2294
2672
  return null;
2295
2673
  }
2296
2674
  if (process.env.NODE_ENV !== 'production') {
2297
2675
  validateConfig(untrustedConfig, configPropertyNames);
2298
2676
  }
2299
- const config = typeCheckConfig$2(untrustedConfig);
2677
+ const config = typeCheckConfig$4(untrustedConfig);
2300
2678
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
2301
2679
  return null;
2302
2680
  }
2303
2681
  return config;
2304
2682
  }
2305
2683
  function adapterFragment$1(luvio, config) {
2306
- createResourceParams$2(config);
2307
- return select$c();
2684
+ createResourceParams$4(config);
2685
+ return select$e();
2308
2686
  }
2309
2687
  function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
2310
- const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
2688
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
2311
2689
  config,
2312
- resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
2690
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
2313
2691
  });
2314
2692
  return luvio.storeBroadcast().then(() => snapshot);
2315
2693
  }
2316
2694
  function onFetchResponseError$1(luvio, config, resourceParams, response) {
2317
2695
  const snapshot = ingestError$1(luvio, resourceParams, response, {
2318
2696
  config,
2319
- resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
2697
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
2320
2698
  });
2321
2699
  return luvio.storeBroadcast().then(() => snapshot);
2322
2700
  }
2323
- function buildNetworkSnapshot$2(luvio, config, options) {
2324
- const resourceParams = createResourceParams$2(config);
2325
- const request = createResourceRequest$2(resourceParams);
2701
+ function buildNetworkSnapshot$4(luvio, config, options) {
2702
+ const resourceParams = createResourceParams$4(config);
2703
+ const request = createResourceRequest$4(resourceParams);
2326
2704
  return luvio.dispatchResourceRequest(request, options)
2327
2705
  .then((response) => {
2328
2706
  return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
2329
2707
  const cache = new StoreKeyMap();
2330
- getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
2708
+ getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
2331
2709
  return cache;
2332
2710
  });
2333
2711
  }, (response) => {
@@ -2335,7 +2713,7 @@ function buildNetworkSnapshot$2(luvio, config, options) {
2335
2713
  });
2336
2714
  }
2337
2715
  function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
2338
- return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
2716
+ return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
2339
2717
  }
2340
2718
  function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
2341
2719
  const { luvio, config } = context;
@@ -2346,12 +2724,12 @@ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
2346
2724
  };
2347
2725
  const cacheSnapshot = storeLookup(selector, {
2348
2726
  config,
2349
- resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
2727
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
2350
2728
  });
2351
2729
  return cacheSnapshot;
2352
2730
  }
2353
2731
  const getPromptTemplateAdapterFactory = (luvio) => function EinsteinLLM__getPromptTemplate(untrustedConfig, requestContext) {
2354
- const config = validateAdapterConfig$2(untrustedConfig, getPromptTemplate_ConfigPropertyNames);
2732
+ const config = validateAdapterConfig$4(untrustedConfig, getPromptTemplate_ConfigPropertyNames);
2355
2733
  // Invalid or incomplete config
2356
2734
  if (config === null) {
2357
2735
  return null;
@@ -2360,6 +2738,271 @@ const getPromptTemplateAdapterFactory = (luvio) => function EinsteinLLM__getProm
2360
2738
  buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
2361
2739
  };
2362
2740
 
2741
+ function select$d(luvio, params) {
2742
+ return select$g();
2743
+ }
2744
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
2745
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
2746
+ }
2747
+ function ingestSuccess$3(luvio, resourceParams, response) {
2748
+ const { body } = response;
2749
+ const key = keyBuilderFromType$1(luvio, body);
2750
+ luvio.storeIngest(key, ingest$2, body);
2751
+ const snapshot = luvio.storeLookup({
2752
+ recordId: key,
2753
+ node: select$d(),
2754
+ variables: {},
2755
+ });
2756
+ if (process.env.NODE_ENV !== 'production') {
2757
+ if (snapshot.state !== 'Fulfilled') {
2758
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2759
+ }
2760
+ }
2761
+ deepFreeze(snapshot.data);
2762
+ return snapshot;
2763
+ }
2764
+ function createResourceRequest$3(config) {
2765
+ const headers = {};
2766
+ return {
2767
+ baseUri: '/services/data/v65.0',
2768
+ basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '/versions',
2769
+ method: 'post',
2770
+ body: config.body,
2771
+ urlParams: config.urlParams,
2772
+ queryParams: {},
2773
+ headers,
2774
+ priority: 'normal',
2775
+ };
2776
+ }
2777
+
2778
+ const adapterName$3 = 'createPromptTemplateVersion';
2779
+ const createPromptTemplateVersion_ConfigPropertyMetadata = [
2780
+ generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
2781
+ generateParamConfigMetadata('apiName', true, 2 /* Body */, 0 /* String */),
2782
+ generateParamConfigMetadata('childRelationships', true, 2 /* Body */, 4 /* Unsupported */),
2783
+ generateParamConfigMetadata('fields', true, 2 /* Body */, 4 /* Unsupported */, true),
2784
+ generateParamConfigMetadata('id', false, 2 /* Body */, 0 /* String */),
2785
+ generateParamConfigMetadata('isStandard', true, 2 /* Body */, 1 /* Boolean */),
2786
+ ];
2787
+ const createPromptTemplateVersion_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, createPromptTemplateVersion_ConfigPropertyMetadata);
2788
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$a(createPromptTemplateVersion_ConfigPropertyMetadata);
2789
+ function typeCheckConfig$3(untrustedConfig) {
2790
+ const config = {};
2791
+ typeCheckConfig$a(untrustedConfig, config, createPromptTemplateVersion_ConfigPropertyMetadata);
2792
+ const untrustedConfig_childRelationships = untrustedConfig.childRelationships;
2793
+ if (untrustedIsObject(untrustedConfig_childRelationships)) {
2794
+ const untrustedConfig_childRelationships_object = {};
2795
+ const untrustedConfig_childRelationships_keys = Object.keys(untrustedConfig_childRelationships);
2796
+ for (let i = 0, arrayLength = untrustedConfig_childRelationships_keys.length; i < arrayLength; i++) {
2797
+ const key = untrustedConfig_childRelationships_keys[i];
2798
+ const untrustedConfig_childRelationships_prop = untrustedConfig_childRelationships[key];
2799
+ if (untrustedConfig_childRelationships_object !== undefined) {
2800
+ untrustedConfig_childRelationships_object[key] = untrustedConfig_childRelationships_prop;
2801
+ }
2802
+ }
2803
+ if (untrustedConfig_childRelationships_object !== undefined && Object.keys(untrustedConfig_childRelationships_object).length >= 0) {
2804
+ config.childRelationships = untrustedConfig_childRelationships_object;
2805
+ }
2806
+ }
2807
+ const untrustedConfig_fields = untrustedConfig.fields;
2808
+ if (ArrayIsArray$1(untrustedConfig_fields)) {
2809
+ const untrustedConfig_fields_array = [];
2810
+ for (let i = 0, arrayLength = untrustedConfig_fields.length; i < arrayLength; i++) {
2811
+ const untrustedConfig_fields_item = untrustedConfig_fields[i];
2812
+ if (untrustedIsObject(untrustedConfig_fields_item)) {
2813
+ const untrustedConfig_fields_item_object = {};
2814
+ const untrustedConfig_fields_item_keys = Object.keys(untrustedConfig_fields_item);
2815
+ for (let i = 0, arrayLength = untrustedConfig_fields_item_keys.length; i < arrayLength; i++) {
2816
+ const key = untrustedConfig_fields_item_keys[i];
2817
+ const untrustedConfig_fields_item_prop = untrustedConfig_fields_item[key];
2818
+ if (untrustedConfig_fields_item_object !== undefined) {
2819
+ untrustedConfig_fields_item_object[key] = untrustedConfig_fields_item_prop;
2820
+ }
2821
+ }
2822
+ if (untrustedConfig_fields_item_object !== undefined && Object.keys(untrustedConfig_fields_item_object).length >= 0) {
2823
+ untrustedConfig_fields_array.push(untrustedConfig_fields_item_object);
2824
+ }
2825
+ }
2826
+ }
2827
+ config.fields = untrustedConfig_fields_array;
2828
+ }
2829
+ return config;
2830
+ }
2831
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
2832
+ if (!untrustedIsObject(untrustedConfig)) {
2833
+ return null;
2834
+ }
2835
+ if (process.env.NODE_ENV !== 'production') {
2836
+ validateConfig(untrustedConfig, configPropertyNames);
2837
+ }
2838
+ const config = typeCheckConfig$3(untrustedConfig);
2839
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2840
+ return null;
2841
+ }
2842
+ return config;
2843
+ }
2844
+ function buildNetworkSnapshot$3(luvio, config, options) {
2845
+ const resourceParams = createResourceParams$3(config);
2846
+ const request = createResourceRequest$3(resourceParams);
2847
+ return luvio.dispatchResourceRequest(request, options)
2848
+ .then((response) => {
2849
+ return luvio.handleSuccessResponse(() => {
2850
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response);
2851
+ return luvio.storeBroadcast().then(() => snapshot);
2852
+ }, () => {
2853
+ const cache = new StoreKeyMap();
2854
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
2855
+ return cache;
2856
+ });
2857
+ }, (response) => {
2858
+ deepFreeze(response);
2859
+ throw response;
2860
+ });
2861
+ }
2862
+ const createPromptTemplateVersionAdapterFactory = (luvio) => {
2863
+ return function createPromptTemplateVersion(untrustedConfig) {
2864
+ const config = validateAdapterConfig$3(untrustedConfig, createPromptTemplateVersion_ConfigPropertyNames);
2865
+ // Invalid or incomplete config
2866
+ if (config === null) {
2867
+ throw new Error('Invalid config for "createPromptTemplateVersion"');
2868
+ }
2869
+ return buildNetworkSnapshot$3(luvio, config);
2870
+ };
2871
+ };
2872
+
2873
+ function select$c(luvio, params) {
2874
+ return select$g();
2875
+ }
2876
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
2877
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
2878
+ }
2879
+ function ingestSuccess$2(luvio, resourceParams, response) {
2880
+ const { body } = response;
2881
+ const key = keyBuilderFromType$1(luvio, body);
2882
+ luvio.storeIngest(key, ingest$2, body);
2883
+ const snapshot = luvio.storeLookup({
2884
+ recordId: key,
2885
+ node: select$c(),
2886
+ variables: {},
2887
+ });
2888
+ if (process.env.NODE_ENV !== 'production') {
2889
+ if (snapshot.state !== 'Fulfilled') {
2890
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2891
+ }
2892
+ }
2893
+ deepFreeze(snapshot.data);
2894
+ return snapshot;
2895
+ }
2896
+ function createResourceRequest$2(config) {
2897
+ const headers = {};
2898
+ return {
2899
+ baseUri: '/services/data/v65.0',
2900
+ basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '/versions/' + config.urlParams.versionId + '',
2901
+ method: 'put',
2902
+ body: config.body,
2903
+ urlParams: config.urlParams,
2904
+ queryParams: {},
2905
+ headers,
2906
+ priority: 'normal',
2907
+ };
2908
+ }
2909
+
2910
+ const adapterName$2 = 'updatePromptTemplateVersion';
2911
+ const updatePromptTemplateVersion_ConfigPropertyMetadata = [
2912
+ generateParamConfigMetadata('promptTemplateDevName', true, 0 /* UrlParameter */, 0 /* String */),
2913
+ generateParamConfigMetadata('versionId', true, 0 /* UrlParameter */, 0 /* String */),
2914
+ generateParamConfigMetadata('apiName', true, 2 /* Body */, 0 /* String */),
2915
+ generateParamConfigMetadata('childRelationships', true, 2 /* Body */, 4 /* Unsupported */),
2916
+ generateParamConfigMetadata('fields', true, 2 /* Body */, 4 /* Unsupported */, true),
2917
+ generateParamConfigMetadata('id', false, 2 /* Body */, 0 /* String */),
2918
+ generateParamConfigMetadata('isStandard', true, 2 /* Body */, 1 /* Boolean */),
2919
+ ];
2920
+ const updatePromptTemplateVersion_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, updatePromptTemplateVersion_ConfigPropertyMetadata);
2921
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$a(updatePromptTemplateVersion_ConfigPropertyMetadata);
2922
+ function typeCheckConfig$2(untrustedConfig) {
2923
+ const config = {};
2924
+ typeCheckConfig$a(untrustedConfig, config, updatePromptTemplateVersion_ConfigPropertyMetadata);
2925
+ const untrustedConfig_childRelationships = untrustedConfig.childRelationships;
2926
+ if (untrustedIsObject(untrustedConfig_childRelationships)) {
2927
+ const untrustedConfig_childRelationships_object = {};
2928
+ const untrustedConfig_childRelationships_keys = Object.keys(untrustedConfig_childRelationships);
2929
+ for (let i = 0, arrayLength = untrustedConfig_childRelationships_keys.length; i < arrayLength; i++) {
2930
+ const key = untrustedConfig_childRelationships_keys[i];
2931
+ const untrustedConfig_childRelationships_prop = untrustedConfig_childRelationships[key];
2932
+ if (untrustedConfig_childRelationships_object !== undefined) {
2933
+ untrustedConfig_childRelationships_object[key] = untrustedConfig_childRelationships_prop;
2934
+ }
2935
+ }
2936
+ if (untrustedConfig_childRelationships_object !== undefined && Object.keys(untrustedConfig_childRelationships_object).length >= 0) {
2937
+ config.childRelationships = untrustedConfig_childRelationships_object;
2938
+ }
2939
+ }
2940
+ const untrustedConfig_fields = untrustedConfig.fields;
2941
+ if (ArrayIsArray$1(untrustedConfig_fields)) {
2942
+ const untrustedConfig_fields_array = [];
2943
+ for (let i = 0, arrayLength = untrustedConfig_fields.length; i < arrayLength; i++) {
2944
+ const untrustedConfig_fields_item = untrustedConfig_fields[i];
2945
+ if (untrustedIsObject(untrustedConfig_fields_item)) {
2946
+ const untrustedConfig_fields_item_object = {};
2947
+ const untrustedConfig_fields_item_keys = Object.keys(untrustedConfig_fields_item);
2948
+ for (let i = 0, arrayLength = untrustedConfig_fields_item_keys.length; i < arrayLength; i++) {
2949
+ const key = untrustedConfig_fields_item_keys[i];
2950
+ const untrustedConfig_fields_item_prop = untrustedConfig_fields_item[key];
2951
+ if (untrustedConfig_fields_item_object !== undefined) {
2952
+ untrustedConfig_fields_item_object[key] = untrustedConfig_fields_item_prop;
2953
+ }
2954
+ }
2955
+ if (untrustedConfig_fields_item_object !== undefined && Object.keys(untrustedConfig_fields_item_object).length >= 0) {
2956
+ untrustedConfig_fields_array.push(untrustedConfig_fields_item_object);
2957
+ }
2958
+ }
2959
+ }
2960
+ config.fields = untrustedConfig_fields_array;
2961
+ }
2962
+ return config;
2963
+ }
2964
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
2965
+ if (!untrustedIsObject(untrustedConfig)) {
2966
+ return null;
2967
+ }
2968
+ if (process.env.NODE_ENV !== 'production') {
2969
+ validateConfig(untrustedConfig, configPropertyNames);
2970
+ }
2971
+ const config = typeCheckConfig$2(untrustedConfig);
2972
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2973
+ return null;
2974
+ }
2975
+ return config;
2976
+ }
2977
+ function buildNetworkSnapshot$2(luvio, config, options) {
2978
+ const resourceParams = createResourceParams$2(config);
2979
+ const request = createResourceRequest$2(resourceParams);
2980
+ return luvio.dispatchResourceRequest(request, options)
2981
+ .then((response) => {
2982
+ return luvio.handleSuccessResponse(() => {
2983
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response);
2984
+ return luvio.storeBroadcast().then(() => snapshot);
2985
+ }, () => {
2986
+ const cache = new StoreKeyMap();
2987
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
2988
+ return cache;
2989
+ });
2990
+ }, (response) => {
2991
+ deepFreeze(response);
2992
+ throw response;
2993
+ });
2994
+ }
2995
+ const updatePromptTemplateVersionAdapterFactory = (luvio) => {
2996
+ return function updatePromptTemplateVersion(untrustedConfig) {
2997
+ const config = validateAdapterConfig$2(untrustedConfig, updatePromptTemplateVersion_ConfigPropertyNames);
2998
+ // Invalid or incomplete config
2999
+ if (config === null) {
3000
+ throw new Error('Invalid config for "updatePromptTemplateVersion"');
3001
+ }
3002
+ return buildNetworkSnapshot$2(luvio, config);
3003
+ };
3004
+ };
3005
+
2363
3006
  function validate$b(obj, path = 'WrappedValueMap') {
2364
3007
  const v_error = (() => {
2365
3008
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -2391,7 +3034,7 @@ function validate$a(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
2391
3034
  if (obj.additionalConfig !== undefined) {
2392
3035
  const obj_additionalConfig = obj.additionalConfig;
2393
3036
  const path_additionalConfig = path + '.additionalConfig';
2394
- const referencepath_additionalConfigValidationError = validate$l(obj_additionalConfig, path_additionalConfig);
3037
+ const referencepath_additionalConfigValidationError = validate$m(obj_additionalConfig, path_additionalConfig);
2395
3038
  if (referencepath_additionalConfigValidationError !== null) {
2396
3039
  let message = 'Object doesn\'t match EinsteinLlmAdditionalConfigInputRepresentation (at "' + path_additionalConfig + '")\n';
2397
3040
  message += referencepath_additionalConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -2986,7 +3629,7 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
2986
3629
  for (let i = 0; i < obj_generations.length; i++) {
2987
3630
  const obj_generations_item = obj_generations[i];
2988
3631
  const path_generations_item = path_generations + '[' + i + ']';
2989
- const referencepath_generations_itemValidationError = validate$h(obj_generations_item, path_generations_item);
3632
+ const referencepath_generations_itemValidationError = validate$i(obj_generations_item, path_generations_item);
2990
3633
  if (referencepath_generations_itemValidationError !== null) {
2991
3634
  let message = 'Object doesn\'t match EinsteinLlmGenerationItemRepresentation (at "' + path_generations_item + '")\n';
2992
3635
  message += referencepath_generations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -3013,7 +3656,7 @@ function validate$3(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation
3013
3656
  const path_parameters = path + '.parameters';
3014
3657
  let obj_parameters_union0 = null;
3015
3658
  const obj_parameters_union0_error = (() => {
3016
- const referencepath_parametersValidationError = validate$g(obj_parameters, path_parameters);
3659
+ const referencepath_parametersValidationError = validate$h(obj_parameters, path_parameters);
3017
3660
  if (referencepath_parametersValidationError !== null) {
3018
3661
  let message = 'Object doesn\'t match WrappedMap (at "' + path_parameters + '")\n';
3019
3662
  message += referencepath_parametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -3144,8 +3787,8 @@ function normalize$1(input, existing, path, luvio, store, timestamp) {
3144
3787
  const select$5 = function EinsteinPromptTemplateGenerationsRepresentationSelect() {
3145
3788
  const { selections: EinsteinPromptTemplateAttachmentRepresentation__selections, opaque: EinsteinPromptTemplateAttachmentRepresentation__opaque, } = select$a();
3146
3789
  const { selections: EinsteinPromptTemplateGenerationsErrorRepresentation__selections, opaque: EinsteinPromptTemplateGenerationsErrorRepresentation__opaque, } = select$9();
3147
- const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$j();
3148
- const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$i();
3790
+ const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$n();
3791
+ const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$m();
3149
3792
  const { selections: EinsteinPromptTemplateMaskContentRepresentation__selections, opaque: EinsteinPromptTemplateMaskContentRepresentation__opaque, } = select$7();
3150
3793
  const { selections: EinsteinPromptTemplateMaskDataRepresentation__selections, opaque: EinsteinPromptTemplateMaskDataRepresentation__opaque, } = select$6();
3151
3794
  return {
@@ -3270,7 +3913,7 @@ function equals$3(existing, incoming) {
3270
3913
  const existing_generations = existing.generations;
3271
3914
  const incoming_generations = incoming.generations;
3272
3915
  const equals_generations_items = equalsArray(existing_generations, incoming_generations, (existing_generations_item, incoming_generations_item) => {
3273
- if (!(equals$e(existing_generations_item, incoming_generations_item))) {
3916
+ if (!(equals$f(existing_generations_item, incoming_generations_item))) {
3274
3917
  return false;
3275
3918
  }
3276
3919
  });
@@ -3300,7 +3943,7 @@ function equals$3(existing, incoming) {
3300
3943
  if (!(existing_parameters === incoming_parameters
3301
3944
  || (existing_parameters != null &&
3302
3945
  incoming_parameters != null &&
3303
- equals$d(existing_parameters, incoming_parameters)))) {
3946
+ equals$e(existing_parameters, incoming_parameters)))) {
3304
3947
  return false;
3305
3948
  }
3306
3949
  const existing_prompt = existing.prompt;
@@ -3430,10 +4073,10 @@ const createGenerationsForPromptTemplate_ConfigPropertyMetadata = [
3430
4073
  generateParamConfigMetadata('promptTemplateGenerationsInput', true, 2 /* Body */, 4 /* Unsupported */),
3431
4074
  ];
3432
4075
  const createGenerationsForPromptTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
3433
- const createResourceParams$1 = /*#__PURE__*/ createResourceParams$7(createGenerationsForPromptTemplate_ConfigPropertyMetadata);
4076
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$a(createGenerationsForPromptTemplate_ConfigPropertyMetadata);
3434
4077
  function typeCheckConfig$1(untrustedConfig) {
3435
4078
  const config = {};
3436
- typeCheckConfig$7(untrustedConfig, config, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
4079
+ typeCheckConfig$a(untrustedConfig, config, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
3437
4080
  const untrustedConfig_promptTemplateGenerationsInput = untrustedConfig.promptTemplateGenerationsInput;
3438
4081
  const referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError = validate$a(untrustedConfig_promptTemplateGenerationsInput);
3439
4082
  if (referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError === null) {
@@ -3796,14 +4439,14 @@ const getOutputLanguages_ConfigPropertyMetadata = [
3796
4439
  generateParamConfigMetadata('versionId', false, 1 /* QueryParameter */, 0 /* String */),
3797
4440
  ];
3798
4441
  const getOutputLanguages_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getOutputLanguages_ConfigPropertyMetadata);
3799
- const createResourceParams = /*#__PURE__*/ createResourceParams$7(getOutputLanguages_ConfigPropertyMetadata);
4442
+ const createResourceParams = /*#__PURE__*/ createResourceParams$a(getOutputLanguages_ConfigPropertyMetadata);
3800
4443
  function keyBuilder(luvio, config) {
3801
4444
  const resourceParams = createResourceParams(config);
3802
4445
  return keyBuilder$1(luvio, resourceParams);
3803
4446
  }
3804
4447
  function typeCheckConfig(untrustedConfig) {
3805
4448
  const config = {};
3806
- typeCheckConfig$7(untrustedConfig, config, getOutputLanguages_ConfigPropertyMetadata);
4449
+ typeCheckConfig$a(untrustedConfig, config, getOutputLanguages_ConfigPropertyMetadata);
3807
4450
  return config;
3808
4451
  }
3809
4452
  function validateAdapterConfig(untrustedConfig, configPropertyNames) {
@@ -3877,4 +4520,4 @@ const getOutputLanguagesAdapterFactory = (luvio) => function EinsteinLLM__getOut
3877
4520
  buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
3878
4521
  };
3879
4522
 
3880
- export { createEmbeddingsAdapterFactory, createFeedbackAdapterFactory, createGenerationsAdapterFactory, createGenerationsForPromptTemplateAdapterFactory, getOutputLanguagesAdapterFactory, getPromptTemplateAdapterFactory, getPromptTemplatesAdapterFactory };
4523
+ export { createEmbeddingsAdapterFactory, createFeedbackAdapterFactory, createGenerationsAdapterFactory, createGenerationsForPromptTemplateAdapterFactory, createPromptTemplateAdapterFactory, createPromptTemplateVersionAdapterFactory, getOutputLanguagesAdapterFactory, getPromptTemplateAdapterFactory, getPromptTemplatesAdapterFactory, updatePromptTemplateVersionAdapterFactory };