@salesforce/lds-adapters-service-einsteinllm 1.289.0 → 1.290.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/es2018/service-einsteinllm.js +385 -51
- package/dist/es/es2018/types/src/generated/types/EinsteinLlmGenerationItemRepresentation.d.ts +7 -5
- package/dist/es/es2018/types/src/generated/types/EinsteinLlmGenerationsContentQualityRepresentation.d.ts +3 -3
- package/dist/es/es2018/types/src/generated/types/EinsteinLlmGenerationsSafetyScoreRepresentation.d.ts +15 -15
- package/package.json +4 -4
- package/sfdc/index.js +386 -52
- package/src/raml/api.raml +19 -18
package/sfdc/index.js
CHANGED
|
@@ -257,7 +257,7 @@ function ingestSuccess$2(luvio, resourceParams, response) {
|
|
|
257
257
|
function createResourceRequest$2(config) {
|
|
258
258
|
const headers = {};
|
|
259
259
|
return {
|
|
260
|
-
baseUri: '/services/data/
|
|
260
|
+
baseUri: '/services/data/v62.0',
|
|
261
261
|
basePath: '/einstein/llm/feedback',
|
|
262
262
|
method: 'post',
|
|
263
263
|
body: config.body,
|
|
@@ -439,16 +439,39 @@ function validate$9(obj, path = 'EinsteinLlmGenerationsInputRepresentation') {
|
|
|
439
439
|
return v_error === undefined ? null : v_error;
|
|
440
440
|
}
|
|
441
441
|
|
|
442
|
-
const VERSION$6 = "
|
|
442
|
+
const VERSION$6 = "9ebac74e6f964c363d5fd1913df363af";
|
|
443
443
|
function validate$8(obj, path = 'EinsteinLlmGenerationsContentQualityRepresentation') {
|
|
444
444
|
const v_error = (() => {
|
|
445
445
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
446
446
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
447
447
|
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
448
|
+
if (obj.isToxicityDetected !== undefined) {
|
|
449
|
+
const obj_isToxicityDetected = obj.isToxicityDetected;
|
|
450
|
+
const path_isToxicityDetected = path + '.isToxicityDetected';
|
|
451
|
+
let obj_isToxicityDetected_union0 = null;
|
|
452
|
+
const obj_isToxicityDetected_union0_error = (() => {
|
|
453
|
+
if (typeof obj_isToxicityDetected !== 'boolean') {
|
|
454
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isToxicityDetected + '" (at "' + path_isToxicityDetected + '")');
|
|
455
|
+
}
|
|
456
|
+
})();
|
|
457
|
+
if (obj_isToxicityDetected_union0_error != null) {
|
|
458
|
+
obj_isToxicityDetected_union0 = obj_isToxicityDetected_union0_error.message;
|
|
459
|
+
}
|
|
460
|
+
let obj_isToxicityDetected_union1 = null;
|
|
461
|
+
const obj_isToxicityDetected_union1_error = (() => {
|
|
462
|
+
if (obj_isToxicityDetected !== null) {
|
|
463
|
+
return new TypeError('Expected "null" but received "' + typeof obj_isToxicityDetected + '" (at "' + path_isToxicityDetected + '")');
|
|
464
|
+
}
|
|
465
|
+
})();
|
|
466
|
+
if (obj_isToxicityDetected_union1_error != null) {
|
|
467
|
+
obj_isToxicityDetected_union1 = obj_isToxicityDetected_union1_error.message;
|
|
468
|
+
}
|
|
469
|
+
if (obj_isToxicityDetected_union0 && obj_isToxicityDetected_union1) {
|
|
470
|
+
let message = 'Object doesn\'t match union (at "' + path_isToxicityDetected + '")';
|
|
471
|
+
message += '\n' + obj_isToxicityDetected_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
472
|
+
message += '\n' + obj_isToxicityDetected_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
473
|
+
return new TypeError(message);
|
|
474
|
+
}
|
|
452
475
|
}
|
|
453
476
|
})();
|
|
454
477
|
return v_error === undefined ? null : v_error;
|
|
@@ -461,7 +484,8 @@ const select$8 = function EinsteinLlmGenerationsContentQualityRepresentationSele
|
|
|
461
484
|
selections: [
|
|
462
485
|
{
|
|
463
486
|
name: 'isToxicityDetected',
|
|
464
|
-
kind: 'Scalar'
|
|
487
|
+
kind: 'Scalar',
|
|
488
|
+
required: false
|
|
465
489
|
}
|
|
466
490
|
]
|
|
467
491
|
};
|
|
@@ -469,25 +493,222 @@ const select$8 = function EinsteinLlmGenerationsContentQualityRepresentationSele
|
|
|
469
493
|
function equals$6(existing, incoming) {
|
|
470
494
|
const existing_isToxicityDetected = existing.isToxicityDetected;
|
|
471
495
|
const incoming_isToxicityDetected = incoming.isToxicityDetected;
|
|
472
|
-
if
|
|
473
|
-
|
|
496
|
+
// if at least one of these optionals is defined
|
|
497
|
+
if (existing_isToxicityDetected !== undefined || incoming_isToxicityDetected !== undefined) {
|
|
498
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
499
|
+
// not equal
|
|
500
|
+
if (existing_isToxicityDetected === undefined || incoming_isToxicityDetected === undefined) {
|
|
501
|
+
return false;
|
|
502
|
+
}
|
|
503
|
+
if (!(existing_isToxicityDetected === incoming_isToxicityDetected)) {
|
|
504
|
+
return false;
|
|
505
|
+
}
|
|
474
506
|
}
|
|
475
507
|
return true;
|
|
476
508
|
}
|
|
477
509
|
|
|
478
|
-
const VERSION$5 = "
|
|
510
|
+
const VERSION$5 = "77af44a252cb5b45b4d9a8101368d2aa";
|
|
479
511
|
function validate$7(obj, path = 'EinsteinLlmGenerationsSafetyScoreRepresentation') {
|
|
480
512
|
const v_error = (() => {
|
|
481
513
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
482
514
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
483
515
|
}
|
|
484
|
-
obj.hateScore
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
516
|
+
if (obj.hateScore !== undefined) {
|
|
517
|
+
const obj_hateScore = obj.hateScore;
|
|
518
|
+
const path_hateScore = path + '.hateScore';
|
|
519
|
+
let obj_hateScore_union0 = null;
|
|
520
|
+
const obj_hateScore_union0_error = (() => {
|
|
521
|
+
if (typeof obj_hateScore !== 'number') {
|
|
522
|
+
return new TypeError('Expected "number" but received "' + typeof obj_hateScore + '" (at "' + path_hateScore + '")');
|
|
523
|
+
}
|
|
524
|
+
})();
|
|
525
|
+
if (obj_hateScore_union0_error != null) {
|
|
526
|
+
obj_hateScore_union0 = obj_hateScore_union0_error.message;
|
|
527
|
+
}
|
|
528
|
+
let obj_hateScore_union1 = null;
|
|
529
|
+
const obj_hateScore_union1_error = (() => {
|
|
530
|
+
if (obj_hateScore !== null) {
|
|
531
|
+
return new TypeError('Expected "null" but received "' + typeof obj_hateScore + '" (at "' + path_hateScore + '")');
|
|
532
|
+
}
|
|
533
|
+
})();
|
|
534
|
+
if (obj_hateScore_union1_error != null) {
|
|
535
|
+
obj_hateScore_union1 = obj_hateScore_union1_error.message;
|
|
536
|
+
}
|
|
537
|
+
if (obj_hateScore_union0 && obj_hateScore_union1) {
|
|
538
|
+
let message = 'Object doesn\'t match union (at "' + path_hateScore + '")';
|
|
539
|
+
message += '\n' + obj_hateScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
540
|
+
message += '\n' + obj_hateScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
541
|
+
return new TypeError(message);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
if (obj.physicalScore !== undefined) {
|
|
545
|
+
const obj_physicalScore = obj.physicalScore;
|
|
546
|
+
const path_physicalScore = path + '.physicalScore';
|
|
547
|
+
let obj_physicalScore_union0 = null;
|
|
548
|
+
const obj_physicalScore_union0_error = (() => {
|
|
549
|
+
if (typeof obj_physicalScore !== 'number') {
|
|
550
|
+
return new TypeError('Expected "number" but received "' + typeof obj_physicalScore + '" (at "' + path_physicalScore + '")');
|
|
551
|
+
}
|
|
552
|
+
})();
|
|
553
|
+
if (obj_physicalScore_union0_error != null) {
|
|
554
|
+
obj_physicalScore_union0 = obj_physicalScore_union0_error.message;
|
|
555
|
+
}
|
|
556
|
+
let obj_physicalScore_union1 = null;
|
|
557
|
+
const obj_physicalScore_union1_error = (() => {
|
|
558
|
+
if (obj_physicalScore !== null) {
|
|
559
|
+
return new TypeError('Expected "null" but received "' + typeof obj_physicalScore + '" (at "' + path_physicalScore + '")');
|
|
560
|
+
}
|
|
561
|
+
})();
|
|
562
|
+
if (obj_physicalScore_union1_error != null) {
|
|
563
|
+
obj_physicalScore_union1 = obj_physicalScore_union1_error.message;
|
|
564
|
+
}
|
|
565
|
+
if (obj_physicalScore_union0 && obj_physicalScore_union1) {
|
|
566
|
+
let message = 'Object doesn\'t match union (at "' + path_physicalScore + '")';
|
|
567
|
+
message += '\n' + obj_physicalScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
568
|
+
message += '\n' + obj_physicalScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
569
|
+
return new TypeError(message);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
if (obj.profanityScore !== undefined) {
|
|
573
|
+
const obj_profanityScore = obj.profanityScore;
|
|
574
|
+
const path_profanityScore = path + '.profanityScore';
|
|
575
|
+
let obj_profanityScore_union0 = null;
|
|
576
|
+
const obj_profanityScore_union0_error = (() => {
|
|
577
|
+
if (typeof obj_profanityScore !== 'number') {
|
|
578
|
+
return new TypeError('Expected "number" but received "' + typeof obj_profanityScore + '" (at "' + path_profanityScore + '")');
|
|
579
|
+
}
|
|
580
|
+
})();
|
|
581
|
+
if (obj_profanityScore_union0_error != null) {
|
|
582
|
+
obj_profanityScore_union0 = obj_profanityScore_union0_error.message;
|
|
583
|
+
}
|
|
584
|
+
let obj_profanityScore_union1 = null;
|
|
585
|
+
const obj_profanityScore_union1_error = (() => {
|
|
586
|
+
if (obj_profanityScore !== null) {
|
|
587
|
+
return new TypeError('Expected "null" but received "' + typeof obj_profanityScore + '" (at "' + path_profanityScore + '")');
|
|
588
|
+
}
|
|
589
|
+
})();
|
|
590
|
+
if (obj_profanityScore_union1_error != null) {
|
|
591
|
+
obj_profanityScore_union1 = obj_profanityScore_union1_error.message;
|
|
592
|
+
}
|
|
593
|
+
if (obj_profanityScore_union0 && obj_profanityScore_union1) {
|
|
594
|
+
let message = 'Object doesn\'t match union (at "' + path_profanityScore + '")';
|
|
595
|
+
message += '\n' + obj_profanityScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
596
|
+
message += '\n' + obj_profanityScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
597
|
+
return new TypeError(message);
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
if (obj.safetyScore !== undefined) {
|
|
601
|
+
const obj_safetyScore = obj.safetyScore;
|
|
602
|
+
const path_safetyScore = path + '.safetyScore';
|
|
603
|
+
let obj_safetyScore_union0 = null;
|
|
604
|
+
const obj_safetyScore_union0_error = (() => {
|
|
605
|
+
if (typeof obj_safetyScore !== 'number') {
|
|
606
|
+
return new TypeError('Expected "number" but received "' + typeof obj_safetyScore + '" (at "' + path_safetyScore + '")');
|
|
607
|
+
}
|
|
608
|
+
})();
|
|
609
|
+
if (obj_safetyScore_union0_error != null) {
|
|
610
|
+
obj_safetyScore_union0 = obj_safetyScore_union0_error.message;
|
|
611
|
+
}
|
|
612
|
+
let obj_safetyScore_union1 = null;
|
|
613
|
+
const obj_safetyScore_union1_error = (() => {
|
|
614
|
+
if (obj_safetyScore !== null) {
|
|
615
|
+
return new TypeError('Expected "null" but received "' + typeof obj_safetyScore + '" (at "' + path_safetyScore + '")');
|
|
616
|
+
}
|
|
617
|
+
})();
|
|
618
|
+
if (obj_safetyScore_union1_error != null) {
|
|
619
|
+
obj_safetyScore_union1 = obj_safetyScore_union1_error.message;
|
|
620
|
+
}
|
|
621
|
+
if (obj_safetyScore_union0 && obj_safetyScore_union1) {
|
|
622
|
+
let message = 'Object doesn\'t match union (at "' + path_safetyScore + '")';
|
|
623
|
+
message += '\n' + obj_safetyScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
624
|
+
message += '\n' + obj_safetyScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
625
|
+
return new TypeError(message);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
if (obj.sexualScore !== undefined) {
|
|
629
|
+
const obj_sexualScore = obj.sexualScore;
|
|
630
|
+
const path_sexualScore = path + '.sexualScore';
|
|
631
|
+
let obj_sexualScore_union0 = null;
|
|
632
|
+
const obj_sexualScore_union0_error = (() => {
|
|
633
|
+
if (typeof obj_sexualScore !== 'number') {
|
|
634
|
+
return new TypeError('Expected "number" but received "' + typeof obj_sexualScore + '" (at "' + path_sexualScore + '")');
|
|
635
|
+
}
|
|
636
|
+
})();
|
|
637
|
+
if (obj_sexualScore_union0_error != null) {
|
|
638
|
+
obj_sexualScore_union0 = obj_sexualScore_union0_error.message;
|
|
639
|
+
}
|
|
640
|
+
let obj_sexualScore_union1 = null;
|
|
641
|
+
const obj_sexualScore_union1_error = (() => {
|
|
642
|
+
if (obj_sexualScore !== null) {
|
|
643
|
+
return new TypeError('Expected "null" but received "' + typeof obj_sexualScore + '" (at "' + path_sexualScore + '")');
|
|
644
|
+
}
|
|
645
|
+
})();
|
|
646
|
+
if (obj_sexualScore_union1_error != null) {
|
|
647
|
+
obj_sexualScore_union1 = obj_sexualScore_union1_error.message;
|
|
648
|
+
}
|
|
649
|
+
if (obj_sexualScore_union0 && obj_sexualScore_union1) {
|
|
650
|
+
let message = 'Object doesn\'t match union (at "' + path_sexualScore + '")';
|
|
651
|
+
message += '\n' + obj_sexualScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
652
|
+
message += '\n' + obj_sexualScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
653
|
+
return new TypeError(message);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
if (obj.toxicityScore !== undefined) {
|
|
657
|
+
const obj_toxicityScore = obj.toxicityScore;
|
|
658
|
+
const path_toxicityScore = path + '.toxicityScore';
|
|
659
|
+
let obj_toxicityScore_union0 = null;
|
|
660
|
+
const obj_toxicityScore_union0_error = (() => {
|
|
661
|
+
if (typeof obj_toxicityScore !== 'number') {
|
|
662
|
+
return new TypeError('Expected "number" but received "' + typeof obj_toxicityScore + '" (at "' + path_toxicityScore + '")');
|
|
663
|
+
}
|
|
664
|
+
})();
|
|
665
|
+
if (obj_toxicityScore_union0_error != null) {
|
|
666
|
+
obj_toxicityScore_union0 = obj_toxicityScore_union0_error.message;
|
|
667
|
+
}
|
|
668
|
+
let obj_toxicityScore_union1 = null;
|
|
669
|
+
const obj_toxicityScore_union1_error = (() => {
|
|
670
|
+
if (obj_toxicityScore !== null) {
|
|
671
|
+
return new TypeError('Expected "null" but received "' + typeof obj_toxicityScore + '" (at "' + path_toxicityScore + '")');
|
|
672
|
+
}
|
|
673
|
+
})();
|
|
674
|
+
if (obj_toxicityScore_union1_error != null) {
|
|
675
|
+
obj_toxicityScore_union1 = obj_toxicityScore_union1_error.message;
|
|
676
|
+
}
|
|
677
|
+
if (obj_toxicityScore_union0 && obj_toxicityScore_union1) {
|
|
678
|
+
let message = 'Object doesn\'t match union (at "' + path_toxicityScore + '")';
|
|
679
|
+
message += '\n' + obj_toxicityScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
680
|
+
message += '\n' + obj_toxicityScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
681
|
+
return new TypeError(message);
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
if (obj.violenceScore !== undefined) {
|
|
685
|
+
const obj_violenceScore = obj.violenceScore;
|
|
686
|
+
const path_violenceScore = path + '.violenceScore';
|
|
687
|
+
let obj_violenceScore_union0 = null;
|
|
688
|
+
const obj_violenceScore_union0_error = (() => {
|
|
689
|
+
if (typeof obj_violenceScore !== 'number') {
|
|
690
|
+
return new TypeError('Expected "number" but received "' + typeof obj_violenceScore + '" (at "' + path_violenceScore + '")');
|
|
691
|
+
}
|
|
692
|
+
})();
|
|
693
|
+
if (obj_violenceScore_union0_error != null) {
|
|
694
|
+
obj_violenceScore_union0 = obj_violenceScore_union0_error.message;
|
|
695
|
+
}
|
|
696
|
+
let obj_violenceScore_union1 = null;
|
|
697
|
+
const obj_violenceScore_union1_error = (() => {
|
|
698
|
+
if (obj_violenceScore !== null) {
|
|
699
|
+
return new TypeError('Expected "null" but received "' + typeof obj_violenceScore + '" (at "' + path_violenceScore + '")');
|
|
700
|
+
}
|
|
701
|
+
})();
|
|
702
|
+
if (obj_violenceScore_union1_error != null) {
|
|
703
|
+
obj_violenceScore_union1 = obj_violenceScore_union1_error.message;
|
|
704
|
+
}
|
|
705
|
+
if (obj_violenceScore_union0 && obj_violenceScore_union1) {
|
|
706
|
+
let message = 'Object doesn\'t match union (at "' + path_violenceScore + '")';
|
|
707
|
+
message += '\n' + obj_violenceScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
708
|
+
message += '\n' + obj_violenceScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
709
|
+
return new TypeError(message);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
491
712
|
})();
|
|
492
713
|
return v_error === undefined ? null : v_error;
|
|
493
714
|
}
|
|
@@ -499,31 +720,38 @@ const select$7 = function EinsteinLlmGenerationsSafetyScoreRepresentationSelect(
|
|
|
499
720
|
selections: [
|
|
500
721
|
{
|
|
501
722
|
name: 'hateScore',
|
|
502
|
-
kind: 'Scalar'
|
|
723
|
+
kind: 'Scalar',
|
|
724
|
+
required: false
|
|
503
725
|
},
|
|
504
726
|
{
|
|
505
727
|
name: 'physicalScore',
|
|
506
|
-
kind: 'Scalar'
|
|
728
|
+
kind: 'Scalar',
|
|
729
|
+
required: false
|
|
507
730
|
},
|
|
508
731
|
{
|
|
509
732
|
name: 'profanityScore',
|
|
510
|
-
kind: 'Scalar'
|
|
733
|
+
kind: 'Scalar',
|
|
734
|
+
required: false
|
|
511
735
|
},
|
|
512
736
|
{
|
|
513
737
|
name: 'safetyScore',
|
|
514
|
-
kind: 'Scalar'
|
|
738
|
+
kind: 'Scalar',
|
|
739
|
+
required: false
|
|
515
740
|
},
|
|
516
741
|
{
|
|
517
742
|
name: 'sexualScore',
|
|
518
|
-
kind: 'Scalar'
|
|
743
|
+
kind: 'Scalar',
|
|
744
|
+
required: false
|
|
519
745
|
},
|
|
520
746
|
{
|
|
521
747
|
name: 'toxicityScore',
|
|
522
|
-
kind: 'Scalar'
|
|
748
|
+
kind: 'Scalar',
|
|
749
|
+
required: false
|
|
523
750
|
},
|
|
524
751
|
{
|
|
525
752
|
name: 'violenceScore',
|
|
526
|
-
kind: 'Scalar'
|
|
753
|
+
kind: 'Scalar',
|
|
754
|
+
required: false
|
|
527
755
|
}
|
|
528
756
|
]
|
|
529
757
|
};
|
|
@@ -531,43 +759,99 @@ const select$7 = function EinsteinLlmGenerationsSafetyScoreRepresentationSelect(
|
|
|
531
759
|
function equals$5(existing, incoming) {
|
|
532
760
|
const existing_hateScore = existing.hateScore;
|
|
533
761
|
const incoming_hateScore = incoming.hateScore;
|
|
534
|
-
if
|
|
535
|
-
|
|
762
|
+
// if at least one of these optionals is defined
|
|
763
|
+
if (existing_hateScore !== undefined || incoming_hateScore !== undefined) {
|
|
764
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
765
|
+
// not equal
|
|
766
|
+
if (existing_hateScore === undefined || incoming_hateScore === undefined) {
|
|
767
|
+
return false;
|
|
768
|
+
}
|
|
769
|
+
if (!(existing_hateScore === incoming_hateScore)) {
|
|
770
|
+
return false;
|
|
771
|
+
}
|
|
536
772
|
}
|
|
537
773
|
const existing_physicalScore = existing.physicalScore;
|
|
538
774
|
const incoming_physicalScore = incoming.physicalScore;
|
|
539
|
-
if
|
|
540
|
-
|
|
775
|
+
// if at least one of these optionals is defined
|
|
776
|
+
if (existing_physicalScore !== undefined || incoming_physicalScore !== undefined) {
|
|
777
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
778
|
+
// not equal
|
|
779
|
+
if (existing_physicalScore === undefined || incoming_physicalScore === undefined) {
|
|
780
|
+
return false;
|
|
781
|
+
}
|
|
782
|
+
if (!(existing_physicalScore === incoming_physicalScore)) {
|
|
783
|
+
return false;
|
|
784
|
+
}
|
|
541
785
|
}
|
|
542
786
|
const existing_profanityScore = existing.profanityScore;
|
|
543
787
|
const incoming_profanityScore = incoming.profanityScore;
|
|
544
|
-
if
|
|
545
|
-
|
|
788
|
+
// if at least one of these optionals is defined
|
|
789
|
+
if (existing_profanityScore !== undefined || incoming_profanityScore !== undefined) {
|
|
790
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
791
|
+
// not equal
|
|
792
|
+
if (existing_profanityScore === undefined || incoming_profanityScore === undefined) {
|
|
793
|
+
return false;
|
|
794
|
+
}
|
|
795
|
+
if (!(existing_profanityScore === incoming_profanityScore)) {
|
|
796
|
+
return false;
|
|
797
|
+
}
|
|
546
798
|
}
|
|
547
799
|
const existing_safetyScore = existing.safetyScore;
|
|
548
800
|
const incoming_safetyScore = incoming.safetyScore;
|
|
549
|
-
if
|
|
550
|
-
|
|
801
|
+
// if at least one of these optionals is defined
|
|
802
|
+
if (existing_safetyScore !== undefined || incoming_safetyScore !== undefined) {
|
|
803
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
804
|
+
// not equal
|
|
805
|
+
if (existing_safetyScore === undefined || incoming_safetyScore === undefined) {
|
|
806
|
+
return false;
|
|
807
|
+
}
|
|
808
|
+
if (!(existing_safetyScore === incoming_safetyScore)) {
|
|
809
|
+
return false;
|
|
810
|
+
}
|
|
551
811
|
}
|
|
552
812
|
const existing_sexualScore = existing.sexualScore;
|
|
553
813
|
const incoming_sexualScore = incoming.sexualScore;
|
|
554
|
-
if
|
|
555
|
-
|
|
814
|
+
// if at least one of these optionals is defined
|
|
815
|
+
if (existing_sexualScore !== undefined || incoming_sexualScore !== undefined) {
|
|
816
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
817
|
+
// not equal
|
|
818
|
+
if (existing_sexualScore === undefined || incoming_sexualScore === undefined) {
|
|
819
|
+
return false;
|
|
820
|
+
}
|
|
821
|
+
if (!(existing_sexualScore === incoming_sexualScore)) {
|
|
822
|
+
return false;
|
|
823
|
+
}
|
|
556
824
|
}
|
|
557
825
|
const existing_toxicityScore = existing.toxicityScore;
|
|
558
826
|
const incoming_toxicityScore = incoming.toxicityScore;
|
|
559
|
-
if
|
|
560
|
-
|
|
827
|
+
// if at least one of these optionals is defined
|
|
828
|
+
if (existing_toxicityScore !== undefined || incoming_toxicityScore !== undefined) {
|
|
829
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
830
|
+
// not equal
|
|
831
|
+
if (existing_toxicityScore === undefined || incoming_toxicityScore === undefined) {
|
|
832
|
+
return false;
|
|
833
|
+
}
|
|
834
|
+
if (!(existing_toxicityScore === incoming_toxicityScore)) {
|
|
835
|
+
return false;
|
|
836
|
+
}
|
|
561
837
|
}
|
|
562
838
|
const existing_violenceScore = existing.violenceScore;
|
|
563
839
|
const incoming_violenceScore = incoming.violenceScore;
|
|
564
|
-
if
|
|
565
|
-
|
|
840
|
+
// if at least one of these optionals is defined
|
|
841
|
+
if (existing_violenceScore !== undefined || incoming_violenceScore !== undefined) {
|
|
842
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
843
|
+
// not equal
|
|
844
|
+
if (existing_violenceScore === undefined || incoming_violenceScore === undefined) {
|
|
845
|
+
return false;
|
|
846
|
+
}
|
|
847
|
+
if (!(existing_violenceScore === incoming_violenceScore)) {
|
|
848
|
+
return false;
|
|
849
|
+
}
|
|
566
850
|
}
|
|
567
851
|
return true;
|
|
568
852
|
}
|
|
569
853
|
|
|
570
|
-
const VERSION$4 = "
|
|
854
|
+
const VERSION$4 = "aebe0f32437ab18bd126a1fb5ff48d9b";
|
|
571
855
|
function validate$6(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
|
|
572
856
|
const v_error = (() => {
|
|
573
857
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
@@ -576,10 +860,31 @@ function validate$6(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
|
|
|
576
860
|
if (obj.contentQualityRepresentation !== undefined) {
|
|
577
861
|
const obj_contentQualityRepresentation = obj.contentQualityRepresentation;
|
|
578
862
|
const path_contentQualityRepresentation = path + '.contentQualityRepresentation';
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
863
|
+
let obj_contentQualityRepresentation_union0 = null;
|
|
864
|
+
const obj_contentQualityRepresentation_union0_error = (() => {
|
|
865
|
+
const referencepath_contentQualityRepresentationValidationError = validate$8(obj_contentQualityRepresentation, path_contentQualityRepresentation);
|
|
866
|
+
if (referencepath_contentQualityRepresentationValidationError !== null) {
|
|
867
|
+
let message = 'Object doesn\'t match EinsteinLlmGenerationsContentQualityRepresentation (at "' + path_contentQualityRepresentation + '")\n';
|
|
868
|
+
message += referencepath_contentQualityRepresentationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
869
|
+
return new TypeError(message);
|
|
870
|
+
}
|
|
871
|
+
})();
|
|
872
|
+
if (obj_contentQualityRepresentation_union0_error != null) {
|
|
873
|
+
obj_contentQualityRepresentation_union0 = obj_contentQualityRepresentation_union0_error.message;
|
|
874
|
+
}
|
|
875
|
+
let obj_contentQualityRepresentation_union1 = null;
|
|
876
|
+
const obj_contentQualityRepresentation_union1_error = (() => {
|
|
877
|
+
if (obj_contentQualityRepresentation !== null) {
|
|
878
|
+
return new TypeError('Expected "null" but received "' + typeof obj_contentQualityRepresentation + '" (at "' + path_contentQualityRepresentation + '")');
|
|
879
|
+
}
|
|
880
|
+
})();
|
|
881
|
+
if (obj_contentQualityRepresentation_union1_error != null) {
|
|
882
|
+
obj_contentQualityRepresentation_union1 = obj_contentQualityRepresentation_union1_error.message;
|
|
883
|
+
}
|
|
884
|
+
if (obj_contentQualityRepresentation_union0 && obj_contentQualityRepresentation_union1) {
|
|
885
|
+
let message = 'Object doesn\'t match union (at "' + path_contentQualityRepresentation + '")';
|
|
886
|
+
message += '\n' + obj_contentQualityRepresentation_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
887
|
+
message += '\n' + obj_contentQualityRepresentation_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
583
888
|
return new TypeError(message);
|
|
584
889
|
}
|
|
585
890
|
}
|
|
@@ -596,10 +901,31 @@ function validate$6(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
|
|
|
596
901
|
if (obj.safetyScoreRepresentation !== undefined) {
|
|
597
902
|
const obj_safetyScoreRepresentation = obj.safetyScoreRepresentation;
|
|
598
903
|
const path_safetyScoreRepresentation = path + '.safetyScoreRepresentation';
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
904
|
+
let obj_safetyScoreRepresentation_union0 = null;
|
|
905
|
+
const obj_safetyScoreRepresentation_union0_error = (() => {
|
|
906
|
+
const referencepath_safetyScoreRepresentationValidationError = validate$7(obj_safetyScoreRepresentation, path_safetyScoreRepresentation);
|
|
907
|
+
if (referencepath_safetyScoreRepresentationValidationError !== null) {
|
|
908
|
+
let message = 'Object doesn\'t match EinsteinLlmGenerationsSafetyScoreRepresentation (at "' + path_safetyScoreRepresentation + '")\n';
|
|
909
|
+
message += referencepath_safetyScoreRepresentationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
910
|
+
return new TypeError(message);
|
|
911
|
+
}
|
|
912
|
+
})();
|
|
913
|
+
if (obj_safetyScoreRepresentation_union0_error != null) {
|
|
914
|
+
obj_safetyScoreRepresentation_union0 = obj_safetyScoreRepresentation_union0_error.message;
|
|
915
|
+
}
|
|
916
|
+
let obj_safetyScoreRepresentation_union1 = null;
|
|
917
|
+
const obj_safetyScoreRepresentation_union1_error = (() => {
|
|
918
|
+
if (obj_safetyScoreRepresentation !== null) {
|
|
919
|
+
return new TypeError('Expected "null" but received "' + typeof obj_safetyScoreRepresentation + '" (at "' + path_safetyScoreRepresentation + '")');
|
|
920
|
+
}
|
|
921
|
+
})();
|
|
922
|
+
if (obj_safetyScoreRepresentation_union1_error != null) {
|
|
923
|
+
obj_safetyScoreRepresentation_union1 = obj_safetyScoreRepresentation_union1_error.message;
|
|
924
|
+
}
|
|
925
|
+
if (obj_safetyScoreRepresentation_union0 && obj_safetyScoreRepresentation_union1) {
|
|
926
|
+
let message = 'Object doesn\'t match union (at "' + path_safetyScoreRepresentation + '")';
|
|
927
|
+
message += '\n' + obj_safetyScoreRepresentation_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
928
|
+
message += '\n' + obj_safetyScoreRepresentation_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
603
929
|
return new TypeError(message);
|
|
604
930
|
}
|
|
605
931
|
}
|
|
@@ -622,6 +948,7 @@ const select$6 = function EinsteinLlmGenerationItemRepresentationSelect() {
|
|
|
622
948
|
{
|
|
623
949
|
name: 'contentQualityRepresentation',
|
|
624
950
|
kind: 'Object',
|
|
951
|
+
nullable: true,
|
|
625
952
|
selections: EinsteinLlmGenerationsContentQualityRepresentation__selections,
|
|
626
953
|
required: false
|
|
627
954
|
},
|
|
@@ -636,6 +963,7 @@ const select$6 = function EinsteinLlmGenerationItemRepresentationSelect() {
|
|
|
636
963
|
{
|
|
637
964
|
name: 'safetyScoreRepresentation',
|
|
638
965
|
kind: 'Object',
|
|
966
|
+
nullable: true,
|
|
639
967
|
selections: EinsteinLlmGenerationsSafetyScoreRepresentation__selections,
|
|
640
968
|
required: false
|
|
641
969
|
},
|
|
@@ -671,7 +999,10 @@ function equals$4(existing, incoming) {
|
|
|
671
999
|
if (existing_contentQualityRepresentation === undefined || incoming_contentQualityRepresentation === undefined) {
|
|
672
1000
|
return false;
|
|
673
1001
|
}
|
|
674
|
-
if (!(
|
|
1002
|
+
if (!(existing_contentQualityRepresentation === incoming_contentQualityRepresentation
|
|
1003
|
+
|| (existing_contentQualityRepresentation != null &&
|
|
1004
|
+
incoming_contentQualityRepresentation != null &&
|
|
1005
|
+
equals$6(existing_contentQualityRepresentation, incoming_contentQualityRepresentation)))) {
|
|
675
1006
|
return false;
|
|
676
1007
|
}
|
|
677
1008
|
}
|
|
@@ -684,7 +1015,10 @@ function equals$4(existing, incoming) {
|
|
|
684
1015
|
if (existing_safetyScoreRepresentation === undefined || incoming_safetyScoreRepresentation === undefined) {
|
|
685
1016
|
return false;
|
|
686
1017
|
}
|
|
687
|
-
if (!(
|
|
1018
|
+
if (!(existing_safetyScoreRepresentation === incoming_safetyScoreRepresentation
|
|
1019
|
+
|| (existing_safetyScoreRepresentation != null &&
|
|
1020
|
+
incoming_safetyScoreRepresentation != null &&
|
|
1021
|
+
equals$5(existing_safetyScoreRepresentation, incoming_safetyScoreRepresentation)))) {
|
|
688
1022
|
return false;
|
|
689
1023
|
}
|
|
690
1024
|
}
|
|
@@ -941,7 +1275,7 @@ function ingestSuccess$1(luvio, resourceParams, response) {
|
|
|
941
1275
|
function createResourceRequest$1(config) {
|
|
942
1276
|
const headers = {};
|
|
943
1277
|
return {
|
|
944
|
-
baseUri: '/services/data/
|
|
1278
|
+
baseUri: '/services/data/v62.0',
|
|
945
1279
|
basePath: '/einstein/llm/prompt/generations',
|
|
946
1280
|
method: 'post',
|
|
947
1281
|
body: config.body,
|
|
@@ -1425,7 +1759,7 @@ function ingestSuccess(luvio, resourceParams, response) {
|
|
|
1425
1759
|
function createResourceRequest(config) {
|
|
1426
1760
|
const headers = {};
|
|
1427
1761
|
return {
|
|
1428
|
-
baseUri: '/services/data/
|
|
1762
|
+
baseUri: '/services/data/v62.0',
|
|
1429
1763
|
basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '/generations',
|
|
1430
1764
|
method: 'post',
|
|
1431
1765
|
body: config.body,
|
|
@@ -1520,4 +1854,4 @@ withDefaultLuvio((luvio) => {
|
|
|
1520
1854
|
});
|
|
1521
1855
|
|
|
1522
1856
|
export { createFeedback, createGenerations, createGenerationsForPromptTemplate };
|
|
1523
|
-
// version: 1.
|
|
1857
|
+
// version: 1.290.0-e2ccd0161
|