Skip to content

Commit f87e55a

Browse files
author
awstools
committed
feat(client-bedrock-runtime): Add an API parameter that allows customers to set performance configuration for invoking a model.
1 parent 044441e commit f87e55a

File tree

8 files changed

+349
-77
lines changed

8 files changed

+349
-77
lines changed

Diff for: clients/client-bedrock-runtime/src/commands/ApplyGuardrailCommand.ts

+10-5
Original file line numberDiff line numberDiff line change
@@ -166,22 +166,27 @@ export interface ApplyGuardrailCommandOutput extends ApplyGuardrailResponse, __M
166166
* @see {@link BedrockRuntimeClientResolvedConfig | config} for BedrockRuntimeClient's `config` shape.
167167
*
168168
* @throws {@link AccessDeniedException} (client fault)
169-
* <p>The request is denied because of missing access permissions.</p>
169+
* <p>The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error,
170+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-access-denied">AccessDeniedException</a> in the Amazon Bedrock User Guide</p>
170171
*
171172
* @throws {@link InternalServerException} (server fault)
172-
* <p>An internal server error occurred. Retry your request.</p>
173+
* <p>An internal server error occurred. For troubleshooting this error,
174+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-internal-failure">InternalFailure</a> in the Amazon Bedrock User Guide</p>
173175
*
174176
* @throws {@link ResourceNotFoundException} (client fault)
175-
* <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
177+
* <p>The specified resource ARN was not found. For troubleshooting this error,
178+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-resource-not-found">ResourceNotFound</a> in the Amazon Bedrock User Guide</p>
176179
*
177180
* @throws {@link ServiceQuotaExceededException} (client fault)
178181
* <p>Your request exceeds the service quota for your account. You can view your quotas at <a href="https://docs.aws.amazon.com/servicequotas/latest/userguide/gs-request-quota.html">Viewing service quotas</a>. You can resubmit your request later.</p>
179182
*
180183
* @throws {@link ThrottlingException} (client fault)
181-
* <p>Your request was throttled because of service-wide limitations. Resubmit your request later or in a different region. You can also purchase <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html">Provisioned Throughput</a> to increase the rate or number of tokens you can process.</p>
184+
* <p>Your request was denied due to exceeding the account quotas for <i>Amazon Bedrock</i>. For
185+
* troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception">ThrottlingException</a> in the Amazon Bedrock User Guide</p>
182186
*
183187
* @throws {@link ValidationException} (client fault)
184-
* <p>Input validation failed. Check your request parameters and retry the request.</p>
188+
* <p>The input fails to satisfy the constraints specified by <i>Amazon Bedrock</i>. For troubleshooting this error,
189+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error">ValidationError</a> in the Amazon Bedrock User Guide</p>
185190
*
186191
* @throws {@link BedrockRuntimeServiceException}
187192
* <p>Base exception class for all service exceptions from BedrockRuntime service.</p>

Diff for: clients/client-bedrock-runtime/src/commands/ConverseCommand.ts

