From 690bc7f848c59958ce107628d424aa5c750a2120 Mon Sep 17 00:00:00 2001 From: awstools Date: Thu, 25 Jul 2024 19:38:55 +0000 Subject: [PATCH] feat(client-bedrock-runtime): Provides ServiceUnavailableException error message --- .../src/commands/ApplyGuardrailCommand.ts | 4 +- .../src/commands/ConverseCommand.ts | 8 +- .../src/commands/ConverseStreamCommand.ts | 12 ++- .../src/commands/InvokeModelCommand.ts | 7 +- .../InvokeModelWithResponseStreamCommand.ts | 12 ++- .../src/models/models_0.ts | 90 ++++++++++++++++++- .../src/protocols/Aws_restJson1.ts | 50 +++++++++++ .../aws-models/bedrock-runtime.json | 46 ++++++++-- 8 files changed, 210 insertions(+), 19 deletions(-) diff --git a/clients/client-bedrock-runtime/src/commands/ApplyGuardrailCommand.ts b/clients/client-bedrock-runtime/src/commands/ApplyGuardrailCommand.ts index 4d97be9f189b..b05b9f4ac753 100644 --- a/clients/client-bedrock-runtime/src/commands/ApplyGuardrailCommand.ts +++ b/clients/client-bedrock-runtime/src/commands/ApplyGuardrailCommand.ts @@ -151,10 +151,10 @@ export interface ApplyGuardrailCommandOutput extends ApplyGuardrailResponse, __M *

The specified resource ARN was not found. Check the ARN and try your request again.

* * @throws {@link ServiceQuotaExceededException} (client fault) - *

The number of requests exceeds the service quota. Resubmit your request later.

+ *

Your request exceeds the service quota for your account. You can view your quotas at Viewing service quotas. You can resubmit your request later.

* * @throws {@link ThrottlingException} (client fault) - *

The number of requests exceeds the limit. Resubmit your request later.

+ *

Your request was throttled because of service-wide limitations. Resubmit your request later or in a different region. You can also purchase Provisioned Throughput to increase the rate or number of tokens you can process.

* * @throws {@link ValidationException} (client fault) *

Input validation failed. Check your request parameters and retry the request.

diff --git a/clients/client-bedrock-runtime/src/commands/ConverseCommand.ts b/clients/client-bedrock-runtime/src/commands/ConverseCommand.ts index 88844a57cc4a..baf9e1bf2c42 100644 --- a/clients/client-bedrock-runtime/src/commands/ConverseCommand.ts +++ b/clients/client-bedrock-runtime/src/commands/ConverseCommand.ts @@ -31,8 +31,9 @@ export interface ConverseCommandOutput extends ConverseResponse, __MetadataBeare *

Sends messages to the specified Amazon Bedrock model. Converse provides * a consistent interface that works with all models that * support messages. This allows you to write code once and use it with different models. - * Should a model have unique inference parameters, you can also pass those unique parameters + * If a model has unique inference parameters, you can also pass those unique parameters * to the model.

+ *

Amazon Bedrock doesn't store any text, images, or documents that you provide as content. The data is only used to generate the response.

*

For information about the Converse API, see Use the Converse API in the Amazon Bedrock User Guide. * To use a guardrail, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide. * To use a tool with a model, see Tool use (Function calling) in the Amazon Bedrock User Guide @@ -395,8 +396,11 @@ export interface ConverseCommandOutput extends ConverseResponse, __MetadataBeare * @throws {@link ResourceNotFoundException} (client fault) *

The specified resource ARN was not found. Check the ARN and try your request again.

* + * @throws {@link ServiceUnavailableException} (server fault) + *

The service isn't currently available. Try again later.

+ * * @throws {@link ThrottlingException} (client fault) - *

The number of requests exceeds the limit. Resubmit your request later.

+ *

Your request was throttled because of service-wide limitations. Resubmit your request later or in a different region. You can also purchase Provisioned Throughput to increase the rate or number of tokens you can process.

