@aws-sdk/client-bedrock-runtime 3.600.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.
package/dist-cjs/index.js CHANGED
@@ -35,6 +35,8 @@ __export(src_exports, {
35
35
  ConverseStreamOutput: () => ConverseStreamOutput,
36
36
  ConverseStreamOutputFilterSensitiveLog: () => ConverseStreamOutputFilterSensitiveLog,
37
37
  ConverseStreamResponseFilterSensitiveLog: () => ConverseStreamResponseFilterSensitiveLog,
38
+ DocumentFormat: () => DocumentFormat,
39
+ DocumentSource: () => DocumentSource,
38
40
  GuardrailContentFilterConfidence: () => GuardrailContentFilterConfidence,
39
41
  GuardrailContentFilterType: () => GuardrailContentFilterType,
40
42
  GuardrailContentPolicyAction: () => GuardrailContentPolicyAction,
@@ -274,6 +276,25 @@ var GuardrailTrace = {
274
276
  DISABLED: "disabled",
275
277
  ENABLED: "enabled"
276
278
  };
279
+ var DocumentFormat = {
280
+ CSV: "csv",
281
+ DOC: "doc",
282
+ DOCX: "docx",
283
+ HTML: "html",
284
+ MD: "md",
285
+ PDF: "pdf",
286
+ TXT: "txt",
287
+ XLS: "xls",
288
+ XLSX: "xlsx"
289
+ };
290
+ var DocumentSource;
291
+ ((DocumentSource2) => {
292
+ DocumentSource2.visit = /* @__PURE__ */ __name((value, visitor) => {
293
+ if (value.bytes !== void 0)
294
+ return visitor.bytes(value.bytes);
295
+ return visitor._(value.$unknown[0], value.$unknown[1]);
296
+ }, "visit");
297
+ })(DocumentSource || (DocumentSource = {}));
277
298
  var GuardrailConverseContentBlock;
278
299
  ((GuardrailConverseContentBlock3) => {
279
300
  GuardrailConverseContentBlock3.visit = /* @__PURE__ */ __name((value, visitor) => {
@@ -305,6 +326,8 @@ var ToolResultContentBlock;
305
326
  return visitor.text(value.text);
306
327
  if (value.image !== void 0)
307
328
  return visitor.image(value.image);
329
+ if (value.document !== void 0)
330
+ return visitor.document(value.document);
308
331
  return visitor._(value.$unknown[0], value.$unknown[1]);
309
332
  }, "visit");
310
333
  })(ToolResultContentBlock || (ToolResultContentBlock = {}));
@@ -319,6 +342,8 @@ var ContentBlock;
319
342
  return visitor.text(value.text);
320
343
  if (value.image !== void 0)
321
344
  return visitor.image(value.image);
345
+ if (value.document !== void 0)
346
+ return visitor.document(value.document);
322
347
  if (value.toolUse !== void 0)
323
348
  return visitor.toolUse(value.toolUse);
324
349
  if (value.toolResult !== void 0)
@@ -1235,6 +1260,7 @@ var de_ValidationException_event = /* @__PURE__ */ __name(async (output, context
1235
1260
  }, "de_ValidationException_event");
1236
1261
  var se_ContentBlock = /* @__PURE__ */ __name((input, context) => {
1237
1262
  return ContentBlock.visit(input, {
1263
+ document: (value) => ({ document: se_DocumentBlock(value, context) }),
1238
1264
  guardContent: (value) => ({ guardContent: (0, import_smithy_client._json)(value) }),
1239
1265
  image: (value) => ({ image: se_ImageBlock(value, context) }),
1240
1266
  text: (value) => ({ text: value }),
@@ -1248,6 +1274,19 @@ var se_ContentBlocks = /* @__PURE__ */ __name((input, context) => {
1248
1274
  return se_ContentBlock(entry, context);
1249
1275
  });
1250
1276
  }, "se_ContentBlocks");
1277
+ var se_DocumentBlock = /* @__PURE__ */ __name((input, context) => {
1278
+ return (0, import_smithy_client.take)(input, {
1279
+ format: [],
1280
+ name: [],
1281
+ source: (_) => se_DocumentSource(_, context)
1282
+ });
1283
+ }, "se_DocumentBlock");
1284
+ var se_DocumentSource = /* @__PURE__ */ __name((input, context) => {
1285
+ return DocumentSource.visit(input, {
1286
+ bytes: (value) => ({ bytes: context.base64Encoder(value) }),
1287
+ _: (name, value) => ({ name: value })
1288
+ });
1289
+ }, "se_DocumentSource");
1251
1290
  var se_ImageBlock = /* @__PURE__ */ __name((input, context) => {
1252
1291
  return (0, import_smithy_client.take)(input, {
1253
1292
  format: [],
@@ -1306,6 +1345,7 @@ var se_ToolResultBlock = /* @__PURE__ */ __name((input, context) => {
1306
1345
  }, "se_ToolResultBlock");
1307
1346
  var se_ToolResultContentBlock = /* @__PURE__ */ __name((input, context) => {
1308
1347
  return ToolResultContentBlock.visit(input, {
1348
+ document: (value) => ({ document: se_DocumentBlock(value, context) }),
1309
1349
  image: (value) => ({ image: se_ImageBlock(value, context) }),
1310
1350
  json: (value) => ({ json: se_Document(value, context) }),
1311
1351
  text: (value) => ({ text: value }),
@@ -1340,6 +1380,11 @@ var se_Document = /* @__PURE__ */ __name((input, context) => {
1340
1380
  return input;
1341
1381
  }, "se_Document");
1342
1382
  var de_ContentBlock = /* @__PURE__ */ __name((output, context) => {
1383
+ if (output.document != null) {
1384
+ return {
1385
+ document: de_DocumentBlock(output.document, context)
1386
+ };
1387
+ }
1343
1388
  if (output.guardContent != null) {
1344
1389
  return {
1345
1390
  guardContent: (0, import_smithy_client._json)((0, import_core2.awsExpectUnion)(output.guardContent))
@@ -1379,6 +1424,21 @@ var de_ConverseOutput = /* @__PURE__ */ __name((output, context) => {
1379
1424
  }
1380
1425
  return { $unknown: Object.entries(output)[0] };
1381
1426
  }, "de_ConverseOutput");
1427
+ var de_DocumentBlock = /* @__PURE__ */ __name((output, context) => {
1428
+ return (0, import_smithy_client.take)(output, {
1429
+ format: import_smithy_client.expectString,
1430
+ name: import_smithy_client.expectString,
1431
+ source: (_) => de_DocumentSource((0, import_core2.awsExpectUnion)(_), context)
1432
+ });
1433
+ }, "de_DocumentBlock");
1434
+ var de_DocumentSource = /* @__PURE__ */ __name((output, context) => {
1435
+ if (output.bytes != null) {
1436
+ return {
1437
+ bytes: context.base64Decoder(output.bytes)
1438
+ };
1439
+ }
1440
+ return { $unknown: Object.entries(output)[0] };
1441
+ }, "de_DocumentSource");
1382
1442
  var de_ImageBlock = /* @__PURE__ */ __name((output, context) => {
1383
1443
  return (0, import_smithy_client.take)(output, {
1384
1444
  format: import_smithy_client.expectString,
@@ -1418,6 +1478,11 @@ var de_ToolResultBlock = /* @__PURE__ */ __name((output, context) => {
1418
1478
  });
1419
1479
  }, "de_ToolResultBlock");
1420
1480
  var de_ToolResultContentBlock = /* @__PURE__ */ __name((output, context) => {
1481
+ if (output.document != null) {
1482
+ return {
1483
+ document: de_DocumentBlock(output.document, context)
1484
+ };
1485
+ }
1421
1486
  if (output.image != null) {
1422
1487
  return {
1423
1488
  image: de_ImageBlock(output.image, context)
@@ -1569,6 +1634,8 @@ var BedrockRuntime = _BedrockRuntime;
1569
1634
  InvokeModelWithResponseStreamCommand,
1570
1635
  AccessDeniedException,
1571
1636
  GuardrailTrace,
1637
+ DocumentFormat,
1638
+ DocumentSource,
1572
1639
  GuardrailConverseContentBlock,
1573
1640
  ImageFormat,
1574
1641
  ImageSource,
@@ -16,6 +16,25 @@ export const GuardrailTrace = {
16
16
  DISABLED: "disabled",
17
17
  ENABLED: "enabled",
18
18
  };
19
+ export const DocumentFormat = {
20
+ CSV: "csv",
21
+ DOC: "doc",
22
+ DOCX: "docx",
23
+ HTML: "html",
24
+ MD: "md",
25
+ PDF: "pdf",
26
+ TXT: "txt",
27
+ XLS: "xls",
28
+ XLSX: "xlsx",
29
+ };
30
+ export var DocumentSource;
31
+ (function (DocumentSource) {
32
+ DocumentSource.visit = (value, visitor) => {
33
+ if (value.bytes !== undefined)
34
+ return visitor.bytes(value.bytes);
35
+ return visitor._(value.$unknown[0], value.$unknown[1]);
36
+ };
37
+ })(DocumentSource || (DocumentSource = {}));
19
38
  export var GuardrailConverseContentBlock;
20
39
  (function (GuardrailConverseContentBlock) {
21
40
  GuardrailConverseContentBlock.visit = (value, visitor) => {
@@ -47,6 +66,8 @@ export var ToolResultContentBlock;
47
66
  return visitor.text(value.text);
48
67
  if (value.image !== undefined)
49
68
  return visitor.image(value.image);
69
+ if (value.document !== undefined)
70
+ return visitor.document(value.document);
50
71
  return visitor._(value.$unknown[0], value.$unknown[1]);
51
72
  };
52
73
  })(ToolResultContentBlock || (ToolResultContentBlock = {}));
@@ -61,6 +82,8 @@ export var ContentBlock;
61
82
  return visitor.text(value.text);
62
83
  if (value.image !== undefined)
63
84
  return visitor.image(value.image);
85
+ if (value.document !== undefined)
86
+ return visitor.document(value.document);
64
87
  if (value.toolUse !== undefined)
65
88
  return visitor.toolUse(value.toolUse);
66
89
  if (value.toolResult !== undefined)
@@ -2,7 +2,7 @@ import { awsExpectUnion as __expectUnion, loadRestJsonErrorCode, parseJsonBody a
2
2
  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, map, serializeFloat as __serializeFloat, take, withBaseException, } from "@smithy/smithy-client";
4
4
  import { BedrockRuntimeServiceException as __BaseException } from "../models/BedrockRuntimeServiceException";
5
- import { AccessDeniedException, ContentBlock, ImageSource, InternalServerException, ModelErrorException, ModelNotReadyException, ModelStreamErrorException, ModelTimeoutException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, Tool, ToolInputSchema, ToolResultContentBlock, ValidationException, } from "../models/models_0";
5
+ import { AccessDeniedException, ContentBlock, DocumentSource, ImageSource, InternalServerException, ModelErrorException, ModelNotReadyException, ModelStreamErrorException, ModelTimeoutException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, Tool, ToolInputSchema, ToolResultContentBlock, ValidationException, } from "../models/models_0";
6
6
  export const se_ConverseCommand = async (input, context) => {
7
7
  const b = rb(input, context);
8
8
  const headers = {
@@ -483,6 +483,7 @@ const de_ValidationException_event = async (output, context) => {
483
483
  };
484
484
  const se_ContentBlock = (input, context) => {
485
485
  return ContentBlock.visit(input, {
486
+ document: (value) => ({ document: se_DocumentBlock(value, context) }),
486
487
  guardContent: (value) => ({ guardContent: _json(value) }),
487
488
  image: (value) => ({ image: se_ImageBlock(value, context) }),
488
489
  text: (value) => ({ text: value }),
@@ -498,6 +499,19 @@ const se_ContentBlocks = (input, context) => {
498
499
  return se_ContentBlock(entry, context);
499
500
  });
500
501
  };
502
+ const se_DocumentBlock = (input, context) => {
503
+ return take(input, {
504
+ format: [],
505
+ name: [],
506
+ source: (_) => se_DocumentSource(_, context),
507
+ });
508
+ };
509
+ const se_DocumentSource = (input, context) => {
510
+ return DocumentSource.visit(input, {
511
+ bytes: (value) => ({ bytes: context.base64Encoder(value) }),
512
+ _: (name, value) => ({ name: value }),
513
+ });
514
+ };
501
515
  const se_ImageBlock = (input, context) => {
502
516
  return take(input, {
503
517
  format: [],
@@ -558,6 +572,7 @@ const se_ToolResultBlock = (input, context) => {
558
572
  };
559
573
  const se_ToolResultContentBlock = (input, context) => {
560
574
  return ToolResultContentBlock.visit(input, {
575
+ document: (value) => ({ document: se_DocumentBlock(value, context) }),
561
576
  image: (value) => ({ image: se_ImageBlock(value, context) }),
562
577
  json: (value) => ({ json: se_Document(value, context) }),
563
578
  text: (value) => ({ text: value }),
@@ -596,6 +611,11 @@ const se_Document = (input, context) => {
596
611
  return input;
597
612
  };
598
613
  const de_ContentBlock = (output, context) => {
614
+ if (output.document != null) {
615
+ return {
616
+ document: de_DocumentBlock(output.document, context),
617
+ };
618
+ }
599
619
  if (output.guardContent != null) {
600
620
  return {
601
621
  guardContent: _json(__expectUnion(output.guardContent)),
@@ -637,6 +657,21 @@ const de_ConverseOutput = (output, context) => {
637
657
  }
638
658
  return { $unknown: Object.entries(output)[0] };
639
659
  };
660
+ const de_DocumentBlock = (output, context) => {
661
+ return take(output, {
662
+ format: __expectString,
663
+ name: __expectString,
664
+ source: (_) => de_DocumentSource(__expectUnion(_), context),
665
+ });
666
+ };
667
+ const de_DocumentSource = (output, context) => {
668
+ if (output.bytes != null) {
669
+ return {
670
+ bytes: context.base64Decoder(output.bytes),
671
+ };
672
+ }
673
+ return { $unknown: Object.entries(output)[0] };
674
+ };
640
675
  const de_ImageBlock = (output, context) => {
641
676
  return take(output, {
642
677
  format: __expectString,
@@ -676,6 +711,11 @@ const de_ToolResultBlock = (output, context) => {
676
711
  });
677
712
  };
678
713
  const de_ToolResultContentBlock = (output, context) => {
714
+ if (output.document != null) {
715
+ return {
716
+ document: de_DocumentBlock(output.document, context),
717
+ };
718
+ }
679
719
  if (output.image != null) {
680
720
  return {
681
721
  image: de_ImageBlock(output.image, context),
@@ -59,6 +59,13 @@ declare const ConverseCommand_base: {
59
59
  * bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
60
60
  * },
61
61
  * },
62
+ * document: { // DocumentBlock
63
+ * format: "pdf" || "csv" || "doc" || "docx" || "xls" || "xlsx" || "html" || "txt" || "md", // required
64
+ * name: "STRING_VALUE", // required
65
+ * source: { // DocumentSource Union: only one key present
66
+ * bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
67
+ * },
68
+ * },
62
69
  * toolUse: { // ToolUseBlock
63
70
  * toolUseId: "STRING_VALUE", // required
64
71
  * name: "STRING_VALUE", // required
@@ -76,6 +83,13 @@ declare const ConverseCommand_base: {
76
83
  * bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
77
84
  * },
78
85
  * },
86
+ * document: {
87
+ * format: "pdf" || "csv" || "doc" || "docx" || "xls" || "xlsx" || "html" || "txt" || "md", // required
88
+ * name: "STRING_VALUE", // required
89
+ * source: {// Union: only one key present
90
+ * bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
91
+ * },
92
+ * },
79
93
  * },
80
94
  * ],
81
95
  * status: "success" || "error",
@@ -152,6 +166,13 @@ declare const ConverseCommand_base: {
152
166
  * // bytes: new Uint8Array(),
153
167
  * // },
154
168
  * // },
169
+ * // document: { // DocumentBlock
170
+ * // format: "pdf" || "csv" || "doc" || "docx" || "xls" || "xlsx" || "html" || "txt" || "md", // required
171
+ * // name: "STRING_VALUE", // required
172
+ * // source: { // DocumentSource Union: only one key present
173
+ * // bytes: new Uint8Array(),
174
+ * // },
175
+ * // },
155
176
  * // toolUse: { // ToolUseBlock
156
177
  * // toolUseId: "STRING_VALUE", // required
157
178
  * // name: "STRING_VALUE", // required
@@ -169,6 +190,13 @@ declare const ConverseCommand_base: {
169
190
  * // bytes: new Uint8Array(),
170
191
  * // },
171
192
  * // },
193
+ * // document: {
194
+ * // format: "pdf" || "csv" || "doc" || "docx" || "xls" || "xlsx" || "html" || "txt" || "md", // required
195
+ * // name: "STRING_VALUE", // required
196
+ * // source: {// Union: only one key present
197
+ * // bytes: new Uint8Array(),
198
+ * // },
199
+ * // },
172
200
  * // },
173
201
  * // ],
174
202
  * // status: "success" || "error",
@@ -62,6 +62,13 @@ declare const ConverseStreamCommand_base: {
62
62
  * bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
63
63
  * },
64
64
  * },
65
+ * document: { // DocumentBlock
66
+ * format: "pdf" || "csv" || "doc" || "docx" || "xls" || "xlsx" || "html" || "txt" || "md", // required
67
+ * name: "STRING_VALUE", // required
68
+ * source: { // DocumentSource Union: only one key present
69
+ * bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
70
+ * },
71
+ * },
65
72
  * toolUse: { // ToolUseBlock
66
73
  * toolUseId: "STRING_VALUE", // required
67
74
  * name: "STRING_VALUE", // required
@@ -79,6 +86,13 @@ declare const ConverseStreamCommand_base: {
79
86
  * bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
80
87
  * },
81
88
  * },
89
+ * document: {
90
+ * format: "pdf" || "csv" || "doc" || "docx" || "xls" || "xlsx" || "html" || "txt" || "md", // required
91
+ * name: "STRING_VALUE", // required
92
+ * source: {// Union: only one key present
93
+ * bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
94
+ * },
95
+ * },
82
96
  * },
83
97
  * ],
84
98
  * status: "success" || "error",
@@ -90,6 +90,76 @@ export interface InferenceConfiguration {
90
90
  */
91
91
  stopSequences?: string[];
92
92
  }
93
+ /**
94
+ * @public
95
+ * @enum
96
+ */
97
+ export declare const DocumentFormat: {
98
+ readonly CSV: "csv";
99
+ readonly DOC: "doc";
100
+ readonly DOCX: "docx";
101
+ readonly HTML: "html";
102
+ readonly MD: "md";
103
+ readonly PDF: "pdf";
104
+ readonly TXT: "txt";
105
+ readonly XLS: "xls";
106
+ readonly XLSX: "xlsx";
107
+ };
108
+ /**
109
+ * @public
110
+ */
111
+ export type DocumentFormat = (typeof DocumentFormat)[keyof typeof DocumentFormat];
112
+ /**
113
+ * <p>Contains the content of the document included in a message when sending a <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> request or in the response.</p>
114
+ * @public
115
+ */
116
+ export type DocumentSource = DocumentSource.BytesMember | DocumentSource.$UnknownMember;
117
+ /**
118
+ * @public
119
+ */
120
+ export declare namespace DocumentSource {
121
+ /**
122
+ * <p>A base64-encoded string of a UTF-8 encoded file, that is the document to include in the message.</p>
123
+ * @public
124
+ */
125
+ interface BytesMember {
126
+ bytes: Uint8Array;
127
+ $unknown?: never;
128
+ }
129
+ /**
130
+ * @public
131
+ */
132
+ interface $UnknownMember {
133
+ bytes?: never;
134
+ $unknown: [string, any];
135
+ }
136
+ interface Visitor<T> {
137
+ bytes: (value: Uint8Array) => T;
138
+ _: (name: string, value: any) => T;
139
+ }
140
+ const visit: <T>(value: DocumentSource, visitor: Visitor<T>) => T;
141
+ }
142
+ /**
143
+ * <p>A document to include in a message when sending a <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> request. You can include up to 5 documents in a request. The maximum document size is 50 MB.</p>
144
+ * @public
145
+ */
146
+ export interface DocumentBlock {
147
+ /**
148
+ * <p>The format of a document, or its extension.</p>
149
+ * @public
150
+ */
151
+ format: DocumentFormat | undefined;
152
+ /**
153
+ * <p>A name for the document.</p>
154
+ * @public
155
+ */
156
+ name: string | undefined;
157
+ /**
158
+ * <p>Contains the content of the document.</p>
159
+ * @public
160
+ */
161
+ source: DocumentSource | undefined;
162
+ }
93
163
  /**
94
164
  * <p>A text block that contains text that you want to assess with a guardrail. For more information, see <a>GuardrailConverseContentBlock</a>.</p>
95
165
  * @public
@@ -197,7 +267,7 @@ export interface ImageBlock {
197
267
  * <p>The tool result content block.</p>
198
268
  * @public
199
269
  */
200
- export type ToolResultContentBlock = ToolResultContentBlock.ImageMember | ToolResultContentBlock.JsonMember | ToolResultContentBlock.TextMember | ToolResultContentBlock.$UnknownMember;
270
+ export type ToolResultContentBlock = ToolResultContentBlock.DocumentMember | ToolResultContentBlock.ImageMember | ToolResultContentBlock.JsonMember | ToolResultContentBlock.TextMember | ToolResultContentBlock.$UnknownMember;
201
271
  /**
202
272
  * @public
203
273
  */
@@ -210,6 +280,7 @@ export declare namespace ToolResultContentBlock {
210
280
  json: __DocumentType;
211
281
  text?: never;
212
282
  image?: never;
283
+ document?: never;
213
284
  $unknown?: never;
214
285
  }
215
286
  /**
@@ -220,6 +291,7 @@ export declare namespace ToolResultContentBlock {
220
291
  json?: never;
221
292
  text: string;
222
293
  image?: never;
294
+ document?: never;
223
295
  $unknown?: never;
224
296
  }
225
297
  /**
@@ -233,6 +305,18 @@ export declare namespace ToolResultContentBlock {
233
305
  json?: never;
234
306
  text?: never;
235
307
  image: ImageBlock;
308
+ document?: never;
309
+ $unknown?: never;
310
+ }
311
+ /**
312
+ * <p>A tool result that is a document.</p>
313
+ * @public
314
+ */
315
+ interface DocumentMember {
316
+ json?: never;
317
+ text?: never;
318
+ image?: never;
319
+ document: DocumentBlock;
236
320
  $unknown?: never;
237
321
  }
238
322
  /**
@@ -242,12 +326,14 @@ export declare namespace ToolResultContentBlock {
242
326
  json?: never;
243
327
  text?: never;
244
328
  image?: never;
329
+ document?: never;
245
330
  $unknown: [string, any];
246
331
  }
247
332
  interface Visitor<T> {
248
333
  json: (value: __DocumentType) => T;
249
334
  text: (value: string) => T;
250
335
  image: (value: ImageBlock) => T;
336
+ document: (value: DocumentBlock) => T;
251
337
  _: (name: string, value: any) => T;
252
338
  }
253
339
  const visit: <T>(value: ToolResultContentBlock, visitor: Visitor<T>) => T;
@@ -315,7 +401,7 @@ export interface ToolUseBlock {
315
401
  * <p>A block of content for a message that you pass to, or receive from, a model with the Converse API (<a>Converse</a> and <a>ConverseStream</a>).</p>
316
402
  * @public
317
403
  */
318
- export type ContentBlock = ContentBlock.GuardContentMember | ContentBlock.ImageMember | ContentBlock.TextMember | ContentBlock.ToolResultMember | ContentBlock.ToolUseMember | ContentBlock.$UnknownMember;
404
+ export type ContentBlock = ContentBlock.DocumentMember | ContentBlock.GuardContentMember | ContentBlock.ImageMember | ContentBlock.TextMember | ContentBlock.ToolResultMember | ContentBlock.ToolUseMember | ContentBlock.$UnknownMember;
319
405
  /**
320
406
  * @public
321
407
  */
@@ -327,6 +413,7 @@ export declare namespace ContentBlock {
327
413
  interface TextMember {
328
414
  text: string;
329
415
  image?: never;
416
+ document?: never;
330
417
  toolUse?: never;
331
418
  toolResult?: never;
332
419
  guardContent?: never;
@@ -342,6 +429,20 @@ export declare namespace ContentBlock {
342
429
  interface ImageMember {
343
430
  text?: never;
344
431
  image: ImageBlock;
432
+ document?: never;
433
+ toolUse?: never;
434
+ toolResult?: never;
435
+ guardContent?: never;
436
+ $unknown?: never;
437
+ }
438
+ /**
439
+ * <p>A document to include in the message.</p>
440
+ * @public
441
+ */
442
+ interface DocumentMember {
443
+ text?: never;
444
+ image?: never;
445
+ document: DocumentBlock;
345
446
  toolUse?: never;
346
447
  toolResult?: never;
347
448
  guardContent?: never;
@@ -354,6 +455,7 @@ export declare namespace ContentBlock {
354
455
  interface ToolUseMember {
355
456
  text?: never;
356
457
  image?: never;
458
+ document?: never;
357
459
  toolUse: ToolUseBlock;
358
460
  toolResult?: never;
359
461
  guardContent?: never;
@@ -366,6 +468,7 @@ export declare namespace ContentBlock {
366
468
  interface ToolResultMember {
367
469
  text?: never;
368
470
  image?: never;
471
+ document?: never;
369
472
  toolUse?: never;
370
473
  toolResult: ToolResultBlock;
371
474
  guardContent?: never;
@@ -383,6 +486,7 @@ export declare namespace ContentBlock {
383
486
  interface GuardContentMember {
384
487
  text?: never;
385
488
  image?: never;
489
+ document?: never;
386
490
  toolUse?: never;
387
491
  toolResult?: never;
388
492
  guardContent: GuardrailConverseContentBlock;
@@ -394,6 +498,7 @@ export declare namespace ContentBlock {
394
498
  interface $UnknownMember {
395
499
  text?: never;
396
500
  image?: never;
501
+ document?: never;
397
502
  toolUse?: never;
398
503
  toolResult?: never;
399
504
  guardContent?: never;
@@ -402,6 +507,7 @@ export declare namespace ContentBlock {
402
507
  interface Visitor<T> {
403
508
  text: (value: string) => T;
404
509
  image: (value: ImageBlock) => T;
510
+ document: (value: DocumentBlock) => T;
405
511
  toolUse: (value: ToolUseBlock) => T;
406
512
  toolResult: (value: ToolResultBlock) => T;
407
513
  guardContent: (value: GuardrailConverseContentBlock) => T;
@@ -25,6 +25,42 @@ export interface InferenceConfiguration {
25
25
  topP?: number;
26
26
  stopSequences?: string[];
27
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
+ }
28
64
  export interface GuardrailConverseTextBlock {
29
65
  text: string | undefined;
30
66
  }
@@ -77,6 +113,7 @@ export interface ImageBlock {
77
113
  source: ImageSource | undefined;
78
114
  }
79
115
  export type ToolResultContentBlock =
116
+ | ToolResultContentBlock.DocumentMember
80
117
  | ToolResultContentBlock.ImageMember
81
118
  | ToolResultContentBlock.JsonMember
82
119
  | ToolResultContentBlock.TextMember
@@ -86,30 +123,42 @@ export declare namespace ToolResultContentBlock {
86
123
  json: __DocumentType;
87
124
  text?: never;
88
125
  image?: never;
126
+ document?: never;
89
127
  $unknown?: never;
90
128
  }
91
129
  interface TextMember {
92
130
  json?: never;
93
131
  text: string;
94
132
  image?: never;
133
+ document?: never;
95
134
  $unknown?: never;
96
135
  }
97
136
  interface ImageMember {
98
137
  json?: never;
99
138
  text?: never;
100
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;
101
148
  $unknown?: never;
102
149
  }
103
150
  interface $UnknownMember {
104
151
  json?: never;
105
152
  text?: never;
106
153
  image?: never;
154
+ document?: never;
107
155
  $unknown: [string, any];
108
156
  }
109
157
  interface Visitor<T> {
110
158
  json: (value: __DocumentType) => T;
111
159
  text: (value: string) => T;
112
160
  image: (value: ImageBlock) => T;
161
+ document: (value: DocumentBlock) => T;
113
162
  _: (name: string, value: any) => T;
114
163
  }
115
164
  const visit: <T>(value: ToolResultContentBlock, visitor: Visitor<T>) => T;
@@ -131,6 +180,7 @@ export interface ToolUseBlock {
131
180
  input: __DocumentType | undefined;
132
181
  }
133
182
  export type ContentBlock =
183
+ | ContentBlock.DocumentMember
134
184
  | ContentBlock.GuardContentMember
135
185
  | ContentBlock.ImageMember
136
186
  | ContentBlock.TextMember
@@ -141,6 +191,7 @@ export declare namespace ContentBlock {
141
191
  interface TextMember {
142
192
  text: string;
143
193
  image?: never;
194
+ document?: never;
144
195
  toolUse?: never;
145
196
  toolResult?: never;
146
197
  guardContent?: never;
@@ -149,6 +200,16 @@ export declare namespace ContentBlock {
149
200
  interface ImageMember {
150
201
  text?: never;
151
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;
152
213
  toolUse?: never;
153
214
  toolResult?: never;
154
215
  guardContent?: never;
@@ -157,6 +218,7 @@ export declare namespace ContentBlock {
157
218
  interface ToolUseMember {
158
219
  text?: never;
159
220
  image?: never;
221
+ document?: never;
160
222
  toolUse: ToolUseBlock;
161
223
  toolResult?: never;
162
224
  guardContent?: never;
@@ -165,6 +227,7 @@ export declare namespace ContentBlock {
165
227
  interface ToolResultMember {
166
228
  text?: never;
167
229
  image?: never;
230
+ document?: never;
168
231
  toolUse?: never;
169
232
  toolResult: ToolResultBlock;
170
233
  guardContent?: never;
@@ -173,6 +236,7 @@ export declare namespace ContentBlock {
173
236
  interface GuardContentMember {
174
237
  text?: never;
175
238
  image?: never;
239
+ document?: never;
176
240
  toolUse?: never;
177
241
  toolResult?: never;
178
242
  guardContent: GuardrailConverseContentBlock;
@@ -181,6 +245,7 @@ export declare namespace ContentBlock {
181
245
  interface $UnknownMember {
182
246
  text?: never;
183
247
  image?: never;
248
+ document?: never;
184
249
  toolUse?: never;
185
250
  toolResult?: never;
186
251
  guardContent?: never;
@@ -189,6 +254,7 @@ export declare namespace ContentBlock {
189
254
  interface Visitor<T> {
190
255
  text: (value: string) => T;
191
256
  image: (value: ImageBlock) => T;
257
+ document: (value: DocumentBlock) => T;
192
258
  toolUse: (value: ToolUseBlock) => T;
193
259
  toolResult: (value: ToolResultBlock) => T;
194
260
  guardContent: (value: GuardrailConverseContentBlock) => T;
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.600.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",