@aws-sdk/client-bedrock-runtime 3.598.0 → 3.602.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.
@@ -8,12 +8,83 @@ export declare class AccessDeniedException extends __BaseException {
8
8
  opts: __ExceptionOptionType<AccessDeniedException, __BaseException>
9
9
  );
10
10
  }
11
+ export declare const GuardrailTrace: {
12
+ readonly DISABLED: "disabled";
13
+ readonly ENABLED: "enabled";
14
+ };
15
+ export type GuardrailTrace =
16
+ (typeof GuardrailTrace)[keyof typeof GuardrailTrace];
17
+ export interface GuardrailConfiguration {
18
+ guardrailIdentifier: string | undefined;
19
+ guardrailVersion: string | undefined;
20
+ trace?: GuardrailTrace;
21
+ }
11
22
  export interface InferenceConfiguration {
12
23
  maxTokens?: number;
13
24
  temperature?: number;
14
25
  topP?: number;
15
26
  stopSequences?: string[];
16
27
  }
28
+ export declare const DocumentFormat: {
29
+ readonly CSV: "csv";
30
+ readonly DOC: "doc";
31
+ readonly DOCX: "docx";
32
+ readonly HTML: "html";
33
+ readonly MD: "md";
34
+ readonly PDF: "pdf";
35
+ readonly TXT: "txt";
36
+ readonly XLS: "xls";
37
+ readonly XLSX: "xlsx";
38
+ };
39
+ export type DocumentFormat =
40
+ (typeof DocumentFormat)[keyof typeof DocumentFormat];
41
+ export type DocumentSource =
42
+ | DocumentSource.BytesMember
43
+ | DocumentSource.$UnknownMember;
44
+ export declare namespace DocumentSource {
45
+ interface BytesMember {
46
+ bytes: Uint8Array;
47
+ $unknown?: never;
48
+ }
49
+ interface $UnknownMember {
50
+ bytes?: never;
51
+ $unknown: [string, any];
52
+ }
53
+ interface Visitor<T> {
54
+ bytes: (value: Uint8Array) => T;
55
+ _: (name: string, value: any) => T;
56
+ }
57
+ const visit: <T>(value: DocumentSource, visitor: Visitor<T>) => T;
58
+ }
59
+ export interface DocumentBlock {
60
+ format: DocumentFormat | undefined;
61
+ name: string | undefined;
62
+ source: DocumentSource | undefined;
63
+ }
64
+ export interface GuardrailConverseTextBlock {
65
+ text: string | undefined;
66
+ }
67
+ export type GuardrailConverseContentBlock =
68
+ | GuardrailConverseContentBlock.TextMember
69
+ | GuardrailConverseContentBlock.$UnknownMember;
70
+ export declare namespace GuardrailConverseContentBlock {
71
+ interface TextMember {
72
+ text: GuardrailConverseTextBlock;
73
+ $unknown?: never;
74
+ }
75
+ interface $UnknownMember {
76
+ text?: never;
77
+ $unknown: [string, any];
78
+ }
79
+ interface Visitor<T> {
80
+ text: (value: GuardrailConverseTextBlock) => T;
81
+ _: (name: string, value: any) => T;
82
+ }
83
+ const visit: <T>(
84
+ value: GuardrailConverseContentBlock,
85
+ visitor: Visitor<T>
86
+ ) => T;
87
+ }
17
88
  export declare const ImageFormat: {
18
89
  readonly GIF: "gif";
19
90
  readonly JPEG: "jpeg";
@@ -42,6 +113,7 @@ export interface ImageBlock {
42
113
  source: ImageSource | undefined;
43
114
  }
44
115
  export type ToolResultContentBlock =
116
+ | ToolResultContentBlock.DocumentMember
45
117
  | ToolResultContentBlock.ImageMember
46
118
  | ToolResultContentBlock.JsonMember
47
119
  | ToolResultContentBlock.TextMember
@@ -51,30 +123,42 @@ export declare namespace ToolResultContentBlock {
51
123
  json: __DocumentType;
52
124
  text?: never;
53
125
  image?: never;
126
+ document?: never;
54
127
  $unknown?: never;
55
128
  }
56
129
  interface TextMember {
57
130
  json?: never;
58
131
  text: string;
59
132
  image?: never;
133
+ document?: never;
60
134
  $unknown?: never;
61
135
  }
62
136
  interface ImageMember {
63
137
  json?: never;
64
138
  text?: never;
65
139
  image: ImageBlock;
140
+ document?: never;
141
+ $unknown?: never;
142
+ }
143
+ interface DocumentMember {
144
+ json?: never;
145
+ text?: never;
146
+ image?: never;
147
+ document: DocumentBlock;
66
148
  $unknown?: never;
67
149
  }
68
150
  interface $UnknownMember {
69
151
  json?: never;
70
152
  text?: never;
71
153
  image?: never;
154
+ document?: never;
72
155
  $unknown: [string, any];
73
156
  }
74
157
  interface Visitor<T> {
75
158
  json: (value: __DocumentType) => T;
76
159
  text: (value: string) => T;
77
160
  image: (value: ImageBlock) => T;
161
+ document: (value: DocumentBlock) => T;
78
162
  _: (name: string, value: any) => T;
79
163
  }
80
164
  const visit: <T>(value: ToolResultContentBlock, visitor: Visitor<T>) => T;
@@ -96,6 +180,8 @@ export interface ToolUseBlock {
96
180
  input: __DocumentType | undefined;
97
181
  }
98
182
  export type ContentBlock =
183
+ | ContentBlock.DocumentMember
184
+ | ContentBlock.GuardContentMember
99
185
  | ContentBlock.ImageMember
100
186
  | ContentBlock.TextMember
101
187
  | ContentBlock.ToolResultMember
@@ -105,43 +191,73 @@ export declare namespace ContentBlock {
105
191
  interface TextMember {
106
192
  text: string;
107
193
  image?: never;
194
+ document?: never;
108
195
  toolUse?: never;
109
196
  toolResult?: never;
197
+ guardContent?: never;
110
198
  $unknown?: never;
111
199
  }
112
200
  interface ImageMember {
113
201
  text?: never;
114
202
  image: ImageBlock;
203
+ document?: never;
204
+ toolUse?: never;
205
+ toolResult?: never;
206
+ guardContent?: never;
207
+ $unknown?: never;
208
+ }
209
+ interface DocumentMember {
210
+ text?: never;
211
+ image?: never;
212
+ document: DocumentBlock;
115
213
  toolUse?: never;
116
214
  toolResult?: never;
215
+ guardContent?: never;
117
216
  $unknown?: never;
118
217
  }
119
218
  interface ToolUseMember {
120
219
  text?: never;
121
220
  image?: never;
221
+ document?: never;
122
222
  toolUse: ToolUseBlock;
123
223
  toolResult?: never;
224
+ guardContent?: never;
124
225
  $unknown?: never;
125
226
  }
126
227
  interface ToolResultMember {
127
228
  text?: never;
128
229
  image?: never;
230
+ document?: never;
129
231
  toolUse?: never;
130
232
  toolResult: ToolResultBlock;
233
+ guardContent?: never;
234
+ $unknown?: never;
235
+ }
236
+ interface GuardContentMember {
237
+ text?: never;
238
+ image?: never;
239
+ document?: never;
240
+ toolUse?: never;
241
+ toolResult?: never;
242
+ guardContent: GuardrailConverseContentBlock;
131
243
  $unknown?: never;
132
244
  }
133
245
  interface $UnknownMember {
134
246
  text?: never;
135
247
  image?: never;
248
+ document?: never;
136
249
  toolUse?: never;
137
250
  toolResult?: never;
251
+ guardContent?: never;
138
252
  $unknown: [string, any];
139
253
  }
140
254
  interface Visitor<T> {
141
255
  text: (value: string) => T;
142
256
  image: (value: ImageBlock) => T;
257
+ document: (value: DocumentBlock) => T;
143
258
  toolUse: (value: ToolUseBlock) => T;
144
259
  toolResult: (value: ToolResultBlock) => T;
260
+ guardContent: (value: GuardrailConverseContentBlock) => T;
145
261
  _: (name: string, value: any) => T;
146
262
  }
147
263
  const visit: <T>(value: ContentBlock, visitor: Visitor<T>) => T;
@@ -157,19 +273,28 @@ export interface Message {
157
273
  content: ContentBlock[] | undefined;
158
274
  }
159
275
  export type SystemContentBlock =
276
+ | SystemContentBlock.GuardContentMember
160
277
  | SystemContentBlock.TextMember
161
278
  | SystemContentBlock.$UnknownMember;
162
279
  export declare namespace SystemContentBlock {
163
280
  interface TextMember {
164
281
  text: string;
282
+ guardContent?: never;
283
+ $unknown?: never;
284
+ }
285
+ interface GuardContentMember {
286
+ text?: never;
287
+ guardContent: GuardrailConverseContentBlock;
165
288
  $unknown?: never;
166
289
  }
167
290
  interface $UnknownMember {
168
291
  text?: never;
292
+ guardContent?: never;
169
293
  $unknown: [string, any];
170
294
  }
171
295
  interface Visitor<T> {
172
296
  text: (value: string) => T;
297
+ guardContent: (value: GuardrailConverseContentBlock) => T;
173
298
  _: (name: string, value: any) => T;
174
299
  }
175
300
  const visit: <T>(value: SystemContentBlock, visitor: Visitor<T>) => T;
@@ -266,6 +391,7 @@ export interface ConverseRequest {
266
391
  system?: SystemContentBlock[];
267
392
  inferenceConfig?: InferenceConfiguration;
268
393
  toolConfig?: ToolConfiguration;
394
+ guardrailConfig?: GuardrailConfiguration;
269
395
  additionalModelRequestFields?: __DocumentType;
270
396
  additionalModelResponseFieldPaths?: string[];
271
397
  }
@@ -293,11 +419,154 @@ export declare namespace ConverseOutput {
293
419
  export declare const StopReason: {
294
420
  readonly CONTENT_FILTERED: "content_filtered";
295
421
  readonly END_TURN: "end_turn";
422
+ readonly GUARDRAIL_INTERVENED: "guardrail_intervened";
296
423
  readonly MAX_TOKENS: "max_tokens";
297
424
  readonly STOP_SEQUENCE: "stop_sequence";
298
425
  readonly TOOL_USE: "tool_use";
299
426
  };
300
427
  export type StopReason = (typeof StopReason)[keyof typeof StopReason];
428
+ export declare const GuardrailContentPolicyAction: {
429
+ readonly BLOCKED: "BLOCKED";
430
+ };
431
+ export type GuardrailContentPolicyAction =
432
+ (typeof GuardrailContentPolicyAction)[keyof typeof GuardrailContentPolicyAction];
433
+ export declare const GuardrailContentFilterConfidence: {
434
+ readonly HIGH: "HIGH";
435
+ readonly LOW: "LOW";
436
+ readonly MEDIUM: "MEDIUM";
437
+ readonly NONE: "NONE";
438
+ };
439
+ export type GuardrailContentFilterConfidence =
440
+ (typeof GuardrailContentFilterConfidence)[keyof typeof GuardrailContentFilterConfidence];
441
+ export declare const GuardrailContentFilterType: {
442
+ readonly HATE: "HATE";
443
+ readonly INSULTS: "INSULTS";
444
+ readonly MISCONDUCT: "MISCONDUCT";
445
+ readonly PROMPT_ATTACK: "PROMPT_ATTACK";
446
+ readonly SEXUAL: "SEXUAL";
447
+ readonly VIOLENCE: "VIOLENCE";
448
+ };
449
+ export type GuardrailContentFilterType =
450
+ (typeof GuardrailContentFilterType)[keyof typeof GuardrailContentFilterType];
451
+ export interface GuardrailContentFilter {
452
+ type: GuardrailContentFilterType | undefined;
453
+ confidence: GuardrailContentFilterConfidence | undefined;
454
+ action: GuardrailContentPolicyAction | undefined;
455
+ }
456
+ export interface GuardrailContentPolicyAssessment {
457
+ filters: GuardrailContentFilter[] | undefined;
458
+ }
459
+ export declare const GuardrailSensitiveInformationPolicyAction: {
460
+ readonly ANONYMIZED: "ANONYMIZED";
461
+ readonly BLOCKED: "BLOCKED";
462
+ };
463
+ export type GuardrailSensitiveInformationPolicyAction =
464
+ (typeof GuardrailSensitiveInformationPolicyAction)[keyof typeof GuardrailSensitiveInformationPolicyAction];
465
+ export declare const GuardrailPiiEntityType: {
466
+ readonly ADDRESS: "ADDRESS";
467
+ readonly AGE: "AGE";
468
+ readonly AWS_ACCESS_KEY: "AWS_ACCESS_KEY";
469
+ readonly AWS_SECRET_KEY: "AWS_SECRET_KEY";
470
+ readonly CA_HEALTH_NUMBER: "CA_HEALTH_NUMBER";
471
+ readonly CA_SOCIAL_INSURANCE_NUMBER: "CA_SOCIAL_INSURANCE_NUMBER";
472
+ readonly CREDIT_DEBIT_CARD_CVV: "CREDIT_DEBIT_CARD_CVV";
473
+ readonly CREDIT_DEBIT_CARD_EXPIRY: "CREDIT_DEBIT_CARD_EXPIRY";
474
+ readonly CREDIT_DEBIT_CARD_NUMBER: "CREDIT_DEBIT_CARD_NUMBER";
475
+ readonly DRIVER_ID: "DRIVER_ID";
476
+ readonly EMAIL: "EMAIL";
477
+ readonly INTERNATIONAL_BANK_ACCOUNT_NUMBER: "INTERNATIONAL_BANK_ACCOUNT_NUMBER";
478
+ readonly IP_ADDRESS: "IP_ADDRESS";
479
+ readonly LICENSE_PLATE: "LICENSE_PLATE";
480
+ readonly MAC_ADDRESS: "MAC_ADDRESS";
481
+ readonly NAME: "NAME";
482
+ readonly PASSWORD: "PASSWORD";
483
+ readonly PHONE: "PHONE";
484
+ readonly PIN: "PIN";
485
+ readonly SWIFT_CODE: "SWIFT_CODE";
486
+ readonly UK_NATIONAL_HEALTH_SERVICE_NUMBER: "UK_NATIONAL_HEALTH_SERVICE_NUMBER";
487
+ readonly UK_NATIONAL_INSURANCE_NUMBER: "UK_NATIONAL_INSURANCE_NUMBER";
488
+ readonly UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER: "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER";
489
+ readonly URL: "URL";
490
+ readonly USERNAME: "USERNAME";
491
+ readonly US_BANK_ACCOUNT_NUMBER: "US_BANK_ACCOUNT_NUMBER";
492
+ readonly US_BANK_ROUTING_NUMBER: "US_BANK_ROUTING_NUMBER";
493
+ readonly US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER: "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER";
494
+ readonly US_PASSPORT_NUMBER: "US_PASSPORT_NUMBER";
495
+ readonly US_SOCIAL_SECURITY_NUMBER: "US_SOCIAL_SECURITY_NUMBER";
496
+ readonly VEHICLE_IDENTIFICATION_NUMBER: "VEHICLE_IDENTIFICATION_NUMBER";
497
+ };
498
+ export type GuardrailPiiEntityType =
499
+ (typeof GuardrailPiiEntityType)[keyof typeof GuardrailPiiEntityType];
500
+ export interface GuardrailPiiEntityFilter {
501
+ match: string | undefined;
502
+ type: GuardrailPiiEntityType | undefined;
503
+ action: GuardrailSensitiveInformationPolicyAction | undefined;
504
+ }
505
+ export interface GuardrailRegexFilter {
506
+ name?: string;
507
+ match?: string;
508
+ regex?: string;
509
+ action: GuardrailSensitiveInformationPolicyAction | undefined;
510
+ }
511
+ export interface GuardrailSensitiveInformationPolicyAssessment {
512
+ piiEntities: GuardrailPiiEntityFilter[] | undefined;
513
+ regexes: GuardrailRegexFilter[] | undefined;
514
+ }
515
+ export declare const GuardrailTopicPolicyAction: {
516
+ readonly BLOCKED: "BLOCKED";
517
+ };
518
+ export type GuardrailTopicPolicyAction =
519
+ (typeof GuardrailTopicPolicyAction)[keyof typeof GuardrailTopicPolicyAction];
520
+ export declare const GuardrailTopicType: {
521
+ readonly DENY: "DENY";
522
+ };
523
+ export type GuardrailTopicType =
524
+ (typeof GuardrailTopicType)[keyof typeof GuardrailTopicType];
525
+ export interface GuardrailTopic {
526
+ name: string | undefined;
527
+ type: GuardrailTopicType | undefined;
528
+ action: GuardrailTopicPolicyAction | undefined;
529
+ }
530
+ export interface GuardrailTopicPolicyAssessment {
531
+ topics: GuardrailTopic[] | undefined;
532
+ }
533
+ export declare const GuardrailWordPolicyAction: {
534
+ readonly BLOCKED: "BLOCKED";
535
+ };
536
+ export type GuardrailWordPolicyAction =
537
+ (typeof GuardrailWordPolicyAction)[keyof typeof GuardrailWordPolicyAction];
538
+ export interface GuardrailCustomWord {
539
+ match: string | undefined;
540
+ action: GuardrailWordPolicyAction | undefined;
541
+ }
542
+ export declare const GuardrailManagedWordType: {
543
+ readonly PROFANITY: "PROFANITY";
544
+ };
545
+ export type GuardrailManagedWordType =
546
+ (typeof GuardrailManagedWordType)[keyof typeof GuardrailManagedWordType];
547
+ export interface GuardrailManagedWord {
548
+ match: string | undefined;
549
+ type: GuardrailManagedWordType | undefined;
550
+ action: GuardrailWordPolicyAction | undefined;
551
+ }
552
+ export interface GuardrailWordPolicyAssessment {
553
+ customWords: GuardrailCustomWord[] | undefined;
554
+ managedWordLists: GuardrailManagedWord[] | undefined;
555
+ }
556
+ export interface GuardrailAssessment {
557
+ topicPolicy?: GuardrailTopicPolicyAssessment;
558
+ contentPolicy?: GuardrailContentPolicyAssessment;
559
+ wordPolicy?: GuardrailWordPolicyAssessment;
560
+ sensitiveInformationPolicy?: GuardrailSensitiveInformationPolicyAssessment;
561
+ }
562
+ export interface GuardrailTraceAssessment {
563
+ modelOutput?: string[];
564
+ inputAssessment?: Record<string, GuardrailAssessment>;
565
+ outputAssessments?: Record<string, GuardrailAssessment[]>;
566
+ }
567
+ export interface ConverseTrace {
568
+ guardrail?: GuardrailTraceAssessment;
569
+ }
301
570
  export interface TokenUsage {
302
571
  inputTokens: number | undefined;
303
572
  outputTokens: number | undefined;
@@ -309,6 +578,7 @@ export interface ConverseResponse {
309
578
  usage: TokenUsage | undefined;
310
579
  metrics: ConverseMetrics | undefined;
311
580
  additionalModelResponseFields?: __DocumentType;
581
+ trace?: ConverseTrace;
312
582
  }
313
583
  export declare class InternalServerException extends __BaseException {
314
584
  readonly name: "InternalServerException";
@@ -361,12 +631,25 @@ export declare class ValidationException extends __BaseException {
361
631
  opts: __ExceptionOptionType<ValidationException, __BaseException>
362
632
  );
363
633
  }
634
+ export declare const GuardrailStreamProcessingMode: {
635
+ readonly ASYNC: "async";
636
+ readonly SYNC: "sync";
637
+ };
638
+ export type GuardrailStreamProcessingMode =
639
+ (typeof GuardrailStreamProcessingMode)[keyof typeof GuardrailStreamProcessingMode];
640
+ export interface GuardrailStreamConfiguration {
641
+ guardrailIdentifier: string | undefined;
642
+ guardrailVersion: string | undefined;
643
+ trace?: GuardrailTrace;
644
+ streamProcessingMode?: GuardrailStreamProcessingMode;
645
+ }
364
646
  export interface ConverseStreamRequest {
365
647
  modelId: string | undefined;
366
648
  messages: Message[] | undefined;
367
649
  system?: SystemContentBlock[];
368
650
  inferenceConfig?: InferenceConfiguration;
369
651
  toolConfig?: ToolConfiguration;
652
+ guardrailConfig?: GuardrailStreamConfiguration;
370
653
  additionalModelRequestFields?: __DocumentType;
371
654
  additionalModelResponseFieldPaths?: string[];
372
655
  }
@@ -443,9 +726,13 @@ export interface MessageStopEvent {
443
726
  export interface ConverseStreamMetrics {
444
727
  latencyMs: number | undefined;
445
728
  }
729
+ export interface ConverseStreamTrace {
730
+ guardrail?: GuardrailTraceAssessment;
731
+ }
446
732
  export interface ConverseStreamMetadataEvent {
447
733
  usage: TokenUsage | undefined;
448
734
  metrics: ConverseStreamMetrics | undefined;
735
+ trace?: ConverseStreamTrace;
449
736
  }
450
737
  export declare class ModelStreamErrorException extends __BaseException {
451
738
  readonly name: "ModelStreamErrorException";
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.598.0",
4
+ "version": "3.602.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",
@@ -20,10 +20,10 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "5.2.0",
22
22
  "@aws-crypto/sha256-js": "5.2.0",
23
- "@aws-sdk/client-sso-oidc": "3.598.0",
24
- "@aws-sdk/client-sts": "3.598.0",
23
+ "@aws-sdk/client-sso-oidc": "3.600.0",
24
+ "@aws-sdk/client-sts": "3.600.0",
25
25
  "@aws-sdk/core": "3.598.0",
26
- "@aws-sdk/credential-provider-node": "3.598.0",
26
+ "@aws-sdk/credential-provider-node": "3.600.0",
27
27
  "@aws-sdk/middleware-host-header": "3.598.0",
28
28
  "@aws-sdk/middleware-logger": "3.598.0",
29
29
  "@aws-sdk/middleware-recursion-detection": "3.598.0",