Skip to content

Commit

Permalink
feat(client-bedrock): Update Application Inference Profile
Browse files Browse the repository at this point in the history
  • Loading branch information
awstools committed Oct 29, 2024
1 parent 820ad6d commit cd3a5ec
Show file tree
Hide file tree
Showing 14 changed files with 892 additions and 72 deletions.
16 changes: 16 additions & 0 deletions clients/client-bedrock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,14 @@ CreateGuardrailVersion

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock/command/CreateGuardrailVersionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock/Interface/CreateGuardrailVersionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock/Interface/CreateGuardrailVersionCommandOutput/)

</details>
<details>
<summary>
CreateInferenceProfile
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock/command/CreateInferenceProfileCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock/Interface/CreateInferenceProfileCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock/Interface/CreateInferenceProfileCommandOutput/)

</details>
<details>
<summary>
Expand Down Expand Up @@ -298,6 +306,14 @@ DeleteImportedModel

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock/command/DeleteImportedModelCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock/Interface/DeleteImportedModelCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock/Interface/DeleteImportedModelCommandOutput/)

</details>
<details>
<summary>
DeleteInferenceProfile
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock/command/DeleteInferenceProfileCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock/Interface/DeleteInferenceProfileCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock/Interface/DeleteInferenceProfileCommandOutput/)

