Skip to content

Commit

Permalink
feat(client-bedrock-runtime): Add support for imported-model in invok…
Browse files Browse the repository at this point in the history
…eModel and InvokeModelWithResponseStream.
  • Loading branch information
awstools committed Aug 29, 2024
1 parent 9b44396 commit 54243d5
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,10 @@ export interface ConverseCommandOutput extends ConverseResponse, __MetadataBeare
* <p>The request failed due to an error while processing the model.</p>
*
* @throws {@link ModelNotReadyException} (client fault)
* <p>The model specified in the request is not ready to serve inference requests.</p>
* <p>The model specified in the request is not ready to serve inference requests. The AWS SDK
* will automatically retry the operation up to 5 times. For information about configuring
* 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>
* reference guide.</p>
*
* @throws {@link ModelTimeoutException} (client fault)
* <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,10 @@ export interface ConverseStreamCommandOutput extends ConverseStreamResponse, __M
* <p>The request failed due to an error while processing the model.</p>
*
* @throws {@link ModelNotReadyException} (client fault)
* <p>The model specified in the request is not ready to serve inference requests.</p>
* <p>The model specified in the request is not ready to serve inference requests. The AWS SDK
* will automatically retry the operation up to 5 times. For information about configuring
* 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>
* reference guide.</p>
*
* @throws {@link ModelTimeoutException} (client fault)
* <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ export interface InvokeModelCommandOutput extends InvokeModelCommandOutputType,
* <p>The request failed due to an error while processing the model.</p>
*
* @throws {@link ModelNotReadyException} (client fault)
* <p>The model specified in the request is not ready to serve inference requests.</p>
* <p>The model specified in the request is not ready to serve inference requests. The AWS SDK
* will automatically retry the operation up to 5 times. For information about configuring
* 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>
* reference guide.</p>
*
* @throws {@link ModelTimeoutException} (client fault)
* <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ export interface InvokeModelWithResponseStreamCommandOutput
* <p>The request failed due to an error while processing the model.</p>
*
* @throws {@link ModelNotReadyException} (client fault)
* <p>The model specified in the request is not ready to serve inference requests.</p>
* <p>The model specified in the request is not ready to serve inference requests. The AWS SDK
* will automatically retry the operation up to 5 times. For information about configuring
* 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>
* reference guide.</p>
*
* @throws {@link ModelStreamErrorException} (client fault)
* <p>An error occurred while streaming the response. Retry your request.</p>
Expand Down
24 changes: 21 additions & 3 deletions clients/client-bedrock-runtime/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1780,18 +1780,22 @@ export interface ToolConfiguration {
export interface ConverseRequest {
/**
* <p>The identifier for the model that you want to call.</p>
* <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
* <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
* <ul>
* <li>
* <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>
* </li>
* <li>
* <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p>
* </li>
* <li>
* <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p>
* </li>
* <li>
* <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>
* </li>
* </ul>
* <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>
* @public
*/
modelId: string | undefined;
Expand Down Expand Up @@ -2065,12 +2069,16 @@ export class ModelErrorException extends __BaseException {
}

/**
* <p>The model specified in the request is not ready to serve inference requests.</p>
* <p>The model specified in the request is not ready to serve inference requests. The AWS SDK
* will automatically retry the operation up to 5 times. For information about configuring
* 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>
* reference guide.</p>
* @public
*/
export class ModelNotReadyException extends __BaseException {
readonly name: "ModelNotReadyException" = "ModelNotReadyException";
readonly $fault: "client" = "client";
$retryable = {};
/**
* @internal
*/
Expand Down Expand Up @@ -2178,18 +2186,22 @@ export interface GuardrailStreamConfiguration {
export interface ConverseStreamRequest {
/**
* <p>The ID for the model.</p>
* <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
* <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
* <ul>
* <li>
* <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>
* </li>
* <li>
* <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p>
* </li>
* <li>
* <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p>
* </li>
* <li>
* <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>
* </li>
* </ul>
* <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>
* @public
*/
modelId: string | undefined;
Expand Down Expand Up @@ -2884,6 +2896,9 @@ export interface InvokeModelRequest {
* <li>
* <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>
* </li>
* <li>
* <p>If you use an <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported model</a>, specify the ARN of the imported model. You can get the model ARN from a successful call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html">CreateModelImportJob</a> or from the Imported models page in the Amazon Bedrock console.</p>
* </li>
* </ul>
* @public
*/
Expand Down Expand Up @@ -2975,6 +2990,9 @@ export interface InvokeModelWithResponseStreamRequest {
* <li>
* <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>
* </li>
* <li>
* <p>If you use an <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported model</a>, specify the ARN of the imported model. You can get the model ARN from a successful call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html">CreateModelImportJob</a> or from the Imported models page in the Amazon Bedrock console.</p>
* </li>
* </ul>
* @public
*/
Expand Down
Loading

0 comments on commit 54243d5

Please sign in to comment.