@aws-sdk/client-bedrock-runtime 3.686.0 → 3.687.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
@@ -32,9 +32,11 @@ __export(src_exports, {
32
32
  ConversationRole: () => ConversationRole,
33
33
  ConverseCommand: () => ConverseCommand,
34
34
  ConverseOutput: () => ConverseOutput,
35
+ ConverseRequestFilterSensitiveLog: () => ConverseRequestFilterSensitiveLog,
35
36
  ConverseStreamCommand: () => ConverseStreamCommand,
36
37
  ConverseStreamOutput: () => ConverseStreamOutput,
37
38
  ConverseStreamOutputFilterSensitiveLog: () => ConverseStreamOutputFilterSensitiveLog,
39
+ ConverseStreamRequestFilterSensitiveLog: () => ConverseStreamRequestFilterSensitiveLog,
38
40
  ConverseStreamResponseFilterSensitiveLog: () => ConverseStreamResponseFilterSensitiveLog,
39
41
  DocumentFormat: () => DocumentFormat,
40
42
  DocumentSource: () => DocumentSource,
@@ -72,6 +74,7 @@ __export(src_exports, {
72
74
  ModelStreamErrorException: () => ModelStreamErrorException,
73
75
  ModelTimeoutException: () => ModelTimeoutException,
74
76
  PayloadPartFilterSensitiveLog: () => PayloadPartFilterSensitiveLog,
77
+ PromptVariableValues: () => PromptVariableValues,
75
78
  ResourceNotFoundException: () => ResourceNotFoundException,
76
79
  ResponseStream: () => ResponseStream,
77
80
  ResponseStreamFilterSensitiveLog: () => ResponseStreamFilterSensitiveLog,
@@ -552,6 +555,14 @@ var ConversationRole = {
552
555
  ASSISTANT: "assistant",
553
556
  USER: "user"
554
557
  };
558
+ var PromptVariableValues;
559
+ ((PromptVariableValues3) => {
560
+ PromptVariableValues3.visit = /* @__PURE__ */ __name((value, visitor) => {
561
+ if (value.text !== void 0)
562
+ return visitor.text(value.text);
563
+ return visitor._(value.$unknown[0], value.$unknown[1]);
564
+ }, "visit");
565
+ })(PromptVariableValues || (PromptVariableValues = {}));
555
566
  var SystemContentBlock;
556
567
  ((SystemContentBlock3) => {
557
568
  SystemContentBlock3.visit = /* @__PURE__ */ __name((value, visitor) => {
@@ -770,6 +781,20 @@ var ResponseStream;
770
781
  return visitor._(value.$unknown[0], value.$unknown[1]);
771
782
  }, "visit");
772
783
  })(ResponseStream || (ResponseStream = {}));
784
+ var ConverseRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
785
+ ...obj,
786
+ ...obj.messages && { messages: obj.messages.map((item) => item) },
787
+ ...obj.system && { system: obj.system.map((item) => item) },
788
+ ...obj.toolConfig && { toolConfig: obj.toolConfig },
789
+ ...obj.promptVariables && { promptVariables: import_smithy_client.SENSITIVE_STRING }
790
+ }), "ConverseRequestFilterSensitiveLog");
791
+ var ConverseStreamRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
792
+ ...obj,
793
+ ...obj.messages && { messages: obj.messages.map((item) => item) },
794
+ ...obj.system && { system: obj.system.map((item) => item) },
795
+ ...obj.toolConfig && { toolConfig: obj.toolConfig },
796
+ ...obj.promptVariables && { promptVariables: import_smithy_client.SENSITIVE_STRING }
797
+ }), "ConverseStreamRequestFilterSensitiveLog");
773
798
  var ConverseStreamOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => {
774
799
  if (obj.messageStart !== void 0)
775
800
  return { messageStart: obj.messageStart };
@@ -873,6 +898,7 @@ var se_ConverseCommand = /* @__PURE__ */ __name(async (input, context) => {
873
898
  guardrailConfig: (_) => (0, import_smithy_client._json)(_),
874
899
  inferenceConfig: (_) => se_InferenceConfiguration(_, context),
875
900
  messages: (_) => se_Messages(_, context),
901
+ promptVariables: (_) => (0, import_smithy_client._json)(_),
876
902
  system: (_) => (0, import_smithy_client._json)(_),
877
903
  toolConfig: (_) => se_ToolConfiguration(_, context)
878
904
  })
@@ -895,6 +921,7 @@ var se_ConverseStreamCommand = /* @__PURE__ */ __name(async (input, context) =>
895
921
  guardrailConfig: (_) => (0, import_smithy_client._json)(_),
896
922
  inferenceConfig: (_) => se_InferenceConfiguration(_, context),
897
923
  messages: (_) => se_Messages(_, context),
924
+ promptVariables: (_) => (0, import_smithy_client._json)(_),
898
925
  system: (_) => (0, import_smithy_client._json)(_),
899
926
  toolConfig: (_) => se_ToolConfiguration(_, context)
900
927
  })
