Skip to content

Commit d49f2f3

Browse files
author
awstools
committed
feat(client-bedrock): Amazon Bedrock SDK updates for Inference Profile.
1 parent b752120 commit d49f2f3

File tree

12 files changed

+10581
-9540
lines changed

12 files changed

+10581
-9540
lines changed

clients/client-bedrock/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,14 @@ GetImportedModel
354354

355355
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock/command/GetImportedModelCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock/Interface/GetImportedModelCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock/Interface/GetImportedModelCommandOutput/)
356356

357+
</details>
358+
<details>
359+
<summary>
360+
GetInferenceProfile
361+
</summary>
362+
363+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock/command/GetInferenceProfileCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock/Interface/GetInferenceProfileCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock/Interface/GetInferenceProfileCommandOutput/)
364+
357365
</details>
358366
<details>
359367
<summary>
@@ -442,6 +450,14 @@ ListImportedModels
442450

443451
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock/command/ListImportedModelsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock/Interface/ListImportedModelsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock/Interface/ListImportedModelsCommandOutput/)
444452

453+
</details>
454+
<details>
455+
<summary>
456+
ListInferenceProfiles
457+
</summary>
458+
459+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock/command/ListInferenceProfilesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock/Interface/ListInferenceProfilesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock/Interface/ListInferenceProfilesCommandOutput/)
460+
445461
</details>
446462
<details>
447463
<summary>

