CreateBotLocale - Amazon Lex

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", "localeId": "string", "nluIntentConfidenceThreshold": number, "voiceSettings": { "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

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 PostText 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", "localeId": "string", "localeName": "string", "nluIntentConfidenceThreshold": number, "voiceSettings": { "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

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.

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

HTTP Status Code: 409

InternalServerException

HTTP Status Code: 500

PreconditionFailedException

HTTP Status Code: 412

ServiceQuotaExceededException

HTTP Status Code: 402

ThrottlingException

HTTP Status Code: 429

ValidationException

HTTP Status Code: 400

See Also

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