@salesforce/lds-adapters-service-einsteinllm 1.287.0-dev1 → 1.287.0-dev11
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 +1338 -295
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +1 -1
- package/dist/es/es2018/types/src/generated/types/EinsteinLlmGenerationItemRepresentation.d.ts +13 -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/EinsteinPromptTemplateGenerationsInputRepresentation.d.ts +4 -1
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateGenerationsRepresentation.d.ts +16 -1
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateMaskContentRepresentation.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateMaskDataRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateMaskSettingsRepresentation.d.ts +28 -0
- package/package.json +4 -4
- package/sfdc/index.js +1098 -55
- package/src/raml/api.raml +147 -17
|
@@ -104,7 +104,219 @@ function createLink(ref) {
|
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
function validate$
|
|
107
|
+
function validate$f(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$a = "4033328f65865dd5d80c68a7573a4522";
|
|
156
|
+
function validate$e(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$d = function EinsteinLlmFeedbackRepresentationSelect() {
|
|
183
|
+
return {
|
|
184
|
+
kind: 'Fragment',
|
|
185
|
+
version: VERSION$a,
|
|
186
|
+
private: [],
|
|
187
|
+
selections: [
|
|
188
|
+
{
|
|
189
|
+
name: 'message',
|
|
190
|
+
kind: 'Scalar'
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
function equals$a(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$e(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$a, RepresentationType$2, equals$a);
|
|
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$c(luvio, params) {
|
|
226
|
+
return select$d();
|
|
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$c(),
|
|
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/v61.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$f(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$d(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$c(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$d(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,12 +430,462 @@ 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$9 = "9ebac74e6f964c363d5fd1913df363af";
|
|
434
|
+
function validate$b(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
|
}
|
|
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
|
+
}
|
|
466
|
+
}
|
|
467
|
+
})();
|
|
468
|
+
return v_error === undefined ? null : v_error;
|
|
469
|
+
}
|
|
470
|
+
const select$b = function EinsteinLlmGenerationsContentQualityRepresentationSelect() {
|
|
471
|
+
return {
|
|
472
|
+
kind: 'Fragment',
|
|
473
|
+
version: VERSION$9,
|
|
474
|
+
private: [],
|
|
475
|
+
selections: [
|
|
476
|
+
{
|
|
477
|
+
name: 'isToxicityDetected',
|
|
478
|
+
kind: 'Scalar',
|
|
479
|
+
required: false
|
|
480
|
+
}
|
|
481
|
+
]
|
|
482
|
+
};
|
|
483
|
+
};
|
|
484
|
+
function equals$9(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
|
+
}
|
|
497
|
+
}
|
|
498
|
+
return true;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
const VERSION$8 = "77af44a252cb5b45b4d9a8101368d2aa";
|
|
502
|
+
function validate$a(obj, path = 'EinsteinLlmGenerationsSafetyScoreRepresentation') {
|
|
503
|
+
const v_error = (() => {
|
|
504
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
505
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
506
|
+
}
|
|
507
|
+
if (obj.hateScore !== undefined) {
|
|
508
|
+
const obj_hateScore = obj.hateScore;
|
|
509
|
+
const path_hateScore = path + '.hateScore';
|
|
510
|
+
let obj_hateScore_union0 = null;
|
|
511
|
+
const obj_hateScore_union0_error = (() => {
|
|
512
|
+
if (typeof obj_hateScore !== 'number') {
|
|
513
|
+
return new TypeError('Expected "number" but received "' + typeof obj_hateScore + '" (at "' + path_hateScore + '")');
|
|
514
|
+
}
|
|
515
|
+
})();
|
|
516
|
+
if (obj_hateScore_union0_error != null) {
|
|
517
|
+
obj_hateScore_union0 = obj_hateScore_union0_error.message;
|
|
518
|
+
}
|
|
519
|
+
let obj_hateScore_union1 = null;
|
|
520
|
+
const obj_hateScore_union1_error = (() => {
|
|
521
|
+
if (obj_hateScore !== null) {
|
|
522
|
+
return new TypeError('Expected "null" but received "' + typeof obj_hateScore + '" (at "' + path_hateScore + '")');
|
|
523
|
+
}
|
|
524
|
+
})();
|
|
525
|
+
if (obj_hateScore_union1_error != null) {
|
|
526
|
+
obj_hateScore_union1 = obj_hateScore_union1_error.message;
|
|
527
|
+
}
|
|
528
|
+
if (obj_hateScore_union0 && obj_hateScore_union1) {
|
|
529
|
+
let message = 'Object doesn\'t match union (at "' + path_hateScore + '")';
|
|
530
|
+
message += '\n' + obj_hateScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
531
|
+
message += '\n' + obj_hateScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
532
|
+
return new TypeError(message);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
if (obj.physicalScore !== undefined) {
|
|
536
|
+
const obj_physicalScore = obj.physicalScore;
|
|
537
|
+
const path_physicalScore = path + '.physicalScore';
|
|
538
|
+
let obj_physicalScore_union0 = null;
|
|
539
|
+
const obj_physicalScore_union0_error = (() => {
|
|
540
|
+
if (typeof obj_physicalScore !== 'number') {
|
|
541
|
+
return new TypeError('Expected "number" but received "' + typeof obj_physicalScore + '" (at "' + path_physicalScore + '")');
|
|
542
|
+
}
|
|
543
|
+
})();
|
|
544
|
+
if (obj_physicalScore_union0_error != null) {
|
|
545
|
+
obj_physicalScore_union0 = obj_physicalScore_union0_error.message;
|
|
546
|
+
}
|
|
547
|
+
let obj_physicalScore_union1 = null;
|
|
548
|
+
const obj_physicalScore_union1_error = (() => {
|
|
549
|
+
if (obj_physicalScore !== null) {
|
|
550
|
+
return new TypeError('Expected "null" but received "' + typeof obj_physicalScore + '" (at "' + path_physicalScore + '")');
|
|
551
|
+
}
|
|
552
|
+
})();
|
|
553
|
+
if (obj_physicalScore_union1_error != null) {
|
|
554
|
+
obj_physicalScore_union1 = obj_physicalScore_union1_error.message;
|
|
555
|
+
}
|
|
556
|
+
if (obj_physicalScore_union0 && obj_physicalScore_union1) {
|
|
557
|
+
let message = 'Object doesn\'t match union (at "' + path_physicalScore + '")';
|
|
558
|
+
message += '\n' + obj_physicalScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
559
|
+
message += '\n' + obj_physicalScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
560
|
+
return new TypeError(message);
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
if (obj.profanityScore !== undefined) {
|
|
564
|
+
const obj_profanityScore = obj.profanityScore;
|
|
565
|
+
const path_profanityScore = path + '.profanityScore';
|
|
566
|
+
let obj_profanityScore_union0 = null;
|
|
567
|
+
const obj_profanityScore_union0_error = (() => {
|
|
568
|
+
if (typeof obj_profanityScore !== 'number') {
|
|
569
|
+
return new TypeError('Expected "number" but received "' + typeof obj_profanityScore + '" (at "' + path_profanityScore + '")');
|
|
570
|
+
}
|
|
571
|
+
})();
|
|
572
|
+
if (obj_profanityScore_union0_error != null) {
|
|
573
|
+
obj_profanityScore_union0 = obj_profanityScore_union0_error.message;
|
|
574
|
+
}
|
|
575
|
+
let obj_profanityScore_union1 = null;
|
|
576
|
+
const obj_profanityScore_union1_error = (() => {
|
|
577
|
+
if (obj_profanityScore !== null) {
|
|
578
|
+
return new TypeError('Expected "null" but received "' + typeof obj_profanityScore + '" (at "' + path_profanityScore + '")');
|
|
579
|
+
}
|
|
580
|
+
})();
|
|
581
|
+
if (obj_profanityScore_union1_error != null) {
|
|
582
|
+
obj_profanityScore_union1 = obj_profanityScore_union1_error.message;
|
|
583
|
+
}
|
|
584
|
+
if (obj_profanityScore_union0 && obj_profanityScore_union1) {
|
|
585
|
+
let message = 'Object doesn\'t match union (at "' + path_profanityScore + '")';
|
|
586
|
+
message += '\n' + obj_profanityScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
587
|
+
message += '\n' + obj_profanityScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
588
|
+
return new TypeError(message);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
if (obj.safetyScore !== undefined) {
|
|
592
|
+
const obj_safetyScore = obj.safetyScore;
|
|
593
|
+
const path_safetyScore = path + '.safetyScore';
|
|
594
|
+
let obj_safetyScore_union0 = null;
|
|
595
|
+
const obj_safetyScore_union0_error = (() => {
|
|
596
|
+
if (typeof obj_safetyScore !== 'number') {
|
|
597
|
+
return new TypeError('Expected "number" but received "' + typeof obj_safetyScore + '" (at "' + path_safetyScore + '")');
|
|
598
|
+
}
|
|
599
|
+
})();
|
|
600
|
+
if (obj_safetyScore_union0_error != null) {
|
|
601
|
+
obj_safetyScore_union0 = obj_safetyScore_union0_error.message;
|
|
602
|
+
}
|
|
603
|
+
let obj_safetyScore_union1 = null;
|
|
604
|
+
const obj_safetyScore_union1_error = (() => {
|
|
605
|
+
if (obj_safetyScore !== null) {
|
|
606
|
+
return new TypeError('Expected "null" but received "' + typeof obj_safetyScore + '" (at "' + path_safetyScore + '")');
|
|
607
|
+
}
|
|
608
|
+
})();
|
|
609
|
+
if (obj_safetyScore_union1_error != null) {
|
|
610
|
+
obj_safetyScore_union1 = obj_safetyScore_union1_error.message;
|
|
611
|
+
}
|
|
612
|
+
if (obj_safetyScore_union0 && obj_safetyScore_union1) {
|
|
613
|
+
let message = 'Object doesn\'t match union (at "' + path_safetyScore + '")';
|
|
614
|
+
message += '\n' + obj_safetyScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
615
|
+
message += '\n' + obj_safetyScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
616
|
+
return new TypeError(message);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
if (obj.sexualScore !== undefined) {
|
|
620
|
+
const obj_sexualScore = obj.sexualScore;
|
|
621
|
+
const path_sexualScore = path + '.sexualScore';
|
|
622
|
+
let obj_sexualScore_union0 = null;
|
|
623
|
+
const obj_sexualScore_union0_error = (() => {
|
|
624
|
+
if (typeof obj_sexualScore !== 'number') {
|
|
625
|
+
return new TypeError('Expected "number" but received "' + typeof obj_sexualScore + '" (at "' + path_sexualScore + '")');
|
|
626
|
+
}
|
|
627
|
+
})();
|
|
628
|
+
if (obj_sexualScore_union0_error != null) {
|
|
629
|
+
obj_sexualScore_union0 = obj_sexualScore_union0_error.message;
|
|
630
|
+
}
|
|
631
|
+
let obj_sexualScore_union1 = null;
|
|
632
|
+
const obj_sexualScore_union1_error = (() => {
|
|
633
|
+
if (obj_sexualScore !== null) {
|
|
634
|
+
return new TypeError('Expected "null" but received "' + typeof obj_sexualScore + '" (at "' + path_sexualScore + '")');
|
|
635
|
+
}
|
|
636
|
+
})();
|
|
637
|
+
if (obj_sexualScore_union1_error != null) {
|
|
638
|
+
obj_sexualScore_union1 = obj_sexualScore_union1_error.message;
|
|
639
|
+
}
|
|
640
|
+
if (obj_sexualScore_union0 && obj_sexualScore_union1) {
|
|
641
|
+
let message = 'Object doesn\'t match union (at "' + path_sexualScore + '")';
|
|
642
|
+
message += '\n' + obj_sexualScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
643
|
+
message += '\n' + obj_sexualScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
644
|
+
return new TypeError(message);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
if (obj.toxicityScore !== undefined) {
|
|
648
|
+
const obj_toxicityScore = obj.toxicityScore;
|
|
649
|
+
const path_toxicityScore = path + '.toxicityScore';
|
|
650
|
+
let obj_toxicityScore_union0 = null;
|
|
651
|
+
const obj_toxicityScore_union0_error = (() => {
|
|
652
|
+
if (typeof obj_toxicityScore !== 'number') {
|
|
653
|
+
return new TypeError('Expected "number" but received "' + typeof obj_toxicityScore + '" (at "' + path_toxicityScore + '")');
|
|
654
|
+
}
|
|
655
|
+
})();
|
|
656
|
+
if (obj_toxicityScore_union0_error != null) {
|
|
657
|
+
obj_toxicityScore_union0 = obj_toxicityScore_union0_error.message;
|
|
658
|
+
}
|
|
659
|
+
let obj_toxicityScore_union1 = null;
|
|
660
|
+
const obj_toxicityScore_union1_error = (() => {
|
|
661
|
+
if (obj_toxicityScore !== null) {
|
|
662
|
+
return new TypeError('Expected "null" but received "' + typeof obj_toxicityScore + '" (at "' + path_toxicityScore + '")');
|
|
663
|
+
}
|
|
664
|
+
})();
|
|
665
|
+
if (obj_toxicityScore_union1_error != null) {
|
|
666
|
+
obj_toxicityScore_union1 = obj_toxicityScore_union1_error.message;
|
|
667
|
+
}
|
|
668
|
+
if (obj_toxicityScore_union0 && obj_toxicityScore_union1) {
|
|
669
|
+
let message = 'Object doesn\'t match union (at "' + path_toxicityScore + '")';
|
|
670
|
+
message += '\n' + obj_toxicityScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
671
|
+
message += '\n' + obj_toxicityScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
672
|
+
return new TypeError(message);
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
if (obj.violenceScore !== undefined) {
|
|
676
|
+
const obj_violenceScore = obj.violenceScore;
|
|
677
|
+
const path_violenceScore = path + '.violenceScore';
|
|
678
|
+
let obj_violenceScore_union0 = null;
|
|
679
|
+
const obj_violenceScore_union0_error = (() => {
|
|
680
|
+
if (typeof obj_violenceScore !== 'number') {
|
|
681
|
+
return new TypeError('Expected "number" but received "' + typeof obj_violenceScore + '" (at "' + path_violenceScore + '")');
|
|
682
|
+
}
|
|
683
|
+
})();
|
|
684
|
+
if (obj_violenceScore_union0_error != null) {
|
|
685
|
+
obj_violenceScore_union0 = obj_violenceScore_union0_error.message;
|
|
686
|
+
}
|
|
687
|
+
let obj_violenceScore_union1 = null;
|
|
688
|
+
const obj_violenceScore_union1_error = (() => {
|
|
689
|
+
if (obj_violenceScore !== null) {
|
|
690
|
+
return new TypeError('Expected "null" but received "' + typeof obj_violenceScore + '" (at "' + path_violenceScore + '")');
|
|
691
|
+
}
|
|
692
|
+
})();
|
|
693
|
+
if (obj_violenceScore_union1_error != null) {
|
|
694
|
+
obj_violenceScore_union1 = obj_violenceScore_union1_error.message;
|
|
695
|
+
}
|
|
696
|
+
if (obj_violenceScore_union0 && obj_violenceScore_union1) {
|
|
697
|
+
let message = 'Object doesn\'t match union (at "' + path_violenceScore + '")';
|
|
698
|
+
message += '\n' + obj_violenceScore_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
699
|
+
message += '\n' + obj_violenceScore_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
700
|
+
return new TypeError(message);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
})();
|
|
704
|
+
return v_error === undefined ? null : v_error;
|
|
705
|
+
}
|
|
706
|
+
const select$a = function EinsteinLlmGenerationsSafetyScoreRepresentationSelect() {
|
|
707
|
+
return {
|
|
708
|
+
kind: 'Fragment',
|
|
709
|
+
version: VERSION$8,
|
|
710
|
+
private: [],
|
|
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
|
+
]
|
|
748
|
+
};
|
|
749
|
+
};
|
|
750
|
+
function equals$8(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
|
+
}
|
|
841
|
+
}
|
|
842
|
+
return true;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
const VERSION$7 = "4a07778ff6c595d91c575188146647a1";
|
|
846
|
+
function validate$9(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
|
|
847
|
+
const v_error = (() => {
|
|
848
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
849
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
850
|
+
}
|
|
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$b(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');
|
|
879
|
+
return new TypeError(message);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
if (obj.isSummarized !== undefined) {
|
|
883
|
+
const obj_isSummarized = obj.isSummarized;
|
|
884
|
+
const path_isSummarized = path + '.isSummarized';
|
|
885
|
+
if (typeof obj_isSummarized !== 'boolean') {
|
|
886
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isSummarized + '" (at "' + path_isSummarized + '")');
|
|
887
|
+
}
|
|
888
|
+
}
|
|
227
889
|
const obj_parameters = obj.parameters;
|
|
228
890
|
const path_parameters = path + '.parameters';
|
|
229
891
|
if (typeof obj_parameters !== 'string') {
|
|
@@ -234,6 +896,37 @@ function validate$7(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
|
|
|
234
896
|
if (typeof obj_responseId !== 'string') {
|
|
235
897
|
return new TypeError('Expected "string" but received "' + typeof obj_responseId + '" (at "' + path_responseId + '")');
|
|
236
898
|
}
|
|
899
|
+
if (obj.safetyScoreRepresentation !== undefined) {
|
|
900
|
+
const obj_safetyScoreRepresentation = obj.safetyScoreRepresentation;
|
|
901
|
+
const path_safetyScoreRepresentation = path + '.safetyScoreRepresentation';
|
|
902
|
+
let obj_safetyScoreRepresentation_union0 = null;
|
|
903
|
+
const obj_safetyScoreRepresentation_union0_error = (() => {
|
|
904
|
+
const referencepath_safetyScoreRepresentationValidationError = validate$a(obj_safetyScoreRepresentation, path_safetyScoreRepresentation);
|
|
905
|
+
if (referencepath_safetyScoreRepresentationValidationError !== null) {
|
|
906
|
+
let message = 'Object doesn\'t match EinsteinLlmGenerationsSafetyScoreRepresentation (at "' + path_safetyScoreRepresentation + '")\n';
|
|
907
|
+
message += referencepath_safetyScoreRepresentationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
908
|
+
return new TypeError(message);
|
|
909
|
+
}
|
|
910
|
+
})();
|
|
911
|
+
if (obj_safetyScoreRepresentation_union0_error != null) {
|
|
912
|
+
obj_safetyScoreRepresentation_union0 = obj_safetyScoreRepresentation_union0_error.message;
|
|
913
|
+
}
|
|
914
|
+
let obj_safetyScoreRepresentation_union1 = null;
|
|
915
|
+
const obj_safetyScoreRepresentation_union1_error = (() => {
|
|
916
|
+
if (obj_safetyScoreRepresentation !== null) {
|
|
917
|
+
return new TypeError('Expected "null" but received "' + typeof obj_safetyScoreRepresentation + '" (at "' + path_safetyScoreRepresentation + '")');
|
|
918
|
+
}
|
|
919
|
+
})();
|
|
920
|
+
if (obj_safetyScoreRepresentation_union1_error != null) {
|
|
921
|
+
obj_safetyScoreRepresentation_union1 = obj_safetyScoreRepresentation_union1_error.message;
|
|
922
|
+
}
|
|
923
|
+
if (obj_safetyScoreRepresentation_union0 && obj_safetyScoreRepresentation_union1) {
|
|
924
|
+
let message = 'Object doesn\'t match union (at "' + path_safetyScoreRepresentation + '")';
|
|
925
|
+
message += '\n' + obj_safetyScoreRepresentation_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
926
|
+
message += '\n' + obj_safetyScoreRepresentation_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
927
|
+
return new TypeError(message);
|
|
928
|
+
}
|
|
929
|
+
}
|
|
237
930
|
const obj_text = obj.text;
|
|
238
931
|
const path_text = path + '.text';
|
|
239
932
|
if (typeof obj_text !== 'string') {
|
|
@@ -242,12 +935,26 @@ function validate$7(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
|
|
|
242
935
|
})();
|
|
243
936
|
return v_error === undefined ? null : v_error;
|
|
244
937
|
}
|
|
245
|
-
const select$
|
|
938
|
+
const select$9 = function EinsteinLlmGenerationItemRepresentationSelect() {
|
|
939
|
+
const { selections: EinsteinLlmGenerationsContentQualityRepresentation__selections, opaque: EinsteinLlmGenerationsContentQualityRepresentation__opaque, } = select$b();
|
|
940
|
+
const { selections: EinsteinLlmGenerationsSafetyScoreRepresentation__selections, opaque: EinsteinLlmGenerationsSafetyScoreRepresentation__opaque, } = select$a();
|
|
246
941
|
return {
|
|
247
942
|
kind: 'Fragment',
|
|
248
|
-
version: VERSION$
|
|
943
|
+
version: VERSION$7,
|
|
249
944
|
private: [],
|
|
250
945
|
selections: [
|
|
946
|
+
{
|
|
947
|
+
name: 'contentQualityRepresentation',
|
|
948
|
+
kind: 'Object',
|
|
949
|
+
nullable: true,
|
|
950
|
+
selections: EinsteinLlmGenerationsContentQualityRepresentation__selections,
|
|
951
|
+
required: false
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
name: 'isSummarized',
|
|
955
|
+
kind: 'Scalar',
|
|
956
|
+
required: false
|
|
957
|
+
},
|
|
251
958
|
{
|
|
252
959
|
name: 'parameters',
|
|
253
960
|
kind: 'Scalar'
|
|
@@ -256,6 +963,13 @@ const select$7 = function EinsteinLlmGenerationItemRepresentationSelect() {
|
|
|
256
963
|
name: 'responseId',
|
|
257
964
|
kind: 'Scalar'
|
|
258
965
|
},
|
|
966
|
+
{
|
|
967
|
+
name: 'safetyScoreRepresentation',
|
|
968
|
+
kind: 'Object',
|
|
969
|
+
nullable: true,
|
|
970
|
+
selections: EinsteinLlmGenerationsSafetyScoreRepresentation__selections,
|
|
971
|
+
required: false
|
|
972
|
+
},
|
|
259
973
|
{
|
|
260
974
|
name: 'text',
|
|
261
975
|
kind: 'Scalar'
|
|
@@ -263,7 +977,20 @@ const select$7 = function EinsteinLlmGenerationItemRepresentationSelect() {
|
|
|
263
977
|
]
|
|
264
978
|
};
|
|
265
979
|
};
|
|
266
|
-
function equals$
|
|
980
|
+
function equals$7(existing, incoming) {
|
|
981
|
+
const existing_isSummarized = existing.isSummarized;
|
|
982
|
+
const incoming_isSummarized = incoming.isSummarized;
|
|
983
|
+
// if at least one of these optionals is defined
|
|
984
|
+
if (existing_isSummarized !== undefined || incoming_isSummarized !== undefined) {
|
|
985
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
986
|
+
// not equal
|
|
987
|
+
if (existing_isSummarized === undefined || incoming_isSummarized === undefined) {
|
|
988
|
+
return false;
|
|
989
|
+
}
|
|
990
|
+
if (!(existing_isSummarized === incoming_isSummarized)) {
|
|
991
|
+
return false;
|
|
992
|
+
}
|
|
993
|
+
}
|
|
267
994
|
const existing_parameters = existing.parameters;
|
|
268
995
|
const incoming_parameters = incoming.parameters;
|
|
269
996
|
if (!(existing_parameters === incoming_parameters)) {
|
|
@@ -279,11 +1006,43 @@ function equals$4(existing, incoming) {
|
|
|
279
1006
|
if (!(existing_text === incoming_text)) {
|
|
280
1007
|
return false;
|
|
281
1008
|
}
|
|
1009
|
+
const existing_contentQualityRepresentation = existing.contentQualityRepresentation;
|
|
1010
|
+
const incoming_contentQualityRepresentation = incoming.contentQualityRepresentation;
|
|
1011
|
+
// if at least one of these optionals is defined
|
|
1012
|
+
if (existing_contentQualityRepresentation !== undefined || incoming_contentQualityRepresentation !== undefined) {
|
|
1013
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1014
|
+
// not equal
|
|
1015
|
+
if (existing_contentQualityRepresentation === undefined || incoming_contentQualityRepresentation === undefined) {
|
|
1016
|
+
return false;
|
|
1017
|
+
}
|
|
1018
|
+
if (!(existing_contentQualityRepresentation === incoming_contentQualityRepresentation
|
|
1019
|
+
|| (existing_contentQualityRepresentation != null &&
|
|
1020
|
+
incoming_contentQualityRepresentation != null &&
|
|
1021
|
+
equals$9(existing_contentQualityRepresentation, incoming_contentQualityRepresentation)))) {
|
|
1022
|
+
return false;
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
const existing_safetyScoreRepresentation = existing.safetyScoreRepresentation;
|
|
1026
|
+
const incoming_safetyScoreRepresentation = incoming.safetyScoreRepresentation;
|
|
1027
|
+
// if at least one of these optionals is defined
|
|
1028
|
+
if (existing_safetyScoreRepresentation !== undefined || incoming_safetyScoreRepresentation !== undefined) {
|
|
1029
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1030
|
+
// not equal
|
|
1031
|
+
if (existing_safetyScoreRepresentation === undefined || incoming_safetyScoreRepresentation === undefined) {
|
|
1032
|
+
return false;
|
|
1033
|
+
}
|
|
1034
|
+
if (!(existing_safetyScoreRepresentation === incoming_safetyScoreRepresentation
|
|
1035
|
+
|| (existing_safetyScoreRepresentation != null &&
|
|
1036
|
+
incoming_safetyScoreRepresentation != null &&
|
|
1037
|
+
equals$8(existing_safetyScoreRepresentation, incoming_safetyScoreRepresentation)))) {
|
|
1038
|
+
return false;
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
282
1041
|
return true;
|
|
283
1042
|
}
|
|
284
1043
|
|
|
285
|
-
const VERSION$
|
|
286
|
-
function validate$
|
|
1044
|
+
const VERSION$6 = "4656c961c9d093a9e206c1db7d4de0b0";
|
|
1045
|
+
function validate$8(obj, path = 'WrappedMap') {
|
|
287
1046
|
const v_error = (() => {
|
|
288
1047
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
289
1048
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -305,15 +1064,15 @@ function validate$6(obj, path = 'WrappedMap') {
|
|
|
305
1064
|
})();
|
|
306
1065
|
return v_error === undefined ? null : v_error;
|
|
307
1066
|
}
|
|
308
|
-
const select$
|
|
1067
|
+
const select$8 = function WrappedMapSelect() {
|
|
309
1068
|
return {
|
|
310
1069
|
kind: 'Fragment',
|
|
311
|
-
version: VERSION$
|
|
1070
|
+
version: VERSION$6,
|
|
312
1071
|
private: [],
|
|
313
1072
|
selections: []
|
|
314
1073
|
};
|
|
315
1074
|
};
|
|
316
|
-
function equals$
|
|
1075
|
+
function equals$6(existing, incoming) {
|
|
317
1076
|
const existing_wrappedMap = existing.wrappedMap;
|
|
318
1077
|
const incoming_wrappedMap = incoming.wrappedMap;
|
|
319
1078
|
const equals_wrappedMap_props = equalsObject(existing_wrappedMap, incoming_wrappedMap, (existing_wrappedMap_prop, incoming_wrappedMap_prop) => {
|
|
@@ -324,9 +1083,9 @@ function equals$3(existing, incoming) {
|
|
|
324
1083
|
return true;
|
|
325
1084
|
}
|
|
326
1085
|
|
|
327
|
-
const TTL$
|
|
328
|
-
const VERSION$
|
|
329
|
-
function validate$
|
|
1086
|
+
const TTL$1 = 100;
|
|
1087
|
+
const VERSION$5 = "d8abd72a42e842b253da1c38954dafbc";
|
|
1088
|
+
function validate$7(obj, path = 'EinsteinLlmGenerationsRepresentation') {
|
|
330
1089
|
const v_error = (() => {
|
|
331
1090
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
332
1091
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -339,7 +1098,7 @@ function validate$5(obj, path = 'EinsteinLlmGenerationsRepresentation') {
|
|
|
339
1098
|
for (let i = 0; i < obj_generations.length; i++) {
|
|
340
1099
|
const obj_generations_item = obj_generations[i];
|
|
341
1100
|
const path_generations_item = path_generations + '[' + i + ']';
|
|
342
|
-
const referencepath_generations_itemValidationError = validate$
|
|
1101
|
+
const referencepath_generations_itemValidationError = validate$9(obj_generations_item, path_generations_item);
|
|
343
1102
|
if (referencepath_generations_itemValidationError !== null) {
|
|
344
1103
|
let message = 'Object doesn\'t match EinsteinLlmGenerationItemRepresentation (at "' + path_generations_item + '")\n';
|
|
345
1104
|
message += referencepath_generations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -350,7 +1109,7 @@ function validate$5(obj, path = 'EinsteinLlmGenerationsRepresentation') {
|
|
|
350
1109
|
const path_parameters = path + '.parameters';
|
|
351
1110
|
let obj_parameters_union0 = null;
|
|
352
1111
|
const obj_parameters_union0_error = (() => {
|
|
353
|
-
const referencepath_parametersValidationError = validate$
|
|
1112
|
+
const referencepath_parametersValidationError = validate$8(obj_parameters, path_parameters);
|
|
354
1113
|
if (referencepath_parametersValidationError !== null) {
|
|
355
1114
|
let message = 'Object doesn\'t match WrappedMap (at "' + path_parameters + '")\n';
|
|
356
1115
|
message += referencepath_parametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -409,25 +1168,25 @@ function validate$5(obj, path = 'EinsteinLlmGenerationsRepresentation') {
|
|
|
409
1168
|
})();
|
|
410
1169
|
return v_error === undefined ? null : v_error;
|
|
411
1170
|
}
|
|
412
|
-
const RepresentationType$
|
|
413
|
-
function keyBuilder$
|
|
414
|
-
return keyPrefix + '::' + RepresentationType$
|
|
1171
|
+
const RepresentationType$1 = 'EinsteinLlmGenerationsRepresentation';
|
|
1172
|
+
function keyBuilder$1(luvio, config) {
|
|
1173
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + config.requestId;
|
|
415
1174
|
}
|
|
416
|
-
function keyBuilderFromType$
|
|
1175
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
417
1176
|
const keyParams = {
|
|
418
1177
|
requestId: object.requestId
|
|
419
1178
|
};
|
|
420
|
-
return keyBuilder$
|
|
1179
|
+
return keyBuilder$1(luvio, keyParams);
|
|
421
1180
|
}
|
|
422
|
-
function normalize$
|
|
1181
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
423
1182
|
return input;
|
|
424
1183
|
}
|
|
425
|
-
const select$
|
|
426
|
-
const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$
|
|
427
|
-
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$
|
|
1184
|
+
const select$7 = function EinsteinLlmGenerationsRepresentationSelect() {
|
|
1185
|
+
const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$9();
|
|
1186
|
+
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$8();
|
|
428
1187
|
return {
|
|
429
1188
|
kind: 'Fragment',
|
|
430
|
-
version: VERSION$
|
|
1189
|
+
version: VERSION$5,
|
|
431
1190
|
private: [],
|
|
432
1191
|
selections: [
|
|
433
1192
|
{
|
|
@@ -453,259 +1212,47 @@ const select$5 = function EinsteinLlmGenerationsRepresentationSelect() {
|
|
|
453
1212
|
]
|
|
454
1213
|
};
|
|
455
1214
|
};
|
|
456
|
-
function equals$
|
|
1215
|
+
function equals$5(existing, incoming) {
|
|
457
1216
|
const existing_requestId = existing.requestId;
|
|
458
1217
|
const incoming_requestId = incoming.requestId;
|
|
459
1218
|
if (!(existing_requestId === incoming_requestId)) {
|
|
460
1219
|
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$
|
|
466
|
-
return false;
|
|
467
|
-
}
|
|
468
|
-
});
|
|
469
|
-
if (equals_generations_items === false) {
|
|
470
|
-
return false;
|
|
471
|
-
}
|
|
472
|
-
const existing_parameters = existing.parameters;
|
|
473
|
-
const incoming_parameters = incoming.parameters;
|
|
474
|
-
if (!(existing_parameters === incoming_parameters
|
|
475
|
-
|| (existing_parameters != null &&
|
|
476
|
-
incoming_parameters != null &&
|
|
477
|
-
equals$
|
|
478
|
-
return false;
|
|
479
|
-
}
|
|
480
|
-
const existing_prompt = existing.prompt;
|
|
481
|
-
const incoming_prompt = incoming.prompt;
|
|
482
|
-
if (!(existing_prompt === incoming_prompt)) {
|
|
483
|
-
return false;
|
|
484
|
-
}
|
|
485
|
-
return true;
|
|
486
|
-
}
|
|
487
|
-
const ingest$2 = function EinsteinLlmGenerationsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
488
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
489
|
-
const validateError = validate$5(input);
|
|
490
|
-
if (validateError !== null) {
|
|
491
|
-
throw validateError;
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
const key = keyBuilderFromType$2(luvio, input);
|
|
495
|
-
const ttlToUse = TTL$2;
|
|
496
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "EinsteinLLM", VERSION$2, RepresentationType$2, equals$2);
|
|
497
|
-
return createLink(key);
|
|
498
|
-
};
|
|
499
|
-
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
500
|
-
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
501
|
-
const rootKey = keyBuilderFromType$2(luvio, input);
|
|
502
|
-
rootKeySet.set(rootKey, {
|
|
503
|
-
namespace: keyPrefix,
|
|
504
|
-
representationName: RepresentationType$2,
|
|
505
|
-
mergeable: false
|
|
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');
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
deepFreeze(snapshot.data);
|
|
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
|
-
};
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
const adapterName$2 = 'createGenerations';
|
|
547
|
-
const createGenerations_ConfigPropertyMetadata = [
|
|
548
|
-
generateParamConfigMetadata('generationsInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
549
|
-
];
|
|
550
|
-
const createGenerations_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, createGenerations_ConfigPropertyMetadata);
|
|
551
|
-
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$3(createGenerations_ConfigPropertyMetadata);
|
|
552
|
-
function typeCheckConfig$2(untrustedConfig) {
|
|
553
|
-
const config = {};
|
|
554
|
-
const untrustedConfig_generationsInput = untrustedConfig.generationsInput;
|
|
555
|
-
const referenceEinsteinLlmGenerationsInputRepresentationValidationError = validate$8(untrustedConfig_generationsInput);
|
|
556
|
-
if (referenceEinsteinLlmGenerationsInputRepresentationValidationError === null) {
|
|
557
|
-
config.generationsInput = untrustedConfig_generationsInput;
|
|
558
|
-
}
|
|
559
|
-
return config;
|
|
560
|
-
}
|
|
561
|
-
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
562
|
-
if (!untrustedIsObject(untrustedConfig)) {
|
|
563
|
-
return null;
|
|
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"');
|
|
598
|
-
}
|
|
599
|
-
return buildNetworkSnapshot$2(luvio, config);
|
|
600
|
-
};
|
|
601
|
-
};
|
|
602
|
-
|
|
603
|
-
function validate$4(obj, path = 'EinsteinLlmFeedbackInputRepresentation') {
|
|
604
|
-
const v_error = (() => {
|
|
605
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
606
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
607
|
-
}
|
|
608
|
-
if (obj.appFeedback !== undefined) {
|
|
609
|
-
const obj_appFeedback = obj.appFeedback;
|
|
610
|
-
const path_appFeedback = path + '.appFeedback';
|
|
611
|
-
if (typeof obj_appFeedback !== 'object' || ArrayIsArray(obj_appFeedback) || obj_appFeedback === null) {
|
|
612
|
-
return new TypeError('Expected "object" but received "' + typeof obj_appFeedback + '" (at "' + path_appFeedback + '")');
|
|
613
|
-
}
|
|
614
|
-
const obj_appFeedback_keys = ObjectKeys(obj_appFeedback);
|
|
615
|
-
for (let i = 0; i < obj_appFeedback_keys.length; i++) {
|
|
616
|
-
const key = obj_appFeedback_keys[i];
|
|
617
|
-
const obj_appFeedback_prop = obj_appFeedback[key];
|
|
618
|
-
const path_appFeedback_prop = path_appFeedback + '["' + key + '"]';
|
|
619
|
-
if (typeof obj_appFeedback_prop !== 'object' || ArrayIsArray(obj_appFeedback_prop) || obj_appFeedback_prop === null) {
|
|
620
|
-
return new TypeError('Expected "object" but received "' + typeof obj_appFeedback_prop + '" (at "' + path_appFeedback_prop + '")');
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
if (obj.feedback !== undefined) {
|
|
625
|
-
const obj_feedback = obj.feedback;
|
|
626
|
-
const path_feedback = path + '.feedback';
|
|
627
|
-
if (typeof obj_feedback !== 'string') {
|
|
628
|
-
return new TypeError('Expected "string" but received "' + typeof obj_feedback + '" (at "' + path_feedback + '")');
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
const obj_feedbackText = obj.feedbackText;
|
|
632
|
-
const path_feedbackText = path + '.feedbackText';
|
|
633
|
-
if (typeof obj_feedbackText !== 'string') {
|
|
634
|
-
return new TypeError('Expected "string" but received "' + typeof obj_feedbackText + '" (at "' + path_feedbackText + '")');
|
|
635
|
-
}
|
|
636
|
-
const obj_generationId = obj.generationId;
|
|
637
|
-
const path_generationId = path + '.generationId';
|
|
638
|
-
if (typeof obj_generationId !== 'string') {
|
|
639
|
-
return new TypeError('Expected "string" but received "' + typeof obj_generationId + '" (at "' + path_generationId + '")');
|
|
640
|
-
}
|
|
641
|
-
const obj_id = obj.id;
|
|
642
|
-
const path_id = path + '.id';
|
|
643
|
-
if (typeof obj_id !== 'string') {
|
|
644
|
-
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
645
|
-
}
|
|
646
|
-
})();
|
|
647
|
-
return v_error === undefined ? null : v_error;
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
const TTL$1 = 100;
|
|
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 + '")');
|
|
656
|
-
}
|
|
657
|
-
const obj_message = obj.message;
|
|
658
|
-
const path_message = path + '.message';
|
|
659
|
-
if (typeof obj_message !== 'string') {
|
|
660
|
-
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
661
|
-
}
|
|
662
|
-
})();
|
|
663
|
-
return v_error === undefined ? null : v_error;
|
|
664
|
-
}
|
|
665
|
-
const RepresentationType$1 = 'EinsteinLlmFeedbackRepresentation';
|
|
666
|
-
function keyBuilder$1(luvio, config) {
|
|
667
|
-
return keyPrefix + '::' + RepresentationType$1 + ':' + config.message;
|
|
668
|
-
}
|
|
669
|
-
function keyBuilderFromType$1(luvio, object) {
|
|
670
|
-
const keyParams = {
|
|
671
|
-
message: object.message
|
|
672
|
-
};
|
|
673
|
-
return keyBuilder$1(luvio, keyParams);
|
|
674
|
-
}
|
|
675
|
-
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
676
|
-
return input;
|
|
677
|
-
}
|
|
678
|
-
const select$3 = function EinsteinLlmFeedbackRepresentationSelect() {
|
|
679
|
-
return {
|
|
680
|
-
kind: 'Fragment',
|
|
681
|
-
version: VERSION$1,
|
|
682
|
-
private: [],
|
|
683
|
-
selections: [
|
|
684
|
-
{
|
|
685
|
-
name: 'message',
|
|
686
|
-
kind: 'Scalar'
|
|
687
|
-
}
|
|
688
|
-
]
|
|
689
|
-
};
|
|
690
|
-
};
|
|
691
|
-
function equals$1(existing, incoming) {
|
|
692
|
-
const existing_message = existing.message;
|
|
693
|
-
const incoming_message = incoming.message;
|
|
694
|
-
if (!(existing_message === incoming_message)) {
|
|
1220
|
+
}
|
|
1221
|
+
const existing_generations = existing.generations;
|
|
1222
|
+
const incoming_generations = incoming.generations;
|
|
1223
|
+
const equals_generations_items = equalsArray(existing_generations, incoming_generations, (existing_generations_item, incoming_generations_item) => {
|
|
1224
|
+
if (!(equals$7(existing_generations_item, incoming_generations_item))) {
|
|
1225
|
+
return false;
|
|
1226
|
+
}
|
|
1227
|
+
});
|
|
1228
|
+
if (equals_generations_items === false) {
|
|
1229
|
+
return false;
|
|
1230
|
+
}
|
|
1231
|
+
const existing_parameters = existing.parameters;
|
|
1232
|
+
const incoming_parameters = incoming.parameters;
|
|
1233
|
+
if (!(existing_parameters === incoming_parameters
|
|
1234
|
+
|| (existing_parameters != null &&
|
|
1235
|
+
incoming_parameters != null &&
|
|
1236
|
+
equals$6(existing_parameters, incoming_parameters)))) {
|
|
1237
|
+
return false;
|
|
1238
|
+
}
|
|
1239
|
+
const existing_prompt = existing.prompt;
|
|
1240
|
+
const incoming_prompt = incoming.prompt;
|
|
1241
|
+
if (!(existing_prompt === incoming_prompt)) {
|
|
695
1242
|
return false;
|
|
696
1243
|
}
|
|
697
1244
|
return true;
|
|
698
1245
|
}
|
|
699
|
-
const ingest$1 = function
|
|
1246
|
+
const ingest$1 = function EinsteinLlmGenerationsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
700
1247
|
if (process.env.NODE_ENV !== 'production') {
|
|
701
|
-
const validateError = validate$
|
|
1248
|
+
const validateError = validate$7(input);
|
|
702
1249
|
if (validateError !== null) {
|
|
703
1250
|
throw validateError;
|
|
704
1251
|
}
|
|
705
1252
|
}
|
|
706
1253
|
const key = keyBuilderFromType$1(luvio, input);
|
|
707
1254
|
const ttlToUse = TTL$1;
|
|
708
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "EinsteinLLM", VERSION$
|
|
1255
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "EinsteinLLM", VERSION$5, RepresentationType$1, equals$5);
|
|
709
1256
|
return createLink(key);
|
|
710
1257
|
};
|
|
711
1258
|
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
@@ -718,8 +1265,8 @@ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
|
718
1265
|
});
|
|
719
1266
|
}
|
|
720
1267
|
|
|
721
|
-
function select$
|
|
722
|
-
return select$
|
|
1268
|
+
function select$6(luvio, params) {
|
|
1269
|
+
return select$7();
|
|
723
1270
|
}
|
|
724
1271
|
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
725
1272
|
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
@@ -730,7 +1277,7 @@ function ingestSuccess$1(luvio, resourceParams, response) {
|
|
|
730
1277
|
luvio.storeIngest(key, ingest$1, body);
|
|
731
1278
|
const snapshot = luvio.storeLookup({
|
|
732
1279
|
recordId: key,
|
|
733
|
-
node: select$
|
|
1280
|
+
node: select$6(),
|
|
734
1281
|
variables: {},
|
|
735
1282
|
});
|
|
736
1283
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -745,7 +1292,7 @@ function createResourceRequest$1(config) {
|
|
|
745
1292
|
const headers = {};
|
|
746
1293
|
return {
|
|
747
1294
|
baseUri: '/services/data/v61.0',
|
|
748
|
-
basePath: '/einstein/llm/
|
|
1295
|
+
basePath: '/einstein/llm/prompt/generations',
|
|
749
1296
|
method: 'post',
|
|
750
1297
|
body: config.body,
|
|
751
1298
|
urlParams: {},
|
|
@@ -755,18 +1302,18 @@ function createResourceRequest$1(config) {
|
|
|
755
1302
|
};
|
|
756
1303
|
}
|
|
757
1304
|
|
|
758
|
-
const adapterName$1 = '
|
|
759
|
-
const
|
|
760
|
-
generateParamConfigMetadata('
|
|
1305
|
+
const adapterName$1 = 'createGenerations';
|
|
1306
|
+
const createGenerations_ConfigPropertyMetadata = [
|
|
1307
|
+
generateParamConfigMetadata('generationsInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
761
1308
|
];
|
|
762
|
-
const
|
|
763
|
-
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$3(
|
|
1309
|
+
const createGenerations_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, createGenerations_ConfigPropertyMetadata);
|
|
1310
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$3(createGenerations_ConfigPropertyMetadata);
|
|
764
1311
|
function typeCheckConfig$1(untrustedConfig) {
|
|
765
1312
|
const config = {};
|
|
766
|
-
const
|
|
767
|
-
const
|
|
768
|
-
if (
|
|
769
|
-
config.
|
|
1313
|
+
const untrustedConfig_generationsInput = untrustedConfig.generationsInput;
|
|
1314
|
+
const referenceEinsteinLlmGenerationsInputRepresentationValidationError = validate$c(untrustedConfig_generationsInput);
|
|
1315
|
+
if (referenceEinsteinLlmGenerationsInputRepresentationValidationError === null) {
|
|
1316
|
+
config.generationsInput = untrustedConfig_generationsInput;
|
|
770
1317
|
}
|
|
771
1318
|
return config;
|
|
772
1319
|
}
|
|
@@ -801,18 +1348,18 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
801
1348
|
throw response;
|
|
802
1349
|
});
|
|
803
1350
|
}
|
|
804
|
-
const
|
|
805
|
-
return function
|
|
806
|
-
const config = validateAdapterConfig$1(untrustedConfig,
|
|
1351
|
+
const createGenerationsAdapterFactory = (luvio) => {
|
|
1352
|
+
return function createGenerations(untrustedConfig) {
|
|
1353
|
+
const config = validateAdapterConfig$1(untrustedConfig, createGenerations_ConfigPropertyNames);
|
|
807
1354
|
// Invalid or incomplete config
|
|
808
1355
|
if (config === null) {
|
|
809
|
-
throw new Error('Invalid config for "
|
|
1356
|
+
throw new Error('Invalid config for "createGenerations"');
|
|
810
1357
|
}
|
|
811
1358
|
return buildNetworkSnapshot$1(luvio, config);
|
|
812
1359
|
};
|
|
813
1360
|
};
|
|
814
1361
|
|
|
815
|
-
function validate$
|
|
1362
|
+
function validate$6(obj, path = 'WrappedValueMap') {
|
|
816
1363
|
const v_error = (() => {
|
|
817
1364
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
818
1365
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -835,7 +1382,7 @@ function validate$2(obj, path = 'WrappedValueMap') {
|
|
|
835
1382
|
return v_error === undefined ? null : v_error;
|
|
836
1383
|
}
|
|
837
1384
|
|
|
838
|
-
function validate$
|
|
1385
|
+
function validate$5(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresentation') {
|
|
839
1386
|
const v_error = (() => {
|
|
840
1387
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
841
1388
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -843,7 +1390,7 @@ function validate$1(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
|
|
|
843
1390
|
if (obj.additionalConfig !== undefined) {
|
|
844
1391
|
const obj_additionalConfig = obj.additionalConfig;
|
|
845
1392
|
const path_additionalConfig = path + '.additionalConfig';
|
|
846
|
-
const referencepath_additionalConfigValidationError = validate$
|
|
1393
|
+
const referencepath_additionalConfigValidationError = validate$d(obj_additionalConfig, path_additionalConfig);
|
|
847
1394
|
if (referencepath_additionalConfigValidationError !== null) {
|
|
848
1395
|
let message = 'Object doesn\'t match EinsteinLlmAdditionalConfigInputRepresentation (at "' + path_additionalConfig + '")\n';
|
|
849
1396
|
message += referencepath_additionalConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -852,7 +1399,7 @@ function validate$1(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
|
|
|
852
1399
|
}
|
|
853
1400
|
const obj_inputParams = obj.inputParams;
|
|
854
1401
|
const path_inputParams = path + '.inputParams';
|
|
855
|
-
const referencepath_inputParamsValidationError = validate$
|
|
1402
|
+
const referencepath_inputParamsValidationError = validate$6(obj_inputParams, path_inputParams);
|
|
856
1403
|
if (referencepath_inputParamsValidationError !== null) {
|
|
857
1404
|
let message = 'Object doesn\'t match WrappedValueMap (at "' + path_inputParams + '")\n';
|
|
858
1405
|
message += referencepath_inputParamsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -863,6 +1410,13 @@ function validate$1(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
|
|
|
863
1410
|
if (typeof obj_isPreview !== 'boolean') {
|
|
864
1411
|
return new TypeError('Expected "boolean" but received "' + typeof obj_isPreview + '" (at "' + path_isPreview + '")');
|
|
865
1412
|
}
|
|
1413
|
+
if (obj.outputLanguage !== undefined) {
|
|
1414
|
+
const obj_outputLanguage = obj.outputLanguage;
|
|
1415
|
+
const path_outputLanguage = path + '.outputLanguage';
|
|
1416
|
+
if (typeof obj_outputLanguage !== 'string') {
|
|
1417
|
+
return new TypeError('Expected "string" but received "' + typeof obj_outputLanguage + '" (at "' + path_outputLanguage + '")');
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
866
1420
|
if (obj.provider !== undefined) {
|
|
867
1421
|
const obj_provider = obj.provider;
|
|
868
1422
|
const path_provider = path + '.provider';
|
|
@@ -874,13 +1428,348 @@ function validate$1(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresent
|
|
|
874
1428
|
return v_error === undefined ? null : v_error;
|
|
875
1429
|
}
|
|
876
1430
|
|
|
1431
|
+
const VERSION$4 = "6458d624e5a1691821c764b6de0badb3";
|
|
1432
|
+
function validate$4(obj, path = 'EinsteinPromptTemplateGenerationsErrorRepresentation') {
|
|
1433
|
+
const v_error = (() => {
|
|
1434
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1435
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1436
|
+
}
|
|
1437
|
+
const obj_errorMessage = obj.errorMessage;
|
|
1438
|
+
const path_errorMessage = path + '.errorMessage';
|
|
1439
|
+
if (typeof obj_errorMessage !== 'string') {
|
|
1440
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
|
|
1441
|
+
}
|
|
1442
|
+
const obj_httpErrorCode = obj.httpErrorCode;
|
|
1443
|
+
const path_httpErrorCode = path + '.httpErrorCode';
|
|
1444
|
+
if (typeof obj_httpErrorCode !== 'string') {
|
|
1445
|
+
return new TypeError('Expected "string" but received "' + typeof obj_httpErrorCode + '" (at "' + path_httpErrorCode + '")');
|
|
1446
|
+
}
|
|
1447
|
+
if (obj.localizedErrorMessage !== undefined) {
|
|
1448
|
+
const obj_localizedErrorMessage = obj.localizedErrorMessage;
|
|
1449
|
+
const path_localizedErrorMessage = path + '.localizedErrorMessage';
|
|
1450
|
+
if (typeof obj_localizedErrorMessage !== 'string') {
|
|
1451
|
+
return new TypeError('Expected "string" but received "' + typeof obj_localizedErrorMessage + '" (at "' + path_localizedErrorMessage + '")');
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
const obj_messageCode = obj.messageCode;
|
|
1455
|
+
const path_messageCode = path + '.messageCode';
|
|
1456
|
+
if (typeof obj_messageCode !== 'string') {
|
|
1457
|
+
return new TypeError('Expected "string" but received "' + typeof obj_messageCode + '" (at "' + path_messageCode + '")');
|
|
1458
|
+
}
|
|
1459
|
+
})();
|
|
1460
|
+
return v_error === undefined ? null : v_error;
|
|
1461
|
+
}
|
|
1462
|
+
const select$5 = function EinsteinPromptTemplateGenerationsErrorRepresentationSelect() {
|
|
1463
|
+
return {
|
|
1464
|
+
kind: 'Fragment',
|
|
1465
|
+
version: VERSION$4,
|
|
1466
|
+
private: [],
|
|
1467
|
+
selections: [
|
|
1468
|
+
{
|
|
1469
|
+
name: 'errorMessage',
|
|
1470
|
+
kind: 'Scalar'
|
|
1471
|
+
},
|
|
1472
|
+
{
|
|
1473
|
+
name: 'httpErrorCode',
|
|
1474
|
+
kind: 'Scalar'
|
|
1475
|
+
},
|
|
1476
|
+
{
|
|
1477
|
+
name: 'localizedErrorMessage',
|
|
1478
|
+
kind: 'Scalar',
|
|
1479
|
+
required: false
|
|
1480
|
+
},
|
|
1481
|
+
{
|
|
1482
|
+
name: 'messageCode',
|
|
1483
|
+
kind: 'Scalar'
|
|
1484
|
+
}
|
|
1485
|
+
]
|
|
1486
|
+
};
|
|
1487
|
+
};
|
|
1488
|
+
function equals$4(existing, incoming) {
|
|
1489
|
+
const existing_errorMessage = existing.errorMessage;
|
|
1490
|
+
const incoming_errorMessage = incoming.errorMessage;
|
|
1491
|
+
if (!(existing_errorMessage === incoming_errorMessage)) {
|
|
1492
|
+
return false;
|
|
1493
|
+
}
|
|
1494
|
+
const existing_httpErrorCode = existing.httpErrorCode;
|
|
1495
|
+
const incoming_httpErrorCode = incoming.httpErrorCode;
|
|
1496
|
+
if (!(existing_httpErrorCode === incoming_httpErrorCode)) {
|
|
1497
|
+
return false;
|
|
1498
|
+
}
|
|
1499
|
+
const existing_localizedErrorMessage = existing.localizedErrorMessage;
|
|
1500
|
+
const incoming_localizedErrorMessage = incoming.localizedErrorMessage;
|
|
1501
|
+
// if at least one of these optionals is defined
|
|
1502
|
+
if (existing_localizedErrorMessage !== undefined || incoming_localizedErrorMessage !== undefined) {
|
|
1503
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1504
|
+
// not equal
|
|
1505
|
+
if (existing_localizedErrorMessage === undefined || incoming_localizedErrorMessage === undefined) {
|
|
1506
|
+
return false;
|
|
1507
|
+
}
|
|
1508
|
+
if (!(existing_localizedErrorMessage === incoming_localizedErrorMessage)) {
|
|
1509
|
+
return false;
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
const existing_messageCode = existing.messageCode;
|
|
1513
|
+
const incoming_messageCode = incoming.messageCode;
|
|
1514
|
+
if (!(existing_messageCode === incoming_messageCode)) {
|
|
1515
|
+
return false;
|
|
1516
|
+
}
|
|
1517
|
+
return true;
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
const VERSION$3 = "7c417ce44e4bc05dfcc454e6825590e8";
|
|
1521
|
+
function validate$3(obj, path = 'EinsteinPromptTemplateMaskSettingsRepresentation') {
|
|
1522
|
+
const v_error = (() => {
|
|
1523
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1524
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1525
|
+
}
|
|
1526
|
+
const obj_enableModeration = obj.enableModeration;
|
|
1527
|
+
const path_enableModeration = path + '.enableModeration';
|
|
1528
|
+
if (typeof obj_enableModeration !== 'boolean') {
|
|
1529
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_enableModeration + '" (at "' + path_enableModeration + '")');
|
|
1530
|
+
}
|
|
1531
|
+
})();
|
|
1532
|
+
return v_error === undefined ? null : v_error;
|
|
1533
|
+
}
|
|
1534
|
+
const select$4 = function EinsteinPromptTemplateMaskSettingsRepresentationSelect() {
|
|
1535
|
+
return {
|
|
1536
|
+
kind: 'Fragment',
|
|
1537
|
+
version: VERSION$3,
|
|
1538
|
+
private: [],
|
|
1539
|
+
selections: [
|
|
1540
|
+
{
|
|
1541
|
+
name: 'enableModeration',
|
|
1542
|
+
kind: 'Scalar'
|
|
1543
|
+
}
|
|
1544
|
+
]
|
|
1545
|
+
};
|
|
1546
|
+
};
|
|
1547
|
+
function equals$3(existing, incoming) {
|
|
1548
|
+
const existing_enableModeration = existing.enableModeration;
|
|
1549
|
+
const incoming_enableModeration = incoming.enableModeration;
|
|
1550
|
+
if (!(existing_enableModeration === incoming_enableModeration)) {
|
|
1551
|
+
return false;
|
|
1552
|
+
}
|
|
1553
|
+
return true;
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
const VERSION$2 = "92ad1abd0e2a60bc36941409cadda7e2";
|
|
1557
|
+
function validate$2(obj, path = 'EinsteinPromptTemplateMaskContentRepresentation') {
|
|
1558
|
+
const v_error = (() => {
|
|
1559
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1560
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1561
|
+
}
|
|
1562
|
+
const obj_content = obj.content;
|
|
1563
|
+
const path_content = path + '.content';
|
|
1564
|
+
if (typeof obj_content !== 'string') {
|
|
1565
|
+
return new TypeError('Expected "string" but received "' + typeof obj_content + '" (at "' + path_content + '")');
|
|
1566
|
+
}
|
|
1567
|
+
if (obj.moderationSettings !== undefined) {
|
|
1568
|
+
const obj_moderationSettings = obj.moderationSettings;
|
|
1569
|
+
const path_moderationSettings = path + '.moderationSettings';
|
|
1570
|
+
let obj_moderationSettings_union0 = null;
|
|
1571
|
+
const obj_moderationSettings_union0_error = (() => {
|
|
1572
|
+
const referencepath_moderationSettingsValidationError = validate$3(obj_moderationSettings, path_moderationSettings);
|
|
1573
|
+
if (referencepath_moderationSettingsValidationError !== null) {
|
|
1574
|
+
let message = 'Object doesn\'t match EinsteinPromptTemplateMaskSettingsRepresentation (at "' + path_moderationSettings + '")\n';
|
|
1575
|
+
message += referencepath_moderationSettingsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1576
|
+
return new TypeError(message);
|
|
1577
|
+
}
|
|
1578
|
+
})();
|
|
1579
|
+
if (obj_moderationSettings_union0_error != null) {
|
|
1580
|
+
obj_moderationSettings_union0 = obj_moderationSettings_union0_error.message;
|
|
1581
|
+
}
|
|
1582
|
+
let obj_moderationSettings_union1 = null;
|
|
1583
|
+
const obj_moderationSettings_union1_error = (() => {
|
|
1584
|
+
if (obj_moderationSettings !== null) {
|
|
1585
|
+
return new TypeError('Expected "null" but received "' + typeof obj_moderationSettings + '" (at "' + path_moderationSettings + '")');
|
|
1586
|
+
}
|
|
1587
|
+
})();
|
|
1588
|
+
if (obj_moderationSettings_union1_error != null) {
|
|
1589
|
+
obj_moderationSettings_union1 = obj_moderationSettings_union1_error.message;
|
|
1590
|
+
}
|
|
1591
|
+
if (obj_moderationSettings_union0 && obj_moderationSettings_union1) {
|
|
1592
|
+
let message = 'Object doesn\'t match union (at "' + path_moderationSettings + '")';
|
|
1593
|
+
message += '\n' + obj_moderationSettings_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1594
|
+
message += '\n' + obj_moderationSettings_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1595
|
+
return new TypeError(message);
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
if (obj.role !== undefined) {
|
|
1599
|
+
const obj_role = obj.role;
|
|
1600
|
+
const path_role = path + '.role';
|
|
1601
|
+
if (typeof obj_role !== 'string') {
|
|
1602
|
+
return new TypeError('Expected "string" but received "' + typeof obj_role + '" (at "' + path_role + '")');
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
})();
|
|
1606
|
+
return v_error === undefined ? null : v_error;
|
|
1607
|
+
}
|
|
1608
|
+
const select$3 = function EinsteinPromptTemplateMaskContentRepresentationSelect() {
|
|
1609
|
+
const { selections: EinsteinPromptTemplateMaskSettingsRepresentation__selections, opaque: EinsteinPromptTemplateMaskSettingsRepresentation__opaque, } = select$4();
|
|
1610
|
+
return {
|
|
1611
|
+
kind: 'Fragment',
|
|
1612
|
+
version: VERSION$2,
|
|
1613
|
+
private: [],
|
|
1614
|
+
selections: [
|
|
1615
|
+
{
|
|
1616
|
+
name: 'content',
|
|
1617
|
+
kind: 'Scalar'
|
|
1618
|
+
},
|
|
1619
|
+
{
|
|
1620
|
+
name: 'moderationSettings',
|
|
1621
|
+
kind: 'Object',
|
|
1622
|
+
nullable: true,
|
|
1623
|
+
selections: EinsteinPromptTemplateMaskSettingsRepresentation__selections,
|
|
1624
|
+
required: false
|
|
1625
|
+
},
|
|
1626
|
+
{
|
|
1627
|
+
name: 'role',
|
|
1628
|
+
kind: 'Scalar',
|
|
1629
|
+
required: false
|
|
1630
|
+
}
|
|
1631
|
+
]
|
|
1632
|
+
};
|
|
1633
|
+
};
|
|
1634
|
+
function equals$2(existing, incoming) {
|
|
1635
|
+
const existing_content = existing.content;
|
|
1636
|
+
const incoming_content = incoming.content;
|
|
1637
|
+
if (!(existing_content === incoming_content)) {
|
|
1638
|
+
return false;
|
|
1639
|
+
}
|
|
1640
|
+
const existing_role = existing.role;
|
|
1641
|
+
const incoming_role = incoming.role;
|
|
1642
|
+
// if at least one of these optionals is defined
|
|
1643
|
+
if (existing_role !== undefined || incoming_role !== undefined) {
|
|
1644
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1645
|
+
// not equal
|
|
1646
|
+
if (existing_role === undefined || incoming_role === undefined) {
|
|
1647
|
+
return false;
|
|
1648
|
+
}
|
|
1649
|
+
if (!(existing_role === incoming_role)) {
|
|
1650
|
+
return false;
|
|
1651
|
+
}
|
|
1652
|
+
}
|
|
1653
|
+
const existing_moderationSettings = existing.moderationSettings;
|
|
1654
|
+
const incoming_moderationSettings = incoming.moderationSettings;
|
|
1655
|
+
// if at least one of these optionals is defined
|
|
1656
|
+
if (existing_moderationSettings !== undefined || incoming_moderationSettings !== undefined) {
|
|
1657
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1658
|
+
// not equal
|
|
1659
|
+
if (existing_moderationSettings === undefined || incoming_moderationSettings === undefined) {
|
|
1660
|
+
return false;
|
|
1661
|
+
}
|
|
1662
|
+
if (!(existing_moderationSettings === incoming_moderationSettings
|
|
1663
|
+
|| (existing_moderationSettings != null &&
|
|
1664
|
+
incoming_moderationSettings != null &&
|
|
1665
|
+
equals$3(existing_moderationSettings, incoming_moderationSettings)))) {
|
|
1666
|
+
return false;
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
return true;
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
const VERSION$1 = "507a815605f8d30ae9b52b0ec513d25e";
|
|
1673
|
+
function validate$1(obj, path = 'EinsteinPromptTemplateMaskDataRepresentation') {
|
|
1674
|
+
const v_error = (() => {
|
|
1675
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1676
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1677
|
+
}
|
|
1678
|
+
const obj_originalValue = obj.originalValue;
|
|
1679
|
+
const path_originalValue = path + '.originalValue';
|
|
1680
|
+
if (typeof obj_originalValue !== 'string') {
|
|
1681
|
+
return new TypeError('Expected "string" but received "' + typeof obj_originalValue + '" (at "' + path_originalValue + '")');
|
|
1682
|
+
}
|
|
1683
|
+
const obj_placeHolder = obj.placeHolder;
|
|
1684
|
+
const path_placeHolder = path + '.placeHolder';
|
|
1685
|
+
if (typeof obj_placeHolder !== 'string') {
|
|
1686
|
+
return new TypeError('Expected "string" but received "' + typeof obj_placeHolder + '" (at "' + path_placeHolder + '")');
|
|
1687
|
+
}
|
|
1688
|
+
const obj_recognizers = obj.recognizers;
|
|
1689
|
+
const path_recognizers = path + '.recognizers';
|
|
1690
|
+
if (!ArrayIsArray(obj_recognizers)) {
|
|
1691
|
+
return new TypeError('Expected "array" but received "' + typeof obj_recognizers + '" (at "' + path_recognizers + '")');
|
|
1692
|
+
}
|
|
1693
|
+
for (let i = 0; i < obj_recognizers.length; i++) {
|
|
1694
|
+
const obj_recognizers_item = obj_recognizers[i];
|
|
1695
|
+
const path_recognizers_item = path_recognizers + '[' + i + ']';
|
|
1696
|
+
if (typeof obj_recognizers_item !== 'string') {
|
|
1697
|
+
return new TypeError('Expected "string" but received "' + typeof obj_recognizers_item + '" (at "' + path_recognizers_item + '")');
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
})();
|
|
1701
|
+
return v_error === undefined ? null : v_error;
|
|
1702
|
+
}
|
|
1703
|
+
const select$2 = function EinsteinPromptTemplateMaskDataRepresentationSelect() {
|
|
1704
|
+
return {
|
|
1705
|
+
kind: 'Fragment',
|
|
1706
|
+
version: VERSION$1,
|
|
1707
|
+
private: [],
|
|
1708
|
+
selections: [
|
|
1709
|
+
{
|
|
1710
|
+
name: 'originalValue',
|
|
1711
|
+
kind: 'Scalar'
|
|
1712
|
+
},
|
|
1713
|
+
{
|
|
1714
|
+
name: 'placeHolder',
|
|
1715
|
+
kind: 'Scalar'
|
|
1716
|
+
},
|
|
1717
|
+
{
|
|
1718
|
+
name: 'recognizers',
|
|
1719
|
+
kind: 'Scalar',
|
|
1720
|
+
plural: true
|
|
1721
|
+
}
|
|
1722
|
+
]
|
|
1723
|
+
};
|
|
1724
|
+
};
|
|
1725
|
+
function equals$1(existing, incoming) {
|
|
1726
|
+
const existing_originalValue = existing.originalValue;
|
|
1727
|
+
const incoming_originalValue = incoming.originalValue;
|
|
1728
|
+
if (!(existing_originalValue === incoming_originalValue)) {
|
|
1729
|
+
return false;
|
|
1730
|
+
}
|
|
1731
|
+
const existing_placeHolder = existing.placeHolder;
|
|
1732
|
+
const incoming_placeHolder = incoming.placeHolder;
|
|
1733
|
+
if (!(existing_placeHolder === incoming_placeHolder)) {
|
|
1734
|
+
return false;
|
|
1735
|
+
}
|
|
1736
|
+
const existing_recognizers = existing.recognizers;
|
|
1737
|
+
const incoming_recognizers = incoming.recognizers;
|
|
1738
|
+
const equals_recognizers_items = equalsArray(existing_recognizers, incoming_recognizers, (existing_recognizers_item, incoming_recognizers_item) => {
|
|
1739
|
+
if (!(existing_recognizers_item === incoming_recognizers_item)) {
|
|
1740
|
+
return false;
|
|
1741
|
+
}
|
|
1742
|
+
});
|
|
1743
|
+
if (equals_recognizers_items === false) {
|
|
1744
|
+
return false;
|
|
1745
|
+
}
|
|
1746
|
+
return true;
|
|
1747
|
+
}
|
|
1748
|
+
|
|
877
1749
|
const TTL = 100;
|
|
878
|
-
const VERSION = "
|
|
1750
|
+
const VERSION = "af7cfa8bd9d9cdd1923263da1734499c";
|
|
879
1751
|
function validate(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation') {
|
|
880
1752
|
const v_error = (() => {
|
|
881
1753
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
882
1754
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
883
1755
|
}
|
|
1756
|
+
if (obj.generationErrors !== undefined) {
|
|
1757
|
+
const obj_generationErrors = obj.generationErrors;
|
|
1758
|
+
const path_generationErrors = path + '.generationErrors';
|
|
1759
|
+
if (!ArrayIsArray(obj_generationErrors)) {
|
|
1760
|
+
return new TypeError('Expected "array" but received "' + typeof obj_generationErrors + '" (at "' + path_generationErrors + '")');
|
|
1761
|
+
}
|
|
1762
|
+
for (let i = 0; i < obj_generationErrors.length; i++) {
|
|
1763
|
+
const obj_generationErrors_item = obj_generationErrors[i];
|
|
1764
|
+
const path_generationErrors_item = path_generationErrors + '[' + i + ']';
|
|
1765
|
+
const referencepath_generationErrors_itemValidationError = validate$4(obj_generationErrors_item, path_generationErrors_item);
|
|
1766
|
+
if (referencepath_generationErrors_itemValidationError !== null) {
|
|
1767
|
+
let message = 'Object doesn\'t match EinsteinPromptTemplateGenerationsErrorRepresentation (at "' + path_generationErrors_item + '")\n';
|
|
1768
|
+
message += referencepath_generationErrors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1769
|
+
return new TypeError(message);
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
884
1773
|
const obj_generations = obj.generations;
|
|
885
1774
|
const path_generations = path + '.generations';
|
|
886
1775
|
if (!ArrayIsArray(obj_generations)) {
|
|
@@ -889,7 +1778,7 @@ function validate(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation')
|
|
|
889
1778
|
for (let i = 0; i < obj_generations.length; i++) {
|
|
890
1779
|
const obj_generations_item = obj_generations[i];
|
|
891
1780
|
const path_generations_item = path_generations + '[' + i + ']';
|
|
892
|
-
const referencepath_generations_itemValidationError = validate$
|
|
1781
|
+
const referencepath_generations_itemValidationError = validate$9(obj_generations_item, path_generations_item);
|
|
893
1782
|
if (referencepath_generations_itemValidationError !== null) {
|
|
894
1783
|
let message = 'Object doesn\'t match EinsteinLlmGenerationItemRepresentation (at "' + path_generations_item + '")\n';
|
|
895
1784
|
message += referencepath_generations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -900,7 +1789,7 @@ function validate(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation')
|
|
|
900
1789
|
const path_parameters = path + '.parameters';
|
|
901
1790
|
let obj_parameters_union0 = null;
|
|
902
1791
|
const obj_parameters_union0_error = (() => {
|
|
903
|
-
const referencepath_parametersValidationError = validate$
|
|
1792
|
+
const referencepath_parametersValidationError = validate$8(obj_parameters, path_parameters);
|
|
904
1793
|
if (referencepath_parametersValidationError !== null) {
|
|
905
1794
|
let message = 'Object doesn\'t match WrappedMap (at "' + path_parameters + '")\n';
|
|
906
1795
|
message += referencepath_parametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -961,6 +1850,57 @@ function validate(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation')
|
|
|
961
1850
|
if (typeof obj_requestId !== 'string') {
|
|
962
1851
|
return new TypeError('Expected "string" but received "' + typeof obj_requestId + '" (at "' + path_requestId + '")');
|
|
963
1852
|
}
|
|
1853
|
+
if (obj.requestMessages !== undefined) {
|
|
1854
|
+
const obj_requestMessages = obj.requestMessages;
|
|
1855
|
+
const path_requestMessages = path + '.requestMessages';
|
|
1856
|
+
if (!ArrayIsArray(obj_requestMessages)) {
|
|
1857
|
+
return new TypeError('Expected "array" but received "' + typeof obj_requestMessages + '" (at "' + path_requestMessages + '")');
|
|
1858
|
+
}
|
|
1859
|
+
for (let i = 0; i < obj_requestMessages.length; i++) {
|
|
1860
|
+
const obj_requestMessages_item = obj_requestMessages[i];
|
|
1861
|
+
const path_requestMessages_item = path_requestMessages + '[' + i + ']';
|
|
1862
|
+
const referencepath_requestMessages_itemValidationError = validate$2(obj_requestMessages_item, path_requestMessages_item);
|
|
1863
|
+
if (referencepath_requestMessages_itemValidationError !== null) {
|
|
1864
|
+
let message = 'Object doesn\'t match EinsteinPromptTemplateMaskContentRepresentation (at "' + path_requestMessages_item + '")\n';
|
|
1865
|
+
message += referencepath_requestMessages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1866
|
+
return new TypeError(message);
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
if (obj.responseMessages !== undefined) {
|
|
1871
|
+
const obj_responseMessages = obj.responseMessages;
|
|
1872
|
+
const path_responseMessages = path + '.responseMessages';
|
|
1873
|
+
if (!ArrayIsArray(obj_responseMessages)) {
|
|
1874
|
+
return new TypeError('Expected "array" but received "' + typeof obj_responseMessages + '" (at "' + path_responseMessages + '")');
|
|
1875
|
+
}
|
|
1876
|
+
for (let i = 0; i < obj_responseMessages.length; i++) {
|
|
1877
|
+
const obj_responseMessages_item = obj_responseMessages[i];
|
|
1878
|
+
const path_responseMessages_item = path_responseMessages + '[' + i + ']';
|
|
1879
|
+
const referencepath_responseMessages_itemValidationError = validate$2(obj_responseMessages_item, path_responseMessages_item);
|
|
1880
|
+
if (referencepath_responseMessages_itemValidationError !== null) {
|
|
1881
|
+
let message = 'Object doesn\'t match EinsteinPromptTemplateMaskContentRepresentation (at "' + path_responseMessages_item + '")\n';
|
|
1882
|
+
message += referencepath_responseMessages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1883
|
+
return new TypeError(message);
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
if (obj.slotsMaskingInformation !== undefined) {
|
|
1888
|
+
const obj_slotsMaskingInformation = obj.slotsMaskingInformation;
|
|
1889
|
+
const path_slotsMaskingInformation = path + '.slotsMaskingInformation';
|
|
1890
|
+
if (!ArrayIsArray(obj_slotsMaskingInformation)) {
|
|
1891
|
+
return new TypeError('Expected "array" but received "' + typeof obj_slotsMaskingInformation + '" (at "' + path_slotsMaskingInformation + '")');
|
|
1892
|
+
}
|
|
1893
|
+
for (let i = 0; i < obj_slotsMaskingInformation.length; i++) {
|
|
1894
|
+
const obj_slotsMaskingInformation_item = obj_slotsMaskingInformation[i];
|
|
1895
|
+
const path_slotsMaskingInformation_item = path_slotsMaskingInformation + '[' + i + ']';
|
|
1896
|
+
const referencepath_slotsMaskingInformation_itemValidationError = validate$1(obj_slotsMaskingInformation_item, path_slotsMaskingInformation_item);
|
|
1897
|
+
if (referencepath_slotsMaskingInformation_itemValidationError !== null) {
|
|
1898
|
+
let message = 'Object doesn\'t match EinsteinPromptTemplateMaskDataRepresentation (at "' + path_slotsMaskingInformation_item + '")\n';
|
|
1899
|
+
message += referencepath_slotsMaskingInformation_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1900
|
+
return new TypeError(message);
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
964
1904
|
})();
|
|
965
1905
|
return v_error === undefined ? null : v_error;
|
|
966
1906
|
}
|
|
@@ -978,13 +1918,23 @@ function normalize(input, existing, path, luvio, store, timestamp) {
|
|
|
978
1918
|
return input;
|
|
979
1919
|
}
|
|
980
1920
|
const select$1 = function EinsteinPromptTemplateGenerationsRepresentationSelect() {
|
|
981
|
-
const { selections:
|
|
982
|
-
const { selections:
|
|
1921
|
+
const { selections: EinsteinPromptTemplateGenerationsErrorRepresentation__selections, opaque: EinsteinPromptTemplateGenerationsErrorRepresentation__opaque, } = select$5();
|
|
1922
|
+
const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$9();
|
|
1923
|
+
const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$8();
|
|
1924
|
+
const { selections: EinsteinPromptTemplateMaskContentRepresentation__selections, opaque: EinsteinPromptTemplateMaskContentRepresentation__opaque, } = select$3();
|
|
1925
|
+
const { selections: EinsteinPromptTemplateMaskDataRepresentation__selections, opaque: EinsteinPromptTemplateMaskDataRepresentation__opaque, } = select$2();
|
|
983
1926
|
return {
|
|
984
1927
|
kind: 'Fragment',
|
|
985
1928
|
version: VERSION,
|
|
986
1929
|
private: [],
|
|
987
1930
|
selections: [
|
|
1931
|
+
{
|
|
1932
|
+
name: 'generationErrors',
|
|
1933
|
+
kind: 'Object',
|
|
1934
|
+
plural: true,
|
|
1935
|
+
selections: EinsteinPromptTemplateGenerationsErrorRepresentation__selections,
|
|
1936
|
+
required: false
|
|
1937
|
+
},
|
|
988
1938
|
{
|
|
989
1939
|
name: 'generations',
|
|
990
1940
|
kind: 'Object',
|
|
@@ -1008,6 +1958,27 @@ const select$1 = function EinsteinPromptTemplateGenerationsRepresentationSelect(
|
|
|
1008
1958
|
{
|
|
1009
1959
|
name: 'requestId',
|
|
1010
1960
|
kind: 'Scalar'
|
|
1961
|
+
},
|
|
1962
|
+
{
|
|
1963
|
+
name: 'requestMessages',
|
|
1964
|
+
kind: 'Object',
|
|
1965
|
+
plural: true,
|
|
1966
|
+
selections: EinsteinPromptTemplateMaskContentRepresentation__selections,
|
|
1967
|
+
required: false
|
|
1968
|
+
},
|
|
1969
|
+
{
|
|
1970
|
+
name: 'responseMessages',
|
|
1971
|
+
kind: 'Object',
|
|
1972
|
+
plural: true,
|
|
1973
|
+
selections: EinsteinPromptTemplateMaskContentRepresentation__selections,
|
|
1974
|
+
required: false
|
|
1975
|
+
},
|
|
1976
|
+
{
|
|
1977
|
+
name: 'slotsMaskingInformation',
|
|
1978
|
+
kind: 'Object',
|
|
1979
|
+
plural: true,
|
|
1980
|
+
selections: EinsteinPromptTemplateMaskDataRepresentation__selections,
|
|
1981
|
+
required: false
|
|
1011
1982
|
}
|
|
1012
1983
|
]
|
|
1013
1984
|
};
|
|
@@ -1023,10 +1994,28 @@ function equals(existing, incoming) {
|
|
|
1023
1994
|
if (!(existing_requestId === incoming_requestId)) {
|
|
1024
1995
|
return false;
|
|
1025
1996
|
}
|
|
1997
|
+
const existing_generationErrors = existing.generationErrors;
|
|
1998
|
+
const incoming_generationErrors = incoming.generationErrors;
|
|
1999
|
+
// if at least one of these optionals is defined
|
|
2000
|
+
if (existing_generationErrors !== undefined || incoming_generationErrors !== undefined) {
|
|
2001
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2002
|
+
// not equal
|
|
2003
|
+
if (existing_generationErrors === undefined || incoming_generationErrors === undefined) {
|
|
2004
|
+
return false;
|
|
2005
|
+
}
|
|
2006
|
+
const equals_generationErrors_items = equalsArray(existing_generationErrors, incoming_generationErrors, (existing_generationErrors_item, incoming_generationErrors_item) => {
|
|
2007
|
+
if (!(equals$4(existing_generationErrors_item, incoming_generationErrors_item))) {
|
|
2008
|
+
return false;
|
|
2009
|
+
}
|
|
2010
|
+
});
|
|
2011
|
+
if (equals_generationErrors_items === false) {
|
|
2012
|
+
return false;
|
|
2013
|
+
}
|
|
2014
|
+
}
|
|
1026
2015
|
const existing_generations = existing.generations;
|
|
1027
2016
|
const incoming_generations = incoming.generations;
|
|
1028
2017
|
const equals_generations_items = equalsArray(existing_generations, incoming_generations, (existing_generations_item, incoming_generations_item) => {
|
|
1029
|
-
if (!(equals$
|
|
2018
|
+
if (!(equals$7(existing_generations_item, incoming_generations_item))) {
|
|
1030
2019
|
return false;
|
|
1031
2020
|
}
|
|
1032
2021
|
});
|
|
@@ -1038,7 +2027,7 @@ function equals(existing, incoming) {
|
|
|
1038
2027
|
if (!(existing_parameters === incoming_parameters
|
|
1039
2028
|
|| (existing_parameters != null &&
|
|
1040
2029
|
incoming_parameters != null &&
|
|
1041
|
-
equals$
|
|
2030
|
+
equals$6(existing_parameters, incoming_parameters)))) {
|
|
1042
2031
|
return false;
|
|
1043
2032
|
}
|
|
1044
2033
|
const existing_prompt = existing.prompt;
|
|
@@ -1046,6 +2035,60 @@ function equals(existing, incoming) {
|
|
|
1046
2035
|
if (!(existing_prompt === incoming_prompt)) {
|
|
1047
2036
|
return false;
|
|
1048
2037
|
}
|
|
2038
|
+
const existing_requestMessages = existing.requestMessages;
|
|
2039
|
+
const incoming_requestMessages = incoming.requestMessages;
|
|
2040
|
+
// if at least one of these optionals is defined
|
|
2041
|
+
if (existing_requestMessages !== undefined || incoming_requestMessages !== undefined) {
|
|
2042
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2043
|
+
// not equal
|
|
2044
|
+
if (existing_requestMessages === undefined || incoming_requestMessages === undefined) {
|
|
2045
|
+
return false;
|
|
2046
|
+
}
|
|
2047
|
+
const equals_requestMessages_items = equalsArray(existing_requestMessages, incoming_requestMessages, (existing_requestMessages_item, incoming_requestMessages_item) => {
|
|
2048
|
+
if (!(equals$2(existing_requestMessages_item, incoming_requestMessages_item))) {
|
|
2049
|
+
return false;
|
|
2050
|
+
}
|
|
2051
|
+
});
|
|
2052
|
+
if (equals_requestMessages_items === false) {
|
|
2053
|
+
return false;
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
const existing_responseMessages = existing.responseMessages;
|
|
2057
|
+
const incoming_responseMessages = incoming.responseMessages;
|
|
2058
|
+
// if at least one of these optionals is defined
|
|
2059
|
+
if (existing_responseMessages !== undefined || incoming_responseMessages !== undefined) {
|
|
2060
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2061
|
+
// not equal
|
|
2062
|
+
if (existing_responseMessages === undefined || incoming_responseMessages === undefined) {
|
|
2063
|
+
return false;
|
|
2064
|
+
}
|
|
2065
|
+
const equals_responseMessages_items = equalsArray(existing_responseMessages, incoming_responseMessages, (existing_responseMessages_item, incoming_responseMessages_item) => {
|
|
2066
|
+
if (!(equals$2(existing_responseMessages_item, incoming_responseMessages_item))) {
|
|
2067
|
+
return false;
|
|
2068
|
+
}
|
|
2069
|
+
});
|
|
2070
|
+
if (equals_responseMessages_items === false) {
|
|
2071
|
+
return false;
|
|
2072
|
+
}
|
|
2073
|
+
}
|
|
2074
|
+
const existing_slotsMaskingInformation = existing.slotsMaskingInformation;
|
|
2075
|
+
const incoming_slotsMaskingInformation = incoming.slotsMaskingInformation;
|
|
2076
|
+
// if at least one of these optionals is defined
|
|
2077
|
+
if (existing_slotsMaskingInformation !== undefined || incoming_slotsMaskingInformation !== undefined) {
|
|
2078
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2079
|
+
// not equal
|
|
2080
|
+
if (existing_slotsMaskingInformation === undefined || incoming_slotsMaskingInformation === undefined) {
|
|
2081
|
+
return false;
|
|
2082
|
+
}
|
|
2083
|
+
const equals_slotsMaskingInformation_items = equalsArray(existing_slotsMaskingInformation, incoming_slotsMaskingInformation, (existing_slotsMaskingInformation_item, incoming_slotsMaskingInformation_item) => {
|
|
2084
|
+
if (!(equals$1(existing_slotsMaskingInformation_item, incoming_slotsMaskingInformation_item))) {
|
|
2085
|
+
return false;
|
|
2086
|
+
}
|
|
2087
|
+
});
|
|
2088
|
+
if (equals_slotsMaskingInformation_items === false) {
|
|
2089
|
+
return false;
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
1049
2092
|
return true;
|
|
1050
2093
|
}
|
|
1051
2094
|
const ingest = function EinsteinPromptTemplateGenerationsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
@@ -1119,7 +2162,7 @@ function typeCheckConfig(untrustedConfig) {
|
|
|
1119
2162
|
const config = {};
|
|
1120
2163
|
typeCheckConfig$3(untrustedConfig, config, createGenerationsForPromptTemplate_ConfigPropertyMetadata);
|
|
1121
2164
|
const untrustedConfig_promptTemplateGenerationsInput = untrustedConfig.promptTemplateGenerationsInput;
|
|
1122
|
-
const referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError = validate$
|
|
2165
|
+
const referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError = validate$5(untrustedConfig_promptTemplateGenerationsInput);
|
|
1123
2166
|
if (referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError === null) {
|
|
1124
2167
|
config.promptTemplateGenerationsInput = untrustedConfig_promptTemplateGenerationsInput;
|
|
1125
2168
|
}
|