clients/client-bedrock/src/Bedrock.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ import {
9898
GetImportedModelCommandInput,
9999
GetImportedModelCommandOutput,
100100
} from "./commands/GetImportedModelCommand";
101+
import {
102+
GetInferenceProfileCommand,
103+
GetInferenceProfileCommandInput,
104+
GetInferenceProfileCommandOutput,
105+
} from "./commands/GetInferenceProfileCommand";
101106
import {
102107
GetModelCopyJobCommand,
103108
GetModelCopyJobCommandInput,
@@ -153,6 +158,11 @@ import {
153158
ListImportedModelsCommandInput,
154159
ListImportedModelsCommandOutput,
155160
} from "./commands/ListImportedModelsCommand";
161+
import {
162+
ListInferenceProfilesCommand,
163+
ListInferenceProfilesCommandInput,
164+
ListInferenceProfilesCommandOutput,
165+
} from "./commands/ListInferenceProfilesCommand";
156166
import {
157167
ListModelCopyJobsCommand,
158168
ListModelCopyJobsCommandInput,
@@ -240,6 +250,7 @@ const commands = {
240250
GetFoundationModelCommand,
241251
GetGuardrailCommand,
242252
GetImportedModelCommand,
253+
GetInferenceProfileCommand,
243254
GetModelCopyJobCommand,
244255
GetModelCustomizationJobCommand,
245256
GetModelImportJobCommand,
@@ -251,6 +262,7 @@ const commands = {
251262
ListFoundationModelsCommand,
252263
ListGuardrailsCommand,
253264
ListImportedModelsCommand,
265+
ListInferenceProfilesCommand,
254266
ListModelCopyJobsCommand,
255267
ListModelCustomizationJobsCommand,
256268
ListModelImportJobsCommand,
@@ -577,6 +589,23 @@ export interface Bedrock {
577589
cb: (err: any, data?: GetImportedModelCommandOutput) => void
578590
): void;
579591

592+
/**
593+
* @see {@link GetInferenceProfileCommand}
594+
*/
595+
getInferenceProfile(
596+
args: GetInferenceProfileCommandInput,
597+
options?: __HttpHandlerOptions
598+
): Promise<GetInferenceProfileCommandOutput>;
599+
getInferenceProfile(
600+
args: GetInferenceProfileCommandInput,
601+
cb: (err: any, data?: GetInferenceProfileCommandOutput) => void
602+
): void;
603+
getInferenceProfile(
604+
args: GetInferenceProfileCommandInput,
605+
options: __HttpHandlerOptions,
606+
cb: (err: any, data?: GetInferenceProfileCommandOutput) => void
607+
): void;
608+
580609
/**
581610
* @see {@link GetModelCopyJobCommand}
582611
*/
@@ -764,6 +793,24 @@ export interface Bedrock {
764793
cb: (err: any, data?: ListImportedModelsCommandOutput) => void
765794
): void;
766795

796+
/**
797+
* @see {@link ListInferenceProfilesCommand}
798+
*/
799+
listInferenceProfiles(): Promise<ListInferenceProfilesCommandOutput>;
800+
listInferenceProfiles(
801+
args: ListInferenceProfilesCommandInput,
802+
options?: __HttpHandlerOptions
803+
): Promise<ListInferenceProfilesCommandOutput>;
804+
listInferenceProfiles(
805+
args: ListInferenceProfilesCommandInput,
806+
cb: (err: any, data?: ListInferenceProfilesCommandOutput) => void
807+
): void;
808+
listInferenceProfiles(
809+
args: ListInferenceProfilesCommandInput,
810+
options: __HttpHandlerOptions,
811+
cb: (err: any, data?: ListInferenceProfilesCommandOutput) => void
812+
): void;
813+
767814
/**
768815
* @see {@link ListModelCopyJobsCommand}
769816
*/

clients/client-bedrock/src/BedrockClient.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ import { GetEvaluationJobCommandInput, GetEvaluationJobCommandOutput } from "./c
102102
import { GetFoundationModelCommandInput, GetFoundationModelCommandOutput } from "./commands/GetFoundationModelCommand";
103103
import { GetGuardrailCommandInput, GetGuardrailCommandOutput } from "./commands/GetGuardrailCommand";
104104
import { GetImportedModelCommandInput, GetImportedModelCommandOutput } from "./commands/GetImportedModelCommand";
105+
import {
106+
GetInferenceProfileCommandInput,
107+
GetInferenceProfileCommandOutput,
108+
} from "./commands/GetInferenceProfileCommand";
105109
import { GetModelCopyJobCommandInput, GetModelCopyJobCommandOutput } from "./commands/GetModelCopyJobCommand";
106110
import {
107111
GetModelCustomizationJobCommandInput,
@@ -128,6 +132,10 @@ import {
128132
} from "./commands/ListFoundationModelsCommand";
129133
import { ListGuardrailsCommandInput, ListGuardrailsCommandOutput } from "./commands/ListGuardrailsCommand";
130134
import { ListImportedModelsCommandInput, ListImportedModelsCommandOutput } from "./commands/ListImportedModelsCommand";
135+
import {
136+
ListInferenceProfilesCommandInput,
137+
ListInferenceProfilesCommandOutput,
138+
} from "./commands/ListInferenceProfilesCommand";
131139
import { ListModelCopyJobsCommandInput, ListModelCopyJobsCommandOutput } from "./commands/ListModelCopyJobsCommand";
132140
import {
133141
ListModelCustomizationJobsCommandInput,
@@ -203,6 +211,7 @@ export type ServiceInputTypes =
203211
| GetFoundationModelCommandInput
204212
| GetGuardrailCommandInput
205213
| GetImportedModelCommandInput
214+
| GetInferenceProfileCommandInput
206215
| GetModelCopyJobCommandInput
207216
| GetModelCustomizationJobCommandInput
208217
| GetModelImportJobCommandInput
@@ -214,6 +223,7 @@ export type ServiceInputTypes =
214223
| ListFoundationModelsCommandInput
215224
| ListGuardrailsCommandInput
216225
| ListImportedModelsCommandInput
226+
| ListInferenceProfilesCommandInput
217227
| ListModelCopyJobsCommandInput
218228
| ListModelCustomizationJobsCommandInput
219229
| ListModelImportJobsCommandInput
@@ -252,6 +262,7 @@ export type ServiceOutputTypes =
252262
| GetFoundationModelCommandOutput
253263
| GetGuardrailCommandOutput
254264
| GetImportedModelCommandOutput
265+
| GetInferenceProfileCommandOutput
255266
| GetModelCopyJobCommandOutput
256267
| GetModelCustomizationJobCommandOutput
257268
| GetModelImportJobCommandOutput
@@ -263,6 +274,7 @@ export type ServiceOutputTypes =
263274
| ListFoundationModelsCommandOutput
264275
| ListGuardrailsCommandOutput
265276
| ListImportedModelsCommandOutput
277+
| ListInferenceProfilesCommandOutput
266278
| ListModelCopyJobsCommandOutput
267279
| ListModelCustomizationJobsCommandOutput
268280
| ListModelImportJobsCommandOutput

clients/client-bedrock/src/commands/CreateModelInvocationJobCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export interface CreateModelInvocationJobCommandInput extends CreateModelInvocat
2828
export interface CreateModelInvocationJobCommandOutput extends CreateModelInvocationJobResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Creates a job to invoke a model on multiple prompts (batch inference). Format your data according to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-prerq.html#batch-inference-data">Format your inference data</a> and upload it to an Amazon S3 bucket. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-create.html">Create a batch inference job</a>.</p>
32-
* <p>The response returns a <code>jobArn</code> that you can use to stop or get details about the job. You can check the status of the job by sending a <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetModelCustomizationJob.html">GetModelCustomizationJob</a> request.</p>
31+
* <p>Creates a batch inference job to invoke a model on multiple prompts. Format your data according to <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-data">Format your inference data</a> and upload it to an Amazon S3 bucket. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference.html">Process multiple prompts with batch inference</a>.</p>
32+
* <p>The response returns a <code>jobArn</code> that you can use to stop or get details about the job.</p>
3333
* @example
3434
* Use a bare-bones client and the command you need to make an API call.
3535
* ```javascript
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
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 { GetInferenceProfileRequest, GetInferenceProfileResponse } from "../models/models_0";
10+
import { de_GetInferenceProfileCommand, se_GetInferenceProfileCommand } from "../protocols/Aws_restJson1";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link GetInferenceProfileCommand}.
21+
*/
22+
export interface GetInferenceProfileCommandInput extends GetInferenceProfileRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link GetInferenceProfileCommand}.
27+
*/
28+
export interface GetInferenceProfileCommandOutput extends GetInferenceProfileResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Gets information about an inference profile. For more information, see the Amazon Bedrock User Guide.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { BedrockClient, GetInferenceProfileCommand } from "@aws-sdk/client-bedrock"; // ES Modules import
36+
* // const { BedrockClient, GetInferenceProfileCommand } = require("@aws-sdk/client-bedrock"); // CommonJS import
37+
* const client = new BedrockClient(config);
38+
* const input = { // GetInferenceProfileRequest
39+
* inferenceProfileIdentifier: "STRING_VALUE", // required
40+
* };
41+
* const command = new GetInferenceProfileCommand(input);
42+
* const response = await client.send(command);
43+
* // { // GetInferenceProfileResponse
44+
* // inferenceProfileName: "STRING_VALUE", // required
45+
* // models: [ // InferenceProfileModels // required
46+
* // { // InferenceProfileModel
47+
* // modelArn: "STRING_VALUE",
48+
* // },
49+
* // ],
50+
* // description: "STRING_VALUE",
51+
* // createdAt: new Date("TIMESTAMP"),
52+
* // updatedAt: new Date("TIMESTAMP"),
53+
* // inferenceProfileArn: "STRING_VALUE", // required
54+
* // inferenceProfileId: "STRING_VALUE", // required
55+
* // status: "ACTIVE", // required
56+
* // type: "SYSTEM_DEFINED", // required
57+
* // };
58+
*
59+
* ```
60+
*
61+
* @param GetInferenceProfileCommandInput - {@link GetInferenceProfileCommandInput}
62+
* @returns {@link GetInferenceProfileCommandOutput}
63+
* @see {@link GetInferenceProfileCommandInput} for command's `input` shape.
64+
* @see {@link GetInferenceProfileCommandOutput} for command's `response` shape.
65+
* @see {@link BedrockClientResolvedConfig | config} for BedrockClient's `config` shape.
66+
*
67+
* @throws {@link AccessDeniedException} (client fault)
68+
* <p>The request is denied because of missing access permissions.</p>
69+
*
70+
* @throws {@link InternalServerException} (server fault)
71+
* <p>An internal server error occurred. Retry your request.</p>
72+
*
73+
* @throws {@link ResourceNotFoundException} (client fault)
74+
* <p>The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.</p>
75+
*
76+
* @throws {@link ThrottlingException} (client fault)
77+
* <p>The number of requests exceeds the limit. Resubmit your request later.</p>
78+
*
79+
* @throws {@link ValidationException} (client fault)
80+
* <p>Input validation failed. Check your request parameters and retry the request.</p>
81+
*
82+
* @throws {@link BedrockServiceException}
83+
* <p>Base exception class for all service exceptions from Bedrock service.</p>
84+
*
85+
* @public
86+
*/
87+
export class GetInferenceProfileCommand extends $Command
88+
.classBuilder<
89+
GetInferenceProfileCommandInput,
90+
GetInferenceProfileCommandOutput,
91+
BedrockClientResolvedConfig,
92+
ServiceInputTypes,
93+
ServiceOutputTypes
94+
>()
95+
.ep({
96+
...commonParams,
97+
})
98+
.m(function (this: any, Command: any, cs: any, config: BedrockClientResolvedConfig, o: any) {
99+
return [
100+
getSerdePlugin(config, this.serialize, this.deserialize),
101+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
102+
];
103+
})
104+
.s("AmazonBedrockControlPlaneService", "GetInferenceProfile", {})
105+
.n("BedrockClient", "GetInferenceProfileCommand")
106+
.f(void 0, void 0)
107+
.ser(se_GetInferenceProfileCommand)
108+
.de(de_GetInferenceProfileCommand)
109+
.build() {}

0 commit comments

Comments
 (0)