* * @throws {@link ValidationException} (client fault) *

Input validation failed. Check your request parameters and retry the request.

diff --git a/clients/client-bedrock-runtime/src/commands/ConverseStreamCommand.ts b/clients/client-bedrock-runtime/src/commands/ConverseStreamCommand.ts index 15561205dcc0..22270ba18d61 100644 --- a/clients/client-bedrock-runtime/src/commands/ConverseStreamCommand.ts +++ b/clients/client-bedrock-runtime/src/commands/ConverseStreamCommand.ts @@ -40,6 +40,10 @@ export interface ConverseStreamCommandOutput extends ConverseStreamResponse, __M * model.

*

To find out if a model supports streaming, call GetFoundationModel * and check the responseStreamingSupported field in the response.

+ * + *

The CLI doesn't support streaming operations in Amazon Bedrock, including ConverseStream.

+ *
+ *

Amazon Bedrock doesn't store any text, images, or documents that you provide as content. The data is only used to generate the response.

*

For information about the Converse API, see Use the Converse API in the Amazon Bedrock User Guide. * To use a guardrail, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide. * To use a tool with a model, see Tool use (Function calling) in the Amazon Bedrock User Guide @@ -359,6 +363,9 @@ export interface ConverseStreamCommandOutput extends ConverseStreamResponse, __M * // throttlingException: { // ThrottlingException * // message: "STRING_VALUE", * // }, + * // serviceUnavailableException: { // ServiceUnavailableException + * // message: "STRING_VALUE", + * // }, * // }, * // }; * @@ -388,8 +395,11 @@ export interface ConverseStreamCommandOutput extends ConverseStreamResponse, __M * @throws {@link ResourceNotFoundException} (client fault) *

The specified resource ARN was not found. Check the ARN and try your request again.

* + * @throws {@link ServiceUnavailableException} (server fault) + *

The service isn't currently available. Try again later.

+ * * @throws {@link ThrottlingException} (client fault) - *

The number of requests exceeds the limit. Resubmit your request later.

+ *

Your request was throttled because of service-wide limitations. Resubmit your request later or in a different region. You can also purchase Provisioned Throughput to increase the rate or number of tokens you can process.

* * @throws {@link ValidationException} (client fault) *

Input validation failed. Check your request parameters and retry the request.

diff --git a/clients/client-bedrock-runtime/src/commands/InvokeModelCommand.ts b/clients/client-bedrock-runtime/src/commands/InvokeModelCommand.ts index 591638ba92b4..ab2a99ac829c 100644 --- a/clients/client-bedrock-runtime/src/commands/InvokeModelCommand.ts +++ b/clients/client-bedrock-runtime/src/commands/InvokeModelCommand.ts @@ -102,10 +102,13 @@ export interface InvokeModelCommandOutput extends InvokeModelCommandOutputType, *

The specified resource ARN was not found. Check the ARN and try your request again.

* * @throws {@link ServiceQuotaExceededException} (client fault) - *

The number of requests exceeds the service quota. Resubmit your request later.

+ *

Your request exceeds the service quota for your account. You can view your quotas at Viewing service quotas. You can resubmit your request later.

+ * + * @throws {@link ServiceUnavailableException} (server fault) + *

The service isn't currently available. Try again later.

* * @throws {@link ThrottlingException} (client fault) - *

The number of requests exceeds the limit. Resubmit your request later.

+ *

Your request was throttled because of service-wide limitations. Resubmit your request later or in a different region. You can also purchase Provisioned Throughput to increase the rate or number of tokens you can process.

* * @throws {@link ValidationException} (client fault) *

Input validation failed. Check your request parameters and retry the request.

