From 4d9c7a12e3b68a83156aa7dd063183cae1c11ed2 Mon Sep 17 00:00:00 2001 From: awstools Date: Tue, 30 Jul 2024 18:19:27 +0000 Subject: [PATCH] feat(client-lex-models-v2): This release adds new capabilities to the AMAZON.QnAIntent: Custom prompting, Guardrails integration and ExactResponse support for Bedrock Knowledge Base. --- .../src/commands/CreateBotLocaleCommand.ts | 36 +++ .../src/commands/CreateIntentCommand.ts | 20 ++ .../CreateResourcePolicyStatementCommand.ts | 2 + .../DeleteResourcePolicyStatementCommand.ts | 2 + .../src/commands/DescribeBotLocaleCommand.ts | 21 +- .../DescribeBotRecommendationCommand.ts | 2 +- .../src/commands/DescribeIntentCommand.ts | 10 + .../src/commands/UpdateBotLocaleCommand.ts | 36 +++ .../src/commands/UpdateIntentCommand.ts | 20 ++ .../src/models/models_0.ts | 264 +++++------------- .../src/models/models_1.ts | 191 ++++++++++++- .../src/protocols/Aws_restJson1.ts | 12 +- .../sdk-codegen/aws-models/lex-models-v2.json | 115 +++++++- 13 files changed, 534 insertions(+), 197 deletions(-) diff --git a/clients/client-lex-models-v2/src/commands/CreateBotLocaleCommand.ts b/clients/client-lex-models-v2/src/commands/CreateBotLocaleCommand.ts index 23b96999382ff..9f263062de66e 100644 --- a/clients/client-lex-models-v2/src/commands/CreateBotLocaleCommand.ts +++ b/clients/client-lex-models-v2/src/commands/CreateBotLocaleCommand.ts @@ -54,6 +54,12 @@ export interface CreateBotLocaleCommandOutput extends CreateBotLocaleResponse, _ * enabled: true || false, // required * bedrockModelSpecification: { // BedrockModelSpecification * modelArn: "STRING_VALUE", // required + * guardrail: { // BedrockGuardrailConfiguration + * identifier: "STRING_VALUE", // required + * version: "STRING_VALUE", // required + * }, + * traceStatus: "ENABLED" || "DISABLED", + * customPrompt: "STRING_VALUE", * }, * }, * }, @@ -62,12 +68,24 @@ export interface CreateBotLocaleCommandOutput extends CreateBotLocaleResponse, _ * enabled: true || false, // required * bedrockModelSpecification: { * modelArn: "STRING_VALUE", // required + * guardrail: { + * identifier: "STRING_VALUE", // required + * version: "STRING_VALUE", // required + * }, + * traceStatus: "ENABLED" || "DISABLED", + * customPrompt: "STRING_VALUE", * }, * }, * sampleUtteranceGeneration: { // SampleUtteranceGenerationSpecification * enabled: true || false, // required * bedrockModelSpecification: { * modelArn: "STRING_VALUE", // required + * guardrail: { + * identifier: "STRING_VALUE", // required + * version: "STRING_VALUE", // required + * }, + * traceStatus: "ENABLED" || "DISABLED", + * customPrompt: "STRING_VALUE", * }, * }, * }, @@ -94,6 +112,12 @@ export interface CreateBotLocaleCommandOutput extends CreateBotLocaleResponse, _ * // enabled: true || false, // required * // bedrockModelSpecification: { // BedrockModelSpecification * // modelArn: "STRING_VALUE", // required + * // guardrail: { // BedrockGuardrailConfiguration + * // identifier: "STRING_VALUE", // required + * // version: "STRING_VALUE", // required + * // }, + * // traceStatus: "ENABLED" || "DISABLED", + * // customPrompt: "STRING_VALUE", * // }, * // }, * // }, @@ -102,12 +126,24 @@ export interface CreateBotLocaleCommandOutput extends CreateBotLocaleResponse, _ * // enabled: true || false, // required * // bedrockModelSpecification: { * // modelArn: "STRING_VALUE", // required + * // guardrail: { + * // identifier: "STRING_VALUE", // required + * // version: "STRING_VALUE", // required + * // }, + * // traceStatus: "ENABLED" || "DISABLED", + * // customPrompt: "STRING_VALUE", * // }, * // }, * // sampleUtteranceGeneration: { // SampleUtteranceGenerationSpecification * // enabled: true || false, // required * // bedrockModelSpecification: { * // modelArn: "STRING_VALUE", // required + * // guardrail: { + * // identifier: "STRING_VALUE", // required + * // version: "STRING_VALUE", // required + * // }, + * // traceStatus: "ENABLED" || "DISABLED", + * // customPrompt: "STRING_VALUE", * // }, * // }, * // }, diff --git a/clients/client-lex-models-v2/src/commands/CreateIntentCommand.ts b/clients/client-lex-models-v2/src/commands/CreateIntentCommand.ts index 85d65047f3e11..bc664360aab15 100644 --- a/clients/client-lex-models-v2/src/commands/CreateIntentCommand.ts +++ b/clients/client-lex-models-v2/src/commands/CreateIntentCommand.ts @@ -523,10 +523,20 @@ export interface CreateIntentCommandOutput extends CreateIntentResponse, __Metad * }, * bedrockKnowledgeStoreConfiguration: { // BedrockKnowledgeStoreConfiguration * bedrockKnowledgeBaseArn: "STRING_VALUE", // required + * exactResponse: true || false, + * exactResponseFields: { // BedrockKnowledgeStoreExactResponseFields + * answerField: "STRING_VALUE", + * }, * }, * }, * bedrockModelConfiguration: { // BedrockModelSpecification * modelArn: "STRING_VALUE", // required + * guardrail: { // BedrockGuardrailConfiguration + * identifier: "STRING_VALUE", // required + * version: "STRING_VALUE", // required + * }, + * traceStatus: "ENABLED" || "DISABLED", + * customPrompt: "STRING_VALUE", * }, * }, * }; @@ -985,10 +995,20 @@ export interface CreateIntentCommandOutput extends CreateIntentResponse, __Metad * // }, * // bedrockKnowledgeStoreConfiguration: { // BedrockKnowledgeStoreConfiguration * // bedrockKnowledgeBaseArn: "STRING_VALUE", // required + * // exactResponse: true || false, + * // exactResponseFields: { // BedrockKnowledgeStoreExactResponseFields + * // answerField: "STRING_VALUE", + * // }, * // }, * // }, * // bedrockModelConfiguration: { // BedrockModelSpecification * // modelArn: "STRING_VALUE", // required + * // guardrail: { // BedrockGuardrailConfiguration + * // identifier: "STRING_VALUE", // required + * // version: "STRING_VALUE", // required + * // }, + * // traceStatus: "ENABLED" || "DISABLED", + * // customPrompt: "STRING_VALUE", * // }, * // }, * // }; diff --git a/clients/client-lex-models-v2/src/commands/CreateResourcePolicyStatementCommand.ts b/clients/client-lex-models-v2/src/commands/CreateResourcePolicyStatementCommand.ts index c73e2ef0fc5ef..113865837833d 100644 --- a/clients/client-lex-models-v2/src/commands/CreateResourcePolicyStatementCommand.ts +++ b/clients/client-lex-models-v2/src/commands/CreateResourcePolicyStatementCommand.ts @@ -38,6 +38,8 @@ export interface CreateResourcePolicyStatementCommandOutput * policy. If a policy doesn't exist, a new policy is created.

