@aws-sdk/client-bedrock-runtime 3.686.0 → 3.691.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.
@@ -16,7 +16,7 @@ export type InvokeModelCommandInputType = Pick<
16
16
  InvokeModelRequest,
17
17
  Exclude<keyof InvokeModelRequest, "body">
18
18
  > & {
19
- body: BlobPayloadInputTypes;
19
+ body?: BlobPayloadInputTypes;
20
20
  };
21
21
  export interface InvokeModelCommandInput extends InvokeModelCommandInputType {}
22
22
  export type InvokeModelCommandOutputType = Pick<
@@ -18,7 +18,7 @@ export type InvokeModelWithResponseStreamCommandInputType = Pick<
18
18
  InvokeModelWithResponseStreamRequest,
19
19
  Exclude<keyof InvokeModelWithResponseStreamRequest, "body">
20
20
  > & {
21
- body: BlobPayloadInputTypes;
21
+ body?: BlobPayloadInputTypes;
22
22
  };
23
23
  export interface InvokeModelWithResponseStreamCommandInput
24
24
  extends InvokeModelWithResponseStreamCommandInputType {}
@@ -17,7 +17,7 @@ export type GuardrailContentQualifier =
17
17
  (typeof GuardrailContentQualifier)[keyof typeof GuardrailContentQualifier];
18
18
  export interface GuardrailTextBlock {
19
19
  text: string | undefined;
20
- qualifiers?: GuardrailContentQualifier[];
20
+ qualifiers?: GuardrailContentQualifier[] | undefined;
21
21
  }
22
22
  export type GuardrailContentBlock =
23
23
  | GuardrailContentBlock.TextMember
@@ -89,7 +89,7 @@ export type GuardrailContentFilterType =
89
89
  export interface GuardrailContentFilter {
90
90
  type: GuardrailContentFilterType | undefined;
91
91
  confidence: GuardrailContentFilterConfidence | undefined;
92
- filterStrength?: GuardrailContentFilterStrength;
92
+ filterStrength?: GuardrailContentFilterStrength | undefined;
93
93
  action: GuardrailContentPolicyAction | undefined;
94
94
  }