diff --git a/clients/client-bedrock-runtime/src/commands/InvokeModelWithResponseStreamCommand.ts b/clients/client-bedrock-runtime/src/commands/InvokeModelWithResponseStreamCommand.ts index adb80b969f30..f4a82ca6e17f 100644 --- a/clients/client-bedrock-runtime/src/commands/InvokeModelWithResponseStreamCommand.ts +++ b/clients/client-bedrock-runtime/src/commands/InvokeModelWithResponseStreamCommand.ts @@ -49,7 +49,7 @@ export interface InvokeModelWithResponseStreamCommandOutput *

To see if a model supports streaming, call GetFoundationModel * and check the responseStreamingSupported field in the response.

* - *

The CLI doesn't support InvokeModelWithResponseStream.

+ *

The CLI doesn't support streaming operations in Amazon Bedrock, including InvokeModelWithResponseStream.

*
*

For example code, see Invoke model with streaming code * example in the Amazon Bedrock User Guide. @@ -94,6 +94,9 @@ export interface InvokeModelWithResponseStreamCommandOutput * // modelTimeoutException: { // ModelTimeoutException * // message: "STRING_VALUE", * // }, + * // serviceUnavailableException: { // ServiceUnavailableException + * // message: "STRING_VALUE", + * // }, * // }, * // contentType: "STRING_VALUE", // required * // }; @@ -128,10 +131,13 @@ export interface InvokeModelWithResponseStreamCommandOutput *

The specified resource ARN was not found. Check the ARN and try your request again.

* * @throws {@link ServiceQuotaExceededException} (client fault) - *

The number of requests exceeds the service quota. Resubmit your request later.

+ *

Your request exceeds the service quota for your account. You can view your quotas at Viewing service quotas. You can resubmit your request later.

+ * + * @throws {@link ServiceUnavailableException} (server fault) + *

The service isn't currently available. Try again later.

* * @throws {@link ThrottlingException} (client fault) - *

The number of requests exceeds the limit. Resubmit your request later.

+ *

Your request was throttled because of service-wide limitations. Resubmit your request later or in a different region. You can also purchase Provisioned Throughput to increase the rate or number of tokens you can process.

* * @throws {@link ValidationException} (client fault) *

Input validation failed. Check your request parameters and retry the request.