*

You can't create a resource policy statement that allows * cross-account access.

+ *

You need to add the CreateResourcePolicy or UpdateResourcePolicy + * action to the bot role in order to call the API.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript diff --git a/clients/client-lex-models-v2/src/commands/DeleteResourcePolicyStatementCommand.ts b/clients/client-lex-models-v2/src/commands/DeleteResourcePolicyStatementCommand.ts index 15f5825331146..927e7408cbd57 100644 --- a/clients/client-lex-models-v2/src/commands/DeleteResourcePolicyStatementCommand.ts +++ b/clients/client-lex-models-v2/src/commands/DeleteResourcePolicyStatementCommand.ts @@ -38,6 +38,8 @@ export interface DeleteResourcePolicyStatementCommandOutput * statement ID that doesn't exist in the policy, or if the bot or bot * alias doesn't have a policy attached, Amazon Lex returns an * exception.

+ *

You need to add the DeleteResourcePolicy or UpdateResourcePolicy + * action to the bot role in order to call the API.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript diff --git a/clients/client-lex-models-v2/src/commands/DescribeBotLocaleCommand.ts b/clients/client-lex-models-v2/src/commands/DescribeBotLocaleCommand.ts index 02ccd3942e65a..652284dc1fcba 100644 --- a/clients/client-lex-models-v2/src/commands/DescribeBotLocaleCommand.ts +++ b/clients/client-lex-models-v2/src/commands/DescribeBotLocaleCommand.ts @@ -6,7 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import { LexModelsV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../LexModelsV2Client"; -import { DescribeBotLocaleRequest, DescribeBotLocaleResponse } from "../models/models_0"; +import { DescribeBotLocaleRequest } from "../models/models_0"; +import { DescribeBotLocaleResponse } from "../models/models_1"; import { de_DescribeBotLocaleCommand, se_DescribeBotLocaleCommand } from "../protocols/Aws_restJson1"; /** @@ -77,6 +78,12 @@ export interface DescribeBotLocaleCommandOutput extends DescribeBotLocaleRespons * // enabled: true || false, // required * // bedrockModelSpecification: { // BedrockModelSpecification * // modelArn: "STRING_VALUE", // required + * // guardrail: { // BedrockGuardrailConfiguration + * // identifier: "STRING_VALUE", // required + * // version: "STRING_VALUE", // required + * // }, + * // traceStatus: "ENABLED" || "DISABLED", + * // customPrompt: "STRING_VALUE", * // }, * // }, * // }, @@ -85,12 +92,24 @@ export interface DescribeBotLocaleCommandOutput extends DescribeBotLocaleRespons * // enabled: true || false, // required * // bedrockModelSpecification: { * // modelArn: "STRING_VALUE", // required + * // guardrail: { + * // identifier: "STRING_VALUE", // required + * // version: "STRING_VALUE", // required + * // }, + * // traceStatus: "ENABLED" || "DISABLED", + * // customPrompt: "STRING_VALUE", * // }, * // }, * // sampleUtteranceGeneration: { // SampleUtteranceGenerationSpecification * // enabled: true || false, // required * // bedrockModelSpecification: { * // modelArn: "STRING_VALUE", // required + * // guardrail: { + * // identifier: "STRING_VALUE", // required + * // version: "STRING_VALUE", // required + * // }, + * // traceStatus: "ENABLED" || "DISABLED", + * // customPrompt: "STRING_VALUE", * // }, * // }, * // }, diff --git a/clients/client-lex-models-v2/src/commands/DescribeBotRecommendationCommand.ts b/clients/client-lex-models-v2/src/commands/DescribeBotRecommendationCommand.ts index 71aa347c9843b..eb92a5ad2d60e 100644 --- a/clients/client-lex-models-v2/src/commands/DescribeBotRecommendationCommand.ts +++ b/clients/client-lex-models-v2/src/commands/DescribeBotRecommendationCommand.ts @@ -6,8 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import { LexModelsV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../LexModelsV2Client"; -import { DescribeBotRecommendationRequest } from "../models/models_0"; import { + DescribeBotRecommendationRequest, DescribeBotRecommendationResponse, DescribeBotRecommendationResponseFilterSensitiveLog, } from "../models/models_1"; diff --git a/clients/client-lex-models-v2/src/commands/DescribeIntentCommand.ts b/clients/client-lex-models-v2/src/commands/DescribeIntentCommand.ts index 8c7b662016b4a..f4f5ba37993b6 100644 --- a/clients/client-lex-models-v2/src/commands/DescribeIntentCommand.ts +++ b/clients/client-lex-models-v2/src/commands/DescribeIntentCommand.ts @@ -503,10 +503,20 @@ export interface DescribeIntentCommandOutput extends DescribeIntentResponse, __M * // }, * // bedrockKnowledgeStoreConfiguration: { // BedrockKnowledgeStoreConfiguration * // bedrockKnowledgeBaseArn: "STRING_VALUE", // required + * // exactResponse: true || false, + * // exactResponseFields: { // BedrockKnowledgeStoreExactResponseFields + * // answerField: "STRING_VALUE", + * // }, * // }, * // }, * // bedrockModelConfiguration: { // BedrockModelSpecification * // modelArn: "STRING_VALUE", // required + * // guardrail: { // BedrockGuardrailConfiguration + * // identifier: "STRING_VALUE", // required + * // version: "STRING_VALUE", // required + * // }, + * // traceStatus: "ENABLED" || "DISABLED", + * // customPrompt: "STRING_VALUE", * // }, * // }, * // }; diff --git a/clients/client-lex-models-v2/src/commands/UpdateBotLocaleCommand.ts b/clients/client-lex-models-v2/src/commands/UpdateBotLocaleCommand.ts index 5777e11fdf091..ba946ea5657b0 100644 --- a/clients/client-lex-models-v2/src/commands/UpdateBotLocaleCommand.ts +++ b/clients/client-lex-models-v2/src/commands/UpdateBotLocaleCommand.ts @@ -51,6 +51,12 @@ export interface UpdateBotLocaleCommandOutput extends UpdateBotLocaleResponse, _ * enabled: true || false, // required * bedrockModelSpecification: { // BedrockModelSpecification * modelArn: "STRING_VALUE", // required + * guardrail: { // BedrockGuardrailConfiguration + * identifier: "STRING_VALUE", // required + * version: "STRING_VALUE", // required + * }, + * traceStatus: "ENABLED" || "DISABLED", + * customPrompt: "STRING_VALUE", * }, * }, * }, @@ -59,12 +65,24 @@ export interface UpdateBotLocaleCommandOutput extends UpdateBotLocaleResponse, _ * enabled: true || false, // required * bedrockModelSpecification: { * modelArn: "STRING_VALUE", // required + * guardrail: { + * identifier: "STRING_VALUE", // required + * version: "STRING_VALUE", // required + * }, + * traceStatus: "ENABLED" || "DISABLED", + * customPrompt: "STRING_VALUE", * }, * }, * sampleUtteranceGeneration: { // SampleUtteranceGenerationSpecification * enabled: true || false, // required * bedrockModelSpecification: { * modelArn: "STRING_VALUE", // required + * guardrail: { + * identifier: "STRING_VALUE", // required + * version: "STRING_VALUE", // required + * }, + * traceStatus: "ENABLED" || "DISABLED", + * customPrompt: "STRING_VALUE", * }, * }, * }, @@ -98,6 +116,12 @@ export interface UpdateBotLocaleCommandOutput extends UpdateBotLocaleResponse, _ * // enabled: true || false, // required * // bedrockModelSpecification: { // BedrockModelSpecification * // modelArn: "STRING_VALUE", // required + * // guardrail: { // BedrockGuardrailConfiguration + * // identifier: "STRING_VALUE", // required + * // version: "STRING_VALUE", // required + * // }, + * // traceStatus: "ENABLED" || "DISABLED", + * // customPrompt: "STRING_VALUE", * // }, * // }, * // }, @@ -106,12 +130,24 @@ export interface UpdateBotLocaleCommandOutput extends UpdateBotLocaleResponse, _ * // enabled: true || false, // required * // bedrockModelSpecification: { * // modelArn: "STRING_VALUE", // required + * // guardrail: { + * // identifier: "STRING_VALUE", // required + * // version: "STRING_VALUE", // required + * // }, + * // traceStatus: "ENABLED" || "DISABLED", + * // customPrompt: "STRING_VALUE", * // }, * // }, * // sampleUtteranceGeneration: { // SampleUtteranceGenerationSpecification * // enabled: true || false, // required * // bedrockModelSpecification: { * // modelArn: "STRING_VALUE", // required + * // guardrail: { + * // identifier: "STRING_VALUE", // required + * // version: "STRING_VALUE", // required + * // }, + * // traceStatus: "ENABLED" || "DISABLED", + * // customPrompt: "STRING_VALUE", * // }, * // }, * // }, diff --git a/clients/client-lex-models-v2/src/commands/UpdateIntentCommand.ts b/clients/client-lex-models-v2/src/commands/UpdateIntentCommand.ts index 878e853d7b36c..0557bb03d5d36 100644 --- a/clients/client-lex-models-v2/src/commands/UpdateIntentCommand.ts +++ b/clients/client-lex-models-v2/src/commands/UpdateIntentCommand.ts @@ -493,10 +493,20 @@ export interface UpdateIntentCommandOutput extends UpdateIntentResponse, __Metad * }, * bedrockKnowledgeStoreConfiguration: { // BedrockKnowledgeStoreConfiguration * bedrockKnowledgeBaseArn: "STRING_VALUE", // required + * exactResponse: true || false, + * exactResponseFields: { // BedrockKnowledgeStoreExactResponseFields + * answerField: "STRING_VALUE", + * }, * }, * }, * bedrockModelConfiguration: { // BedrockModelSpecification * modelArn: "STRING_VALUE", // required + * guardrail: { // BedrockGuardrailConfiguration + * identifier: "STRING_VALUE", // required + * version: "STRING_VALUE", // required + * }, + * traceStatus: "ENABLED" || "DISABLED", + * customPrompt: "STRING_VALUE", * }, * }, * }; @@ -962,10 +972,20 @@ export interface UpdateIntentCommandOutput extends UpdateIntentResponse, __Metad * // }, * // bedrockKnowledgeStoreConfiguration: { // BedrockKnowledgeStoreConfiguration * // bedrockKnowledgeBaseArn: "STRING_VALUE", // required + * // exactResponse: true || false, + * // exactResponseFields: { // BedrockKnowledgeStoreExactResponseFields + * // answerField: "STRING_VALUE", + * // }, * // }, * // }, * // bedrockModelConfiguration: { // BedrockModelSpecification * // modelArn: "STRING_VALUE", // required + * // guardrail: { // BedrockGuardrailConfiguration + * // identifier: "STRING_VALUE", // required + * // version: "STRING_VALUE", // required + * // }, + * // traceStatus: "ENABLED" || "DISABLED", + * // customPrompt: "STRING_VALUE", * // }, * // }, * // }; diff --git a/clients/client-lex-models-v2/src/models/models_0.ts b/clients/client-lex-models-v2/src/models/models_0.ts index a81be5af38a75..8088d13617091 100644 --- a/clients/client-lex-models-v2/src/models/models_0.ts +++ b/clients/client-lex-models-v2/src/models/models_0.ts @@ -2937,18 +2937,74 @@ export interface BatchUpdateCustomVocabularyItemResponse { resources?: CustomVocabularyItem[]; } +/** + *

The details on the Bedrock guardrail configuration.

+ * @public + */ +export interface BedrockGuardrailConfiguration { + /** + *

The unique guardrail id for the Bedrock guardrail configuration.

+ * @public + */ + identifier: string | undefined; + + /** + *

The guardrail version for the Bedrock guardrail configuration.

+ * @public + */ + version: string | undefined; +} + +/** + *

The exact response fields given by the Bedrock knowledge store.

+ * @public + */ +export interface BedrockKnowledgeStoreExactResponseFields { + /** + *

The answer field used for an exact response from Bedrock Knowledge Store.

+ * @public + */ + answerField?: string; +} + /** *

Contains details about the configuration of a Amazon Bedrock knowledge base.

* @public */ export interface BedrockKnowledgeStoreConfiguration { /** - *

The ARN of the knowledge base used.

+ *

The base ARN of the knowledge base used.

* @public */ bedrockKnowledgeBaseArn: string | undefined; + + /** + *

Specifies whether to return an exact response, or to return an answer generated by the model, using the fields you specify from the database.

+ * @public + */ + exactResponse?: boolean; + + /** + *

Contains the names of the fields used for an exact response to the user.

+ * @public + */ + exactResponseFields?: BedrockKnowledgeStoreExactResponseFields; } +/** + * @public + * @enum + */ +export const BedrockTraceStatus = { + DISABLED: "DISABLED", + ENABLED: "ENABLED", +} as const; + +/** + * @public + */ +export type BedrockTraceStatus = (typeof BedrockTraceStatus)[keyof typeof BedrockTraceStatus]; + /** *

Contains information about the Amazon Bedrock model used to interpret the prompt used in descriptive bot building.

* @public @@ -2959,6 +3015,24 @@ export interface BedrockModelSpecification { * @public */ modelArn: string | undefined; + + /** + *

The guardrail configuration in the Bedrock model specification details.

+ * @public + */ + guardrail?: BedrockGuardrailConfiguration; + + /** + *

The Bedrock trace status in the Bedrock model specification details.

+ * @public + */ + traceStatus?: BedrockTraceStatus; + + /** + *

The custom prompt used in the Bedrock model specification details.

+ * @public + */ + customPrompt?: string; } /** @@ -8128,185 +8202,6 @@ export interface DescribeBotLocaleRequest { localeId: string | undefined; } -/** - * @public - */ -export interface DescribeBotLocaleResponse { - /** - *

The identifier of the bot associated with the locale.

- * @public - */ - botId?: string; - - /** - *

The version of the bot associated with the - * locale.

- * @public - */ - botVersion?: string; - - /** - *

The unique identifier of the described locale.

- * @public - */ - localeId?: string; - - /** - *

The name of the locale.

- * @public - */ - localeName?: string; - - /** - *

The description of the locale.

- * @public - */ - description?: string; - - /** - *

The confidence threshold where Amazon Lex inserts the - * AMAZON.FallbackIntent and - * AMAZON.KendraSearchIntent intents in the list of - * possible intents for an utterance.

- * @public - */ - nluIntentConfidenceThreshold?: number; - - /** - *

The Amazon Polly voice Amazon Lex uses for voice interaction with the - * user.

- * @public - */ - voiceSettings?: VoiceSettings; - - /** - *

The number of intents defined for the locale.

- * @public - */ - intentsCount?: number; - - /** - *

The number of slot types defined for the locale.

- * @public - */ - slotTypesCount?: number; - - /** - *

The status of the bot. If the status is Failed, the - * reasons for the failure are listed in the failureReasons - * field.

- * @public - */ - botLocaleStatus?: BotLocaleStatus; - - /** - *

if botLocaleStatus is Failed, Amazon Lex - * explains why it failed to build the bot.

- * @public - */ - failureReasons?: string[]; - - /** - *

The date and time that the locale was created.

- * @public - */ - creationDateTime?: Date; - - /** - *

The date and time that the locale was last updated.

- * @public - */ - lastUpdatedDateTime?: Date; - - /** - *

The date and time that the locale was last submitted for - * building.

- * @public - */ - lastBuildSubmittedDateTime?: Date; - - /** - *

History of changes, such as when a locale is used in an alias, that - * have taken place for the locale.

- * @public - */ - botLocaleHistoryEvents?: BotLocaleHistoryEvent[]; - - /** - *

Recommended actions to take to resolve an error in the - * failureReasons field.

- * @public - */ - recommendedActions?: string[]; - - /** - *

Contains settings for Amazon Bedrock's generative AI features for your bot locale.

- * @public - */ - generativeAISettings?: GenerativeAISettings; -} - -/** - * @public - */ -export interface DescribeBotRecommendationRequest { - /** - *

The unique identifier of the bot associated with the bot - * recommendation.

- * @public - */ - botId: string | undefined; - - /** - *

The version of the bot associated with the bot - * recommendation.

- * @public - */ - botVersion: string | undefined; - - /** - *

The identifier of the language and locale of the bot recommendation - * to describe. The string must match one of the supported locales. For - * more information, see Supported languages.

- * @public - */ - localeId: string | undefined; - - /** - *

The identifier of the bot recommendation to describe.

- * @public - */ - botRecommendationId: string | undefined; -} - -/** - *

The object representing the passwords that were used to encrypt the - * data related to the bot recommendation, as well as the KMS key ARN used - * to encrypt the associated metadata.

- * @public - */ -export interface EncryptionSetting { - /** - *

The KMS key ARN used to encrypt the metadata associated with the bot - * recommendation.

- * @public - */ - kmsKeyArn?: string; - - /** - *

The password used to encrypt the recommended bot recommendation - * file.

- * @public - */ - botLocaleExportPassword?: string; - - /** - *

The password used to encrypt the associated transcript file.

- * @public - */ - associatedTranscriptsPassword?: string; -} - /** * @internal */ @@ -8314,12 +8209,3 @@ export const CreateExportRequestFilterSensitiveLog = (obj: CreateExportRequest): ...obj, ...(obj.filePassword && { filePassword: SENSITIVE_STRING }), }); - -/** - * @internal - */ -export const EncryptionSettingFilterSensitiveLog = (obj: EncryptionSetting): any => ({ - ...obj, - ...(obj.botLocaleExportPassword && { botLocaleExportPassword: SENSITIVE_STRING }), - ...(obj.associatedTranscriptsPassword && { associatedTranscriptsPassword: SENSITIVE_STRING }), -}); diff --git a/clients/client-lex-models-v2/src/models/models_1.ts b/clients/client-lex-models-v2/src/models/models_1.ts index 4b5be55298418..0153a9c4b8010 100644 --- a/clients/client-lex-models-v2/src/models/models_1.ts +++ b/clients/client-lex-models-v2/src/models/models_1.ts @@ -42,6 +42,7 @@ import { BotFilter, BotImportSpecification, BotLocaleFilter, + BotLocaleHistoryEvent, BotLocaleImportSpecification, BotLocaleSortBy, BotLocaleStatus, @@ -80,8 +81,6 @@ import { DialogAction, DialogCodeHookSettings, ElicitationCodeHookInvocationSetting, - EncryptionSetting, - EncryptionSettingFilterSensitiveLog, ExecutionErrorDetails, ExportResourceSpecification, ExportStatus, @@ -117,6 +116,185 @@ import { WaitAndContinueSpecification, } from "./models_0"; +/** + * @public + */ +export interface DescribeBotLocaleResponse { + /** + *

The identifier of the bot associated with the locale.

+ * @public + */ + botId?: string; + + /** + *

The version of the bot associated with the + * locale.

+ * @public + */ + botVersion?: string; + + /** + *

The unique identifier of the described locale.

+ * @public + */ + localeId?: string; + + /** + *

The name of the locale.

+ * @public + */ + localeName?: string; + + /** + *

The description of the locale.

+ * @public + */ + description?: string; + + /** + *

The confidence threshold where Amazon Lex inserts the + * AMAZON.FallbackIntent and + * AMAZON.KendraSearchIntent intents in the list of + * possible intents for an utterance.

+ * @public + */ + nluIntentConfidenceThreshold?: number; + + /** + *

The Amazon Polly voice Amazon Lex uses for voice interaction with the + * user.

+ * @public + */ + voiceSettings?: VoiceSettings; + + /** + *

The number of intents defined for the locale.

+ * @public + */ + intentsCount?: number; + + /** + *

The number of slot types defined for the locale.

+ * @public + */ + slotTypesCount?: number; + + /** + *

The status of the bot. If the status is Failed, the + * reasons for the failure are listed in the failureReasons + * field.

+ * @public + */ + botLocaleStatus?: BotLocaleStatus; + + /** + *

if botLocaleStatus is Failed, Amazon Lex + * explains why it failed to build the bot.

+ * @public + */ + failureReasons?: string[]; + + /** + *

The date and time that the locale was created.

+ * @public + */ + creationDateTime?: Date; + + /** + *

The date and time that the locale was last updated.

+ * @public + */ + lastUpdatedDateTime?: Date; + + /** + *

The date and time that the locale was last submitted for + * building.

+ * @public + */ + lastBuildSubmittedDateTime?: Date; + + /** + *

History of changes, such as when a locale is used in an alias, that + * have taken place for the locale.

+ * @public + */ + botLocaleHistoryEvents?: BotLocaleHistoryEvent[]; + + /** + *

Recommended actions to take to resolve an error in the + * failureReasons field.

+ * @public + */ + recommendedActions?: string[]; + + /** + *

Contains settings for Amazon Bedrock's generative AI features for your bot locale.

+ * @public + */ + generativeAISettings?: GenerativeAISettings; +} + +/** + * @public + */ +export interface DescribeBotRecommendationRequest { + /** + *

The unique identifier of the bot associated with the bot + * recommendation.

+ * @public + */ + botId: string | undefined; + + /** + *

The version of the bot associated with the bot + * recommendation.

+ * @public + */ + botVersion: string | undefined; + + /** + *

The identifier of the language and locale of the bot recommendation + * to describe. The string must match one of the supported locales. For + * more information, see Supported languages.

+ * @public + */ + localeId: string | undefined; + + /** + *

The identifier of the bot recommendation to describe.

+ * @public + */ + botRecommendationId: string | undefined; +} + +/** + *

The object representing the passwords that were used to encrypt the + * data related to the bot recommendation, as well as the KMS key ARN used + * to encrypt the associated metadata.

+ * @public + */ +export interface EncryptionSetting { + /** + *

The KMS key ARN used to encrypt the metadata associated with the bot + * recommendation.

+ * @public + */ + kmsKeyArn?: string; + + /** + *

The password used to encrypt the recommended bot recommendation + * file.

+ * @public + */ + botLocaleExportPassword?: string; + + /** + *

The password used to encrypt the associated transcript file.

+ * @public + */ + associatedTranscriptsPassword?: string; +} + /** *

The object that contains a path format that will be applied when * Amazon Lex reads the transcript file in the bucket you provide. Specify this @@ -9942,6 +10120,15 @@ export interface UpdateIntentResponse { qnAIntentConfiguration?: QnAIntentConfiguration; } +/** + * @internal + */ +export const EncryptionSettingFilterSensitiveLog = (obj: EncryptionSetting): any => ({ + ...obj, + ...(obj.botLocaleExportPassword && { botLocaleExportPassword: SENSITIVE_STRING }), + ...(obj.associatedTranscriptsPassword && { associatedTranscriptsPassword: SENSITIVE_STRING }), +}); + /** * @internal */ diff --git a/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts b/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts index 95b476312ba16..e1fb757f7b924 100644 --- a/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts +++ b/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts @@ -280,7 +280,9 @@ import { AudioLogDestination, AudioLogSetting, AudioSpecification, + BedrockGuardrailConfiguration, BedrockKnowledgeStoreConfiguration, + BedrockKnowledgeStoreExactResponseFields, BedrockModelSpecification, BotAliasHistoryEvent, BotAliasLocaleSettings, @@ -332,7 +334,6 @@ import { DialogCodeHookSettings, DTMFSpecification, ElicitationCodeHookInvocationSetting, - EncryptionSetting, ExactResponseFields, ExportResourceSpecification, ExternalSourceSetting, @@ -402,6 +403,7 @@ import { DefaultConditionalBranch, DialogCodeHookInvocationSetting, DialogState, + EncryptionSetting, ExportFilter, ExportSortBy, ExportSummary, @@ -5772,8 +5774,12 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_AudioSpecification omitted. +// se_BedrockGuardrailConfiguration omitted. + // se_BedrockKnowledgeStoreConfiguration omitted. +// se_BedrockKnowledgeStoreExactResponseFields omitted. + // se_BedrockModelSpecification omitted. // se_BotAliasLocaleSettings omitted. @@ -6726,8 +6732,12 @@ const de_AnalyticsUtteranceResults = (output: any, context: __SerdeContext): Ana // de_AudioSpecification omitted. +// de_BedrockGuardrailConfiguration omitted. + // de_BedrockKnowledgeStoreConfiguration omitted. +// de_BedrockKnowledgeStoreExactResponseFields omitted. + // de_BedrockModelSpecification omitted. /** diff --git a/codegen/sdk-codegen/aws-models/lex-models-v2.json b/codegen/sdk-codegen/aws-models/lex-models-v2.json index 71d919449eb1d..450bd58661db9 100644 --- a/codegen/sdk-codegen/aws-models/lex-models-v2.json +++ b/codegen/sdk-codegen/aws-models/lex-models-v2.json @@ -2629,6 +2629,44 @@ "smithy.api#output": {} } }, + "com.amazonaws.lexmodelsv2#BedrockGuardrailConfiguration": { + "type": "structure", + "members": { + "identifier": { + "target": "com.amazonaws.lexmodelsv2#BedrockGuardrailIdentifier", + "traits": { + "smithy.api#documentation": "

The unique guardrail id for the Bedrock guardrail configuration.

", + "smithy.api#required": {} + } + }, + "version": { + "target": "com.amazonaws.lexmodelsv2#BedrockGuardrailVersion", + "traits": { + "smithy.api#documentation": "

The guardrail version for the Bedrock guardrail configuration.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The details on the Bedrock guardrail configuration.

" + } + }, + "com.amazonaws.lexmodelsv2#BedrockGuardrailIdentifier": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "smithy.api#pattern": "^(([a-z0-9]+)|(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:guardrail/[a-z0-9]+))$" + } + }, + "com.amazonaws.lexmodelsv2#BedrockGuardrailVersion": { + "type": "string", + "traits": { + "smithy.api#pattern": "^(([1-9][0-9]{0,7})|(DRAFT))$" + } + }, "com.amazonaws.lexmodelsv2#BedrockKnowledgeBaseArn": { "type": "string", "traits": { @@ -2645,21 +2683,57 @@ "bedrockKnowledgeBaseArn": { "target": "com.amazonaws.lexmodelsv2#BedrockKnowledgeBaseArn", "traits": { - "smithy.api#documentation": "

The ARN of the knowledge base used.

", + "smithy.api#documentation": "

The base ARN of the knowledge base used.

", "smithy.api#required": {} } + }, + "exactResponse": { + "target": "com.amazonaws.lexmodelsv2#Boolean", + "traits": { + "smithy.api#default": false, + "smithy.api#documentation": "

Specifies whether to return an exact response, or to return an answer generated by the model, using the fields you specify from the database.

" + } + }, + "exactResponseFields": { + "target": "com.amazonaws.lexmodelsv2#BedrockKnowledgeStoreExactResponseFields", + "traits": { + "smithy.api#documentation": "

Contains the names of the fields used for an exact response to the user.

" + } } }, "traits": { "smithy.api#documentation": "

Contains details about the configuration of a Amazon Bedrock knowledge base.

" } }, + "com.amazonaws.lexmodelsv2#BedrockKnowledgeStoreExactResponseFields": { + "type": "structure", + "members": { + "answerField": { + "target": "com.amazonaws.lexmodelsv2#AnswerField", + "traits": { + "smithy.api#documentation": "

The answer field used for an exact response from Bedrock Knowledge Store.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The exact response fields given by the Bedrock knowledge store.

" + } + }, "com.amazonaws.lexmodelsv2#BedrockModelArn": { "type": "string", "traits": { "smithy.api#pattern": "^arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}::foundation-model\\/[a-z0-9-]{1,63}[.]{1}([a-z0-9-]{1,63}[.]){0,2}[a-z0-9-]{1,63}([:][a-z0-9-]{1,63}){0,2}$" } }, + "com.amazonaws.lexmodelsv2#BedrockModelCustomPrompt": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 4000 + } + } + }, "com.amazonaws.lexmodelsv2#BedrockModelSpecification": { "type": "structure", "members": { @@ -2669,12 +2743,47 @@ "smithy.api#documentation": "

The ARN of the foundation model used in descriptive bot building.

", "smithy.api#required": {} } + }, + "guardrail": { + "target": "com.amazonaws.lexmodelsv2#BedrockGuardrailConfiguration", + "traits": { + "smithy.api#documentation": "

The guardrail configuration in the Bedrock model specification details.

" + } + }, + "traceStatus": { + "target": "com.amazonaws.lexmodelsv2#BedrockTraceStatus", + "traits": { + "smithy.api#documentation": "

The Bedrock trace status in the Bedrock model specification details.

" + } + }, + "customPrompt": { + "target": "com.amazonaws.lexmodelsv2#BedrockModelCustomPrompt", + "traits": { + "smithy.api#documentation": "

The custom prompt used in the Bedrock model specification details.

" + } } }, "traits": { "smithy.api#documentation": "

Contains information about the Amazon Bedrock model used to interpret the prompt used in descriptive bot building.

" } }, + "com.amazonaws.lexmodelsv2#BedrockTraceStatus": { + "type": "enum", + "members": { + "ENABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENABLED" + } + }, + "DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DISABLED" + } + } + } + }, "com.amazonaws.lexmodelsv2#Boolean": { "type": "boolean", "traits": { @@ -6154,7 +6263,7 @@ } ], "traits": { - "smithy.api#documentation": "

Adds a new resource policy statement to a bot or bot alias. If a\n resource policy exists, the statement is added to the current resource\n policy. If a policy doesn't exist, a new policy is created.

\n

You can't create a resource policy statement that allows\n cross-account access.

", + "smithy.api#documentation": "

Adds a new resource policy statement to a bot or bot alias. If a\n resource policy exists, the statement is added to the current resource\n policy. If a policy doesn't exist, a new policy is created.

\n

You can't create a resource policy statement that allows\n cross-account access.

\n

You need to add the CreateResourcePolicy or UpdateResourcePolicy \n action to the bot role in order to call the API.

", "smithy.api#http": { "method": "POST", "uri": "/policy/{resourceArn}/statements", @@ -7972,7 +8081,7 @@ } ], "traits": { - "smithy.api#documentation": "

Deletes a policy statement from a resource policy. If you delete the\n last statement from a policy, the policy is deleted. If you specify a\n statement ID that doesn't exist in the policy, or if the bot or bot\n alias doesn't have a policy attached, Amazon Lex returns an\n exception.

", + "smithy.api#documentation": "

Deletes a policy statement from a resource policy. If you delete the\n last statement from a policy, the policy is deleted. If you specify a\n statement ID that doesn't exist in the policy, or if the bot or bot\n alias doesn't have a policy attached, Amazon Lex returns an\n exception.

\n

You need to add the DeleteResourcePolicy or UpdateResourcePolicy \n action to the bot role in order to call the API.

", "smithy.api#http": { "method": "DELETE", "uri": "/policy/{resourceArn}/statements/{statementId}",