@@ -1774,7 +1801,7 @@ var _ConverseCommand = class _ConverseCommand extends import_smithy_client.Comma
1774
1801
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1775
1802
  (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1776
1803
  ];
1777
- }).s("AmazonBedrockFrontendService", "Converse", {}).n("BedrockRuntimeClient", "ConverseCommand").f(void 0, void 0).ser(se_ConverseCommand).de(de_ConverseCommand).build() {
1804
+ }).s("AmazonBedrockFrontendService", "Converse", {}).n("BedrockRuntimeClient", "ConverseCommand").f(ConverseRequestFilterSensitiveLog, void 0).ser(se_ConverseCommand).de(de_ConverseCommand).build() {
1778
1805
  };
1779
1806
  __name(_ConverseCommand, "ConverseCommand");
1780
1807
  var ConverseCommand = _ConverseCommand;
@@ -1795,7 +1822,7 @@ var _ConverseStreamCommand = class _ConverseStreamCommand extends import_smithy_
1795
1822
  eventStream: {
1796
1823
  output: true
1797
1824
  }
1798
- }).n("BedrockRuntimeClient", "ConverseStreamCommand").f(void 0, ConverseStreamResponseFilterSensitiveLog).ser(se_ConverseStreamCommand).de(de_ConverseStreamCommand).build() {
1825
+ }).n("BedrockRuntimeClient", "ConverseStreamCommand").f(ConverseStreamRequestFilterSensitiveLog, ConverseStreamResponseFilterSensitiveLog).ser(se_ConverseStreamCommand).de(de_ConverseStreamCommand).build() {
1799
1826
  };
1800
1827
  __name(_ConverseStreamCommand, "ConverseStreamCommand");
1801
1828
  var ConverseStreamCommand = _ConverseStreamCommand;
@@ -1894,6 +1921,7 @@ var BedrockRuntime = _BedrockRuntime;
1894
1921
  ToolResultStatus,
1895
1922
  ContentBlock,
1896
1923
  ConversationRole,
1924
+ PromptVariableValues,
1897
1925
  SystemContentBlock,
1898
1926
  ToolChoice,
1899
1927
  ToolInputSchema,
@@ -1911,6 +1939,8 @@ var BedrockRuntime = _BedrockRuntime;
1911
1939
  ConverseStreamOutput,
1912
1940
  Trace,
1913
1941
  ResponseStream,
1942
+ ConverseRequestFilterSensitiveLog,
1943
+ ConverseStreamRequestFilterSensitiveLog,
1914
1944
  ConverseStreamOutputFilterSensitiveLog,
1915
1945
  ConverseStreamResponseFilterSensitiveLog,
1916
1946
  InvokeModelRequestFilterSensitiveLog,
@@ -2,6 +2,7 @@ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
2
  import { getSerdePlugin } from "@smithy/middleware-serde";
3
3
  import { Command as $Command } from "@smithy/smithy-client";
4
4
  import { commonParams } from "../endpoint/EndpointParameters";
5
+ import { ConverseRequestFilterSensitiveLog } from "../models/models_0";
5
6
  import { de_ConverseCommand, se_ConverseCommand } from "../protocols/Aws_restJson1";
6
7
  export { $Command };
7
8
  export class ConverseCommand extends $Command
@@ -15,7 +16,7 @@ export class ConverseCommand extends $Command
15
16
  })
16
17
  .s("AmazonBedrockFrontendService", "Converse", {})
17
18
  .n("BedrockRuntimeClient", "ConverseCommand")
18
- .f(void 0, void 0)
19
+ .f(ConverseRequestFilterSensitiveLog, void 0)
19
20
  .ser(se_ConverseCommand)
20
21
  .de(de_ConverseCommand)
21
22
  .build() {
@@ -2,7 +2,7 @@ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
2
  import { getSerdePlugin } from "@smithy/middleware-serde";
3
3
  import { Command as $Command } from "@smithy/smithy-client";
4
4
  import { commonParams } from "../endpoint/EndpointParameters";
5
- import { ConverseStreamResponseFilterSensitiveLog, } from "../models/models_0";
5
+ import { ConverseStreamRequestFilterSensitiveLog, ConverseStreamResponseFilterSensitiveLog, } from "../models/models_0";
6
6
  import { de_ConverseStreamCommand, se_ConverseStreamCommand } from "../protocols/Aws_restJson1";
7
7
  export { $Command };
8
8
  export class ConverseStreamCommand extends $Command
@@ -20,7 +20,7 @@ export class ConverseStreamCommand extends $Command
20
20
  },
