@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,275 @@
1
+ #%RAML 1.0
2
+ securedBy:
3
+ - OAuth2
4
+ title: Salesforce Connect API
5
+ version: '59.0'
6
+ mediaType: application/json
7
+ protocols:
8
+ - https
9
+ baseUri: /services/data/v59.0
10
+ securitySchemes:
11
+ OAuth2:
12
+ type: OAuth 2.0
13
+ settings:
14
+ authorizationUri: https://example.com/oauth/authorize
15
+ accessTokenUri: ''
16
+ authorizationGrants:
17
+ - implicit
18
+ annotationTypes:
19
+ oas-readOnly:
20
+ type: boolean
21
+ allowedTargets: TypeDeclaration
22
+ oas-collectionFormat:
23
+ type: string
24
+ oas-body-name:
25
+ type: string
26
+ allowedTargets: TypeDeclaration
27
+ types:
28
+ EinsteinLlmAdditionalConfigInputRepresentation:
29
+ description: Input representation for additional configurations for Einstein LLM
30
+ generations
31
+ type: object
32
+ properties:
33
+ additionalParameters:
34
+ description: Dictionary of any other parameters that are required by the specific
35
+ provider. The values will be passed as is to the provider. This is to allow
36
+ parameters that are unique to each provider to be specified as part of the
37
+ request.
38
+ type: object
39
+ required: false # TODO Hand-rolled W-9314597
40
+ properties:
41
+ //:
42
+ type: object
43
+ applicationName:
44
+ description: 'Salesforce Hawking Application Name '
45
+ type: string
46
+ required: false # TODO Hand-rolled W-9314597
47
+ enablePiiMasking:
48
+ description: Whether to mask PII for this request. Defaults is provider specific.
49
+ type: boolean
50
+ required: false # TODO Hand-rolled W-9314597
51
+ frequencyPenalty:
52
+ description: Defaults to 0.0, min value of 0.0, max value of 1.0. Can be used
53
+ to reduce repetitiveness of generated tokens. The higher the value, the
54
+ stronger a penalty is applied to previously present tokens, proportional
55
+ to how many times they have already appeared in the prompt or prior generation.
56
+ format: double
57
+ type: number
58
+ required: false # TODO Hand-rolled W-9314597
59
+ maxTokens:
60
+ description: Maximum number of tokens to be generated
61
+ type: integer
62
+ required: false # TODO Hand-rolled W-9314597
63
+ model:
64
+ description: The model to be used for the generations request. Defaults to
65
+ provider specific model.
66
+ type: string
67
+ required: false # TODO Hand-rolled W-9314597
68
+ numGenerations:
69
+ description: Number of completions to be generated for this prompt
70
+ type: integer
71
+ required: false # TODO Hand-rolled W-9314597
72
+ presencePenalty:
73
+ description: Defaults to 0.0, min value of 0.0, max value of 1.0. Can be used
74
+ to reduce repetitiveness of generated tokens. Similar to frequency_penalty,
75
+ except that this penalty is applied equally to all tokens that have already
76
+ appeared, regardless of their exact frequencies.
77
+ format: double
78
+ type: number
79
+ required: false # TODO Hand-rolled W-9314597
80
+ stopSequences:
81
+ description: The generated text will be cut at the end of the earliest occurence
82
+ of a stop sequence.
83
+ type: array
84
+ required: false # TODO Hand-rolled W-9314597
85
+ items:
86
+ type: string
87
+ temperature:
88
+ description: Sampling temperature to be used. Higher values means the model
89
+ will take more risks. Lower temperatures mean less random generations. Min
90
+ value of 0 and max value of 1.0
91
+ format: double
92
+ type: number
93
+ required: false # TODO Hand-rolled W-9314597
94
+ # Hand-rolled remove all EinsteinLlmEmbedding*Representation types; not in scope for current work
95
+ EinsteinLlmGenerationItemRepresentation:
96
+ description: Output of a einstein llm generation item response
97
+ type: object
98
+ properties:
99
+ parameters:
100
+ description: Any provider specific attributes will be included as part of
101
+ this object
102
+ type: string
103
+ text:
104
+ description: Text
105
+ type: string
106
+ # TODO Hand-rolled W-8334626
107
+ # Need to manually wrap the input representation with what the aura controller is expecting
108
+ EinsteinLlmGenerationsInputWrapperRepresentation:
109
+ description: Input wrapper for generations input representation
110
+ type: object
111
+ properties:
112
+ generationsInput:
113
+ description: Set the parameters for message generation
114
+ type: EinsteinLlmGenerationsInputRepresentation
115
+ EinsteinLlmGenerationsInputRepresentation:
116
+ description: Input representation for generating responses with Einstein LLM
117
+ type: object
118
+ properties:
119
+ additionalConfig:
120
+ description: Additional configuration to fine tune model parameters
121
+ type: EinsteinLlmAdditionalConfigInputRepresentation # Hand-rolled update from 'object'
122
+ required: false # TODO Hand-rolled W-9314597
123
+ promptTextorId:
124
+ description: Represents the promptTextorId or text to be completed.
125
+ type: string
126
+ provider:
127
+ description: LLM Provider
128
+ type: string
129
+ required: false # TODO Hand-rolled W-9314597
130
+ EinsteinLlmGenerationsRepresentation:
131
+ description: Output of a einstein llm generations response
132
+ type: object
133
+ properties:
134
+ generations:
135
+ description: List of generated text
136
+ type: array
137
+ items:
138
+ type: EinsteinLlmGenerationItemRepresentation
139
+ parameters:
140
+ description: Any provider specific attributes will be included as part of
141
+ this object
142
+ type: WrappedMap | nil # Hand-rolled union 'nil'
143
+ prompt:
144
+ description: Prompt used for the generation
145
+ type: string | nil # Hand-rolled union 'nil'
146
+ requestId:
147
+ description: ID of the generation request
148
+ type: string
149
+ # TODO Hand-rolled W-8334626
150
+ # Need to manually wrap the input representation with what the aura controller is expecting
151
+ EinsteinPromptTemplateGenerationsInputWrapperRepresentation:
152
+ description: Input wrapper for prompt template generations input representation
153
+ type: object
154
+ properties:
155
+ promptTemplateGenerationsInput:
156
+ description: Set the parameters for prompt template message generation
157
+ type: EinsteinPromptTemplateGenerationsInputRepresentation
158
+ EinsteinPromptTemplateGenerationsInputRepresentation:
159
+ description: Input representation for generating prompt template responses with
160
+ Einstein LLM
161
+ type: object
162
+ properties:
163
+ additionalConfig:
164
+ description: Additional configuration to fine tune model parameters
165
+ type: EinsteinLlmAdditionalConfigInputRepresentation # Hand-rolled update from 'object'
166
+ required: false # TODO Hand-rolled W-9314597
167
+ inputParams:
168
+ description: Dictionary of input parameters to generate prompt from prompt
169
+ template.
170
+ type: WrappedValueMap # Hand-rolled update from 'object'
171
+ properties:
172
+ //:
173
+ type: object
174
+ isPreview:
175
+ description: Whether to generate prompt template preview by resolving merge
176
+ fields
177
+ type: boolean
178
+ provider:
179
+ description: LLM Provider
180
+ type: string
181
+ required: false # TODO Hand-rolled W-9314597
182
+ EinsteinPromptTemplateGenerationsRepresentation:
183
+ description: Output of a einstein llm generations response for given prompt template
184
+ type: object
185
+ properties:
186
+ generations:
187
+ description: List of generated text
188
+ type: array
189
+ items:
190
+ type: EinsteinLlmGenerationItemRepresentation
191
+ parameters:
192
+ description: Any provider specific attributes will be included as part of
193
+ this object
194
+ type: WrappedMap | nil # Hand-rolled union 'nil'
195
+ prompt:
196
+ description: Prompt used for the generation
197
+ type: string | nil # Hand-rolled union 'nil'
198
+ promptTemplateDevName:
199
+ description: generated prompt template promptTemplateDevName
200
+ type: string
201
+ requestId:
202
+ description: ID of the generation request
203
+ type: string
204
+ WrappedListString:
205
+ description: Wrapped list of String for use in Apex.
206
+ type: object
207
+ properties:
208
+ wrappedListString:
209
+ description: wrappedListString
210
+ type: array
211
+ items:
212
+ type: string
213
+ WrappedMap:
214
+ description: Wrapped map for use in Connect API.
215
+ type: object
216
+ properties:
217
+ wrappedMap:
218
+ description: wrapped map
219
+ type: object
220
+ properties:
221
+ //:
222
+ type: object
223
+ WrappedValue:
224
+ description: Wrapped Object for use in Einstein LLM.
225
+ type: object
226
+ properties:
227
+ value:
228
+ description: Value
229
+ type: object
230
+ WrappedValueMap:
231
+ description: Wrapped Map of Object for use in Apex.
232
+ type: object
233
+ properties:
234
+ valueMap:
235
+ description: Wrapped Value Map
236
+ type: object
237
+ properties:
238
+ //:
239
+ type: object
240
+ /einstein:
241
+ /llm:
242
+ # Hand-rolled remove /embeddings endpoint; not in scope for current work
243
+ /prompt/generations:
244
+ post:
245
+ displayName: postEinsteinLlmGenerations
246
+ description: Generates a response based on the provided prompt and parameters
247
+ responses:
248
+ '200':
249
+ description: Success
250
+ body:
251
+ application/json:
252
+ type: EinsteinLlmGenerationsRepresentation
253
+ body:
254
+ application/json:
255
+ type: EinsteinLlmGenerationsInputWrapperRepresentation
256
+ (oas-body-name): generationsInput
257
+ /prompt-templates/{promptTemplateDevName}/generations:
258
+ post:
259
+ displayName: postEinsteinPromptTemplateGenerations
260
+ description: Generates a response based on the provided prompt template and
261
+ parameters
262
+ responses:
263
+ '200':
264
+ description: Success
265
+ body:
266
+ application/json:
267
+ type: EinsteinPromptTemplateGenerationsRepresentation
268
+ body:
269
+ application/json:
270
+ type: EinsteinPromptTemplateGenerationsInputWrapperRepresentation
271
+ (oas-body-name): promptTemplateGenerationsInput
272
+ uriParameters:
273
+ promptTemplateDevName:
274
+ type: string
275
+ required: true
@@ -0,0 +1,27 @@
1
+ #%RAML 1.0 Overlay
2
+ extends: ./api.raml
3
+
4
+ uses:
5
+ luvio: luvio://annotations.raml
6
+
7
+ (luvio.keyPrefix): 'EinsteinLLM'
8
+
9
+ types:
10
+ EinsteinLlmGenerationsRepresentation:
11
+ (luvio.ttl): 100
12
+ (luvio.key):
13
+ requestId: requestId
14
+ EinsteinPromptTemplateGenerationsRepresentation:
15
+ (luvio.ttl): 100
16
+ (luvio.key):
17
+ requestId: requestId
18
+
19
+ /einstein/llm/prompt/generations:
20
+ post:
21
+ (luvio.adapter):
22
+ name: createGenerateMessages
23
+
24
+ /einstein/prompt-templates/{promptTemplateDevName}/generations:
25
+ post:
26
+ (luvio.adapter):
27
+ name: createGenerateMessagesForPromptTemplate