@aws-sdk/client-bedrock-runtime 3.751.0 → 3.758.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
@@ -33,6 +33,8 @@ __export(src_exports, {
33
33
  ConflictException: () => ConflictException,
34
34
  ContentBlock: () => ContentBlock,
35
35
  ContentBlockDelta: () => ContentBlockDelta,
36
+ ContentBlockDeltaEventFilterSensitiveLog: () => ContentBlockDeltaEventFilterSensitiveLog,
37
+ ContentBlockDeltaFilterSensitiveLog: () => ContentBlockDeltaFilterSensitiveLog,
36
38
  ContentBlockFilterSensitiveLog: () => ContentBlockFilterSensitiveLog,
37
39
  ContentBlockStart: () => ContentBlockStart,
38
40
  ConversationRole: () => ConversationRole,
@@ -99,6 +101,11 @@ __export(src_exports, {
99
101
  PayloadPartFilterSensitiveLog: () => PayloadPartFilterSensitiveLog,
100
102
  PerformanceConfigLatency: () => PerformanceConfigLatency,
101
103
  PromptVariableValues: () => PromptVariableValues,
104
+ ReasoningContentBlock: () => ReasoningContentBlock,
105
+ ReasoningContentBlockDelta: () => ReasoningContentBlockDelta,
106
+ ReasoningContentBlockDeltaFilterSensitiveLog: () => ReasoningContentBlockDeltaFilterSensitiveLog,
107
+ ReasoningContentBlockFilterSensitiveLog: () => ReasoningContentBlockFilterSensitiveLog,
108
+ ReasoningTextBlockFilterSensitiveLog: () => ReasoningTextBlockFilterSensitiveLog,
102
109
  ResourceNotFoundException: () => ResourceNotFoundException,
103
110
  ResponseStream: () => ResponseStream,
104
111
  ResponseStreamFilterSensitiveLog: () => ResponseStreamFilterSensitiveLog,
@@ -640,6 +647,16 @@ var ImageSource;
640
647
  return visitor._(value.$unknown[0], value.$unknown[1]);
641
648
  }, "visit");
642
649
  })(ImageSource || (ImageSource = {}));
650
+ var ReasoningContentBlock;
651
+ ((ReasoningContentBlock2) => {
652
+ ReasoningContentBlock2.visit = /* @__PURE__ */ __name((value, visitor) => {
653
+ if (value.reasoningText !== void 0)
654
+ return visitor.reasoningText(value.reasoningText);
655
+ if (value.redactedContent !== void 0)
656
+ return visitor.redactedContent(value.redactedContent);
657
+ return visitor._(value.$unknown[0], value.$unknown[1]);
658
+ }, "visit");
659
+ })(ReasoningContentBlock || (ReasoningContentBlock = {}));
643
660
  var VideoFormat = {
644
661
  FLV: "flv",
645
662
  MKV: "mkv",
@@ -698,6 +715,8 @@ var ContentBlock;
698
715
  return visitor.toolResult(value.toolResult);
699
716
  if (value.guardContent !== void 0)
700
717
  return visitor.guardContent(value.guardContent);
718
+ if (value.reasoningContent !== void 0)
719
+ return visitor.reasoningContent(value.reasoningContent);
701
720
  return visitor._(value.$unknown[0], value.$unknown[1]);
702
721
  }, "visit");
703
722
  })(ContentBlock || (ContentBlock = {}));
@@ -842,13 +861,27 @@ var GuardrailStreamProcessingMode = {
842
861
  ASYNC: "async",
843
862
  SYNC: "sync"
844
863
  };
864
+ var ReasoningContentBlockDelta;
865
+ ((ReasoningContentBlockDelta3) => {
866
+ ReasoningContentBlockDelta3.visit = /* @__PURE__ */ __name((value, visitor) => {
867
+ if (value.text !== void 0)
868
+ return visitor.text(value.text);
869
+ if (value.redactedContent !== void 0)
870
+ return visitor.redactedContent(value.redactedContent);
871
+ if (value.signature !== void 0)
872
+ return visitor.signature(value.signature);
873
+ return visitor._(value.$unknown[0], value.$unknown[1]);
874
+ }, "visit");
875
+ })(ReasoningContentBlockDelta || (ReasoningContentBlockDelta = {}));
845
876
  var ContentBlockDelta;
846
- ((ContentBlockDelta2) => {
847
- ContentBlockDelta2.visit = /* @__PURE__ */ __name((value, visitor) => {
877
+ ((ContentBlockDelta3) => {
878
+ ContentBlockDelta3.visit = /* @__PURE__ */ __name((value, visitor) => {
848
879
  if (value.text !== void 0)
849
880
  return visitor.text(value.text);
850
881
  if (value.toolUse !== void 0)
851
882
  return visitor.toolUse(value.toolUse);
883
+ if (value.reasoningContent !== void 0)
884
+ return visitor.reasoningContent(value.reasoningContent);
852
885
  return visitor._(value.$unknown[0], value.$unknown[1]);
853
886
  }, "visit");
854
887
  })(ContentBlockDelta || (ContentBlockDelta = {}));
@@ -1003,6 +1036,17 @@ var GuardrailConverseContentBlockFilterSensitiveLog = /* @__PURE__ */ __name((ob
1003
1036
  if (obj.$unknown !== void 0)
1004
1037
  return { [obj.$unknown[0]]: "UNKNOWN" };
1005
1038
  }, "GuardrailConverseContentBlockFilterSensitiveLog");
1039
+ var ReasoningTextBlockFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
1040
+ ...obj
1041
+ }), "ReasoningTextBlockFilterSensitiveLog");
1042
+ var ReasoningContentBlockFilterSensitiveLog = /* @__PURE__ */ __name((obj) => {
1043
+ if (obj.reasoningText !== void 0)
1044
+ return { reasoningText: import_smithy_client.SENSITIVE_STRING };
1045
+ if (obj.redactedContent !== void 0)
1046
+ return { redactedContent: obj.redactedContent };
1047
+ if (obj.$unknown !== void 0)
1048
+ return { [obj.$unknown[0]]: "UNKNOWN" };
1049
+ }, "ReasoningContentBlockFilterSensitiveLog");
1006
1050
  var ContentBlockFilterSensitiveLog = /* @__PURE__ */ __name((obj) => {
1007
1051
  if (obj.text !== void 0)
1008
1052
  return { text: obj.text };
@@ -1018,6 +1062,8 @@ var ContentBlockFilterSensitiveLog = /* @__PURE__ */ __name((obj) => {
1018
1062
  return { toolResult: obj.toolResult };
1019
1063
  if (obj.guardContent !== void 0)
1020
1064
  return { guardContent: GuardrailConverseContentBlockFilterSensitiveLog(obj.guardContent) };
1065
+ if (obj.reasoningContent !== void 0)
1066
+ return { reasoningContent: import_smithy_client.SENSITIVE_STRING };
1021
1067
  if (obj.$unknown !== void 0)
1022
1068
  return { [obj.$unknown[0]]: "UNKNOWN" };
1023
1069
  }, "ContentBlockFilterSensitiveLog");
@@ -1059,13 +1105,37 @@ var ConverseStreamRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
1059
1105
  ...obj.promptVariables && { promptVariables: import_smithy_client.SENSITIVE_STRING },
1060
1106
  ...obj.requestMetadata && { requestMetadata: import_smithy_client.SENSITIVE_STRING }
1061
1107
  }), "ConverseStreamRequestFilterSensitiveLog");
