LexModelsV2 / Client / create_bot_locale
create_bot_locale#
- LexModelsV2.Client.create_bot_locale(**kwargs)#
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.
See also: AWS API Documentation
Request Syntax
response = client.create_bot_locale( botId='string', botVersion='string', localeId='string', description='string', nluIntentConfidenceThreshold=123.0, voiceSettings={ 'voiceId': 'string', 'engine': 'standard'|'neural'|'long-form'|'generative' }, generativeAISettings={ 'runtimeSettings': { 'slotResolutionImprovement': { 'enabled': True|False, 'bedrockModelSpecification': { 'modelArn': 'string', 'guardrail': { 'identifier': 'string', 'version': 'string' }, 'traceStatus': 'ENABLED'|'DISABLED', 'customPrompt': 'string' } } }, 'buildtimeSettings': { 'descriptiveBotBuilder': { 'enabled': True|False, 'bedrockModelSpecification': { 'modelArn': 'string', 'guardrail': { 'identifier': 'string', 'version': 'string' }, 'traceStatus': 'ENABLED'|'DISABLED', 'customPrompt': 'string' } }, 'sampleUtteranceGeneration': { 'enabled': True|False, 'bedrockModelSpecification': { 'modelArn': 'string', 'guardrail': { 'identifier': 'string', 'version': 'string' }, 'traceStatus': 'ENABLED'|'DISABLED', 'customPrompt': 'string' } } } } )
- Parameters:
botId (string) –
[REQUIRED]
The identifier of the bot to create the locale for.
botVersion (string) –
[REQUIRED]
The version of the bot to create the locale for. This can only be the draft version of the bot.
localeId (string) –
[REQUIRED]
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.
description (string) – A description of the bot locale. Use this to help identify the bot locale in lists.
nluIntentConfidenceThreshold (float) –
[REQUIRED]
Determines the threshold where Amazon Lex will insert the
AMAZON.FallbackIntent
,AMAZON.KendraSearchIntent
, or both when returning alternative intents.AMAZON.FallbackIntent
andAMAZON.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 theRecognizeText
operation would be:AMAZON.FallbackIntent
IntentA
IntentB
IntentC
voiceSettings (dict) –
The Amazon Polly voice ID that Amazon Lex uses for voice interaction with the user.
voiceId (string) – [REQUIRED]
The identifier of the Amazon Polly voice to use.
engine (string) –
Indicates the type of Amazon Polly voice that Amazon Lex should use for voice interaction with the user. For more information, see the engine parameter of the SynthesizeSpeech operation in the Amazon Polly developer guide.
If you do not specify a value, the default is
standard
.
generativeAISettings (dict) –
Contains specifications about the generative AI capabilities from Amazon Bedrock that you can turn on for your bot.
runtimeSettings (dict) –
Contains specifications about the Amazon Lex runtime generative AI capabilities from Amazon Bedrock that you can turn on for your bot.
slotResolutionImprovement (dict) –
An object containing specifications for the assisted slot resolution feature.
enabled (boolean) – [REQUIRED]
Specifies whether assisted slot resolution is turned on or off.
bedrockModelSpecification (dict) –
An object containing information about the Amazon Bedrock model used to assist slot resolution.
modelArn (string) – [REQUIRED]
The ARN of the foundation model used in descriptive bot building.
guardrail (dict) –
The guardrail configuration in the Bedrock model specification details.
identifier (string) – [REQUIRED]
The unique guardrail id for the Bedrock guardrail configuration.
version (string) – [REQUIRED]
The guardrail version for the Bedrock guardrail configuration.
traceStatus (string) –
The Bedrock trace status in the Bedrock model specification details.
customPrompt (string) –
The custom prompt used in the Bedrock model specification details.
buildtimeSettings (dict) –
Contains specifications about the Amazon Lex build time generative AI capabilities from Amazon Bedrock that you can turn on for your bot.
descriptiveBotBuilder (dict) –
An object containing specifications for the descriptive bot building feature.
enabled (boolean) – [REQUIRED]
Specifies whether the descriptive bot building feature is activated or not.
bedrockModelSpecification (dict) –
An object containing information about the Amazon Bedrock model used to interpret the prompt used in descriptive bot building.
modelArn (string) – [REQUIRED]
The ARN of the foundation model used in descriptive bot building.
guardrail (dict) –
The guardrail configuration in the Bedrock model specification details.
identifier (string) – [REQUIRED]
The unique guardrail id for the Bedrock guardrail configuration.
version (string) – [REQUIRED]
The guardrail version for the Bedrock guardrail configuration.
traceStatus (string) –
The Bedrock trace status in the Bedrock model specification details.
customPrompt (string) –
The custom prompt used in the Bedrock model specification details.
sampleUtteranceGeneration (dict) –
Contains specifications for the sample utterance generation feature.
enabled (boolean) – [REQUIRED]
Specifies whether to enable sample utterance generation or not.
bedrockModelSpecification (dict) –
Contains information about the Amazon Bedrock model used to interpret the prompt used in descriptive bot building.
modelArn (string) – [REQUIRED]
The ARN of the foundation model used in descriptive bot building.
guardrail (dict) –
The guardrail configuration in the Bedrock model specification details.
identifier (string) – [REQUIRED]
The unique guardrail id for the Bedrock guardrail configuration.
version (string) – [REQUIRED]
The guardrail version for the Bedrock guardrail configuration.
traceStatus (string) –
The Bedrock trace status in the Bedrock model specification details.
customPrompt (string) –
The custom prompt used in the Bedrock model specification details.
- Return type:
dict
- Returns:
Response Syntax
{ 'botId': 'string', 'botVersion': 'string', 'localeName': 'string', 'localeId': 'string', 'description': 'string', 'nluIntentConfidenceThreshold': 123.0, 'voiceSettings': { 'voiceId': 'string', 'engine': 'standard'|'neural'|'long-form'|'generative' }, 'botLocaleStatus': 'Creating'|'Building'|'Built'|'ReadyExpressTesting'|'Failed'|'Deleting'|'NotBuilt'|'Importing'|'Processing', 'creationDateTime': datetime(2015, 1, 1), 'generativeAISettings': { 'runtimeSettings': { 'slotResolutionImprovement': { 'enabled': True|False, 'bedrockModelSpecification': { 'modelArn': 'string', 'guardrail': { 'identifier': 'string', 'version': 'string' }, 'traceStatus': 'ENABLED'|'DISABLED', 'customPrompt': 'string' } } }, 'buildtimeSettings': { 'descriptiveBotBuilder': { 'enabled': True|False, 'bedrockModelSpecification': { 'modelArn': 'string', 'guardrail': { 'identifier': 'string', 'version': 'string' }, 'traceStatus': 'ENABLED'|'DISABLED', 'customPrompt': 'string' } }, 'sampleUtteranceGeneration': { 'enabled': True|False, 'bedrockModelSpecification': { 'modelArn': 'string', 'guardrail': { 'identifier': 'string', 'version': 'string' }, 'traceStatus': 'ENABLED'|'DISABLED', 'customPrompt': 'string' } } } } }
Response Structure
(dict) –
botId (string) –
The specified bot identifier.
botVersion (string) –
The specified bot version.
localeName (string) –
The specified locale name.
localeId (string) –
The specified locale identifier.
description (string) –
The specified description of the bot locale.
nluIntentConfidenceThreshold (float) –
The specified confidence threshold for inserting the
AMAZON.FallbackIntent
andAMAZON.KendraSearchIntent
intents.voiceSettings (dict) –
The Amazon Polly voice ID that Amazon Lex uses for voice interaction with the user.
voiceId (string) –
The identifier of the Amazon Polly voice to use.
engine (string) –
Indicates the type of Amazon Polly voice that Amazon Lex should use for voice interaction with the user. For more information, see the engine parameter of the SynthesizeSpeech operation in the Amazon Polly developer guide.
If you do not specify a value, the default is
standard
.
botLocaleStatus (string) –
The status of the bot.
When the status is
Creating
the bot locale is being configured. When the status isBuilding
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 isBuilt
.If there was a problem with building the bot, the status is
Failed
. If the bot was saved but not built, the status isNotBuilt
.creationDateTime (datetime) –
A timestamp specifying the date and time that the bot locale was created.
generativeAISettings (dict) –
Contains specifications about the generative AI capabilities from Amazon Bedrock that you can turn on for your bot.
runtimeSettings (dict) –
Contains specifications about the Amazon Lex runtime generative AI capabilities from Amazon Bedrock that you can turn on for your bot.
slotResolutionImprovement (dict) –
An object containing specifications for the assisted slot resolution feature.
enabled (boolean) –
Specifies whether assisted slot resolution is turned on or off.
bedrockModelSpecification (dict) –
An object containing information about the Amazon Bedrock model used to assist slot resolution.
modelArn (string) –
The ARN of the foundation model used in descriptive bot building.
guardrail (dict) –
The guardrail configuration in the Bedrock model specification details.
identifier (string) –
The unique guardrail id for the Bedrock guardrail configuration.
version (string) –
The guardrail version for the Bedrock guardrail configuration.
traceStatus (string) –
The Bedrock trace status in the Bedrock model specification details.
customPrompt (string) –
The custom prompt used in the Bedrock model specification details.
buildtimeSettings (dict) –
Contains specifications about the Amazon Lex build time generative AI capabilities from Amazon Bedrock that you can turn on for your bot.
descriptiveBotBuilder (dict) –
An object containing specifications for the descriptive bot building feature.
enabled (boolean) –
Specifies whether the descriptive bot building feature is activated or not.
bedrockModelSpecification (dict) –
An object containing information about the Amazon Bedrock model used to interpret the prompt used in descriptive bot building.
modelArn (string) –
The ARN of the foundation model used in descriptive bot building.
guardrail (dict) –
The guardrail configuration in the Bedrock model specification details.
identifier (string) –
The unique guardrail id for the Bedrock guardrail configuration.
version (string) –
The guardrail version for the Bedrock guardrail configuration.
traceStatus (string) –
The Bedrock trace status in the Bedrock model specification details.
customPrompt (string) –
The custom prompt used in the Bedrock model specification details.
sampleUtteranceGeneration (dict) –
Contains specifications for the sample utterance generation feature.
enabled (boolean) –
Specifies whether to enable sample utterance generation or not.
bedrockModelSpecification (dict) –
Contains information about the Amazon Bedrock model used to interpret the prompt used in descriptive bot building.
modelArn (string) –
The ARN of the foundation model used in descriptive bot building.
guardrail (dict) –
The guardrail configuration in the Bedrock model specification details.
identifier (string) –
The unique guardrail id for the Bedrock guardrail configuration.
version (string) –
The guardrail version for the Bedrock guardrail configuration.
traceStatus (string) –
The Bedrock trace status in the Bedrock model specification details.
customPrompt (string) –
The custom prompt used in the Bedrock model specification details.
Exceptions