@salesforce/lds-adapters-sfap-einstein-ai-gateway 1.256.0 → 1.258.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.
@@ -7,8 +7,8 @@
7
7
  import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckConfig as typeCheckConfig$2, StoreKeyMap, createResourceParams as createResourceParams$2 } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
- const { keys: ObjectKeys, create: ObjectCreate } = Object;
11
- const { stringify: JSONStringify } = JSON;
10
+ const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
11
+ const { stringify: JSONStringify$1 } = JSON;
12
12
  const { isArray: ArrayIsArray$1 } = Array;
13
13
  /**
14
14
  * Validates an adapter config is well-formed.
@@ -32,7 +32,7 @@ function validateConfig(config, adapter, oneOf) {
32
32
  throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
33
33
  }
34
34
  const supported = required.concat(optional);
35
- if (ObjectKeys(config).some(key => !supported.includes(key))) {
35
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
36
36
  throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
37
37
  }
38
38
  }
@@ -72,7 +72,7 @@ function stableJSONStringify(node) {
72
72
  return isFinite(node) ? '' + node : 'null';
73
73
  }
74
74
  if (typeof node !== 'object') {
75
- return JSONStringify(node);
75
+ return JSONStringify$1(node);
76
76
  }
77
77
  let i;
78
78
  let out;
@@ -89,7 +89,7 @@ function stableJSONStringify(node) {
89
89
  if (node === null) {
90
90
  return 'null';
91
91
  }
92
- const keys = ObjectKeys(node).sort();
92
+ const keys = ObjectKeys$1(node).sort();
93
93
  out = '';
94
94
  for (i = 0; i < keys.length; i++) {
95
95
  const key = keys[i];
@@ -100,7 +100,7 @@ function stableJSONStringify(node) {
100
100
  if (out) {
101
101
  out += ',';
102
102
  }
103
- out += JSONStringify(key) + ':' + value;
103
+ out += JSONStringify$1(key) + ':' + value;
104
104
  }
105
105
  return '{' + out + '}';
106
106
  }
@@ -127,7 +127,9 @@ function buildAdapterValidationConfig(displayName, paramsMeta) {
127
127
  }
128
128
  const keyPrefix = 'einstein-ai-gateway';
129
129
 
130
+ const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
130
131
  const { isArray: ArrayIsArray } = Array;
132
+ const { stringify: JSONStringify } = JSON;
131
133
  function equalsArray(a, b, equalsItem) {
132
134
  const aLength = a.length;
133
135
  const bLength = b.length;
@@ -141,6 +143,25 @@ function equalsArray(a, b, equalsItem) {
141
143
  }
142
144
  return true;
143
145
  }
146
+ function equalsObject(a, b, equalsProp) {
147
+ const aKeys = ObjectKeys(a).sort();
148
+ const bKeys = ObjectKeys(b).sort();
149
+ const aKeysLength = aKeys.length;
150
+ const bKeysLength = bKeys.length;
151
+ if (aKeysLength !== bKeysLength) {
152
+ return false;
153
+ }
154
+ for (let i = 0; i < aKeys.length; i++) {
155
+ const key = aKeys[i];
156
+ if (key !== bKeys[i]) {
157
+ return false;
158
+ }
159
+ if (equalsProp(a[key], b[key]) === false) {
160
+ return false;
161
+ }
162
+ }
163
+ return true;
164
+ }
144
165
  function createLink(ref) {
145
166
  return {
146
167
  __ref: serializeStructuredKey(ref),
@@ -421,7 +442,7 @@ function equals$3(existing, incoming) {
421
442
  return true;
422
443
  }
423
444
 
424
- const VERSION$2 = "d8d7906c67f7e6b5d9e80f599c4cb47f";
445
+ const VERSION$2 = "c02333b512cb7d327983d4719e829b60";
425
446
  function validate$2(obj, path = 'GenerationResponseGenerations') {
426
447
  const v_error = (() => {
427
448
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -450,6 +471,15 @@ function validate$2(obj, path = 'GenerationResponseGenerations') {
450
471
  if (typeof obj_parameters !== 'object' || ArrayIsArray(obj_parameters) || obj_parameters === null) {
451
472
  return new TypeError('Expected "object" but received "' + typeof obj_parameters + '" (at "' + path_parameters + '")');
452
473
  }
474
+ const obj_parameters_keys = ObjectKeys(obj_parameters);
475
+ for (let i = 0; i < obj_parameters_keys.length; i++) {
476
+ const key = obj_parameters_keys[i];
477
+ const obj_parameters_prop = obj_parameters[key];
478
+ const path_parameters_prop = path_parameters + '["' + key + '"]';
479
+ if (obj_parameters_prop === undefined) {
480
+ return new TypeError('Expected "defined" but received "' + typeof obj_parameters_prop + '" (at "' + path_parameters_prop + '")');
481
+ }
482
+ }
453
483
  }
454
484
  const obj_text = obj.text;
455
485
  const path_text = path + '.text';
@@ -477,6 +507,11 @@ const select$4 = function GenerationResponseGenerationsSelect() {
477
507
  kind: 'Scalar',
478
508
  required: false
479
509
  },
510
+ {
511
+ name: 'parameters',
512
+ kind: 'Object',
513
+ // any
514
+ },
480
515
  {
481
516
  name: 'text',
482
517
  kind: 'Scalar'
@@ -525,11 +560,19 @@ function equals$2(existing, incoming) {
525
560
  if (existing_parameters === undefined || incoming_parameters === undefined) {
526
561
  return false;
527
562
  }
563
+ const equals_parameters_props = equalsObject(existing_parameters, incoming_parameters, (existing_parameters_prop, incoming_parameters_prop) => {
564
+ if (JSONStringify(incoming_parameters_prop) !== JSONStringify(existing_parameters_prop)) {
565
+ return false;
566
+ }
567
+ });
568
+ if (equals_parameters_props === false) {
569
+ return false;
570
+ }
528
571
  }
529
572
  return true;
530
573
  }
531
574
 
532
- const VERSION$1 = "31470ce89388a2c22a9c6a5a8a898945";
575
+ const VERSION$1 = "4f085d3ce8f948d5a3d38e9e24ce4f63";
533
576
  function validate$1(obj, path = 'GenerationResponse') {
534
577
  const v_error = (() => {
535
578
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -561,6 +604,15 @@ function validate$1(obj, path = 'GenerationResponse') {
561
604
  if (typeof obj_parameters !== 'object' || ArrayIsArray(obj_parameters) || obj_parameters === null) {
562
605
  return new TypeError('Expected "object" but received "' + typeof obj_parameters + '" (at "' + path_parameters + '")');
563
606
  }
607
+ const obj_parameters_keys = ObjectKeys(obj_parameters);
608
+ for (let i = 0; i < obj_parameters_keys.length; i++) {
609
+ const key = obj_parameters_keys[i];
610
+ const obj_parameters_prop = obj_parameters[key];
611
+ const path_parameters_prop = path_parameters + '["' + key + '"]';
612
+ if (obj_parameters_prop === undefined) {
613
+ return new TypeError('Expected "defined" but received "' + typeof obj_parameters_prop + '" (at "' + path_parameters_prop + '")');
614
+ }
615
+ }
564
616
  }
565
617
  if (obj.prompt !== undefined) {
566
618
  const obj_prompt = obj.prompt;
@@ -614,6 +666,11 @@ const select$3 = function GenerationResponseSelect() {
614
666
  name: 'id',
615
667
  kind: 'Scalar'
616
668
  },
669
+ {
670
+ name: 'parameters',
671
+ kind: 'Object',
672
+ // any
673
+ },
617
674
  {
618
675
  name: 'prompt',
619
676
  kind: 'Scalar',
@@ -647,6 +704,14 @@ function equals$1(existing, incoming) {
647
704
  if (existing_parameters === undefined || incoming_parameters === undefined) {
648
705
  return false;
649
706
  }
707
+ const equals_parameters_props = equalsObject(existing_parameters, incoming_parameters, (existing_parameters_prop, incoming_parameters_prop) => {
708
+ if (JSONStringify(incoming_parameters_prop) !== JSONStringify(existing_parameters_prop)) {
709
+ return false;
710
+ }
711
+ });
712
+ if (equals_parameters_props === false) {
713
+ return false;
714
+ }
650
715
  }
651
716
  const existing_prompt = existing.prompt;
652
717
  const incoming_prompt = incoming.prompt;
@@ -761,6 +826,14 @@ function typeCheckConfig$1(untrustedConfig) {
761
826
  const untrustedConfig_parameters = untrustedConfig.parameters;
762
827
  if (untrustedIsObject(untrustedConfig_parameters)) {
763
828
  const untrustedConfig_parameters_object = {};
829
+ const untrustedConfig_parameters_keys = Object.keys(untrustedConfig_parameters);
830
+ for (let i = 0, arrayLength = untrustedConfig_parameters_keys.length; i < arrayLength; i++) {
831
+ const key = untrustedConfig_parameters_keys[i];
832
+ const untrustedConfig_parameters_prop = untrustedConfig_parameters[key];
833
+ if (untrustedConfig_parameters_object !== undefined) {
834
+ untrustedConfig_parameters_object[key] = untrustedConfig_parameters_prop;
835
+ }
836
+ }
764
837
  if (untrustedConfig_parameters_object !== undefined && Object.keys(untrustedConfig_parameters_object).length >= 0) {
765
838
  config.parameters = untrustedConfig_parameters_object;
766
839
  }
@@ -768,6 +841,14 @@ function typeCheckConfig$1(untrustedConfig) {
768
841
  const untrustedConfig_tags = untrustedConfig.tags;
769
842
  if (untrustedIsObject(untrustedConfig_tags)) {
770
843
  const untrustedConfig_tags_object = {};
844
+ const untrustedConfig_tags_keys = Object.keys(untrustedConfig_tags);
845
+ for (let i = 0, arrayLength = untrustedConfig_tags_keys.length; i < arrayLength; i++) {
846
+ const key = untrustedConfig_tags_keys[i];
847
+ const untrustedConfig_tags_prop = untrustedConfig_tags[key];
848
+ if (untrustedConfig_tags_object !== undefined) {
849
+ untrustedConfig_tags_object[key] = untrustedConfig_tags_prop;
850
+ }
851
+ }
771
852
  if (untrustedConfig_tags_object !== undefined && Object.keys(untrustedConfig_tags_object).length >= 0) {
772
853
  config.tags = untrustedConfig_tags_object;
773
854
  }
@@ -972,6 +1053,14 @@ function typeCheckConfig(untrustedConfig) {
972
1053
  const untrustedConfig_app_feedback = untrustedConfig.app_feedback;
973
1054
  if (untrustedIsObject(untrustedConfig_app_feedback)) {
974
1055
  const untrustedConfig_app_feedback_object = {};
1056
+ const untrustedConfig_app_feedback_keys = Object.keys(untrustedConfig_app_feedback);
1057
+ for (let i = 0, arrayLength = untrustedConfig_app_feedback_keys.length; i < arrayLength; i++) {
1058
+ const key = untrustedConfig_app_feedback_keys[i];
1059
+ const untrustedConfig_app_feedback_prop = untrustedConfig_app_feedback[key];
1060
+ if (untrustedConfig_app_feedback_object !== undefined) {
1061
+ untrustedConfig_app_feedback_object[key] = untrustedConfig_app_feedback_prop;
1062
+ }
1063
+ }
975
1064
  if (untrustedConfig_app_feedback_object !== undefined && Object.keys(untrustedConfig_app_feedback_object).length >= 0) {
976
1065
  config.app_feedback = untrustedConfig_app_feedback_object;
977
1066
  }
@@ -17,8 +17,12 @@ export interface GetGenerationsConfig {
17
17
  frequency_penalty?: number;
18
18
  presence_penalty?: number;
19
19
  model?: string;
20
- parameters?: {};
21
- tags?: {};
20
+ parameters?: {
21
+ [key: string]: unknown;
22
+ };
23
+ tags?: {
24
+ [key: string]: unknown;
25
+ };
22
26
  }
23
27
  export declare const createResourceParams: (config: GetGenerationsConfig) => resources_postAiGptV1Generations_ResourceRequestConfig;
24
28
  export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, config: GetGenerationsConfig): string;
@@ -12,7 +12,9 @@ export interface RegisterFeedbackConfig {
12
12
  feedback?: string;
13
13
  feedback_text?: string;
14
14
  source?: string;
15
- app_feedback?: {};
15
+ app_feedback?: {
16
+ [key: string]: unknown;
17
+ };
16
18
  }
17
19
  export declare const createResourceParams: (config: RegisterFeedbackConfig) => resources_postAiGptV1Feedback_ResourceRequestConfig;
18
20
  export declare function typeCheckConfig(untrustedConfig: adapter$45$utils_Untrusted<RegisterFeedbackConfig>): adapter$45$utils_Untrusted<RegisterFeedbackConfig>;
@@ -7,7 +7,9 @@ export interface ResourceRequestConfig {
7
7
  feedback?: string;
8
8
  feedback_text?: string;
9
9
  source?: string;
10
- app_feedback?: {};
10
+ app_feedback?: {
11
+ [key: string]: unknown;
12
+ };
11
13
  };
12
14
  headers: {
13
15
  xClientFeatureId: string;
@@ -11,8 +11,12 @@ export interface ResourceRequestConfig {
11
11
  frequency_penalty?: number;
12
12
  presence_penalty?: number;
13
13
  model?: string;
14
- parameters?: {};
15
- tags?: {};
14
+ parameters?: {
15
+ [key: string]: unknown;
16
+ };
17
+ tags?: {
18
+ [key: string]: unknown;
19
+ };
16
20
  };
17
21
  headers: {
18
22
  xClientFeatureId: string;
@@ -1,5 +1,5 @@
1
1
  import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
2
- export declare const VERSION = "04473de7ea74376ef14bfcda3cf6bb44";
2
+ export declare const VERSION = "2b1264cadecb909e3b5c2755ed465fcd";
3
3
  export declare function validate(obj: any, path?: string): TypeError | null;
4
4
  export declare const RepresentationType: string;
5
5
  export declare function normalize(input: FeedbackRequest, existing: FeedbackRequestNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): FeedbackRequestNormalized;
@@ -15,7 +15,9 @@ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableSto
15
15
  */
