@salesforce/lds-adapters-service-einsteinllm 1.204.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/service-einsteinllm.js +981 -0
  3. package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +60 -0
  4. package/dist/es/es2018/types/src/generated/adapters/createGenerateMessages.d.ts +15 -0
  5. package/dist/es/es2018/types/src/generated/adapters/createGenerateMessagesForPromptTemplate.d.ts +16 -0
  6. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +2 -0
  7. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +3 -0
  8. package/dist/es/es2018/types/src/generated/resources/postEinsteinLlmPromptGenerations.d.ts +13 -0
  9. package/dist/es/es2018/types/src/generated/resources/postEinsteinPromptTemplatesGenerationsByPromptTemplateDevName.d.ts +16 -0
  10. package/dist/es/es2018/types/src/generated/types/EinsteinLlmAdditionalConfigInputRepresentation.d.ts +59 -0
  11. package/dist/es/es2018/types/src/generated/types/EinsteinLlmGenerationItemRepresentation.d.ts +31 -0
  12. package/dist/es/es2018/types/src/generated/types/EinsteinLlmGenerationsInputRepresentation.d.ts +35 -0
  13. package/dist/es/es2018/types/src/generated/types/EinsteinLlmGenerationsInputWrapperRepresentation.d.ts +28 -0
  14. package/dist/es/es2018/types/src/generated/types/EinsteinLlmGenerationsRepresentation.d.ts +49 -0
  15. package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateGenerationsInputRepresentation.d.ts +39 -0
  16. package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateGenerationsInputWrapperRepresentation.d.ts +28 -0
  17. package/dist/es/es2018/types/src/generated/types/EinsteinPromptTemplateGenerationsRepresentation.d.ts +52 -0
  18. package/dist/es/es2018/types/src/generated/types/WrappedListString.d.ts +28 -0
  19. package/dist/es/es2018/types/src/generated/types/WrappedMap.d.ts +32 -0
  20. package/dist/es/es2018/types/src/generated/types/WrappedValue.d.ts +28 -0
  21. package/dist/es/es2018/types/src/generated/types/WrappedValueMap.d.ts +32 -0
  22. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
  23. package/package.json +68 -0
  24. package/sfdc/index.d.ts +1 -0
  25. package/sfdc/index.js +1011 -0
  26. package/src/raml/api.raml +275 -0
  27. package/src/raml/luvio.raml +27 -0