+30-9
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ export interface ConverseCommandOutput extends ConverseResponse, __MetadataBeare
4343
* <p>For example code, see <i>Converse API examples</i> in the <i>Amazon Bedrock User Guide</i>.
4444
* </p>
4545
* <p>This operation requires permission for the <code>bedrock:InvokeModel</code> action. </p>
46+
* <important>
47+
* <p>To deny all inference access to resources that you specify in the modelId field, you
48+
* need to deny access to the <code>bedrock:InvokeModel</code> and
49+
* <code>bedrock:InvokeModelWithResponseStream</code> actions. Doing this also denies
50+
* access to the resource through the base inference actions (<a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModel.html">InvokeModel</a> and <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModelWithResponseStream.html">InvokeModelWithResponseStream</a>). For more information see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/security_iam_id-based-policy-examples.html#security_iam_id-based-policy-examples-deny-inference">Deny access for inference on specific models</a>.
51+
* </p>
52+
* </important>
53+
* <p>For troubleshooting some of the common errors you might encounter when using the <code>Converse</code> API,
54+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html">Troubleshooting Amazon Bedrock API Error Codes</a> in the Amazon Bedrock User Guide</p>
4655
* @example
4756
* Use a bare-bones client and the command you need to make an API call.
4857
* ```javascript
@@ -165,6 +174,9 @@ export interface ConverseCommandOutput extends ConverseResponse, __MetadataBeare
165174
* additionalModelResponseFieldPaths: [ // AdditionalModelResponseFieldPaths
166175
* "STRING_VALUE",
167176
* ],
177+
* performanceConfig: { // PerformanceConfiguration
178+
* latency: "standard" || "optimized",
179+
* },
168180
* };
169181
* const command = new ConverseCommand(input);
170182
* const response = await client.send(command);
@@ -411,6 +423,9 @@ export interface ConverseCommandOutput extends ConverseResponse, __MetadataBeare
411423
* // },
412424
* // },
413425
* // },
426+
* // performanceConfig: { // PerformanceConfiguration
427+
* // latency: "standard" || "optimized",
428+
* // },
414429
* // };
415430
*
416431
* ```
@@ -422,34 +437,40 @@ export interface ConverseCommandOutput extends ConverseResponse, __MetadataBeare
422437
* @see {@link BedrockRuntimeClientResolvedConfig | config} for BedrockRuntimeClient's `config` shape.
423438
*
424439
* @throws {@link AccessDeniedException} (client fault)
425-
* <p>The request is denied because of missing access permissions.</p>
440+
* <p>The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error,
441+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-access-denied">AccessDeniedException</a> in the Amazon Bedrock User Guide</p>
426442
*
427443
* @throws {@link InternalServerException} (server fault)
428-
* <p>An internal server error occurred. Retry your request.</p>
444+
* <p>An internal server error occurred. For troubleshooting this error,
445+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-internal-failure">InternalFailure</a> in the Amazon Bedrock User Guide</p>
429446
*
430447
* @throws {@link ModelErrorException} (client fault)
431448
* <p>The request failed due to an error while processing the model.</p>
432449
*
433450
* @throws {@link ModelNotReadyException} (client fault)
434451
* <p>The model specified in the request is not ready to serve inference requests. The AWS SDK
435-
* will automatically retry the operation up to 5 times. For information about configuring
436-
* automatic retries, see <a href="https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html">Retry behavior</a> in the <i>AWS SDKs and Tools</i>
437-
* reference guide.</p>
452+
* will automatically retry the operation up to 5 times. For information about configuring
453+
* automatic retries, see <a href="https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html">Retry behavior</a> in the <i>AWS SDKs and Tools</i>
454+
* reference guide.</p>
438455
*
439456
* @throws {@link ModelTimeoutException} (client fault)
440457
* <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
441458
*
442459
* @throws {@link ResourceNotFoundException} (client fault)
443-
* <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
460+
* <p>The specified resource ARN was not found. For troubleshooting this error,
461+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-resource-not-found">ResourceNotFound</a> in the Amazon Bedrock User Guide</p>
444462
*
445463
* @throws {@link ServiceUnavailableException} (server fault)
446-
* <p>The service isn't currently available. Try again later.</p>
464+
* <p>The service isn't currently available. For troubleshooting this error,
465+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-service-unavailable">ServiceUnavailable</a> in the Amazon Bedrock User Guide</p>
447466
*
448467
* @throws {@link ThrottlingException} (client fault)
449-
* <p>Your request was throttled because of service-wide limitations. Resubmit your request later or in a different region. You can also purchase <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html">Provisioned Throughput</a> to increase the rate or number of tokens you can process.</p>
468+
* <p>Your request was denied due to exceeding the account quotas for <i>Amazon Bedrock</i>. For
469+
* troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception">ThrottlingException</a> in the Amazon Bedrock User Guide</p>
450470
*
451471
* @throws {@link ValidationException} (client fault)
452-
* <p>Input validation failed. Check your request parameters and retry the request.</p>
472+
* <p>The input fails to satisfy the constraints specified by <i>Amazon Bedrock</i>. For troubleshooting this error,
473+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error">ValidationError</a> in the Amazon Bedrock User Guide</p>
453474
*
454475
* @throws {@link BedrockRuntimeServiceException}
455476
* <p>Base exception class for all service exceptions from BedrockRuntime service.</p>

Diff for: clients/client-bedrock-runtime/src/commands/ConverseStreamCommand.ts