21
21
  })
22
22
  .n("BedrockRuntimeClient", "ConverseStreamCommand")
23
- .f(void 0, ConverseStreamResponseFilterSensitiveLog)
23
+ .f(ConverseStreamRequestFilterSensitiveLog, ConverseStreamResponseFilterSensitiveLog)
24
24
  .ser(se_ConverseStreamCommand)
25
25
  .de(de_ConverseStreamCommand)
26
26
  .build() {
@@ -263,6 +263,14 @@ export const ConversationRole = {
263
263
  ASSISTANT: "assistant",
264
264
  USER: "user",
265
265
  };
266
+ export var PromptVariableValues;
267
+ (function (PromptVariableValues) {
268
+ PromptVariableValues.visit = (value, visitor) => {
269
+ if (value.text !== undefined)
270
+ return visitor.text(value.text);
271
+ return visitor._(value.$unknown[0], value.$unknown[1]);
272
+ };
273
+ })(PromptVariableValues || (PromptVariableValues = {}));
266
274
  export var SystemContentBlock;
267
275
  (function (SystemContentBlock) {
268
276
  SystemContentBlock.visit = (value, visitor) => {
@@ -456,6 +464,20 @@ export var ResponseStream;
456
464
  return visitor._(value.$unknown[0], value.$unknown[1]);
457
465
  };
458
466
  })(ResponseStream || (ResponseStream = {}));
467
+ export const ConverseRequestFilterSensitiveLog = (obj) => ({
468
+ ...obj,
469
+ ...(obj.messages && { messages: obj.messages.map((item) => item) }),
470
+ ...(obj.system && { system: obj.system.map((item) => item) }),
471
+ ...(obj.toolConfig && { toolConfig: obj.toolConfig }),
472
+ ...(obj.promptVariables && { promptVariables: SENSITIVE_STRING }),
473
+ });
474
+ export const ConverseStreamRequestFilterSensitiveLog = (obj) => ({
475
+ ...obj,
476
+ ...(obj.messages && { messages: obj.messages.map((item) => item) }),
477
+ ...(obj.system && { system: obj.system.map((item) => item) }),
478
+ ...(obj.toolConfig && { toolConfig: obj.toolConfig }),
479
+ ...(obj.promptVariables && { promptVariables: SENSITIVE_STRING }),
480
+ });
459
481
  export const ConverseStreamOutputFilterSensitiveLog = (obj) => {
460
482
  if (obj.messageStart !== undefined)
461
483
  return { messageStart: obj.messageStart };
@@ -33,6 +33,7 @@ export const se_ConverseCommand = async (input, context) => {
33
33
  guardrailConfig: (_) => _json(_),
34
34
  inferenceConfig: (_) => se_InferenceConfiguration(_, context),
35
35
  messages: (_) => se_Messages(_, context),
36
+ promptVariables: (_) => _json(_),
36
37
  system: (_) => _json(_),
37
38
  toolConfig: (_) => se_ToolConfiguration(_, context),
38
39
  }));
@@ -53,6 +54,7 @@ export const se_ConverseStreamCommand = async (input, context) => {
53
54
  guardrailConfig: (_) => _json(_),
54
55
  inferenceConfig: (_) => se_InferenceConfiguration(_, context),
55
56
  messages: (_) => se_Messages(_, context),
57
+ promptVariables: (_) => _json(_),
56
58
  system: (_) => _json(_),
57
59
  toolConfig: (_) => se_ToolConfiguration(_, context),
58
60
  }));