95
95
  export interface GuardrailContentPolicyAssessment {
@@ -114,14 +114,14 @@ export interface GuardrailContextualGroundingFilter {
114
114
  action: GuardrailContextualGroundingPolicyAction | undefined;
115
115
  }
116
116
  export interface GuardrailContextualGroundingPolicyAssessment {
117
- filters?: GuardrailContextualGroundingFilter[];
117
+ filters?: GuardrailContextualGroundingFilter[] | undefined;
118
118
  }
119
119
  export interface GuardrailTextCharactersCoverage {
120
- guarded?: number;
121
- total?: number;
120
+ guarded?: number | undefined;
121
+ total?: number | undefined;
122
122
  }
123
123
  export interface GuardrailCoverage {
124
- textCharacters?: GuardrailTextCharactersCoverage;
124
+ textCharacters?: GuardrailTextCharactersCoverage | undefined;
125
125
  }
126
126
  export interface GuardrailUsage {
127
127
  topicPolicyUnits: number | undefined;
@@ -132,9 +132,9 @@ export interface GuardrailUsage {
132
132
  contextualGroundingPolicyUnits: number | undefined;
133
133
  }
134
134
  export interface GuardrailInvocationMetrics {
135
- guardrailProcessingLatency?: number;
136
- usage?: GuardrailUsage;
137
- guardrailCoverage?: GuardrailCoverage;
135
+ guardrailProcessingLatency?: number | undefined;
136
+ usage?: GuardrailUsage | undefined;
137
+ guardrailCoverage?: GuardrailCoverage | undefined;
138
138
  }
139
139
  export declare const GuardrailSensitiveInformationPolicyAction: {
140
140
  readonly ANONYMIZED: "ANONYMIZED";
@@ -183,9 +183,9 @@ export interface GuardrailPiiEntityFilter {
183
183
  action: GuardrailSensitiveInformationPolicyAction | undefined;
184
184
  }
185
185
  export interface GuardrailRegexFilter {
186
- name?: string;
187
- match?: string;
188
- regex?: string;
186
+ name?: string | undefined;
187
+ match?: string | undefined;
188
+ regex?: string | undefined;
189
189
  action: GuardrailSensitiveInformationPolicyAction | undefined;
190
190
  }
191
191
  export interface GuardrailSensitiveInformationPolicyAssessment {
@@ -234,22 +234,26 @@ export interface GuardrailWordPolicyAssessment {
234
234
  managedWordLists: GuardrailManagedWord[] | undefined;
235
235
  }
236
236
  export interface GuardrailAssessment {
237
- topicPolicy?: GuardrailTopicPolicyAssessment;
238
- contentPolicy?: GuardrailContentPolicyAssessment;
239
- wordPolicy?: GuardrailWordPolicyAssessment;
240
- sensitiveInformationPolicy?: GuardrailSensitiveInformationPolicyAssessment;
241
- contextualGroundingPolicy?: GuardrailContextualGroundingPolicyAssessment;
242
- invocationMetrics?: GuardrailInvocationMetrics;
237
+ topicPolicy?: GuardrailTopicPolicyAssessment | undefined;
238
+ contentPolicy?: GuardrailContentPolicyAssessment | undefined;
239
+ wordPolicy?: GuardrailWordPolicyAssessment | undefined;
240
+ sensitiveInformationPolicy?:
241
+ | GuardrailSensitiveInformationPolicyAssessment
242
+ | undefined;
243
+ contextualGroundingPolicy?:
244
+ | GuardrailContextualGroundingPolicyAssessment
245
+ | undefined;
246
+ invocationMetrics?: GuardrailInvocationMetrics | undefined;
243
247
  }
244
248
  export interface GuardrailOutputContent {
245
- text?: string;
249
+ text?: string | undefined;
246
250
  }
247
251
  export interface ApplyGuardrailResponse {
248
252
  usage: GuardrailUsage | undefined;
249
253
  action: GuardrailAction | undefined;
250
254
  outputs: GuardrailOutputContent[] | undefined;
251
255
  assessments: GuardrailAssessment[] | undefined;
252
- guardrailCoverage?: GuardrailCoverage;
256
+ guardrailCoverage?: GuardrailCoverage | undefined;
253
257
  }
254
258
  export declare class InternalServerException extends __BaseException {
255
259
  readonly name: "InternalServerException";
@@ -295,13 +299,13 @@ export type GuardrailTrace =
295
299
  export interface GuardrailConfiguration {
296
300
  guardrailIdentifier: string | undefined;
297
301
  guardrailVersion: string | undefined;
298
- trace?: GuardrailTrace;
302
+ trace?: GuardrailTrace | undefined;
299
303
  }
300
304
  export interface InferenceConfiguration {
301
- maxTokens?: number;
302
- temperature?: number;
303
- topP?: number;
304
- stopSequences?: string[];
305
+ maxTokens?: number | undefined;
306
+ temperature?: number | undefined;
307
+ topP?: number | undefined;
308
+ stopSequences?: string[] | undefined;
305
309
  }
306
310
  export declare const DocumentFormat: {
307
311
  readonly CSV: "csv";
@@ -348,7 +352,7 @@ export type GuardrailConverseContentQualifier =
348
352
  (typeof GuardrailConverseContentQualifier)[keyof typeof GuardrailConverseContentQualifier];
349
353
  export interface GuardrailConverseTextBlock {
350
354
  text: string | undefined;
351
- qualifiers?: GuardrailConverseContentQualifier[];
355
+ qualifiers?: GuardrailConverseContentQualifier[] | undefined;
352
356
  }
353
357
  export type GuardrailConverseContentBlock =
354
358
  | GuardrailConverseContentBlock.TextMember
@@ -458,7 +462,7 @@ export type ToolResultStatus =
458
462
  export interface ToolResultBlock {
459
463
  toolUseId: string | undefined;
460
464
  content: ToolResultContentBlock[] | undefined;
461
- status?: ToolResultStatus;
465
+ status?: ToolResultStatus | undefined;
462
466
  }
463
467
  export interface ToolUseBlock {
464
468
  toolUseId: string | undefined;
@@ -558,6 +562,24 @@ export interface Message {
558
562
  role: ConversationRole | undefined;
559
563
  content: ContentBlock[] | undefined;
560
564
  }
565
+ export type PromptVariableValues =
566
+ | PromptVariableValues.TextMember
567
+ | PromptVariableValues.$UnknownMember;
568
+ export declare namespace PromptVariableValues {
569
+ interface TextMember {
570
+ text: string;
571
+ $unknown?: never;
572
+ }
573
+ interface $UnknownMember {
574
+ text?: never;
575
+ $unknown: [string, any];
576
+ }
577
+ interface Visitor<T> {
578
+ text: (value: string) => T;
579
+ _: (name: string, value: any) => T;
580
+ }
581
+ const visit: <T>(value: PromptVariableValues, visitor: Visitor<T>) => T;
582
+ }
561
583
  export type SystemContentBlock =
562
584
  | SystemContentBlock.GuardContentMember
563
585
  | SystemContentBlock.TextMember
@@ -648,7 +670,7 @@ export declare namespace ToolInputSchema {
648
670
  }
649
671
  export interface ToolSpecification {
650
672
  name: string | undefined;
651
- description?: string;
673
+ description?: string | undefined;
652
674
  inputSchema: ToolInputSchema | undefined;
653
675
  }
654
676
  export type Tool = Tool.ToolSpecMember | Tool.$UnknownMember;
@@ -669,17 +691,18 @@ export declare namespace Tool {
669
691
  }
670
692
  export interface ToolConfiguration {
671
693
  tools: Tool[] | undefined;
672
- toolChoice?: ToolChoice;
694
+ toolChoice?: ToolChoice | undefined;
673
695
  }
674
696
  export interface ConverseRequest {
675
697
  modelId: string | undefined;
676
- messages: Message[] | undefined;
677
- system?: SystemContentBlock[];
678
- inferenceConfig?: InferenceConfiguration;
679
- toolConfig?: ToolConfiguration;
680
- guardrailConfig?: GuardrailConfiguration;
681
- additionalModelRequestFields?: __DocumentType;
682
- additionalModelResponseFieldPaths?: string[];
698
+ messages?: Message[] | undefined;
699
+ system?: SystemContentBlock[] | undefined;
700
+ inferenceConfig?: InferenceConfiguration | undefined;
701
+ toolConfig?: ToolConfiguration | undefined;
702
+ guardrailConfig?: GuardrailConfiguration | undefined;
703
+ additionalModelRequestFields?: __DocumentType | undefined;
704
+ promptVariables?: Record<string, PromptVariableValues> | undefined;
705
+ additionalModelResponseFieldPaths?: string[] | undefined;
683
706
  }
684
707
  export interface ConverseMetrics {
685
708
  latencyMs: number | undefined;
@@ -712,12 +735,12 @@ export declare const StopReason: {
712
735
  };
713
736
  export type StopReason = (typeof StopReason)[keyof typeof StopReason];
714
737
  export interface GuardrailTraceAssessment {
715
- modelOutput?: string[];
716
- inputAssessment?: Record<string, GuardrailAssessment>;
717
- outputAssessments?: Record<string, GuardrailAssessment[]>;
738
+ modelOutput?: string[] | undefined;
739
+ inputAssessment?: Record<string, GuardrailAssessment> | undefined;
740
+ outputAssessments?: Record<string, GuardrailAssessment[]> | undefined;
718
741
  }
719
742
  export interface ConverseTrace {
720
- guardrail?: GuardrailTraceAssessment;
743
+ guardrail?: GuardrailTraceAssessment | undefined;
721
744
  }
722
745
  export interface TokenUsage {
723
746
  inputTokens: number | undefined;
@@ -729,14 +752,14 @@ export interface ConverseResponse {
729
752
  stopReason: StopReason | undefined;
730
753
  usage: TokenUsage | undefined;
731
754
  metrics: ConverseMetrics | undefined;
732
- additionalModelResponseFields?: __DocumentType;
733
- trace?: ConverseTrace;
755
+ additionalModelResponseFields?: __DocumentType | undefined;
756
+ trace?: ConverseTrace | undefined;
734
757
  }
735
758
  export declare class ModelErrorException extends __BaseException {
736
759
  readonly name: "ModelErrorException";
737
760
  readonly $fault: "client";
738
- originalStatusCode?: number;
739
- resourceName?: string;
761
+ originalStatusCode?: number | undefined;
762
+ resourceName?: string | undefined;
740
763
  constructor(
741
764
  opts: __ExceptionOptionType<ModelErrorException, __BaseException>
742
765
  );
@@ -772,18 +795,19 @@ export type GuardrailStreamProcessingMode =
772
795
  export interface GuardrailStreamConfiguration {
773
796
  guardrailIdentifier: string | undefined;
774
797
  guardrailVersion: string | undefined;
775
- trace?: GuardrailTrace;
776
- streamProcessingMode?: GuardrailStreamProcessingMode;
798
+ trace?: GuardrailTrace | undefined;
799
+ streamProcessingMode?: GuardrailStreamProcessingMode | undefined;
777
800
  }
778
801
  export interface ConverseStreamRequest {
779
802
  modelId: string | undefined;
780
- messages: Message[] | undefined;
781
- system?: SystemContentBlock[];
782
- inferenceConfig?: InferenceConfiguration;
783
- toolConfig?: ToolConfiguration;
784
- guardrailConfig?: GuardrailStreamConfiguration;
785
- additionalModelRequestFields?: __DocumentType;
786
- additionalModelResponseFieldPaths?: string[];
803
+ messages?: Message[] | undefined;
804
+ system?: SystemContentBlock[] | undefined;
805
+ inferenceConfig?: InferenceConfiguration | undefined;
806
+ toolConfig?: ToolConfiguration | undefined;
807
+ guardrailConfig?: GuardrailStreamConfiguration | undefined;
808
+ additionalModelRequestFields?: __DocumentType | undefined;
809
+ promptVariables?: Record<string, PromptVariableValues> | undefined;
810
+ additionalModelResponseFieldPaths?: string[] | undefined;
787
811
  }
788
812
  export interface ToolUseBlockDelta {
789
813
  input: string | undefined;
@@ -853,24 +877,24 @@ export interface MessageStartEvent {
853
877
  }
854
878
  export interface MessageStopEvent {
855
879
  stopReason: StopReason | undefined;
856
- additionalModelResponseFields?: __DocumentType;
880
+ additionalModelResponseFields?: __DocumentType | undefined;
857
881
  }
858
882
  export interface ConverseStreamMetrics {
859
883
  latencyMs: number | undefined;
860
884
  }
861
885
  export interface ConverseStreamTrace {
862
- guardrail?: GuardrailTraceAssessment;
886
+ guardrail?: GuardrailTraceAssessment | undefined;
863
887
  }
864
888
  export interface ConverseStreamMetadataEvent {
865
889
  usage: TokenUsage | undefined;
866
890
  metrics: ConverseStreamMetrics | undefined;
867
- trace?: ConverseStreamTrace;
891
+ trace?: ConverseStreamTrace | undefined;
868
892
  }
869
893
  export declare class ModelStreamErrorException extends __BaseException {
870
894
  readonly name: "ModelStreamErrorException";
871
895
  readonly $fault: "client";
872
- originalStatusCode?: number;
873
- originalMessage?: string;
896
+ originalStatusCode?: number | undefined;
897
+ originalMessage?: string | undefined;
874
898
  constructor(
875
899
  opts: __ExceptionOptionType<ModelStreamErrorException, __BaseException>
876
900
  );
@@ -1074,7 +1098,7 @@ export declare namespace ConverseStreamOutput {
1074
1098
  const visit: <T>(value: ConverseStreamOutput, visitor: Visitor<T>) => T;
1075
1099
  }
1076
1100
  export interface ConverseStreamResponse {
1077
- stream?: AsyncIterable<ConverseStreamOutput>;
1101
+ stream?: AsyncIterable<ConverseStreamOutput> | undefined;
1078
1102
  }
1079
1103
  export declare const Trace: {
1080
1104
  readonly DISABLED: "DISABLED";
@@ -1082,29 +1106,29 @@ export declare const Trace: {
1082
1106
  };
1083
1107
  export type Trace = (typeof Trace)[keyof typeof Trace];
1084
1108
  export interface InvokeModelRequest {
1085
- body: Uint8Array | undefined;
1086
- contentType?: string;
1087
- accept?: string;
1109
+ body?: Uint8Array | undefined;
1110
+ contentType?: string | undefined;
1111
+ accept?: string | undefined;
1088
1112
  modelId: string | undefined;
1089
- trace?: Trace;
1090
- guardrailIdentifier?: string;
1091
- guardrailVersion?: string;
1113
+ trace?: Trace | undefined;
1114
+ guardrailIdentifier?: string | undefined;
1115
+ guardrailVersion?: string | undefined;
1092
1116
  }
1093
1117
  export interface InvokeModelResponse {
1094
1118
  body: Uint8Array | undefined;
1095
1119
  contentType: string | undefined;
1096
1120
  }
1097
1121
  export interface InvokeModelWithResponseStreamRequest {
1098
- body: Uint8Array | undefined;
1099
- contentType?: string;
1100
- accept?: string;
1122
+ body?: Uint8Array | undefined;
1123
+ contentType?: string | undefined;
1124
+ accept?: string | undefined;
1101
1125
  modelId: string | undefined;
1102
- trace?: Trace;
1103
- guardrailIdentifier?: string;
1104
- guardrailVersion?: string;
1126
+ trace?: Trace | undefined;
1127
+ guardrailIdentifier?: string | undefined;
1128
+ guardrailVersion?: string | undefined;
1105
1129
  }
1106
1130
  export interface PayloadPart {
1107
- bytes?: Uint8Array;
1131
+ bytes?: Uint8Array | undefined;
1108
1132
  }
1109
1133
  export type ResponseStream =
1110
1134
  | ResponseStream.ChunkMember
@@ -1212,6 +1236,12 @@ export interface InvokeModelWithResponseStreamResponse {
1212
1236
  body: AsyncIterable<ResponseStream> | undefined;
1213
1237
  contentType: string | undefined;
1214
1238
  }
1239
+ export declare const ConverseRequestFilterSensitiveLog: (
1240
+ obj: ConverseRequest
1241
+ ) => any;
1242
+ export declare const ConverseStreamRequestFilterSensitiveLog: (
1243
+ obj: ConverseStreamRequest
1244
+ ) => any;
1215
1245
  export declare const ConverseStreamOutputFilterSensitiveLog: (
1216
1246
  obj: ConverseStreamOutput
1217
1247
  ) => any;
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.686.0",
4
+ "version": "3.691.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,19 +20,19 @@
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.686.0",
24
- "@aws-sdk/client-sts": "3.686.0",
25
- "@aws-sdk/core": "3.686.0",
26
- "@aws-sdk/credential-provider-node": "3.686.0",
23
+ "@aws-sdk/client-sso-oidc": "3.691.0",
24
+ "@aws-sdk/client-sts": "3.691.0",
25
+ "@aws-sdk/core": "3.691.0",
26
+ "@aws-sdk/credential-provider-node": "3.691.0",
27
27
  "@aws-sdk/middleware-host-header": "3.686.0",
28
28
  "@aws-sdk/middleware-logger": "3.686.0",
29
29
  "@aws-sdk/middleware-recursion-detection": "3.686.0",
30
- "@aws-sdk/middleware-user-agent": "3.686.0",
30
+ "@aws-sdk/middleware-user-agent": "3.691.0",
31
31
  "@aws-sdk/region-config-resolver": "3.686.0",
32
32
  "@aws-sdk/types": "3.686.0",
33
33
  "@aws-sdk/util-endpoints": "3.686.0",
34
34
  "@aws-sdk/util-user-agent-browser": "3.686.0",
35
- "@aws-sdk/util-user-agent-node": "3.686.0",
35
+ "@aws-sdk/util-user-agent-node": "3.691.0",
36
36
  "@smithy/config-resolver": "^3.0.10",
37
37
  "@smithy/core": "^2.5.1",
38
38
  "@smithy/eventstream-serde-browser": "^3.0.11",