diff --git a/clients/client-bedrock-runtime/src/models/models_0.ts b/clients/client-bedrock-runtime/src/models/models_0.ts index cb83451b5114..1929dc53f1bb 100644 --- a/clients/client-bedrock-runtime/src/models/models_0.ts +++ b/clients/client-bedrock-runtime/src/models/models_0.ts @@ -748,7 +748,7 @@ export class ResourceNotFoundException extends __BaseException { } /** - *

The number of requests exceeds the service quota. Resubmit your request later.

+ *

Your request exceeds the service quota for your account. You can view your quotas at Viewing service quotas. You can resubmit your request later.

* @public */ export class ServiceQuotaExceededException extends __BaseException { @@ -768,7 +768,7 @@ export class ServiceQuotaExceededException extends __BaseException { } /** - *

The number of requests exceeds the limit. Resubmit your request later.

+ *

Your request was throttled because of service-wide limitations. Resubmit your request later or in a different region. You can also purchase Provisioned Throughput to increase the rate or number of tokens you can process.

* @public */ export class ThrottlingException extends __BaseException { @@ -2104,6 +2104,26 @@ export class ModelTimeoutException extends __BaseException { } } +/** + *

The service isn't currently available. Try again later.

+ * @public + */ +export class ServiceUnavailableException extends __BaseException { + readonly name: "ServiceUnavailableException" = "ServiceUnavailableException"; + readonly $fault: "server" = "server"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ServiceUnavailableException", + $fault: "server", + ...opts, + }); + Object.setPrototypeOf(this, ServiceUnavailableException.prototype); + } +} + /** * @public * @enum @@ -2533,6 +2553,7 @@ export type ConverseStreamOutput = | ConverseStreamOutput.MessageStopMember | ConverseStreamOutput.MetadataMember | ConverseStreamOutput.ModelStreamErrorExceptionMember + | ConverseStreamOutput.ServiceUnavailableExceptionMember | ConverseStreamOutput.ThrottlingExceptionMember | ConverseStreamOutput.ValidationExceptionMember | ConverseStreamOutput.$UnknownMember; @@ -2556,6 +2577,7 @@ export namespace ConverseStreamOutput { modelStreamErrorException?: never; validationException?: never; throttlingException?: never; + serviceUnavailableException?: never; $unknown?: never; } @@ -2574,6 +2596,7 @@ export namespace ConverseStreamOutput { modelStreamErrorException?: never; validationException?: never; throttlingException?: never; + serviceUnavailableException?: never; $unknown?: never; } @@ -2592,6 +2615,7 @@ export namespace ConverseStreamOutput { modelStreamErrorException?: never; validationException?: never; throttlingException?: never; + serviceUnavailableException?: never; $unknown?: never; } @@ -2610,6 +2634,7 @@ export namespace ConverseStreamOutput { modelStreamErrorException?: never; validationException?: never; throttlingException?: never; + serviceUnavailableException?: never; $unknown?: never; } @@ -2628,6 +2653,7 @@ export namespace ConverseStreamOutput { modelStreamErrorException?: never; validationException?: never; throttlingException?: never; + serviceUnavailableException?: never; $unknown?: never; } @@ -2646,6 +2672,7 @@ export namespace ConverseStreamOutput { modelStreamErrorException?: never; validationException?: never; throttlingException?: never; + serviceUnavailableException?: never; $unknown?: never; } @@ -2664,6 +2691,7 @@ export namespace ConverseStreamOutput { modelStreamErrorException?: never; validationException?: never; throttlingException?: never; + serviceUnavailableException?: never; $unknown?: never; } @@ -2682,6 +2710,7 @@ export namespace ConverseStreamOutput { modelStreamErrorException: ModelStreamErrorException; validationException?: never; throttlingException?: never; + serviceUnavailableException?: never; $unknown?: never; } @@ -2700,6 +2729,7 @@ export namespace ConverseStreamOutput { modelStreamErrorException?: never; validationException: ValidationException; throttlingException?: never; + serviceUnavailableException?: never; $unknown?: never; } @@ -2718,6 +2748,26 @@ export namespace ConverseStreamOutput { modelStreamErrorException?: never; validationException?: never; throttlingException: ThrottlingException; + serviceUnavailableException?: never; + $unknown?: never; + } + + /** + *

The service isn't currently available. Try again later.

+ * @public + */ + export interface ServiceUnavailableExceptionMember { + messageStart?: never; + contentBlockStart?: never; + contentBlockDelta?: never; + contentBlockStop?: never; + messageStop?: never; + metadata?: never; + internalServerException?: never; + modelStreamErrorException?: never; + validationException?: never; + throttlingException?: never; + serviceUnavailableException: ServiceUnavailableException; $unknown?: never; } @@ -2735,6 +2785,7 @@ export namespace ConverseStreamOutput { modelStreamErrorException?: never; validationException?: never; throttlingException?: never; + serviceUnavailableException?: never; $unknown: [string, any]; } @@ -2749,6 +2800,7 @@ export namespace ConverseStreamOutput { modelStreamErrorException: (value: ModelStreamErrorException) => T; validationException: (value: ValidationException) => T; throttlingException: (value: ThrottlingException) => T; + serviceUnavailableException: (value: ServiceUnavailableException) => T; _: (name: string, value: any) => T; } @@ -2765,6 +2817,8 @@ export namespace ConverseStreamOutput { return visitor.modelStreamErrorException(value.modelStreamErrorException); if (value.validationException !== undefined) return visitor.validationException(value.validationException); if (value.throttlingException !== undefined) return visitor.throttlingException(value.throttlingException); + if (value.serviceUnavailableException !== undefined) + return visitor.serviceUnavailableException(value.serviceUnavailableException); return visitor._(value.$unknown[0], value.$unknown[1]); }; } @@ -2979,6 +3033,7 @@ export type ResponseStream = | ResponseStream.InternalServerExceptionMember | ResponseStream.ModelStreamErrorExceptionMember | ResponseStream.ModelTimeoutExceptionMember + | ResponseStream.ServiceUnavailableExceptionMember | ResponseStream.ThrottlingExceptionMember | ResponseStream.ValidationExceptionMember | ResponseStream.$UnknownMember; @@ -2998,6 +3053,7 @@ export namespace ResponseStream { validationException?: never; throttlingException?: never; modelTimeoutException?: never; + serviceUnavailableException?: never; $unknown?: never; } @@ -3012,6 +3068,7 @@ export namespace ResponseStream { validationException?: never; throttlingException?: never; modelTimeoutException?: never; + serviceUnavailableException?: never; $unknown?: never; } @@ -3026,6 +3083,7 @@ export namespace ResponseStream { validationException?: never; throttlingException?: never; modelTimeoutException?: never; + serviceUnavailableException?: never; $unknown?: never; } @@ -3040,11 +3098,12 @@ export namespace ResponseStream { validationException: ValidationException; throttlingException?: never; modelTimeoutException?: never; + serviceUnavailableException?: never; $unknown?: never; } /** - *

The number or frequency of requests exceeds the limit. Resubmit your request later.

+ *

Your request was throttled because of service-wide limitations. Resubmit your request later or in a different region. You can also purchase Provisioned Throughput to increase the rate or number of tokens you can process.

* @public */ export interface ThrottlingExceptionMember { @@ -3054,6 +3113,7 @@ export namespace ResponseStream { validationException?: never; throttlingException: ThrottlingException; modelTimeoutException?: never; + serviceUnavailableException?: never; $unknown?: never; } @@ -3068,6 +3128,22 @@ export namespace ResponseStream { validationException?: never; throttlingException?: never; modelTimeoutException: ModelTimeoutException; + serviceUnavailableException?: never; + $unknown?: never; + } + + /** + *

The service isn't currently available. Try again later.

+ * @public + */ + export interface ServiceUnavailableExceptionMember { + chunk?: never; + internalServerException?: never; + modelStreamErrorException?: never; + validationException?: never; + throttlingException?: never; + modelTimeoutException?: never; + serviceUnavailableException: ServiceUnavailableException; $unknown?: never; } @@ -3081,6 +3157,7 @@ export namespace ResponseStream { validationException?: never; throttlingException?: never; modelTimeoutException?: never; + serviceUnavailableException?: never; $unknown: [string, any]; } @@ -3091,6 +3168,7 @@ export namespace ResponseStream { validationException: (value: ValidationException) => T; throttlingException: (value: ThrottlingException) => T; modelTimeoutException: (value: ModelTimeoutException) => T; + serviceUnavailableException: (value: ServiceUnavailableException) => T; _: (name: string, value: any) => T; } @@ -3103,6 +3181,8 @@ export namespace ResponseStream { if (value.validationException !== undefined) return visitor.validationException(value.validationException); if (value.throttlingException !== undefined) return visitor.throttlingException(value.throttlingException); if (value.modelTimeoutException !== undefined) return visitor.modelTimeoutException(value.modelTimeoutException); + if (value.serviceUnavailableException !== undefined) + return visitor.serviceUnavailableException(value.serviceUnavailableException); return visitor._(value.$unknown[0], value.$unknown[1]); }; } @@ -3138,6 +3218,8 @@ export const ConverseStreamOutputFilterSensitiveLog = (obj: ConverseStreamOutput if (obj.modelStreamErrorException !== undefined) return { modelStreamErrorException: obj.modelStreamErrorException }; if (obj.validationException !== undefined) return { validationException: obj.validationException }; if (obj.throttlingException !== undefined) return { throttlingException: obj.throttlingException }; + if (obj.serviceUnavailableException !== undefined) + return { serviceUnavailableException: obj.serviceUnavailableException }; if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" }; }; @@ -3193,6 +3275,8 @@ export const ResponseStreamFilterSensitiveLog = (obj: ResponseStream): any => { if (obj.validationException !== undefined) return { validationException: obj.validationException }; if (obj.throttlingException !== undefined) return { throttlingException: obj.throttlingException }; if (obj.modelTimeoutException !== undefined) return { modelTimeoutException: obj.modelTimeoutException }; + if (obj.serviceUnavailableException !== undefined) + return { serviceUnavailableException: obj.serviceUnavailableException }; if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" }; }; diff --git a/clients/client-bedrock-runtime/src/protocols/Aws_restJson1.ts b/clients/client-bedrock-runtime/src/protocols/Aws_restJson1.ts index ea4109208633..20d2e00dc00f 100644 --- a/clients/client-bedrock-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-bedrock-runtime/src/protocols/Aws_restJson1.ts @@ -81,6 +81,7 @@ import { ResourceNotFoundException, ResponseStream, ServiceQuotaExceededException, + ServiceUnavailableException, SpecificToolChoice, SystemContentBlock, ThrottlingException, @@ -371,6 +372,9 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): case "ModelTimeoutException": case "com.amazonaws.bedrockruntime#ModelTimeoutException": throw await de_ModelTimeoutExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.bedrockruntime#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); case "ModelStreamErrorException": case "com.amazonaws.bedrockruntime#ModelStreamErrorException": throw await de_ModelStreamErrorExceptionRes(parsedOutput, context); @@ -546,6 +550,26 @@ const de_ServiceQuotaExceededExceptionRes = async ( return __decorateServiceException(exception, parsedOutput.body); }; +/** + * deserializeAws_restJson1ServiceUnavailableExceptionRes + */ +const de_ServiceUnavailableExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ServiceUnavailableException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + /** * deserializeAws_restJson1ThrottlingExceptionRes */ @@ -641,6 +665,14 @@ const de_ConverseStreamOutput = ( throttlingException: await de_ThrottlingException_event(event["throttlingException"], context), }; } + if (event["serviceUnavailableException"] != null) { + return { + serviceUnavailableException: await de_ServiceUnavailableException_event( + event["serviceUnavailableException"], + context + ), + }; + } return { $unknown: output }; }); }; @@ -685,6 +717,14 @@ const de_ResponseStream = ( modelTimeoutException: await de_ModelTimeoutException_event(event["modelTimeoutException"], context), }; } + if (event["serviceUnavailableException"] != null) { + return { + serviceUnavailableException: await de_ServiceUnavailableException_event( + event["serviceUnavailableException"], + context + ), + }; + } return { $unknown: output }; }); }; @@ -766,6 +806,16 @@ const de_PayloadPart_event = async (output: any, context: __SerdeContext): Promi Object.assign(contents, de_PayloadPart(data, context)); return contents; }; +const de_ServiceUnavailableException_event = async ( + output: any, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context), + }; + return de_ServiceUnavailableExceptionRes(parsedOutput, context); +}; const de_ThrottlingException_event = async (output: any, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, diff --git a/codegen/sdk-codegen/aws-models/bedrock-runtime.json b/codegen/sdk-codegen/aws-models/bedrock-runtime.json index 63d7f38d9697..319cec8c9356 100644 --- a/codegen/sdk-codegen/aws-models/bedrock-runtime.json +++ b/codegen/sdk-codegen/aws-models/bedrock-runtime.json @@ -1051,6 +1051,9 @@ { "target": "com.amazonaws.bedrockruntime#ResourceNotFoundException" }, + { + "target": "com.amazonaws.bedrockruntime#ServiceUnavailableException" + }, { "target": "com.amazonaws.bedrockruntime#ThrottlingException" }, @@ -1059,7 +1062,7 @@ } ], "traits": { - "smithy.api#documentation": "

