@salesforce/lds-adapters-service-einsteinllm 1.287.0-dev5 → 1.287.0-dev6
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 +382 -48
- 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 +383 -49
- package/src/raml/api.raml +18 -17
|
@@ -430,16 +430,39 @@ function validate$9(obj, path = 'EinsteinLlmGenerationsInputRepresentation') {
|
|
|
430
430
|
return v_error === undefined ? null : v_error;
|
|
431
431
|
}
|
|
432
432
|
|
|
433
|
-
const VERSION$6 = "
|
|
433
|
+
const VERSION$6 = "9ebac74e6f964c363d5fd1913df363af";
|
|
434
434
|
function validate$8(obj, path = 'EinsteinLlmGenerationsContentQualityRepresentation') {
|
|
435
435
|
const v_error = (() => {
|
|
436
436
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
437
437
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
438
438
|
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
439
|
+
if (obj.isToxicityDetected !== undefined) {
|
|
440
|
+
const obj_isToxicityDetected = obj.isToxicityDetected;
|
|
441
|
+
const path_isToxicityDetected = path + '.isToxicityDetected';
|
|
442
|
+
let obj_isToxicityDetected_union0 = null;
|
|
443
|
+
const obj_isToxicityDetected_union0_error = (() => {
|
|
444
|
+
if (typeof obj_isToxicityDetected !== 'boolean') {
|
|
445
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isToxicityDetected + '" (at "' + path_isToxicityDetected + '")');
|
|
446
|
+
}
|
|
447
|
+
})();
|
|
448
|
+
if (obj_isToxicityDetected_union0_error != null) {
|
|
449
|
+
obj_isToxicityDetected_union0 = obj_isToxicityDetected_union0_error.message;
|
|
450
|
+
}
|
|
451
|
+
let obj_isToxicityDetected_union1 = null;
|
|
452
|
+
const obj_isToxicityDetected_union1_error = (() => {
|
|
453
|
+
if (obj_isToxicityDetected !== null) {
|
|
454
|
+
return new TypeError('Expected "null" but received "' + typeof obj_isToxicityDetected + '" (at "' + path_isToxicityDetected + '")');
|
|
455
|
+
}
|
|
456
|
+
})();
|
|
457
|
+
if (obj_isToxicityDetected_union1_error != null) {
|
|
458
|
+
obj_isToxicityDetected_union1 = obj_isToxicityDetected_union1_error.message;
|
|
459
|
+
}
|
|
460
|
+
if (obj_isToxicityDetected_union0 && obj_isToxicityDetected_union1) {
|
|
461
|
+
let message = 'Object doesn\'t match union (at "' + path_isToxicityDetected + '")';
|
|
462
|
+
message += '\n' + obj_isToxicityDetected_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
463
|
+
message += '\n' + obj_isToxicityDetected_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
464
|
+
return new TypeError(message);
|
|
465
|
+
}
|
|
443
466
|
}
|
|
444
467
|
})();
|
|
445
468
|
return v_error === undefined ? null : v_error;
|
|
@@ -452,7 +475,8 @@ const select$8 = function EinsteinLlmGenerationsContentQualityRepresentationSele
|
|
|
452
475
|
selections: [
|
|
453
476
|
{
|
|
454
477
|
name: 'isToxicityDetected',
|
|
455
|
-
kind: 'Scalar'
|
|
478
|
+
kind: 'Scalar',
|
|
479
|
+
required: false
|
|
456
480
|
}
|
|
457
481
|
]
|
|
458
482
|
};
|
|
@@ -460,25 +484,222 @@ const select$8 = function EinsteinLlmGenerationsContentQualityRepresentationSele
|
|
|
460
484
|
function equals$6(existing, incoming) {
|
|
461
485
|
const existing_isToxicityDetected = existing.isToxicityDetected;
|
|
462
486
|
const incoming_isToxicityDetected = incoming.isToxicityDetected;
|
|
463
|
-
if
|
|
464
|
-
|
|
487
|
+
// if at least one of these optionals is defined
|
|
488
|
+
if (existing_isToxicityDetected !== undefined || incoming_isToxicityDetected !== undefined) {
|
|
489
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
490
|
+
// not equal
|
|
491
|
+
if (existing_isToxicityDetected === undefined || incoming_isToxicityDetected === undefined) {
|
|
492
|
+
return false;
|
|
493
|
+
}
|
|
494
|
+
if (!(existing_isToxicityDetected === incoming_isToxicityDetected)) {
|
|
495
|
+
return false;
|
|
496
|
+
}
|
|
465
497
|
}
|
|
466
498
|
return true;
|
|
467
499
|
}
|
|
468
500
|
|
|
469
|
-
const VERSION$5 = "
|
|
501
|
+
const VERSION$5 = "77af44a252cb5b45b4d9a8101368d2aa";
|
|
470
502
|
function validate$7(obj, path = 'EinsteinLlmGenerationsSafetyScoreRepresentation') {
|
|
471
503
|
const v_error = (() => {
|
|
472
504
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
473
505
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
474
506
|
}
|
|
475
|
-
obj.hateScore
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
507
|
+
if (obj.hateScore !== undefined) {
|
|
508
|
+
const obj_hateScore = obj.hateScore;
|
|
509
|
+
const path_hateScore = path + '.hateScore';
|
|
510
|
+
let obj_hateScore_union0 = null;
|
|
511
|
+
const obj_hateScore_union0_error = (() => {
|
|
512
|
+
if (typeof obj_hateScore !== 'number') {
|
|
513
|
+
return new TypeError('Expected "number" but received "' + typeof obj_hateScore + '" (at "' + path_hateScore + '")');
|
|
514
|
+
}
|
|
515
|
+
})();
|
|
516
|
+
if (obj_hateScore_union0_error != null) {
|
|
517
|
+
obj_hateScore_union0 = obj_hateScore_union0_error.message;
|
|
518
|
+
}
|
|
519
|
+
let obj_hateScore_union1 = null;
|
|
520
|
+
const obj_hateScore_union1_error = (() => {
|
|
521
|
+
if (obj_hateScore !== null) {
|
|
522
|
+
return new TypeError('Expected "null" but received "' + typeof obj_hateScore + '" (at "' + path_hateScore + '")');
|
|
523
|
+
}
|
|
524
|
+
})();
|
|
525
|
+
if (obj_hateScore_union1_error != null) {
|
|
526
|
+
obj_hateScore_union1 = obj_hateScore_union1_error.message;
|
|
527
|
+
}
|
|
528
|
+
if (obj_hateScore_union0 && obj_hateScore_union1) {
|
|
529
|
+
let message = 'Object doesn\'t match union (at "' + path_hateScore + '")';
|
|
530
|
+
message += '\n' + obj_hateScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
531
|
+
message += '\n' + obj_hateScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
532
|
+
return new TypeError(message);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
if (obj.physicalScore !== undefined) {
|
|
536
|
+
const obj_physicalScore = obj.physicalScore;
|
|
537
|
+
const path_physicalScore = path + '.physicalScore';
|
|
538
|
+
let obj_physicalScore_union0 = null;
|
|
539
|
+
const obj_physicalScore_union0_error = (() => {
|
|
540
|
+
if (typeof obj_physicalScore !== 'number') {
|
|
541
|
+
return new TypeError('Expected "number" but received "' + typeof obj_physicalScore + '" (at "' + path_physicalScore + '")');
|
|
542
|
+
}
|
|
543
|
+
})();
|
|
544
|
+
if (obj_physicalScore_union0_error != null) {
|
|
545
|
+
obj_physicalScore_union0 = obj_physicalScore_union0_error.message;
|
|
546
|
+
}
|
|
547
|
+
let obj_physicalScore_union1 = null;
|
|
548
|
+
const obj_physicalScore_union1_error = (() => {
|
|
549
|
+
if (obj_physicalScore !== null) {
|
|
550
|
+
return new TypeError('Expected "null" but received "' + typeof obj_physicalScore + '" (at "' + path_physicalScore + '")');
|
|
551
|
+
}
|
|
552
|
+
})();
|
|
553
|
+
if (obj_physicalScore_union1_error != null) {
|
|
554
|
+
obj_physicalScore_union1 = obj_physicalScore_union1_error.message;
|
|
555
|
+
}
|
|
556
|
+
if (obj_physicalScore_union0 && obj_physicalScore_union1) {
|
|
557
|
+
let message = 'Object doesn\'t match union (at "' + path_physicalScore + '")';
|
|
558
|
+
message += '\n' + obj_physicalScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
559
|
+
message += '\n' + obj_physicalScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
560
|
+
return new TypeError(message);
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
if (obj.profanityScore !== undefined) {
|
|
564
|
+
const obj_profanityScore = obj.profanityScore;
|
|
565
|
+
const path_profanityScore = path + '.profanityScore';
|
|
566
|
+
let obj_profanityScore_union0 = null;
|
|
567
|
+
const obj_profanityScore_union0_error = (() => {
|
|
568
|
+
if (typeof obj_profanityScore !== 'number') {
|
|
569
|
+
return new TypeError('Expected "number" but received "' + typeof obj_profanityScore + '" (at "' + path_profanityScore + '")');
|
|
570
|
+
}
|
|
571
|
+
})();
|
|
572
|
+
if (obj_profanityScore_union0_error != null) {
|
|
573
|
+
obj_profanityScore_union0 = obj_profanityScore_union0_error.message;
|
|
574
|
+
}
|
|
575
|
+
let obj_profanityScore_union1 = null;
|
|
576
|
+
const obj_profanityScore_union1_error = (() => {
|
|
577
|
+
if (obj_profanityScore !== null) {
|
|
578
|
+
return new TypeError('Expected "null" but received "' + typeof obj_profanityScore + '" (at "' + path_profanityScore + '")');
|
|
579
|
+
}
|
|
580
|
+
})();
|
|
581
|
+
if (obj_profanityScore_union1_error != null) {
|
|
582
|
+
obj_profanityScore_union1 = obj_profanityScore_union1_error.message;
|
|
583
|
+
}
|
|
584
|
+
if (obj_profanityScore_union0 && obj_profanityScore_union1) {
|
|
585
|
+
let message = 'Object doesn\'t match union (at "' + path_profanityScore + '")';
|
|
586
|
+
message += '\n' + obj_profanityScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
587
|
+
message += '\n' + obj_profanityScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
588
|
+
return new TypeError(message);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
if (obj.safetyScore !== undefined) {
|
|
592
|
+
const obj_safetyScore = obj.safetyScore;
|
|
593
|
+
const path_safetyScore = path + '.safetyScore';
|
|
594
|
+
let obj_safetyScore_union0 = null;
|
|
595
|
+
const obj_safetyScore_union0_error = (() => {
|
|
596
|
+
if (typeof obj_safetyScore !== 'number') {
|
|
597
|
+
return new TypeError('Expected "number" but received "' + typeof obj_safetyScore + '" (at "' + path_safetyScore + '")');
|
|
598
|
+
}
|
|
599
|
+
})();
|
|
600
|
+
if (obj_safetyScore_union0_error != null) {
|
|
601
|
+
obj_safetyScore_union0 = obj_safetyScore_union0_error.message;
|
|
602
|
+
}
|
|
603
|
+
let obj_safetyScore_union1 = null;
|
|
604
|
+
const obj_safetyScore_union1_error = (() => {
|
|
605
|
+
if (obj_safetyScore !== null) {
|
|
606
|
+
return new TypeError('Expected "null" but received "' + typeof obj_safetyScore + '" (at "' + path_safetyScore + '")');
|
|
607
|
+
}
|
|
608
|
+
})();
|
|
609
|
+
if (obj_safetyScore_union1_error != null) {
|
|
610
|
+
obj_safetyScore_union1 = obj_safetyScore_union1_error.message;
|
|
611
|
+
}
|
|
612
|
+
if (obj_safetyScore_union0 && obj_safetyScore_union1) {
|
|
613
|
+
let message = 'Object doesn\'t match union (at "' + path_safetyScore + '")';
|
|
614
|
+
message += '\n' + obj_safetyScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
615
|
+
message += '\n' + obj_safetyScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
616
|
+
return new TypeError(message);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
if (obj.sexualScore !== undefined) {
|
|
620
|
+
const obj_sexualScore = obj.sexualScore;
|
|
621
|
+
const path_sexualScore = path + '.sexualScore';
|
|
622
|
+
let obj_sexualScore_union0 = null;
|
|
623
|
+
const obj_sexualScore_union0_error = (() => {
|
|
624
|
+
if (typeof obj_sexualScore !== 'number') {
|
|
625
|
+
return new TypeError('Expected "number" but received "' + typeof obj_sexualScore + '" (at "' + path_sexualScore + '")');
|
|
626
|
+
}
|
|
627
|
+
})();
|
|
628
|
+
if (obj_sexualScore_union0_error != null) {
|
|
629
|
+
obj_sexualScore_union0 = obj_sexualScore_union0_error.message;
|
|
630
|
+
}
|
|
631
|
+
let obj_sexualScore_union1 = null;
|
|
632
|
+
const obj_sexualScore_union1_error = (() => {
|
|
633
|
+
if (obj_sexualScore !== null) {
|
|
634
|
+
return new TypeError('Expected "null" but received "' + typeof obj_sexualScore + '" (at "' + path_sexualScore + '")');
|
|
635
|
+
}
|
|
636
|
+
})();
|
|
637
|
+
if (obj_sexualScore_union1_error != null) {
|
|
638
|
+
obj_sexualScore_union1 = obj_sexualScore_union1_error.message;
|
|
639
|
+
}
|
|
640
|
+
if (obj_sexualScore_union0 && obj_sexualScore_union1) {
|
|
641
|
+
let message = 'Object doesn\'t match union (at "' + path_sexualScore + '")';
|
|
642
|
+
message += '\n' + obj_sexualScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
643
|
+
message += '\n' + obj_sexualScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
644
|
+
return new TypeError(message);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
if (obj.toxicityScore !== undefined) {
|
|
648
|
+
const obj_toxicityScore = obj.toxicityScore;
|
|
649
|
+
const path_toxicityScore = path + '.toxicityScore';
|
|
650
|
+
let obj_toxicityScore_union0 = null;
|
|
651
|
+
const obj_toxicityScore_union0_error = (() => {
|
|
652
|
+
if (typeof obj_toxicityScore !== 'number') {
|
|
653
|
+
return new TypeError('Expected "number" but received "' + typeof obj_toxicityScore + '" (at "' + path_toxicityScore + '")');
|
|
654
|
+
}
|
|
655
|
+
})();
|
|
656
|
+
if (obj_toxicityScore_union0_error != null) {
|
|
657
|
+
obj_toxicityScore_union0 = obj_toxicityScore_union0_error.message;
|
|
658
|
+
}
|
|
659
|
+
let obj_toxicityScore_union1 = null;
|
|
660
|
+
const obj_toxicityScore_union1_error = (() => {
|
|
661
|
+
if (obj_toxicityScore !== null) {
|
|
662
|
+
return new TypeError('Expected "null" but received "' + typeof obj_toxicityScore + '" (at "' + path_toxicityScore + '")');
|
|
663
|
+
}
|
|
664
|
+
})();
|
|
665
|
+
if (obj_toxicityScore_union1_error != null) {
|
|
666
|
+
obj_toxicityScore_union1 = obj_toxicityScore_union1_error.message;
|
|
667
|
+
}
|
|
668
|
+
if (obj_toxicityScore_union0 && obj_toxicityScore_union1) {
|
|
669
|
+
let message = 'Object doesn\'t match union (at "' + path_toxicityScore + '")';
|
|
670
|
+
message += '\n' + obj_toxicityScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
671
|
+
message += '\n' + obj_toxicityScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
672
|
+
return new TypeError(message);
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
if (obj.violenceScore !== undefined) {
|
|
676
|
+
const obj_violenceScore = obj.violenceScore;
|
|
677
|
+
const path_violenceScore = path + '.violenceScore';
|
|
678
|
+
let obj_violenceScore_union0 = null;
|
|
679
|
+
const obj_violenceScore_union0_error = (() => {
|
|
680
|
+
if (typeof obj_violenceScore !== 'number') {
|
|
681
|
+
return new TypeError('Expected "number" but received "' + typeof obj_violenceScore + '" (at "' + path_violenceScore + '")');
|
|
682
|
+
}
|
|
683
|
+
})();
|
|
684
|
+
if (obj_violenceScore_union0_error != null) {
|
|
685
|
+
obj_violenceScore_union0 = obj_violenceScore_union0_error.message;
|
|
686
|
+
}
|
|
687
|
+
let obj_violenceScore_union1 = null;
|
|
688
|
+
const obj_violenceScore_union1_error = (() => {
|
|
689
|
+
if (obj_violenceScore !== null) {
|
|
690
|
+
return new TypeError('Expected "null" but received "' + typeof obj_violenceScore + '" (at "' + path_violenceScore + '")');
|
|
691
|
+
}
|
|
692
|
+
})();
|
|
693
|
+
if (obj_violenceScore_union1_error != null) {
|
|
694
|
+
obj_violenceScore_union1 = obj_violenceScore_union1_error.message;
|
|
695
|
+
}
|
|
696
|
+
if (obj_violenceScore_union0 && obj_violenceScore_union1) {
|
|
697
|
+
let message = 'Object doesn\'t match union (at "' + path_violenceScore + '")';
|
|
698
|
+
message += '\n' + obj_violenceScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
699
|
+
message += '\n' + obj_violenceScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
700
|
+
return new TypeError(message);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
482
703
|
})();
|
|
483
704
|
return v_error === undefined ? null : v_error;
|
|
484
705
|
}
|
|
@@ -490,31 +711,38 @@ const select$7 = function EinsteinLlmGenerationsSafetyScoreRepresentationSelect(
|
|
|
490
711
|
selections: [
|
|
491
712
|
{
|
|
492
713
|
name: 'hateScore',
|
|
493
|
-
kind: 'Scalar'
|
|
714
|
+
kind: 'Scalar',
|
|
715
|
+
required: false
|
|
494
716
|
},
|
|
495
717
|
{
|
|
496
718
|
name: 'physicalScore',
|
|
497
|
-
kind: 'Scalar'
|
|
719
|
+
kind: 'Scalar',
|
|
720
|
+
required: false
|
|
498
721
|
},
|
|
499
722
|
{
|
|
500
723
|
name: 'profanityScore',
|
|
501
|
-
kind: 'Scalar'
|
|
724
|
+
kind: 'Scalar',
|
|
725
|
+
required: false
|
|
502
726
|
},
|
|
503
727
|
{
|
|
504
728
|
name: 'safetyScore',
|
|
505
|
-
kind: 'Scalar'
|
|
729
|
+
kind: 'Scalar',
|
|
730
|
+
required: false
|
|
506
731
|
},
|
|
507
732
|
{
|
|
508
733
|
name: 'sexualScore',
|
|
509
|
-
kind: 'Scalar'
|
|
734
|
+
kind: 'Scalar',
|
|
735
|
+
required: false
|
|
510
736
|
},
|
|
511
737
|
{
|
|
512
738
|
name: 'toxicityScore',
|
|
513
|
-
kind: 'Scalar'
|
|
739
|
+
kind: 'Scalar',
|
|
740
|
+
required: false
|
|
514
741
|
},
|
|
515
742
|
{
|
|
516
743
|
name: 'violenceScore',
|
|
517
|
-
kind: 'Scalar'
|
|
744
|
+
kind: 'Scalar',
|
|
745
|
+
required: false
|
|
518
746
|
}
|
|
519
747
|
]
|
|
520
748
|
};
|
|
@@ -522,43 +750,99 @@ const select$7 = function EinsteinLlmGenerationsSafetyScoreRepresentationSelect(
|
|
|
522
750
|
function equals$5(existing, incoming) {
|
|
523
751
|
const existing_hateScore = existing.hateScore;
|
|
524
752
|
const incoming_hateScore = incoming.hateScore;
|
|
525
|
-
if
|
|
526
|
-
|
|
753
|
+
// if at least one of these optionals is defined
|
|
754
|
+
if (existing_hateScore !== undefined || incoming_hateScore !== undefined) {
|
|
755
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
756
|
+
// not equal
|
|
757
|
+
if (existing_hateScore === undefined || incoming_hateScore === undefined) {
|
|
758
|
+
return false;
|
|
759
|
+
}
|
|
760
|
+
if (!(existing_hateScore === incoming_hateScore)) {
|
|
761
|
+
return false;
|
|
762
|
+
}
|
|
527
763
|
}
|
|
528
764
|
const existing_physicalScore = existing.physicalScore;
|
|
529
765
|
const incoming_physicalScore = incoming.physicalScore;
|
|
530
|
-
if
|
|
531
|
-
|
|
766
|
+
// if at least one of these optionals is defined
|
|
767
|
+
if (existing_physicalScore !== undefined || incoming_physicalScore !== undefined) {
|
|
768
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
769
|
+
// not equal
|
|
770
|
+
if (existing_physicalScore === undefined || incoming_physicalScore === undefined) {
|
|
771
|
+
return false;
|
|
772
|
+
}
|
|
773
|
+
if (!(existing_physicalScore === incoming_physicalScore)) {
|
|
774
|
+
return false;
|
|
775
|
+
}
|
|
532
776
|
}
|
|
533
777
|
const existing_profanityScore = existing.profanityScore;
|
|
534
778
|
const incoming_profanityScore = incoming.profanityScore;
|
|
535
|
-
if
|
|
536
|
-
|
|
779
|
+
// if at least one of these optionals is defined
|
|
780
|
+
if (existing_profanityScore !== undefined || incoming_profanityScore !== undefined) {
|
|
781
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
782
|
+
// not equal
|
|
783
|
+
if (existing_profanityScore === undefined || incoming_profanityScore === undefined) {
|
|
784
|
+
return false;
|
|
785
|
+
}
|
|
786
|
+
if (!(existing_profanityScore === incoming_profanityScore)) {
|
|
787
|
+
return false;
|
|
788
|
+
}
|
|
537
789
|
}
|
|
538
790
|
const existing_safetyScore = existing.safetyScore;
|
|
539
791
|
const incoming_safetyScore = incoming.safetyScore;
|
|
540
|
-
if
|
|
541
|
-
|
|
792
|
+
// if at least one of these optionals is defined
|
|
793
|
+
if (existing_safetyScore !== undefined || incoming_safetyScore !== undefined) {
|
|
794
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
795
|
+
// not equal
|
|
796
|
+
if (existing_safetyScore === undefined || incoming_safetyScore === undefined) {
|
|
797
|
+
return false;
|
|
798
|
+
}
|
|
799
|
+
if (!(existing_safetyScore === incoming_safetyScore)) {
|
|
800
|
+
return false;
|
|
801
|
+
}
|
|
542
802
|
}
|
|
543
803
|
const existing_sexualScore = existing.sexualScore;
|
|
544
804
|
const incoming_sexualScore = incoming.sexualScore;
|
|
545
|
-
if
|
|
546
|
-
|
|
805
|
+
// if at least one of these optionals is defined
|
|
806
|
+
if (existing_sexualScore !== undefined || incoming_sexualScore !== undefined) {
|
|
807
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
808
|
+
// not equal
|
|
809
|
+
if (existing_sexualScore === undefined || incoming_sexualScore === undefined) {
|
|
810
|
+
return false;
|
|
811
|
+
}
|
|
812
|
+
if (!(existing_sexualScore === incoming_sexualScore)) {
|
|
813
|
+
return false;
|
|
814
|
+
}
|
|
547
815
|
}
|
|
548
816
|
const existing_toxicityScore = existing.toxicityScore;
|
|
549
817
|
const incoming_toxicityScore = incoming.toxicityScore;
|
|
550
|
-
if
|
|
551
|
-
|
|
818
|
+
// if at least one of these optionals is defined
|
|
819
|
+
if (existing_toxicityScore !== undefined || incoming_toxicityScore !== undefined) {
|
|
820
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
821
|
+
// not equal
|
|
822
|
+
if (existing_toxicityScore === undefined || incoming_toxicityScore === undefined) {
|
|
823
|
+
return false;
|
|
824
|
+
}
|
|
825
|
+
if (!(existing_toxicityScore === incoming_toxicityScore)) {
|
|
826
|
+
return false;
|
|
827
|
+
}
|
|
552
828
|
}
|
|
553
829
|
const existing_violenceScore = existing.violenceScore;
|
|
554
830
|
const incoming_violenceScore = incoming.violenceScore;
|
|
555
|
-
if
|
|
556
|
-
|
|
831
|
+
// if at least one of these optionals is defined
|
|
832
|
+
if (existing_violenceScore !== undefined || incoming_violenceScore !== undefined) {
|
|
833
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
834
|
+
// not equal
|
|
835
|
+
if (existing_violenceScore === undefined || incoming_violenceScore === undefined) {
|
|
836
|
+
return false;
|
|
837
|
+
}
|
|
838
|
+
if (!(existing_violenceScore === incoming_violenceScore)) {
|
|
839
|
+
return false;
|
|
840
|
+
}
|
|
557
841
|
}
|
|
558
842
|
return true;
|
|
559
843
|
}
|
|
560
844
|
|
|
561
|
-
const VERSION$4 = "
|
|
845
|
+
const VERSION$4 = "aebe0f32437ab18bd126a1fb5ff48d9b";
|
|
562
846
|
function validate$6(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
|
|
563
847
|
const v_error = (() => {
|
|
564
848
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
@@ -567,10 +851,31 @@ function validate$6(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
|
|
|
567
851
|
if (obj.contentQualityRepresentation !== undefined) {
|
|
568
852
|
const obj_contentQualityRepresentation = obj.contentQualityRepresentation;
|
|
569
853
|
const path_contentQualityRepresentation = path + '.contentQualityRepresentation';
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
854
|
+
let obj_contentQualityRepresentation_union0 = null;
|
|
855
|
+
const obj_contentQualityRepresentation_union0_error = (() => {
|
|
856
|
+
const referencepath_contentQualityRepresentationValidationError = validate$8(obj_contentQualityRepresentation, path_contentQualityRepresentation);
|
|
857
|
+
if (referencepath_contentQualityRepresentationValidationError !== null) {
|
|
858
|
+
let message = 'Object doesn\'t match EinsteinLlmGenerationsContentQualityRepresentation (at "' + path_contentQualityRepresentation + '")\n';
|
|
859
|
+
message += referencepath_contentQualityRepresentationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
860
|
+
return new TypeError(message);
|
|
861
|
+
}
|
|
862
|
+
})();
|
|
863
|
+
if (obj_contentQualityRepresentation_union0_error != null) {
|
|
864
|
+
obj_contentQualityRepresentation_union0 = obj_contentQualityRepresentation_union0_error.message;
|
|
865
|
+
}
|
|
866
|
+
let obj_contentQualityRepresentation_union1 = null;
|
|
867
|
+
const obj_contentQualityRepresentation_union1_error = (() => {
|
|
868
|
+
if (obj_contentQualityRepresentation !== null) {
|
|
869
|
+
return new TypeError('Expected "null" but received "' + typeof obj_contentQualityRepresentation + '" (at "' + path_contentQualityRepresentation + '")');
|
|
870
|
+
}
|
|
871
|
+
})();
|
|
872
|
+
if (obj_contentQualityRepresentation_union1_error != null) {
|
|
873
|
+
obj_contentQualityRepresentation_union1 = obj_contentQualityRepresentation_union1_error.message;
|
|
874
|
+
}
|
|
875
|
+
if (obj_contentQualityRepresentation_union0 && obj_contentQualityRepresentation_union1) {
|
|
876
|
+
let message = 'Object doesn\'t match union (at "' + path_contentQualityRepresentation + '")';
|
|
877
|
+
message += '\n' + obj_contentQualityRepresentation_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
878
|
+
message += '\n' + obj_contentQualityRepresentation_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
574
879
|
return new TypeError(message);
|
|
575
880
|
}
|
|
576
881
|
}
|
|
@@ -587,10 +892,31 @@ function validate$6(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
|
|
|
587
892
|
if (obj.safetyScoreRepresentation !== undefined) {
|
|
588
893
|
const obj_safetyScoreRepresentation = obj.safetyScoreRepresentation;
|
|
589
894
|
const path_safetyScoreRepresentation = path + '.safetyScoreRepresentation';
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
895
|
+
let obj_safetyScoreRepresentation_union0 = null;
|
|
896
|
+
const obj_safetyScoreRepresentation_union0_error = (() => {
|
|
897
|
+
const referencepath_safetyScoreRepresentationValidationError = validate$7(obj_safetyScoreRepresentation, path_safetyScoreRepresentation);
|
|
898
|
+
if (referencepath_safetyScoreRepresentationValidationError !== null) {
|
|
899
|
+
let message = 'Object doesn\'t match EinsteinLlmGenerationsSafetyScoreRepresentation (at "' + path_safetyScoreRepresentation + '")\n';
|
|
900
|
+
message += referencepath_safetyScoreRepresentationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
901
|
+
return new TypeError(message);
|
|
902
|
+
}
|
|
903
|
+
})();
|
|
904
|
+
if (obj_safetyScoreRepresentation_union0_error != null) {
|
|
905
|
+
obj_safetyScoreRepresentation_union0 = obj_safetyScoreRepresentation_union0_error.message;
|
|
906
|
+
}
|
|
907
|
+
let obj_safetyScoreRepresentation_union1 = null;
|
|
908
|
+
const obj_safetyScoreRepresentation_union1_error = (() => {
|
|
909
|
+
if (obj_safetyScoreRepresentation !== null) {
|
|
910
|
+
return new TypeError('Expected "null" but received "' + typeof obj_safetyScoreRepresentation + '" (at "' + path_safetyScoreRepresentation + '")');
|
|
911
|
+
}
|
|
912
|
+
})();
|
|
913
|
+
if (obj_safetyScoreRepresentation_union1_error != null) {
|
|
914
|
+
obj_safetyScoreRepresentation_union1 = obj_safetyScoreRepresentation_union1_error.message;
|
|
915
|
+
}
|
|
916
|
+
if (obj_safetyScoreRepresentation_union0 && obj_safetyScoreRepresentation_union1) {
|
|
917
|
+
let message = 'Object doesn\'t match union (at "' + path_safetyScoreRepresentation + '")';
|
|
918
|
+
message += '\n' + obj_safetyScoreRepresentation_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
919
|
+
message += '\n' + obj_safetyScoreRepresentation_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
594
920
|
return new TypeError(message);
|
|
595
921
|
}
|
|
596
922
|
}
|
|
@@ -613,6 +939,7 @@ const select$6 = function EinsteinLlmGenerationItemRepresentationSelect() {
|
|
|
613
939
|
{
|
|
614
940
|
name: 'contentQualityRepresentation',
|
|
615
941
|
kind: 'Object',
|
|
942
|
+
nullable: true,
|
|
616
943
|
selections: EinsteinLlmGenerationsContentQualityRepresentation__selections,
|
|
617
944
|
required: false
|
|
618
945
|
},
|
|
@@ -627,6 +954,7 @@ const select$6 = function EinsteinLlmGenerationItemRepresentationSelect() {
|
|
|
627
954
|
{
|
|
628
955
|
name: 'safetyScoreRepresentation',
|
|
629
956
|
kind: 'Object',
|
|
957
|
+
nullable: true,
|
|
630
958
|
selections: EinsteinLlmGenerationsSafetyScoreRepresentation__selections,
|
|
631
959
|
required: false
|
|
632
960
|
},
|
|
@@ -662,7 +990,10 @@ function equals$4(existing, incoming) {
|
|
|
662
990
|
if (existing_contentQualityRepresentation === undefined || incoming_contentQualityRepresentation === undefined) {
|
|
663
991
|
return false;
|
|
664
992
|
}
|
|
665
|
-
if (!(
|
|
993
|
+
if (!(existing_contentQualityRepresentation === incoming_contentQualityRepresentation
|
|
994
|
+
|| (existing_contentQualityRepresentation != null &&
|
|
995
|
+
incoming_contentQualityRepresentation != null &&
|
|
996
|
+
equals$6(existing_contentQualityRepresentation, incoming_contentQualityRepresentation)))) {
|
|
666
997
|
return false;
|
|
667
998
|
}
|
|
668
999
|
}
|
|
@@ -675,7 +1006,10 @@ function equals$4(existing, incoming) {
|
|
|
675
1006
|
if (existing_safetyScoreRepresentation === undefined || incoming_safetyScoreRepresentation === undefined) {
|
|
676
1007
|
return false;
|
|
677
1008
|
}
|
|
678
|
-
if (!(
|
|
1009
|
+
if (!(existing_safetyScoreRepresentation === incoming_safetyScoreRepresentation
|
|
1010
|
+
|| (existing_safetyScoreRepresentation != null &&
|
|
1011
|
+
incoming_safetyScoreRepresentation != null &&
|
|
1012
|
+
equals$5(existing_safetyScoreRepresentation, incoming_safetyScoreRepresentation)))) {
|
|
679
1013
|
return false;
|
|
680
1014
|
}
|
|
681
1015
|
}
|
package/dist/es/es2018/types/src/generated/types/EinsteinLlmGenerationItemRepresentation.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EinsteinLlmGenerationsContentQualityRepresentation as EinsteinLlmGenerationsContentQualityRepresentation_EinsteinLlmGenerationsContentQualityRepresentation } from './EinsteinLlmGenerationsContentQualityRepresentation';
|
|
2
2
|
import { EinsteinLlmGenerationsSafetyScoreRepresentation as EinsteinLlmGenerationsSafetyScoreRepresentation_EinsteinLlmGenerationsSafetyScoreRepresentation } from './EinsteinLlmGenerationsSafetyScoreRepresentation';
|
|
3
3
|
import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
|
|
4
|
-
export declare const VERSION = "
|
|
4
|
+
export declare const VERSION = "aebe0f32437ab18bd126a1fb5ff48d9b";
|
|
5
5
|
export declare function validate(obj: any, path?: string): TypeError | null;
|
|
6
6
|
export declare const RepresentationType: string;
|
|
7
7
|
export declare function normalize(input: EinsteinLlmGenerationItemRepresentation, existing: EinsteinLlmGenerationItemRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): EinsteinLlmGenerationItemRepresentationNormalized;
|
|
@@ -16,12 +16,14 @@ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableSto
|
|
|
16
16
|
* (none)
|
|
17
17
|
*/
|
|
18
18
|
export interface EinsteinLlmGenerationItemRepresentationNormalized {
|
|
19
|
-
|
|
19
|
+
/** Generations Content Quality Representation */
|
|
20
|
+
contentQualityRepresentation?: EinsteinLlmGenerationsContentQualityRepresentation_EinsteinLlmGenerationsContentQualityRepresentation | null;
|
|
20
21
|
/** Any provider specific attributes will be included as part of this object */
|
|
21
22
|
parameters: string;
|
|
22
23
|
/** Generations Response Id */
|
|
23
24
|
responseId: string;
|
|
24
|
-
|
|
25
|
+
/** Generations Safety Score Representation */
|
|
26
|
+
safetyScoreRepresentation?: EinsteinLlmGenerationsSafetyScoreRepresentation_EinsteinLlmGenerationsSafetyScoreRepresentation | null;
|
|
25
27
|
/** Text */
|
|
26
28
|
text: string;
|
|
27
29
|
}
|
|
@@ -32,9 +34,9 @@ export interface EinsteinLlmGenerationItemRepresentationNormalized {
|
|
|
32
34
|
* (none)
|
|
33
35
|
*/
|
|
34
36
|
export interface EinsteinLlmGenerationItemRepresentation {
|
|
35
|
-
contentQualityRepresentation?: EinsteinLlmGenerationsContentQualityRepresentation_EinsteinLlmGenerationsContentQualityRepresentation;
|
|
37
|
+
contentQualityRepresentation?: EinsteinLlmGenerationsContentQualityRepresentation_EinsteinLlmGenerationsContentQualityRepresentation | null;
|
|
36
38
|
parameters: string;
|
|
37
39
|
responseId: string;
|
|
38
|
-
safetyScoreRepresentation?: EinsteinLlmGenerationsSafetyScoreRepresentation_EinsteinLlmGenerationsSafetyScoreRepresentation;
|
|
40
|
+
safetyScoreRepresentation?: EinsteinLlmGenerationsSafetyScoreRepresentation_EinsteinLlmGenerationsSafetyScoreRepresentation | null;
|
|
39
41
|
text: string;
|
|
40
42
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
|
|
2
|
-
export declare const VERSION = "
|
|
2
|
+
export declare const VERSION = "9ebac74e6f964c363d5fd1913df363af";
|
|
3
3
|
export declare function validate(obj: any, path?: string): TypeError | null;
|
|
4
4
|
export declare const RepresentationType: string;
|
|
5
5
|
export declare function normalize(input: EinsteinLlmGenerationsContentQualityRepresentation, existing: EinsteinLlmGenerationsContentQualityRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): EinsteinLlmGenerationsContentQualityRepresentationNormalized;
|
|
@@ -15,7 +15,7 @@ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableSto
|
|
|
15
15
|
*/
|
|
16
16
|
export interface EinsteinLlmGenerationsContentQualityRepresentationNormalized {
|
|
17
17
|
/** Content Quality */
|
|
18
|
-
isToxicityDetected
|
|
18
|
+
isToxicityDetected?: boolean | null;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Output of a einstein llm generation content quality representation
|
|
@@ -24,5 +24,5 @@ export interface EinsteinLlmGenerationsContentQualityRepresentationNormalized {
|
|
|
24
24
|
* (none)
|
|
25
25
|
*/
|
|
26
26
|
export interface EinsteinLlmGenerationsContentQualityRepresentation {
|
|
27
|
-
isToxicityDetected
|
|
27
|
+
isToxicityDetected?: boolean | null;
|
|
28
28
|
}
|