@aws-sdk/client-bedrock-runtime 3.596.0 → 3.600.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/index.js +120 -0
- package/dist-es/models/models_0.js +87 -0
- package/dist-es/protocols/Aws_restJson1.js +9 -0
- package/dist-types/commands/ConverseCommand.d.ts +145 -2
- package/dist-types/commands/ConverseStreamCommand.d.ts +140 -4
- package/dist-types/models/models_0.d.ts +583 -108
- package/dist-types/ts3.4/models/models_0.d.ts +221 -0
- package/package.json +41 -41
|
@@ -32,11 +32,14 @@ declare const ConverseStreamCommand_base: {
|
|
|
32
32
|
* that works with all Amazon Bedrock models that support messages.
|
|
33
33
|
* This allows you to write code once and use it with different models. Should a
|
|
34
34
|
* model have unique inference parameters, you can also pass those unique parameters to the
|
|
35
|
-
* model.
|
|
35
|
+
* model. </p>
|
|
36
36
|
* <p>To find out if a model supports streaming, call <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetFoundationModel.html">GetFoundationModel</a>
|
|
37
37
|
* and check the <code>responseStreamingSupported</code> field in the response.</p>
|
|
38
|
-
* <p>For
|
|
39
|
-
*
|
|
38
|
+
* <p>For information about the Converse API, see <i>Use the Converse API</i> in the <i>Amazon Bedrock User Guide</i>.
|
|
39
|
+
* To use a guardrail, see <i>Use a guardrail with the Converse API</i> in the <i>Amazon Bedrock User Guide</i>.
|
|
40
|
+
* To use a tool with a model, see <i>Tool use (Function calling)</i> in the <i>Amazon Bedrock User Guide</i>
|
|
41
|
+
* </p>
|
|
42
|
+
* <p>For example code, see <i>Conversation streaming example</i> in the <i>Amazon Bedrock User Guide</i>.
|
|
40
43
|
* </p>
|
|
41
44
|
* <p>This operation requires permission for the <code>bedrock:InvokeModelWithResponseStream</code> action.</p>
|
|
42
45
|
* @example
|
|
@@ -80,6 +83,11 @@ declare const ConverseStreamCommand_base: {
|
|
|
80
83
|
* ],
|
|
81
84
|
* status: "success" || "error",
|
|
82
85
|
* },
|
|
86
|
+
* guardContent: { // GuardrailConverseContentBlock Union: only one key present
|
|
87
|
+
* text: { // GuardrailConverseTextBlock
|
|
88
|
+
* text: "STRING_VALUE", // required
|
|
89
|
+
* },
|
|
90
|
+
* },
|
|
83
91
|
* },
|
|
84
92
|
* ],
|
|
85
93
|
* },
|
|
@@ -87,6 +95,11 @@ declare const ConverseStreamCommand_base: {
|
|
|
87
95
|
* system: [ // SystemContentBlocks
|
|
88
96
|
* { // SystemContentBlock Union: only one key present
|
|
89
97
|
* text: "STRING_VALUE",
|
|
98
|
+
* guardContent: {// Union: only one key present
|
|
99
|
+
* text: {
|
|
100
|
+
* text: "STRING_VALUE", // required
|
|
101
|
+
* },
|
|
102
|
+
* },
|
|
90
103
|
* },
|
|
91
104
|
* ],
|
|
92
105
|
* inferenceConfig: { // InferenceConfiguration
|
|
@@ -117,6 +130,12 @@ declare const ConverseStreamCommand_base: {
|
|
|
117
130
|
* },
|
|
118
131
|
* },
|
|
119
132
|
* },
|
|
133
|
+
* guardrailConfig: { // GuardrailStreamConfiguration
|
|
134
|
+
* guardrailIdentifier: "STRING_VALUE", // required
|
|
135
|
+
* guardrailVersion: "STRING_VALUE", // required
|
|
136
|
+
* trace: "enabled" || "disabled",
|
|
137
|
+
* streamProcessingMode: "sync" || "async",
|
|
138
|
+
* },
|
|
120
139
|
* additionalModelRequestFields: "DOCUMENT_VALUE",
|
|
121
140
|
* additionalModelResponseFieldPaths: [ // AdditionalModelResponseFieldPaths
|
|
122
141
|
* "STRING_VALUE",
|
|
@@ -151,7 +170,7 @@ declare const ConverseStreamCommand_base: {
|
|
|
151
170
|
* // contentBlockIndex: Number("int"), // required
|
|
152
171
|
* // },
|
|
153
172
|
* // messageStop: { // MessageStopEvent
|
|
154
|
-
* // stopReason: "end_turn" || "tool_use" || "max_tokens" || "stop_sequence" || "content_filtered", // required
|
|
173
|
+
* // stopReason: "end_turn" || "tool_use" || "max_tokens" || "stop_sequence" || "guardrail_intervened" || "content_filtered", // required
|
|
155
174
|
* // additionalModelResponseFields: "DOCUMENT_VALUE",
|
|
156
175
|
* // },
|
|
157
176
|
* // metadata: { // ConverseStreamMetadataEvent
|
|
@@ -163,6 +182,123 @@ declare const ConverseStreamCommand_base: {
|
|
|
163
182
|
* // metrics: { // ConverseStreamMetrics
|
|
164
183
|
* // latencyMs: Number("long"), // required
|
|
165
184
|
* // },
|
|
185
|
+
* // trace: { // ConverseStreamTrace
|
|
186
|
+
* // guardrail: { // GuardrailTraceAssessment
|
|
187
|
+
* // modelOutput: [ // ModelOutputs
|
|
188
|
+
* // "STRING_VALUE",
|
|
189
|
+
* // ],
|
|
190
|
+
* // inputAssessment: { // GuardrailAssessmentMap
|
|
191
|
+
* // "<keys>": { // GuardrailAssessment
|
|
192
|
+
* // topicPolicy: { // GuardrailTopicPolicyAssessment
|
|
193
|
+
* // topics: [ // GuardrailTopicList // required
|
|
194
|
+
* // { // GuardrailTopic
|
|
195
|
+
* // name: "STRING_VALUE", // required
|
|
196
|
+
* // type: "DENY", // required
|
|
197
|
+
* // action: "BLOCKED", // required
|
|
198
|
+
* // },
|
|
199
|
+
* // ],
|
|
200
|
+
* // },
|
|
201
|
+
* // contentPolicy: { // GuardrailContentPolicyAssessment
|
|
202
|
+
* // filters: [ // GuardrailContentFilterList // required
|
|
203
|
+
* // { // GuardrailContentFilter
|
|
204
|
+
* // type: "INSULTS" || "HATE" || "SEXUAL" || "VIOLENCE" || "MISCONDUCT" || "PROMPT_ATTACK", // required
|
|
205
|
+
* // confidence: "NONE" || "LOW" || "MEDIUM" || "HIGH", // required
|
|
206
|
+
* // action: "BLOCKED", // required
|
|
207
|
+
* // },
|
|
208
|
+
* // ],
|
|
209
|
+
* // },
|
|
210
|
+
* // wordPolicy: { // GuardrailWordPolicyAssessment
|
|
211
|
+
* // customWords: [ // GuardrailCustomWordList // required
|
|
212
|
+
* // { // GuardrailCustomWord
|
|
213
|
+
* // match: "STRING_VALUE", // required
|
|
214
|
+
* // action: "BLOCKED", // required
|
|
215
|
+
* // },
|
|
216
|
+
* // ],
|
|
217
|
+
* // managedWordLists: [ // GuardrailManagedWordList // required
|
|
218
|
+
* // { // GuardrailManagedWord
|
|
219
|
+
* // match: "STRING_VALUE", // required
|
|
220
|
+
* // type: "PROFANITY", // required
|
|
221
|
+
* // action: "BLOCKED", // required
|
|
222
|
+
* // },
|
|
223
|
+
* // ],
|
|
224
|
+
* // },
|
|
225
|
+
* // sensitiveInformationPolicy: { // GuardrailSensitiveInformationPolicyAssessment
|
|
226
|
+
* // piiEntities: [ // GuardrailPiiEntityFilterList // required
|
|
227
|
+
* // { // GuardrailPiiEntityFilter
|
|
228
|
+
* // match: "STRING_VALUE", // required
|
|
229
|
+
* // type: "ADDRESS" || "AGE" || "AWS_ACCESS_KEY" || "AWS_SECRET_KEY" || "CA_HEALTH_NUMBER" || "CA_SOCIAL_INSURANCE_NUMBER" || "CREDIT_DEBIT_CARD_CVV" || "CREDIT_DEBIT_CARD_EXPIRY" || "CREDIT_DEBIT_CARD_NUMBER" || "DRIVER_ID" || "EMAIL" || "INTERNATIONAL_BANK_ACCOUNT_NUMBER" || "IP_ADDRESS" || "LICENSE_PLATE" || "MAC_ADDRESS" || "NAME" || "PASSWORD" || "PHONE" || "PIN" || "SWIFT_CODE" || "UK_NATIONAL_HEALTH_SERVICE_NUMBER" || "UK_NATIONAL_INSURANCE_NUMBER" || "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" || "URL" || "USERNAME" || "US_BANK_ACCOUNT_NUMBER" || "US_BANK_ROUTING_NUMBER" || "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" || "US_PASSPORT_NUMBER" || "US_SOCIAL_SECURITY_NUMBER" || "VEHICLE_IDENTIFICATION_NUMBER", // required
|
|
230
|
+
* // action: "ANONYMIZED" || "BLOCKED", // required
|
|
231
|
+
* // },
|
|
232
|
+
* // ],
|
|
233
|
+
* // regexes: [ // GuardrailRegexFilterList // required
|
|
234
|
+
* // { // GuardrailRegexFilter
|
|
235
|
+
* // name: "STRING_VALUE",
|
|
236
|
+
* // match: "STRING_VALUE",
|
|
237
|
+
* // regex: "STRING_VALUE",
|
|
238
|
+
* // action: "ANONYMIZED" || "BLOCKED", // required
|
|
239
|
+
* // },
|
|
240
|
+
* // ],
|
|
241
|
+
* // },
|
|
242
|
+
* // },
|
|
243
|
+
* // },
|
|
244
|
+
* // outputAssessments: { // GuardrailAssessmentListMap
|
|
245
|
+
* // "<keys>": [ // GuardrailAssessmentList
|
|
246
|
+
* // {
|
|
247
|
+
* // topicPolicy: {
|
|
248
|
+
* // topics: [ // required
|
|
249
|
+
* // {
|
|
250
|
+
* // name: "STRING_VALUE", // required
|
|
251
|
+
* // type: "DENY", // required
|
|
252
|
+
* // action: "BLOCKED", // required
|
|
253
|
+
* // },
|
|
254
|
+
* // ],
|
|
255
|
+
* // },
|
|
256
|
+
* // contentPolicy: {
|
|
257
|
+
* // filters: [ // required
|
|
258
|
+
* // {
|
|
259
|
+
* // type: "INSULTS" || "HATE" || "SEXUAL" || "VIOLENCE" || "MISCONDUCT" || "PROMPT_ATTACK", // required
|
|
260
|
+
* // confidence: "NONE" || "LOW" || "MEDIUM" || "HIGH", // required
|
|
261
|
+
* // action: "BLOCKED", // required
|
|
262
|
+
* // },
|
|
263
|
+
* // ],
|
|
264
|
+
* // },
|
|
265
|
+
* // wordPolicy: {
|
|
266
|
+
* // customWords: [ // required
|
|
267
|
+
* // {
|
|
268
|
+
* // match: "STRING_VALUE", // required
|
|
269
|
+
* // action: "BLOCKED", // required
|
|
270
|
+
* // },
|
|
271
|
+
* // ],
|
|
272
|
+
* // managedWordLists: [ // required
|
|
273
|
+
* // {
|
|
274
|
+
* // match: "STRING_VALUE", // required
|
|
275
|
+
* // type: "PROFANITY", // required
|
|
276
|
+
* // action: "BLOCKED", // required
|
|
277
|
+
* // },
|
|
278
|
+
* // ],
|
|
279
|
+
* // },
|
|
280
|
+
* // sensitiveInformationPolicy: {
|
|
281
|
+
* // piiEntities: [ // required
|
|
282
|
+
* // {
|
|
283
|
+
* // match: "STRING_VALUE", // required
|
|
284
|
+
* // type: "ADDRESS" || "AGE" || "AWS_ACCESS_KEY" || "AWS_SECRET_KEY" || "CA_HEALTH_NUMBER" || "CA_SOCIAL_INSURANCE_NUMBER" || "CREDIT_DEBIT_CARD_CVV" || "CREDIT_DEBIT_CARD_EXPIRY" || "CREDIT_DEBIT_CARD_NUMBER" || "DRIVER_ID" || "EMAIL" || "INTERNATIONAL_BANK_ACCOUNT_NUMBER" || "IP_ADDRESS" || "LICENSE_PLATE" || "MAC_ADDRESS" || "NAME" || "PASSWORD" || "PHONE" || "PIN" || "SWIFT_CODE" || "UK_NATIONAL_HEALTH_SERVICE_NUMBER" || "UK_NATIONAL_INSURANCE_NUMBER" || "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" || "URL" || "USERNAME" || "US_BANK_ACCOUNT_NUMBER" || "US_BANK_ROUTING_NUMBER" || "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" || "US_PASSPORT_NUMBER" || "US_SOCIAL_SECURITY_NUMBER" || "VEHICLE_IDENTIFICATION_NUMBER", // required
|
|
285
|
+
* // action: "ANONYMIZED" || "BLOCKED", // required
|
|
286
|
+
* // },
|
|
287
|
+
* // ],
|
|
288
|
+
* // regexes: [ // required
|
|
289
|
+
* // {
|
|
290
|
+
* // name: "STRING_VALUE",
|
|
291
|
+
* // match: "STRING_VALUE",
|
|
292
|
+
* // regex: "STRING_VALUE",
|
|
293
|
+
* // action: "ANONYMIZED" || "BLOCKED", // required
|
|
294
|
+
* // },
|
|
295
|
+
* // ],
|
|
296
|
+
* // },
|
|
297
|
+
* // },
|
|
298
|
+
* // ],
|
|
299
|
+
* // },
|
|
300
|
+
* // },
|
|
301
|
+
* // },
|
|
166
302
|
* // },
|
|
167
303
|
* // internalServerException: { // InternalServerException
|
|
168
304
|
* // message: "STRING_VALUE",
|