Sends messages to the specified Amazon Bedrock model. Converse provides\n a consistent interface that works with all models that\n support messages. This allows you to write code once and use it with different models.\n Should a model have unique inference parameters, you can also pass those unique parameters\n to the model.

\n

For information about the Converse API, see Use the Converse API in the Amazon Bedrock User Guide.\n To use a guardrail, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide.\n To use a tool with a model, see Tool use (Function calling) in the Amazon Bedrock User Guide\n

\n

For example code, see Converse API examples in the Amazon Bedrock User Guide.\n

\n

This operation requires permission for the bedrock:InvokeModel action.

", + "smithy.api#documentation": "

Sends messages to the specified Amazon Bedrock model. Converse provides\n a consistent interface that works with all models that\n support messages. This allows you to write code once and use it with different models.\n If a model has unique inference parameters, you can also pass those unique parameters\n to the model.

\n

Amazon Bedrock doesn't store any text, images, or documents that you provide as content. The data is only used to generate the response.

\n

For information about the Converse API, see Use the Converse API in the Amazon Bedrock User Guide.\n To use a guardrail, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide.\n To use a tool with a model, see Tool use (Function calling) in the Amazon Bedrock User Guide\n

\n

For example code, see Converse API examples in the Amazon Bedrock User Guide.\n