1108
+ var ReasoningContentBlockDeltaFilterSensitiveLog = /* @__PURE__ */ __name((obj) => {
1109
+ if (obj.text !== void 0)
1110
+ return { text: obj.text };
1111
+ if (obj.redactedContent !== void 0)
1112
+ return { redactedContent: obj.redactedContent };
1113
+ if (obj.signature !== void 0)
1114
+ return { signature: obj.signature };
1115
+ if (obj.$unknown !== void 0)
1116
+ return { [obj.$unknown[0]]: "UNKNOWN" };
1117
+ }, "ReasoningContentBlockDeltaFilterSensitiveLog");
1118
+ var ContentBlockDeltaFilterSensitiveLog = /* @__PURE__ */ __name((obj) => {
1119
+ if (obj.text !== void 0)
1120
+ return { text: obj.text };
1121
+ if (obj.toolUse !== void 0)
1122
+ return { toolUse: obj.toolUse };
1123
+ if (obj.reasoningContent !== void 0)
1124
+ return { reasoningContent: import_smithy_client.SENSITIVE_STRING };
1125
+ if (obj.$unknown !== void 0)
1126
+ return { [obj.$unknown[0]]: "UNKNOWN" };
1127
+ }, "ContentBlockDeltaFilterSensitiveLog");
1128
+ var ContentBlockDeltaEventFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
1129
+ ...obj,
1130
+ ...obj.delta && { delta: ContentBlockDeltaFilterSensitiveLog(obj.delta) }
1131
+ }), "ContentBlockDeltaEventFilterSensitiveLog");
1062
1132
  var ConverseStreamOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => {
1063
1133
  if (obj.messageStart !== void 0)
1064
1134
  return { messageStart: obj.messageStart };
1065
1135
  if (obj.contentBlockStart !== void 0)
1066
1136
  return { contentBlockStart: obj.contentBlockStart };
1067
1137
  if (obj.contentBlockDelta !== void 0)
1068
- return { contentBlockDelta: obj.contentBlockDelta };
1138
+ return { contentBlockDelta: ContentBlockDeltaEventFilterSensitiveLog(obj.contentBlockDelta) };
1069
1139
  if (obj.contentBlockStop !== void 0)
1070
1140
  return { contentBlockStop: obj.contentBlockStop };
1071
1141
  if (obj.messageStop !== void 0)
@@ -1738,7 +1808,7 @@ var de_ResponseStream = /* @__PURE__ */ __name((output, context) => {
1738
1808
  var de_ContentBlockDeltaEvent_event = /* @__PURE__ */ __name(async (output, context) => {
1739
1809
  const contents = {};
1740
1810
  const data = await (0, import_core2.parseJsonBody)(output.body, context);
1741
- Object.assign(contents, (0, import_smithy_client._json)(data));
1811
+ Object.assign(contents, de_ContentBlockDeltaEvent(data, context));
1742
1812
  return contents;
1743
1813
  }, "de_ContentBlockDeltaEvent_event");
1744
1814
  var de_ContentBlockStartEvent_event = /* @__PURE__ */ __name(async (output, context) => {
@@ -1824,6 +1894,7 @@ var se_ContentBlock = /* @__PURE__ */ __name((input, context) => {
1824
1894
  document: (value) => ({ document: se_DocumentBlock(value, context) }),
1825
1895
  guardContent: (value) => ({ guardContent: se_GuardrailConverseContentBlock(value, context) }),
1826
1896
  image: (value) => ({ image: se_ImageBlock(value, context) }),
1897
+ reasoningContent: (value) => ({ reasoningContent: se_ReasoningContentBlock(value, context) }),
1827
1898
  text: (value) => ({ text: value }),
1828
1899
  toolResult: (value) => ({ toolResult: se_ToolResultBlock(value, context) }),
1829
1900
  toolUse: (value) => ({ toolUse: se_ToolUseBlock(value, context) }),
@@ -1926,6 +1997,13 @@ var se_Messages = /* @__PURE__ */ __name((input, context) => {
1926
1997
  var se_ModelInputPayload = /* @__PURE__ */ __name((input, context) => {
1927
1998
  return input;
1928
1999
  }, "se_ModelInputPayload");
2000
+ var se_ReasoningContentBlock = /* @__PURE__ */ __name((input, context) => {
2001
+ return ReasoningContentBlock.visit(input, {
2002
+ reasoningText: (value) => ({ reasoningText: (0, import_smithy_client._json)(value) }),
2003
+ redactedContent: (value) => ({ redactedContent: context.base64Encoder(value) }),
2004
+ _: (name, value) => ({ [name]: value })
2005
+ });
2006
+ }, "se_ReasoningContentBlock");
1929
2007
  var se_SystemContentBlock = /* @__PURE__ */ __name((input, context) => {
1930
2008
  return SystemContentBlock.visit(input, {
1931
2009
  guardContent: (value) => ({ guardContent: se_GuardrailConverseContentBlock(value, context) }),
@@ -2048,6 +2126,11 @@ var de_ContentBlock = /* @__PURE__ */ __name((output, context) => {
2048
2126
  image: de_ImageBlock(output.image, context)
2049
2127
  };
2050
2128
  }
2129
+ if (output.reasoningContent != null) {
2130
+ return {
2131
+ reasoningContent: de_ReasoningContentBlock((0, import_core2.awsExpectUnion)(output.reasoningContent), context)
2132
+ };
2133
+ }
2051
2134
  if ((0, import_smithy_client.expectString)(output.text) !== void 0) {
2052
2135
  return { text: (0, import_smithy_client.expectString)(output.text) };
2053
2136
  }
@@ -2068,6 +2151,28 @@ var de_ContentBlock = /* @__PURE__ */ __name((output, context) => {
2068
2151
  }
2069
2152
  return { $unknown: Object.entries(output)[0] };
2070
2153
  }, "de_ContentBlock");
2154
+ var de_ContentBlockDelta = /* @__PURE__ */ __name((output, context) => {
2155
+ if (output.reasoningContent != null) {
2156
+ return {
2157
+ reasoningContent: de_ReasoningContentBlockDelta((0, import_core2.awsExpectUnion)(output.reasoningContent), context)
2158
+ };
2159
+ }
2160
+ if ((0, import_smithy_client.expectString)(output.text) !== void 0) {
2161
+ return { text: (0, import_smithy_client.expectString)(output.text) };
2162
+ }
2163
+ if (output.toolUse != null) {
2164
+ return {
2165
+ toolUse: (0, import_smithy_client._json)(output.toolUse)
2166
+ };
2167
+ }
2168
+ return { $unknown: Object.entries(output)[0] };
2169
+ }, "de_ContentBlockDelta");
2170
+ var de_ContentBlockDeltaEvent = /* @__PURE__ */ __name((output, context) => {
2171
+ return (0, import_smithy_client.take)(output, {
2172
+ contentBlockIndex: import_smithy_client.expectInt32,
2173
+ delta: (_) => de_ContentBlockDelta((0, import_core2.awsExpectUnion)(_), context)
2174
+ });
2175
+ }, "de_ContentBlockDeltaEvent");
2071
2176
  var de_ContentBlocks = /* @__PURE__ */ __name((output, context) => {
2072
2177
  const retVal = (output || []).filter((e) => e != null).map((entry) => {
2073
2178
  return de_ContentBlock((0, import_core2.awsExpectUnion)(entry), context);
@@ -2235,6 +2340,33 @@ var de_PayloadPart = /* @__PURE__ */ __name((output, context) => {
2235
2340
  bytes: context.base64Decoder
2236
2341
  });
2237
2342
  }, "de_PayloadPart");
2343
+ var de_ReasoningContentBlock = /* @__PURE__ */ __name((output, context) => {
2344
+ if (output.reasoningText != null) {
2345
+ return {
2346
+ reasoningText: (0, import_smithy_client._json)(output.reasoningText)
2347
+ };
2348
+ }
2349
+ if (output.redactedContent != null) {
2350
+ return {
2351
+ redactedContent: context.base64Decoder(output.redactedContent)
2352
+ };
2353
+ }
2354
+ return { $unknown: Object.entries(output)[0] };
2355
+ }, "de_ReasoningContentBlock");
2356
+ var de_ReasoningContentBlockDelta = /* @__PURE__ */ __name((output, context) => {
2357
+ if (output.redactedContent != null) {
2358
+ return {
2359
+ redactedContent: context.base64Decoder(output.redactedContent)
2360
+ };
2361
+ }
2362
+ if ((0, import_smithy_client.expectString)(output.signature) !== void 0) {
2363
+ return { signature: (0, import_smithy_client.expectString)(output.signature) };
2364
+ }
2365
+ if ((0, import_smithy_client.expectString)(output.text) !== void 0) {
2366
+ return { text: (0, import_smithy_client.expectString)(output.text) };
2367
+ }
2368
+ return { $unknown: Object.entries(output)[0] };
2369
+ }, "de_ReasoningContentBlockDelta");
2238
2370
  var de_ToolResultBlock = /* @__PURE__ */ __name((output, context) => {
2239
2371
  return (0, import_smithy_client.take)(output, {
2240
2372
  content: (_) => de_ToolResultContentBlocks(_, context),
@@ -2538,6 +2670,7 @@ var paginateListAsyncInvokes = (0, import_core.createPaginator)(BedrockRuntimeCl
2538
2670
  GuardrailConverseContentBlock,
2539
2671
  ImageFormat,
2540
2672
  ImageSource,
2673
+ ReasoningContentBlock,
2541
2674
  VideoFormat,
2542
2675
  VideoSource,
2543
2676
  ToolResultContentBlock,
@@ -2556,6 +2689,7 @@ var paginateListAsyncInvokes = (0, import_core.createPaginator)(BedrockRuntimeCl
2556
2689
  ModelNotReadyException,
2557
2690
  ModelTimeoutException,
2558
2691
  GuardrailStreamProcessingMode,
2692
+ ReasoningContentBlockDelta,
2559
2693
  ContentBlockDelta,
2560
2694
  ContentBlockStart,
2561
2695
  ModelStreamErrorException,
@@ -2573,6 +2707,8 @@ var paginateListAsyncInvokes = (0, import_core.createPaginator)(BedrockRuntimeCl
2573
2707
  GuardrailConverseImageSourceFilterSensitiveLog,
2574
2708
  GuardrailConverseImageBlockFilterSensitiveLog,
2575
2709
  GuardrailConverseContentBlockFilterSensitiveLog,
2710
+ ReasoningTextBlockFilterSensitiveLog,
2711
+ ReasoningContentBlockFilterSensitiveLog,
2576
2712
  ContentBlockFilterSensitiveLog,
2577
2713
  MessageFilterSensitiveLog,
2578
2714
  SystemContentBlockFilterSensitiveLog,
@@ -2580,6 +2716,9 @@ var paginateListAsyncInvokes = (0, import_core.createPaginator)(BedrockRuntimeCl
2580
2716
  ConverseOutputFilterSensitiveLog,
2581
2717
  ConverseResponseFilterSensitiveLog,
2582
2718
  ConverseStreamRequestFilterSensitiveLog,
2719
+ ReasoningContentBlockDeltaFilterSensitiveLog,
2720
+ ContentBlockDeltaFilterSensitiveLog,
2721
+ ContentBlockDeltaEventFilterSensitiveLog,
2583
2722
  ConverseStreamOutputFilterSensitiveLog,
2584
2723
  ConverseStreamResponseFilterSensitiveLog,
2585
2724
  InvokeModelRequestFilterSensitiveLog,
@@ -295,6 +295,16 @@ export var ImageSource;
295
295
  return visitor._(value.$unknown[0], value.$unknown[1]);
296
296
  };
297
297
  })(ImageSource || (ImageSource = {}));
298
+ export var ReasoningContentBlock;
299
+ (function (ReasoningContentBlock) {
300
+ ReasoningContentBlock.visit = (value, visitor) => {
301
+ if (value.reasoningText !== undefined)
302
+ return visitor.reasoningText(value.reasoningText);
303
+ if (value.redactedContent !== undefined)
304
+ return visitor.redactedContent(value.redactedContent);
305
+ return visitor._(value.$unknown[0], value.$unknown[1]);
306
+ };
307
+ })(ReasoningContentBlock || (ReasoningContentBlock = {}));
298
308
  export const VideoFormat = {
299
309
  FLV: "flv",
300
310
  MKV: "mkv",
@@ -353,6 +363,8 @@ export var ContentBlock;
353
363
  return visitor.toolResult(value.toolResult);
354
364
  if (value.guardContent !== undefined)
355
365
  return visitor.guardContent(value.guardContent);
366
+ if (value.reasoningContent !== undefined)
367
+ return visitor.reasoningContent(value.reasoningContent);
356
368
  return visitor._(value.$unknown[0], value.$unknown[1]);
357
369
  };
358
370
  })(ContentBlock || (ContentBlock = {}));
@@ -471,6 +483,18 @@ export const GuardrailStreamProcessingMode = {
471
483
  ASYNC: "async",
472
484
  SYNC: "sync",
473
485
  };
486
+ export var ReasoningContentBlockDelta;
487
+ (function (ReasoningContentBlockDelta) {
488
+ ReasoningContentBlockDelta.visit = (value, visitor) => {
489
+ if (value.text !== undefined)
490
+ return visitor.text(value.text);
491
+ if (value.redactedContent !== undefined)
492
+ return visitor.redactedContent(value.redactedContent);
493
+ if (value.signature !== undefined)
494
+ return visitor.signature(value.signature);
495
+ return visitor._(value.$unknown[0], value.$unknown[1]);
496
+ };
497
+ })(ReasoningContentBlockDelta || (ReasoningContentBlockDelta = {}));
474
498
  export var ContentBlockDelta;
475
499
  (function (ContentBlockDelta) {
476
500
  ContentBlockDelta.visit = (value, visitor) => {
@@ -478,6 +502,8 @@ export var ContentBlockDelta;
478
502
  return visitor.text(value.text);
479
503
  if (value.toolUse !== undefined)
480
504
  return visitor.toolUse(value.toolUse);
505
+ if (value.reasoningContent !== undefined)
506
+ return visitor.reasoningContent(value.reasoningContent);
481
507
  return visitor._(value.$unknown[0], value.$unknown[1]);
482
508
  };
483
509
  })(ContentBlockDelta || (ContentBlockDelta = {}));
@@ -618,6 +644,17 @@ export const GuardrailConverseContentBlockFilterSensitiveLog = (obj) => {
618
644
  if (obj.$unknown !== undefined)
619
645
  return { [obj.$unknown[0]]: "UNKNOWN" };
620
646
  };
647
+ export const ReasoningTextBlockFilterSensitiveLog = (obj) => ({
648
+ ...obj,
649
+ });
650
+ export const ReasoningContentBlockFilterSensitiveLog = (obj) => {
651
+ if (obj.reasoningText !== undefined)
652
+ return { reasoningText: SENSITIVE_STRING };
653
+ if (obj.redactedContent !== undefined)
654
+ return { redactedContent: obj.redactedContent };
655
+ if (obj.$unknown !== undefined)
656
+ return { [obj.$unknown[0]]: "UNKNOWN" };
657
+ };
621
658
  export const ContentBlockFilterSensitiveLog = (obj) => {
622
659
  if (obj.text !== undefined)
623
660
  return { text: obj.text };
@@ -633,6 +670,8 @@ export const ContentBlockFilterSensitiveLog = (obj) => {
633
670
  return { toolResult: obj.toolResult };
634
671
  if (obj.guardContent !== undefined)
635
672
  return { guardContent: GuardrailConverseContentBlockFilterSensitiveLog(obj.guardContent) };
673
+ if (obj.reasoningContent !== undefined)
674
+ return { reasoningContent: SENSITIVE_STRING };
636
675
  if (obj.$unknown !== undefined)
637
676
  return { [obj.$unknown[0]]: "UNKNOWN" };
638
677
  };
@@ -674,13 +713,37 @@ export const ConverseStreamRequestFilterSensitiveLog = (obj) => ({
674
713
  ...(obj.promptVariables && { promptVariables: SENSITIVE_STRING }),
675
714
  ...(obj.requestMetadata && { requestMetadata: SENSITIVE_STRING }),
676
715
  });
716
+ export const ReasoningContentBlockDeltaFilterSensitiveLog = (obj) => {
717
+ if (obj.text !== undefined)
718
+ return { text: obj.text };
719
+ if (obj.redactedContent !== undefined)
720
+ return { redactedContent: obj.redactedContent };
721
+ if (obj.signature !== undefined)
722
+ return { signature: obj.signature };
723
+ if (obj.$unknown !== undefined)
724
+ return { [obj.$unknown[0]]: "UNKNOWN" };
725
+ };
726
+ export const ContentBlockDeltaFilterSensitiveLog = (obj) => {
727
+ if (obj.text !== undefined)
728
+ return { text: obj.text };
729
+ if (obj.toolUse !== undefined)
730
+ return { toolUse: obj.toolUse };
731
+ if (obj.reasoningContent !== undefined)
732
+ return { reasoningContent: SENSITIVE_STRING };
733
+ if (obj.$unknown !== undefined)
734
+ return { [obj.$unknown[0]]: "UNKNOWN" };
735
+ };
736
+ export const ContentBlockDeltaEventFilterSensitiveLog = (obj) => ({
737
+ ...obj,
738
+ ...(obj.delta && { delta: ContentBlockDeltaFilterSensitiveLog(obj.delta) }),
739
+ });
677
740
  export const ConverseStreamOutputFilterSensitiveLog = (obj) => {
678
741
  if (obj.messageStart !== undefined)
679
742
  return { messageStart: obj.messageStart };
680
743
  if (obj.contentBlockStart !== undefined)
681
744
  return { contentBlockStart: obj.contentBlockStart };
682
745
  if (obj.contentBlockDelta !== undefined)
683
- return { contentBlockDelta: obj.contentBlockDelta };
746
+ return { contentBlockDelta: ContentBlockDeltaEventFilterSensitiveLog(obj.contentBlockDelta) };
684
747
  if (obj.contentBlockStop !== undefined)
685
748
  return { contentBlockStop: obj.contentBlockStop };
686
749
  if (obj.messageStop !== undefined)
@@ -3,7 +3,7 @@ import { requestBuilder as rb } from "@smithy/core";
3
3
  import { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, isSerializableHeaderValue, limitedParseDouble as __limitedParseDouble, map, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, serializeDateTime as __serializeDateTime, serializeFloat as __serializeFloat, take, withBaseException, } from "@smithy/smithy-client";
4
4
  import { v4 as generateIdempotencyToken } from "uuid";
5
5
  import { BedrockRuntimeServiceException as __BaseException } from "../models/BedrockRuntimeServiceException";
6
- import { AccessDeniedException, ConflictException, ContentBlock, DocumentSource, GuardrailContentBlock, GuardrailConverseContentBlock, GuardrailConverseImageSource, GuardrailImageSource, ImageSource, InternalServerException, ModelErrorException, ModelNotReadyException, ModelStreamErrorException, ModelTimeoutException, ResourceNotFoundException, ServiceQuotaExceededException, ServiceUnavailableException, SystemContentBlock, ThrottlingException, Tool, ToolInputSchema, ToolResultContentBlock, ValidationException, VideoSource, } from "../models/models_0";
6
+ import { AccessDeniedException, ConflictException, ContentBlock, DocumentSource, GuardrailContentBlock, GuardrailConverseContentBlock, GuardrailConverseImageSource, GuardrailImageSource, ImageSource, InternalServerException, ModelErrorException, ModelNotReadyException, ModelStreamErrorException, ModelTimeoutException, ReasoningContentBlock, ResourceNotFoundException, ServiceQuotaExceededException, ServiceUnavailableException, SystemContentBlock, ThrottlingException, Tool, ToolInputSchema, ToolResultContentBlock, ValidationException, VideoSource, } from "../models/models_0";
7
7
  export const se_ApplyGuardrailCommand = async (input, context) => {
8
8
  const b = rb(input, context);
9
9
  const headers = {
@@ -589,7 +589,7 @@ const de_ResponseStream = (output, context) => {
589
589
  const de_ContentBlockDeltaEvent_event = async (output, context) => {
590
590
  const contents = {};
591
591
  const data = await parseBody(output.body, context);
592
- Object.assign(contents, _json(data));
592
+ Object.assign(contents, de_ContentBlockDeltaEvent(data, context));
593
593
  return contents;
594
594
  };
595
595
  const de_ContentBlockStartEvent_event = async (output, context) => {
@@ -675,6 +675,7 @@ const se_ContentBlock = (input, context) => {
675
675
  document: (value) => ({ document: se_DocumentBlock(value, context) }),
676
676
  guardContent: (value) => ({ guardContent: se_GuardrailConverseContentBlock(value, context) }),
677
677
  image: (value) => ({ image: se_ImageBlock(value, context) }),
678
+ reasoningContent: (value) => ({ reasoningContent: se_ReasoningContentBlock(value, context) }),
678
679
  text: (value) => ({ text: value }),
679
680
  toolResult: (value) => ({ toolResult: se_ToolResultBlock(value, context) }),
680
681
  toolUse: (value) => ({ toolUse: se_ToolUseBlock(value, context) }),
@@ -783,6 +784,13 @@ const se_Messages = (input, context) => {
783
784
  const se_ModelInputPayload = (input, context) => {
784
785
  return input;
785
786
  };
787
+ const se_ReasoningContentBlock = (input, context) => {
788
+ return ReasoningContentBlock.visit(input, {
789
+ reasoningText: (value) => ({ reasoningText: _json(value) }),
790
+ redactedContent: (value) => ({ redactedContent: context.base64Encoder(value) }),
791
+ _: (name, value) => ({ [name]: value }),
792
+ });
793
+ };
786
794
  const se_SystemContentBlock = (input, context) => {
787
795
  return SystemContentBlock.visit(input, {
788
796
  guardContent: (value) => ({ guardContent: se_GuardrailConverseContentBlock(value, context) }),
@@ -913,6 +921,11 @@ const de_ContentBlock = (output, context) => {
913
921
  image: de_ImageBlock(output.image, context),
914
922
  };
915
923
  }
924
+ if (output.reasoningContent != null) {
925
+ return {
926
+ reasoningContent: de_ReasoningContentBlock(__expectUnion(output.reasoningContent), context),
927
+ };
928
+ }
916
929
  if (__expectString(output.text) !== undefined) {
917
930
  return { text: __expectString(output.text) };
918
931
  }
@@ -933,6 +946,28 @@ const de_ContentBlock = (output, context) => {
933
946
  }
934
947
  return { $unknown: Object.entries(output)[0] };
935
948
  };
949
+ const de_ContentBlockDelta = (output, context) => {
950
+ if (output.reasoningContent != null) {
951
+ return {
952
+ reasoningContent: de_ReasoningContentBlockDelta(__expectUnion(output.reasoningContent), context),
953
+ };
954
+ }
955
+ if (__expectString(output.text) !== undefined) {
956
+ return { text: __expectString(output.text) };
957
+ }
958
+ if (output.toolUse != null) {
959
+ return {
960
+ toolUse: _json(output.toolUse),
961
+ };
962
+ }
963
+ return { $unknown: Object.entries(output)[0] };
964
+ };
965
+ const de_ContentBlockDeltaEvent = (output, context) => {
966
+ return take(output, {
967
+ contentBlockIndex: __expectInt32,
968
+ delta: (_) => de_ContentBlockDelta(__expectUnion(_), context),
969
+ });
970
+ };
936
971
  const de_ContentBlocks = (output, context) => {
937
972
  const retVal = (output || [])
938
973
  .filter((e) => e != null)
@@ -1106,6 +1141,33 @@ const de_PayloadPart = (output, context) => {
1106
1141
  bytes: context.base64Decoder,
1107
1142
  });
1108
1143
  };
1144
+ const de_ReasoningContentBlock = (output, context) => {
1145
+ if (output.reasoningText != null) {
1146
+ return {
1147
+ reasoningText: _json(output.reasoningText),
1148
+ };
1149
+ }
1150
+ if (output.redactedContent != null) {
1151
+ return {
1152
+ redactedContent: context.base64Decoder(output.redactedContent),
1153
+ };
1154
+ }
1155
+ return { $unknown: Object.entries(output)[0] };
1156
+ };
1157
+ const de_ReasoningContentBlockDelta = (output, context) => {
1158
+ if (output.redactedContent != null) {
1159
+ return {
1160
+ redactedContent: context.base64Decoder(output.redactedContent),
1161
+ };
1162
+ }
1163
+ if (__expectString(output.signature) !== undefined) {
1164
+ return { signature: __expectString(output.signature) };
1165
+ }
1166
+ if (__expectString(output.text) !== undefined) {
1167
+ return { text: __expectString(output.text) };
1168
+ }
1169
+ return { $unknown: Object.entries(output)[0] };
1170
+ };
1109
1171
  const de_ToolResultBlock = (output, context) => {
1110
1172
  return take(output, {
1111
1173
  content: (_) => de_ToolResultContentBlocks(_, context),
@@ -140,6 +140,13 @@ declare const ConverseCommand_base: {
140
140
  * },
141
141
  * },
142
142
  * },
143
+ * reasoningContent: { // ReasoningContentBlock Union: only one key present
144
+ * reasoningText: { // ReasoningTextBlock
145
+ * text: "STRING_VALUE", // required
146
+ * signature: "STRING_VALUE",
147
+ * },
148
+ * redactedContent: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
149
+ * },
143
150
  * },
144
151
  * ],
145
152
  * },
@@ -296,6 +303,13 @@ declare const ConverseCommand_base: {
296
303
  * // },
297
304
  * // },
298
305
  * // },
306
+ * // reasoningContent: { // ReasoningContentBlock Union: only one key present
307
+ * // reasoningText: { // ReasoningTextBlock
308
+ * // text: "STRING_VALUE", // required
309
+ * // signature: "STRING_VALUE",
310
+ * // },
311
+ * // redactedContent: new Uint8Array(),
312
+ * // },
299
313
  * // },
300
314
  * // ],
301
315
  * // },
@@ -146,6 +146,13 @@ declare const ConverseStreamCommand_base: {
146
146
  * },
147
147
  * },
148
148
  * },
149
+ * reasoningContent: { // ReasoningContentBlock Union: only one key present
150
+ * reasoningText: { // ReasoningTextBlock
151
+ * text: "STRING_VALUE", // required
152
+ * signature: "STRING_VALUE",
153
+ * },
154
+ * redactedContent: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
155
+ * },
149
156
  * },
150
157
  * ],
151
158
  * },
@@ -241,6 +248,11 @@ declare const ConverseStreamCommand_base: {
241
248
  * // toolUse: { // ToolUseBlockDelta
242
249
  * // input: "STRING_VALUE", // required
243
250
  * // },
251
+ * // reasoningContent: { // ReasoningContentBlockDelta Union: only one key present
252
+ * // text: "STRING_VALUE",
253
+ * // redactedContent: new Uint8Array(),
254
+ * // signature: "STRING_VALUE",
255
+ * // },
244
256
  * // },
245
257
  * // contentBlockIndex: Number("int"), // required
246
258
  * // },
@@ -1528,6 +1528,64 @@ export interface ImageBlock {
1528
1528
  */
1529
1529
  source: ImageSource | undefined;
1530
1530
  }
1531
+ /**
1532
+ * <p>Contains the reasoning that the model used to return the output.</p>
1533
+ * @public
1534
+ */
1535
+ export interface ReasoningTextBlock {
1536
+ /**
1537
+ * <p>The reasoning that the model used to return the output.</p>
1538
+ * @public
1539
+ */
1540
+ text: string | undefined;
1541
+ /**
1542
+ * <p>A token that verifies that the reasoning text was generated by the model. If you pass a reasoning block back to the API in a multi-turn conversation, include the text and its signature unmodified.</p>
1543
+ * @public
1544
+ */
1545
+ signature?: string | undefined;
1546
+ }
1547
+ /**
1548
+ * <p>Contains content regarding the reasoning that is carried out by the model with respect to the content in the content block. Reasoning refers to a Chain of Thought (CoT) that the model generates to enhance the accuracy of its final response.</p>
1549
+ * @public
1550
+ */
1551
+ export type ReasoningContentBlock = ReasoningContentBlock.ReasoningTextMember | ReasoningContentBlock.RedactedContentMember | ReasoningContentBlock.$UnknownMember;
1552
+ /**
1553
+ * @public
1554
+ */
1555
+ export declare namespace ReasoningContentBlock {
1556
+ /**
1557
+ * <p>The reasoning that the model used to return the output.</p>
1558
+ * @public
1559
+ */
1560
+ interface ReasoningTextMember {
1561
+ reasoningText: ReasoningTextBlock;
1562
+ redactedContent?: never;
1563
+ $unknown?: never;
1564
+ }
1565
+ /**
1566
+ * <p>The content in the reasoning that was encrypted by the model provider for safety reasons. The encryption doesn't affect the quality of responses.</p>
1567
+ * @public
1568
+ */
1569
+ interface RedactedContentMember {
1570
+ reasoningText?: never;
1571
+ redactedContent: Uint8Array;
1572
+ $unknown?: never;
1573
+ }
1574
+ /**
1575
+ * @public
1576
+ */
1577
+ interface $UnknownMember {
1578
+ reasoningText?: never;
1579
+ redactedContent?: never;
1580
+ $unknown: [string, any];
1581
+ }
1582
+ interface Visitor<T> {
1583
+ reasoningText: (value: ReasoningTextBlock) => T;
1584
+ redactedContent: (value: Uint8Array) => T;
1585
+ _: (name: string, value: any) => T;
1586
+ }
1587
+ const visit: <T>(value: ReasoningContentBlock, visitor: Visitor<T>) => T;
1588
+ }
1531
1589
  /**
1532
1590
  * @public
1533
1591
  * @enum
@@ -1779,7 +1837,7 @@ export interface ToolUseBlock {
1779
1837
  * <p>A block of content for a message that you pass to, or receive from, a model with the <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a> or <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html">ConverseStream</a> API operations.</p>
1780
1838
  * @public
1781
1839
  */
1782
- export type ContentBlock = ContentBlock.DocumentMember | ContentBlock.GuardContentMember | ContentBlock.ImageMember | ContentBlock.TextMember | ContentBlock.ToolResultMember | ContentBlock.ToolUseMember | ContentBlock.VideoMember | ContentBlock.$UnknownMember;
1840
+ export type ContentBlock = ContentBlock.DocumentMember | ContentBlock.GuardContentMember | ContentBlock.ImageMember | ContentBlock.ReasoningContentMember | ContentBlock.TextMember | ContentBlock.ToolResultMember | ContentBlock.ToolUseMember | ContentBlock.VideoMember | ContentBlock.$UnknownMember;
1783
1841
  /**
1784
1842
  * @public
1785
1843
  */
@@ -1796,6 +1854,7 @@ export declare namespace ContentBlock {
1796
1854
  toolUse?: never;
1797
1855
  toolResult?: never;
1798
1856
  guardContent?: never;
1857
+ reasoningContent?: never;
1799
1858
  $unknown?: never;
1800
1859
  }
1801
1860
  /**
@@ -1813,6 +1872,7 @@ export declare namespace ContentBlock {
1813
1872
  toolUse?: never;
1814
1873
  toolResult?: never;
1815
1874
  guardContent?: never;
1875
+ reasoningContent?: never;
1816
1876
  $unknown?: never;
1817
1877
  }
1818
1878
  /**
@@ -1827,6 +1887,7 @@ export declare namespace ContentBlock {
1827
1887
  toolUse?: never;
1828
1888
  toolResult?: never;
1829
1889
  guardContent?: never;
1890
+ reasoningContent?: never;
1830
1891
  $unknown?: never;
1831
1892
  }
1832
1893
  /**
@@ -1841,6 +1902,7 @@ export declare namespace ContentBlock {
1841
1902
  toolUse?: never;
1842
1903
  toolResult?: never;
1843
1904
  guardContent?: never;
1905
+ reasoningContent?: never;
1844
1906
  $unknown?: never;
1845
1907
  }
1846
1908
  /**
@@ -1855,6 +1917,7 @@ export declare namespace ContentBlock {
1855
1917
  toolUse: ToolUseBlock;
1856
1918
  toolResult?: never;
1857
1919
  guardContent?: never;
1920
+ reasoningContent?: never;
1858
1921
  $unknown?: never;
1859
1922
  }
1860
1923
  /**
@@ -1869,6 +1932,7 @@ export declare namespace ContentBlock {
1869
1932
  toolUse?: never;
1870
1933
  toolResult: ToolResultBlock;
1871
1934
  guardContent?: never;
1935
+ reasoningContent?: never;
1872
1936
  $unknown?: never;
1873
1937
  }
1874
1938
  /**
@@ -1888,6 +1952,22 @@ export declare namespace ContentBlock {
1888
1952
  toolUse?: never;
1889
1953
  toolResult?: never;
1890
1954
  guardContent: GuardrailConverseContentBlock;
1955
+ reasoningContent?: never;
1956
+ $unknown?: never;
1957
+ }
1958
+ /**
1959
+ * <p>Contains content regarding the reasoning that is carried out by the model. Reasoning refers to a Chain of Thought (CoT) that the model generates to enhance the accuracy of its final response.</p>
1960
+ * @public
1961
+ */
1962
+ interface ReasoningContentMember {
1963
+ text?: never;
1964
+ image?: never;
1965
+ document?: never;
1966
+ video?: never;
1967
+ toolUse?: never;
1968
+ toolResult?: never;
1969
+ guardContent?: never;
1970
+ reasoningContent: ReasoningContentBlock;
1891
1971
  $unknown?: never;
1892
1972
  }
1893
1973
  /**
@@ -1901,6 +1981,7 @@ export declare namespace ContentBlock {
1901
1981
  toolUse?: never;
1902
1982
  toolResult?: never;
1903
1983
  guardContent?: never;
1984
+ reasoningContent?: never;
1904
1985
  $unknown: [string, any];
1905
1986
  }
1906
1987
  interface Visitor<T> {
@@ -1911,6 +1992,7 @@ export declare namespace ContentBlock {
1911
1992
  toolUse: (value: ToolUseBlock) => T;
1912
1993
  toolResult: (value: ToolResultBlock) => T;
1913
1994
  guardContent: (value: GuardrailConverseContentBlock) => T;
1995
+ reasoningContent: (value: ReasoningContentBlock) => T;
1914
1996
  _: (name: string, value: any) => T;
1915
1997
  }
1916
1998
  const visit: <T>(value: ContentBlock, visitor: Visitor<T>) => T;
@@ -2689,6 +2771,62 @@ export interface ConverseStreamRequest {
2689
2771
  */
2690
2772
  performanceConfig?: PerformanceConfiguration | undefined;
2691
2773
  }
2774
+ /**
2775
+ * <p>Contains content regarding the reasoning that is carried out by the model with respect to the content in the content block. Reasoning refers to a Chain of Thought (CoT) that the model generates to enhance the accuracy of its final response.</p>
2776
+ * @public
2777
+ */
2778
+ export type ReasoningContentBlockDelta = ReasoningContentBlockDelta.RedactedContentMember | ReasoningContentBlockDelta.SignatureMember | ReasoningContentBlockDelta.TextMember | ReasoningContentBlockDelta.$UnknownMember;
2779
+ /**
2780
+ * @public
2781
+ */
2782
+ export declare namespace ReasoningContentBlockDelta {
2783
+ /**
2784
+ * <p>The reasoning that the model used to return the output.</p>
2785
+ * @public
2786
+ */
2787
+ interface TextMember {
2788
+ text: string;
2789
+ redactedContent?: never;
2790
+ signature?: never;
2791
+ $unknown?: never;
2792
+ }
2793
+ /**
2794
+ * <p>The content in the reasoning that was encrypted by the model provider for safety reasons. The encryption doesn't affect the quality of responses.</p>
2795
+ * @public
2796
+ */
2797
+ interface RedactedContentMember {
2798
+ text?: never;
2799
+ redactedContent: Uint8Array;
2800
+ signature?: never;
2801
+ $unknown?: never;
2802
+ }
2803
+ /**
2804
+ * <p>A token that verifies that the reasoning text was generated by the model. If you pass a reasoning block back to the API in a multi-turn conversation, include the text and its signature unmodified.</p>
2805
+ * @public
2806
+ */
2807
+ interface SignatureMember {
2808
+ text?: never;
2809
+ redactedContent?: never;
2810
+ signature: string;
2811
+ $unknown?: never;
2812
+ }
2813
+ /**
2814
+ * @public
2815
+ */
2816
+ interface $UnknownMember {
2817
+ text?: never;
2818
+ redactedContent?: never;
2819
+ signature?: never;
2820
+ $unknown: [string, any];
2821
+ }
2822
+ interface Visitor<T> {
2823
+ text: (value: string) => T;
2824
+ redactedContent: (value: Uint8Array) => T;
2825
+ signature: (value: string) => T;
2826
+ _: (name: string, value: any) => T;
2827
+ }
2828
+ const visit: <T>(value: ReasoningContentBlockDelta, visitor: Visitor<T>) => T;
2829
+ }
2692
2830
  /**
2693
2831
  * <p>The delta for a tool use block.</p>
2694
2832
  * @public
@@ -2701,10 +2839,10 @@ export interface ToolUseBlockDelta {
2701
2839
  input: string | undefined;
2702
2840
  }
2703
2841
  /**
2704
- * <p>A bock of content in a streaming response.</p>
2842
+ * <p>A block of content in a streaming response.</p>
2705
2843
  * @public
2706
2844
  */
2707
- export type ContentBlockDelta = ContentBlockDelta.TextMember | ContentBlockDelta.ToolUseMember | ContentBlockDelta.$UnknownMember;
2845
+ export type ContentBlockDelta = ContentBlockDelta.ReasoningContentMember | ContentBlockDelta.TextMember | ContentBlockDelta.ToolUseMember | ContentBlockDelta.$UnknownMember;
2708
2846
  /**
2709
2847
  * @public
2710
2848
  */
@@ -2716,6 +2854,7 @@ export declare namespace ContentBlockDelta {
2716
2854
  interface TextMember {
2717
2855
  text: string;
2718
2856
  toolUse?: never;
2857
+ reasoningContent?: never;
2719
2858
  $unknown?: never;
2720
2859
  }
2721
2860
  /**
@@ -2725,6 +2864,17 @@ export declare namespace ContentBlockDelta {
2725
2864
  interface ToolUseMember {
2726
2865
  text?: never;
2727
2866
  toolUse: ToolUseBlockDelta;
2867
+ reasoningContent?: never;
2868
+ $unknown?: never;
2869
+ }
2870
+ /**
2871
+ * <p>Contains content regarding the reasoning that is carried out by the model. Reasoning refers to a Chain of Thought (CoT) that the model generates to enhance the accuracy of its final response.</p>
2872
+ * @public
2873
+ */
2874
+ interface ReasoningContentMember {
2875
+ text?: never;
2876
+ toolUse?: never;
2877
+ reasoningContent: ReasoningContentBlockDelta;
2728
2878
  $unknown?: never;
2729
2879
  }
2730
2880
  /**
@@ -2733,11 +2883,13 @@ export declare namespace ContentBlockDelta {
2733
2883
  interface $UnknownMember {
2734
2884
  text?: never;
2735
2885
  toolUse?: never;
2886
+ reasoningContent?: never;
2736
2887
  $unknown: [string, any];
2737
2888
  }
2738
2889
  interface Visitor<T> {
2739
2890
  text: (value: string) => T;
2740
2891
  toolUse: (value: ToolUseBlockDelta) => T;
2892
+ reasoningContent: (value: ReasoningContentBlockDelta) => T;
2741
2893
  _: (name: string, value: any) => T;
2742
2894
  }
2743
2895
  const visit: <T>(value: ContentBlockDelta, visitor: Visitor<T>) => T;
@@ -3580,6 +3732,14 @@ export declare const GuardrailConverseImageBlockFilterSensitiveLog: (obj: Guardr
3580
3732
  * @internal
3581
3733
  */
3582
3734
  export declare const GuardrailConverseContentBlockFilterSensitiveLog: (obj: GuardrailConverseContentBlock) => any;
3735
+ /**
3736
+ * @internal
3737
+ */
3738
+ export declare const ReasoningTextBlockFilterSensitiveLog: (obj: ReasoningTextBlock) => any;
3739
+ /**
3740
+ * @internal
3741
+ */
3742
+ export declare const ReasoningContentBlockFilterSensitiveLog: (obj: ReasoningContentBlock) => any;
3583
3743
  /**
3584
3744
  * @internal
3585
3745
  */
@@ -3608,6 +3768,18 @@ export declare const ConverseResponseFilterSensitiveLog: (obj: ConverseResponse)
3608
3768
  * @internal
3609
3769
  */
3610
3770
  export declare const ConverseStreamRequestFilterSensitiveLog: (obj: ConverseStreamRequest) => any;
3771
+ /**
3772
+ * @internal
3773
+ */
3774
+ export declare const ReasoningContentBlockDeltaFilterSensitiveLog: (obj: ReasoningContentBlockDelta) => any;
3775
+ /**
3776
+ * @internal
3777
+ */
3778
+ export declare const ContentBlockDeltaFilterSensitiveLog: (obj: ContentBlockDelta) => any;
3779
+ /**
3780
+ * @internal
3781
+ */
3782
+ export declare const ContentBlockDeltaEventFilterSensitiveLog: (obj: ContentBlockDeltaEvent) => any;
3611
3783
  /**
3612
3784
  * @internal
3613
3785
  */
@@ -591,6 +591,37 @@ export interface ImageBlock {
591
591
  format: ImageFormat | undefined;
592
592
  source: ImageSource | undefined;
593
593
  }
594
+ export interface ReasoningTextBlock {
595
+ text: string | undefined;
596
+ signature?: string | undefined;
597
+ }
598
+ export type ReasoningContentBlock =
599
+ | ReasoningContentBlock.ReasoningTextMember
600
+ | ReasoningContentBlock.RedactedContentMember
601
+ | ReasoningContentBlock.$UnknownMember;
602
+ export declare namespace ReasoningContentBlock {
603
+ interface ReasoningTextMember {
604
+ reasoningText: ReasoningTextBlock;
605
+ redactedContent?: never;
606
+ $unknown?: never;
607
+ }
608
+ interface RedactedContentMember {
609
+ reasoningText?: never;
610
+ redactedContent: Uint8Array;
611
+ $unknown?: never;
612
+ }
613
+ interface $UnknownMember {
614
+ reasoningText?: never;
615
+ redactedContent?: never;
616
+ $unknown: [string, any];
617
+ }
618
+ interface Visitor<T> {
619
+ reasoningText: (value: ReasoningTextBlock) => T;
620
+ redactedContent: (value: Uint8Array) => T;
621
+ _: (name: string, value: any) => T;
622
+ }
623
+ const visit: <T>(value: ReasoningContentBlock, visitor: Visitor<T>) => T;
624
+ }
594
625
  export declare const VideoFormat: {
595
626
  readonly FLV: "flv";
596
627
  readonly MKV: "mkv";
@@ -724,6 +755,7 @@ export type ContentBlock =
724
755
  | ContentBlock.DocumentMember
725
756
  | ContentBlock.GuardContentMember
726
757
  | ContentBlock.ImageMember
758
+ | ContentBlock.ReasoningContentMember
727
759
  | ContentBlock.TextMember
728
760
  | ContentBlock.ToolResultMember
729
761
  | ContentBlock.ToolUseMember
@@ -738,6 +770,7 @@ export declare namespace ContentBlock {
738
770
  toolUse?: never;
739
771
  toolResult?: never;
740
772
  guardContent?: never;
773
+ reasoningContent?: never;
741
774
  $unknown?: never;
742
775
  }
743
776
  interface ImageMember {
@@ -748,6 +781,7 @@ export declare namespace ContentBlock {
748
781
  toolUse?: never;
749
782
  toolResult?: never;
750
783
  guardContent?: never;
784
+ reasoningContent?: never;
751
785
  $unknown?: never;
752
786
  }
753
787
  interface DocumentMember {
@@ -758,6 +792,7 @@ export declare namespace ContentBlock {
758
792
  toolUse?: never;
759
793
  toolResult?: never;
760
794
  guardContent?: never;
795
+ reasoningContent?: never;
761
796
  $unknown?: never;
762
797
  }
763
798
  interface VideoMember {
@@ -768,6 +803,7 @@ export declare namespace ContentBlock {
768
803
  toolUse?: never;
769
804
  toolResult?: never;
770
805
  guardContent?: never;
806
+ reasoningContent?: never;
771
807
  $unknown?: never;
772
808
  }
773
809
  interface ToolUseMember {
@@ -778,6 +814,7 @@ export declare namespace ContentBlock {
778
814
  toolUse: ToolUseBlock;
779
815
  toolResult?: never;
780
816
  guardContent?: never;
817
+ reasoningContent?: never;
781
818
  $unknown?: never;
782
819
  }
783
820
  interface ToolResultMember {
@@ -788,6 +825,7 @@ export declare namespace ContentBlock {
788
825
  toolUse?: never;
789
826
  toolResult: ToolResultBlock;
790
827
  guardContent?: never;
828
+ reasoningContent?: never;
791
829
  $unknown?: never;
792
830
  }
793
831
  interface GuardContentMember {
@@ -798,6 +836,18 @@ export declare namespace ContentBlock {
798
836
  toolUse?: never;
799
837
  toolResult?: never;
800
838
  guardContent: GuardrailConverseContentBlock;
839
+ reasoningContent?: never;
840
+ $unknown?: never;
841
+ }
842
+ interface ReasoningContentMember {
843
+ text?: never;
844
+ image?: never;
845
+ document?: never;
846
+ video?: never;
847
+ toolUse?: never;
848
+ toolResult?: never;
849
+ guardContent?: never;
850
+ reasoningContent: ReasoningContentBlock;
801
851
  $unknown?: never;
802
852
  }
803
853
  interface $UnknownMember {
@@ -808,6 +858,7 @@ export declare namespace ContentBlock {
808
858
  toolUse?: never;
809
859
  toolResult?: never;
810
860
  guardContent?: never;
861
+ reasoningContent?: never;
811
862
  $unknown: [string, any];
812
863
  }
813
864
  interface Visitor<T> {
@@ -818,6 +869,7 @@ export declare namespace ContentBlock {
818
869
  toolUse: (value: ToolUseBlock) => T;
819
870
  toolResult: (value: ToolResultBlock) => T;
820
871
  guardContent: (value: GuardrailConverseContentBlock) => T;
872
+ reasoningContent: (value: ReasoningContentBlock) => T;
821
873
  _: (name: string, value: any) => T;
822
874
  }
823
875
  const visit: <T>(value: ContentBlock, visitor: Visitor<T>) => T;
@@ -1090,10 +1142,49 @@ export interface ConverseStreamRequest {
1090
1142
  requestMetadata?: Record<string, string> | undefined;
1091
1143
  performanceConfig?: PerformanceConfiguration | undefined;
1092
1144
  }
1145
+ export type ReasoningContentBlockDelta =
1146
+ | ReasoningContentBlockDelta.RedactedContentMember
1147
+ | ReasoningContentBlockDelta.SignatureMember
1148
+ | ReasoningContentBlockDelta.TextMember
1149
+ | ReasoningContentBlockDelta.$UnknownMember;
1150
+ export declare namespace ReasoningContentBlockDelta {
1151
+ interface TextMember {
1152
+ text: string;
1153
+ redactedContent?: never;
1154
+ signature?: never;
1155
+ $unknown?: never;
1156
+ }
1157
+ interface RedactedContentMember {
1158
+ text?: never;
1159
+ redactedContent: Uint8Array;
1160
+ signature?: never;
1161
+ $unknown?: never;
1162
+ }
1163
+ interface SignatureMember {
1164
+ text?: never;
1165
+ redactedContent?: never;
1166
+ signature: string;
1167
+ $unknown?: never;
1168
+ }
1169
+ interface $UnknownMember {
1170
+ text?: never;
1171
+ redactedContent?: never;
1172
+ signature?: never;
1173
+ $unknown: [string, any];
1174
+ }
1175
+ interface Visitor<T> {
1176
+ text: (value: string) => T;
1177
+ redactedContent: (value: Uint8Array) => T;
1178
+ signature: (value: string) => T;
1179
+ _: (name: string, value: any) => T;
1180
+ }
1181
+ const visit: <T>(value: ReasoningContentBlockDelta, visitor: Visitor<T>) => T;
1182
+ }
1093
1183
  export interface ToolUseBlockDelta {
1094
1184
  input: string | undefined;
1095
1185
  }
1096
1186
  export type ContentBlockDelta =
1187
+ | ContentBlockDelta.ReasoningContentMember
1097
1188
  | ContentBlockDelta.TextMember
1098
1189
  | ContentBlockDelta.ToolUseMember
1099
1190
  | ContentBlockDelta.$UnknownMember;
@@ -1101,21 +1192,31 @@ export declare namespace ContentBlockDelta {
1101
1192
  interface TextMember {
1102
1193
  text: string;
1103
1194
  toolUse?: never;
1195
+ reasoningContent?: never;
1104
1196
  $unknown?: never;
1105
1197
  }
1106
1198
  interface ToolUseMember {
1107
1199
  text?: never;
1108
1200
  toolUse: ToolUseBlockDelta;
1201
+ reasoningContent?: never;
1202
+ $unknown?: never;
1203
+ }
1204
+ interface ReasoningContentMember {
1205
+ text?: never;
1206
+ toolUse?: never;
1207
+ reasoningContent: ReasoningContentBlockDelta;
1109
1208
  $unknown?: never;
1110
1209
  }
1111
1210
  interface $UnknownMember {
1112
1211
  text?: never;
1113
1212
  toolUse?: never;
1213
+ reasoningContent?: never;
1114
1214
  $unknown: [string, any];
1115
1215
  }
1116
1216
  interface Visitor<T> {
1117
1217
  text: (value: string) => T;
1118
1218
  toolUse: (value: ToolUseBlockDelta) => T;
1219
+ reasoningContent: (value: ReasoningContentBlockDelta) => T;
1119
1220
  _: (name: string, value: any) => T;
1120
1221
  }
1121
1222
  const visit: <T>(value: ContentBlockDelta, visitor: Visitor<T>) => T;
@@ -1556,6 +1657,12 @@ export declare const GuardrailConverseImageBlockFilterSensitiveLog: (
1556
1657
  export declare const GuardrailConverseContentBlockFilterSensitiveLog: (
1557
1658
  obj: GuardrailConverseContentBlock
1558
1659
  ) => any;
1660
+ export declare const ReasoningTextBlockFilterSensitiveLog: (
1661
+ obj: ReasoningTextBlock
1662
+ ) => any;
1663
+ export declare const ReasoningContentBlockFilterSensitiveLog: (
1664
+ obj: ReasoningContentBlock
1665
+ ) => any;
1559
1666
  export declare const ContentBlockFilterSensitiveLog: (obj: ContentBlock) => any;
1560
1667
  export declare const MessageFilterSensitiveLog: (obj: Message) => any;
1561
1668
  export declare const SystemContentBlockFilterSensitiveLog: (
@@ -1573,6 +1680,15 @@ export declare const ConverseResponseFilterSensitiveLog: (
1573
1680
  export declare const ConverseStreamRequestFilterSensitiveLog: (
1574
1681
  obj: ConverseStreamRequest
1575
1682
  ) => any;
1683
+ export declare const ReasoningContentBlockDeltaFilterSensitiveLog: (
1684
+ obj: ReasoningContentBlockDelta
1685
+ ) => any;
1686
+ export declare const ContentBlockDeltaFilterSensitiveLog: (
1687
+ obj: ContentBlockDelta
1688
+ ) => any;
1689
+ export declare const ContentBlockDeltaEventFilterSensitiveLog: (
1690
+ obj: ContentBlockDeltaEvent
1691
+ ) => any;
1576
1692
  export declare const ConverseStreamOutputFilterSensitiveLog: (
1577
1693
  obj: ConverseStreamOutput
1578
1694
  ) => 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.751.0",
4
+ "version": "3.758.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/core": "3.750.0",
24
- "@aws-sdk/credential-provider-node": "3.750.0",
23
+ "@aws-sdk/core": "3.758.0",
24
+ "@aws-sdk/credential-provider-node": "3.758.0",
25
25
  "@aws-sdk/middleware-host-header": "3.734.0",
26
26
  "@aws-sdk/middleware-logger": "3.734.0",
27
27
  "@aws-sdk/middleware-recursion-detection": "3.734.0",
28
- "@aws-sdk/middleware-user-agent": "3.750.0",
28
+ "@aws-sdk/middleware-user-agent": "3.758.0",
29
29
  "@aws-sdk/region-config-resolver": "3.734.0",
30
30
  "@aws-sdk/types": "3.734.0",
31
31
  "@aws-sdk/util-endpoints": "3.743.0",
32
32
  "@aws-sdk/util-user-agent-browser": "3.734.0",
33
- "@aws-sdk/util-user-agent-node": "3.750.0",
33
+ "@aws-sdk/util-user-agent-node": "3.758.0",
34
34
  "@smithy/config-resolver": "^4.0.1",
35
- "@smithy/core": "^3.1.4",
35
+ "@smithy/core": "^3.1.5",
36
36
  "@smithy/eventstream-serde-browser": "^4.0.1",
37
37
  "@smithy/eventstream-serde-config-resolver": "^4.0.1",
38
38
  "@smithy/eventstream-serde-node": "^4.0.1",
@@ -40,25 +40,25 @@
40
40
  "@smithy/hash-node": "^4.0.1",
41
41
  "@smithy/invalid-dependency": "^4.0.1",
42
42
  "@smithy/middleware-content-length": "^4.0.1",
43
- "@smithy/middleware-endpoint": "^4.0.5",
44
- "@smithy/middleware-retry": "^4.0.6",
43
+ "@smithy/middleware-endpoint": "^4.0.6",
44
+ "@smithy/middleware-retry": "^4.0.7",
45
45
  "@smithy/middleware-serde": "^4.0.2",
46
46
  "@smithy/middleware-stack": "^4.0.1",
47
47
  "@smithy/node-config-provider": "^4.0.1",
48
- "@smithy/node-http-handler": "^4.0.2",
48
+ "@smithy/node-http-handler": "^4.0.3",
49
49
  "@smithy/protocol-http": "^5.0.1",
50
- "@smithy/smithy-client": "^4.1.5",
50
+ "@smithy/smithy-client": "^4.1.6",
51
51
  "@smithy/types": "^4.1.0",
52
52
  "@smithy/url-parser": "^4.0.1",
53
53
  "@smithy/util-base64": "^4.0.0",
54
54
  "@smithy/util-body-length-browser": "^4.0.0",
55
55
  "@smithy/util-body-length-node": "^4.0.0",
56
- "@smithy/util-defaults-mode-browser": "^4.0.6",
57
- "@smithy/util-defaults-mode-node": "^4.0.6",
56
+ "@smithy/util-defaults-mode-browser": "^4.0.7",
57
+ "@smithy/util-defaults-mode-node": "^4.0.7",
58
58
  "@smithy/util-endpoints": "^3.0.1",
59
59
  "@smithy/util-middleware": "^4.0.1",
60
60
  "@smithy/util-retry": "^4.0.1",
61
- "@smithy/util-stream": "^4.1.1",
61
+ "@smithy/util-stream": "^4.1.2",
62
62
  "@smithy/util-utf8": "^4.0.0",
63
63
  "@types/uuid": "^9.0.1",
64
64
  "tslib": "^2.6.2",