16
16
  export interface FeedbackRequestNormalized {
17
17
  /** Dictionary of any app-level feedback and any other free-form parameters. */
18
- app_feedback?: {};
18
+ app_feedback?: {
19
+ [key: string]: unknown;
20
+ };
19
21
  /** The feedback sentiment. Can be `null`. */
20
22
  feedback?: string;
21
23
  /** The textual representation of the feedback as provided by the user. */
@@ -34,7 +36,9 @@ export interface FeedbackRequestNormalized {
34
36
  * (none)
35
37
  */
36
38
  export interface FeedbackRequest {
37
- app_feedback?: {};
39
+ app_feedback?: {
40
+ [key: string]: unknown;
41
+ };
38
42
  feedback?: string;
39
43
  feedback_text?: string;
40
44
  generation_id: string;
@@ -1,5 +1,5 @@
1
1
  import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
2
- export declare const VERSION = "c3409a1691f96ea567287ea5c9fd1606";
2
+ export declare const VERSION = "2a7a1d4afe523792197b7276c67c0ecb";
3
3
  export declare function validate(obj: any, path?: string): TypeError | null;
4
4
  export declare const RepresentationType: string;
5
5
  export declare function normalize(input: GenerationRequest, existing: GenerationRequestNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): GenerationRequestNormalized;
@@ -25,7 +25,9 @@ export interface GenerationRequestNormalized {
25
25
  /** Number of completions to be generated for the prompt. */
26
26
  num_generations?: number;
27
27
  /** Dictionary of any other parameters that are required by the provider. Values are passed as is to the provider so that the request can include parameters that are unique to a provider. */
28
- parameters?: {};
28
+ parameters?: {
29
+ [key: string]: unknown;
30
+ };
29
31
  /** The presence penalty. Min value is 0.0; max value is 1.0. Can reduce the repetitiveness of generated tokens. Behaves similarly to `frequency_penalty`, except that this penalty is applied equally to all tokens that have already appeared, regardless of their exact frequencies. */
30
32
  presence_penalty?: number;
31
33
  /** The prompt or text to be completed. */
@@ -33,7 +35,9 @@ export interface GenerationRequestNormalized {
33
35
  /** An array of stop sequences. The generated text is cut at the end of the earliest occurrence of a stop sequence. */
34
36
  stop_sequences?: Array<string>;
35
37
  /** Dictionary of any other information relevant to the gateway client. */
36
- tags?: {};
38
+ tags?: {
39
+ [key: string]: unknown;
40
+ };
37
41
  /** Sampling temperature to be used. Higher values mean more random token choices. Lower values mean less random token choices. Min value of 0; max value of 1.0. */
38
42
  temperature?: number;
39
43
  }
@@ -49,10 +53,14 @@ export interface GenerationRequest {
49
53
  max_tokens?: number;
50
54
  model?: string;
51
55
  num_generations?: number;
52
- parameters?: {};
56
+ parameters?: {
57
+ [key: string]: unknown;
58
+ };
53
59
  presence_penalty?: number;
54
60
  prompt: string;
55
61
  stop_sequences?: Array<string>;
56
- tags?: {};
62
+ tags?: {
63
+ [key: string]: unknown;
64
+ };
57
65
  temperature?: number;
58
66
  }
@@ -1,6 +1,6 @@
1
1
  import { GenerationResponseGenerations as GenerationResponseGenerations_GenerationResponseGenerations } from './GenerationResponseGenerations';
2
2
  import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
3
- export declare const VERSION = "31470ce89388a2c22a9c6a5a8a898945";
3
+ export declare const VERSION = "4f085d3ce8f948d5a3d38e9e24ce4f63";
4
4
  export declare function validate(obj: any, path?: string): TypeError | null;
5
5
  export declare const RepresentationType: string;
6
6
  export declare function normalize(input: GenerationResponse, existing: GenerationResponseNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): GenerationResponseNormalized;
@@ -20,7 +20,9 @@ export interface GenerationResponseNormalized {
20
20
  /** ID of the generation request. */
21
21
  id: string;
22
22
  /** Any provider-specific attributes included as part of this object. Can be `null`. */
23
- parameters?: {};
23
+ parameters?: {
24
+ [key: string]: unknown;
25
+ };
24
26
  /** Prompt used for the generation. Can be `null`. */
25
27
  prompt?: string | null;
26
28
  }
@@ -33,6 +35,8 @@ export interface GenerationResponseNormalized {
33
35
  export interface GenerationResponse {
34
36
  generations: Array<GenerationResponseGenerations_GenerationResponseGenerations>;
35
37
  id: string;
36
- parameters?: {};
38
+ parameters?: {
39
+ [key: string]: unknown;
40
+ };
37
41
  prompt?: string | null;
38
42
  }
@@ -1,6 +1,6 @@
1
1
  import { SafetyScoreRepresentation as SafetyScoreRepresentation_SafetyScoreRepresentation } from './SafetyScoreRepresentation';
2
2
  import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
3
- export declare const VERSION = "d8d7906c67f7e6b5d9e80f599c4cb47f";
3
+ export declare const VERSION = "c02333b512cb7d327983d4719e829b60";
4
4
  export declare function validate(obj: any, path?: string): TypeError | null;
5
5
  export declare const RepresentationType: string;
6
6
  export declare function normalize(input: GenerationResponseGenerations, existing: GenerationResponseGenerationsNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): GenerationResponseGenerationsNormalized;
@@ -19,7 +19,9 @@ export interface GenerationResponseGenerationsNormalized {
19
19
  /** Generation ID. This value is required to register feedback. */
20
20
  id?: string;
21
21
  /** Any provider-specific attributes included as part of this object. Can be `null`. */
22
- parameters?: {};
22
+ parameters?: {
23
+ [key: string]: unknown;
24
+ };
23
25
  /** The generated text. */
24
26
  text: string;
25
27
  }
@@ -32,6 +34,8 @@ export interface GenerationResponseGenerationsNormalized {
32
34
  export interface GenerationResponseGenerations {
33
35
  generation_safety_score?: SafetyScoreRepresentation_SafetyScoreRepresentation;
34
36
  id?: string;
35
- parameters?: {};
37
+ parameters?: {
38
+ [key: string]: unknown;
39
+ };
36
40
  text: string;
37
41
  }
@@ -1,5 +1,5 @@
1
1
  import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
2
- export declare const VERSION = "e21119e091aa6d42b4db9c7084ef4581";
2
+ export declare const VERSION = "e497bea0175bf1c5896a8cca051ac8ad";
3
3
  export declare function validate(obj: any, path?: string): TypeError | null;
4
4
  export declare const RepresentationType: string;
5
5
  export declare function normalize(input: GenerationSettings, existing: GenerationSettingsNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): GenerationSettingsNormalized;
@@ -21,7 +21,9 @@ export interface GenerationSettingsNormalized {
21
21
  /** Number of completions to be generated for a prompt. */
22
22
  num_generations?: number;
23
23
  /** Dictionary of any other parameters that are required by the specified provider. Values are passed as is to the provider so that the request can include parameters that are unique to a provider. */
24
- parameters?: {};
24
+ parameters?: {
25
+ [key: string]: unknown;
26
+ };
25
27
  /** The presence penalty to be used. Min value is 0.0; max value is 1.0. Can reduce the repetitiveness of generated tokens. Behaves similarly to `frequency_penalty`, except that this penalty is applied equally to all tokens that have already appeared, regardless of their exact frequencies. */
26
28
  presence_penalty?: number;
27
29
  /** An array of stop sequences to be used. The generated text is cut at the end of the earliest occurrence of a stop sequence. */
@@ -39,7 +41,9 @@ export interface GenerationSettings {
39
41
  frequency_penalty?: number;
40
42
  max_tokens?: number;
41
43
  num_generations?: number;
42
- parameters?: {};
44
+ parameters?: {
45
+ [key: string]: unknown;
46
+ };
43
47
  presence_penalty?: number;
44
48
  stop_sequences?: Array<string>;
45
49
  temperature?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-sfap-einstein-ai-gateway",
3
- "version": "1.256.0",
3
+ "version": "1.258.0",
4
4
  "description": "LLM Gateway API's",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "dist/es/es2018/sfap-einstein-ai-gateway.js",
@@ -40,10 +40,10 @@
40
40
  "test:unit": "jest"
41
41
  },
42
42
  "dependencies": {
43
- "@salesforce/lds-bindings": "^1.256.0"
43
+ "@salesforce/lds-bindings": "^1.258.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@salesforce/lds-compiler-plugins": "^1.256.0"
46
+ "@salesforce/lds-compiler-plugins": "^1.258.0"
47
47
  },
48
48
  "nx": {
49
49
  "targets": {
package/sfdc/index.js CHANGED
@@ -17,8 +17,8 @@ import { withDefaultLuvio } from 'force/ldsEngine';
17
17
  import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckConfig as typeCheckConfig$2, StoreKeyMap, createResourceParams as createResourceParams$2 } from 'force/luvioEngine';
18
18
 
19
19
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
- const { keys: ObjectKeys, create: ObjectCreate } = Object;
21
- const { stringify: JSONStringify } = JSON;
20
+ const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
21
+ const { stringify: JSONStringify$1 } = JSON;
22
22
  const { isArray: ArrayIsArray$1 } = Array;
23
23
  /**
24
24
  * Validates an adapter config is well-formed.
@@ -42,7 +42,7 @@ function validateConfig(config, adapter, oneOf) {
42
42
  throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
43
43
  }
44
44
  const supported = required.concat(optional);
45
- if (ObjectKeys(config).some(key => !supported.includes(key))) {
45
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
46
46
  throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
47
47
  }
48
48
  }
@@ -82,7 +82,7 @@ function stableJSONStringify(node) {
82
82
  return isFinite(node) ? '' + node : 'null';
83
83
  }
84
84
  if (typeof node !== 'object') {
85
- return JSONStringify(node);
85
+ return JSONStringify$1(node);
86
86
  }
87
87
  let i;
88
88
  let out;
@@ -99,7 +99,7 @@ function stableJSONStringify(node) {
99
99
  if (node === null) {
100
100
  return 'null';
101
101
  }
102
- const keys = ObjectKeys(node).sort();
102
+ const keys = ObjectKeys$1(node).sort();
103
103
  out = '';
104
104
  for (i = 0; i < keys.length; i++) {
105
105
  const key = keys[i];
@@ -110,7 +110,7 @@ function stableJSONStringify(node) {
110
110
  if (out) {
111
111
  out += ',';
112
112
  }
113
- out += JSONStringify(key) + ':' + value;
113
+ out += JSONStringify$1(key) + ':' + value;
114
114
  }
115
115
  return '{' + out + '}';
116
116
  }
@@ -137,7 +137,9 @@ function buildAdapterValidationConfig(displayName, paramsMeta) {
137
137
  }
138
138
  const keyPrefix = 'einstein-ai-gateway';
139
139
 
140
+ const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
140
141
  const { isArray: ArrayIsArray } = Array;
142
+ const { stringify: JSONStringify } = JSON;
141
143
  function equalsArray(a, b, equalsItem) {
142
144
  const aLength = a.length;
143
145
  const bLength = b.length;
@@ -151,6 +153,25 @@ function equalsArray(a, b, equalsItem) {
151
153
  }
152
154
  return true;
153
155
  }
156
+ function equalsObject(a, b, equalsProp) {
157
+ const aKeys = ObjectKeys(a).sort();
158
+ const bKeys = ObjectKeys(b).sort();
159
+ const aKeysLength = aKeys.length;
160
+ const bKeysLength = bKeys.length;
161
+ if (aKeysLength !== bKeysLength) {
162
+ return false;
163
+ }
164
+ for (let i = 0; i < aKeys.length; i++) {
165
+ const key = aKeys[i];
166
+ if (key !== bKeys[i]) {
167
+ return false;
168
+ }
169
+ if (equalsProp(a[key], b[key]) === false) {
170
+ return false;
171
+ }
172
+ }
173
+ return true;
174
+ }
154
175
  function createLink(ref) {
155
176
  return {
156
177
  __ref: serializeStructuredKey(ref),
@@ -431,7 +452,7 @@ function equals$3(existing, incoming) {
431
452
  return true;
432
453
  }
433
454
 
434
- const VERSION$2 = "d8d7906c67f7e6b5d9e80f599c4cb47f";
455
+ const VERSION$2 = "c02333b512cb7d327983d4719e829b60";
435
456
  function validate$2(obj, path = 'GenerationResponseGenerations') {
436
457
  const v_error = (() => {
437
458
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -460,6 +481,15 @@ function validate$2(obj, path = 'GenerationResponseGenerations') {
460
481
  if (typeof obj_parameters !== 'object' || ArrayIsArray(obj_parameters) || obj_parameters === null) {
461
482
  return new TypeError('Expected "object" but received "' + typeof obj_parameters + '" (at "' + path_parameters + '")');
462
483
  }
484
+ const obj_parameters_keys = ObjectKeys(obj_parameters);
485
+ for (let i = 0; i < obj_parameters_keys.length; i++) {
486
+ const key = obj_parameters_keys[i];
487
+ const obj_parameters_prop = obj_parameters[key];
488
+ const path_parameters_prop = path_parameters + '["' + key + '"]';
489
+ if (obj_parameters_prop === undefined) {
490
+ return new TypeError('Expected "defined" but received "' + typeof obj_parameters_prop + '" (at "' + path_parameters_prop + '")');
491
+ }
492
+ }
463
493
  }
464
494
  const obj_text = obj.text;
465
495
  const path_text = path + '.text';
@@ -487,6 +517,11 @@ const select$4 = function GenerationResponseGenerationsSelect() {
487
517
  kind: 'Scalar',
488
518
  required: false
489
519
  },
520
+ {
521
+ name: 'parameters',
522
+ kind: 'Object',
523
+ // any
524
+ },
490
525
  {
491
526
  name: 'text',
492
527
  kind: 'Scalar'
@@ -535,11 +570,19 @@ function equals$2(existing, incoming) {
535
570
  if (existing_parameters === undefined || incoming_parameters === undefined) {
536
571
  return false;
537
572
  }
573
+ const equals_parameters_props = equalsObject(existing_parameters, incoming_parameters, (existing_parameters_prop, incoming_parameters_prop) => {
574
+ if (JSONStringify(incoming_parameters_prop) !== JSONStringify(existing_parameters_prop)) {
575
+ return false;
576
+ }
577
+ });
578
+ if (equals_parameters_props === false) {
579
+ return false;
580
+ }
538
581
  }
539
582
  return true;
540
583
  }
541
584
 
542
- const VERSION$1 = "31470ce89388a2c22a9c6a5a8a898945";
585
+ const VERSION$1 = "4f085d3ce8f948d5a3d38e9e24ce4f63";
543
586
  function validate$1(obj, path = 'GenerationResponse') {
544
587
  const v_error = (() => {
545
588
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -571,6 +614,15 @@ function validate$1(obj, path = 'GenerationResponse') {
571
614
  if (typeof obj_parameters !== 'object' || ArrayIsArray(obj_parameters) || obj_parameters === null) {
572
615
  return new TypeError('Expected "object" but received "' + typeof obj_parameters + '" (at "' + path_parameters + '")');
573
616
  }
617
+ const obj_parameters_keys = ObjectKeys(obj_parameters);
618
+ for (let i = 0; i < obj_parameters_keys.length; i++) {
619
+ const key = obj_parameters_keys[i];
620
+ const obj_parameters_prop = obj_parameters[key];
621
+ const path_parameters_prop = path_parameters + '["' + key + '"]';
622
+ if (obj_parameters_prop === undefined) {
623
+ return new TypeError('Expected "defined" but received "' + typeof obj_parameters_prop + '" (at "' + path_parameters_prop + '")');
624
+ }
625
+ }
574
626
  }
575
627
  if (obj.prompt !== undefined) {
576
628
  const obj_prompt = obj.prompt;
@@ -624,6 +676,11 @@ const select$3 = function GenerationResponseSelect() {
624
676
  name: 'id',
625
677
  kind: 'Scalar'
626
678
  },
679
+ {
680
+ name: 'parameters',
681
+ kind: 'Object',
682
+ // any
683
+ },
627
684
  {
628
685
  name: 'prompt',
629
686
  kind: 'Scalar',
@@ -657,6 +714,14 @@ function equals$1(existing, incoming) {
657
714
  if (existing_parameters === undefined || incoming_parameters === undefined) {
658
715
  return false;
659
716
  }
717
+ const equals_parameters_props = equalsObject(existing_parameters, incoming_parameters, (existing_parameters_prop, incoming_parameters_prop) => {
718
+ if (JSONStringify(incoming_parameters_prop) !== JSONStringify(existing_parameters_prop)) {
719
+ return false;
720
+ }
721
+ });
722
+ if (equals_parameters_props === false) {
723
+ return false;
724
+ }
660
725
  }
661
726
  const existing_prompt = existing.prompt;
662
727
  const incoming_prompt = incoming.prompt;
@@ -771,6 +836,14 @@ function typeCheckConfig$1(untrustedConfig) {
771
836
  const untrustedConfig_parameters = untrustedConfig.parameters;
772
837
  if (untrustedIsObject(untrustedConfig_parameters)) {
773
838
  const untrustedConfig_parameters_object = {};
839
+ const untrustedConfig_parameters_keys = Object.keys(untrustedConfig_parameters);
840
+ for (let i = 0, arrayLength = untrustedConfig_parameters_keys.length; i < arrayLength; i++) {
841
+ const key = untrustedConfig_parameters_keys[i];
842
+ const untrustedConfig_parameters_prop = untrustedConfig_parameters[key];
843
+ if (untrustedConfig_parameters_object !== undefined) {
844
+ untrustedConfig_parameters_object[key] = untrustedConfig_parameters_prop;
845
+ }
846
+ }
774
847
  if (untrustedConfig_parameters_object !== undefined && Object.keys(untrustedConfig_parameters_object).length >= 0) {
775
848
  config.parameters = untrustedConfig_parameters_object;
776
849
  }
@@ -778,6 +851,14 @@ function typeCheckConfig$1(untrustedConfig) {
778
851
  const untrustedConfig_tags = untrustedConfig.tags;
779
852
  if (untrustedIsObject(untrustedConfig_tags)) {
780
853
  const untrustedConfig_tags_object = {};
854
+ const untrustedConfig_tags_keys = Object.keys(untrustedConfig_tags);
855
+ for (let i = 0, arrayLength = untrustedConfig_tags_keys.length; i < arrayLength; i++) {
856
+ const key = untrustedConfig_tags_keys[i];
857
+ const untrustedConfig_tags_prop = untrustedConfig_tags[key];
858
+ if (untrustedConfig_tags_object !== undefined) {
859
+ untrustedConfig_tags_object[key] = untrustedConfig_tags_prop;
860
+ }
861
+ }
781
862
  if (untrustedConfig_tags_object !== undefined && Object.keys(untrustedConfig_tags_object).length >= 0) {
782
863
  config.tags = untrustedConfig_tags_object;
783
864
  }
@@ -982,6 +1063,14 @@ function typeCheckConfig(untrustedConfig) {
982
1063
  const untrustedConfig_app_feedback = untrustedConfig.app_feedback;
983
1064
  if (untrustedIsObject(untrustedConfig_app_feedback)) {
984
1065
  const untrustedConfig_app_feedback_object = {};
1066
+ const untrustedConfig_app_feedback_keys = Object.keys(untrustedConfig_app_feedback);
1067
+ for (let i = 0, arrayLength = untrustedConfig_app_feedback_keys.length; i < arrayLength; i++) {
1068
+ const key = untrustedConfig_app_feedback_keys[i];
1069
+ const untrustedConfig_app_feedback_prop = untrustedConfig_app_feedback[key];
1070
+ if (untrustedConfig_app_feedback_object !== undefined) {
1071
+ untrustedConfig_app_feedback_object[key] = untrustedConfig_app_feedback_prop;
1072
+ }
1073
+ }
985
1074
  if (untrustedConfig_app_feedback_object !== undefined && Object.keys(untrustedConfig_app_feedback_object).length >= 0) {
986
1075
  config.app_feedback = untrustedConfig_app_feedback_object;
987
1076
  }
@@ -1059,4 +1148,4 @@ withDefaultLuvio((luvio) => {
1059
1148
  });
1060
1149
 
1061
1150
  export { getGenerations, getGenerations_imperative, registerFeedback };
1062
- // version: 1.256.0-fb019fbad
1151
+ // version: 1.258.0-c09652442
package/src/raml/api.raml CHANGED
@@ -24,6 +24,9 @@ types:
24
24
  description: Any provider-specific attributes included as part of this object. Can be `null`.
25
25
  (nullable): true
26
26
  type: object
27
+ properties:
28
+ //:
29
+ type: any
27
30
  example:
28
31
  strict: false
29
32
  value:
@@ -120,6 +123,9 @@ types:
120
123
  parameters?:
121
124
  description: Dictionary of any other parameters that are required by the specified provider. Values are passed as is to the provider so that the request can include parameters that are unique to a provider.
122
125
  type: object
126
+ properties:
127
+ //:
128
+ type: any
123
129
  example:
124
130
  strict: false
125
131
  value:
@@ -282,6 +288,9 @@ types:
282
288
  description: Any provider-specific attributes included as part of this object. Can be `null`.
283
289
  (nullable): true
284
290
  type: object
291
+ properties:
292
+ //:
293
+ type: any
285
294
  example:
286
295
  strict: false
287
296
  value:
@@ -289,7 +298,9 @@ types:
289
298
  index: 0
290
299
  logprobs: null
291
300
  additionalProperties: true
292
- generation_safety_score?: SafetyScoreRepresentation
301
+ generation_safety_score?:
302
+ (nullable): true
303
+ type: SafetyScoreRepresentation
293
304
  SafetyCategoryScores:
294
305
  description: Probability for each category. A higher probability indicates a more toxic content.
295
306
  type: object
@@ -376,6 +387,9 @@ types:
376
387
  parameters?:
377
388
  description: Dictionary of any other parameters that are required by the provider. Values are passed as is to the provider so that the request can include parameters that are unique to a provider.
378
389
  type: object
390
+ properties:
391
+ //:
392
+ type: any
379
393
  example:
380
394
  strict: false
381
395
  value:
@@ -386,6 +400,9 @@ types:
386
400
  tags?:
387
401
  description: Dictionary of any other information relevant to the gateway client.
388
402
  type: object
403
+ properties:
404
+ //:
405
+ type: any
389
406
  example:
390
407
  strict: false
391
408
  value:
@@ -470,6 +487,9 @@ types:
470
487
  app_feedback?:
471
488
  description: Dictionary of any app-level feedback and any other free-form parameters.
472
489
  type: object
490
+ properties:
491
+ //:
492
+ type: any # Fix for W-14390785
473
493
  additionalProperties: true
474
494
  FeedbackResponseRepresentation:
475
495
  description: Output of a einstein llm feedback call