@salesforce/lds-adapters-service-einsteinllm 1.288.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 +1034 -380
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +1 -1
- package/dist/es/es2018/types/src/generated/types/EinsteinLlmGenerationItemRepresentation.d.ts +10 -2
- package/dist/es/es2018/types/src/generated/types/EinsteinLlmGenerationsContentQualityRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/EinsteinLlmGenerationsSafetyScoreRepresentation.d.ts +46 -0
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateGenerationsErrorRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateGenerationsRepresentation.d.ts +5 -1
- package/package.json +4 -4
- package/sfdc/index.js +712 -58
- package/src/raml/api.raml +90 -18
|
@@ -104,7 +104,219 @@ function createLink(ref) {
|
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
function validate$
|
|
107
|
+
function validate$c(obj, path = 'EinsteinLlmFeedbackInputRepresentation') {
|
|
108
|
+
const v_error = (() => {
|
|
109
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
110
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
111
|
+
}
|
|
112
|
+
if (obj.appFeedback !== undefined) {
|
|
113
|
+
const obj_appFeedback = obj.appFeedback;
|
|
114
|
+
const path_appFeedback = path + '.appFeedback';
|
|
115
|
+
if (typeof obj_appFeedback !== 'object' || ArrayIsArray(obj_appFeedback) || obj_appFeedback === null) {
|
|
116
|
+
return new TypeError('Expected "object" but received "' + typeof obj_appFeedback + '" (at "' + path_appFeedback + '")');
|
|
117
|
+
}
|
|
118
|
+
const obj_appFeedback_keys = ObjectKeys(obj_appFeedback);
|
|
119
|
+
for (let i = 0; i < obj_appFeedback_keys.length; i++) {
|
|
120
|
+
const key = obj_appFeedback_keys[i];
|
|
121
|
+
const obj_appFeedback_prop = obj_appFeedback[key];
|
|
122
|
+
const path_appFeedback_prop = path_appFeedback + '["' + key + '"]';
|
|
123
|
+
if (typeof obj_appFeedback_prop !== 'object' || ArrayIsArray(obj_appFeedback_prop) || obj_appFeedback_prop === null) {
|
|
124
|
+
return new TypeError('Expected "object" but received "' + typeof obj_appFeedback_prop + '" (at "' + path_appFeedback_prop + '")');
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (obj.feedback !== undefined) {
|
|
129
|
+
const obj_feedback = obj.feedback;
|
|
130
|
+
const path_feedback = path + '.feedback';
|
|
131
|
+
if (typeof obj_feedback !== 'string') {
|
|
132
|
+
return new TypeError('Expected "string" but received "' + typeof obj_feedback + '" (at "' + path_feedback + '")');
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const obj_feedbackText = obj.feedbackText;
|
|
136
|
+
const path_feedbackText = path + '.feedbackText';
|
|
137
|
+
if (typeof obj_feedbackText !== 'string') {
|
|
138
|
+
return new TypeError('Expected "string" but received "' + typeof obj_feedbackText + '" (at "' + path_feedbackText + '")');
|
|
139
|
+
}
|
|
140
|
+
const obj_generationId = obj.generationId;
|
|
141
|
+
const path_generationId = path + '.generationId';
|
|
142
|
+
if (typeof obj_generationId !== 'string') {
|
|
143
|
+
return new TypeError('Expected "string" but received "' + typeof obj_generationId + '" (at "' + path_generationId + '")');
|
|
144
|
+
}
|
|
145
|
+
const obj_id = obj.id;
|
|
146
|
+
const path_id = path + '.id';
|
|
147
|
+
if (typeof obj_id !== 'string') {
|
|
148
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
149
|
+
}
|
|
150
|
+
})();
|
|
151
|
+
return v_error === undefined ? null : v_error;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const TTL$2 = 100;
|
|
155
|
+
const VERSION$7 = "4033328f65865dd5d80c68a7573a4522";
|
|
156
|
+
function validate$b(obj, path = 'EinsteinLlmFeedbackRepresentation') {
|
|
157
|
+
const v_error = (() => {
|
|
158
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
159
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
160
|
+
}
|
|
161
|
+
const obj_message = obj.message;
|
|
162
|
+
const path_message = path + '.message';
|
|
163
|
+
if (typeof obj_message !== 'string') {
|
|
164
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
165
|
+
}
|
|
166
|
+
})();
|
|
167
|
+
return v_error === undefined ? null : v_error;
|
|
168
|
+
}
|
|
169
|
+
const RepresentationType$2 = 'EinsteinLlmFeedbackRepresentation';
|
|
170
|
+
function keyBuilder$2(luvio, config) {
|
|
171
|
+
return keyPrefix + '::' + RepresentationType$2 + ':' + config.message;
|
|
172
|
+
}
|
|
173
|
+
function keyBuilderFromType$2(luvio, object) {
|
|
174
|
+
const keyParams = {
|
|
175
|
+
message: object.message
|
|
176
|
+
};
|
|
177
|
+
return keyBuilder$2(luvio, keyParams);
|
|
178
|
+
}
|
|
179
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
180
|
+
return input;
|
|
181
|
+
}
|
|
182
|
+
const select$a = function EinsteinLlmFeedbackRepresentationSelect() {
|
|
183
|
+
return {
|
|
184
|
+
kind: 'Fragment',
|
|
185
|
+
version: VERSION$7,
|
|
186
|
+
private: [],
|
|
187
|
+
selections: [
|
|
188
|
+
{
|
|
189
|
+
name: 'message',
|
|
190
|
+
kind: 'Scalar'
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
function equals$7(existing, incoming) {
|
|
196
|
+
const existing_message = existing.message;
|
|
197
|
+
const incoming_message = incoming.message;
|
|
198
|
+
if (!(existing_message === incoming_message)) {
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
const ingest$2 = function EinsteinLlmFeedbackRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
204
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
205
|
+
const validateError = validate$b(input);
|
|
206
|
+
if (validateError !== null) {
|
|
207
|
+
throw validateError;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
const key = keyBuilderFromType$2(luvio, input);
|
|
211
|
+
const ttlToUse = TTL$2;
|
|
212
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "EinsteinLLM", VERSION$7, RepresentationType$2, equals$7);
|
|
213
|
+
return createLink(key);
|
|
214
|
+
};
|
|
215
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
216
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
217
|
+
const rootKey = keyBuilderFromType$2(luvio, input);
|
|
218
|
+
rootKeySet.set(rootKey, {
|
|
219
|
+
namespace: keyPrefix,
|
|
220
|
+
representationName: RepresentationType$2,
|
|
221
|
+
mergeable: false
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function select$9(luvio, params) {
|
|
226
|
+
return select$a();
|
|
227
|
+
}
|
|
228
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
229
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response);
|
|
230
|
+
}
|
|
231
|
+
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
232
|
+
const { body } = response;
|
|
233
|
+
const key = keyBuilderFromType$2(luvio, body);
|
|
234
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
235
|
+
const snapshot = luvio.storeLookup({
|
|
236
|
+
recordId: key,
|
|
237
|
+
node: select$9(),
|
|
238
|
+
variables: {},
|
|
239
|
+
});
|
|
240
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
241
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
242
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
deepFreeze(snapshot.data);
|
|
246
|
+
return snapshot;
|
|
247
|
+
}
|
|
248
|
+
function createResourceRequest$2(config) {
|
|
249
|
+
const headers = {};
|
|
250
|
+
return {
|
|
251
|
+
baseUri: '/services/data/v62.0',
|
|
252
|
+
basePath: '/einstein/llm/feedback',
|
|
253
|
+
method: 'post',
|
|
254
|
+
body: config.body,
|
|
255
|
+
urlParams: {},
|
|
256
|
+
queryParams: {},
|
|
257
|
+
headers,
|
|
258
|
+
priority: 'normal',
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
const adapterName$2 = 'createFeedback';
|
|
263
|
+
const createFeedback_ConfigPropertyMetadata = [
|
|
264
|
+
generateParamConfigMetadata('feedbackInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
265
|
+
];
|
|
266
|
+
const createFeedback_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, createFeedback_ConfigPropertyMetadata);
|
|
267
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$3(createFeedback_ConfigPropertyMetadata);
|
|
268
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
269
|
+
const config = {};
|
|
270
|
+
const untrustedConfig_feedbackInput = untrustedConfig.feedbackInput;
|
|
271
|
+
const referenceEinsteinLlmFeedbackInputRepresentationValidationError = validate$c(untrustedConfig_feedbackInput);
|
|
272
|
+
if (referenceEinsteinLlmFeedbackInputRepresentationValidationError === null) {
|
|
273
|
+
config.feedbackInput = untrustedConfig_feedbackInput;
|
|
274
|
+
}
|
|
275
|
+
return config;
|
|
276
|
+
}
|
|
277
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
278
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
279
|
+
return null;
|
|
280
|
+
}
|
|
281
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
282
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
283
|
+
}
|
|
284
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
285
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
286
|
+
return null;
|
|
287
|
+
}
|
|
288
|
+
return config;
|
|
289
|
+
}
|
|
290
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
291
|
+
const resourceParams = createResourceParams$2(config);
|
|
292
|
+
const request = createResourceRequest$2(resourceParams);
|
|
293
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
294
|
+
.then((response) => {
|
|
295
|
+
return luvio.handleSuccessResponse(() => {
|
|
296
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
297
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
298
|
+
}, () => {
|
|
299
|
+
const cache = new StoreKeyMap();
|
|
300
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
301
|
+
return cache;
|
|
302
|
+
});
|
|
303
|
+
}, (response) => {
|
|
304
|
+
deepFreeze(response);
|
|
305
|
+
throw response;
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
const createFeedbackAdapterFactory = (luvio) => {
|
|
309
|
+
return function createFeedback(untrustedConfig) {
|
|
310
|
+
const config = validateAdapterConfig$2(untrustedConfig, createFeedback_ConfigPropertyNames);
|
|
311
|
+
// Invalid or incomplete config
|
|
312
|
+
if (config === null) {
|
|
313
|
+
throw new Error('Invalid config for "createFeedback"');
|
|
314
|
+
}
|
|
315
|
+
return buildNetworkSnapshot$2(luvio, config);
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
function validate$a(obj, path = 'EinsteinLlmAdditionalConfigInputRepresentation') {
|
|
108
320
|
const v_error = (() => {
|
|
109
321
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
110
322
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -187,7 +399,7 @@ function validate$9(obj, path = 'EinsteinLlmAdditionalConfigInputRepresentation'
|
|
|
187
399
|
return v_error === undefined ? null : v_error;
|
|
188
400
|
}
|
|
189
401
|
|
|
190
|
-
function validate$
|
|
402
|
+
function validate$9(obj, path = 'EinsteinLlmGenerationsInputRepresentation') {
|
|
191
403
|
const v_error = (() => {
|
|
192
404
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
193
405
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -195,7 +407,7 @@ function validate$8(obj, path = 'EinsteinLlmGenerationsInputRepresentation') {
|
|
|
195
407
|
if (obj.additionalConfig !== undefined) {
|
|
196
408
|
const obj_additionalConfig = obj.additionalConfig;
|
|
197
409
|
const path_additionalConfig = path + '.additionalConfig';
|
|
198
|
-
const referencepath_additionalConfigValidationError = validate$
|
|
410
|
+
const referencepath_additionalConfigValidationError = validate$a(obj_additionalConfig, path_additionalConfig);
|
|
199
411
|
if (referencepath_additionalConfigValidationError !== null) {
|
|
200
412
|
let message = 'Object doesn\'t match EinsteinLlmAdditionalConfigInputRepresentation (at "' + path_additionalConfig + '")\n';
|
|
201
413
|
message += referencepath_additionalConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -218,494 +430,804 @@ function validate$8(obj, path = 'EinsteinLlmGenerationsInputRepresentation') {
|
|
|
218
430
|
return v_error === undefined ? null : v_error;
|
|
219
431
|
}
|
|
220
432
|
|
|
221
|
-
const VERSION$
|
|
222
|
-
function validate$
|
|
433
|
+
const VERSION$6 = "9ebac74e6f964c363d5fd1913df363af";
|
|
434
|
+
function validate$8(obj, path = 'EinsteinLlmGenerationsContentQualityRepresentation') {
|
|
223
435
|
const v_error = (() => {
|
|
224
436
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
225
437
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
226
438
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
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
|
+
}
|
|
241
466
|
}
|
|
242
467
|
})();
|
|
243
468
|
return v_error === undefined ? null : v_error;
|
|
244
469
|
}
|
|
245
|
-
const select$
|
|
470
|
+
const select$8 = function EinsteinLlmGenerationsContentQualityRepresentationSelect() {
|
|
246
471
|
return {
|
|
247
472
|
kind: 'Fragment',
|
|
248
|
-
version: VERSION$
|
|
473
|
+
version: VERSION$6,
|
|
249
474
|
private: [],
|
|
250
475
|
selections: [
|
|
251
476
|
{
|
|
252
|
-
name: '
|
|
253
|
-
kind: 'Scalar'
|
|
254
|
-
|
|
255
|
-
{
|
|
256
|
-
name: 'responseId',
|
|
257
|
-
kind: 'Scalar'
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
name: 'text',
|
|
261
|
-
kind: 'Scalar'
|
|
477
|
+
name: 'isToxicityDetected',
|
|
478
|
+
kind: 'Scalar',
|
|
479
|
+
required: false
|
|
262
480
|
}
|
|
263
481
|
]
|
|
264
482
|
};
|
|
265
483
|
};
|
|
266
|
-
function equals$
|
|
267
|
-
const
|
|
268
|
-
const
|
|
269
|
-
if
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
if (!(existing_text === incoming_text)) {
|
|
280
|
-
return false;
|
|
484
|
+
function equals$6(existing, incoming) {
|
|
485
|
+
const existing_isToxicityDetected = existing.isToxicityDetected;
|
|
486
|
+
const incoming_isToxicityDetected = incoming.isToxicityDetected;
|
|
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
|
+
}
|
|
281
497
|
}
|
|
282
498
|
return true;
|
|
283
499
|
}
|
|
284
500
|
|
|
285
|
-
const VERSION$
|
|
286
|
-
function validate$
|
|
501
|
+
const VERSION$5 = "77af44a252cb5b45b4d9a8101368d2aa";
|
|
502
|
+
function validate$7(obj, path = 'EinsteinLlmGenerationsSafetyScoreRepresentation') {
|
|
287
503
|
const v_error = (() => {
|
|
288
504
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
289
505
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
290
506
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
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);
|
|
303
701
|
}
|
|
304
702
|
}
|
|
305
703
|
})();
|
|
306
704
|
return v_error === undefined ? null : v_error;
|
|
307
705
|
}
|
|
308
|
-
const select$
|
|
706
|
+
const select$7 = function EinsteinLlmGenerationsSafetyScoreRepresentationSelect() {
|
|
309
707
|
return {
|
|
310
708
|
kind: 'Fragment',
|
|
311
|
-
version: VERSION$
|
|
709
|
+
version: VERSION$5,
|
|
312
710
|
private: [],
|
|
313
|
-
selections: [
|
|
711
|
+
selections: [
|
|
712
|
+
{
|
|
713
|
+
name: 'hateScore',
|
|
714
|
+
kind: 'Scalar',
|
|
715
|
+
required: false
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
name: 'physicalScore',
|
|
719
|
+
kind: 'Scalar',
|
|
720
|
+
required: false
|
|
721
|
+
},
|
|
722
|
+
{
|
|
723
|
+
name: 'profanityScore',
|
|
724
|
+
kind: 'Scalar',
|
|
725
|
+
required: false
|
|
726
|
+
},
|
|
727
|
+
{
|
|
728
|
+
name: 'safetyScore',
|
|
729
|
+
kind: 'Scalar',
|
|
730
|
+
required: false
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
name: 'sexualScore',
|
|
734
|
+
kind: 'Scalar',
|
|
735
|
+
required: false
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
name: 'toxicityScore',
|
|
739
|
+
kind: 'Scalar',
|
|
740
|
+
required: false
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
name: 'violenceScore',
|
|
744
|
+
kind: 'Scalar',
|
|
745
|
+
required: false
|
|
746
|
+
}
|
|
747
|
+
]
|
|
314
748
|
};
|
|
315
749
|
};
|
|
316
|
-
function equals$
|
|
317
|
-
const
|
|
318
|
-
const
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
750
|
+
function equals$5(existing, incoming) {
|
|
751
|
+
const existing_hateScore = existing.hateScore;
|
|
752
|
+
const incoming_hateScore = incoming.hateScore;
|
|
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
|
+
}
|
|
763
|
+
}
|
|
764
|
+
const existing_physicalScore = existing.physicalScore;
|
|
765
|
+
const incoming_physicalScore = incoming.physicalScore;
|
|
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
|
+
}
|
|
776
|
+
}
|
|
777
|
+
const existing_profanityScore = existing.profanityScore;
|
|
778
|
+
const incoming_profanityScore = incoming.profanityScore;
|
|
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
|
+
}
|
|
789
|
+
}
|
|
790
|
+
const existing_safetyScore = existing.safetyScore;
|
|
791
|
+
const incoming_safetyScore = incoming.safetyScore;
|
|
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
|
+
}
|
|
802
|
+
}
|
|
803
|
+
const existing_sexualScore = existing.sexualScore;
|
|
804
|
+
const incoming_sexualScore = incoming.sexualScore;
|
|
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
|
+
}
|
|
815
|
+
}
|
|
816
|
+
const existing_toxicityScore = existing.toxicityScore;
|
|
817
|
+
const incoming_toxicityScore = incoming.toxicityScore;
|
|
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
|
+
}
|
|
828
|
+
}
|
|
829
|
+
const existing_violenceScore = existing.violenceScore;
|
|
830
|
+
const incoming_violenceScore = incoming.violenceScore;
|
|
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
|
+
}
|
|
323
841
|
}
|
|
324
842
|
return true;
|
|
325
843
|
}
|
|
326
844
|
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
function validate$5(obj, path = 'EinsteinLlmGenerationsRepresentation') {
|
|
845
|
+
const VERSION$4 = "aebe0f32437ab18bd126a1fb5ff48d9b";
|
|
846
|
+
function validate$6(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
|
|
330
847
|
const v_error = (() => {
|
|
331
848
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
332
849
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
333
850
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
851
|
+
if (obj.contentQualityRepresentation !== undefined) {
|
|
852
|
+
const obj_contentQualityRepresentation = obj.contentQualityRepresentation;
|
|
853
|
+
const path_contentQualityRepresentation = path + '.contentQualityRepresentation';
|
|
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');
|
|
346
879
|
return new TypeError(message);
|
|
347
880
|
}
|
|
348
881
|
}
|
|
349
882
|
const obj_parameters = obj.parameters;
|
|
350
883
|
const path_parameters = path + '.parameters';
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
const referencepath_parametersValidationError = validate$6(obj_parameters, path_parameters);
|
|
354
|
-
if (referencepath_parametersValidationError !== null) {
|
|
355
|
-
let message = 'Object doesn\'t match WrappedMap (at "' + path_parameters + '")\n';
|
|
356
|
-
message += referencepath_parametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
357
|
-
return new TypeError(message);
|
|
358
|
-
}
|
|
359
|
-
})();
|
|
360
|
-
if (obj_parameters_union0_error != null) {
|
|
361
|
-
obj_parameters_union0 = obj_parameters_union0_error.message;
|
|
362
|
-
}
|
|
363
|
-
let obj_parameters_union1 = null;
|
|
364
|
-
const obj_parameters_union1_error = (() => {
|
|
365
|
-
if (obj_parameters !== null) {
|
|
366
|
-
return new TypeError('Expected "null" but received "' + typeof obj_parameters + '" (at "' + path_parameters + '")');
|
|
367
|
-
}
|
|
368
|
-
})();
|
|
369
|
-
if (obj_parameters_union1_error != null) {
|
|
370
|
-
obj_parameters_union1 = obj_parameters_union1_error.message;
|
|
884
|
+
if (typeof obj_parameters !== 'string') {
|
|
885
|
+
return new TypeError('Expected "string" but received "' + typeof obj_parameters + '" (at "' + path_parameters + '")');
|
|
371
886
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
return new TypeError(message);
|
|
887
|
+
const obj_responseId = obj.responseId;
|
|
888
|
+
const path_responseId = path + '.responseId';
|
|
889
|
+
if (typeof obj_responseId !== 'string') {
|
|
890
|
+
return new TypeError('Expected "string" but received "' + typeof obj_responseId + '" (at "' + path_responseId + '")');
|
|
377
891
|
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
892
|
+
if (obj.safetyScoreRepresentation !== undefined) {
|
|
893
|
+
const obj_safetyScoreRepresentation = obj.safetyScoreRepresentation;
|
|
894
|
+
const path_safetyScoreRepresentation = path + '.safetyScoreRepresentation';
|
|
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;
|
|
384
906
|
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
if (
|
|
392
|
-
|
|
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');
|
|
920
|
+
return new TypeError(message);
|
|
393
921
|
}
|
|
394
|
-
})();
|
|
395
|
-
if (obj_prompt_union1_error != null) {
|
|
396
|
-
obj_prompt_union1 = obj_prompt_union1_error.message;
|
|
397
|
-
}
|
|
398
|
-
if (obj_prompt_union0 && obj_prompt_union1) {
|
|
399
|
-
let message = 'Object doesn\'t match union (at "' + path_prompt + '")';
|
|
400
|
-
message += '\n' + obj_prompt_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
401
|
-
message += '\n' + obj_prompt_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
402
|
-
return new TypeError(message);
|
|
403
922
|
}
|
|
404
|
-
const
|
|
405
|
-
const
|
|
406
|
-
if (typeof
|
|
407
|
-
return new TypeError('Expected "string" but received "' + typeof
|
|
923
|
+
const obj_text = obj.text;
|
|
924
|
+
const path_text = path + '.text';
|
|
925
|
+
if (typeof obj_text !== 'string') {
|
|
926
|
+
return new TypeError('Expected "string" but received "' + typeof obj_text + '" (at "' + path_text + '")');
|
|
408
927
|
}
|
|
409
928
|
})();
|
|
410
929
|
return v_error === undefined ? null : v_error;
|
|
411
930
|
}
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
}
|
|
416
|
-
function keyBuilderFromType$2(luvio, object) {
|
|
417
|
-
const keyParams = {
|
|
418
|
-
requestId: object.requestId
|
|
419
|
-
};
|
|
420
|
-
return keyBuilder$2(luvio, keyParams);
|
|
421
|
-
}
|
|
422
|
-
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
423
|
-
return input;
|
|
424
|
-
}
|
|
425
|
-
const select$5 = function EinsteinLlmGenerationsRepresentationSelect() {
|
|
426
|
-
const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$7();
|
|
427
|
-
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$6();
|
|
931
|
+
const select$6 = function EinsteinLlmGenerationItemRepresentationSelect() {
|
|
932
|
+
const { selections: EinsteinLlmGenerationsContentQualityRepresentation__selections, opaque: EinsteinLlmGenerationsContentQualityRepresentation__opaque, } = select$8();
|
|
933
|
+
const { selections: EinsteinLlmGenerationsSafetyScoreRepresentation__selections, opaque: EinsteinLlmGenerationsSafetyScoreRepresentation__opaque, } = select$7();
|
|
428
934
|
return {
|
|
429
935
|
kind: 'Fragment',
|
|
430
|
-
version: VERSION$
|
|
936
|
+
version: VERSION$4,
|
|
431
937
|
private: [],
|
|
432
938
|
selections: [
|
|
433
939
|
{
|
|
434
|
-
name: '
|
|
940
|
+
name: 'contentQualityRepresentation',
|
|
435
941
|
kind: 'Object',
|
|
436
|
-
|
|
437
|
-
selections:
|
|
942
|
+
nullable: true,
|
|
943
|
+
selections: EinsteinLlmGenerationsContentQualityRepresentation__selections,
|
|
944
|
+
required: false
|
|
438
945
|
},
|
|
439
946
|
{
|
|
440
947
|
name: 'parameters',
|
|
441
|
-
kind: '
|
|
442
|
-
nullable: true,
|
|
443
|
-
selections: WrappedMap__selections
|
|
948
|
+
kind: 'Scalar'
|
|
444
949
|
},
|
|
445
950
|
{
|
|
446
|
-
name: '
|
|
951
|
+
name: 'responseId',
|
|
447
952
|
kind: 'Scalar'
|
|
448
953
|
},
|
|
449
954
|
{
|
|
450
|
-
name: '
|
|
955
|
+
name: 'safetyScoreRepresentation',
|
|
956
|
+
kind: 'Object',
|
|
957
|
+
nullable: true,
|
|
958
|
+
selections: EinsteinLlmGenerationsSafetyScoreRepresentation__selections,
|
|
959
|
+
required: false
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
name: 'text',
|
|
451
963
|
kind: 'Scalar'
|
|
452
964
|
}
|
|
453
965
|
]
|
|
454
966
|
};
|
|
455
967
|
};
|
|
456
|
-
function equals$
|
|
457
|
-
const existing_requestId = existing.requestId;
|
|
458
|
-
const incoming_requestId = incoming.requestId;
|
|
459
|
-
if (!(existing_requestId === incoming_requestId)) {
|
|
460
|
-
return false;
|
|
461
|
-
}
|
|
462
|
-
const existing_generations = existing.generations;
|
|
463
|
-
const incoming_generations = incoming.generations;
|
|
464
|
-
const equals_generations_items = equalsArray(existing_generations, incoming_generations, (existing_generations_item, incoming_generations_item) => {
|
|
465
|
-
if (!(equals$4(existing_generations_item, incoming_generations_item))) {
|
|
466
|
-
return false;
|
|
467
|
-
}
|
|
468
|
-
});
|
|
469
|
-
if (equals_generations_items === false) {
|
|
470
|
-
return false;
|
|
471
|
-
}
|
|
968
|
+
function equals$4(existing, incoming) {
|
|
472
969
|
const existing_parameters = existing.parameters;
|
|
473
970
|
const incoming_parameters = incoming.parameters;
|
|
474
|
-
if (!(existing_parameters === incoming_parameters
|
|
475
|
-
|| (existing_parameters != null &&
|
|
476
|
-
incoming_parameters != null &&
|
|
477
|
-
equals$3(existing_parameters, incoming_parameters)))) {
|
|
971
|
+
if (!(existing_parameters === incoming_parameters)) {
|
|
478
972
|
return false;
|
|
479
973
|
}
|
|
480
|
-
const
|
|
481
|
-
const
|
|
482
|
-
if (!(
|
|
974
|
+
const existing_responseId = existing.responseId;
|
|
975
|
+
const incoming_responseId = incoming.responseId;
|
|
976
|
+
if (!(existing_responseId === incoming_responseId)) {
|
|
483
977
|
return false;
|
|
484
978
|
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
979
|
+
const existing_text = existing.text;
|
|
980
|
+
const incoming_text = incoming.text;
|
|
981
|
+
if (!(existing_text === incoming_text)) {
|
|
982
|
+
return false;
|
|
983
|
+
}
|
|
984
|
+
const existing_contentQualityRepresentation = existing.contentQualityRepresentation;
|
|
985
|
+
const incoming_contentQualityRepresentation = incoming.contentQualityRepresentation;
|
|
986
|
+
// if at least one of these optionals is defined
|
|
987
|
+
if (existing_contentQualityRepresentation !== undefined || incoming_contentQualityRepresentation !== undefined) {
|
|
988
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
989
|
+
// not equal
|
|
990
|
+
if (existing_contentQualityRepresentation === undefined || incoming_contentQualityRepresentation === undefined) {
|
|
991
|
+
return false;
|
|
992
|
+
}
|
|
993
|
+
if (!(existing_contentQualityRepresentation === incoming_contentQualityRepresentation
|
|
994
|
+
|| (existing_contentQualityRepresentation != null &&
|
|
995
|
+
incoming_contentQualityRepresentation != null &&
|
|
996
|
+
equals$6(existing_contentQualityRepresentation, incoming_contentQualityRepresentation)))) {
|
|
997
|
+
return false;
|
|
492
998
|
}
|
|
493
999
|
}
|
|
494
|
-
const
|
|
495
|
-
const
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
function select$4(luvio, params) {
|
|
510
|
-
return select$5();
|
|
511
|
-
}
|
|
512
|
-
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
513
|
-
getTypeCacheKeys$2(storeKeyMap, luvio, response);
|
|
514
|
-
}
|
|
515
|
-
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
516
|
-
const { body } = response;
|
|
517
|
-
const key = keyBuilderFromType$2(luvio, body);
|
|
518
|
-
luvio.storeIngest(key, ingest$2, body);
|
|
519
|
-
const snapshot = luvio.storeLookup({
|
|
520
|
-
recordId: key,
|
|
521
|
-
node: select$4(),
|
|
522
|
-
variables: {},
|
|
523
|
-
});
|
|
524
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
525
|
-
if (snapshot.state !== 'Fulfilled') {
|
|
526
|
-
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1000
|
+
const existing_safetyScoreRepresentation = existing.safetyScoreRepresentation;
|
|
1001
|
+
const incoming_safetyScoreRepresentation = incoming.safetyScoreRepresentation;
|
|
1002
|
+
// if at least one of these optionals is defined
|
|
1003
|
+
if (existing_safetyScoreRepresentation !== undefined || incoming_safetyScoreRepresentation !== undefined) {
|
|
1004
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1005
|
+
// not equal
|
|
1006
|
+
if (existing_safetyScoreRepresentation === undefined || incoming_safetyScoreRepresentation === undefined) {
|
|
1007
|
+
return false;
|
|
1008
|
+
}
|
|
1009
|
+
if (!(existing_safetyScoreRepresentation === incoming_safetyScoreRepresentation
|
|
1010
|
+
|| (existing_safetyScoreRepresentation != null &&
|
|
1011
|
+
incoming_safetyScoreRepresentation != null &&
|
|
1012
|
+
equals$5(existing_safetyScoreRepresentation, incoming_safetyScoreRepresentation)))) {
|
|
1013
|
+
return false;
|
|
527
1014
|
}
|
|
528
1015
|
}
|
|
529
|
-
|
|
530
|
-
return snapshot;
|
|
531
|
-
}
|
|
532
|
-
function createResourceRequest$2(config) {
|
|
533
|
-
const headers = {};
|
|
534
|
-
return {
|
|
535
|
-
baseUri: '/services/data/v61.0',
|
|
536
|
-
basePath: '/einstein/llm/prompt/generations',
|
|
537
|
-
method: 'post',
|
|
538
|
-
body: config.body,
|
|
539
|
-
urlParams: {},
|
|
540
|
-
queryParams: {},
|
|
541
|
-
headers,
|
|
542
|
-
priority: 'normal',
|
|
543
|
-
};
|
|
1016
|
+
return true;
|
|
544
1017
|
}
|
|
545
1018
|
|
|
546
|
-
const
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
566
|
-
validateConfig(untrustedConfig, configPropertyNames);
|
|
567
|
-
}
|
|
568
|
-
const config = typeCheckConfig$2(untrustedConfig);
|
|
569
|
-
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
570
|
-
return null;
|
|
571
|
-
}
|
|
572
|
-
return config;
|
|
573
|
-
}
|
|
574
|
-
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
575
|
-
const resourceParams = createResourceParams$2(config);
|
|
576
|
-
const request = createResourceRequest$2(resourceParams);
|
|
577
|
-
return luvio.dispatchResourceRequest(request, options)
|
|
578
|
-
.then((response) => {
|
|
579
|
-
return luvio.handleSuccessResponse(() => {
|
|
580
|
-
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
581
|
-
return luvio.storeBroadcast().then(() => snapshot);
|
|
582
|
-
}, () => {
|
|
583
|
-
const cache = new StoreKeyMap();
|
|
584
|
-
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
585
|
-
return cache;
|
|
586
|
-
});
|
|
587
|
-
}, (response) => {
|
|
588
|
-
deepFreeze(response);
|
|
589
|
-
throw response;
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
const createGenerationsAdapterFactory = (luvio) => {
|
|
593
|
-
return function createGenerations(untrustedConfig) {
|
|
594
|
-
const config = validateAdapterConfig$2(untrustedConfig, createGenerations_ConfigPropertyNames);
|
|
595
|
-
// Invalid or incomplete config
|
|
596
|
-
if (config === null) {
|
|
597
|
-
throw new Error('Invalid config for "createGenerations"');
|
|
1019
|
+
const VERSION$3 = "4656c961c9d093a9e206c1db7d4de0b0";
|
|
1020
|
+
function validate$5(obj, path = 'WrappedMap') {
|
|
1021
|
+
const v_error = (() => {
|
|
1022
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1023
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1024
|
+
}
|
|
1025
|
+
const obj_wrappedMap = obj.wrappedMap;
|
|
1026
|
+
const path_wrappedMap = path + '.wrappedMap';
|
|
1027
|
+
if (typeof obj_wrappedMap !== 'object' || ArrayIsArray(obj_wrappedMap) || obj_wrappedMap === null) {
|
|
1028
|
+
return new TypeError('Expected "object" but received "' + typeof obj_wrappedMap + '" (at "' + path_wrappedMap + '")');
|
|
1029
|
+
}
|
|
1030
|
+
const obj_wrappedMap_keys = ObjectKeys(obj_wrappedMap);
|
|
1031
|
+
for (let i = 0; i < obj_wrappedMap_keys.length; i++) {
|
|
1032
|
+
const key = obj_wrappedMap_keys[i];
|
|
1033
|
+
const obj_wrappedMap_prop = obj_wrappedMap[key];
|
|
1034
|
+
const path_wrappedMap_prop = path_wrappedMap + '["' + key + '"]';
|
|
1035
|
+
if (typeof obj_wrappedMap_prop !== 'object' || ArrayIsArray(obj_wrappedMap_prop) || obj_wrappedMap_prop === null) {
|
|
1036
|
+
return new TypeError('Expected "object" but received "' + typeof obj_wrappedMap_prop + '" (at "' + path_wrappedMap_prop + '")');
|
|
1037
|
+
}
|
|
598
1038
|
}
|
|
599
|
-
|
|
1039
|
+
})();
|
|
1040
|
+
return v_error === undefined ? null : v_error;
|
|
1041
|
+
}
|
|
1042
|
+
const select$5 = function WrappedMapSelect() {
|
|
1043
|
+
return {
|
|
1044
|
+
kind: 'Fragment',
|
|
1045
|
+
version: VERSION$3,
|
|
1046
|
+
private: [],
|
|
1047
|
+
selections: []
|
|
600
1048
|
};
|
|
601
1049
|
};
|
|
1050
|
+
function equals$3(existing, incoming) {
|
|
1051
|
+
const existing_wrappedMap = existing.wrappedMap;
|
|
1052
|
+
const incoming_wrappedMap = incoming.wrappedMap;
|
|
1053
|
+
const equals_wrappedMap_props = equalsObject(existing_wrappedMap, incoming_wrappedMap, (existing_wrappedMap_prop, incoming_wrappedMap_prop) => {
|
|
1054
|
+
});
|
|
1055
|
+
if (equals_wrappedMap_props === false) {
|
|
1056
|
+
return false;
|
|
1057
|
+
}
|
|
1058
|
+
return true;
|
|
1059
|
+
}
|
|
602
1060
|
|
|
603
|
-
|
|
1061
|
+
const TTL$1 = 100;
|
|
1062
|
+
const VERSION$2 = "d8abd72a42e842b253da1c38954dafbc";
|
|
1063
|
+
function validate$4(obj, path = 'EinsteinLlmGenerationsRepresentation') {
|
|
604
1064
|
const v_error = (() => {
|
|
605
1065
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
606
1066
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
607
1067
|
}
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
1068
|
+
const obj_generations = obj.generations;
|
|
1069
|
+
const path_generations = path + '.generations';
|
|
1070
|
+
if (!ArrayIsArray(obj_generations)) {
|
|
1071
|
+
return new TypeError('Expected "array" but received "' + typeof obj_generations + '" (at "' + path_generations + '")');
|
|
1072
|
+
}
|
|
1073
|
+
for (let i = 0; i < obj_generations.length; i++) {
|
|
1074
|
+
const obj_generations_item = obj_generations[i];
|
|
1075
|
+
const path_generations_item = path_generations + '[' + i + ']';
|
|
1076
|
+
const referencepath_generations_itemValidationError = validate$6(obj_generations_item, path_generations_item);
|
|
1077
|
+
if (referencepath_generations_itemValidationError !== null) {
|
|
1078
|
+
let message = 'Object doesn\'t match EinsteinLlmGenerationItemRepresentation (at "' + path_generations_item + '")\n';
|
|
1079
|
+
message += referencepath_generations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1080
|
+
return new TypeError(message);
|
|
613
1081
|
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
1082
|
+
}
|
|
1083
|
+
const obj_parameters = obj.parameters;
|
|
1084
|
+
const path_parameters = path + '.parameters';
|
|
1085
|
+
let obj_parameters_union0 = null;
|
|
1086
|
+
const obj_parameters_union0_error = (() => {
|
|
1087
|
+
const referencepath_parametersValidationError = validate$5(obj_parameters, path_parameters);
|
|
1088
|
+
if (referencepath_parametersValidationError !== null) {
|
|
1089
|
+
let message = 'Object doesn\'t match WrappedMap (at "' + path_parameters + '")\n';
|
|
1090
|
+
message += referencepath_parametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1091
|
+
return new TypeError(message);
|
|
622
1092
|
}
|
|
1093
|
+
})();
|
|
1094
|
+
if (obj_parameters_union0_error != null) {
|
|
1095
|
+
obj_parameters_union0 = obj_parameters_union0_error.message;
|
|
623
1096
|
}
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
return new TypeError('Expected "string" but received "' + typeof obj_feedback + '" (at "' + path_feedback + '")');
|
|
1097
|
+
let obj_parameters_union1 = null;
|
|
1098
|
+
const obj_parameters_union1_error = (() => {
|
|
1099
|
+
if (obj_parameters !== null) {
|
|
1100
|
+
return new TypeError('Expected "null" but received "' + typeof obj_parameters + '" (at "' + path_parameters + '")');
|
|
629
1101
|
}
|
|
1102
|
+
})();
|
|
1103
|
+
if (obj_parameters_union1_error != null) {
|
|
1104
|
+
obj_parameters_union1 = obj_parameters_union1_error.message;
|
|
630
1105
|
}
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
1106
|
+
if (obj_parameters_union0 && obj_parameters_union1) {
|
|
1107
|
+
let message = 'Object doesn\'t match union (at "' + path_parameters + '")';
|
|
1108
|
+
message += '\n' + obj_parameters_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1109
|
+
message += '\n' + obj_parameters_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1110
|
+
return new TypeError(message);
|
|
635
1111
|
}
|
|
636
|
-
const
|
|
637
|
-
const
|
|
638
|
-
|
|
639
|
-
|
|
1112
|
+
const obj_prompt = obj.prompt;
|
|
1113
|
+
const path_prompt = path + '.prompt';
|
|
1114
|
+
let obj_prompt_union0 = null;
|
|
1115
|
+
const obj_prompt_union0_error = (() => {
|
|
1116
|
+
if (typeof obj_prompt !== 'string') {
|
|
1117
|
+
return new TypeError('Expected "string" but received "' + typeof obj_prompt + '" (at "' + path_prompt + '")');
|
|
1118
|
+
}
|
|
1119
|
+
})();
|
|
1120
|
+
if (obj_prompt_union0_error != null) {
|
|
1121
|
+
obj_prompt_union0 = obj_prompt_union0_error.message;
|
|
640
1122
|
}
|
|
641
|
-
|
|
642
|
-
const
|
|
643
|
-
|
|
644
|
-
|
|
1123
|
+
let obj_prompt_union1 = null;
|
|
1124
|
+
const obj_prompt_union1_error = (() => {
|
|
1125
|
+
if (obj_prompt !== null) {
|
|
1126
|
+
return new TypeError('Expected "null" but received "' + typeof obj_prompt + '" (at "' + path_prompt + '")');
|
|
1127
|
+
}
|
|
1128
|
+
})();
|
|
1129
|
+
if (obj_prompt_union1_error != null) {
|
|
1130
|
+
obj_prompt_union1 = obj_prompt_union1_error.message;
|
|
645
1131
|
}
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
const VERSION$1 = "4033328f65865dd5d80c68a7573a4522";
|
|
652
|
-
function validate$3(obj, path = 'EinsteinLlmFeedbackRepresentation') {
|
|
653
|
-
const v_error = (() => {
|
|
654
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
655
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1132
|
+
if (obj_prompt_union0 && obj_prompt_union1) {
|
|
1133
|
+
let message = 'Object doesn\'t match union (at "' + path_prompt + '")';
|
|
1134
|
+
message += '\n' + obj_prompt_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1135
|
+
message += '\n' + obj_prompt_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1136
|
+
return new TypeError(message);
|
|
656
1137
|
}
|
|
657
|
-
const
|
|
658
|
-
const
|
|
659
|
-
if (typeof
|
|
660
|
-
return new TypeError('Expected "string" but received "' + typeof
|
|
1138
|
+
const obj_requestId = obj.requestId;
|
|
1139
|
+
const path_requestId = path + '.requestId';
|
|
1140
|
+
if (typeof obj_requestId !== 'string') {
|
|
1141
|
+
return new TypeError('Expected "string" but received "' + typeof obj_requestId + '" (at "' + path_requestId + '")');
|
|
661
1142
|
}
|
|
662
1143
|
})();
|
|
663
1144
|
return v_error === undefined ? null : v_error;
|
|
664
1145
|
}
|
|
665
|
-
const RepresentationType$1 = '
|
|
1146
|
+
const RepresentationType$1 = 'EinsteinLlmGenerationsRepresentation';
|
|
666
1147
|
function keyBuilder$1(luvio, config) {
|
|
667
|
-
return keyPrefix + '::' + RepresentationType$1 + ':' + config.
|
|
1148
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + config.requestId;
|
|
668
1149
|
}
|
|
669
1150
|
function keyBuilderFromType$1(luvio, object) {
|
|
670
1151
|
const keyParams = {
|
|
671
|
-
|
|
1152
|
+
requestId: object.requestId
|
|
672
1153
|
};
|
|
673
1154
|
return keyBuilder$1(luvio, keyParams);
|
|
674
1155
|
}
|
|
675
1156
|
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
676
1157
|
return input;
|
|
677
1158
|
}
|
|
678
|
-
const select$
|
|
1159
|
+
const select$4 = function EinsteinLlmGenerationsRepresentationSelect() {
|
|
1160
|
+
const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$6();
|
|
1161
|
+
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$5();
|
|
679
1162
|
return {
|
|
680
1163
|
kind: 'Fragment',
|
|
681
|
-
version: VERSION$
|
|
1164
|
+
version: VERSION$2,
|
|
682
1165
|
private: [],
|
|
683
1166
|
selections: [
|
|
684
1167
|
{
|
|
685
|
-
name: '
|
|
1168
|
+
name: 'generations',
|
|
1169
|
+
kind: 'Object',
|
|
1170
|
+
plural: true,
|
|
1171
|
+
selections: EinsteinLlmGenerationItemRepresentation__selections
|
|
1172
|
+
},
|
|
1173
|
+
{
|
|
1174
|
+
name: 'parameters',
|
|
1175
|
+
kind: 'Object',
|
|
1176
|
+
nullable: true,
|
|
1177
|
+
selections: WrappedMap__selections
|
|
1178
|
+
},
|
|
1179
|
+
{
|
|
1180
|
+
name: 'prompt',
|
|
1181
|
+
kind: 'Scalar'
|
|
1182
|
+
},
|
|
1183
|
+
{
|
|
1184
|
+
name: 'requestId',
|
|
686
1185
|
kind: 'Scalar'
|
|
687
1186
|
}
|
|
688
1187
|
]
|
|
689
1188
|
};
|
|
690
1189
|
};
|
|
691
|
-
function equals$
|
|
692
|
-
const
|
|
693
|
-
const
|
|
694
|
-
if (!(
|
|
1190
|
+
function equals$2(existing, incoming) {
|
|
1191
|
+
const existing_requestId = existing.requestId;
|
|
1192
|
+
const incoming_requestId = incoming.requestId;
|
|
1193
|
+
if (!(existing_requestId === incoming_requestId)) {
|
|
1194
|
+
return false;
|
|
1195
|
+
}
|
|
1196
|
+
const existing_generations = existing.generations;
|
|
1197
|
+
const incoming_generations = incoming.generations;
|
|
1198
|
+
const equals_generations_items = equalsArray(existing_generations, incoming_generations, (existing_generations_item, incoming_generations_item) => {
|
|
1199
|
+
if (!(equals$4(existing_generations_item, incoming_generations_item))) {
|
|
1200
|
+
return false;
|
|
1201
|
+
}
|
|
1202
|
+
});
|
|
1203
|
+
if (equals_generations_items === false) {
|
|
1204
|
+
return false;
|
|
1205
|
+
}
|
|
1206
|
+
const existing_parameters = existing.parameters;
|
|
1207
|
+
const incoming_parameters = incoming.parameters;
|
|
1208
|
+
if (!(existing_parameters === incoming_parameters
|
|
1209
|
+
|| (existing_parameters != null &&
|
|
1210
|
+
incoming_parameters != null &&
|
|
1211
|
+
equals$3(existing_parameters, incoming_parameters)))) {
|
|
1212
|
+
return false;
|
|
1213
|
+
}
|
|
1214
|
+
const existing_prompt = existing.prompt;
|
|
1215
|
+
const incoming_prompt = incoming.prompt;
|
|
1216
|
+
if (!(existing_prompt === incoming_prompt)) {
|
|
695
1217
|
return false;
|
|
696
1218
|
}
|
|
697
1219
|
return true;
|
|
698
1220
|
}
|
|
699
|
-
const ingest$1 = function
|
|
1221
|
+
const ingest$1 = function EinsteinLlmGenerationsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
700
1222
|
if (process.env.NODE_ENV !== 'production') {
|
|
701
|
-
const validateError = validate$
|
|
1223
|
+
const validateError = validate$4(input);
|
|
702
1224
|
if (validateError !== null) {
|
|
703
1225
|
throw validateError;
|
|
704
1226
|
}
|
|
705
1227
|
}
|
|
706
1228
|
const key = keyBuilderFromType$1(luvio, input);
|
|
707
1229
|
const ttlToUse = TTL$1;
|
|
708
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "EinsteinLLM", VERSION$
|
|
1230
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "EinsteinLLM", VERSION$2, RepresentationType$1, equals$2);
|
|
709
1231
|
return createLink(key);
|
|
710
1232
|
};
|
|
711
1233
|
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
@@ -718,8 +1240,8 @@ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
|
718
1240
|
});
|
|
719
1241
|
}
|
|
720
1242
|
|
|
721
|
-
function select$
|
|
722
|
-
return select$
|
|
1243
|
+
function select$3(luvio, params) {
|
|
1244
|
+
return select$4();
|
|
723
1245
|
}
|
|
724
1246
|
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
725
1247
|
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
@@ -730,7 +1252,7 @@ function ingestSuccess$1(luvio, resourceParams, response) {
|
|
|
730
1252
|
luvio.storeIngest(key, ingest$1, body);
|
|
731
1253
|
const snapshot = luvio.storeLookup({
|
|
732
1254
|
recordId: key,
|
|
733
|
-
node: select$
|
|
1255
|
+
node: select$3(),
|
|
734
1256
|
variables: {},
|
|
735
1257
|
});
|
|
736
1258
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -744,8 +1266,8 @@ function ingestSuccess$1(luvio, resourceParams, response) {
|
|
|
744
1266
|
function createResourceRequest$1(config) {
|
|
745
1267
|
const headers = {};
|
|
746
1268
|
return {
|
|
747
|
-
baseUri: '/services/data/
|
|
748
|
-
basePath: '/einstein/llm/
|
|
1269
|
+
baseUri: '/services/data/v62.0',
|
|
1270
|
+
basePath: '/einstein/llm/prompt/generations',
|
|
749
1271
|
method: 'post',
|
|
750
1272
|
body: config.body,
|
|
751
1273
|
urlParams: {},
|
|
@@ -755,18 +1277,18 @@ function createResourceRequest$1(config) {
|
|
|
755
1277
|
};
|
|
756
1278
|
}
|
|
757
1279
|
|
|
758
|
-
const adapterName$1 = '
|
|
759
|
-
const
|
|
760
|
-
generateParamConfigMetadata('
|
|
1280
|
+
const adapterName$1 = 'createGenerations';
|
|
1281
|
+
const createGenerations_ConfigPropertyMetadata = [
|
|
1282
|
+
generateParamConfigMetadata('generationsInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
761
1283
|
];
|
|
762
|
-
const
|
|
763
|
-
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$3(
|
|
1284
|
+
const createGenerations_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, createGenerations_ConfigPropertyMetadata);
|
|
1285
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$3(createGenerations_ConfigPropertyMetadata);
|
|
764
1286
|
function typeCheckConfig$1(untrustedConfig) {
|
|
765
1287
|
const config = {};
|
|
766
|
-
const
|
|
767
|
-
const
|
|
768
|
-
if (
|
|
769
|
-
config.
|
|
1288
|
+
const untrustedConfig_generationsInput = untrustedConfig.generationsInput;
|
|
1289
|
+
const referenceEinsteinLlmGenerationsInputRepresentationValidationError = validate$9(untrustedConfig_generationsInput);
|
|
1290
|
+
if (referenceEinsteinLlmGenerationsInputRepresentationValidationError === null) {
|
|
1291
|
+
config.generationsInput = untrustedConfig_generationsInput;
|
|
770
1292
|
}
|
|
771
1293
|
return config;
|
|
772
1294
|
}
|
|
@@ -801,18 +1323,18 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
801
1323
|
throw response;
|
|
802
1324
|
});
|
|
803
1325
|
}
|
|
804
|
-
const
|
|
805
|
-
return function
|
|
806
|
-
const config = validateAdapterConfig$1(untrustedConfig,
|
|
1326
|
+
const createGenerationsAdapterFactory = (luvio) => {
|
|
1327
|
+
return function createGenerations(untrustedConfig) {
|
|
1328
|
+
const config = validateAdapterConfig$1(untrustedConfig, createGenerations_ConfigPropertyNames);
|
|
807
1329
|
// Invalid or incomplete config
|
|
808
1330
|
if (config === null) {
|
|
809
|
-
throw new Error('Invalid config for "
|
|
1331
|
+
throw new Error('Invalid config for "createGenerations"');
|
|
810
1332
|
}
|
|
811
1333
|
return buildNetworkSnapshot$1(luvio, config);
|
|
812
1334
|
};
|
|
813
1335
|
};
|
|
814
1336
|
|
|
815
|
-
function validate$
|
|
1337
|
+
function validate$3(obj, path = 'WrappedValueMap') {
|
|
816
1338
|
const v_error = (() => {
|
|
817
1339
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
818
1340
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -835,7 +1357,7 @@ function validate$2(obj, path = 'WrappedValueMap') {
|
|
|
835
1357
|
return v_error === undefined ? null : v_error;
|
|
836
1358
|
}
|
|
837
1359
|
|
|
838
|
-
function validate$
|
|
1360
|
+
function validate$2(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresentation') {
|
|
839
1361
|
const v_error = (() => {
|
|
840
1362
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
841
1363
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -843,7 +1365,7 @@ function validate$1(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
|
|
|
843
1365
|
if (obj.additionalConfig !== undefined) {
|
|
844
1366
|
const obj_additionalConfig = obj.additionalConfig;
|
|
845
1367
|
const path_additionalConfig = path + '.additionalConfig';
|
|
846
|
-
const referencepath_additionalConfigValidationError = validate$
|
|
1368
|
+
const referencepath_additionalConfigValidationError = validate$a(obj_additionalConfig, path_additionalConfig);
|
|
847
1369
|
if (referencepath_additionalConfigValidationError !== null) {
|
|
848
1370
|
let message = 'Object doesn\'t match EinsteinLlmAdditionalConfigInputRepresentation (at "' + path_additionalConfig + '")\n';
|
|
849
1371
|
message += referencepath_additionalConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -852,7 +1374,7 @@ function validate$1(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
|
|
|
852
1374
|
}
|
|
853
1375
|
const obj_inputParams = obj.inputParams;
|
|
854
1376
|
const path_inputParams = path + '.inputParams';
|
|
855
|
-
const referencepath_inputParamsValidationError = validate$
|
|
1377
|
+
const referencepath_inputParamsValidationError = validate$3(obj_inputParams, path_inputParams);
|
|
856
1378
|
if (referencepath_inputParamsValidationError !== null) {
|
|
857
1379
|
let message = 'Object doesn\'t match WrappedValueMap (at "' + path_inputParams + '")\n';
|
|
858
1380
|
message += referencepath_inputParamsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -874,13 +1396,119 @@ function validate$1(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
|
|
|
874
1396
|
return v_error === undefined ? null : v_error;
|
|
875
1397
|
}
|
|
876
1398
|
|
|
1399
|
+
const VERSION$1 = "6458d624e5a1691821c764b6de0badb3";
|
|
1400
|
+
function validate$1(obj, path = 'EinsteinPromptTemplateGenerationsErrorRepresentation') {
|
|
1401
|
+
const v_error = (() => {
|
|
1402
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1403
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1404
|
+
}
|
|
1405
|
+
const obj_errorMessage = obj.errorMessage;
|
|
1406
|
+
const path_errorMessage = path + '.errorMessage';
|
|
1407
|
+
if (typeof obj_errorMessage !== 'string') {
|
|
1408
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
|
|
1409
|
+
}
|
|
1410
|
+
const obj_httpErrorCode = obj.httpErrorCode;
|
|
1411
|
+
const path_httpErrorCode = path + '.httpErrorCode';
|
|
1412
|
+
if (typeof obj_httpErrorCode !== 'string') {
|
|
1413
|
+
return new TypeError('Expected "string" but received "' + typeof obj_httpErrorCode + '" (at "' + path_httpErrorCode + '")');
|
|
1414
|
+
}
|
|
1415
|
+
if (obj.localizedErrorMessage !== undefined) {
|
|
1416
|
+
const obj_localizedErrorMessage = obj.localizedErrorMessage;
|
|
1417
|
+
const path_localizedErrorMessage = path + '.localizedErrorMessage';
|
|
1418
|
+
if (typeof obj_localizedErrorMessage !== 'string') {
|
|
1419
|
+
return new TypeError('Expected "string" but received "' + typeof obj_localizedErrorMessage + '" (at "' + path_localizedErrorMessage + '")');
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
const obj_messageCode = obj.messageCode;
|
|
1423
|
+
const path_messageCode = path + '.messageCode';
|
|
1424
|
+
if (typeof obj_messageCode !== 'string') {
|
|
1425
|
+
return new TypeError('Expected "string" but received "' + typeof obj_messageCode + '" (at "' + path_messageCode + '")');
|
|
1426
|
+
}
|
|
1427
|
+
})();
|
|
1428
|
+
return v_error === undefined ? null : v_error;
|
|
1429
|
+
}
|
|
1430
|
+
const select$2 = function EinsteinPromptTemplateGenerationsErrorRepresentationSelect() {
|
|
1431
|
+
return {
|
|
1432
|
+
kind: 'Fragment',
|
|
1433
|
+
version: VERSION$1,
|
|
1434
|
+
private: [],
|
|
1435
|
+
selections: [
|
|
1436
|
+
{
|
|
1437
|
+
name: 'errorMessage',
|
|
1438
|
+
kind: 'Scalar'
|
|
1439
|
+
},
|
|
1440
|
+
{
|
|
1441
|
+
name: 'httpErrorCode',
|
|
1442
|
+
kind: 'Scalar'
|
|
1443
|
+
},
|
|
1444
|
+
{
|
|
1445
|
+
name: 'localizedErrorMessage',
|
|
1446
|
+
kind: 'Scalar',
|
|
1447
|
+
required: false
|
|
1448
|
+
},
|
|
1449
|
+
{
|
|
1450
|
+
name: 'messageCode',
|
|
1451
|
+
kind: 'Scalar'
|
|
1452
|
+
}
|
|
1453
|
+
]
|
|
1454
|
+
};
|
|
1455
|
+
};
|
|
1456
|
+
function equals$1(existing, incoming) {
|
|
1457
|
+
const existing_errorMessage = existing.errorMessage;
|
|
1458
|
+
const incoming_errorMessage = incoming.errorMessage;
|
|
1459
|
+
if (!(existing_errorMessage === incoming_errorMessage)) {
|
|
1460
|
+
return false;
|
|
1461
|
+
}
|
|
1462
|
+
const existing_httpErrorCode = existing.httpErrorCode;
|
|
1463
|
+
const incoming_httpErrorCode = incoming.httpErrorCode;
|
|
1464
|
+
if (!(existing_httpErrorCode === incoming_httpErrorCode)) {
|
|
1465
|
+
return false;
|
|
1466
|
+
}
|
|
1467
|
+
const existing_localizedErrorMessage = existing.localizedErrorMessage;
|
|
1468
|
+
const incoming_localizedErrorMessage = incoming.localizedErrorMessage;
|
|
1469
|
+
// if at least one of these optionals is defined
|
|
1470
|
+
if (existing_localizedErrorMessage !== undefined || incoming_localizedErrorMessage !== undefined) {
|
|
1471
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1472
|
+
// not equal
|
|
1473
|
+
if (existing_localizedErrorMessage === undefined || incoming_localizedErrorMessage === undefined) {
|
|
1474
|
+
return false;
|
|
1475
|
+
}
|
|
1476
|
+
if (!(existing_localizedErrorMessage === incoming_localizedErrorMessage)) {
|
|
1477
|
+
return false;
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
const existing_messageCode = existing.messageCode;
|
|
1481
|
+
const incoming_messageCode = incoming.messageCode;
|
|
1482
|
+
if (!(existing_messageCode === incoming_messageCode)) {
|
|
1483
|
+
return false;
|
|
1484
|
+
}
|
|
1485
|
+
return true;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
877
1488
|
const TTL = 100;
|
|
878
|
-
const VERSION = "
|
|
1489
|
+
const VERSION = "a4c71dd12b7b696b7b04ebf6cf5101a3";
|
|
879
1490
|
function validate(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation') {
|
|
880
1491
|
const v_error = (() => {
|
|
881
1492
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
882
1493
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
883
1494
|
}
|
|
1495
|
+
if (obj.generationErrors !== undefined) {
|
|
1496
|
+
const obj_generationErrors = obj.generationErrors;
|
|
1497
|
+
const path_generationErrors = path + '.generationErrors';
|
|
1498
|
+
if (!ArrayIsArray(obj_generationErrors)) {
|
|
1499
|
+
return new TypeError('Expected "array" but received "' + typeof obj_generationErrors + '" (at "' + path_generationErrors + '")');
|
|
1500
|
+
}
|
|
1501
|
+
for (let i = 0; i < obj_generationErrors.length; i++) {
|
|
1502
|
+
const obj_generationErrors_item = obj_generationErrors[i];
|
|
1503
|
+
const path_generationErrors_item = path_generationErrors + '[' + i + ']';
|
|
1504
|
+
const referencepath_generationErrors_itemValidationError = validate$1(obj_generationErrors_item, path_generationErrors_item);
|
|
1505
|
+
if (referencepath_generationErrors_itemValidationError !== null) {
|
|
1506
|
+
let message = 'Object doesn\'t match EinsteinPromptTemplateGenerationsErrorRepresentation (at "' + path_generationErrors_item + '")\n';
|
|
1507
|
+
message += referencepath_generationErrors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1508
|
+
return new TypeError(message);
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
884
1512
|
const obj_generations = obj.generations;
|
|
885
1513
|
const path_generations = path + '.generations';
|
|
886
1514
|
if (!ArrayIsArray(obj_generations)) {
|
|
@@ -889,7 +1517,7 @@ function validate(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation')
|
|
|
889
1517
|
for (let i = 0; i < obj_generations.length; i++) {
|
|
890
1518
|
const obj_generations_item = obj_generations[i];
|
|
891
1519
|
const path_generations_item = path_generations + '[' + i + ']';
|
|
892
|
-
const referencepath_generations_itemValidationError = validate$
|
|
1520
|
+
const referencepath_generations_itemValidationError = validate$6(obj_generations_item, path_generations_item);
|
|
893
1521
|
if (referencepath_generations_itemValidationError !== null) {
|
|
894
1522
|
let message = 'Object doesn\'t match EinsteinLlmGenerationItemRepresentation (at "' + path_generations_item + '")\n';
|
|
895
1523
|
message += referencepath_generations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -900,7 +1528,7 @@ function validate(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation')
|
|
|
900
1528
|
const path_parameters = path + '.parameters';
|
|
901
1529
|
let obj_parameters_union0 = null;
|
|
902
1530
|
const obj_parameters_union0_error = (() => {
|
|
903
|
-
const referencepath_parametersValidationError = validate$
|
|
1531
|
+
const referencepath_parametersValidationError = validate$5(obj_parameters, path_parameters);
|
|
904
1532
|
if (referencepath_parametersValidationError !== null) {
|
|
905
1533
|
let message = 'Object doesn\'t match WrappedMap (at "' + path_parameters + '")\n';
|
|
906
1534
|
message += referencepath_parametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -978,13 +1606,21 @@ function normalize(input, existing, path, luvio, store, timestamp) {
|
|
|
978
1606
|
return input;
|
|
979
1607
|
}
|
|
980
1608
|
const select$1 = function EinsteinPromptTemplateGenerationsRepresentationSelect() {
|
|
981
|
-
const { selections:
|
|
982
|
-
const { selections:
|
|
1609
|
+
const { selections: EinsteinPromptTemplateGenerationsErrorRepresentation__selections, opaque: EinsteinPromptTemplateGenerationsErrorRepresentation__opaque, } = select$2();
|
|
1610
|
+
const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$6();
|
|
1611
|
+
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$5();
|
|
983
1612
|
return {
|
|
984
1613
|
kind: 'Fragment',
|
|
985
1614
|
version: VERSION,
|
|
986
1615
|
private: [],
|
|
987
1616
|
selections: [
|
|
1617
|
+
{
|
|
1618
|
+
name: 'generationErrors',
|
|
1619
|
+
kind: 'Object',
|
|
1620
|
+
plural: true,
|
|
1621
|
+
selections: EinsteinPromptTemplateGenerationsErrorRepresentation__selections,
|
|
1622
|
+
required: false
|
|
1623
|
+
},
|
|
988
1624
|
{
|
|
989
1625
|
name: 'generations',
|
|
990
1626
|
kind: 'Object',
|
|
@@ -1023,6 +1659,24 @@ function equals(existing, incoming) {
|
|
|
1023
1659
|
if (!(existing_requestId === incoming_requestId)) {
|
|
1024
1660
|
return false;
|
|
1025
1661
|
}
|
|
1662
|
+
const existing_generationErrors = existing.generationErrors;
|
|
1663
|
+
const incoming_generationErrors = incoming.generationErrors;
|
|
1664
|
+
// if at least one of these optionals is defined
|
|
1665
|
+
if (existing_generationErrors !== undefined || incoming_generationErrors !== undefined) {
|
|
1666
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1667
|
+
// not equal
|
|
1668
|
+
if (existing_generationErrors === undefined || incoming_generationErrors === undefined) {
|
|
1669
|
+
return false;
|
|
1670
|
+
}
|
|
1671
|
+
const equals_generationErrors_items = equalsArray(existing_generationErrors, incoming_generationErrors, (existing_generationErrors_item, incoming_generationErrors_item) => {
|
|
1672
|
+
if (!(equals$1(existing_generationErrors_item, incoming_generationErrors_item))) {
|
|
1673
|
+
return false;
|
|
1674
|
+
}
|
|
1675
|
+
});
|
|
1676
|
+
if (equals_generationErrors_items === false) {
|
|
1677
|
+
return false;
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1026
1680
|
const existing_generations = existing.generations;
|
|
1027
1681
|
const incoming_generations = incoming.generations;
|
|
1028
1682
|
const equals_generations_items = equalsArray(existing_generations, incoming_generations, (existing_generations_item, incoming_generations_item) => {
|
|
@@ -1096,7 +1750,7 @@ function ingestSuccess(luvio, resourceParams, response) {
|
|
|
1096
1750
|
function createResourceRequest(config) {
|
|
1097
1751
|
const headers = {};
|
|
1098
1752
|
return {
|
|
1099
|
-
baseUri: '/services/data/
|
|
1753
|
+
baseUri: '/services/data/v62.0',
|
|
1100
1754
|
basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '/generations',
|
|
1101
1755
|
method: 'post',
|
|
1102
1756
|
body: config.body,
|
|
@@ -1119,7 +1773,7 @@ function typeCheckConfig(untrustedConfig) {
|
|
|
1119
1773
|
const config = {};
|
|
1120
1774
|
typeCheckConfig$3(untrustedConfig, config, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
|
|
1121
1775
|
const untrustedConfig_promptTemplateGenerationsInput = untrustedConfig.promptTemplateGenerationsInput;
|
|
1122
|
-
const referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError = validate$
|
|
1776
|
+
const referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError = validate$2(untrustedConfig_promptTemplateGenerationsInput);
|
|
1123
1777
|
if (referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError === null) {
|
|
1124
1778
|
config.promptTemplateGenerationsInput = untrustedConfig_promptTemplateGenerationsInput;
|
|
1125
1779
|
}
|