Skip to content

update_bot_locale

update_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,
) -> UpdateBotLocaleResponse

Updates the settings that a bot has for a specific locale.

Parameters:

  • bot_id (Id) –

    The unique identifier of the bot that contains the locale.

  • bot_version (DraftBotVersion) –

    The version of the bot that contains the locale to be updated. The version can only be the DRAFT version.

  • locale_id (LocaleId) –

    The identifier of the language and locale to update. The string must match one of the supported locales. For more information, see Supported languages.

  • description (Optional[Description], default: None ) –

    The new description of the locale.

  • nlu_intent_confidence_threshold (ConfidenceThreshold) –

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

  • voice_settings (Optional[VoiceSettings], default: None ) –

    The new Amazon Polly voice Amazon Lex should use for voice interaction with the user.

  • unified_speech_settings (Optional[UnifiedSpeechSettings], default: None ) –

    Updated unified speech settings to apply to the bot locale.

  • audio_filler_settings (Optional[AudioFillerSettings], default: None ) –

    Updated audio filler settings to apply to the bot locale. When enabled, requires unifiedSpeechSettings (speech-to-speech) to be configured on the bot locale.

  • speech_recognition_settings (Optional[SpeechRecognitionSettings], default: None ) –

    Updated speech-to-text settings to apply to the bot locale.

  • generative_ai_settings (Optional[GenerativeAISettings], default: None ) –

    Contains settings for generative AI features powered by Amazon Bedrock for your bot locale. Use this object to turn generative AI features on and off. Pricing may differ if you turn a feature on. For more information, see LINK.

  • speech_detection_sensitivity (Optional[SpeechDetectionSensitivity], default: None ) –

    The new 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 updated speaker diarization settings to apply to the bot locale. If you omit this field, Amazon Lex keeps the setting currently stored on the bot locale. To turn speaker diarization off, set enabled to false explicitly.

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
def update_bot_locale(
    self,
    bot_id: "capo_lex_models_v2.types.id.Id",
    bot_version: "capo_lex_models_v2.types.draft_bot_version.DraftBotVersion",
    locale_id: "capo_lex_models_v2.types.locale_id.LocaleId",
    nlu_intent_confidence_threshold: "capo_lex_models_v2.types.confidence_threshold.ConfidenceThreshold",
    *,
    config_overrides: Optional[LexModelsV2ClientConfig] = None,
    description: Optional[
        "capo_lex_models_v2.types.description.Description"
    ] = None,
    voice_settings: Optional[
        "capo_lex_models_v2.types.voice_settings.VoiceSettings"
    ] = None,
    unified_speech_settings: Optional[
        "capo_lex_models_v2.types.unified_speech_settings.UnifiedSpeechSettings"
    ] = None,
    audio_filler_settings: Optional[
        "capo_lex_models_v2.types.audio_filler_settings.AudioFillerSettings"
    ] = None,
    speech_recognition_settings: Optional[
        "capo_lex_models_v2.types.speech_recognition_settings.SpeechRecognitionSettings"
    ] = None,
    generative_ai_settings: Optional[
        "capo_lex_models_v2.types.generative_ai_settings.GenerativeAISettings"
    ] = None,
    speech_detection_sensitivity: Optional[
        "capo_lex_models_v2.types.speech_detection_sensitivity.SpeechDetectionSensitivity"
    ] = None,
    speaker_diarization_settings: Optional[
        "capo_lex_models_v2.types.speaker_diarization_settings.SpeakerDiarizationSettings"
    ] = None,
) -> "capo_lex_models_v2.types.update_bot_locale_response.UpdateBotLocaleResponse":
    """<p>Updates the settings that a bot has for a specific locale.</p>

    Args:
        bot_id: <p>The unique identifier of the bot that contains the locale.</p>
        bot_version: <p>The version of the bot that contains the locale to be updated. The version can only be the <code>DRAFT</code> version.</p>
        locale_id: <p>The identifier of the language and locale to update. The string must match one of the supported locales. For more information, see <a href="https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html">Supported languages</a>.</p>
        description: <p>The new description of the locale.</p>
        nlu_intent_confidence_threshold: <p>The new confidence threshold where Amazon Lex inserts the <code>AMAZON.FallbackIntent</code> and <code>AMAZON.KendraSearchIntent</code> intents in the list of possible intents for an utterance.</p>
        voice_settings: <p>The new Amazon Polly voice Amazon Lex should use for voice interaction with the user.</p>
        unified_speech_settings: <p>Updated unified speech settings to apply to the bot locale.</p>
        audio_filler_settings: <p>Updated audio filler settings to apply to the bot locale. When enabled, requires <code>unifiedSpeechSettings</code> (speech-to-speech) to be configured on the bot locale.</p>
        speech_recognition_settings: <p>Updated speech-to-text settings to apply to the bot locale.</p>
        generative_ai_settings: <p>Contains settings for generative AI features powered by Amazon Bedrock for your bot locale. Use this object to turn generative AI features on and off. Pricing may differ if you turn a feature on. For more information, see LINK.</p>
        speech_detection_sensitivity: <p>The new 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.</p>
        speaker_diarization_settings: <p>The updated speaker diarization settings to apply to the bot locale. If you omit this field, Amazon Lex keeps the setting currently stored on the bot locale. To turn speaker diarization off, set <code>enabled</code> to <code>false</code> explicitly.</p>

    Raises:
        capo_lex_models_v2.errors.conflict_exception.ConflictException: <p>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. </p>
        capo_lex_models_v2.errors.internal_server_exception.InternalServerException: <p>The service encountered an unexpected condition. Try your request again.</p>
        capo_lex_models_v2.errors.precondition_failed_exception.PreconditionFailedException: <p>Your request couldn't be completed because one or more request fields aren't valid. Check the fields in your request and try again.</p>
        capo_lex_models_v2.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have reached a quota for your bot. </p>
        capo_lex_models_v2.errors.throttling_exception.ThrottlingException: <p>Your request rate is too high. Reduce the frequency of requests.</p>
        capo_lex_models_v2.errors.validation_exception.ValidationException: <p>One of the input parameters in your request isn't valid. Check the parameters and try your request again.</p>
        capo_lex_models_v2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_lex_models_v2.types.update_bot_locale_request.UpdateBotLocaleRequest]",
    ) -> OperationResponse[
        "capo_lex_models_v2.types.update_bot_locale_response.UpdateBotLocaleResponse"
    ]:
        import capo_lex_models_v2._operations.lex_model_building_service_v2.update_bot_locale

        output, http_response = (
            capo_lex_models_v2._operations.lex_model_building_service_v2.update_bot_locale.update_bot_locale(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateBotLocale")
    )
    input_: capo_lex_models_v2.types.update_bot_locale_request.UpdateBotLocaleRequest = {
        "bot_id": bot_id,
        "bot_version": bot_version,
        "locale_id": locale_id,
        "nlu_intent_confidence_threshold": nlu_intent_confidence_threshold,
    }
    if description is not None:
        input_["description"] = description
    if voice_settings is not None:
        input_["voice_settings"] = voice_settings
    if unified_speech_settings is not None:
        input_["unified_speech_settings"] = unified_speech_settings
    if audio_filler_settings is not None:
        input_["audio_filler_settings"] = audio_filler_settings
    if speech_recognition_settings is not None:
        input_["speech_recognition_settings"] = speech_recognition_settings
    if generative_ai_settings is not None:
        input_["generative_ai_settings"] = generative_ai_settings
    if speech_detection_sensitivity is not None:
        input_["speech_detection_sensitivity"] = speech_detection_sensitivity
    if speaker_diarization_settings is not None:
        input_["speaker_diarization_settings"] = speaker_diarization_settings

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output