+30-9
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ export interface ConverseStreamCommandOutput extends ConverseStreamResponse, __M
5454
* <p>For example code, see <i>Conversation streaming example</i> in the <i>Amazon Bedrock User Guide</i>.
5555
* </p>
5656
* <p>This operation requires permission for the <code>bedrock:InvokeModelWithResponseStream</code> action.</p>
57+
* <important>
58+
* <p>To deny all inference access to resources that you specify in the modelId field, you
59+
* need to deny access to the <code>bedrock:InvokeModel</code> and
60+
* <code>bedrock:InvokeModelWithResponseStream</code> actions. Doing this also denies
61+
* access to the resource through the base inference actions (<a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModel.html">InvokeModel</a> and <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModelWithResponseStream.html">InvokeModelWithResponseStream</a>). For more information see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/security_iam_id-based-policy-examples.html#security_iam_id-based-policy-examples-deny-inference">Deny access for inference on specific models</a>.
62+
* </p>
63+
* </important>
64+
* <p>For troubleshooting some of the common errors you might encounter when using the <code>ConverseStream</code> API,
65+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html">Troubleshooting Amazon Bedrock API Error Codes</a> in the Amazon Bedrock User Guide</p>
5766
* @example
5867
* Use a bare-bones client and the command you need to make an API call.
5968
* ```javascript
@@ -177,6 +186,9 @@ export interface ConverseStreamCommandOutput extends ConverseStreamResponse, __M
177186
* additionalModelResponseFieldPaths: [ // AdditionalModelResponseFieldPaths
178187
* "STRING_VALUE",
179188
* ],
189+
* performanceConfig: { // PerformanceConfiguration
190+
* latency: "standard" || "optimized",
191+
* },
180192
* };
181193
* const command = new ConverseStreamCommand(input);
182194
* const response = await client.send(command);
@@ -392,6 +404,9 @@ export interface ConverseStreamCommandOutput extends ConverseStreamResponse, __M
392404
* // },
393405
* // },
394406
* // },
407+
* // performanceConfig: { // PerformanceConfiguration
408+
* // latency: "standard" || "optimized",
409+
* // },
395410
* // },
396411
* // internalServerException: { // InternalServerException
397412
* // message: "STRING_VALUE",
@@ -422,34 +437,40 @@ export interface ConverseStreamCommandOutput extends ConverseStreamResponse, __M
422437
* @see {@link BedrockRuntimeClientResolvedConfig | config} for BedrockRuntimeClient's `config` shape.
423438
*
424439
* @throws {@link AccessDeniedException} (client fault)
425-
* <p>The request is denied because of missing access permissions.</p>
440+
* <p>The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error,
441+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-access-denied">AccessDeniedException</a> in the Amazon Bedrock User Guide</p>
426442
*
427443
* @throws {@link InternalServerException} (server fault)
428-
* <p>An internal server error occurred. Retry your request.</p>
444+
* <p>An internal server error occurred. For troubleshooting this error,
445+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-internal-failure">InternalFailure</a> in the Amazon Bedrock User Guide</p>
429446
*
430447
* @throws {@link ModelErrorException} (client fault)
431448
* <p>The request failed due to an error while processing the model.</p>
432449
*
433450
* @throws {@link ModelNotReadyException} (client fault)
434451
* <p>The model specified in the request is not ready to serve inference requests. The AWS SDK
435-
* will automatically retry the operation up to 5 times. For information about configuring
436-
* automatic retries, see <a href="https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html">Retry behavior</a> in the <i>AWS SDKs and Tools</i>
437-
* reference guide.</p>
452+
* will automatically retry the operation up to 5 times. For information about configuring
453+
* automatic retries, see <a href="https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html">Retry behavior</a> in the <i>AWS SDKs and Tools</i>
454+
* reference guide.</p>
438455
*
439456
* @throws {@link ModelTimeoutException} (client fault)
440457
* <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
441458
*
442459
* @throws {@link ResourceNotFoundException} (client fault)
443-
* <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
460+
* <p>The specified resource ARN was not found. For troubleshooting this error,
461+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-resource-not-found">ResourceNotFound</a> in the Amazon Bedrock User Guide</p>
444462
*
445463
* @throws {@link ServiceUnavailableException} (server fault)
446-
* <p>The service isn't currently available. Try again later.</p>
464+
* <p>The service isn't currently available. For troubleshooting this error,
465+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-service-unavailable">ServiceUnavailable</a> in the Amazon Bedrock User Guide</p>
447466
*
448467
* @throws {@link ThrottlingException} (client fault)
449-
* <p>Your request was throttled because of service-wide limitations. Resubmit your request later or in a different region. You can also purchase <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html">Provisioned Throughput</a> to increase the rate or number of tokens you can process.</p>
468+
* <p>Your request was denied due to exceeding the account quotas for <i>Amazon Bedrock</i>. For
469+
* troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception">ThrottlingException</a> in the Amazon Bedrock User Guide</p>
450470
*
451471
* @throws {@link ValidationException} (client fault)
452-
* <p>Input validation failed. Check your request parameters and retry the request.</p>
472+
* <p>The input fails to satisfy the constraints specified by <i>Amazon Bedrock</i>. For troubleshooting this error,
473+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error">ValidationError</a> in the Amazon Bedrock User Guide</p>
453474
*
454475
* @throws {@link BedrockRuntimeServiceException}
455476
* <p>Base exception class for all service exceptions from BedrockRuntime service.</p>

0 commit comments

Comments
 (0)