</details>
<details>
<summary>
Expand Down
46 changes: 46 additions & 0 deletions clients/client-bedrock/src/Bedrock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ import {
CreateGuardrailVersionCommandInput,
CreateGuardrailVersionCommandOutput,
} from "./commands/CreateGuardrailVersionCommand";
import {
CreateInferenceProfileCommand,
CreateInferenceProfileCommandInput,
CreateInferenceProfileCommandOutput,
} from "./commands/CreateInferenceProfileCommand";
import {
CreateModelCopyJobCommand,
CreateModelCopyJobCommandInput,
Expand Down Expand Up @@ -63,6 +68,11 @@ import {
DeleteImportedModelCommandInput,
DeleteImportedModelCommandOutput,
} from "./commands/DeleteImportedModelCommand";
import {
DeleteInferenceProfileCommand,
DeleteInferenceProfileCommandInput,
DeleteInferenceProfileCommandOutput,
} from "./commands/DeleteInferenceProfileCommand";
import {
DeleteModelInvocationLoggingConfigurationCommand,
DeleteModelInvocationLoggingConfigurationCommandInput,
Expand Down Expand Up @@ -235,6 +245,7 @@ const commands = {
CreateEvaluationJobCommand,
CreateGuardrailCommand,
CreateGuardrailVersionCommand,
CreateInferenceProfileCommand,
CreateModelCopyJobCommand,
CreateModelCustomizationJobCommand,
CreateModelImportJobCommand,
Expand All @@ -243,6 +254,7 @@ const commands = {
DeleteCustomModelCommand,
DeleteGuardrailCommand,
DeleteImportedModelCommand,
DeleteInferenceProfileCommand,
DeleteModelInvocationLoggingConfigurationCommand,
DeleteProvisionedModelThroughputCommand,
GetCustomModelCommand,
Expand Down Expand Up @@ -345,6 +357,23 @@ export interface Bedrock {
cb: (err: any, data?: CreateGuardrailVersionCommandOutput) => void
): void;

/**
* @see {@link CreateInferenceProfileCommand}
*/
createInferenceProfile(
args: CreateInferenceProfileCommandInput,
options?: __HttpHandlerOptions
): Promise<CreateInferenceProfileCommandOutput>;
createInferenceProfile(
args: CreateInferenceProfileCommandInput,
cb: (err: any, data?: CreateInferenceProfileCommandOutput) => void
): void;
createInferenceProfile(
args: CreateInferenceProfileCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: CreateInferenceProfileCommandOutput) => void
): void;

/**
* @see {@link CreateModelCopyJobCommand}
*/
Expand Down Expand Up @@ -478,6 +507,23 @@ export interface Bedrock {
cb: (err: any, data?: DeleteImportedModelCommandOutput) => void
): void;

/**
* @see {@link DeleteInferenceProfileCommand}
*/
deleteInferenceProfile(
args: DeleteInferenceProfileCommandInput,
options?: __HttpHandlerOptions
): Promise<DeleteInferenceProfileCommandOutput>;
deleteInferenceProfile(
args: DeleteInferenceProfileCommandInput,
cb: (err: any, data?: DeleteInferenceProfileCommandOutput) => void
): void;
deleteInferenceProfile(
args: DeleteInferenceProfileCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DeleteInferenceProfileCommandOutput) => void
): void;

/**
* @see {@link DeleteModelInvocationLoggingConfigurationCommand}
*/
Expand Down
12 changes: 12 additions & 0 deletions clients/client-bedrock/src/BedrockClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ import {
CreateGuardrailVersionCommandInput,
CreateGuardrailVersionCommandOutput,
} from "./commands/CreateGuardrailVersionCommand";
import {
CreateInferenceProfileCommandInput,
CreateInferenceProfileCommandOutput,
} from "./commands/CreateInferenceProfileCommand";
import { CreateModelCopyJobCommandInput, CreateModelCopyJobCommandOutput } from "./commands/CreateModelCopyJobCommand";
import {
CreateModelCustomizationJobCommandInput,
Expand All @@ -89,6 +93,10 @@ import {
DeleteImportedModelCommandInput,
DeleteImportedModelCommandOutput,
} from "./commands/DeleteImportedModelCommand";
import {
DeleteInferenceProfileCommandInput,
DeleteInferenceProfileCommandOutput,
} from "./commands/DeleteInferenceProfileCommand";
import {
DeleteModelInvocationLoggingConfigurationCommandInput,
DeleteModelInvocationLoggingConfigurationCommandOutput,
Expand Down Expand Up @@ -196,6 +204,7 @@ export type ServiceInputTypes =
| CreateEvaluationJobCommandInput
| CreateGuardrailCommandInput
| CreateGuardrailVersionCommandInput
| CreateInferenceProfileCommandInput
| CreateModelCopyJobCommandInput
| CreateModelCustomizationJobCommandInput
| CreateModelImportJobCommandInput
Expand All @@ -204,6 +213,7 @@ export type ServiceInputTypes =
| DeleteCustomModelCommandInput
| DeleteGuardrailCommandInput
| DeleteImportedModelCommandInput
| DeleteInferenceProfileCommandInput
| DeleteModelInvocationLoggingConfigurationCommandInput
| DeleteProvisionedModelThroughputCommandInput
| GetCustomModelCommandInput
Expand Down Expand Up @@ -247,6 +257,7 @@ export type ServiceOutputTypes =
| CreateEvaluationJobCommandOutput
| CreateGuardrailCommandOutput
| CreateGuardrailVersionCommandOutput
| CreateInferenceProfileCommandOutput
| CreateModelCopyJobCommandOutput
| CreateModelCustomizationJobCommandOutput
| CreateModelImportJobCommandOutput
Expand All @@ -255,6 +266,7 @@ export type ServiceOutputTypes =
| DeleteCustomModelCommandOutput
| DeleteGuardrailCommandOutput
| DeleteImportedModelCommandOutput
| DeleteInferenceProfileCommandOutput
| DeleteModelInvocationLoggingConfigurationCommandOutput
| DeleteProvisionedModelThroughputCommandOutput
| GetCustomModelCommandOutput
Expand Down
133 changes: 133 additions & 0 deletions clients/client-bedrock/src/commands/CreateInferenceProfileCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
// 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 { BedrockClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockClient";
import { commonParams } from "../endpoint/EndpointParameters";
import {
CreateInferenceProfileRequest,
CreateInferenceProfileRequestFilterSensitiveLog,
CreateInferenceProfileResponse,
} from "../models/models_0";
import { de_CreateInferenceProfileCommand, se_CreateInferenceProfileCommand } from "../protocols/Aws_restJson1";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link CreateInferenceProfileCommand}.
*/
export interface CreateInferenceProfileCommandInput extends CreateInferenceProfileRequest {}
/**
* @public
*
* The output of {@link CreateInferenceProfileCommand}.
*/
export interface CreateInferenceProfileCommandOutput extends CreateInferenceProfileResponse, __MetadataBearer {}

/**
* <p>Creates an application inference profile to track metrics and costs when invoking a model. To create an application inference profile for a foundation model in one region, specify the ARN of the model in that region. To create an application inference profile for a foundation model across multiple regions, specify the ARN of the system-defined inference profile that contains the regions that you want to route requests to. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">Increase throughput and resilience with cross-region inference in Amazon Bedrock</a>. in the Amazon Bedrock User Guide.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { BedrockClient, CreateInferenceProfileCommand } from "@aws-sdk/client-bedrock"; // ES Modules import
* // const { BedrockClient, CreateInferenceProfileCommand } = require("@aws-sdk/client-bedrock"); // CommonJS import
* const client = new BedrockClient(config);
* const input = { // CreateInferenceProfileRequest
* inferenceProfileName: "STRING_VALUE", // required
* description: "STRING_VALUE",
* clientRequestToken: "STRING_VALUE",
* modelSource: { // InferenceProfileModelSource Union: only one key present
* copyFrom: "STRING_VALUE",
* },
* tags: [ // TagList
* { // Tag
* key: "STRING_VALUE", // required
* value: "STRING_VALUE", // required
* },
* ],
* };
* const command = new CreateInferenceProfileCommand(input);
* const response = await client.send(command);
* // { // CreateInferenceProfileResponse
* // inferenceProfileArn: "STRING_VALUE", // required
* // status: "ACTIVE",
* // };
*
* ```
*
* @param CreateInferenceProfileCommandInput - {@link CreateInferenceProfileCommandInput}
* @returns {@link CreateInferenceProfileCommandOutput}
* @see {@link CreateInferenceProfileCommandInput} for command's `input` shape.
* @see {@link CreateInferenceProfileCommandOutput} for command's `response` shape.
* @see {@link BedrockClientResolvedConfig | config} for BedrockClient's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>The request is denied because of missing access permissions.</p>
*
* @throws {@link ConflictException} (client fault)
* <p>Error occurred because of a conflict while performing an operation.</p>
*
* @throws {@link InternalServerException} (server fault)
* <p>An internal server error occurred. Retry your request.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.</p>
*
* @throws {@link ServiceQuotaExceededException} (client fault)
* <p>The number of requests exceeds the service quota. Resubmit your request later.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>The number of requests exceeds the limit. Resubmit your request later.</p>
*
* @throws {@link TooManyTagsException} (client fault)
* <p>The request contains more tags than can be associated with a resource (50 tags per resource).
* The maximum number of tags includes both existing tags and those included in your current request. </p>
*
* @throws {@link ValidationException} (client fault)
* <p>Input validation failed. Check your request parameters and retry the request.</p>
*
* @throws {@link BedrockServiceException}
* <p>Base exception class for all service exceptions from Bedrock service.</p>
*
* @public
*/
export class CreateInferenceProfileCommand extends $Command
.classBuilder<
CreateInferenceProfileCommandInput,
CreateInferenceProfileCommandOutput,
BedrockClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep(commonParams)
.m(function (this: any, Command: any, cs: any, config: BedrockClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("AmazonBedrockControlPlaneService", "CreateInferenceProfile", {})
.n("BedrockClient", "CreateInferenceProfileCommand")
.f(CreateInferenceProfileRequestFilterSensitiveLog, void 0)
.ser(se_CreateInferenceProfileCommand)
.de(de_CreateInferenceProfileCommand)
.build() {
/** @internal type navigation helper, not in runtime. */
protected declare static __types: {
api: {
input: CreateInferenceProfileRequest;
output: CreateInferenceProfileResponse;
};
sdk: {
input: CreateInferenceProfileCommandInput;
output: CreateInferenceProfileCommandOutput;
};
};
}
Loading

0 comments on commit cd3a5ec

Please sign in to comment.