\n

This operation requires permission for the bedrock:InvokeModel action.

", "smithy.api#http": { "code": 200, "method": "POST", @@ -1233,6 +1236,9 @@ { "target": "com.amazonaws.bedrockruntime#ResourceNotFoundException" }, + { + "target": "com.amazonaws.bedrockruntime#ServiceUnavailableException" + }, { "target": "com.amazonaws.bedrockruntime#ThrottlingException" }, @@ -1241,7 +1247,7 @@ } ], "traits": { - "smithy.api#documentation": "

Sends messages to the specified Amazon Bedrock model and returns\n the response in a stream. ConverseStream provides a consistent API\n that works with all Amazon Bedrock models that support messages.\n This allows you to write code once and use it with different models. Should a\n model have unique inference parameters, you can also pass those unique parameters to the\n model.

\n

To find out if a model supports streaming, call GetFoundationModel\n and check the responseStreamingSupported field in the response.

\n

For information about the Converse API, see Use the Converse API in the Amazon Bedrock User Guide.\n To use a guardrail, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide.\n To use a tool with a model, see Tool use (Function calling) in the Amazon Bedrock User Guide\n

\n

For example code, see Conversation streaming example in the Amazon Bedrock User Guide.\n

\n

This operation requires permission for the bedrock:InvokeModelWithResponseStream action.