@@ -33,6 +33,8 @@ declare const ConverseCommand_base: {
33
33
  * If a model has unique inference parameters, you can also pass those unique parameters
34
34
  * to the model.</p>
35
35
  * <p>Amazon Bedrock doesn't store any text, images, or documents that you provide as content. The data is only used to generate the response.</p>
36
+ * <p>You can submit a prompt by including it in the <code>messages</code> field, specifying the <code>modelId</code> of a foundation model or inference profile to run inference on it, and including any other fields that are relevant to your use case.</p>
37
+ * <p>You can also submit a prompt from Prompt management by specifying the ARN of the prompt version and including a map of variables to values in the <code>promptVariables</code> field. You can append more messages to the prompt by using the <code>messages</code> field. If you use a prompt from Prompt management, you can't include the following fields in the request: <code>additionalModelRequestFields</code>, <code>inferenceConfig</code>, <code>system</code>, or <code>toolConfig</code>. Instead, these fields must be defined through Prompt management. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-use.html">Use a prompt from Prompt management</a>.</p>
36
38
  * <p>For information about the Converse API, see <i>Use the Converse API</i> in the <i>Amazon Bedrock User Guide</i>.
37
39
  * To use a guardrail, see <i>Use a guardrail with the Converse API</i> in the <i>Amazon Bedrock User Guide</i>.
38
40
  * To use a tool with a model, see <i>Tool use (Function calling)</i> in the <i>Amazon Bedrock User Guide</i>
@@ -48,7 +50,7 @@ declare const ConverseCommand_base: {
48
50
  * const client = new BedrockRuntimeClient(config);
49
51
  * const input = { // ConverseRequest
50
52
  * modelId: "STRING_VALUE", // required
51
- * messages: [ // Messages // required
53
+ * messages: [ // Messages
52
54
  * { // Message
53
55
  * role: "user" || "assistant", // required
54
56
  * content: [ // ContentBlocks // required
@@ -154,6 +156,11 @@ declare const ConverseCommand_base: {
154
156
  * trace: "enabled" || "disabled",
155
157
  * },
156
158
  * additionalModelRequestFields: "DOCUMENT_VALUE",
159
+ * promptVariables: { // PromptVariableMap
160
+ * "<keys>": { // PromptVariableValues Union: only one key present
161
+ * text: "STRING_VALUE",
162
+ * },
163
+ * },
157
164
  * additionalModelResponseFieldPaths: [ // AdditionalModelResponseFieldPaths
158
165
  * "STRING_VALUE",
159
166
  * ],
@@ -39,6 +39,8 @@ declare const ConverseStreamCommand_base: {
39
39
  * <p>The CLI doesn't support streaming operations in Amazon Bedrock, including <code>ConverseStream</code>.</p>
40
40
  * </note>
41
41
  * <p>Amazon Bedrock doesn't store any text, images, or documents that you provide as content. The data is only used to generate the response.</p>
42
+ * <p>You can submit a prompt by including it in the <code>messages</code> field, specifying the <code>modelId</code> of a foundation model or inference profile to run inference on it, and including any other fields that are relevant to your use case.</p>
43
+ * <p>You can also submit a prompt from Prompt management by specifying the ARN of the prompt version and including a map of variables to values in the <code>promptVariables</code> field. You can append more messages to the prompt by using the <code>messages</code> field. If you use a prompt from Prompt management, you can't include the following fields in the request: <code>additionalModelRequestFields</code>, <code>inferenceConfig</code>, <code>system</code>, or <code>toolConfig</code>. Instead, these fields must be defined through Prompt management. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-use.html">Use a prompt from Prompt management</a>.</p>
42
44
  * <p>For information about the Converse API, see <i>Use the Converse API</i> in the <i>Amazon Bedrock User Guide</i>.
43
45
  * To use a guardrail, see <i>Use a guardrail with the Converse API</i> in the <i>Amazon Bedrock User Guide</i>.
44
46
  * To use a tool with a model, see <i>Tool use (Function calling)</i> in the <i>Amazon Bedrock User Guide</i>
@@ -54,7 +56,7 @@ declare const ConverseStreamCommand_base: {
54
56
  * const client = new BedrockRuntimeClient(config);
55
57
  * const input = { // ConverseStreamRequest
56
58
  * modelId: "STRING_VALUE", // required
57
- * messages: [ // Messages // required
59
+ * messages: [ // Messages
58
60
  * { // Message
59
61
  * role: "user" || "assistant", // required
60
62
  * content: [ // ContentBlocks // required
@@ -161,6 +163,11 @@ declare const ConverseStreamCommand_base: {
161
163
  * streamProcessingMode: "sync" || "async",
162
164
  * },
163
165
  * additionalModelRequestFields: "DOCUMENT_VALUE",
166
+ * promptVariables: { // PromptVariableMap
167
+ * "<keys>": { // PromptVariableValues Union: only one key present
168
+ * text: "STRING_VALUE",
169
+ * },
170
+ * },
164
171
  * additionalModelResponseFieldPaths: [ // AdditionalModelResponseFieldPaths
165
172
  * "STRING_VALUE",
166
173
  * ],
@@ -12,7 +12,7 @@ export { $Command };
12
12
  * @public
13
13
  */
14
14
  export type InvokeModelCommandInputType = Omit<InvokeModelRequest, "body"> & {
15
- body: BlobPayloadInputTypes;
15
+ body?: BlobPayloadInputTypes;
16
16
  };
17
17
  /**
18
18
  * @public
@@ -52,7 +52,7 @@ declare const InvokeModelCommand_base: {
52
52
  * // const { BedrockRuntimeClient, InvokeModelCommand } = require("@aws-sdk/client-bedrock-runtime"); // CommonJS import
53
53
  * const client = new BedrockRuntimeClient(config);
54
54
  * const input = { // InvokeModelRequest
55
- * body: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") // required
55
+ * body: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
56
56
  * contentType: "STRING_VALUE",
57
57
  * accept: "STRING_VALUE",
58
58
  * modelId: "STRING_VALUE", // required
@@ -11,7 +11,7 @@ export { $Command };
11
11
  * @public
12
12
  */
13
13
  export type InvokeModelWithResponseStreamCommandInputType = Omit<InvokeModelWithResponseStreamRequest, "body"> & {
14
- body: BlobPayloadInputTypes;
14
+ body?: BlobPayloadInputTypes;
15
15
  };
16
16
  /**
17
17
  * @public
@@ -50,7 +50,7 @@ declare const InvokeModelWithResponseStreamCommand_base: {
50
50
  * // const { BedrockRuntimeClient, InvokeModelWithResponseStreamCommand } = require("@aws-sdk/client-bedrock-runtime"); // CommonJS import
51
51
  * const client = new BedrockRuntimeClient(config);
52
52
  * const input = { // InvokeModelWithResponseStreamRequest
53
- * body: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") // required
53
+ * body: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
54
54
  * contentType: "STRING_VALUE",
55
55
  * accept: "STRING_VALUE",
56
56
  * modelId: "STRING_VALUE", // required
@@ -1322,6 +1322,36 @@ export interface Message {
1322
1322
  */
1323
1323
  content: ContentBlock[] | undefined;
1324
1324
  }
1325
+ /**
1326
+ * <p>Contains a map of variables in a prompt from Prompt management to an object containing the values to fill in for them when running model invocation. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-how.html">How Prompt management works</a>.</p>
1327
+ * @public
1328
+ */
1329
+ export type PromptVariableValues = PromptVariableValues.TextMember | PromptVariableValues.$UnknownMember;
1330
+ /**
1331
+ * @public
1332
+ */
1333
+ export declare namespace PromptVariableValues {
1334
+ /**
1335
+ * <p>The text value that the variable maps to.</p>
1336
+ * @public
1337
+ */
1338
+ interface TextMember {
1339
+ text: string;
1340
+ $unknown?: never;
1341
+ }
1342
+ /**
1343
+ * @public
1344
+ */
1345
+ interface $UnknownMember {
1346
+ text?: never;
1347
+ $unknown: [string, any];
1348
+ }
1349
+ interface Visitor<T> {
1350
+ text: (value: string) => T;
1351
+ _: (name: string, value: any) => T;
1352
+ }
1353
+ const visit: <T>(value: PromptVariableValues, visitor: Visitor<T>) => T;
1354
+ }
1325
1355
  /**
1326
1356
  * <p>A system content block.</p>
1327
1357
  * @public
@@ -1556,8 +1586,7 @@ export interface ToolConfiguration {
1556
1586
  */
1557
1587
  export interface ConverseRequest {
1558
1588
  /**
1559
- * <p>The identifier for the model that you want to call.</p>
1560
- * <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
1589
+ * <p>Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource that you use:</p>
1561
1590
  * <ul>
1562
1591
  * <li>
1563
1592
  * <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p>
@@ -1571,6 +1600,9 @@ export interface ConverseRequest {
1571
1600
  * <li>
1572
1601
  * <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p>
1573
1602
  * </li>
1603
+ * <li>
1604
+ * <p>To include a prompt that was defined in Prompt management, specify the ARN of the prompt version to use.</p>
1605
+ * </li>
1574
1606
  * </ul>
1575
1607
  * <p>The Converse API doesn't support <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported models</a>.</p>
1576
1608
  * @public
@@ -1580,14 +1612,14 @@ export interface ConverseRequest {
1580
1612
  * <p>The messages that you want to send to the model.</p>
1581
1613
  * @public
1582
1614
  */
1583
- messages: Message[] | undefined;
1615
+ messages?: Message[];
1584
1616
  /**
1585
- * <p>A system prompt to pass to the model.</p>
1617
+ * <p>A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.</p>
1586
1618
  * @public
1587
1619
  */
1588
1620
  system?: SystemContentBlock[];
1589
1621
  /**
1590
- * <p>Inference parameters to pass to the model. <code>Converse</code> supports a base
1622
+ * <p>Inference parameters to pass to the model. <code>Converse</code> and <code>ConverseStream</code> support a base
1591
1623
  * set of inference parameters. If you need to pass additional parameters that the model
1592
1624
  * supports, use the <code>additionalModelRequestFields</code> request field.</p>
1593
1625
  * @public
@@ -1602,20 +1634,25 @@ export interface ConverseRequest {
1602
1634
  */
1603
1635
  toolConfig?: ToolConfiguration;
1604
1636
  /**
1605
- * <p>Configuration information for a guardrail that you want to use in the request. </p>
1637
+ * <p>Configuration information for a guardrail that you want to use in the request. If you include <code>guardContent</code> blocks in the <code>content</code> field in the <code>messages</code> field, the guardrail operates only on those messages. If you include no <code>guardContent</code> blocks, the guardrail operates on all messages in the request body and in any included prompt resource.</p>
1606
1638
  * @public
1607
1639
  */
1608
1640
  guardrailConfig?: GuardrailConfiguration;
1609
1641
  /**
1610
1642
  * <p>Additional inference parameters that the model supports, beyond the
1611
- * base set of inference parameters that <code>Converse</code> supports in the <code>inferenceConfig</code>
1643
+ * base set of inference parameters that <code>Converse</code> and <code>ConverseStream</code> support in the <code>inferenceConfig</code>
1612
1644
  * field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
1613
1645
  * @public
1614
1646
  */
1615
1647
  additionalModelRequestFields?: __DocumentType;
1648
+ /**
1649
+ * <p>Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the <code>modelId</code> field.</p>
1650
+ * @public
1651
+ */
1652
+ promptVariables?: Record<string, PromptVariableValues>;
1616
1653
  /**
1617
1654
  * <p>Additional model parameters field paths to return in the
1618
- * response. <code>Converse</code> returns the requested fields as a JSON Pointer object in the
1655
+ * response. <code>Converse</code> and <code>ConverseStream</code> return the requested fields as a JSON Pointer object in the
1619
1656
  * <code>additionalModelResponseFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
1620
1657
  * <p>
1621
1658
  * <code>[
@@ -1623,9 +1660,9 @@ export interface ConverseRequest {
1623
1660
  * ]</code>
1624
1661
  * </p>
1625
1662
  * <p>For information about the JSON Pointer syntax, see the
1626
- * <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
1663
+ * <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
1627
1664
  * <p>
1628
- * <code>Converse</code> rejects an empty JSON Pointer or incorrectly structured
1665
+ * <code>Converse</code> and <code>ConverseStream</code> reject an empty JSON Pointer or incorrectly structured
1629
1666
  * JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested
1630
1667
  * field is not in the model response, it is ignored by <code>Converse</code>.</p>
1631
1668
  * @public
@@ -1887,8 +1924,7 @@ export interface GuardrailStreamConfiguration {
1887
1924
  */
1888
1925
  export interface ConverseStreamRequest {
1889
1926
  /**
1890
- * <p>The ID for the model.</p>
1891
- * <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
1927
+ * <p>Specifies the model or throughput with which to run inference, or the prompt resource to use in inference. The value depends on the resource that you use:</p>
1892
1928
  * <ul>
1893
1929
  * <li>
1894
1930
  * <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p>
@@ -1902,6 +1938,9 @@ export interface ConverseStreamRequest {
1902
1938
  * <li>
1903
1939
  * <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p>
1904
1940
  * </li>
1941
+ * <li>
1942
+ * <p>To include a prompt that was defined in Prompt management, specify the ARN of the prompt version to use.</p>
1943
+ * </li>
1905
1944
  * </ul>
1906
1945
  * <p>The Converse API doesn't support <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported models</a>.</p>
1907
1946
  * @public
@@ -1911,14 +1950,14 @@ export interface ConverseStreamRequest {
1911
1950
  * <p>The messages that you want to send to the model.</p>
1912
1951
  * @public
1913
1952
  */
1914
- messages: Message[] | undefined;
1953
+ messages?: Message[];
1915
1954
  /**
1916
- * <p>A system prompt to send to the model.</p>
1955
+ * <p>A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.</p>
1917
1956
  * @public
1918
1957
  */
1919
1958
  system?: SystemContentBlock[];
1920
1959
  /**
1921
- * <p>Inference parameters to pass to the model. <code>ConverseStream</code> supports a base
1960
+ * <p>Inference parameters to pass to the model. <code>Converse</code> and <code>ConverseStream</code> support a base
1922
1961
  * set of inference parameters. If you need to pass additional parameters that the model
1923
1962
  * supports, use the <code>additionalModelRequestFields</code> request field.</p>
1924
1963
  * @public
@@ -1933,20 +1972,25 @@ export interface ConverseStreamRequest {
1933
1972
  */
1934
1973
  toolConfig?: ToolConfiguration;
1935
1974
  /**
1936
- * <p>Configuration information for a guardrail that you want to use in the request. </p>
1975
+ * <p>Configuration information for a guardrail that you want to use in the request. If you include <code>guardContent</code> blocks in the <code>content</code> field in the <code>messages</code> field, the guardrail operates only on those messages. If you include no <code>guardContent</code> blocks, the guardrail operates on all messages in the request body and in any included prompt resource.</p>
1937
1976
  * @public
1938
1977
  */
1939
1978
  guardrailConfig?: GuardrailStreamConfiguration;
1940
1979
  /**
1941
1980
  * <p>Additional inference parameters that the model supports, beyond the
1942
- * base set of inference parameters that <code>ConverseStream</code> supports in the <code>inferenceConfig</code>
1943
- * field.</p>
1981
+ * base set of inference parameters that <code>Converse</code> and <code>ConverseStream</code> support in the <code>inferenceConfig</code>
1982
+ * field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
1944
1983
  * @public
1945
1984
  */
1946
1985
  additionalModelRequestFields?: __DocumentType;
1986
+ /**
1987
+ * <p>Contains a map of variables in a prompt from Prompt management to objects containing the values to fill in for them when running model invocation. This field is ignored if you don't specify a prompt resource in the <code>modelId</code> field.</p>
1988
+ * @public
1989
+ */
1990
+ promptVariables?: Record<string, PromptVariableValues>;
1947
1991
  /**
1948
1992
  * <p>Additional model parameters field paths to return in the
1949
- * response. <code>ConverseStream</code> returns the requested fields as a JSON Pointer object in the
1993
+ * response. <code>Converse</code> and <code>ConverseStream</code> return the requested fields as a JSON Pointer object in the
1950
1994
  * <code>additionalModelResponseFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
1951
1995
  * <p>
1952
1996
  * <code>[
@@ -1954,11 +1998,11 @@ export interface ConverseStreamRequest {
1954
1998
  * ]</code>
1955
1999
  * </p>
1956
2000
  * <p>For information about the JSON Pointer syntax, see the
1957
- * <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
2001
+ * <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
1958
2002
  * <p>
1959
- * <code>ConverseStream</code> rejects an empty JSON Pointer or incorrectly structured
2003
+ * <code>Converse</code> and <code>ConverseStream</code> reject an empty JSON Pointer or incorrectly structured
1960
2004
  * JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested
1961
- * field is not in the model response, it is ignored by <code>ConverseStream</code>.</p>
2005
+ * field is not in the model response, it is ignored by <code>Converse</code>.</p>
1962
2006
  * @public
1963
2007
  */
1964
2008
  additionalModelResponseFieldPaths?: string[];
@@ -2467,7 +2511,7 @@ export interface InvokeModelRequest {
2467
2511
  * <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
2468
2512
  * @public
2469
2513
  */
2470
- body: Uint8Array | undefined;
2514
+ body?: Uint8Array;
2471
2515
  /**
2472
2516
  * <p>The MIME type of the input data in the request. You must specify
2473
2517
  * <code>application/json</code>.</p>
@@ -2551,7 +2595,7 @@ export interface InvokeModelWithResponseStreamRequest {
2551
2595
  * <p>The prompt and inference parameters in the format specified in the <code>contentType</code> in the header. You must provide the body in JSON format. To see the format and content of the request and response bodies for different models, refer to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters</a>. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html">Run inference</a> in the Bedrock User Guide.</p>
2552
2596
  * @public
2553
2597
  */
2554
- body: Uint8Array | undefined;
2598
+ body?: Uint8Array;
2555
2599
  /**
2556
2600
  * <p>The MIME type of the input data in the request. You must specify
2557
2601
  * <code>application/json</code>.</p>
@@ -2771,6 +2815,14 @@ export interface InvokeModelWithResponseStreamResponse {
2771
2815
  */
2772
2816
  contentType: string | undefined;
2773
2817
  }
2818
+ /**
2819
+ * @internal
2820
+ */
2821
+ export declare const ConverseRequestFilterSensitiveLog: (obj: ConverseRequest) => any;
2822
+ /**
2823
+ * @internal
2824
+ */
2825
+ export declare const ConverseStreamRequestFilterSensitiveLog: (obj: ConverseStreamRequest) => any;
2774
2826
  /**
2775
2827
  * @internal
2776
2828
  */
@@ -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 {}
@@ -558,6 +558,24 @@ export interface Message {
558
558
  role: ConversationRole | undefined;
559
559
  content: ContentBlock[] | undefined;
560
560
  }
561
+ export type PromptVariableValues =
562
+ | PromptVariableValues.TextMember
563
+ | PromptVariableValues.$UnknownMember;
564
+ export declare namespace PromptVariableValues {
565
+ interface TextMember {
566
+ text: string;
567
+ $unknown?: never;
568
+ }
569
+ interface $UnknownMember {
570
+ text?: never;
571
+ $unknown: [string, any];
572
+ }
573
+ interface Visitor<T> {
574
+ text: (value: string) => T;
575
+ _: (name: string, value: any) => T;
576
+ }
577
+ const visit: <T>(value: PromptVariableValues, visitor: Visitor<T>) => T;
578
+ }
561
579
  export type SystemContentBlock =
562
580
  | SystemContentBlock.GuardContentMember
563
581
  | SystemContentBlock.TextMember
@@ -673,12 +691,13 @@ export interface ToolConfiguration {
673
691
  }
674
692
  export interface ConverseRequest {
675
693
  modelId: string | undefined;
676
- messages: Message[] | undefined;
694
+ messages?: Message[];
677
695
  system?: SystemContentBlock[];
678
696
  inferenceConfig?: InferenceConfiguration;
679
697
  toolConfig?: ToolConfiguration;
680
698
  guardrailConfig?: GuardrailConfiguration;
681
699
  additionalModelRequestFields?: __DocumentType;
700
+ promptVariables?: Record<string, PromptVariableValues>;
682
701
  additionalModelResponseFieldPaths?: string[];
683
702
  }
684
703
  export interface ConverseMetrics {
@@ -777,12 +796,13 @@ export interface GuardrailStreamConfiguration {
777
796
  }
778
797
  export interface ConverseStreamRequest {
779
798
  modelId: string | undefined;
780
- messages: Message[] | undefined;
799
+ messages?: Message[];
781
800
  system?: SystemContentBlock[];
782
801
  inferenceConfig?: InferenceConfiguration;
783
802
  toolConfig?: ToolConfiguration;
784
803
  guardrailConfig?: GuardrailStreamConfiguration;
785
804
  additionalModelRequestFields?: __DocumentType;
805
+ promptVariables?: Record<string, PromptVariableValues>;
786
806
  additionalModelResponseFieldPaths?: string[];
787
807
  }
788
808
  export interface ToolUseBlockDelta {
@@ -1082,7 +1102,7 @@ export declare const Trace: {
1082
1102
  };
1083
1103
  export type Trace = (typeof Trace)[keyof typeof Trace];
1084
1104
  export interface InvokeModelRequest {
1085
- body: Uint8Array | undefined;
1105
+ body?: Uint8Array;
1086
1106
  contentType?: string;
1087
1107
  accept?: string;
1088
1108
  modelId: string | undefined;
@@ -1095,7 +1115,7 @@ export interface InvokeModelResponse {
1095
1115
  contentType: string | undefined;
1096
1116
  }
1097
1117
  export interface InvokeModelWithResponseStreamRequest {
1098
- body: Uint8Array | undefined;
1118
+ body?: Uint8Array;
1099
1119
  contentType?: string;
1100
1120
  accept?: string;
1101
1121
  modelId: string | undefined;
@@ -1212,6 +1232,12 @@ export interface InvokeModelWithResponseStreamResponse {
1212
1232
  body: AsyncIterable<ResponseStream> | undefined;
1213
1233
  contentType: string | undefined;
1214
1234
  }
1235
+ export declare const ConverseRequestFilterSensitiveLog: (
1236
+ obj: ConverseRequest
1237
+ ) => any;
1238
+ export declare const ConverseStreamRequestFilterSensitiveLog: (
1239
+ obj: ConverseStreamRequest
1240
+ ) => any;
1215
1241
  export declare const ConverseStreamOutputFilterSensitiveLog: (
1216
1242
  obj: ConverseStreamOutput
1217
1243
  ) => 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.687.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",
23
+ "@aws-sdk/client-sso-oidc": "3.687.0",
24
+ "@aws-sdk/client-sts": "3.687.0",
25
25
  "@aws-sdk/core": "3.686.0",
26
- "@aws-sdk/credential-provider-node": "3.686.0",
26
+ "@aws-sdk/credential-provider-node": "3.687.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.687.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.687.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",