@salesforce/lds-adapters-sfap-einstein-ai-gateway 1.262.4 → 1.264.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/sfap-einstein-ai-gateway.js +70 -13
- package/dist/es/es2018/types/src/generated/adapters/registerFeedback.d.ts +1 -1
- package/dist/es/es2018/types/src/generated/resources/postAiGptV1Feedback.d.ts +1 -1
- package/dist/es/es2018/types/src/generated/types/FeedbackRequest.d.ts +3 -3
- package/dist/es/es2018/types/src/generated/types/GenerationResponseGenerations.d.ts +3 -3
- package/dist/es/es2018/types/src/generated/types/SafetyScoreRepresentation.d.ts +3 -3
- package/package.json +3 -3
- package/sfdc/index.js +71 -14
- package/src/raml/api.raml +3 -3
|
@@ -365,7 +365,7 @@ function equals$4(existing, incoming) {
|
|
|
365
365
|
return true;
|
|
366
366
|
}
|
|
367
367
|
|
|
368
|
-
const VERSION$3 = "
|
|
368
|
+
const VERSION$3 = "24a5fffc6e46c3c67de0b0430d230c56";
|
|
369
369
|
function validate$3(obj, path = 'SafetyScoreRepresentation') {
|
|
370
370
|
const v_error = (() => {
|
|
371
371
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
@@ -374,10 +374,31 @@ function validate$3(obj, path = 'SafetyScoreRepresentation') {
|
|
|
374
374
|
if (obj.category_scores !== undefined) {
|
|
375
375
|
const obj_category_scores = obj.category_scores;
|
|
376
376
|
const path_category_scores = path + '.category_scores';
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
377
|
+
let obj_category_scores_union0 = null;
|
|
378
|
+
const obj_category_scores_union0_error = (() => {
|
|
379
|
+
const referencepath_category_scoresValidationError = validate$4(obj_category_scores, path_category_scores);
|
|
380
|
+
if (referencepath_category_scoresValidationError !== null) {
|
|
381
|
+
let message = 'Object doesn\'t match SafetyCategoryScores (at "' + path_category_scores + '")\n';
|
|
382
|
+
message += referencepath_category_scoresValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
383
|
+
return new TypeError(message);
|
|
384
|
+
}
|
|
385
|
+
})();
|
|
386
|
+
if (obj_category_scores_union0_error != null) {
|
|
387
|
+
obj_category_scores_union0 = obj_category_scores_union0_error.message;
|
|
388
|
+
}
|
|
389
|
+
let obj_category_scores_union1 = null;
|
|
390
|
+
const obj_category_scores_union1_error = (() => {
|
|
391
|
+
if (obj_category_scores !== null) {
|
|
392
|
+
return new TypeError('Expected "null" but received "' + typeof obj_category_scores + '" (at "' + path_category_scores + '")');
|
|
393
|
+
}
|
|
394
|
+
})();
|
|
395
|
+
if (obj_category_scores_union1_error != null) {
|
|
396
|
+
obj_category_scores_union1 = obj_category_scores_union1_error.message;
|
|
397
|
+
}
|
|
398
|
+
if (obj_category_scores_union0 && obj_category_scores_union1) {
|
|
399
|
+
let message = 'Object doesn\'t match union (at "' + path_category_scores + '")';
|
|
400
|
+
message += '\n' + obj_category_scores_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
401
|
+
message += '\n' + obj_category_scores_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
381
402
|
return new TypeError(message);
|
|
382
403
|
}
|
|
383
404
|
}
|
|
@@ -401,6 +422,7 @@ const select$5 = function SafetyScoreRepresentationSelect() {
|
|
|
401
422
|
{
|
|
402
423
|
name: 'category_scores',
|
|
403
424
|
kind: 'Object',
|
|
425
|
+
nullable: true,
|
|
404
426
|
selections: SafetyCategoryScores__selections,
|
|
405
427
|
required: false
|
|
406
428
|
},
|
|
@@ -435,14 +457,17 @@ function equals$3(existing, incoming) {
|
|
|
435
457
|
if (existing_category_scores === undefined || incoming_category_scores === undefined) {
|
|
436
458
|
return false;
|
|
437
459
|
}
|
|
438
|
-
if (!(
|
|
460
|
+
if (!(existing_category_scores === incoming_category_scores
|
|
461
|
+
|| (existing_category_scores != null &&
|
|
462
|
+
incoming_category_scores != null &&
|
|
463
|
+
equals$4(existing_category_scores, incoming_category_scores)))) {
|
|
439
464
|
return false;
|
|
440
465
|
}
|
|
441
466
|
}
|
|
442
467
|
return true;
|
|
443
468
|
}
|
|
444
469
|
|
|
445
|
-
const VERSION$2 = "
|
|
470
|
+
const VERSION$2 = "c8979ea0708e5029fa2ab1e7d5ede8c8";
|
|
446
471
|
function validate$2(obj, path = 'GenerationResponseGenerations') {
|
|
447
472
|
const v_error = (() => {
|
|
448
473
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
@@ -451,10 +476,31 @@ function validate$2(obj, path = 'GenerationResponseGenerations') {
|
|
|
451
476
|
if (obj.generation_safety_score !== undefined) {
|
|
452
477
|
const obj_generation_safety_score = obj.generation_safety_score;
|
|
453
478
|
const path_generation_safety_score = path + '.generation_safety_score';
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
479
|
+
let obj_generation_safety_score_union0 = null;
|
|
480
|
+
const obj_generation_safety_score_union0_error = (() => {
|
|
481
|
+
const referencepath_generation_safety_scoreValidationError = validate$3(obj_generation_safety_score, path_generation_safety_score);
|
|
482
|
+
if (referencepath_generation_safety_scoreValidationError !== null) {
|
|
483
|
+
let message = 'Object doesn\'t match SafetyScoreRepresentation (at "' + path_generation_safety_score + '")\n';
|
|
484
|
+
message += referencepath_generation_safety_scoreValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
485
|
+
return new TypeError(message);
|
|
486
|
+
}
|
|
487
|
+
})();
|
|
488
|
+
if (obj_generation_safety_score_union0_error != null) {
|
|
489
|
+
obj_generation_safety_score_union0 = obj_generation_safety_score_union0_error.message;
|
|
490
|
+
}
|
|
491
|
+
let obj_generation_safety_score_union1 = null;
|
|
492
|
+
const obj_generation_safety_score_union1_error = (() => {
|
|
493
|
+
if (obj_generation_safety_score !== null) {
|
|
494
|
+
return new TypeError('Expected "null" but received "' + typeof obj_generation_safety_score + '" (at "' + path_generation_safety_score + '")');
|
|
495
|
+
}
|
|
496
|
+
})();
|
|
497
|
+
if (obj_generation_safety_score_union1_error != null) {
|
|
498
|
+
obj_generation_safety_score_union1 = obj_generation_safety_score_union1_error.message;
|
|
499
|
+
}
|
|
500
|
+
if (obj_generation_safety_score_union0 && obj_generation_safety_score_union1) {
|
|
501
|
+
let message = 'Object doesn\'t match union (at "' + path_generation_safety_score + '")';
|
|
502
|
+
message += '\n' + obj_generation_safety_score_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
503
|
+
message += '\n' + obj_generation_safety_score_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
458
504
|
return new TypeError(message);
|
|
459
505
|
}
|
|
460
506
|
}
|
|
@@ -499,6 +545,7 @@ const select$4 = function GenerationResponseGenerationsSelect() {
|
|
|
499
545
|
{
|
|
500
546
|
name: 'generation_safety_score',
|
|
501
547
|
kind: 'Object',
|
|
548
|
+
nullable: true,
|
|
502
549
|
selections: SafetyScoreRepresentation__selections,
|
|
503
550
|
required: false
|
|
504
551
|
},
|
|
@@ -547,7 +594,10 @@ function equals$2(existing, incoming) {
|
|
|
547
594
|
if (existing_generation_safety_score === undefined || incoming_generation_safety_score === undefined) {
|
|
548
595
|
return false;
|
|
549
596
|
}
|
|
550
|
-
if (!(
|
|
597
|
+
if (!(existing_generation_safety_score === incoming_generation_safety_score
|
|
598
|
+
|| (existing_generation_safety_score != null &&
|
|
599
|
+
incoming_generation_safety_score != null &&
|
|
600
|
+
equals$3(existing_generation_safety_score, incoming_generation_safety_score)))) {
|
|
551
601
|
return false;
|
|
552
602
|
}
|
|
553
603
|
}
|
|
@@ -1039,7 +1089,7 @@ const adapterName = 'registerFeedback';
|
|
|
1039
1089
|
const registerFeedback_ConfigPropertyMetadata = [
|
|
1040
1090
|
generateParamConfigMetadata('id', true, 2 /* Body */, 0 /* String */),
|
|
1041
1091
|
generateParamConfigMetadata('generation_id', true, 2 /* Body */, 0 /* String */),
|
|
1042
|
-
generateParamConfigMetadata('feedback', false, 2 /* Body */,
|
|
1092
|
+
generateParamConfigMetadata('feedback', false, 2 /* Body */, 4 /* Unsupported */),
|
|
1043
1093
|
generateParamConfigMetadata('feedback_text', false, 2 /* Body */, 0 /* String */),
|
|
1044
1094
|
generateParamConfigMetadata('source', false, 2 /* Body */, 0 /* String */),
|
|
1045
1095
|
generateParamConfigMetadata('app_feedback', false, 2 /* Body */, 4 /* Unsupported */),
|
|
@@ -1050,6 +1100,13 @@ const createResourceParams = /*#__PURE__*/ createResourceParams$2(registerFeedba
|
|
|
1050
1100
|
function typeCheckConfig(untrustedConfig) {
|
|
1051
1101
|
const config = {};
|
|
1052
1102
|
typeCheckConfig$2(untrustedConfig, config, registerFeedback_ConfigPropertyMetadata);
|
|
1103
|
+
const untrustedConfig_feedback = untrustedConfig.feedback;
|
|
1104
|
+
if (typeof untrustedConfig_feedback === 'string') {
|
|
1105
|
+
config.feedback = untrustedConfig_feedback;
|
|
1106
|
+
}
|
|
1107
|
+
if (untrustedConfig_feedback === null) {
|
|
1108
|
+
config.feedback = untrustedConfig_feedback;
|
|
1109
|
+
}
|
|
1053
1110
|
const untrustedConfig_app_feedback = untrustedConfig.app_feedback;
|
|
1054
1111
|
if (untrustedIsObject(untrustedConfig_app_feedback)) {
|
|
1055
1112
|
const untrustedConfig_app_feedback_object = {};
|
|
@@ -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 = "677aa3c947477cdf2196296053ea3a8d";
|
|
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: FeedbackRequest, existing: FeedbackRequestNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): FeedbackRequestNormalized;
|
|
@@ -19,7 +19,7 @@ export interface FeedbackRequestNormalized {
|
|
|
19
19
|
[key: string]: unknown;
|
|
20
20
|
};
|
|
21
21
|
/** The feedback sentiment. Can be `null`. */
|
|
22
|
-
feedback?: string;
|
|
22
|
+
feedback?: string | null;
|
|
23
23
|
/** The textual representation of the feedback as provided by the user. */
|
|
24
24
|
feedback_text?: string;
|
|
25
25
|
/** The ID of the gateway's generation response. For example, `GenerationResponseGenerations.id`. */
|
|
@@ -39,7 +39,7 @@ export interface FeedbackRequest {
|
|
|
39
39
|
app_feedback?: {
|
|
40
40
|
[key: string]: unknown;
|
|
41
41
|
};
|
|
42
|
-
feedback?: string;
|
|
42
|
+
feedback?: string | null;
|
|
43
43
|
feedback_text?: string;
|
|
44
44
|
generation_id: string;
|
|
45
45
|
id: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SafetyScoreRepresentation as SafetyScoreRepresentation_SafetyScoreRepresentation } from './SafetyScoreRepresentation';
|
|
2
2
|
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';
|
|
3
|
-
export declare const VERSION = "
|
|
3
|
+
export declare const VERSION = "c8979ea0708e5029fa2ab1e7d5ede8c8";
|
|
4
4
|
export declare function validate(obj: any, path?: string): TypeError | null;
|
|
5
5
|
export declare const RepresentationType: string;
|
|
6
6
|
export declare function normalize(input: GenerationResponseGenerations, existing: GenerationResponseGenerationsNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): GenerationResponseGenerationsNormalized;
|
|
@@ -15,7 +15,7 @@ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableSto
|
|
|
15
15
|
* (none)
|
|
16
16
|
*/
|
|
17
17
|
export interface GenerationResponseGenerationsNormalized {
|
|
18
|
-
generation_safety_score?: SafetyScoreRepresentation_SafetyScoreRepresentation;
|
|
18
|
+
generation_safety_score?: SafetyScoreRepresentation_SafetyScoreRepresentation | null;
|
|
19
19
|
/** Generation ID. This value is required to register feedback. */
|
|
20
20
|
id?: string;
|
|
21
21
|
/** Any provider-specific attributes included as part of this object. Can be `null`. */
|
|
@@ -32,7 +32,7 @@ export interface GenerationResponseGenerationsNormalized {
|
|
|
32
32
|
* (none)
|
|
33
33
|
*/
|
|
34
34
|
export interface GenerationResponseGenerations {
|
|
35
|
-
generation_safety_score?: SafetyScoreRepresentation_SafetyScoreRepresentation;
|
|
35
|
+
generation_safety_score?: SafetyScoreRepresentation_SafetyScoreRepresentation | null;
|
|
36
36
|
id?: string;
|
|
37
37
|
parameters?: {
|
|
38
38
|
[key: string]: unknown;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SafetyCategoryScores as SafetyCategoryScores_SafetyCategoryScores } from './SafetyCategoryScores';
|
|
2
2
|
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';
|
|
3
|
-
export declare const VERSION = "
|
|
3
|
+
export declare const VERSION = "24a5fffc6e46c3c67de0b0430d230c56";
|
|
4
4
|
export declare function validate(obj: any, path?: string): TypeError | null;
|
|
5
5
|
export declare const RepresentationType: string;
|
|
6
6
|
export declare function normalize(input: SafetyScoreRepresentation, existing: SafetyScoreRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): SafetyScoreRepresentationNormalized;
|
|
@@ -15,7 +15,7 @@ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableSto
|
|
|
15
15
|
* (none)
|
|
16
16
|
*/
|
|
17
17
|
export interface SafetyScoreRepresentationNormalized {
|
|
18
|
-
category_scores?: SafetyCategoryScores_SafetyCategoryScores;
|
|
18
|
+
category_scores?: SafetyCategoryScores_SafetyCategoryScores | null;
|
|
19
19
|
/** A higher score implies safer content */
|
|
20
20
|
safety_score?: number;
|
|
21
21
|
}
|
|
@@ -26,6 +26,6 @@ export interface SafetyScoreRepresentationNormalized {
|
|
|
26
26
|
* (none)
|
|
27
27
|
*/
|
|
28
28
|
export interface SafetyScoreRepresentation {
|
|
29
|
-
category_scores?: SafetyCategoryScores_SafetyCategoryScores;
|
|
29
|
+
category_scores?: SafetyCategoryScores_SafetyCategoryScores | null;
|
|
30
30
|
safety_score?: number;
|
|
31
31
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-adapters-sfap-einstein-ai-gateway",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.264.0",
|
|
4
4
|
"description": "LLM Gateway API's",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "dist/es/es2018/sfap-einstein-ai-gateway.js",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"test:unit": "jest"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@salesforce/lds-bindings": "^1.
|
|
43
|
+
"@salesforce/lds-bindings": "^1.264.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@salesforce/lds-compiler-plugins": "^1.
|
|
46
|
+
"@salesforce/lds-compiler-plugins": "^1.264.0"
|
|
47
47
|
},
|
|
48
48
|
"nx": {
|
|
49
49
|
"targets": {
|
package/sfdc/index.js
CHANGED
|
@@ -375,7 +375,7 @@ function equals$4(existing, incoming) {
|
|
|
375
375
|
return true;
|
|
376
376
|
}
|
|
377
377
|
|
|
378
|
-
const VERSION$3 = "
|
|
378
|
+
const VERSION$3 = "24a5fffc6e46c3c67de0b0430d230c56";
|
|
379
379
|
function validate$3(obj, path = 'SafetyScoreRepresentation') {
|
|
380
380
|
const v_error = (() => {
|
|
381
381
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
@@ -384,10 +384,31 @@ function validate$3(obj, path = 'SafetyScoreRepresentation') {
|
|
|
384
384
|
if (obj.category_scores !== undefined) {
|
|
385
385
|
const obj_category_scores = obj.category_scores;
|
|
386
386
|
const path_category_scores = path + '.category_scores';
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
387
|
+
let obj_category_scores_union0 = null;
|
|
388
|
+
const obj_category_scores_union0_error = (() => {
|
|
389
|
+
const referencepath_category_scoresValidationError = validate$4(obj_category_scores, path_category_scores);
|
|
390
|
+
if (referencepath_category_scoresValidationError !== null) {
|
|
391
|
+
let message = 'Object doesn\'t match SafetyCategoryScores (at "' + path_category_scores + '")\n';
|
|
392
|
+
message += referencepath_category_scoresValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
393
|
+
return new TypeError(message);
|
|
394
|
+
}
|
|
395
|
+
})();
|
|
396
|
+
if (obj_category_scores_union0_error != null) {
|
|
397
|
+
obj_category_scores_union0 = obj_category_scores_union0_error.message;
|
|
398
|
+
}
|
|
399
|
+
let obj_category_scores_union1 = null;
|
|
400
|
+
const obj_category_scores_union1_error = (() => {
|
|
401
|
+
if (obj_category_scores !== null) {
|
|
402
|
+
return new TypeError('Expected "null" but received "' + typeof obj_category_scores + '" (at "' + path_category_scores + '")');
|
|
403
|
+
}
|
|
404
|
+
})();
|
|
405
|
+
if (obj_category_scores_union1_error != null) {
|
|
406
|
+
obj_category_scores_union1 = obj_category_scores_union1_error.message;
|
|
407
|
+
}
|
|
408
|
+
if (obj_category_scores_union0 && obj_category_scores_union1) {
|
|
409
|
+
let message = 'Object doesn\'t match union (at "' + path_category_scores + '")';
|
|
410
|
+
message += '\n' + obj_category_scores_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
411
|
+
message += '\n' + obj_category_scores_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
391
412
|
return new TypeError(message);
|
|
392
413
|
}
|
|
393
414
|
}
|
|
@@ -411,6 +432,7 @@ const select$5 = function SafetyScoreRepresentationSelect() {
|
|
|
411
432
|
{
|
|
412
433
|
name: 'category_scores',
|
|
413
434
|
kind: 'Object',
|
|
435
|
+
nullable: true,
|
|
414
436
|
selections: SafetyCategoryScores__selections,
|
|
415
437
|
required: false
|
|
416
438
|
},
|
|
@@ -445,14 +467,17 @@ function equals$3(existing, incoming) {
|
|
|
445
467
|
if (existing_category_scores === undefined || incoming_category_scores === undefined) {
|
|
446
468
|
return false;
|
|
447
469
|
}
|
|
448
|
-
if (!(
|
|
470
|
+
if (!(existing_category_scores === incoming_category_scores
|
|
471
|
+
|| (existing_category_scores != null &&
|
|
472
|
+
incoming_category_scores != null &&
|
|
473
|
+
equals$4(existing_category_scores, incoming_category_scores)))) {
|
|
449
474
|
return false;
|
|
450
475
|
}
|
|
451
476
|
}
|
|
452
477
|
return true;
|
|
453
478
|
}
|
|
454
479
|
|
|
455
|
-
const VERSION$2 = "
|
|
480
|
+
const VERSION$2 = "c8979ea0708e5029fa2ab1e7d5ede8c8";
|
|
456
481
|
function validate$2(obj, path = 'GenerationResponseGenerations') {
|
|
457
482
|
const v_error = (() => {
|
|
458
483
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
@@ -461,10 +486,31 @@ function validate$2(obj, path = 'GenerationResponseGenerations') {
|
|
|
461
486
|
if (obj.generation_safety_score !== undefined) {
|
|
462
487
|
const obj_generation_safety_score = obj.generation_safety_score;
|
|
463
488
|
const path_generation_safety_score = path + '.generation_safety_score';
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
489
|
+
let obj_generation_safety_score_union0 = null;
|
|
490
|
+
const obj_generation_safety_score_union0_error = (() => {
|
|
491
|
+
const referencepath_generation_safety_scoreValidationError = validate$3(obj_generation_safety_score, path_generation_safety_score);
|
|
492
|
+
if (referencepath_generation_safety_scoreValidationError !== null) {
|
|
493
|
+
let message = 'Object doesn\'t match SafetyScoreRepresentation (at "' + path_generation_safety_score + '")\n';
|
|
494
|
+
message += referencepath_generation_safety_scoreValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
495
|
+
return new TypeError(message);
|
|
496
|
+
}
|
|
497
|
+
})();
|
|
498
|
+
if (obj_generation_safety_score_union0_error != null) {
|
|
499
|
+
obj_generation_safety_score_union0 = obj_generation_safety_score_union0_error.message;
|
|
500
|
+
}
|
|
501
|
+
let obj_generation_safety_score_union1 = null;
|
|
502
|
+
const obj_generation_safety_score_union1_error = (() => {
|
|
503
|
+
if (obj_generation_safety_score !== null) {
|
|
504
|
+
return new TypeError('Expected "null" but received "' + typeof obj_generation_safety_score + '" (at "' + path_generation_safety_score + '")');
|
|
505
|
+
}
|
|
506
|
+
})();
|
|
507
|
+
if (obj_generation_safety_score_union1_error != null) {
|
|
508
|
+
obj_generation_safety_score_union1 = obj_generation_safety_score_union1_error.message;
|
|
509
|
+
}
|
|
510
|
+
if (obj_generation_safety_score_union0 && obj_generation_safety_score_union1) {
|
|
511
|
+
let message = 'Object doesn\'t match union (at "' + path_generation_safety_score + '")';
|
|
512
|
+
message += '\n' + obj_generation_safety_score_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
513
|
+
message += '\n' + obj_generation_safety_score_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
468
514
|
return new TypeError(message);
|
|
469
515
|
}
|
|
470
516
|
}
|
|
@@ -509,6 +555,7 @@ const select$4 = function GenerationResponseGenerationsSelect() {
|
|
|
509
555
|
{
|
|
510
556
|
name: 'generation_safety_score',
|
|
511
557
|
kind: 'Object',
|
|
558
|
+
nullable: true,
|
|
512
559
|
selections: SafetyScoreRepresentation__selections,
|
|
513
560
|
required: false
|
|
514
561
|
},
|
|
@@ -557,7 +604,10 @@ function equals$2(existing, incoming) {
|
|
|
557
604
|
if (existing_generation_safety_score === undefined || incoming_generation_safety_score === undefined) {
|
|
558
605
|
return false;
|
|
559
606
|
}
|
|
560
|
-
if (!(
|
|
607
|
+
if (!(existing_generation_safety_score === incoming_generation_safety_score
|
|
608
|
+
|| (existing_generation_safety_score != null &&
|
|
609
|
+
incoming_generation_safety_score != null &&
|
|
610
|
+
equals$3(existing_generation_safety_score, incoming_generation_safety_score)))) {
|
|
561
611
|
return false;
|
|
562
612
|
}
|
|
563
613
|
}
|
|
@@ -1049,7 +1099,7 @@ const adapterName = 'registerFeedback';
|
|
|
1049
1099
|
const registerFeedback_ConfigPropertyMetadata = [
|
|
1050
1100
|
generateParamConfigMetadata('id', true, 2 /* Body */, 0 /* String */),
|
|
1051
1101
|
generateParamConfigMetadata('generation_id', true, 2 /* Body */, 0 /* String */),
|
|
1052
|
-
generateParamConfigMetadata('feedback', false, 2 /* Body */,
|
|
1102
|
+
generateParamConfigMetadata('feedback', false, 2 /* Body */, 4 /* Unsupported */),
|
|
1053
1103
|
generateParamConfigMetadata('feedback_text', false, 2 /* Body */, 0 /* String */),
|
|
1054
1104
|
generateParamConfigMetadata('source', false, 2 /* Body */, 0 /* String */),
|
|
1055
1105
|
generateParamConfigMetadata('app_feedback', false, 2 /* Body */, 4 /* Unsupported */),
|
|
@@ -1060,6 +1110,13 @@ const createResourceParams = /*#__PURE__*/ createResourceParams$2(registerFeedba
|
|
|
1060
1110
|
function typeCheckConfig(untrustedConfig) {
|
|
1061
1111
|
const config = {};
|
|
1062
1112
|
typeCheckConfig$2(untrustedConfig, config, registerFeedback_ConfigPropertyMetadata);
|
|
1113
|
+
const untrustedConfig_feedback = untrustedConfig.feedback;
|
|
1114
|
+
if (typeof untrustedConfig_feedback === 'string') {
|
|
1115
|
+
config.feedback = untrustedConfig_feedback;
|
|
1116
|
+
}
|
|
1117
|
+
if (untrustedConfig_feedback === null) {
|
|
1118
|
+
config.feedback = untrustedConfig_feedback;
|
|
1119
|
+
}
|
|
1063
1120
|
const untrustedConfig_app_feedback = untrustedConfig.app_feedback;
|
|
1064
1121
|
if (untrustedIsObject(untrustedConfig_app_feedback)) {
|
|
1065
1122
|
const untrustedConfig_app_feedback_object = {};
|
|
@@ -1146,4 +1203,4 @@ withDefaultLuvio((luvio) => {
|
|
|
1146
1203
|
});
|
|
1147
1204
|
|
|
1148
1205
|
export { getGenerations, getGenerations_imperative, registerFeedback };
|
|
1149
|
-
// version: 1.
|
|
1206
|
+
// version: 1.264.0-76ebb1758
|
package/src/raml/api.raml
CHANGED
|
@@ -300,7 +300,7 @@ types:
|
|
|
300
300
|
additionalProperties: true
|
|
301
301
|
generation_safety_score?:
|
|
302
302
|
(nullable): true
|
|
303
|
-
type: SafetyScoreRepresentation
|
|
303
|
+
type: SafetyScoreRepresentation | nil
|
|
304
304
|
SafetyCategoryScores:
|
|
305
305
|
description: Probability for each category. A higher probability indicates a more toxic content.
|
|
306
306
|
type: object
|
|
@@ -418,7 +418,7 @@ types:
|
|
|
418
418
|
type: number
|
|
419
419
|
minimum: 0
|
|
420
420
|
maximum: 1
|
|
421
|
-
category_scores?: SafetyCategoryScores
|
|
421
|
+
category_scores?: SafetyCategoryScores | nil
|
|
422
422
|
ModelResponse:
|
|
423
423
|
description: Model properties.
|
|
424
424
|
type: object
|
|
@@ -477,7 +477,7 @@ types:
|
|
|
477
477
|
- GOOD
|
|
478
478
|
- BAD
|
|
479
479
|
(nullable): true
|
|
480
|
-
type: string
|
|
480
|
+
type: string | nil
|
|
481
481
|
feedback_text?:
|
|
482
482
|
description: The textual representation of the feedback as provided by the user.
|
|
483
483
|
type: string
|