", + "smithy.api#documentation": "

Sends messages to the specified Amazon Bedrock model and returns\n the response in a stream. ConverseStream provides a consistent API\n that works with all Amazon Bedrock models that support messages.\n This allows you to write code once and use it with different models. Should a\n model have unique inference parameters, you can also pass those unique parameters to the\n model.

\n

To find out if a model supports streaming, call GetFoundationModel\n and check the responseStreamingSupported field in the response.

\n \n

The CLI doesn't support streaming operations in Amazon Bedrock, including ConverseStream.

\n
\n

Amazon Bedrock doesn't store any text, images, or documents that you provide as content. The data is only used to generate the response.

\n

For information about the Converse API, see Use the Converse API in the Amazon Bedrock User Guide.\n To use a guardrail, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide.\n To use a tool with a model, see Tool use (Function calling) in the Amazon Bedrock User Guide\n

\n

For example code, see Conversation streaming example in the Amazon Bedrock User Guide.\n

\n

This operation requires permission for the bedrock:InvokeModelWithResponseStream action.

", "smithy.api#http": { "code": 200, "method": "POST", @@ -1354,6 +1360,12 @@ "traits": { "smithy.api#documentation": "

The number of requests exceeds the limit. Resubmit your request later.

" } + }, + "serviceUnavailableException": { + "target": "com.amazonaws.bedrockruntime#ServiceUnavailableException", + "traits": { + "smithy.api#documentation": "