@@ -0,0 +1,981 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ import { serializeStructuredKey, deepFreeze, StoreKeyMap } from '@luvio/engine';
8
+
9
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
+ const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
11
+ const { isArray: ArrayIsArray$1 } = Array;
12
+ /**
13
+ * Validates an adapter config is well-formed.
14
+ * @param config The config to validate.
15
+ * @param adapter The adapter validation configuration.
16
+ * @param oneOf The keys the config must contain at least one of.
17
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
18
+ */
19
+ function validateConfig(config, adapter, oneOf) {
20
+ const { displayName } = adapter;
21
+ const { required, optional, unsupported } = adapter.parameters;
22
+ if (config === undefined ||
23
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
24
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
25
+ }
26
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
27
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
28
+ }
29
+ if (unsupported !== undefined &&
30
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
31
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
32
+ }
33
+ const supported = required.concat(optional);
34
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
35
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
36
+ }
37
+ }
38
+ function untrustedIsObject(untrusted) {
39
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
40
+ }
41
+ function areRequiredParametersPresent(config, configPropertyNames) {
42
+ return configPropertyNames.parameters.required.every(req => req in config);
43
+ }
44
+ const keyPrefix = 'EinsteinLLM';
45
+
46
+ const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
47
+ const { isArray: ArrayIsArray } = Array;
48
+ function equalsArray(a, b, equalsItem) {
49
+ const aLength = a.length;
50
+ const bLength = b.length;
51
+ if (aLength !== bLength) {
52
+ return false;
53
+ }
54
+ for (let i = 0; i < aLength; i++) {
55
+ if (equalsItem(a[i], b[i]) === false) {
56
+ return false;
57
+ }
58
+ }
59
+ return true;
60
+ }
61
+ function equalsObject(a, b, equalsProp) {
62
+ const aKeys = ObjectKeys(a).sort();
63
+ const bKeys = ObjectKeys(b).sort();
64
+ const aKeysLength = aKeys.length;
65
+ const bKeysLength = bKeys.length;
66
+ if (aKeysLength !== bKeysLength) {
67
+ return false;
68
+ }
69
+ for (let i = 0; i < aKeys.length; i++) {
70
+ const key = aKeys[i];
71
+ if (key !== bKeys[i]) {
72
+ return false;
73
+ }
74
+ if (equalsProp(a[key], b[key]) === false) {
75
+ return false;
76
+ }
77
+ }
78
+ return true;
79
+ }
80
+ function createLink(ref) {
81
+ return {
82
+ __ref: serializeStructuredKey(ref),
83
+ };
84
+ }
85
+
86
+ function validate$7(obj, path = 'EinsteinLlmAdditionalConfigInputRepresentation') {
87
+ const v_error = (() => {
88
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
89
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
90
+ }
91
+ if (obj.additionalParameters !== undefined) {
92
+ const obj_additionalParameters = obj.additionalParameters;
93
+ const path_additionalParameters = path + '.additionalParameters';
94
+ if (typeof obj_additionalParameters !== 'object' || ArrayIsArray(obj_additionalParameters) || obj_additionalParameters === null) {
95
+ return new TypeError('Expected "object" but received "' + typeof obj_additionalParameters + '" (at "' + path_additionalParameters + '")');
96
+ }
97
+ const obj_additionalParameters_keys = ObjectKeys(obj_additionalParameters);
98
+ for (let i = 0; i < obj_additionalParameters_keys.length; i++) {
99
+ const key = obj_additionalParameters_keys[i];
100
+ const obj_additionalParameters_prop = obj_additionalParameters[key];
101
+ const path_additionalParameters_prop = path_additionalParameters + '["' + key + '"]';
102
+ if (typeof obj_additionalParameters_prop !== 'object' || ArrayIsArray(obj_additionalParameters_prop) || obj_additionalParameters_prop === null) {
103
+ return new TypeError('Expected "object" but received "' + typeof obj_additionalParameters_prop + '" (at "' + path_additionalParameters_prop + '")');
104
+ }
105
+ }
106
+ }
107
+ if (obj.applicationName !== undefined) {
108
+ const obj_applicationName = obj.applicationName;
109
+ const path_applicationName = path + '.applicationName';
110
+ if (typeof obj_applicationName !== 'string') {
111
+ return new TypeError('Expected "string" but received "' + typeof obj_applicationName + '" (at "' + path_applicationName + '")');
112
+ }
113
+ }
114
+ if (obj.enablePiiMasking !== undefined) {
115
+ const obj_enablePiiMasking = obj.enablePiiMasking;
116
+ const path_enablePiiMasking = path + '.enablePiiMasking';
117
+ if (typeof obj_enablePiiMasking !== 'boolean') {
118
+ return new TypeError('Expected "boolean" but received "' + typeof obj_enablePiiMasking + '" (at "' + path_enablePiiMasking + '")');
119
+ }
120
+ }
121
+ if (obj.frequencyPenalty !== undefined) {
122
+ obj.frequencyPenalty;
123
+ }
124
+ if (obj.maxTokens !== undefined) {
125
+ const obj_maxTokens = obj.maxTokens;
126
+ const path_maxTokens = path + '.maxTokens';
127
+ if (typeof obj_maxTokens !== 'number' || (typeof obj_maxTokens === 'number' && Math.floor(obj_maxTokens) !== obj_maxTokens)) {
128
+ return new TypeError('Expected "integer" but received "' + typeof obj_maxTokens + '" (at "' + path_maxTokens + '")');
129
+ }
130
+ }
131
+ if (obj.model !== undefined) {
132
+ const obj_model = obj.model;
133
+ const path_model = path + '.model';
134
+ if (typeof obj_model !== 'string') {
135
+ return new TypeError('Expected "string" but received "' + typeof obj_model + '" (at "' + path_model + '")');
136
+ }
137
+ }
138
+ if (obj.numGenerations !== undefined) {
139
+ const obj_numGenerations = obj.numGenerations;
140
+ const path_numGenerations = path + '.numGenerations';
141
+ if (typeof obj_numGenerations !== 'number' || (typeof obj_numGenerations === 'number' && Math.floor(obj_numGenerations) !== obj_numGenerations)) {
142
+ return new TypeError('Expected "integer" but received "' + typeof obj_numGenerations + '" (at "' + path_numGenerations + '")');
143
+ }
144
+ }
145
+ if (obj.presencePenalty !== undefined) {
146
+ obj.presencePenalty;
147
+ }
148
+ if (obj.stopSequences !== undefined) {
149
+ const obj_stopSequences = obj.stopSequences;
150
+ const path_stopSequences = path + '.stopSequences';
151
+ if (!ArrayIsArray(obj_stopSequences)) {
152
+ return new TypeError('Expected "array" but received "' + typeof obj_stopSequences + '" (at "' + path_stopSequences + '")');
153
+ }
154
+ for (let i = 0; i < obj_stopSequences.length; i++) {
155
+ const obj_stopSequences_item = obj_stopSequences[i];
156
+ const path_stopSequences_item = path_stopSequences + '[' + i + ']';
157
+ if (typeof obj_stopSequences_item !== 'string') {
158
+ return new TypeError('Expected "string" but received "' + typeof obj_stopSequences_item + '" (at "' + path_stopSequences_item + '")');
159
+ }
160
+ }
161
+ }
162
+ if (obj.temperature !== undefined) {
163
+ obj.temperature;
164
+ }
165
+ })();
166
+ return v_error === undefined ? null : v_error;
167
+ }
168
+
169
+ function validate$6(obj, path = 'EinsteinLlmGenerationsInputRepresentation') {
170
+ const v_error = (() => {
171
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
172
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
173
+ }
174
+ if (obj.additionalConfig !== undefined) {
175
+ const obj_additionalConfig = obj.additionalConfig;
176
+ const path_additionalConfig = path + '.additionalConfig';
177
+ const referencepath_additionalConfigValidationError = validate$7(obj_additionalConfig, path_additionalConfig);
178
+ if (referencepath_additionalConfigValidationError !== null) {
179
+ let message = 'Object doesn\'t match EinsteinLlmAdditionalConfigInputRepresentation (at "' + path_additionalConfig + '")\n';
180
+ message += referencepath_additionalConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
181
+ return new TypeError(message);
182
+ }
183
+ }
184
+ const obj_promptTextorId = obj.promptTextorId;
185
+ const path_promptTextorId = path + '.promptTextorId';
186
+ if (typeof obj_promptTextorId !== 'string') {
187
+ return new TypeError('Expected "string" but received "' + typeof obj_promptTextorId + '" (at "' + path_promptTextorId + '")');
188
+ }
189
+ if (obj.provider !== undefined) {
190
+ const obj_provider = obj.provider;
191
+ const path_provider = path + '.provider';
192
+ if (typeof obj_provider !== 'string') {
193
+ return new TypeError('Expected "string" but received "' + typeof obj_provider + '" (at "' + path_provider + '")');
194
+ }
195
+ }
196
+ })();
197
+ return v_error === undefined ? null : v_error;
198
+ }
199
+
200
+ const VERSION$3 = "e87ca68f9dcf9550fb4dc9fd91df91ae";
201
+ function validate$5(obj, path = 'EinsteinLlmGenerationItemRepresentation') {
202
+ const v_error = (() => {
203
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
204
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
205
+ }
206
+ const obj_parameters = obj.parameters;
207
+ const path_parameters = path + '.parameters';
208
+ if (typeof obj_parameters !== 'string') {
209
+ return new TypeError('Expected "string" but received "' + typeof obj_parameters + '" (at "' + path_parameters + '")');
210
+ }
211
+ const obj_text = obj.text;
212
+ const path_text = path + '.text';
213
+ if (typeof obj_text !== 'string') {
214
+ return new TypeError('Expected "string" but received "' + typeof obj_text + '" (at "' + path_text + '")');
215
+ }
216
+ })();
217
+ return v_error === undefined ? null : v_error;
218
+ }
219
+ const select$5 = function EinsteinLlmGenerationItemRepresentationSelect() {
220
+ return {
221
+ kind: 'Fragment',
222
+ version: VERSION$3,
223
+ private: [],
224
+ selections: [
225
+ {
226
+ name: 'parameters',
227
+ kind: 'Scalar'
228
+ },
229
+ {
230
+ name: 'text',
231
+ kind: 'Scalar'
232
+ }
233
+ ]
234
+ };
235
+ };
236
+ function equals$3(existing, incoming) {
237
+ const existing_parameters = existing.parameters;
238
+ const incoming_parameters = incoming.parameters;
239
+ if (!(existing_parameters === incoming_parameters)) {
240
+ return false;
241
+ }
242
+ const existing_text = existing.text;
243
+ const incoming_text = incoming.text;
244
+ if (!(existing_text === incoming_text)) {
245
+ return false;
246
+ }
247
+ return true;
248
+ }
249
+
250
+ const VERSION$2 = "4656c961c9d093a9e206c1db7d4de0b0";
251
+ function validate$4(obj, path = 'WrappedMap') {
252
+ const v_error = (() => {
253
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
254
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
255
+ }
256
+ const obj_wrappedMap = obj.wrappedMap;
257
+ const path_wrappedMap = path + '.wrappedMap';
258
+ if (typeof obj_wrappedMap !== 'object' || ArrayIsArray(obj_wrappedMap) || obj_wrappedMap === null) {
259
+ return new TypeError('Expected "object" but received "' + typeof obj_wrappedMap + '" (at "' + path_wrappedMap + '")');
260
+ }
261
+ const obj_wrappedMap_keys = ObjectKeys(obj_wrappedMap);
262
+ for (let i = 0; i < obj_wrappedMap_keys.length; i++) {
263
+ const key = obj_wrappedMap_keys[i];
264
+ const obj_wrappedMap_prop = obj_wrappedMap[key];
265
+ const path_wrappedMap_prop = path_wrappedMap + '["' + key + '"]';
266
+ if (typeof obj_wrappedMap_prop !== 'object' || ArrayIsArray(obj_wrappedMap_prop) || obj_wrappedMap_prop === null) {
267
+ return new TypeError('Expected "object" but received "' + typeof obj_wrappedMap_prop + '" (at "' + path_wrappedMap_prop + '")');
268
+ }
269
+ }
270
+ })();
271
+ return v_error === undefined ? null : v_error;
272
+ }
273
+ const select$4 = function WrappedMapSelect() {
274
+ return {
275
+ kind: 'Fragment',
276
+ version: VERSION$2,
277
+ private: [],
278
+ selections: []
279
+ };
280
+ };
281
+ function equals$2(existing, incoming) {
282
+ const existing_wrappedMap = existing.wrappedMap;
283
+ const incoming_wrappedMap = incoming.wrappedMap;
284
+ const equals_wrappedMap_props = equalsObject(existing_wrappedMap, incoming_wrappedMap, (existing_wrappedMap_prop, incoming_wrappedMap_prop) => {
285
+ });
286
+ if (equals_wrappedMap_props === false) {
287
+ return false;
288
+ }
289
+ return true;
290
+ }
291
+
292
+ const TTL$1 = 100;
293
+ const VERSION$1 = "d8abd72a42e842b253da1c38954dafbc";
294
+ function validate$3(obj, path = 'EinsteinLlmGenerationsRepresentation') {
295
+ const v_error = (() => {
296
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
297
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
298
+ }
299
+ const obj_generations = obj.generations;
300
+ const path_generations = path + '.generations';
301
+ if (!ArrayIsArray(obj_generations)) {
302
+ return new TypeError('Expected "array" but received "' + typeof obj_generations + '" (at "' + path_generations + '")');
303
+ }
304
+ for (let i = 0; i < obj_generations.length; i++) {
305
+ const obj_generations_item = obj_generations[i];
306
+ const path_generations_item = path_generations + '[' + i + ']';
307
+ const referencepath_generations_itemValidationError = validate$5(obj_generations_item, path_generations_item);
308
+ if (referencepath_generations_itemValidationError !== null) {
309
+ let message = 'Object doesn\'t match EinsteinLlmGenerationItemRepresentation (at "' + path_generations_item + '")\n';
310
+ message += referencepath_generations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
311
+ return new TypeError(message);
312
+ }
313
+ }
314
+ const obj_parameters = obj.parameters;
315
+ const path_parameters = path + '.parameters';
316
+ let obj_parameters_union0 = null;
317
+ const obj_parameters_union0_error = (() => {
318
+ const referencepath_parametersValidationError = validate$4(obj_parameters, path_parameters);
319
+ if (referencepath_parametersValidationError !== null) {
320
+ let message = 'Object doesn\'t match WrappedMap (at "' + path_parameters + '")\n';
321
+ message += referencepath_parametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
322
+ return new TypeError(message);
323
+ }
324
+ })();
325
+ if (obj_parameters_union0_error != null) {
326
+ obj_parameters_union0 = obj_parameters_union0_error.message;
327
+ }
328
+ let obj_parameters_union1 = null;
329
+ const obj_parameters_union1_error = (() => {
330
+ if (obj_parameters !== null) {
331
+ return new TypeError('Expected "null" but received "' + typeof obj_parameters + '" (at "' + path_parameters + '")');
332
+ }
333
+ })();
334
+ if (obj_parameters_union1_error != null) {
335
+ obj_parameters_union1 = obj_parameters_union1_error.message;
336
+ }
337
+ if (obj_parameters_union0 && obj_parameters_union1) {
338
+ let message = 'Object doesn\'t match union (at "' + path_parameters + '")';
339
+ message += '\n' + obj_parameters_union0.split('\n').map((line) => '\t' + line).join('\n');
340
+ message += '\n' + obj_parameters_union1.split('\n').map((line) => '\t' + line).join('\n');
341
+ return new TypeError(message);
342
+ }
343
+ const obj_prompt = obj.prompt;
344
+ const path_prompt = path + '.prompt';
345
+ let obj_prompt_union0 = null;
346
+ const obj_prompt_union0_error = (() => {
347
+ if (typeof obj_prompt !== 'string') {
348
+ return new TypeError('Expected "string" but received "' + typeof obj_prompt + '" (at "' + path_prompt + '")');
349
+ }
350
+ })();
351
+ if (obj_prompt_union0_error != null) {
352
+ obj_prompt_union0 = obj_prompt_union0_error.message;
353
+ }
354
+ let obj_prompt_union1 = null;
355
+ const obj_prompt_union1_error = (() => {
356
+ if (obj_prompt !== null) {
357
+ return new TypeError('Expected "null" but received "' + typeof obj_prompt + '" (at "' + path_prompt + '")');
358
+ }
359
+ })();
360
+ if (obj_prompt_union1_error != null) {
361
+ obj_prompt_union1 = obj_prompt_union1_error.message;
362
+ }
363
+ if (obj_prompt_union0 && obj_prompt_union1) {
364
+ let message = 'Object doesn\'t match union (at "' + path_prompt + '")';
365
+ message += '\n' + obj_prompt_union0.split('\n').map((line) => '\t' + line).join('\n');
366
+ message += '\n' + obj_prompt_union1.split('\n').map((line) => '\t' + line).join('\n');
367
+ return new TypeError(message);
368
+ }
369
+ const obj_requestId = obj.requestId;
370
+ const path_requestId = path + '.requestId';
371
+ if (typeof obj_requestId !== 'string') {
372
+ return new TypeError('Expected "string" but received "' + typeof obj_requestId + '" (at "' + path_requestId + '")');
373
+ }
374
+ })();
375
+ return v_error === undefined ? null : v_error;
376
+ }
377
+ const RepresentationType$1 = 'EinsteinLlmGenerationsRepresentation';
378
+ function keyBuilder$1(luvio, config) {
379
+ return keyPrefix + '::' + RepresentationType$1 + ':' + config.requestId;
380
+ }
381
+ function keyBuilderFromType$1(luvio, object) {
382
+ const keyParams = {
383
+ requestId: object.requestId
384
+ };
385
+ return keyBuilder$1(luvio, keyParams);
386
+ }
387
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
388
+ return input;
389
+ }
390
+ const select$3 = function EinsteinLlmGenerationsRepresentationSelect() {
391
+ const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$5();
392
+ const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$4();
393
+ return {
394
+ kind: 'Fragment',
395
+ version: VERSION$1,
396
+ private: [],
397
+ selections: [
398
+ {
399
+ name: 'generations',
400
+ kind: 'Object',
401
+ plural: true,
402
+ selections: EinsteinLlmGenerationItemRepresentation__selections
403
+ },
404
+ {
405
+ name: 'parameters',
406
+ kind: 'Object',
407
+ nullable: true,
408
+ selections: WrappedMap__selections
409
+ },
410
+ {
411
+ name: 'prompt',
412
+ kind: 'Scalar'
413
+ },
414
+ {
415
+ name: 'requestId',
416
+ kind: 'Scalar'
417
+ }
418
+ ]
419
+ };
420
+ };
421
+ function equals$1(existing, incoming) {
422
+ const existing_requestId = existing.requestId;
423
+ const incoming_requestId = incoming.requestId;
424
+ if (!(existing_requestId === incoming_requestId)) {
425
+ return false;
426
+ }
427
+ const existing_generations = existing.generations;
428
+ const incoming_generations = incoming.generations;
429
+ const equals_generations_items = equalsArray(existing_generations, incoming_generations, (existing_generations_item, incoming_generations_item) => {
430
+ if (!(equals$3(existing_generations_item, incoming_generations_item))) {
431
+ return false;
432
+ }
433
+ });
434
+ if (equals_generations_items === false) {
435
+ return false;
436
+ }
437
+ const existing_parameters = existing.parameters;
438
+ const incoming_parameters = incoming.parameters;
439
+ if (!(existing_parameters === incoming_parameters
440
+ || (existing_parameters != null &&
441
+ incoming_parameters != null &&
442
+ equals$2(existing_parameters, incoming_parameters)))) {
443
+ return false;
444
+ }
445
+ const existing_prompt = existing.prompt;
446
+ const incoming_prompt = incoming.prompt;
447
+ if (!(existing_prompt === incoming_prompt)) {
448
+ return false;
449
+ }
450
+ return true;
451
+ }
452
+ const ingest$1 = function EinsteinLlmGenerationsRepresentationIngest(input, path, luvio, store, timestamp) {
453
+ if (process.env.NODE_ENV !== 'production') {
454
+ const validateError = validate$3(input);
455
+ if (validateError !== null) {
456
+ throw validateError;
457
+ }
458
+ }
459
+ const key = keyBuilderFromType$1(luvio, input);
460
+ const existingRecord = store.readEntry(key);
461
+ const ttlToUse = TTL$1;
462
+ let incomingRecord = normalize$1(input, store.readEntry(key), {
463
+ fullPath: key,
464
+ parent: path.parent,
465
+ propertyName: path.propertyName,
466
+ ttl: ttlToUse
467
+ });
468
+ if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
469
+ luvio.storePublish(key, incomingRecord);
470
+ }
471
+ {
472
+ const storeMetadataParams = {
473
+ ttl: ttlToUse,
474
+ namespace: "EinsteinLLM",
475
+ version: VERSION$1,
476
+ representationName: RepresentationType$1,
477
+ };
478
+ luvio.publishStoreMetadata(key, storeMetadataParams);
479
+ }
480
+ return createLink(key);
481
+ };
482
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
483
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
484
+ const rootKey = keyBuilderFromType$1(luvio, input);
485
+ rootKeySet.set(rootKey, {
486
+ namespace: keyPrefix,
487
+ representationName: RepresentationType$1,
488
+ mergeable: false
489
+ });
490
+ }
491
+
492
+ function select$2(luvio, params) {
493
+ return select$3();
494
+ }
495
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
496
+ getTypeCacheKeys$1(storeKeyMap, luvio, response);
497
+ }
498
+ function ingestSuccess$1(luvio, resourceParams, response) {
499
+ const { body } = response;
500
+ const key = keyBuilderFromType$1(luvio, body);
501
+ luvio.storeIngest(key, ingest$1, body);
502
+ const snapshot = luvio.storeLookup({
503
+ recordId: key,
504
+ node: select$2(),
505
+ variables: {},
506
+ });
507
+ if (process.env.NODE_ENV !== 'production') {
508
+ if (snapshot.state !== 'Fulfilled') {
509
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
510
+ }
511
+ }
512
+ deepFreeze(snapshot.data);
513
+ return snapshot;
514
+ }
515
+ function createResourceRequest$1(config) {
516
+ const headers = {};
517
+ return {
518
+ baseUri: '/services/data/v59.0',
519
+ basePath: '/einstein/llm/prompt/generations',
520
+ method: 'post',
521
+ body: config.body,
522
+ urlParams: {},
523
+ queryParams: {},
524
+ headers,
525
+ priority: 'normal',
526
+ };
527
+ }
528
+
529
+ const createGenerateMessages_ConfigPropertyNames = {
530
+ displayName: 'createGenerateMessages',
531
+ parameters: {
532
+ required: ['generationsInput'],
533
+ optional: []
534
+ }
535
+ };
536
+ function createResourceParams$1(config) {
537
+ const resourceParams = {
538
+ body: {
539
+ generationsInput: config.generationsInput
540
+ }
541
+ };
542
+ return resourceParams;
543
+ }
544
+ function typeCheckConfig$1(untrustedConfig) {
545
+ const config = {};
546
+ const untrustedConfig_generationsInput = untrustedConfig.generationsInput;
547
+ const referenceEinsteinLlmGenerationsInputRepresentationValidationError = validate$6(untrustedConfig_generationsInput);
548
+ if (referenceEinsteinLlmGenerationsInputRepresentationValidationError === null) {
549
+ config.generationsInput = untrustedConfig_generationsInput;
550
+ }
551
+ return config;
552
+ }
553
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
554
+ if (!untrustedIsObject(untrustedConfig)) {
555
+ return null;
556
+ }
557
+ if (process.env.NODE_ENV !== 'production') {
558
+ validateConfig(untrustedConfig, configPropertyNames);
559
+ }
560
+ const config = typeCheckConfig$1(untrustedConfig);
561
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
562
+ return null;
563
+ }
564
+ return config;
565
+ }
566
+ function buildNetworkSnapshot$1(luvio, config, options) {
567
+ const resourceParams = createResourceParams$1(config);
568
+ const request = createResourceRequest$1(resourceParams);
569
+ return luvio.dispatchResourceRequest(request, options)
570
+ .then((response) => {
571
+ return luvio.handleSuccessResponse(() => {
572
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response);
573
+ return luvio.storeBroadcast().then(() => snapshot);
574
+ }, () => {
575
+ const cache = new StoreKeyMap();
576
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
577
+ return cache;
578
+ });
579
+ }, (response) => {
580
+ deepFreeze(response);
581
+ throw response;
582
+ });
583
+ }
584
+ const createGenerateMessagesAdapterFactory = (luvio) => {
585
+ return function createGenerateMessages(untrustedConfig) {
586
+ const config = validateAdapterConfig$1(untrustedConfig, createGenerateMessages_ConfigPropertyNames);
587
+ // Invalid or incomplete config
588
+ if (config === null) {
589
+ throw new Error('Invalid config for "createGenerateMessages"');
590
+ }
591
+ return buildNetworkSnapshot$1(luvio, config);
592
+ };
593
+ };
594
+
595
+ function validate$2(obj, path = 'WrappedValueMap') {
596
+ const v_error = (() => {
597
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
598
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
599
+ }
600
+ const obj_valueMap = obj.valueMap;
601
+ const path_valueMap = path + '.valueMap';
602
+ if (typeof obj_valueMap !== 'object' || ArrayIsArray(obj_valueMap) || obj_valueMap === null) {
603
+ return new TypeError('Expected "object" but received "' + typeof obj_valueMap + '" (at "' + path_valueMap + '")');
604
+ }
605
+ const obj_valueMap_keys = ObjectKeys(obj_valueMap);
606
+ for (let i = 0; i < obj_valueMap_keys.length; i++) {
607
+ const key = obj_valueMap_keys[i];
608
+ const obj_valueMap_prop = obj_valueMap[key];
609
+ const path_valueMap_prop = path_valueMap + '["' + key + '"]';
610
+ if (typeof obj_valueMap_prop !== 'object' || ArrayIsArray(obj_valueMap_prop) || obj_valueMap_prop === null) {
611
+ return new TypeError('Expected "object" but received "' + typeof obj_valueMap_prop + '" (at "' + path_valueMap_prop + '")');
612
+ }
613
+ }
614
+ })();
615
+ return v_error === undefined ? null : v_error;
616
+ }
617
+
618
+ function validate$1(obj, path = 'EinsteinPromptTemplateGenerationsInputRepresentation') {
619
+ const v_error = (() => {
620
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
621
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
622
+ }
623
+ if (obj.additionalConfig !== undefined) {
624
+ const obj_additionalConfig = obj.additionalConfig;
625
+ const path_additionalConfig = path + '.additionalConfig';
626
+ const referencepath_additionalConfigValidationError = validate$7(obj_additionalConfig, path_additionalConfig);
627
+ if (referencepath_additionalConfigValidationError !== null) {
628
+ let message = 'Object doesn\'t match EinsteinLlmAdditionalConfigInputRepresentation (at "' + path_additionalConfig + '")\n';
629
+ message += referencepath_additionalConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
630
+ return new TypeError(message);
631
+ }
632
+ }
633
+ const obj_inputParams = obj.inputParams;
634
+ const path_inputParams = path + '.inputParams';
635
+ const referencepath_inputParamsValidationError = validate$2(obj_inputParams, path_inputParams);
636
+ if (referencepath_inputParamsValidationError !== null) {
637
+ let message = 'Object doesn\'t match WrappedValueMap (at "' + path_inputParams + '")\n';
638
+ message += referencepath_inputParamsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
639
+ return new TypeError(message);
640
+ }
641
+ const obj_isPreview = obj.isPreview;
642
+ const path_isPreview = path + '.isPreview';
643
+ if (typeof obj_isPreview !== 'boolean') {
644
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isPreview + '" (at "' + path_isPreview + '")');
645
+ }
646
+ if (obj.provider !== undefined) {
647
+ const obj_provider = obj.provider;
648
+ const path_provider = path + '.provider';
649
+ if (typeof obj_provider !== 'string') {
650
+ return new TypeError('Expected "string" but received "' + typeof obj_provider + '" (at "' + path_provider + '")');
651
+ }
652
+ }
653
+ })();
654
+ return v_error === undefined ? null : v_error;
655
+ }
656
+
657
+ const TTL = 100;
658
+ const VERSION = "72c96c11855d430a55c0a79c239c0838";
659
+ function validate(obj, path = 'EinsteinPromptTemplateGenerationsRepresentation') {
660
+ const v_error = (() => {
661
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
662
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
663
+ }
664
+ const obj_generations = obj.generations;
665
+ const path_generations = path + '.generations';
666
+ if (!ArrayIsArray(obj_generations)) {
667
+ return new TypeError('Expected "array" but received "' + typeof obj_generations + '" (at "' + path_generations + '")');
668
+ }
669
+ for (let i = 0; i < obj_generations.length; i++) {
670
+ const obj_generations_item = obj_generations[i];
671
+ const path_generations_item = path_generations + '[' + i + ']';
672
+ const referencepath_generations_itemValidationError = validate$5(obj_generations_item, path_generations_item);
673
+ if (referencepath_generations_itemValidationError !== null) {
674
+ let message = 'Object doesn\'t match EinsteinLlmGenerationItemRepresentation (at "' + path_generations_item + '")\n';
675
+ message += referencepath_generations_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
676
+ return new TypeError(message);
677
+ }
678
+ }
679
+ const obj_parameters = obj.parameters;
680
+ const path_parameters = path + '.parameters';
681
+ let obj_parameters_union0 = null;
682
+ const obj_parameters_union0_error = (() => {
683
+ const referencepath_parametersValidationError = validate$4(obj_parameters, path_parameters);
684
+ if (referencepath_parametersValidationError !== null) {
685
+ let message = 'Object doesn\'t match WrappedMap (at "' + path_parameters + '")\n';
686
+ message += referencepath_parametersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
687
+ return new TypeError(message);
688
+ }
689
+ })();
690
+ if (obj_parameters_union0_error != null) {
691
+ obj_parameters_union0 = obj_parameters_union0_error.message;
692
+ }
693
+ let obj_parameters_union1 = null;
694
+ const obj_parameters_union1_error = (() => {
695
+ if (obj_parameters !== null) {
696
+ return new TypeError('Expected "null" but received "' + typeof obj_parameters + '" (at "' + path_parameters + '")');
697
+ }
698
+ })();
699
+ if (obj_parameters_union1_error != null) {
700
+ obj_parameters_union1 = obj_parameters_union1_error.message;
701
+ }
702
+ if (obj_parameters_union0 && obj_parameters_union1) {
703
+ let message = 'Object doesn\'t match union (at "' + path_parameters + '")';
704
+ message += '\n' + obj_parameters_union0.split('\n').map((line) => '\t' + line).join('\n');
705
+ message += '\n' + obj_parameters_union1.split('\n').map((line) => '\t' + line).join('\n');
706
+ return new TypeError(message);
707
+ }
708
+ const obj_prompt = obj.prompt;
709
+ const path_prompt = path + '.prompt';
710
+ let obj_prompt_union0 = null;
711
+ const obj_prompt_union0_error = (() => {
712
+ if (typeof obj_prompt !== 'string') {
713
+ return new TypeError('Expected "string" but received "' + typeof obj_prompt + '" (at "' + path_prompt + '")');
714
+ }
715
+ })();
716
+ if (obj_prompt_union0_error != null) {
717
+ obj_prompt_union0 = obj_prompt_union0_error.message;
718
+ }
719
+ let obj_prompt_union1 = null;
720
+ const obj_prompt_union1_error = (() => {
721
+ if (obj_prompt !== null) {
722
+ return new TypeError('Expected "null" but received "' + typeof obj_prompt + '" (at "' + path_prompt + '")');
723
+ }
724
+ })();
725
+ if (obj_prompt_union1_error != null) {
726
+ obj_prompt_union1 = obj_prompt_union1_error.message;
727
+ }
728
+ if (obj_prompt_union0 && obj_prompt_union1) {
729
+ let message = 'Object doesn\'t match union (at "' + path_prompt + '")';
730
+ message += '\n' + obj_prompt_union0.split('\n').map((line) => '\t' + line).join('\n');
731
+ message += '\n' + obj_prompt_union1.split('\n').map((line) => '\t' + line).join('\n');
732
+ return new TypeError(message);
733
+ }
734
+ const obj_promptTemplateDevName = obj.promptTemplateDevName;
735
+ const path_promptTemplateDevName = path + '.promptTemplateDevName';
736
+ if (typeof obj_promptTemplateDevName !== 'string') {
737
+ return new TypeError('Expected "string" but received "' + typeof obj_promptTemplateDevName + '" (at "' + path_promptTemplateDevName + '")');
738
+ }
739
+ const obj_requestId = obj.requestId;
740
+ const path_requestId = path + '.requestId';
741
+ if (typeof obj_requestId !== 'string') {
742
+ return new TypeError('Expected "string" but received "' + typeof obj_requestId + '" (at "' + path_requestId + '")');
743
+ }
744
+ })();
745
+ return v_error === undefined ? null : v_error;
746
+ }
747
+ const RepresentationType = 'EinsteinPromptTemplateGenerationsRepresentation';
748
+ function keyBuilder(luvio, config) {
749
+ return keyPrefix + '::' + RepresentationType + ':' + config.requestId;
750
+ }
751
+ function keyBuilderFromType(luvio, object) {
752
+ const keyParams = {
753
+ requestId: object.requestId
754
+ };
755
+ return keyBuilder(luvio, keyParams);
756
+ }
757
+ function normalize(input, existing, path, luvio, store, timestamp) {
758
+ return input;
759
+ }
760
+ const select$1 = function EinsteinPromptTemplateGenerationsRepresentationSelect() {
761
+ const { selections: EinsteinLlmGenerationItemRepresentation__selections, opaque: EinsteinLlmGenerationItemRepresentation__opaque, } = select$5();
762
+ const { selections: WrappedMap__selections, opaque: WrappedMap__opaque, } = select$4();
763
+ return {
764
+ kind: 'Fragment',
765
+ version: VERSION,
766
+ private: [],
767
+ selections: [
768
+ {
769
+ name: 'generations',
770
+ kind: 'Object',
771
+ plural: true,
772
+ selections: EinsteinLlmGenerationItemRepresentation__selections
773
+ },
774
+ {
775
+ name: 'parameters',
776
+ kind: 'Object',
777
+ nullable: true,
778
+ selections: WrappedMap__selections
779
+ },
780
+ {
781
+ name: 'prompt',
782
+ kind: 'Scalar'
783
+ },
784
+ {
785
+ name: 'promptTemplateDevName',
786
+ kind: 'Scalar'
787
+ },
788
+ {
789
+ name: 'requestId',
790
+ kind: 'Scalar'
791
+ }
792
+ ]
793
+ };
794
+ };
795
+ function equals(existing, incoming) {
796
+ const existing_promptTemplateDevName = existing.promptTemplateDevName;
797
+ const incoming_promptTemplateDevName = incoming.promptTemplateDevName;
798
+ if (!(existing_promptTemplateDevName === incoming_promptTemplateDevName)) {
799
+ return false;
800
+ }
801
+ const existing_requestId = existing.requestId;
802
+ const incoming_requestId = incoming.requestId;
803
+ if (!(existing_requestId === incoming_requestId)) {
804
+ return false;
805
+ }
806
+ const existing_generations = existing.generations;
807
+ const incoming_generations = incoming.generations;
808
+ const equals_generations_items = equalsArray(existing_generations, incoming_generations, (existing_generations_item, incoming_generations_item) => {
809
+ if (!(equals$3(existing_generations_item, incoming_generations_item))) {
810
+ return false;
811
+ }
812
+ });
813
+ if (equals_generations_items === false) {
814
+ return false;
815
+ }
816
+ const existing_parameters = existing.parameters;
817
+ const incoming_parameters = incoming.parameters;
818
+ if (!(existing_parameters === incoming_parameters
819
+ || (existing_parameters != null &&
820
+ incoming_parameters != null &&
821
+ equals$2(existing_parameters, incoming_parameters)))) {
822
+ return false;
823
+ }
824
+ const existing_prompt = existing.prompt;
825
+ const incoming_prompt = incoming.prompt;
826
+ if (!(existing_prompt === incoming_prompt)) {
827
+ return false;
828
+ }
829
+ return true;
830
+ }
831
+ const ingest = function EinsteinPromptTemplateGenerationsRepresentationIngest(input, path, luvio, store, timestamp) {
832
+ if (process.env.NODE_ENV !== 'production') {
833
+ const validateError = validate(input);
834
+ if (validateError !== null) {
835
+ throw validateError;
836
+ }
837
+ }
838
+ const key = keyBuilderFromType(luvio, input);
839
+ const existingRecord = store.readEntry(key);
840
+ const ttlToUse = TTL;
841
+ let incomingRecord = normalize(input, store.readEntry(key), {
842
+ fullPath: key,
843
+ parent: path.parent,
844
+ propertyName: path.propertyName,
845
+ ttl: ttlToUse
846
+ });
847
+ if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
848
+ luvio.storePublish(key, incomingRecord);
849
+ }
850
+ {
851
+ const storeMetadataParams = {
852
+ ttl: ttlToUse,
853
+ namespace: "EinsteinLLM",
854
+ version: VERSION,
855
+ representationName: RepresentationType,
856
+ };
857
+ luvio.publishStoreMetadata(key, storeMetadataParams);
858
+ }
859
+ return createLink(key);
860
+ };
861
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
862
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
863
+ const rootKey = keyBuilderFromType(luvio, input);
864
+ rootKeySet.set(rootKey, {
865
+ namespace: keyPrefix,
866
+ representationName: RepresentationType,
867
+ mergeable: false
868
+ });
869
+ }
870
+
871
+ function select(luvio, params) {
872
+ return select$1();
873
+ }
874
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
875
+ getTypeCacheKeys(storeKeyMap, luvio, response);
876
+ }
877
+ function ingestSuccess(luvio, resourceParams, response) {
878
+ const { body } = response;
879
+ const key = keyBuilderFromType(luvio, body);
880
+ luvio.storeIngest(key, ingest, body);
881
+ const snapshot = luvio.storeLookup({
882
+ recordId: key,
883
+ node: select(),
884
+ variables: {},
885
+ });
886
+ if (process.env.NODE_ENV !== 'production') {
887
+ if (snapshot.state !== 'Fulfilled') {
888
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
889
+ }
890
+ }
891
+ deepFreeze(snapshot.data);
892
+ return snapshot;
893
+ }
894
+ function createResourceRequest(config) {
895
+ const headers = {};
896
+ return {
897
+ baseUri: '/services/data/v59.0',
898
+ basePath: '/einstein/prompt-templates/' + config.urlParams.promptTemplateDevName + '/generations',
899
+ method: 'post',
900
+ body: config.body,
901
+ urlParams: config.urlParams,
902
+ queryParams: {},
903
+ headers,
904
+ priority: 'normal',
905
+ };
906
+ }
907
+
908
+ const createGenerateMessagesForPromptTemplate_ConfigPropertyNames = {
909
+ displayName: 'createGenerateMessagesForPromptTemplate',
910
+ parameters: {
911
+ required: ['promptTemplateDevName', 'promptTemplateGenerationsInput'],
912
+ optional: []
913
+ }
914
+ };
915
+ function createResourceParams(config) {
916
+ const resourceParams = {
917
+ urlParams: {
918
+ promptTemplateDevName: config.promptTemplateDevName
919
+ },
920
+ body: {
921
+ promptTemplateGenerationsInput: config.promptTemplateGenerationsInput
922
+ }
923
+ };
924
+ return resourceParams;
925
+ }
926
+ function typeCheckConfig(untrustedConfig) {
927
+ const config = {};
928
+ const untrustedConfig_promptTemplateDevName = untrustedConfig.promptTemplateDevName;
929
+ if (typeof untrustedConfig_promptTemplateDevName === 'string') {
930
+ config.promptTemplateDevName = untrustedConfig_promptTemplateDevName;
931
+ }
932
+ const untrustedConfig_promptTemplateGenerationsInput = untrustedConfig.promptTemplateGenerationsInput;
933
+ const referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError = validate$1(untrustedConfig_promptTemplateGenerationsInput);
934
+ if (referenceEinsteinPromptTemplateGenerationsInputRepresentationValidationError === null) {
935
+ config.promptTemplateGenerationsInput = untrustedConfig_promptTemplateGenerationsInput;
936
+ }
937
+ return config;
938
+ }
939
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
940
+ if (!untrustedIsObject(untrustedConfig)) {
941
+ return null;
942
+ }
943
+ if (process.env.NODE_ENV !== 'production') {
944
+ validateConfig(untrustedConfig, configPropertyNames);
945
+ }
946
+ const config = typeCheckConfig(untrustedConfig);
947
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
948
+ return null;
949
+ }
950
+ return config;
951
+ }
952
+ function buildNetworkSnapshot(luvio, config, options) {
953
+ const resourceParams = createResourceParams(config);
954
+ const request = createResourceRequest(resourceParams);
955
+ return luvio.dispatchResourceRequest(request, options)
956
+ .then((response) => {
957
+ return luvio.handleSuccessResponse(() => {
958
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
959
+ return luvio.storeBroadcast().then(() => snapshot);
960
+ }, () => {
961
+ const cache = new StoreKeyMap();
962
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
963
+ return cache;
964
+ });
965
+ }, (response) => {
966
+ deepFreeze(response);
967
+ throw response;
968
+ });
969
+ }
970
+ const createGenerateMessagesForPromptTemplateAdapterFactory = (luvio) => {
971
+ return function createGenerateMessagesForPromptTemplate(untrustedConfig) {
972
+ const config = validateAdapterConfig(untrustedConfig, createGenerateMessagesForPromptTemplate_ConfigPropertyNames);
973
+ // Invalid or incomplete config
974
+ if (config === null) {
975
+ throw new Error('Invalid config for "createGenerateMessagesForPromptTemplate"');
976
+ }
977
+ return buildNetworkSnapshot(luvio, config);
978
+ };
979
+ };
980
+
981
+ export { createGenerateMessagesAdapterFactory, createGenerateMessagesForPromptTemplateAdapterFactory };