create_bot_locale
¶
create_bot_locale(
bot_id: Id,
bot_version: DraftBotVersion,
locale_id: LocaleId,
nlu_intent_confidence_threshold: ConfidenceThreshold,
*,
config_overrides: Optional[LexModelsV2ClientConfig] = None,
description: Optional[Description] = None,
voice_settings: Optional[VoiceSettings] = None,
unified_speech_settings: Optional[UnifiedSpeechSettings] = None,
audio_filler_settings: Optional[AudioFillerSettings] = None,
speech_recognition_settings: Optional[SpeechRecognitionSettings] = None,
generative_ai_settings: Optional[GenerativeAISettings] = None,
speech_detection_sensitivity: Optional[SpeechDetectionSensitivity] = None,
speaker_diarization_settings: Optional[SpeakerDiarizationSettings] = None,
) -> CreateBotLocaleResponse
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.
Parameters:
-
bot_id(Id) –The identifier of the bot to create the locale for.
-
bot_version(DraftBotVersion) –The version of the bot to create the locale for. This can only be the draft version of the bot.
-
locale_id(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.
-
description(Optional[Description], default:None) –A description of the bot locale. Use this to help identify the bot locale in lists.
-
nlu_intent_confidence_threshold(ConfidenceThreshold) –Determines the threshold where Amazon Lex will insert the
AMAZON.FallbackIntent,AMAZON.KendraSearchIntent, or both when returning alternative intents.AMAZON.FallbackIntentandAMAZON.KendraSearchIntentare 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 theRecognizeTextoperation would be:-
AMAZON.FallbackIntent
-
IntentA
-
IntentB
-
IntentC
-
-
voice_settings(Optional[VoiceSettings], default:None) –The Amazon Polly voice ID that Amazon Lex uses for voice interaction with the user.
-
unified_speech_settings(Optional[UnifiedSpeechSettings], default:None) –Unified speech settings to configure for the new bot locale.
-
audio_filler_settings(Optional[AudioFillerSettings], default:None) –Audio filler settings to configure for the new bot locale. When enabled, Amazon Lex plays a brief background audio filler during speech-to-speech interactions to mask processing delays. Requires
unifiedSpeechSettings(speech-to-speech) to be configured on the bot locale. -
speech_recognition_settings(Optional[SpeechRecognitionSettings], default:None) –Speech-to-text settings to configure for the new bot locale.
-
speech_detection_sensitivity(Optional[SpeechDetectionSensitivity], default:None) –The sensitivity level for voice activity detection (VAD) in the bot locale. This setting helps optimize speech recognition accuracy by adjusting how the system responds to background noise during voice interactions.
-
speaker_diarization_settings(Optional[SpeakerDiarizationSettings], default:None) –The speaker diarization settings to configure for the new bot locale. When enabled, Amazon Lex restricts speech detection to the primary (loudest) speaker during streaming audio conversations.
Raises:
-
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.
-
InternalServerException–The service encountered an unexpected condition. Try your request again.
-
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.
-
ServiceQuotaExceededException–You have reached a quota for your bot.
-
ThrottlingException–Your request rate is too high. Reduce the frequency of requests.
-
ValidationException–One of the input parameters in your request isn't valid. Check the parameters and try your request again.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_lex_models_v2/_services/lex_models_v2.py
891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 | |