The service isn't currently available. Try again later.

" + } } }, "traits": { @@ -2930,6 +2942,9 @@ { "target": "com.amazonaws.bedrockruntime#ServiceQuotaExceededException" }, + { + "target": "com.amazonaws.bedrockruntime#ServiceUnavailableException" + }, { "target": "com.amazonaws.bedrockruntime#ThrottlingException" }, @@ -3072,6 +3087,9 @@ { "target": "com.amazonaws.bedrockruntime#ServiceQuotaExceededException" }, + { + "target": "com.amazonaws.bedrockruntime#ServiceUnavailableException" + }, { "target": "com.amazonaws.bedrockruntime#ThrottlingException" }, @@ -3080,7 +3098,7 @@ } ], "traits": { - "smithy.api#documentation": "

Invoke the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. The response is returned in a stream.

\n

To see if a model supports streaming, call GetFoundationModel\n and check the responseStreamingSupported field in the response.

\n \n

The CLI doesn't support InvokeModelWithResponseStream.

\n
\n

For example code, see Invoke model with streaming code\n example in the Amazon Bedrock User Guide.\n

\n

This operation requires permissions to perform the bedrock:InvokeModelWithResponseStream action.

", + "smithy.api#documentation": "

Invoke the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. The response is returned in a stream.

\n

To see if a model supports streaming, call GetFoundationModel\n and check the responseStreamingSupported field in the response.

\n \n

The CLI doesn't support streaming operations in Amazon Bedrock, including InvokeModelWithResponseStream.

\n
\n

For example code, see Invoke model with streaming code\n example in the Amazon Bedrock User Guide.\n

\n

This operation requires permissions to perform the bedrock:InvokeModelWithResponseStream action.

", "smithy.api#http": { "code": 200, "method": "POST", @@ -3415,7 +3433,7 @@ "throttlingException": { "target": "com.amazonaws.bedrockruntime#ThrottlingException", "traits": { - "smithy.api#documentation": "

The number or frequency of requests exceeds the limit. Resubmit your request later.

" + "smithy.api#documentation": "

Your request was throttled because of service-wide limitations. Resubmit your request later or in a different region. You can also purchase Provisioned Throughput to increase the rate or number of tokens you can process.

" } }, "modelTimeoutException": { @@ -3423,6 +3441,9 @@ "traits": { "smithy.api#documentation": "

The request took too long to process. Processing time exceeded the model timeout length.

" } + }, + "serviceUnavailableException": { + "target": "com.amazonaws.bedrockruntime#ServiceUnavailableException" } }, "traits": { @@ -3438,11 +3459,24 @@ } }, "traits": { - "smithy.api#documentation": "

The number of requests exceeds the service quota. Resubmit your request later.

", + "smithy.api#documentation": "

Your request exceeds the service quota for your account. You can view your quotas at Viewing service quotas. You can resubmit your request later.

", "smithy.api#error": "client", "smithy.api#httpError": 400 } }, + "com.amazonaws.bedrockruntime#ServiceUnavailableException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.bedrockruntime#NonBlankString" + } + }, + "traits": { + "smithy.api#documentation": "

The service isn't currently available. Try again later.

", + "smithy.api#error": "server", + "smithy.api#httpError": 503 + } + }, "com.amazonaws.bedrockruntime#SpecificToolChoice": { "type": "structure", "members": { @@ -3542,7 +3576,7 @@ } }, "traits": { - "smithy.api#documentation": "

The number of requests exceeds the limit. Resubmit your request later.

", + "smithy.api#documentation": "

Your request was throttled because of service-wide limitations. Resubmit your request later or in a different region. You can also purchase Provisioned Throughput to increase the rate or number of tokens you can process.

", "smithy.api#error": "client", "smithy.api#httpError": 429 }