@aws-sdk/client-bedrock-runtime 3.662.0 → 3.663.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 CHANGED
@@ -41,6 +41,7 @@ __export(src_exports, {
41
41
  GuardrailAction: () => GuardrailAction,
42
42
  GuardrailContentBlock: () => GuardrailContentBlock,
43
43
  GuardrailContentFilterConfidence: () => GuardrailContentFilterConfidence,
44
+ GuardrailContentFilterStrength: () => GuardrailContentFilterStrength,
44
45
  GuardrailContentFilterType: () => GuardrailContentFilterType,
45
46
  GuardrailContentPolicyAction: () => GuardrailContentPolicyAction,
46
47
  GuardrailContentQualifier: () => GuardrailContentQualifier,
@@ -305,6 +306,12 @@ var GuardrailContentFilterConfidence = {
305
306
  MEDIUM: "MEDIUM",
306
307
  NONE: "NONE"
307
308
  };
309
+ var GuardrailContentFilterStrength = {
310
+ HIGH: "HIGH",
311
+ LOW: "LOW",
312
+ MEDIUM: "MEDIUM",
313
+ NONE: "NONE"
314
+ };
308
315
  var GuardrailContentFilterType = {
309
316
  HATE: "HATE",
310
317
  INSULTS: "INSULTS",
@@ -942,6 +949,7 @@ var de_ApplyGuardrailCommand = /* @__PURE__ */ __name(async (output, context) =>
942
949
  const doc = (0, import_smithy_client.take)(data, {
943
950
  action: import_smithy_client.expectString,
944
951
  assessments: (_) => de_GuardrailAssessmentList(_, context),
952
+ guardrailCoverage: import_smithy_client._json,
945
953
  outputs: import_smithy_client._json,
946
954
  usage: import_smithy_client._json
947
955
  });
@@ -1597,6 +1605,7 @@ var de_GuardrailAssessment = /* @__PURE__ */ __name((output, context) => {
1597
1605
  return (0, import_smithy_client.take)(output, {
1598
1606
  contentPolicy: import_smithy_client._json,
1599
1607
  contextualGroundingPolicy: (_) => de_GuardrailContextualGroundingPolicyAssessment(_, context),
1608
+ invocationMetrics: import_smithy_client._json,
1600
1609
  sensitiveInformationPolicy: import_smithy_client._json,
1601
1610
  topicPolicy: import_smithy_client._json,
1602
1611
  wordPolicy: import_smithy_client._json
@@ -1859,6 +1868,7 @@ var BedrockRuntime = _BedrockRuntime;
1859
1868
  GuardrailAction,
1860
1869
  GuardrailContentPolicyAction,
1861
1870
  GuardrailContentFilterConfidence,
1871
+ GuardrailContentFilterStrength,
1862
1872
  GuardrailContentFilterType,
1863
1873
  GuardrailContextualGroundingPolicyAction,
1864
1874
  GuardrailContextualGroundingFilterType,
@@ -42,6 +42,12 @@ export const GuardrailContentFilterConfidence = {
42
42
  MEDIUM: "MEDIUM",
43
43
  NONE: "NONE",
44
44
  };
45
+ export const GuardrailContentFilterStrength = {
46
+ HIGH: "HIGH",
47
+ LOW: "LOW",
48
+ MEDIUM: "MEDIUM",
49
+ NONE: "NONE",
50
+ };
45
51
  export const GuardrailContentFilterType = {
46
52
  HATE: "HATE",
47
53
  INSULTS: "INSULTS",
@@ -106,6 +106,7 @@ export const de_ApplyGuardrailCommand = async (output, context) => {
106
106
  const doc = take(data, {
107
107
  action: __expectString,
108
108
  assessments: (_) => de_GuardrailAssessmentList(_, context),
109
+ guardrailCoverage: _json,
109
110
  outputs: _json,
110
111
  usage: _json,
111
112
  });
@@ -759,6 +760,7 @@ const de_GuardrailAssessment = (output, context) => {
759
760
  return take(output, {
760
761
  contentPolicy: _json,
761
762
  contextualGroundingPolicy: (_) => de_GuardrailContextualGroundingPolicyAssessment(_, context),
763
+ invocationMetrics: _json,
762
764
  sensitiveInformationPolicy: _json,
763
765
  topicPolicy: _json,
764
766
  wordPolicy: _json,
@@ -82,6 +82,7 @@ declare const ApplyGuardrailCommand_base: {
82
82
  * // { // GuardrailContentFilter
83
83
  * // type: "INSULTS" || "HATE" || "SEXUAL" || "VIOLENCE" || "MISCONDUCT" || "PROMPT_ATTACK", // required
84
84
  * // confidence: "NONE" || "LOW" || "MEDIUM" || "HIGH", // required
85
+ * // filterStrength: "NONE" || "LOW" || "MEDIUM" || "HIGH",
85
86
  * // action: "BLOCKED", // required
86
87
  * // },
87
88
  * // ],
@@ -128,8 +129,31 @@ declare const ApplyGuardrailCommand_base: {
128
129
  * // },
129
130
  * // ],
130
131
  * // },
132
+ * // invocationMetrics: { // GuardrailInvocationMetrics
133
+ * // guardrailProcessingLatency: Number("long"),
134
+ * // usage: {
135
+ * // topicPolicyUnits: Number("int"), // required
136
+ * // contentPolicyUnits: Number("int"), // required
137
+ * // wordPolicyUnits: Number("int"), // required
138
+ * // sensitiveInformationPolicyUnits: Number("int"), // required
139
+ * // sensitiveInformationPolicyFreeUnits: Number("int"), // required
140
+ * // contextualGroundingPolicyUnits: Number("int"), // required
141
+ * // },
142
+ * // guardrailCoverage: { // GuardrailCoverage
143
+ * // textCharacters: { // GuardrailTextCharactersCoverage
144
+ * // guarded: Number("int"),
145
+ * // total: Number("int"),
146
+ * // },
147
+ * // },
148
+ * // },
131
149
  * // },
132
150
  * // ],
151
+ * // guardrailCoverage: {
152
+ * // textCharacters: {
153
+ * // guarded: Number("int"),
154
+ * // total: Number("int"),
155
+ * // },
156
+ * // },
133
157
  * // };
134
158
  *
135
159
  * ```
@@ -251,6 +251,7 @@ declare const ConverseCommand_base: {
251
251
  * // { // GuardrailContentFilter
252
252
  * // type: "INSULTS" || "HATE" || "SEXUAL" || "VIOLENCE" || "MISCONDUCT" || "PROMPT_ATTACK", // required
253
253
  * // confidence: "NONE" || "LOW" || "MEDIUM" || "HIGH", // required
254
+ * // filterStrength: "NONE" || "LOW" || "MEDIUM" || "HIGH",
254
255
  * // action: "BLOCKED", // required
255
256
  * // },
256
257
  * // ],
@@ -297,6 +298,23 @@ declare const ConverseCommand_base: {
297
298
  * // },
298
299
  * // ],
299
300
  * // },
301
+ * // invocationMetrics: { // GuardrailInvocationMetrics
302
+ * // guardrailProcessingLatency: Number("long"),
303
+ * // usage: { // GuardrailUsage
304
+ * // topicPolicyUnits: Number("int"), // required
305
+ * // contentPolicyUnits: Number("int"), // required
306
+ * // wordPolicyUnits: Number("int"), // required
307
+ * // sensitiveInformationPolicyUnits: Number("int"), // required
308
+ * // sensitiveInformationPolicyFreeUnits: Number("int"), // required
309
+ * // contextualGroundingPolicyUnits: Number("int"), // required
310
+ * // },
311
+ * // guardrailCoverage: { // GuardrailCoverage
312
+ * // textCharacters: { // GuardrailTextCharactersCoverage
313
+ * // guarded: Number("int"),
314
+ * // total: Number("int"),
315
+ * // },
316
+ * // },
317
+ * // },
300
318
  * // },
301
319
  * // },
302
320
  * // outputAssessments: { // GuardrailAssessmentListMap
@@ -316,6 +334,7 @@ declare const ConverseCommand_base: {
316
334
  * // {
317
335
  * // type: "INSULTS" || "HATE" || "SEXUAL" || "VIOLENCE" || "MISCONDUCT" || "PROMPT_ATTACK", // required
318
336
  * // confidence: "NONE" || "LOW" || "MEDIUM" || "HIGH", // required
337
+ * // filterStrength: "NONE" || "LOW" || "MEDIUM" || "HIGH",
319
338
  * // action: "BLOCKED", // required
320
339
  * // },
321
340
  * // ],
@@ -362,6 +381,23 @@ declare const ConverseCommand_base: {
362
381
  * // },
363
382
  * // ],
364
383
  * // },
384
+ * // invocationMetrics: {
385
+ * // guardrailProcessingLatency: Number("long"),
386
+ * // usage: {
387
+ * // topicPolicyUnits: Number("int"), // required
388
+ * // contentPolicyUnits: Number("int"), // required
389
+ * // wordPolicyUnits: Number("int"), // required
390
+ * // sensitiveInformationPolicyUnits: Number("int"), // required
391
+ * // sensitiveInformationPolicyFreeUnits: Number("int"), // required
392
+ * // contextualGroundingPolicyUnits: Number("int"), // required
393
+ * // },
394
+ * // guardrailCoverage: {
395
+ * // textCharacters: {
396
+ * // guarded: Number("int"),
397
+ * // total: Number("int"),
398
+ * // },
399
+ * // },
400
+ * // },
365
401
  * // },
366
402
  * // ],
367
403
  * // },
@@ -227,6 +227,7 @@ declare const ConverseStreamCommand_base: {
227
227
  * // { // GuardrailContentFilter
228
228
  * // type: "INSULTS" || "HATE" || "SEXUAL" || "VIOLENCE" || "MISCONDUCT" || "PROMPT_ATTACK", // required
229
229
  * // confidence: "NONE" || "LOW" || "MEDIUM" || "HIGH", // required
230
+ * // filterStrength: "NONE" || "LOW" || "MEDIUM" || "HIGH",
230
231
  * // action: "BLOCKED", // required
231
232
  * // },
232
233
  * // ],
@@ -273,6 +274,23 @@ declare const ConverseStreamCommand_base: {
273
274
  * // },
274
275
  * // ],
275
276
  * // },
277
+ * // invocationMetrics: { // GuardrailInvocationMetrics
278
+ * // guardrailProcessingLatency: Number("long"),
279
+ * // usage: { // GuardrailUsage
280
+ * // topicPolicyUnits: Number("int"), // required
281
+ * // contentPolicyUnits: Number("int"), // required
282
+ * // wordPolicyUnits: Number("int"), // required
283
+ * // sensitiveInformationPolicyUnits: Number("int"), // required
284
+ * // sensitiveInformationPolicyFreeUnits: Number("int"), // required
285
+ * // contextualGroundingPolicyUnits: Number("int"), // required
286
+ * // },
287
+ * // guardrailCoverage: { // GuardrailCoverage
288
+ * // textCharacters: { // GuardrailTextCharactersCoverage
289
+ * // guarded: Number("int"),
290
+ * // total: Number("int"),
291
+ * // },
292
+ * // },
293
+ * // },
276
294
  * // },
277
295
  * // },
278
296
  * // outputAssessments: { // GuardrailAssessmentListMap
@@ -292,6 +310,7 @@ declare const ConverseStreamCommand_base: {
292
310
  * // {
293
311
  * // type: "INSULTS" || "HATE" || "SEXUAL" || "VIOLENCE" || "MISCONDUCT" || "PROMPT_ATTACK", // required
294
312
  * // confidence: "NONE" || "LOW" || "MEDIUM" || "HIGH", // required
313
+ * // filterStrength: "NONE" || "LOW" || "MEDIUM" || "HIGH",
295
314
  * // action: "BLOCKED", // required
296
315
  * // },
297
316
  * // ],
@@ -338,6 +357,23 @@ declare const ConverseStreamCommand_base: {
338
357
  * // },
339
358
  * // ],
340
359
  * // },
360
+ * // invocationMetrics: {
361
+ * // guardrailProcessingLatency: Number("long"),
362
+ * // usage: {
363
+ * // topicPolicyUnits: Number("int"), // required
364
+ * // contentPolicyUnits: Number("int"), // required
365
+ * // wordPolicyUnits: Number("int"), // required
366
+ * // sensitiveInformationPolicyUnits: Number("int"), // required
367
+ * // sensitiveInformationPolicyFreeUnits: Number("int"), // required
368
+ * // contextualGroundingPolicyUnits: Number("int"), // required
369
+ * // },
370
+ * // guardrailCoverage: {
371
+ * // textCharacters: {
372
+ * // guarded: Number("int"),
373
+ * // total: Number("int"),
374
+ * // },
375
+ * // },
376
+ * // },
341
377
  * // },
342
378
  * // ],
343
379
  * // },
@@ -146,6 +146,20 @@ export declare const GuardrailContentFilterConfidence: {
146
146
  * @public
147
147
  */
148
148
  export type GuardrailContentFilterConfidence = (typeof GuardrailContentFilterConfidence)[keyof typeof GuardrailContentFilterConfidence];
149
+ /**
150
+ * @public
151
+ * @enum
152
+ */
153
+ export declare const GuardrailContentFilterStrength: {
154
+ readonly HIGH: "HIGH";
155
+ readonly LOW: "LOW";
156
+ readonly MEDIUM: "MEDIUM";
157
+ readonly NONE: "NONE";
158
+ };
159
+ /**
160
+ * @public
161
+ */
162
+ export type GuardrailContentFilterStrength = (typeof GuardrailContentFilterStrength)[keyof typeof GuardrailContentFilterStrength];
149
163
  /**
150
164
  * @public
151
165
  * @enum
@@ -177,6 +191,11 @@ export interface GuardrailContentFilter {
177
191
  * @public
178
192
  */
179
193
  confidence: GuardrailContentFilterConfidence | undefined;
194
+ /**
195
+ * <p>The filter strength setting for the guardrail content filter.</p>
196
+ * @public
197
+ */
198
+ filterStrength?: GuardrailContentFilterStrength;
180
199
  /**
181
200
  * <p>The guardrail action.</p>
182
201
  * @public
@@ -255,6 +274,90 @@ export interface GuardrailContextualGroundingPolicyAssessment {
255
274
  */
256
275
  filters?: GuardrailContextualGroundingFilter[];
257
276
  }
277
+ /**
278
+ * <p>The guardrail coverage for the text characters.</p>
279
+ * @public
280
+ */
281
+ export interface GuardrailTextCharactersCoverage {
282
+ /**
283
+ * <p>The text characters that were guarded by the guardrail coverage.</p>
284
+ * @public
285
+ */
286
+ guarded?: number;
287
+ /**
288
+ * <p>The total text characters by the guardrail coverage.</p>
289
+ * @public
290
+ */
291
+ total?: number;
292
+ }
293
+ /**
294
+ * <p>The action of the guardrail coverage details.</p>
295
+ * @public
296
+ */
297
+ export interface GuardrailCoverage {
298
+ /**
299
+ * <p>The text characters of the guardrail coverage details.</p>
300
+ * @public
301
+ */
302
+ textCharacters?: GuardrailTextCharactersCoverage;
303
+ }
304
+ /**
305
+ * <p>The details on the use of the guardrail.</p>
306
+ * @public
307
+ */
308
+ export interface GuardrailUsage {
309
+ /**
310
+ * <p>The topic policy units processed by the guardrail.</p>
311
+ * @public
312
+ */
313
+ topicPolicyUnits: number | undefined;
314
+ /**
315
+ * <p>The content policy units processed by the guardrail.</p>
316
+ * @public
317
+ */
318
+ contentPolicyUnits: number | undefined;
319
+ /**
320
+ * <p>The word policy units processed by the guardrail.</p>
321
+ * @public
322
+ */
323
+ wordPolicyUnits: number | undefined;
324
+ /**
325
+ * <p>The sensitive information policy units processed by the guardrail.</p>
326
+ * @public
327
+ */
328
+ sensitiveInformationPolicyUnits: number | undefined;
329
+ /**
330
+ * <p>The sensitive information policy free units processed by the guardrail.</p>
331
+ * @public
332
+ */
333
+ sensitiveInformationPolicyFreeUnits: number | undefined;
334
+ /**
335
+ * <p>The contextual grounding policy units processed by the guardrail.</p>
336
+ * @public
337
+ */
338
+ contextualGroundingPolicyUnits: number | undefined;
339
+ }
340
+ /**
341
+ * <p>The invocation metrics for the guardrail.</p>
342
+ * @public
343
+ */
344
+ export interface GuardrailInvocationMetrics {
345
+ /**
346
+ * <p>The processing latency details for the guardrail invocation metrics.</p>
347
+ * @public
348
+ */
349
+ guardrailProcessingLatency?: number;
350
+ /**
351
+ * <p>The usage details for the guardrail invocation metrics.</p>
352
+ * @public
353
+ */
354
+ usage?: GuardrailUsage;
355
+ /**
356
+ * <p>The coverage details for the guardrail invocation metrics.</p>
357
+ * @public
358
+ */
359
+ guardrailCoverage?: GuardrailCoverage;
360
+ }
258
361
  /**
259
362
  * @public
260
363
  * @enum
@@ -530,6 +633,11 @@ export interface GuardrailAssessment {
530
633
  * @public
531
634
  */
532
635
  contextualGroundingPolicy?: GuardrailContextualGroundingPolicyAssessment;
636
+ /**
637
+ * <p>The invocation metrics for the guardrail assessment.</p>
638
+ * @public
639
+ */
640
+ invocationMetrics?: GuardrailInvocationMetrics;
533
641
  }
534
642
  /**
535
643
  * <p>The output content produced by the guardrail.</p>
@@ -542,42 +650,6 @@ export interface GuardrailOutputContent {
542
650
  */
543
651
  text?: string;
544
652
  }
545
- /**
546
- * <p>The details on the use of the guardrail.</p>
547
- * @public
548
- */
549
- export interface GuardrailUsage {
550
- /**
551
- * <p>The topic policy units processed by the guardrail.</p>
552
- * @public
553
- */
554
- topicPolicyUnits: number | undefined;
555
- /**
556
- * <p>The content policy units processed by the guardrail.</p>
557
- * @public
558
- */
559
- contentPolicyUnits: number | undefined;
560
- /**
561
- * <p>The word policy units processed by the guardrail.</p>
562
- * @public
563
- */
564
- wordPolicyUnits: number | undefined;
565
- /**
566
- * <p>The sensitive information policy units processed by the guardrail.</p>
567
- * @public
568
- */
569
- sensitiveInformationPolicyUnits: number | undefined;
570
- /**
571
- * <p>The sensitive information policy free units processed by the guardrail.</p>
572
- * @public
573
- */
574
- sensitiveInformationPolicyFreeUnits: number | undefined;
575
- /**
576
- * <p>The contextual grounding policy units processed by the guardrail.</p>
577
- * @public
578
- */
579
- contextualGroundingPolicyUnits: number | undefined;
580
- }
581
653
  /**
582
654
  * @public
583
655
  */
@@ -602,6 +674,11 @@ export interface ApplyGuardrailResponse {
602
674
  * @public
603
675
  */
604
676
  assessments: GuardrailAssessment[] | undefined;
677
+ /**
678
+ * <p>The guardrail coverage details in the apply guardrail response.</p>
679
+ * @public
680
+ */
681
+ guardrailCoverage?: GuardrailCoverage;
605
682
  }
606
683
  /**
607
684
  * <p>An internal server error occurred. Retry your request.</p>
@@ -68,6 +68,14 @@ export declare const GuardrailContentFilterConfidence: {
68
68
  };
69
69
  export type GuardrailContentFilterConfidence =
70
70
  (typeof GuardrailContentFilterConfidence)[keyof typeof GuardrailContentFilterConfidence];
71
+ export declare const GuardrailContentFilterStrength: {
72
+ readonly HIGH: "HIGH";
73
+ readonly LOW: "LOW";
74
+ readonly MEDIUM: "MEDIUM";
75
+ readonly NONE: "NONE";
76
+ };
77
+ export type GuardrailContentFilterStrength =
78
+ (typeof GuardrailContentFilterStrength)[keyof typeof GuardrailContentFilterStrength];
71
79
  export declare const GuardrailContentFilterType: {
72
80
  readonly HATE: "HATE";
73
81
  readonly INSULTS: "INSULTS";
@@ -81,6 +89,7 @@ export type GuardrailContentFilterType =
81
89
  export interface GuardrailContentFilter {
82
90
  type: GuardrailContentFilterType | undefined;
83
91
  confidence: GuardrailContentFilterConfidence | undefined;
92
+ filterStrength?: GuardrailContentFilterStrength;
84
93
  action: GuardrailContentPolicyAction | undefined;
85
94
  }
86
95
  export interface GuardrailContentPolicyAssessment {
@@ -107,6 +116,26 @@ export interface GuardrailContextualGroundingFilter {
107
116
  export interface GuardrailContextualGroundingPolicyAssessment {
108
117
  filters?: GuardrailContextualGroundingFilter[];
109
118
  }
119
+ export interface GuardrailTextCharactersCoverage {
120
+ guarded?: number;
121
+ total?: number;
122
+ }
123
+ export interface GuardrailCoverage {
124
+ textCharacters?: GuardrailTextCharactersCoverage;
125
+ }
126
+ export interface GuardrailUsage {
127
+ topicPolicyUnits: number | undefined;
128
+ contentPolicyUnits: number | undefined;
129
+ wordPolicyUnits: number | undefined;
130
+ sensitiveInformationPolicyUnits: number | undefined;
131
+ sensitiveInformationPolicyFreeUnits: number | undefined;
132
+ contextualGroundingPolicyUnits: number | undefined;
133
+ }
134
+ export interface GuardrailInvocationMetrics {
135
+ guardrailProcessingLatency?: number;
136
+ usage?: GuardrailUsage;
137
+ guardrailCoverage?: GuardrailCoverage;
138
+ }
110
139
  export declare const GuardrailSensitiveInformationPolicyAction: {
111
140
  readonly ANONYMIZED: "ANONYMIZED";
112
141
  readonly BLOCKED: "BLOCKED";
@@ -210,23 +239,17 @@ export interface GuardrailAssessment {
210
239
  wordPolicy?: GuardrailWordPolicyAssessment;
211
240
  sensitiveInformationPolicy?: GuardrailSensitiveInformationPolicyAssessment;
212
241
  contextualGroundingPolicy?: GuardrailContextualGroundingPolicyAssessment;
242
+ invocationMetrics?: GuardrailInvocationMetrics;
213
243
  }
214
244
  export interface GuardrailOutputContent {
215
245
  text?: string;
216
246
  }
217
- export interface GuardrailUsage {
218
- topicPolicyUnits: number | undefined;
219
- contentPolicyUnits: number | undefined;
220
- wordPolicyUnits: number | undefined;
221
- sensitiveInformationPolicyUnits: number | undefined;
222
- sensitiveInformationPolicyFreeUnits: number | undefined;
223
- contextualGroundingPolicyUnits: number | undefined;
224
- }
225
247
  export interface ApplyGuardrailResponse {
226
248
  usage: GuardrailUsage | undefined;
227
249
  action: GuardrailAction | undefined;
228
250
  outputs: GuardrailOutputContent[] | undefined;
229
251
  assessments: GuardrailAssessment[] | undefined;
252
+ guardrailCoverage?: GuardrailCoverage;
230
253
  }
231
254
  export declare class InternalServerException extends __BaseException {
232
255
  readonly name: "InternalServerException";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-bedrock-runtime",
3
3
  "description": "AWS SDK for JavaScript Bedrock Runtime Client for Node.js, Browser and React Native",
4
- "version": "3.662.0",
4
+ "version": "3.663.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "node ../../scripts/compilation/inline client-bedrock-runtime",