The action to apply a guardrail.
+ *For troubleshooting some of the common errors you might encounter when using the ApplyGuardrail
API,
+ * see Troubleshooting Amazon Bedrock API Error Codes in the Amazon Bedrock User Guide
Retrieve information about an asynchronous invocation.
+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockRuntimeClient, GetAsyncInvokeCommand } from "@aws-sdk/client-bedrock-runtime"; // ES Modules import + * // const { BedrockRuntimeClient, GetAsyncInvokeCommand } = require("@aws-sdk/client-bedrock-runtime"); // CommonJS import + * const client = new BedrockRuntimeClient(config); + * const input = { // GetAsyncInvokeRequest + * invocationArn: "STRING_VALUE", // required + * }; + * const command = new GetAsyncInvokeCommand(input); + * const response = await client.send(command); + * // { // GetAsyncInvokeResponse + * // invocationArn: "STRING_VALUE", // required + * // modelArn: "STRING_VALUE", // required + * // clientRequestToken: "STRING_VALUE", + * // status: "InProgress" || "Completed" || "Failed", // required + * // failureMessage: "STRING_VALUE", + * // submitTime: new Date("TIMESTAMP"), // required + * // lastModifiedTime: new Date("TIMESTAMP"), + * // endTime: new Date("TIMESTAMP"), + * // outputDataConfig: { // AsyncInvokeOutputDataConfig Union: only one key present + * // s3OutputDataConfig: { // AsyncInvokeS3OutputDataConfig + * // s3Uri: "STRING_VALUE", // required + * // kmsKeyId: "STRING_VALUE", + * // bucketOwner: "STRING_VALUE", + * // }, + * // }, + * // }; + * + * ``` + * + * @param GetAsyncInvokeCommandInput - {@link GetAsyncInvokeCommandInput} + * @returns {@link GetAsyncInvokeCommandOutput} + * @see {@link GetAsyncInvokeCommandInput} for command's `input` shape. + * @see {@link GetAsyncInvokeCommandOutput} for command's `response` shape. + * @see {@link BedrockRuntimeClientResolvedConfig | config} for BedrockRuntimeClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error, + * see AccessDeniedException in the Amazon Bedrock User Guide
+ * + * @throws {@link InternalServerException} (server fault) + *An internal server error occurred. For troubleshooting this error, + * see InternalFailure in the Amazon Bedrock User Guide
+ * + * @throws {@link ThrottlingException} (client fault) + *Your request was denied due to exceeding the account quotas for Amazon Bedrock. For + * troubleshooting this error, see ThrottlingException in the Amazon Bedrock User Guide
+ * + * @throws {@link ValidationException} (client fault) + *The input fails to satisfy the constraints specified by Amazon Bedrock. For troubleshooting this error, + * see ValidationError in the Amazon Bedrock User Guide
+ * + * @throws {@link BedrockRuntimeServiceException} + *Base exception class for all service exceptions from BedrockRuntime service.
+ * + * @public + */ +export class GetAsyncInvokeCommand extends $Command + .classBuilder< + GetAsyncInvokeCommandInput, + GetAsyncInvokeCommandOutput, + BedrockRuntimeClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: BedrockRuntimeClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonBedrockFrontendService", "GetAsyncInvoke", {}) + .n("BedrockRuntimeClient", "GetAsyncInvokeCommand") + .f(void 0, GetAsyncInvokeResponseFilterSensitiveLog) + .ser(se_GetAsyncInvokeCommand) + .de(de_GetAsyncInvokeCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: GetAsyncInvokeRequest; + output: GetAsyncInvokeResponse; + }; + sdk: { + input: GetAsyncInvokeCommandInput; + output: GetAsyncInvokeCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-runtime/src/commands/ListAsyncInvokesCommand.ts b/clients/client-bedrock-runtime/src/commands/ListAsyncInvokesCommand.ts new file mode 100644 index 000000000000..1a753a74f7a4 --- /dev/null +++ b/clients/client-bedrock-runtime/src/commands/ListAsyncInvokesCommand.ts @@ -0,0 +1,137 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockRuntimeClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { + ListAsyncInvokesRequest, + ListAsyncInvokesResponse, + ListAsyncInvokesResponseFilterSensitiveLog, +} from "../models/models_0"; +import { de_ListAsyncInvokesCommand, se_ListAsyncInvokesCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ListAsyncInvokesCommand}. + */ +export interface ListAsyncInvokesCommandInput extends ListAsyncInvokesRequest {} +/** + * @public + * + * The output of {@link ListAsyncInvokesCommand}. + */ +export interface ListAsyncInvokesCommandOutput extends ListAsyncInvokesResponse, __MetadataBearer {} + +/** + *Lists asynchronous invocations.
+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BedrockRuntimeClient, ListAsyncInvokesCommand } from "@aws-sdk/client-bedrock-runtime"; // ES Modules import + * // const { BedrockRuntimeClient, ListAsyncInvokesCommand } = require("@aws-sdk/client-bedrock-runtime"); // CommonJS import + * const client = new BedrockRuntimeClient(config); + * const input = { // ListAsyncInvokesRequest + * submitTimeAfter: new Date("TIMESTAMP"), + * submitTimeBefore: new Date("TIMESTAMP"), + * statusEquals: "InProgress" || "Completed" || "Failed", + * maxResults: Number("int"), + * nextToken: "STRING_VALUE", + * sortBy: "SubmissionTime", + * sortOrder: "Ascending" || "Descending", + * }; + * const command = new ListAsyncInvokesCommand(input); + * const response = await client.send(command); + * // { // ListAsyncInvokesResponse + * // nextToken: "STRING_VALUE", + * // asyncInvokeSummaries: [ // AsyncInvokeSummaries + * // { // AsyncInvokeSummary + * // invocationArn: "STRING_VALUE", // required + * // modelArn: "STRING_VALUE", // required + * // clientRequestToken: "STRING_VALUE", + * // status: "InProgress" || "Completed" || "Failed", + * // failureMessage: "STRING_VALUE", + * // submitTime: new Date("TIMESTAMP"), // required + * // lastModifiedTime: new Date("TIMESTAMP"), + * // endTime: new Date("TIMESTAMP"), + * // outputDataConfig: { // AsyncInvokeOutputDataConfig Union: only one key present + * // s3OutputDataConfig: { // AsyncInvokeS3OutputDataConfig + * // s3Uri: "STRING_VALUE", // required + * // kmsKeyId: "STRING_VALUE", + * // bucketOwner: "STRING_VALUE", + * // }, + * // }, + * // }, + * // ], + * // }; + * + * ``` + * + * @param ListAsyncInvokesCommandInput - {@link ListAsyncInvokesCommandInput} + * @returns {@link ListAsyncInvokesCommandOutput} + * @see {@link ListAsyncInvokesCommandInput} for command's `input` shape. + * @see {@link ListAsyncInvokesCommandOutput} for command's `response` shape. + * @see {@link BedrockRuntimeClientResolvedConfig | config} for BedrockRuntimeClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error, + * see AccessDeniedException in the Amazon Bedrock User Guide
+ * + * @throws {@link InternalServerException} (server fault) + *An internal server error occurred. For troubleshooting this error, + * see InternalFailure in the Amazon Bedrock User Guide
+ * + * @throws {@link ThrottlingException} (client fault) + *Your request was denied due to exceeding the account quotas for Amazon Bedrock. For + * troubleshooting this error, see ThrottlingException in the Amazon Bedrock User Guide
+ * + * @throws {@link ValidationException} (client fault) + *The input fails to satisfy the constraints specified by Amazon Bedrock. For troubleshooting this error, + * see ValidationError in the Amazon Bedrock User Guide
+ * + * @throws {@link BedrockRuntimeServiceException} + *Base exception class for all service exceptions from BedrockRuntime service.
+ * + * @public + */ +export class ListAsyncInvokesCommand extends $Command + .classBuilder< + ListAsyncInvokesCommandInput, + ListAsyncInvokesCommandOutput, + BedrockRuntimeClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: BedrockRuntimeClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonBedrockFrontendService", "ListAsyncInvokes", {}) + .n("BedrockRuntimeClient", "ListAsyncInvokesCommand") + .f(void 0, ListAsyncInvokesResponseFilterSensitiveLog) + .ser(se_ListAsyncInvokesCommand) + .de(de_ListAsyncInvokesCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ListAsyncInvokesRequest; + output: ListAsyncInvokesResponse; + }; + sdk: { + input: ListAsyncInvokesCommandInput; + output: ListAsyncInvokesCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-runtime/src/commands/StartAsyncInvokeCommand.ts b/clients/client-bedrock-runtime/src/commands/StartAsyncInvokeCommand.ts new file mode 100644 index 000000000000..981ae8fef52d --- /dev/null +++ b/clients/client-bedrock-runtime/src/commands/StartAsyncInvokeCommand.ts @@ -0,0 +1,149 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockRuntimeClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { + StartAsyncInvokeRequest, + StartAsyncInvokeRequestFilterSensitiveLog, + StartAsyncInvokeResponse, +} from "../models/models_0"; +import { de_StartAsyncInvokeCommand, se_StartAsyncInvokeCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link StartAsyncInvokeCommand}. + */ +export interface StartAsyncInvokeCommandInput extends StartAsyncInvokeRequest {} +/** + * @public + * + * The output of {@link StartAsyncInvokeCommand}. + */ +export interface StartAsyncInvokeCommandOutput extends StartAsyncInvokeResponse, __MetadataBearer {} + +/** + *Starts an asynchronous invocation.
+ *This operation requires permission for the bedrock:InvokeModel
action.
To deny all inference access to resources that you specify in the modelId field, you
+ * need to deny access to the bedrock:InvokeModel
and
+ * bedrock:InvokeModelWithResponseStream
actions. Doing this also denies
+ * access to the resource through the Converse API actions (Converse and ConverseStream). For more information see Deny access for inference on specific models.
+ *
The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error, + * see AccessDeniedException in the Amazon Bedrock User Guide
+ * + * @throws {@link ConflictException} (client fault) + *Error occurred because of a conflict while performing an operation.
+ * + * @throws {@link InternalServerException} (server fault) + *An internal server error occurred. For troubleshooting this error, + * see InternalFailure in the Amazon Bedrock User Guide
+ * + * @throws {@link ResourceNotFoundException} (client fault) + *The specified resource ARN was not found. For troubleshooting this error, + * see ResourceNotFound in the Amazon Bedrock User Guide
+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *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. For troubleshooting this error, + * see ServiceUnavailable in the Amazon Bedrock User Guide
+ * + * @throws {@link ThrottlingException} (client fault) + *Your request was denied due to exceeding the account quotas for Amazon Bedrock. For + * troubleshooting this error, see ThrottlingException in the Amazon Bedrock User Guide
+ * + * @throws {@link ValidationException} (client fault) + *The input fails to satisfy the constraints specified by Amazon Bedrock. For troubleshooting this error, + * see ValidationError in the Amazon Bedrock User Guide
+ * + * @throws {@link BedrockRuntimeServiceException} + *Base exception class for all service exceptions from BedrockRuntime service.
+ * + * @public + */ +export class StartAsyncInvokeCommand extends $Command + .classBuilder< + StartAsyncInvokeCommandInput, + StartAsyncInvokeCommandOutput, + BedrockRuntimeClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: BedrockRuntimeClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonBedrockFrontendService", "StartAsyncInvoke", {}) + .n("BedrockRuntimeClient", "StartAsyncInvokeCommand") + .f(StartAsyncInvokeRequestFilterSensitiveLog, void 0) + .ser(se_StartAsyncInvokeCommand) + .de(de_StartAsyncInvokeCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: StartAsyncInvokeRequest; + output: StartAsyncInvokeResponse; + }; + sdk: { + input: StartAsyncInvokeCommandInput; + output: StartAsyncInvokeCommandOutput; + }; + }; +} diff --git a/clients/client-bedrock-runtime/src/commands/index.ts b/clients/client-bedrock-runtime/src/commands/index.ts index d8eed6a0bb8a..804caf03e485 100644 --- a/clients/client-bedrock-runtime/src/commands/index.ts +++ b/clients/client-bedrock-runtime/src/commands/index.ts @@ -2,5 +2,8 @@ export * from "./ApplyGuardrailCommand"; export * from "./ConverseCommand"; export * from "./ConverseStreamCommand"; +export * from "./GetAsyncInvokeCommand"; export * from "./InvokeModelCommand"; export * from "./InvokeModelWithResponseStreamCommand"; +export * from "./ListAsyncInvokesCommand"; +export * from "./StartAsyncInvokeCommand"; diff --git a/clients/client-bedrock-runtime/src/index.ts b/clients/client-bedrock-runtime/src/index.ts index a1ffa0fe0a91..e38159742cba 100644 --- a/clients/client-bedrock-runtime/src/index.ts +++ b/clients/client-bedrock-runtime/src/index.ts @@ -11,6 +11,7 @@ export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters"; export type { RuntimeExtension } from "./runtimeExtensions"; export type { BedrockRuntimeExtensionConfiguration } from "./extensionConfiguration"; export * from "./commands"; +export * from "./pagination"; export * from "./models"; export { BedrockRuntimeServiceException } from "./models/BedrockRuntimeServiceException"; diff --git a/clients/client-bedrock-runtime/src/models/models_0.ts b/clients/client-bedrock-runtime/src/models/models_0.ts index b8a21d82e18f..01e85425ce37 100644 --- a/clients/client-bedrock-runtime/src/models/models_0.ts +++ b/clients/client-bedrock-runtime/src/models/models_0.ts @@ -26,6 +26,515 @@ export class AccessDeniedException extends __BaseException { } } +/** + * @public + */ +export interface GetAsyncInvokeRequest { + /** + *The invocation's ARN.
+ * @public + */ + invocationArn: string | undefined; +} + +/** + *Asynchronous invocation output data settings.
+ * @public + */ +export interface AsyncInvokeS3OutputDataConfig { + /** + *An object URI starting with s3://
.
A KMS encryption key ID.
+ * @public + */ + kmsKeyId?: string | undefined; + + /** + *If the bucket belongs to another AWS account, specify that account's ID.
+ * @public + */ + bucketOwner?: string | undefined; +} + +/** + *Asynchronous invocation output data settings.
+ * @public + */ +export type AsyncInvokeOutputDataConfig = + | AsyncInvokeOutputDataConfig.S3OutputDataConfigMember + | AsyncInvokeOutputDataConfig.$UnknownMember; + +/** + * @public + */ +export namespace AsyncInvokeOutputDataConfig { + /** + *A storage location for the output data in an S3 bucket
+ * @public + */ + export interface S3OutputDataConfigMember { + s3OutputDataConfig: AsyncInvokeS3OutputDataConfig; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + s3OutputDataConfig?: never; + $unknown: [string, any]; + } + + export interface VisitorThe invocation's ARN.
+ * @public + */ + invocationArn: string | undefined; + + /** + *The invocation's model ARN.
+ * @public + */ + modelArn: string | undefined; + + /** + *The invocation's idempotency token.
+ * @public + */ + clientRequestToken?: string | undefined; + + /** + *The invocation's status.
+ * @public + */ + status: AsyncInvokeStatus | undefined; + + /** + *An error message.
+ * @public + */ + failureMessage?: string | undefined; + + /** + *When the invocation request was submitted.
+ * @public + */ + submitTime: Date | undefined; + + /** + *The invocation's last modified time.
+ * @public + */ + lastModifiedTime?: Date | undefined; + + /** + *When the invocation ended.
+ * @public + */ + endTime?: Date | undefined; + + /** + *Output data settings.
+ * @public + */ + outputDataConfig: AsyncInvokeOutputDataConfig | undefined; +} + +/** + *An internal server error occurred. For troubleshooting this error, + * see InternalFailure in the Amazon Bedrock User Guide
+ * @public + */ +export class InternalServerException extends __BaseException { + readonly name: "InternalServerException" = "InternalServerException"; + readonly $fault: "server" = "server"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionTypeYour request was denied due to exceeding the account quotas for Amazon Bedrock. For + * troubleshooting this error, see ThrottlingException in the Amazon Bedrock User Guide
+ * @public + */ +export class ThrottlingException extends __BaseException { + readonly name: "ThrottlingException" = "ThrottlingException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionTypeThe input fails to satisfy the constraints specified by Amazon Bedrock. For troubleshooting this error, + * see ValidationError in the Amazon Bedrock User Guide
+ * @public + */ +export class ValidationException extends __BaseException { + readonly name: "ValidationException" = "ValidationException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionTypeInclude invocations submitted after this time.
+ * @public + */ + submitTimeAfter?: Date | undefined; + + /** + *Include invocations submitted before this time.
+ * @public + */ + submitTimeBefore?: Date | undefined; + + /** + *Filter invocations by status.
+ * @public + */ + statusEquals?: AsyncInvokeStatus | undefined; + + /** + *The maximum number of invocations to return in one page of results.
+ * @public + */ + maxResults?: number | undefined; + + /** + *Specify the pagination token from a previous request to retrieve the next page of results.
+ * @public + */ + nextToken?: string | undefined; + + /** + *How to sort the response.
+ * @public + */ + sortBy?: SortAsyncInvocationBy | undefined; + + /** + *The sorting order for the response.
+ * @public + */ + sortOrder?: SortOrder | undefined; +} + +/** + *A summary of an asynchronous invocation.
+ * @public + */ +export interface AsyncInvokeSummary { + /** + *The invocation's ARN.
+ * @public + */ + invocationArn: string | undefined; + + /** + *The invoked model's ARN.
+ * @public + */ + modelArn: string | undefined; + + /** + *The invocation's idempotency token.
+ * @public + */ + clientRequestToken?: string | undefined; + + /** + *The invocation's status.
+ * @public + */ + status?: AsyncInvokeStatus | undefined; + + /** + *An error message.
+ * @public + */ + failureMessage?: string | undefined; + + /** + *When the invocation was submitted.
+ * @public + */ + submitTime: Date | undefined; + + /** + *When the invocation was last modified.
+ * @public + */ + lastModifiedTime?: Date | undefined; + + /** + *When the invocation ended.
+ * @public + */ + endTime?: Date | undefined; + + /** + *The invocation's output data settings.
+ * @public + */ + outputDataConfig: AsyncInvokeOutputDataConfig | undefined; +} + +/** + * @public + */ +export interface ListAsyncInvokesResponse { + /** + *Specify the pagination token from a previous request to retrieve the next page of results.
+ * @public + */ + nextToken?: string | undefined; + + /** + *A list of invocation summaries.
+ * @public + */ + asyncInvokeSummaries?: AsyncInvokeSummary[] | undefined; +} + +/** + *Error occurred because of a conflict while performing an operation.
+ * @public + */ +export class ConflictException extends __BaseException { + readonly name: "ConflictException" = "ConflictException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionTypeThe specified resource ARN was not found. For troubleshooting this error, + * see ResourceNotFound in the Amazon Bedrock User Guide
+ * @public + */ +export class ResourceNotFoundException extends __BaseException { + readonly name: "ResourceNotFoundException" = "ResourceNotFoundException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionTypeYour 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 { + readonly name: "ServiceQuotaExceededException" = "ServiceQuotaExceededException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionTypeThe service isn't currently available. For troubleshooting this error, + * see ServiceUnavailable in the Amazon Bedrock User Guide
+ * @public + */ +export class ServiceUnavailableException extends __BaseException { + readonly name: "ServiceUnavailableException" = "ServiceUnavailableException"; + readonly $fault: "server" = "server"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionTypeA tag.
+ * @public + */ +export interface Tag { + /** + *The tag's key.
+ * @public + */ + key: string | undefined; + + /** + *The tag's value.
+ * @public + */ + value: string | undefined; +} + +/** + * @public + */ +export interface StartAsyncInvokeRequest { + /** + *Specify idempotency token to ensure that requests are not duplicated.
+ * @public + */ + clientRequestToken?: string | undefined; + + /** + *The model to invoke.
+ * @public + */ + modelId: string | undefined; + + /** + *Input to send to the model.
+ * @public + */ + modelInput: __DocumentType | undefined; + + /** + *Where to store the output.
+ * @public + */ + outputDataConfig: AsyncInvokeOutputDataConfig | undefined; + + /** + *Tags to apply to the invocation.
+ * @public + */ + tags?: Tag[] | undefined; +} + +/** + * @public + */ +export interface StartAsyncInvokeResponse { + /** + *The ARN of the invocation.
+ * @public + */ + invocationArn: string | undefined; +} + /** * @public * @enum @@ -747,158 +1256,54 @@ export interface GuardrailAssessment { *The invocation metrics for the guardrail assessment.
* @public */ - invocationMetrics?: GuardrailInvocationMetrics | undefined; -} - -/** - *The output content produced by the guardrail.
- * @public - */ -export interface GuardrailOutputContent { - /** - *The specific text for the output content produced by the guardrail.
- * @public - */ - text?: string | undefined; -} - -/** - * @public - */ -export interface ApplyGuardrailResponse { - /** - *The usage details in the response from the guardrail.
- * @public - */ - usage: GuardrailUsage | undefined; - - /** - *The action taken in the response from the guardrail.
- * @public - */ - action: GuardrailAction | undefined; - - /** - *The output details in the response from the guardrail.
- * @public - */ - outputs: GuardrailOutputContent[] | undefined; - - /** - *The assessment details in the response from the guardrail.
- * @public - */ - assessments: GuardrailAssessment[] | undefined; - - /** - *The guardrail coverage details in the apply guardrail response.
- * @public - */ - guardrailCoverage?: GuardrailCoverage | undefined; -} - -/** - *An internal server error occurred. For troubleshooting this error, - * see InternalFailure in the Amazon Bedrock User Guide
- * @public - */ -export class InternalServerException extends __BaseException { - readonly name: "InternalServerException" = "InternalServerException"; - readonly $fault: "server" = "server"; - /** - * @internal - */ - constructor(opts: __ExceptionOptionTypeThe specified resource ARN was not found. For troubleshooting this error, - * see ResourceNotFound in the Amazon Bedrock User Guide
+ *The output content produced by the guardrail.
* @public */ -export class ResourceNotFoundException extends __BaseException { - readonly name: "ResourceNotFoundException" = "ResourceNotFoundException"; - readonly $fault: "client" = "client"; +export interface GuardrailOutputContent { /** - * @internal + *The specific text for the output content produced by the guardrail.
+ * @public */ - constructor(opts: __ExceptionOptionTypeYour 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 { - readonly name: "ServiceQuotaExceededException" = "ServiceQuotaExceededException"; - readonly $fault: "client" = "client"; +export interface ApplyGuardrailResponse { /** - * @internal + *The usage details in the response from the guardrail.
+ * @public */ - constructor(opts: __ExceptionOptionTypeYour request was denied due to exceeding the account quotas for Amazon Bedrock. For - * troubleshooting this error, see ThrottlingException in the Amazon Bedrock User Guide
- * @public - */ -export class ThrottlingException extends __BaseException { - readonly name: "ThrottlingException" = "ThrottlingException"; - readonly $fault: "client" = "client"; /** - * @internal + *The action taken in the response from the guardrail.
+ * @public */ - constructor(opts: __ExceptionOptionTypeThe input fails to satisfy the constraints specified by Amazon Bedrock. For troubleshooting this error, - * see ValidationError in the Amazon Bedrock User Guide
- * @public - */ -export class ValidationException extends __BaseException { - readonly name: "ValidationException" = "ValidationException"; - readonly $fault: "client" = "client"; /** - * @internal + *The output details in the response from the guardrail.
+ * @public */ - constructor(opts: __ExceptionOptionTypeThe assessment details in the response from the guardrail.
+ * @public + */ + assessments: GuardrailAssessment[] | undefined; + + /** + *The guardrail coverage details in the apply guardrail response.
+ * @public + */ + guardrailCoverage?: GuardrailCoverage | undefined; } /** @@ -1238,6 +1643,117 @@ export interface ImageBlock { source: ImageSource | undefined; } +/** + * @public + * @enum + */ +export const VideoFormat = { + FLV: "flv", + MKV: "mkv", + MOV: "mov", + MP4: "mp4", + MPEG: "mpeg", + MPG: "mpg", + THREE_GP: "three_gp", + WEBM: "webm", + WMV: "wmv", +} as const; + +/** + * @public + */ +export type VideoFormat = (typeof VideoFormat)[keyof typeof VideoFormat]; + +/** + *A storage location in an S3 bucket.
+ * @public + */ +export interface S3Location { + /** + *An object URI starting with s3://
.
If the bucket belongs to another AWS account, specify that account's ID.
+ * @public + */ + bucketOwner?: string | undefined; +} + +/** + *A video source. You can upload a smaller video as a base64-encoded string as + * long as the encoded file is less than 25MB. You can also transfer videos up to 1GB in size + * from an S3 bucket.
+ * @public + */ +export type VideoSource = VideoSource.BytesMember | VideoSource.S3LocationMember | VideoSource.$UnknownMember; + +/** + * @public + */ +export namespace VideoSource { + /** + *Video content encoded in base64.
+ * @public + */ + export interface BytesMember { + bytes: Uint8Array; + s3Location?: never; + $unknown?: never; + } + + /** + *The location of a video object in an S3 bucket.
+ * @public + */ + export interface S3LocationMember { + bytes?: never; + s3Location: S3Location; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + bytes?: never; + s3Location?: never; + $unknown: [string, any]; + } + + export interface VisitorA video block.
+ * @public + */ +export interface VideoBlock { + /** + *The block's format.
+ * @public + */ + format: VideoFormat | undefined; + + /** + *The block's source.
+ * @public + */ + source: VideoSource | undefined; +} + /** *The tool result content block.
* @public @@ -1247,6 +1763,7 @@ export type ToolResultContentBlock = | ToolResultContentBlock.ImageMember | ToolResultContentBlock.JsonMember | ToolResultContentBlock.TextMember + | ToolResultContentBlock.VideoMember | ToolResultContentBlock.$UnknownMember; /** @@ -1262,6 +1779,7 @@ export namespace ToolResultContentBlock { text?: never; image?: never; document?: never; + video?: never; $unknown?: never; } @@ -1274,6 +1792,7 @@ export namespace ToolResultContentBlock { text: string; image?: never; document?: never; + video?: never; $unknown?: never; } @@ -1289,6 +1808,7 @@ export namespace ToolResultContentBlock { text?: never; image: ImageBlock; document?: never; + video?: never; $unknown?: never; } @@ -1301,6 +1821,20 @@ export namespace ToolResultContentBlock { text?: never; image?: never; document: DocumentBlock; + video?: never; + $unknown?: never; + } + + /** + *A tool result that is video.
+ * @public + */ + export interface VideoMember { + json?: never; + text?: never; + image?: never; + document?: never; + video: VideoBlock; $unknown?: never; } @@ -1312,6 +1846,7 @@ export namespace ToolResultContentBlock { text?: never; image?: never; document?: never; + video?: never; $unknown: [string, any]; } @@ -1320,6 +1855,7 @@ export namespace ToolResultContentBlock { text: (value: string) => T; image: (value: ImageBlock) => T; document: (value: DocumentBlock) => T; + video: (value: VideoBlock) => T; _: (name: string, value: any) => T; } @@ -1328,6 +1864,7 @@ export namespace ToolResultContentBlock { if (value.text !== undefined) return visitor.text(value.text); if (value.image !== undefined) return visitor.image(value.image); if (value.document !== undefined) return visitor.document(value.document); + if (value.video !== undefined) return visitor.video(value.video); return visitor._(value.$unknown[0], value.$unknown[1]); }; } @@ -1410,6 +1947,7 @@ export type ContentBlock = | ContentBlock.TextMember | ContentBlock.ToolResultMember | ContentBlock.ToolUseMember + | ContentBlock.VideoMember | ContentBlock.$UnknownMember; /** @@ -1424,6 +1962,7 @@ export namespace ContentBlock { text: string; image?: never; document?: never; + video?: never; toolUse?: never; toolResult?: never; guardContent?: never; @@ -1441,6 +1980,7 @@ export namespace ContentBlock { text?: never; image: ImageBlock; document?: never; + video?: never; toolUse?: never; toolResult?: never; guardContent?: never; @@ -1455,6 +1995,22 @@ export namespace ContentBlock { text?: never; image?: never; document: DocumentBlock; + video?: never; + toolUse?: never; + toolResult?: never; + guardContent?: never; + $unknown?: never; + } + + /** + *Video to include in the message.
+ * @public + */ + export interface VideoMember { + text?: never; + image?: never; + document?: never; + video: VideoBlock; toolUse?: never; toolResult?: never; guardContent?: never; @@ -1469,6 +2025,7 @@ export namespace ContentBlock { text?: never; image?: never; document?: never; + video?: never; toolUse: ToolUseBlock; toolResult?: never; guardContent?: never; @@ -1483,6 +2040,7 @@ export namespace ContentBlock { text?: never; image?: never; document?: never; + video?: never; toolUse?: never; toolResult: ToolResultBlock; guardContent?: never; @@ -1502,6 +2060,7 @@ export namespace ContentBlock { text?: never; image?: never; document?: never; + video?: never; toolUse?: never; toolResult?: never; guardContent: GuardrailConverseContentBlock; @@ -1515,6 +2074,7 @@ export namespace ContentBlock { text?: never; image?: never; document?: never; + video?: never; toolUse?: never; toolResult?: never; guardContent?: never; @@ -1525,6 +2085,7 @@ export namespace ContentBlock { text: (value: string) => T; image: (value: ImageBlock) => T; document: (value: DocumentBlock) => T; + video: (value: VideoBlock) => T; toolUse: (value: ToolUseBlock) => T; toolResult: (value: ToolResultBlock) => T; guardContent: (value: GuardrailConverseContentBlock) => T; @@ -1535,6 +2096,7 @@ export namespace ContentBlock { if (value.text !== undefined) return visitor.text(value.text); if (value.image !== undefined) return visitor.image(value.image); if (value.document !== undefined) return visitor.document(value.document); + if (value.video !== undefined) return visitor.video(value.video); if (value.toolUse !== undefined) return visitor.toolUse(value.toolUse); if (value.toolResult !== undefined) return visitor.toolResult(value.toolResult); if (value.guardContent !== undefined) return visitor.guardContent(value.guardContent); @@ -1913,9 +2475,6 @@ export namespace Tool { /** *Configuration information for the tools that you pass to a model. For more information, see Tool use (function calling) in the Amazon Bedrock User Guide.
- *This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.
- *Configuration information for the tools that the model can use when generating a response.
- *This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.
- *For information about models that support tool use, see + * Supported models and model features.
* @public */ toolConfig?: ToolConfiguration | undefined; @@ -2028,6 +2586,12 @@ export interface ConverseRequest { */ additionalModelResponseFieldPaths?: string[] | undefined; + /** + *Key-value pairs that you can use to filter invocation logs.
+ * @public + */ + requestMetadata?: RecordModel performance settings for the request.
* @public @@ -2290,27 +2854,6 @@ export class ModelTimeoutException extends __BaseException { } } -/** - *The service isn't currently available. For troubleshooting this error, - * see ServiceUnavailable in the Amazon Bedrock User Guide
- * @public - */ -export class ServiceUnavailableException extends __BaseException { - readonly name: "ServiceUnavailableException" = "ServiceUnavailableException"; - readonly $fault: "server" = "server"; - /** - * @internal - */ - constructor(opts: __ExceptionOptionTypeConfiguration information for the tools that the model can use when generating a response.
- *This field is only supported by Anthropic Claude 3 models.
- *For information about models that support streaming tool use, see + * Supported models and model features.
* @public */ toolConfig?: ToolConfiguration | undefined; @@ -2455,6 +2997,12 @@ export interface ConverseStreamRequest { */ additionalModelResponseFieldPaths?: string[] | undefined; + /** + *Key-value pairs that you can use to filter invocation logs.
+ * @public + */ + requestMetadata?: RecordModel performance settings for the request.
* @public @@ -2926,7 +3474,8 @@ export namespace ConverseStreamOutput { } /** - *Input validation failed. Check your request parameters and retry the request.
+ *The input fails to satisfy the constraints specified by Amazon Bedrock. For troubleshooting this error, + * see ValidationError in the Amazon Bedrock User Guide
* @public */ export interface ValidationExceptionMember { @@ -2945,7 +3494,8 @@ export namespace ConverseStreamOutput { } /** - *The number of requests exceeds the limit. Resubmit your request later.
+ *Your request was denied due to exceeding the account quotas for Amazon Bedrock. For + * troubleshooting this error, see ThrottlingException in the Amazon Bedrock User Guide
* @public */ export interface ThrottlingExceptionMember { @@ -3452,6 +4002,43 @@ export interface InvokeModelWithResponseStreamResponse { performanceConfigLatency?: PerformanceConfigLatency | undefined; } +/** + * @internal + */ +export const GetAsyncInvokeResponseFilterSensitiveLog = (obj: GetAsyncInvokeResponse): any => ({ + ...obj, + ...(obj.failureMessage && { failureMessage: SENSITIVE_STRING }), + ...(obj.outputDataConfig && { outputDataConfig: obj.outputDataConfig }), +}); + +/** + * @internal + */ +export const AsyncInvokeSummaryFilterSensitiveLog = (obj: AsyncInvokeSummary): any => ({ + ...obj, + ...(obj.failureMessage && { failureMessage: SENSITIVE_STRING }), + ...(obj.outputDataConfig && { outputDataConfig: obj.outputDataConfig }), +}); + +/** + * @internal + */ +export const ListAsyncInvokesResponseFilterSensitiveLog = (obj: ListAsyncInvokesResponse): any => ({ + ...obj, + ...(obj.asyncInvokeSummaries && { + asyncInvokeSummaries: obj.asyncInvokeSummaries.map((item) => AsyncInvokeSummaryFilterSensitiveLog(item)), + }), +}); + +/** + * @internal + */ +export const StartAsyncInvokeRequestFilterSensitiveLog = (obj: StartAsyncInvokeRequest): any => ({ + ...obj, + ...(obj.modelInput && { modelInput: SENSITIVE_STRING }), + ...(obj.outputDataConfig && { outputDataConfig: obj.outputDataConfig }), +}); + /** * @internal */ @@ -3461,6 +4048,7 @@ export const ConverseRequestFilterSensitiveLog = (obj: ConverseRequest): any => ...(obj.system && { system: obj.system.map((item) => item) }), ...(obj.toolConfig && { toolConfig: obj.toolConfig }), ...(obj.promptVariables && { promptVariables: SENSITIVE_STRING }), + ...(obj.requestMetadata && { requestMetadata: SENSITIVE_STRING }), }); /** @@ -3472,6 +4060,7 @@ export const ConverseStreamRequestFilterSensitiveLog = (obj: ConverseStreamReque ...(obj.system && { system: obj.system.map((item) => item) }), ...(obj.toolConfig && { toolConfig: obj.toolConfig }), ...(obj.promptVariables && { promptVariables: SENSITIVE_STRING }), + ...(obj.requestMetadata && { requestMetadata: SENSITIVE_STRING }), }); /** diff --git a/clients/client-bedrock-runtime/src/pagination/Interfaces.ts b/clients/client-bedrock-runtime/src/pagination/Interfaces.ts new file mode 100644 index 000000000000..441261d4dd66 --- /dev/null +++ b/clients/client-bedrock-runtime/src/pagination/Interfaces.ts @@ -0,0 +1,11 @@ +// smithy-typescript generated code +import { PaginationConfiguration } from "@smithy/types"; + +import { BedrockRuntimeClient } from "../BedrockRuntimeClient"; + +/** + * @public + */ +export interface BedrockRuntimePaginationConfiguration extends PaginationConfiguration { + client: BedrockRuntimeClient; +} diff --git a/clients/client-bedrock-runtime/src/pagination/ListAsyncInvokesPaginator.ts b/clients/client-bedrock-runtime/src/pagination/ListAsyncInvokesPaginator.ts new file mode 100644 index 000000000000..7e6f6f7174d2 --- /dev/null +++ b/clients/client-bedrock-runtime/src/pagination/ListAsyncInvokesPaginator.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { createPaginator } from "@smithy/core"; +import { Paginator } from "@smithy/types"; + +import { BedrockRuntimeClient } from "../BedrockRuntimeClient"; +import { + ListAsyncInvokesCommand, + ListAsyncInvokesCommandInput, + ListAsyncInvokesCommandOutput, +} from "../commands/ListAsyncInvokesCommand"; +import { BedrockRuntimePaginationConfiguration } from "./Interfaces"; + +/** + * @public + */ +export const paginateListAsyncInvokes: ( + config: BedrockRuntimePaginationConfiguration, + input: ListAsyncInvokesCommandInput, + ...rest: any[] +) => PaginatorThe action to apply a guardrail.
", + "smithy.api#documentation": "The action to apply a guardrail.
\nFor troubleshooting some of the common errors you might encounter when using the ApplyGuardrail
API, \n see Troubleshooting Amazon Bedrock API Error Codes in the Amazon Bedrock User Guide
A storage location for the output data in an S3 bucket
" + } + } + }, + "traits": { + "smithy.api#documentation": "Asynchronous invocation output data settings.
" + } + }, + "com.amazonaws.bedrockruntime#AsyncInvokeResource": { + "type": "resource", + "operations": [ + { + "target": "com.amazonaws.bedrockruntime#GetAsyncInvoke" + }, + { + "target": "com.amazonaws.bedrockruntime#ListAsyncInvokes" + }, + { + "target": "com.amazonaws.bedrockruntime#StartAsyncInvoke" + } + ] + }, + "com.amazonaws.bedrockruntime#AsyncInvokeS3OutputDataConfig": { + "type": "structure", + "members": { + "s3Uri": { + "target": "com.amazonaws.bedrockruntime#S3Uri", + "traits": { + "smithy.api#documentation": "An object URI starting with s3://
.
A KMS encryption key ID.
" + } + }, + "bucketOwner": { + "target": "com.amazonaws.bedrockruntime#AccountId", + "traits": { + "smithy.api#documentation": "If the bucket belongs to another AWS account, specify that account's ID.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Asynchronous invocation output data settings.
" + } + }, + "com.amazonaws.bedrockruntime#AsyncInvokeStatus": { + "type": "enum", + "members": { + "IN_PROGRESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "InProgress" + } + }, + "COMPLETED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Completed" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Failed" + } + } + } + }, + "com.amazonaws.bedrockruntime#AsyncInvokeSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockruntime#AsyncInvokeSummary" + } + }, + "com.amazonaws.bedrockruntime#AsyncInvokeSummary": { + "type": "structure", + "members": { + "invocationArn": { + "target": "com.amazonaws.bedrockruntime#InvocationArn", + "traits": { + "smithy.api#documentation": "The invocation's ARN.
", + "smithy.api#required": {} + } + }, + "modelArn": { + "target": "com.amazonaws.bedrockruntime#AsyncInvokeArn", + "traits": { + "smithy.api#documentation": "The invoked model's ARN.
", + "smithy.api#required": {} + } + }, + "clientRequestToken": { + "target": "com.amazonaws.bedrockruntime#AsyncInvokeIdempotencyToken", + "traits": { + "smithy.api#documentation": "The invocation's idempotency token.
" + } + }, + "status": { + "target": "com.amazonaws.bedrockruntime#AsyncInvokeStatus", + "traits": { + "smithy.api#documentation": "The invocation's status.
" + } + }, + "failureMessage": { + "target": "com.amazonaws.bedrockruntime#AsyncInvokeMessage", + "traits": { + "smithy.api#documentation": "An error message.
" + } + }, + "submitTime": { + "target": "com.amazonaws.bedrockruntime#Timestamp", + "traits": { + "smithy.api#documentation": "When the invocation was submitted.
", + "smithy.api#required": {} + } + }, + "lastModifiedTime": { + "target": "com.amazonaws.bedrockruntime#Timestamp", + "traits": { + "smithy.api#documentation": "When the invocation was last modified.
" + } + }, + "endTime": { + "target": "com.amazonaws.bedrockruntime#Timestamp", + "traits": { + "smithy.api#documentation": "When the invocation ended.
" + } + }, + "outputDataConfig": { + "target": "com.amazonaws.bedrockruntime#AsyncInvokeOutputDataConfig", + "traits": { + "smithy.api#documentation": "The invocation's output data settings.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A summary of an asynchronous invocation.
" + } + }, "com.amazonaws.bedrockruntime#AutoToolChoice": { "type": "structure", "members": {}, @@ -860,6 +1058,19 @@ "smithy.api#sensitive": {} } }, + "com.amazonaws.bedrockruntime#ConflictException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.bedrockruntime#NonBlankString" + } + }, + "traits": { + "smithy.api#documentation": "Error occurred because of a conflict while performing an operation.
", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, "com.amazonaws.bedrockruntime#ContentBlock": { "type": "union", "members": { @@ -881,6 +1092,12 @@ "smithy.api#documentation": "A document to include in the message.
" } }, + "video": { + "target": "com.amazonaws.bedrockruntime#VideoBlock", + "traits": { + "smithy.api#documentation": "Video to include in the message.
" + } + }, "toolUse": { "target": "com.amazonaws.bedrockruntime#ToolUseBlock", "traits": { @@ -1137,7 +1354,7 @@ "toolConfig": { "target": "com.amazonaws.bedrockruntime#ToolConfiguration", "traits": { - "smithy.api#documentation": "Configuration information for the tools that the model can use when generating a response.
\nThis field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.
\nConfiguration information for the tools that the model can use when generating a response.
\nFor information about models that support tool use, see \n Supported models and model features.
" } }, "guardrailConfig": { @@ -1167,6 +1384,12 @@ } } }, + "requestMetadata": { + "target": "com.amazonaws.bedrockruntime#RequestMetadata", + "traits": { + "smithy.api#documentation": "Key-value pairs that you can use to filter invocation logs.
" + } + }, "performanceConfig": { "target": "com.amazonaws.bedrockruntime#PerformanceConfiguration", "traits": { @@ -1381,13 +1604,13 @@ "validationException": { "target": "com.amazonaws.bedrockruntime#ValidationException", "traits": { - "smithy.api#documentation": "Input validation failed. Check your request parameters and retry the request.
" + "smithy.api#documentation": "The input fails to satisfy the constraints specified by Amazon Bedrock. For troubleshooting this error, \n see ValidationError in the Amazon Bedrock User Guide
" } }, "throttlingException": { "target": "com.amazonaws.bedrockruntime#ThrottlingException", "traits": { - "smithy.api#documentation": "The number of requests exceeds the limit. Resubmit your request later.
" + "smithy.api#documentation": "Your request was denied due to exceeding the account quotas for Amazon Bedrock. For\n troubleshooting this error, see ThrottlingException in the Amazon Bedrock User Guide
" } }, "serviceUnavailableException": { @@ -1434,7 +1657,7 @@ "toolConfig": { "target": "com.amazonaws.bedrockruntime#ToolConfiguration", "traits": { - "smithy.api#documentation": "Configuration information for the tools that the model can use when generating a response.
\nThis field is only supported by Anthropic Claude 3 models.
\nConfiguration information for the tools that the model can use when generating a response.
\nFor information about models that support streaming tool use, see \n Supported models and model features.
" } }, "guardrailConfig": { @@ -1464,6 +1687,12 @@ } } }, + "requestMetadata": { + "target": "com.amazonaws.bedrockruntime#RequestMetadata", + "traits": { + "smithy.api#documentation": "Key-value pairs that you can use to filter invocation logs.
" + } + }, "performanceConfig": { "target": "com.amazonaws.bedrockruntime#PerformanceConfiguration", "traits": { @@ -1627,6 +1856,121 @@ "smithy.api#documentation": "Contains the content of a document.
" } }, + "com.amazonaws.bedrockruntime#GetAsyncInvoke": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockruntime#GetAsyncInvokeRequest" + }, + "output": { + "target": "com.amazonaws.bedrockruntime#GetAsyncInvokeResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockruntime#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockruntime#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockruntime#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockruntime#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Retrieve information about an asynchronous invocation.
", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/async-invoke/{invocationArn}" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.bedrockruntime#GetAsyncInvokeRequest": { + "type": "structure", + "members": { + "invocationArn": { + "target": "com.amazonaws.bedrockruntime#InvocationArn", + "traits": { + "smithy.api#documentation": "The invocation's ARN.
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockruntime#GetAsyncInvokeResponse": { + "type": "structure", + "members": { + "invocationArn": { + "target": "com.amazonaws.bedrockruntime#InvocationArn", + "traits": { + "smithy.api#documentation": "The invocation's ARN.
", + "smithy.api#required": {} + } + }, + "modelArn": { + "target": "com.amazonaws.bedrockruntime#AsyncInvokeArn", + "traits": { + "smithy.api#documentation": "The invocation's model ARN.
", + "smithy.api#required": {} + } + }, + "clientRequestToken": { + "target": "com.amazonaws.bedrockruntime#AsyncInvokeIdempotencyToken", + "traits": { + "smithy.api#documentation": "The invocation's idempotency token.
" + } + }, + "status": { + "target": "com.amazonaws.bedrockruntime#AsyncInvokeStatus", + "traits": { + "smithy.api#documentation": "The invocation's status.
", + "smithy.api#required": {} + } + }, + "failureMessage": { + "target": "com.amazonaws.bedrockruntime#AsyncInvokeMessage", + "traits": { + "smithy.api#documentation": "An error message.
" + } + }, + "submitTime": { + "target": "com.amazonaws.bedrockruntime#Timestamp", + "traits": { + "smithy.api#documentation": "When the invocation request was submitted.
", + "smithy.api#required": {} + } + }, + "lastModifiedTime": { + "target": "com.amazonaws.bedrockruntime#Timestamp", + "traits": { + "smithy.api#documentation": "The invocation's last modified time.
" + } + }, + "endTime": { + "target": "com.amazonaws.bedrockruntime#Timestamp", + "traits": { + "smithy.api#documentation": "When the invocation ended.
" + } + }, + "outputDataConfig": { + "target": "com.amazonaws.bedrockruntime#AsyncInvokeOutputDataConfig", + "traits": { + "smithy.api#documentation": "Output data settings.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.bedrockruntime#GuardrailAction": { "type": "enum", "members": { @@ -3056,6 +3400,16 @@ "smithy.api#httpError": 500 } }, + "com.amazonaws.bedrockruntime#InvocationArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "smithy.api#pattern": "^arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:async-invoke/[a-z0-9]{12}$" + } + }, "com.amazonaws.bedrockruntime#InvokeModel": { "type": "operation", "input": { @@ -3361,27 +3715,163 @@ "smithy.api#output": {} } }, - "com.amazonaws.bedrockruntime#Message": { - "type": "structure", - "members": { - "role": { - "target": "com.amazonaws.bedrockruntime#ConversationRole", - "traits": { - "smithy.api#documentation": "The role that the message plays in the message.
", - "smithy.api#required": {} - } - }, - "content": { - "target": "com.amazonaws.bedrockruntime#ContentBlocks", - "traits": { - "smithy.api#documentation": "The message content. Note the following restrictions:
\nYou can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.
\nYou can include up to five documents. Each document's size must be no more than 4.5 MB.
\nIf you include a ContentBlock
with a document
field in the array, you must also include a ContentBlock
with a text
field.
You can only include images and documents if the role
is user
.
A message input, or returned from, a call to Converse or ConverseStream.
" - } + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "smithy.api#pattern": "^arn:aws(-[^:]+)?:kms:[a-zA-Z0-9-]*:[0-9]{12}:((key/[a-zA-Z0-9-]{36})|(alias/[a-zA-Z0-9-_/]+))$" + } + }, + "com.amazonaws.bedrockruntime#ListAsyncInvokes": { + "type": "operation", + "input": { + "target": "com.amazonaws.bedrockruntime#ListAsyncInvokesRequest" + }, + "output": { + "target": "com.amazonaws.bedrockruntime#ListAsyncInvokesResponse" + }, + "errors": [ + { + "target": "com.amazonaws.bedrockruntime#AccessDeniedException" + }, + { + "target": "com.amazonaws.bedrockruntime#InternalServerException" + }, + { + "target": "com.amazonaws.bedrockruntime#ThrottlingException" + }, + { + "target": "com.amazonaws.bedrockruntime#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "Lists asynchronous invocations.
", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/async-invoke" + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "asyncInvokeSummaries" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.bedrockruntime#ListAsyncInvokesRequest": { + "type": "structure", + "members": { + "submitTimeAfter": { + "target": "com.amazonaws.bedrockruntime#Timestamp", + "traits": { + "smithy.api#documentation": "Include invocations submitted after this time.
", + "smithy.api#httpQuery": "submitTimeAfter" + } + }, + "submitTimeBefore": { + "target": "com.amazonaws.bedrockruntime#Timestamp", + "traits": { + "smithy.api#documentation": "Include invocations submitted before this time.
", + "smithy.api#httpQuery": "submitTimeBefore" + } + }, + "statusEquals": { + "target": "com.amazonaws.bedrockruntime#AsyncInvokeStatus", + "traits": { + "smithy.api#documentation": "Filter invocations by status.
", + "smithy.api#httpQuery": "statusEquals" + } + }, + "maxResults": { + "target": "com.amazonaws.bedrockruntime#MaxResults", + "traits": { + "smithy.api#documentation": "The maximum number of invocations to return in one page of results.
", + "smithy.api#httpQuery": "maxResults" + } + }, + "nextToken": { + "target": "com.amazonaws.bedrockruntime#PaginationToken", + "traits": { + "smithy.api#documentation": "Specify the pagination token from a previous request to retrieve the next page of results.
", + "smithy.api#httpQuery": "nextToken" + } + }, + "sortBy": { + "target": "com.amazonaws.bedrockruntime#SortAsyncInvocationBy", + "traits": { + "smithy.api#default": "SubmissionTime", + "smithy.api#documentation": "How to sort the response.
", + "smithy.api#httpQuery": "sortBy" + } + }, + "sortOrder": { + "target": "com.amazonaws.bedrockruntime#SortOrder", + "traits": { + "smithy.api#default": "Descending", + "smithy.api#documentation": "The sorting order for the response.
", + "smithy.api#httpQuery": "sortOrder" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockruntime#ListAsyncInvokesResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "com.amazonaws.bedrockruntime#PaginationToken", + "traits": { + "smithy.api#documentation": "Specify the pagination token from a previous request to retrieve the next page of results.
" + } + }, + "asyncInvokeSummaries": { + "target": "com.amazonaws.bedrockruntime#AsyncInvokeSummaries", + "traits": { + "smithy.api#documentation": "A list of invocation summaries.
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.bedrockruntime#MaxResults": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 1000 + } + } + }, + "com.amazonaws.bedrockruntime#Message": { + "type": "structure", + "members": { + "role": { + "target": "com.amazonaws.bedrockruntime#ConversationRole", + "traits": { + "smithy.api#documentation": "The role that the message plays in the message.
", + "smithy.api#required": {} + } + }, + "content": { + "target": "com.amazonaws.bedrockruntime#ContentBlocks", + "traits": { + "smithy.api#documentation": "The message content. Note the following restrictions:
\nYou can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.
\nYou can include up to five documents. Each document's size must be no more than 4.5 MB.
\nIf you include a ContentBlock
with a document
field in the array, you must also include a ContentBlock
with a text
field.
You can only include images and documents if the role
is user
.
A message input, or returned from, a call to Converse or ConverseStream.
" + } }, "com.amazonaws.bedrockruntime#MessageStartEvent": { "type": "structure", @@ -3453,6 +3943,12 @@ "smithy.api#httpError": 424 } }, + "com.amazonaws.bedrockruntime#ModelInputPayload": { + "type": "document", + "traits": { + "smithy.api#sensitive": {} + } + }, "com.amazonaws.bedrockruntime#ModelNotReadyException": { "type": "structure", "members": { @@ -3539,6 +4035,16 @@ } } }, + "com.amazonaws.bedrockruntime#PaginationToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "smithy.api#pattern": "^\\S*$" + } + }, "com.amazonaws.bedrockruntime#PartBody": { "type": "blob", "traits": { @@ -3621,6 +4127,36 @@ "smithy.api#documentation": "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 How Prompt management works.
" } }, + "com.amazonaws.bedrockruntime#RequestMetadata": { + "type": "map", + "key": { + "target": "smithy.api#String", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 256 + }, + "smithy.api#pattern": "^[a-zA-Z0-9\\s:_@$#=/+,-.]{1,256}$" + } + }, + "value": { + "target": "smithy.api#String", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 256 + }, + "smithy.api#pattern": "^[a-zA-Z0-9\\s:_@$#=/+,-.]{0,256}$" + } + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 16 + }, + "smithy.api#sensitive": {} + } + }, "com.amazonaws.bedrockruntime#ResourceNotFoundException": { "type": "structure", "members": { @@ -3685,6 +4221,37 @@ "smithy.api#streaming": {} } }, + "com.amazonaws.bedrockruntime#S3Location": { + "type": "structure", + "members": { + "uri": { + "target": "com.amazonaws.bedrockruntime#S3Uri", + "traits": { + "smithy.api#documentation": "An object URI starting with s3://
.
If the bucket belongs to another AWS account, specify that account's ID.
" + } + } + }, + "traits": { + "smithy.api#documentation": "A storage location in an S3 bucket.
" + } + }, + "com.amazonaws.bedrockruntime#S3Uri": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1024 + }, + "smithy.api#pattern": "^s3://[a-z0-9][\\.\\-a-z0-9]{1,61}[a-z0-9](/.*)?$" + } + }, "com.amazonaws.bedrockruntime#ServiceQuotaExceededException": { "type": "structure", "members": { @@ -3711,6 +4278,34 @@ "smithy.api#httpError": 503 } }, + "com.amazonaws.bedrockruntime#SortAsyncInvocationBy": { + "type": "enum", + "members": { + "SUBMISSION_TIME": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SubmissionTime" + } + } + } + }, + "com.amazonaws.bedrockruntime#SortOrder": { + "type": "enum", + "members": { + "ASCENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Ascending" + } + }, + "DESCENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Descending" + } + } + } + }, "com.amazonaws.bedrockruntime#SpecificToolChoice": { "type": "structure", "members": { @@ -3726,6 +4321,107 @@ "smithy.api#documentation": "The model must request a specific tool. For example, {\"tool\" : {\"name\" : \"Your tool name\"}}
.
This field is only supported by Anthropic Claude 3 models.
\nStarts an asynchronous invocation.
\nThis operation requires permission for the bedrock:InvokeModel
action.
To deny all inference access to resources that you specify in the modelId field, you\n need to deny access to the bedrock:InvokeModel
and\n bedrock:InvokeModelWithResponseStream
actions. Doing this also denies\n access to the resource through the Converse API actions (Converse and ConverseStream). For more information see Deny access for inference on specific models.\n
Specify idempotency token to ensure that requests are not duplicated.
", + "smithy.api#idempotencyToken": {} + } + }, + "modelId": { + "target": "com.amazonaws.bedrockruntime#AsyncInvokeIdentifier", + "traits": { + "smithy.api#documentation": "The model to invoke.
", + "smithy.api#required": {} + } + }, + "modelInput": { + "target": "com.amazonaws.bedrockruntime#ModelInputPayload", + "traits": { + "smithy.api#documentation": "Input to send to the model.
", + "smithy.api#required": {} + } + }, + "outputDataConfig": { + "target": "com.amazonaws.bedrockruntime#AsyncInvokeOutputDataConfig", + "traits": { + "smithy.api#documentation": "Where to store the output.
", + "smithy.api#required": {} + } + }, + "tags": { + "target": "com.amazonaws.bedrockruntime#TagList", + "traits": { + "smithy.api#documentation": "Tags to apply to the invocation.
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.bedrockruntime#StartAsyncInvokeResponse": { + "type": "structure", + "members": { + "invocationArn": { + "target": "com.amazonaws.bedrockruntime#InvocationArn", + "traits": { + "smithy.api#documentation": "The ARN of the invocation.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.bedrockruntime#StatusCode": { "type": "integer", "traits": { @@ -3802,6 +4498,60 @@ "target": "com.amazonaws.bedrockruntime#SystemContentBlock" } }, + "com.amazonaws.bedrockruntime#Tag": { + "type": "structure", + "members": { + "key": { + "target": "com.amazonaws.bedrockruntime#TagKey", + "traits": { + "smithy.api#documentation": "The tag's key.
", + "smithy.api#required": {} + } + }, + "value": { + "target": "com.amazonaws.bedrockruntime#TagValue", + "traits": { + "smithy.api#documentation": "The tag's value.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A tag.
" + } + }, + "com.amazonaws.bedrockruntime#TagKey": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 128 + }, + "smithy.api#pattern": "^[a-zA-Z0-9\\s._:/=+@-]*$" + } + }, + "com.amazonaws.bedrockruntime#TagList": { + "type": "list", + "member": { + "target": "com.amazonaws.bedrockruntime#Tag" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 200 + } + } + }, + "com.amazonaws.bedrockruntime#TagValue": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 256 + }, + "smithy.api#pattern": "^[a-zA-Z0-9\\s._:/=+@-]*$" + } + }, "com.amazonaws.bedrockruntime#TextCharactersGuarded": { "type": "integer" }, @@ -3821,6 +4571,12 @@ "smithy.api#httpError": 429 } }, + "com.amazonaws.bedrockruntime#Timestamp": { + "type": "timestamp", + "traits": { + "smithy.api#timestampFormat": "date-time" + } + }, "com.amazonaws.bedrockruntime#TokenUsage": { "type": "structure", "members": { @@ -3920,7 +4676,7 @@ } }, "traits": { - "smithy.api#documentation": "Configuration information for the tools that you pass to a model. For more information, see Tool use (function calling) in the Amazon Bedrock User Guide.
\nThis field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.
\nConfiguration information for the tools that you pass to a model. For more information, see Tool use (function calling) in the Amazon Bedrock User Guide.
" } }, "com.amazonaws.bedrockruntime#ToolInputSchema": { @@ -4001,6 +4757,12 @@ "traits": { "smithy.api#documentation": "A tool result that is a document.
" } + }, + "video": { + "target": "com.amazonaws.bedrockruntime#VideoBlock", + "traits": { + "smithy.api#documentation": "A tool result that is video.
" + } } }, "traits": { @@ -4169,6 +4931,110 @@ "smithy.api#error": "client", "smithy.api#httpError": 400 } + }, + "com.amazonaws.bedrockruntime#VideoBlock": { + "type": "structure", + "members": { + "format": { + "target": "com.amazonaws.bedrockruntime#VideoFormat", + "traits": { + "smithy.api#documentation": "The block's format.
", + "smithy.api#required": {} + } + }, + "source": { + "target": "com.amazonaws.bedrockruntime#VideoSource", + "traits": { + "smithy.api#documentation": "The block's source.
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "A video block.
" + } + }, + "com.amazonaws.bedrockruntime#VideoFormat": { + "type": "enum", + "members": { + "MKV": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "mkv" + } + }, + "MOV": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "mov" + } + }, + "MP4": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "mp4" + } + }, + "WEBM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "webm" + } + }, + "FLV": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "flv" + } + }, + "MPEG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "mpeg" + } + }, + "MPG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "mpg" + } + }, + "WMV": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "wmv" + } + }, + "THREE_GP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "three_gp" + } + } + } + }, + "com.amazonaws.bedrockruntime#VideoSource": { + "type": "union", + "members": { + "bytes": { + "target": "smithy.api#Blob", + "traits": { + "smithy.api#documentation": "Video content encoded in base64.
", + "smithy.api#length": { + "min": 1 + } + } + }, + "s3Location": { + "target": "com.amazonaws.bedrockruntime#S3Location", + "traits": { + "smithy.api#documentation": "The location of a video object in an S3 bucket.
" + } + } + }, + "traits": { + "smithy.api#documentation": "A video source. You can upload a smaller video as a base64-encoded string as\n long as the encoded file is less than 25MB. You can also transfer videos up to 1GB in size\n from an S3 bucket.
" + } } } }