Skip to content

Commit cd3a5ec

Browse files
author
awstools
committed
feat(client-bedrock): Update Application Inference Profile
1 parent 820ad6d commit cd3a5ec

14 files changed

+892
-72
lines changed

clients/client-bedrock/README.md

+16
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,14 @@ CreateGuardrailVersion
234234

235235
[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/)
236236

237+
</details>
238+
<details>
239+
<summary>
240+
CreateInferenceProfile
241+
</summary>
242+
243+
[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/)
244+
237245
</details>
238246
<details>
239247
<summary>
@@ -298,6 +306,14 @@ DeleteImportedModel
298306

299307
[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/)
300308

309+
</details>
310+
<details>
311+
<summary>
312+
DeleteInferenceProfile
313+
</summary>
314+
315+
[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/)
316+
301317
</details>
302318
<details>
303319
<summary>

clients/client-bedrock/src/Bedrock.ts

+46
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ import {
2323
CreateGuardrailVersionCommandInput,
2424
CreateGuardrailVersionCommandOutput,
2525
} from "./commands/CreateGuardrailVersionCommand";
26+
import {
27+
CreateInferenceProfileCommand,
28+
CreateInferenceProfileCommandInput,
29+
CreateInferenceProfileCommandOutput,
30+
} from "./commands/CreateInferenceProfileCommand";
2631
import {
2732
CreateModelCopyJobCommand,
2833
CreateModelCopyJobCommandInput,
@@ -63,6 +68,11 @@ import {
6368
DeleteImportedModelCommandInput,
6469
DeleteImportedModelCommandOutput,
6570
} from "./commands/DeleteImportedModelCommand";
71+
import {
72+
DeleteInferenceProfileCommand,
73+
DeleteInferenceProfileCommandInput,
74+
DeleteInferenceProfileCommandOutput,
75+
} from "./commands/DeleteInferenceProfileCommand";
6676
import {
6777
DeleteModelInvocationLoggingConfigurationCommand,
6878
DeleteModelInvocationLoggingConfigurationCommandInput,
@@ -235,6 +245,7 @@ const commands = {
235245
CreateEvaluationJobCommand,
236246
CreateGuardrailCommand,
237247
CreateGuardrailVersionCommand,
248+
CreateInferenceProfileCommand,
238249
CreateModelCopyJobCommand,
239250
CreateModelCustomizationJobCommand,
240251
CreateModelImportJobCommand,
@@ -243,6 +254,7 @@ const commands = {
243254
DeleteCustomModelCommand,
244255
DeleteGuardrailCommand,
245256
DeleteImportedModelCommand,
257+
DeleteInferenceProfileCommand,
246258
DeleteModelInvocationLoggingConfigurationCommand,
247259
DeleteProvisionedModelThroughputCommand,
248260
GetCustomModelCommand,
@@ -345,6 +357,23 @@ export interface Bedrock {
345357
cb: (err: any, data?: CreateGuardrailVersionCommandOutput) => void
346358
): void;
347359

360+
/**
361+
* @see {@link CreateInferenceProfileCommand}
362+
*/
363+
createInferenceProfile(
364+
args: CreateInferenceProfileCommandInput,
365+
options?: __HttpHandlerOptions
366+
): Promise<CreateInferenceProfileCommandOutput>;
367+
createInferenceProfile(
368+
args: CreateInferenceProfileCommandInput,
369+
cb: (err: any, data?: CreateInferenceProfileCommandOutput) => void
370+
): void;
371+
createInferenceProfile(
372+
args: CreateInferenceProfileCommandInput,
373+
options: __HttpHandlerOptions,
374+
cb: (err: any, data?: CreateInferenceProfileCommandOutput) => void
375+
): void;
376+
348377
/**
349378
* @see {@link CreateModelCopyJobCommand}
350379
*/
@@ -478,6 +507,23 @@ export interface Bedrock {
478507
cb: (err: any, data?: DeleteImportedModelCommandOutput) => void
479508
): void;
480509

510+
/**
511+
* @see {@link DeleteInferenceProfileCommand}
512+
*/
513+
deleteInferenceProfile(
514+
args: DeleteInferenceProfileCommandInput,
515+
options?: __HttpHandlerOptions
516+
): Promise<DeleteInferenceProfileCommandOutput>;
517+
deleteInferenceProfile(
518+
args: DeleteInferenceProfileCommandInput,
519+
cb: (err: any, data?: DeleteInferenceProfileCommandOutput) => void
520+
): void;
521+
deleteInferenceProfile(
522+
args: DeleteInferenceProfileCommandInput,
523+
options: __HttpHandlerOptions,
524+
cb: (err: any, data?: DeleteInferenceProfileCommandOutput) => void
525+
): void;
526+
481527
/**
482528
* @see {@link DeleteModelInvocationLoggingConfigurationCommand}
483529
*/

clients/client-bedrock/src/BedrockClient.ts

+12
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ import {
6666
CreateGuardrailVersionCommandInput,
6767
CreateGuardrailVersionCommandOutput,
6868
} from "./commands/CreateGuardrailVersionCommand";
69+
import {
70+
CreateInferenceProfileCommandInput,
71+
CreateInferenceProfileCommandOutput,
72+
} from "./commands/CreateInferenceProfileCommand";
6973
import { CreateModelCopyJobCommandInput, CreateModelCopyJobCommandOutput } from "./commands/CreateModelCopyJobCommand";
7074
import {
7175
CreateModelCustomizationJobCommandInput,
@@ -89,6 +93,10 @@ import {
8993
DeleteImportedModelCommandInput,
9094
DeleteImportedModelCommandOutput,
9195
} from "./commands/DeleteImportedModelCommand";
96+
import {
97+
DeleteInferenceProfileCommandInput,
98+
DeleteInferenceProfileCommandOutput,
99+
} from "./commands/DeleteInferenceProfileCommand";
92100
import {
93101
DeleteModelInvocationLoggingConfigurationCommandInput,
94102
DeleteModelInvocationLoggingConfigurationCommandOutput,
@@ -196,6 +204,7 @@ export type ServiceInputTypes =
196204
| CreateEvaluationJobCommandInput
197205
| CreateGuardrailCommandInput
198206
| CreateGuardrailVersionCommandInput
207+
| CreateInferenceProfileCommandInput
199208
| CreateModelCopyJobCommandInput
200209
| CreateModelCustomizationJobCommandInput
201210
| CreateModelImportJobCommandInput
@@ -204,6 +213,7 @@ export type ServiceInputTypes =
204213
| DeleteCustomModelCommandInput
205214
| DeleteGuardrailCommandInput
206215
| DeleteImportedModelCommandInput
216+
| DeleteInferenceProfileCommandInput
207217
| DeleteModelInvocationLoggingConfigurationCommandInput
208218
| DeleteProvisionedModelThroughputCommandInput
209219
| GetCustomModelCommandInput
@@ -247,6 +257,7 @@ export type ServiceOutputTypes =
247257
| CreateEvaluationJobCommandOutput
248258
| CreateGuardrailCommandOutput
249259
| CreateGuardrailVersionCommandOutput
260+
| CreateInferenceProfileCommandOutput
250261
| CreateModelCopyJobCommandOutput
251262
| CreateModelCustomizationJobCommandOutput
252263
| CreateModelImportJobCommandOutput
@@ -255,6 +266,7 @@ export type ServiceOutputTypes =
255266
| DeleteCustomModelCommandOutput
256267
| DeleteGuardrailCommandOutput
257268
| DeleteImportedModelCommandOutput
269+
| DeleteInferenceProfileCommandOutput
258270
| DeleteModelInvocationLoggingConfigurationCommandOutput
259271
| DeleteProvisionedModelThroughputCommandOutput
260272
| GetCustomModelCommandOutput
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { BedrockClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import {
10+
CreateInferenceProfileRequest,
11+
CreateInferenceProfileRequestFilterSensitiveLog,
12+
CreateInferenceProfileResponse,
13+
} from "../models/models_0";
14+
import { de_CreateInferenceProfileCommand, se_CreateInferenceProfileCommand } from "../protocols/Aws_restJson1";
15+
16+
/**
17+
* @public
18+
*/
19+
export type { __MetadataBearer };
20+
export { $Command };
21+
/**
22+
* @public
23+
*
24+
* The input for {@link CreateInferenceProfileCommand}.
25+
*/
26+
export interface CreateInferenceProfileCommandInput extends CreateInferenceProfileRequest {}
27+
/**
28+
* @public
29+
*
30+
* The output of {@link CreateInferenceProfileCommand}.
31+
*/
32+
export interface CreateInferenceProfileCommandOutput extends CreateInferenceProfileResponse, __MetadataBearer {}
33+
34+
/**
35+
* <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>
36+
* @example
37+
* Use a bare-bones client and the command you need to make an API call.
38+
* ```javascript
39+
* import { BedrockClient, CreateInferenceProfileCommand } from "@aws-sdk/client-bedrock"; // ES Modules import
40+
* // const { BedrockClient, CreateInferenceProfileCommand } = require("@aws-sdk/client-bedrock"); // CommonJS import
41+
* const client = new BedrockClient(config);
42+
* const input = { // CreateInferenceProfileRequest
43+
* inferenceProfileName: "STRING_VALUE", // required
44+
* description: "STRING_VALUE",
45+
* clientRequestToken: "STRING_VALUE",
46+
* modelSource: { // InferenceProfileModelSource Union: only one key present
47+
* copyFrom: "STRING_VALUE",
48+
* },
49+
* tags: [ // TagList
50+
* { // Tag
51+
* key: "STRING_VALUE", // required
52+
* value: "STRING_VALUE", // required
53+
* },
54+
* ],
55+
* };
56+
* const command = new CreateInferenceProfileCommand(input);
57+
* const response = await client.send(command);
58+
* // { // CreateInferenceProfileResponse
59+
* // inferenceProfileArn: "STRING_VALUE", // required
60+
* // status: "ACTIVE",
61+
* // };
62+
*
63+
* ```
64+
*
65+
* @param CreateInferenceProfileCommandInput - {@link CreateInferenceProfileCommandInput}
66+
* @returns {@link CreateInferenceProfileCommandOutput}
67+
* @see {@link CreateInferenceProfileCommandInput} for command's `input` shape.
68+
* @see {@link CreateInferenceProfileCommandOutput} for command's `response` shape.
69+
* @see {@link BedrockClientResolvedConfig | config} for BedrockClient's `config` shape.
70+
*
71+
* @throws {@link AccessDeniedException} (client fault)
72+
* <p>The request is denied because of missing access permissions.</p>
73+
*
74+
* @throws {@link ConflictException} (client fault)
75+
* <p>Error occurred because of a conflict while performing an operation.</p>
76+
*
77+
* @throws {@link InternalServerException} (server fault)
78+
* <p>An internal server error occurred. Retry your request.</p>
79+
*
80+
* @throws {@link ResourceNotFoundException} (client fault)
81+
* <p>The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.</p>
82+
*
83+
* @throws {@link ServiceQuotaExceededException} (client fault)
84+
* <p>The number of requests exceeds the service quota. Resubmit your request later.</p>
85+
*
86+
* @throws {@link ThrottlingException} (client fault)
87+
* <p>The number of requests exceeds the limit. Resubmit your request later.</p>
88+
*
89+
* @throws {@link TooManyTagsException} (client fault)
90+
* <p>The request contains more tags than can be associated with a resource (50 tags per resource).
91+
* The maximum number of tags includes both existing tags and those included in your current request. </p>
92+
*
93+
* @throws {@link ValidationException} (client fault)
94+
* <p>Input validation failed. Check your request parameters and retry the request.</p>
95+
*
96+
* @throws {@link BedrockServiceException}
97+
* <p>Base exception class for all service exceptions from Bedrock service.</p>
98+
*
99+
* @public
100+
*/
101+
export class CreateInferenceProfileCommand extends $Command
102+
.classBuilder<
103+
CreateInferenceProfileCommandInput,
104+
CreateInferenceProfileCommandOutput,
105+
BedrockClientResolvedConfig,
106+
ServiceInputTypes,
107+
ServiceOutputTypes
108+
>()
109+
.ep(commonParams)
110+
.m(function (this: any, Command: any, cs: any, config: BedrockClientResolvedConfig, o: any) {
111+
return [
112+
getSerdePlugin(config, this.serialize, this.deserialize),
113+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
114+
];
115+
})
116+
.s("AmazonBedrockControlPlaneService", "CreateInferenceProfile", {})
117+
.n("BedrockClient", "CreateInferenceProfileCommand")
118+
.f(CreateInferenceProfileRequestFilterSensitiveLog, void 0)
119+
.ser(se_CreateInferenceProfileCommand)
120+
.de(de_CreateInferenceProfileCommand)
121+
.build() {
122+
/** @internal type navigation helper, not in runtime. */
123+
protected declare static __types: {
124+
api: {
125+
input: CreateInferenceProfileRequest;
126+
output: CreateInferenceProfileResponse;
127+
};
128+
sdk: {
129+
input: CreateInferenceProfileCommandInput;
130+
output: CreateInferenceProfileCommandOutput;
131+
};
132+
};
133+
}

0 commit comments

Comments
 (0)