CreateBotLocale - Amazon Lex API Reference

CreateBotLocale

Creates a locale in the bot. The locale contains the intents and slot types that the bot uses in conversations with users in the specified language and locale. You must add a locale to a bot before you can add intents and slot types to the bot.

Request Syntax

PUT /bots/botId/botversions/botVersion/botlocales/ HTTP/1.1 Content-type: application/json { "description": "string", "generativeAISettings": { "buildtimeSettings": { "descriptiveBotBuilder": { "bedrockModelSpecification": { "customPrompt": "string", "guardrail": { "identifier": "string", "version": "string" }, "modelArn": "string", "traceStatus": "string" }, "enabled": boolean }, "sampleUtteranceGeneration": { "bedrockModelSpecification": { "customPrompt": "string", "guardrail": { "identifier": "string", "version": "string" }, "modelArn": "string", "traceStatus": "string" }, "enabled": boolean } }, "runtimeSettings": { "slotResolutionImprovement": { "bedrockModelSpecification": { "customPrompt": "string", "guardrail": { "identifier": "string", "version": "string" }, "modelArn": "string", "traceStatus": "string" }, "enabled": boolean } } }, "localeId": "string", "nluIntentConfidenceThreshold": number, "voiceSettings": { "engine": "string", "voiceId": "string" } }

URI Request Parameters

The request uses the following URI parameters.

botId

The identifier of the bot to create the locale for.

Length Constraints: Fixed length of 10.

Pattern: ^[0-9a-zA-Z]+$

Required: Yes

botVersion

The version of the bot to create the locale for. This can only be the draft version of the bot.

Length Constraints: Fixed length of 5.

Pattern: ^DRAFT$

Required: Yes

Request Body

The request accepts the following data in JSON format.

description

A description of the bot locale. Use this to help identify the bot locale in lists.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 200.

Required: No

generativeAISettings

Contains specifications about the generative AI capabilities from Amazon Bedrock that you can turn on for your bot.

Type: GenerativeAISettings object

Required: No

localeId

The identifier of the language and locale that the bot will be used in. The string must match one of the supported locales. All of the intents, slot types, and slots used in the bot must have the same locale. For more information, see Supported languages.

Type: String

Required: Yes

nluIntentConfidenceThreshold

Determines the threshold where Amazon Lex will insert the AMAZON.FallbackIntent, AMAZON.KendraSearchIntent, or both when returning alternative intents. AMAZON.FallbackIntent and AMAZON.KendraSearchIntent are only inserted if they are configured for the bot.

For example, suppose a bot is configured with the confidence threshold of 0.80 and the AMAZON.FallbackIntent. Amazon Lex returns three alternative intents with the following confidence scores: IntentA (0.70), IntentB (0.60), IntentC (0.50). The response from the RecognizeText operation would be:

  • AMAZON.FallbackIntent

  • IntentA

  • IntentB

  • IntentC

Type: Double

Valid Range: Minimum value of 0. Maximum value of 1.

Required: Yes

voiceSettings

The Amazon Polly voice ID that Amazon Lex uses for voice interaction with the user.

Type: VoiceSettings object

Required: No

Response Syntax

HTTP/1.1 202 Content-type: application/json { "botId": "string", "botLocaleStatus": "string", "botVersion": "string", "creationDateTime": number, "description": "string", "generativeAISettings": { "buildtimeSettings": { "descriptiveBotBuilder": { "bedrockModelSpecification": { "customPrompt": "string", "guardrail": { "identifier": "string", "version": "string" }, "modelArn": "string", "traceStatus": "string" }, "enabled": boolean }, "sampleUtteranceGeneration": { "bedrockModelSpecification": { "customPrompt": "string", "guardrail": { "identifier": "string", "version": "string" }, "modelArn": "string", "traceStatus": "string" }, "enabled": boolean } }, "runtimeSettings": { "slotResolutionImprovement": { "bedrockModelSpecification": { "customPrompt": "string", "guardrail": { "identifier": "string", "version": "string" }, "modelArn": "string", "traceStatus": "string" }, "enabled": boolean } } }, "localeId": "string", "localeName": "string", "nluIntentConfidenceThreshold": number, "voiceSettings": { "engine": "string", "voiceId": "string" } }

Response Elements

If the action is successful, the service sends back an HTTP 202 response.

The following data is returned in JSON format by the service.

botId

The specified bot identifier.

Type: String

Length Constraints: Fixed length of 10.

Pattern: ^[0-9a-zA-Z]+$

botLocaleStatus

The status of the bot.

When the status is Creating the bot locale is being configured. When the status is Building Amazon Lex is building the bot for testing and use.

If the status of the bot is ReadyExpressTesting, you can test the bot using the exact utterances specified in the bots' intents. When the bot is ready for full testing or to run, the status is Built.

If there was a problem with building the bot, the status is Failed. If the bot was saved but not built, the status is NotBuilt.

Type: String

Valid Values: Creating | Building | Built | ReadyExpressTesting | Failed | Deleting | NotBuilt | Importing | Processing

botVersion

The specified bot version.

Type: String

Length Constraints: Fixed length of 5.

Pattern: ^DRAFT$

creationDateTime

A timestamp specifying the date and time that the bot locale was created.

Type: Timestamp

description

The specified description of the bot locale.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 200.

generativeAISettings

Contains specifications about the generative AI capabilities from Amazon Bedrock that you can turn on for your bot.

Type: GenerativeAISettings object

localeId

The specified locale identifier.

Type: String

localeName

The specified locale name.

Type: String

nluIntentConfidenceThreshold

The specified confidence threshold for inserting the AMAZON.FallbackIntent and AMAZON.KendraSearchIntent intents.

Type: Double

Valid Range: Minimum value of 0. Maximum value of 1.

voiceSettings

The Amazon Polly voice ID that Amazon Lex uses for voice interaction with the user.

Type: VoiceSettings object

Errors

For information about the errors that are common to all actions, see Common Errors.

ConflictException

The action that you tried to perform couldn't be completed because the resource is in a conflicting state. For example, deleting a bot that is in the CREATING state. Try your request again.

HTTP Status Code: 409

InternalServerException

The service encountered an unexpected condition. Try your request again.

HTTP Status Code: 500

PreconditionFailedException

Your request couldn't be completed because one or more request fields aren't valid. Check the fields in your request and try again.

HTTP Status Code: 412

ServiceQuotaExceededException

You have reached a quota for your bot.

HTTP Status Code: 402

ThrottlingException

Your request rate is too high. Reduce the frequency of requests.

HTTP Status Code: 429

ValidationException

One of the input parameters in your request isn't valid. Check the parameters and try your request again.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: