Skip to content

Commit

Permalink
feat(client-bedrock): Tagging support for Async Invoke resources. Add…
Browse files Browse the repository at this point in the history
…ed support for Distillation in CreateModelCustomizationJob API. Support for videoDataDeliveryEnabled flag in invocation logging.
  • Loading branch information
awstools committed Dec 3, 2024
1 parent c1cceb3 commit 44b1172
Show file tree
Hide file tree
Showing 16 changed files with 938 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export interface CreateGuardrailCommandOutput extends CreateGuardrailResponse, _
* </ul>
* <p>In addition to the above policies, you can also configure the messages to be returned to
* the user if a user input or model response is in violation of the policies defined in the guardrail.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html">Guardrails for Amazon Bedrock</a> in
* <p>For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html">Amazon Bedrock Guardrails</a> in
* the <i>Amazon Bedrock User Guide</i>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { BedrockClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { CreateModelCustomizationJobRequest, CreateModelCustomizationJobResponse } from "../models/models_0";
import {
CreateModelCustomizationJobRequest,
CreateModelCustomizationJobRequestFilterSensitiveLog,
CreateModelCustomizationJobResponse,
} from "../models/models_0";
import {
de_CreateModelCustomizationJobCommand,
se_CreateModelCustomizationJobCommand,
Expand Down Expand Up @@ -54,7 +58,7 @@ export interface CreateModelCustomizationJobCommandOutput
* roleArn: "STRING_VALUE", // required
* clientRequestToken: "STRING_VALUE",
* baseModelIdentifier: "STRING_VALUE", // required
* customizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING",
* customizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING" || "DISTILLATION",
* customModelKmsKeyId: "STRING_VALUE",
* jobTags: [ // TagList
* { // Tag
Expand All @@ -69,7 +73,39 @@ export interface CreateModelCustomizationJobCommandOutput
* },
* ],
* trainingDataConfig: { // TrainingDataConfig
* s3Uri: "STRING_VALUE", // required
* s3Uri: "STRING_VALUE",
* invocationLogsConfig: { // InvocationLogsConfig
* usePromptResponse: true || false,
* invocationLogSource: { // InvocationLogSource Union: only one key present
* s3Uri: "STRING_VALUE",
* },
* requestMetadataFilters: { // RequestMetadataFilters Union: only one key present
* equals: { // RequestMetadataMap
* "<keys>": "STRING_VALUE",
* },
* notEquals: {
* "<keys>": "STRING_VALUE",
* },
* andAll: [ // RequestMetadataFiltersList
* { // RequestMetadataBaseFilters
* equals: {
* "<keys>": "STRING_VALUE",
* },
* notEquals: {
* "<keys>": "STRING_VALUE",
* },
* },
* ],
* orAll: [
* {
* equals: {
* "<keys>": "STRING_VALUE",
* },
* notEquals: "<RequestMetadataMap>",
* },
* ],
* },
* },
* },
* validationDataConfig: { // ValidationDataConfig
* validators: [ // Validators // required
Expand All @@ -81,7 +117,7 @@ export interface CreateModelCustomizationJobCommandOutput
* outputDataConfig: { // OutputDataConfig
* s3Uri: "STRING_VALUE", // required
* },
* hyperParameters: { // ModelCustomizationHyperParameters // required
* hyperParameters: { // ModelCustomizationHyperParameters
* "<keys>": "STRING_VALUE",
* },
* vpcConfig: { // VpcConfig
Expand All @@ -92,6 +128,14 @@ export interface CreateModelCustomizationJobCommandOutput
* "STRING_VALUE",
* ],
* },
* customizationConfig: { // CustomizationConfig Union: only one key present
* distillationConfig: { // DistillationConfig
* teacherModelConfig: { // TeacherModelConfig
* teacherModelIdentifier: "STRING_VALUE", // required
* maxResponseLengthForInference: Number("int"),
* },
* },
* },
* };
* const command = new CreateModelCustomizationJobCommand(input);
* const response = await client.send(command);
Expand Down Expand Up @@ -154,7 +198,7 @@ export class CreateModelCustomizationJobCommand extends $Command
})
.s("AmazonBedrockControlPlaneService", "CreateModelCustomizationJob", {})
.n("BedrockClient", "CreateModelCustomizationJobCommand")
.f(void 0, void 0)
.f(CreateModelCustomizationJobRequestFilterSensitiveLog, void 0)
.ser(se_CreateModelCustomizationJobCommand)
.de(de_CreateModelCustomizationJobCommand)
.build() {
Expand Down
52 changes: 48 additions & 4 deletions clients/client-bedrock/src/commands/GetCustomModelCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { BedrockClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { GetCustomModelRequest, GetCustomModelResponse } from "../models/models_0";
import {
GetCustomModelRequest,
GetCustomModelResponse,
GetCustomModelResponseFilterSensitiveLog,
} from "../models/models_0";
import { de_GetCustomModelCommand, se_GetCustomModelCommand } from "../protocols/Aws_restJson1";

/**
Expand Down Expand Up @@ -46,13 +50,45 @@ export interface GetCustomModelCommandOutput extends GetCustomModelResponse, __M
* // jobName: "STRING_VALUE",
* // jobArn: "STRING_VALUE", // required
* // baseModelArn: "STRING_VALUE", // required
* // customizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING",
* // customizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING" || "DISTILLATION",
* // modelKmsKeyArn: "STRING_VALUE",
* // hyperParameters: { // ModelCustomizationHyperParameters
* // "<keys>": "STRING_VALUE",
* // },
* // trainingDataConfig: { // TrainingDataConfig
* // s3Uri: "STRING_VALUE", // required
* // s3Uri: "STRING_VALUE",
* // invocationLogsConfig: { // InvocationLogsConfig
* // usePromptResponse: true || false,
* // invocationLogSource: { // InvocationLogSource Union: only one key present
* // s3Uri: "STRING_VALUE",
* // },
* // requestMetadataFilters: { // RequestMetadataFilters Union: only one key present
* // equals: { // RequestMetadataMap
* // "<keys>": "STRING_VALUE",
* // },
* // notEquals: {
* // "<keys>": "STRING_VALUE",
* // },
* // andAll: [ // RequestMetadataFiltersList
* // { // RequestMetadataBaseFilters
* // equals: {
* // "<keys>": "STRING_VALUE",
* // },
* // notEquals: {
* // "<keys>": "STRING_VALUE",
* // },
* // },
* // ],
* // orAll: [
* // {
* // equals: {
* // "<keys>": "STRING_VALUE",
* // },
* // notEquals: "<RequestMetadataMap>",
* // },
* // ],
* // },
* // },
* // },
* // validationDataConfig: { // ValidationDataConfig
* // validators: [ // Validators // required
Expand All @@ -73,6 +109,14 @@ export interface GetCustomModelCommandOutput extends GetCustomModelResponse, __M
* // },
* // ],
* // creationTime: new Date("TIMESTAMP"), // required
* // customizationConfig: { // CustomizationConfig Union: only one key present
* // distillationConfig: { // DistillationConfig
* // teacherModelConfig: { // TeacherModelConfig
* // teacherModelIdentifier: "STRING_VALUE", // required
* // maxResponseLengthForInference: Number("int"),
* // },
* // },
* // },
* // };
*
* ```
Expand Down Expand Up @@ -120,7 +164,7 @@ export class GetCustomModelCommand extends $Command
})
.s("AmazonBedrockControlPlaneService", "GetCustomModel", {})
.n("BedrockClient", "GetCustomModelCommand")
.f(void 0, void 0)
.f(void 0, GetCustomModelResponseFilterSensitiveLog)
.ser(se_GetCustomModelCommand)
.de(de_GetCustomModelCommand)
.build() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface GetFoundationModelCommandOutput extends GetFoundationModelRespo
* // ],
* // responseStreamingSupported: true || false,
* // customizationsSupported: [ // ModelCustomizationList
* // "FINE_TUNING" || "CONTINUED_PRE_TRAINING",
* // "FINE_TUNING" || "CONTINUED_PRE_TRAINING" || "DISTILLATION",
* // ],
* // inferenceTypesSupported: [ // InferenceTypeList
* // "ON_DEMAND" || "PROVISIONED",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { BedrockClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { GetModelCustomizationJobRequest, GetModelCustomizationJobResponse } from "../models/models_0";
import {
GetModelCustomizationJobRequest,
GetModelCustomizationJobResponse,
GetModelCustomizationJobResponseFilterSensitiveLog,
} from "../models/models_0";
import { de_GetModelCustomizationJobCommand, se_GetModelCustomizationJobCommand } from "../protocols/Aws_restJson1";

/**
Expand Down Expand Up @@ -54,11 +58,43 @@ export interface GetModelCustomizationJobCommandOutput extends GetModelCustomiza
* // lastModifiedTime: new Date("TIMESTAMP"),
* // endTime: new Date("TIMESTAMP"),
* // baseModelArn: "STRING_VALUE", // required
* // hyperParameters: { // ModelCustomizationHyperParameters // required
* // hyperParameters: { // ModelCustomizationHyperParameters
* // "<keys>": "STRING_VALUE",
* // },
* // trainingDataConfig: { // TrainingDataConfig
* // s3Uri: "STRING_VALUE", // required
* // s3Uri: "STRING_VALUE",
* // invocationLogsConfig: { // InvocationLogsConfig
* // usePromptResponse: true || false,
* // invocationLogSource: { // InvocationLogSource Union: only one key present
* // s3Uri: "STRING_VALUE",
* // },
* // requestMetadataFilters: { // RequestMetadataFilters Union: only one key present
* // equals: { // RequestMetadataMap
* // "<keys>": "STRING_VALUE",
* // },
* // notEquals: {
* // "<keys>": "STRING_VALUE",
* // },
* // andAll: [ // RequestMetadataFiltersList
* // { // RequestMetadataBaseFilters
* // equals: {
* // "<keys>": "STRING_VALUE",
* // },
* // notEquals: {
* // "<keys>": "STRING_VALUE",
* // },
* // },
* // ],
* // orAll: [
* // {
* // equals: {
* // "<keys>": "STRING_VALUE",
* // },
* // notEquals: "<RequestMetadataMap>",
* // },
* // ],
* // },
* // },
* // },
* // validationDataConfig: { // ValidationDataConfig
* // validators: [ // Validators // required
Expand All @@ -70,7 +106,7 @@ export interface GetModelCustomizationJobCommandOutput extends GetModelCustomiza
* // outputDataConfig: { // OutputDataConfig
* // s3Uri: "STRING_VALUE", // required
* // },
* // customizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING",
* // customizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING" || "DISTILLATION",
* // outputModelKmsKeyArn: "STRING_VALUE",
* // trainingMetrics: { // TrainingMetrics
* // trainingLoss: Number("float"),
Expand All @@ -88,6 +124,14 @@ export interface GetModelCustomizationJobCommandOutput extends GetModelCustomiza
* // "STRING_VALUE",
* // ],
* // },
* // customizationConfig: { // CustomizationConfig Union: only one key present
* // distillationConfig: { // DistillationConfig
* // teacherModelConfig: { // TeacherModelConfig
* // teacherModelIdentifier: "STRING_VALUE", // required
* // maxResponseLengthForInference: Number("int"),
* // },
* // },
* // },
* // };
*
* ```
Expand Down Expand Up @@ -135,7 +179,7 @@ export class GetModelCustomizationJobCommand extends $Command
})
.s("AmazonBedrockControlPlaneService", "GetModelCustomizationJob", {})
.n("BedrockClient", "GetModelCustomizationJobCommand")
.f(void 0, void 0)
.f(void 0, GetModelCustomizationJobResponseFilterSensitiveLog)
.ser(se_GetModelCustomizationJobCommand)
.de(de_GetModelCustomizationJobCommand)
.build() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface GetModelInvocationJobCommandInput extends GetModelInvocationJob
export interface GetModelInvocationJobCommandOutput extends GetModelInvocationJobResponse, __MetadataBearer {}

/**
* <p>Gets details about a batch inference job. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-manage.html#batch-inference-view">View details about a batch inference job</a>
* <p>Gets details about a batch inference job. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-monitor">Monitor batch inference jobs</a>
* </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export interface GetModelInvocationLoggingConfigurationCommandOutput
* // textDataDeliveryEnabled: true || false,
* // imageDataDeliveryEnabled: true || false,
* // embeddingDataDeliveryEnabled: true || false,
* // videoDataDeliveryEnabled: true || false,
* // },
* // };
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export interface ListCustomModelsCommandOutput extends ListCustomModelsResponse,
* // creationTime: new Date("TIMESTAMP"), // required
* // baseModelArn: "STRING_VALUE", // required
* // baseModelName: "STRING_VALUE", // required
* // customizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING",
* // customizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING" || "DISTILLATION",
* // ownerAccountId: "STRING_VALUE",
* // },
* // ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface ListFoundationModelsCommandOutput extends ListFoundationModelsR
* const client = new BedrockClient(config);
* const input = { // ListFoundationModelsRequest
* byProvider: "STRING_VALUE",
* byCustomizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING",
* byCustomizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING" || "DISTILLATION",
* byOutputModality: "TEXT" || "IMAGE" || "EMBEDDING",
* byInferenceType: "ON_DEMAND" || "PROVISIONED",
* };
Expand All @@ -58,7 +58,7 @@ export interface ListFoundationModelsCommandOutput extends ListFoundationModelsR
* // ],
* // responseStreamingSupported: true || false,
* // customizationsSupported: [ // ModelCustomizationList
* // "FINE_TUNING" || "CONTINUED_PRE_TRAINING",
* // "FINE_TUNING" || "CONTINUED_PRE_TRAINING" || "DISTILLATION",
* // ],
* // inferenceTypesSupported: [ // InferenceTypeList
* // "ON_DEMAND" || "PROVISIONED",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export interface ListModelCustomizationJobsCommandOutput extends ListModelCustom
* // endTime: new Date("TIMESTAMP"),
* // customModelArn: "STRING_VALUE",
* // customModelName: "STRING_VALUE",
* // customizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING",
* // customizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING" || "DISTILLATION",
* // },
* // ],
* // };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface ListModelInvocationJobsCommandInput extends ListModelInvocation
export interface ListModelInvocationJobsCommandOutput extends ListModelInvocationJobsResponse, __MetadataBearer {}

/**
* <p>Lists all batch inference jobs in the account. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-manage.html#batch-inference-view">View details about a batch inference job</a>.</p>
* <p>Lists all batch inference jobs in the account. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-view.html">View details about a batch inference job</a>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export interface PutModelInvocationLoggingConfigurationCommandOutput
* textDataDeliveryEnabled: true || false,
* imageDataDeliveryEnabled: true || false,
* embeddingDataDeliveryEnabled: true || false,
* videoDataDeliveryEnabled: true || false,
* },
* };
* const command = new PutModelInvocationLoggingConfigurationCommand(input);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface StopModelInvocationJobCommandInput extends StopModelInvocationJ
export interface StopModelInvocationJobCommandOutput extends StopModelInvocationJobResponse, __MetadataBearer {}

/**
* <p>Stops a batch inference job. You're only charged for tokens that were already processed. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-manage.html#batch-inference-stop">Stop a batch inference job</a>.</p>
* <p>Stops a batch inference job. You're only charged for tokens that were already processed. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-stop.html">Stop a batch inference job</a>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Loading

0 comments on commit 44b1172

Please sign in to comment.