updateBotLocale method

Future<UpdateBotLocaleResponse> updateBotLocale({
  1. required String botId,
  2. required String botVersion,
  3. required String localeId,
  4. required double nluIntentConfidenceThreshold,
  5. AudioFillerSettings? audioFillerSettings,
  6. String? description,
  7. GenerativeAISettings? generativeAISettings,
  8. SpeechDetectionSensitivity? speechDetectionSensitivity,
  9. SpeechRecognitionSettings? speechRecognitionSettings,
  10. UnifiedSpeechSettings? unifiedSpeechSettings,
  11. VoiceSettings? voiceSettings,
})

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

May throw ConflictException. May throw InternalServerException. May throw PreconditionFailedException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter botId : The unique identifier of the bot that contains the locale.

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

Parameter 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.

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

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

Parameter description : The new description of the locale.

Parameter generativeAISettings : 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.

Parameter speechDetectionSensitivity : 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.

Parameter speechRecognitionSettings : Updated speech-to-text settings to apply to the bot locale.

Parameter unifiedSpeechSettings : Updated unified speech settings to apply to the bot locale.

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

Implementation

Future<UpdateBotLocaleResponse> updateBotLocale({
  required String botId,
  required String botVersion,
  required String localeId,
  required double nluIntentConfidenceThreshold,
  AudioFillerSettings? audioFillerSettings,
  String? description,
  GenerativeAISettings? generativeAISettings,
  SpeechDetectionSensitivity? speechDetectionSensitivity,
  SpeechRecognitionSettings? speechRecognitionSettings,
  UnifiedSpeechSettings? unifiedSpeechSettings,
  VoiceSettings? voiceSettings,
}) async {
  _s.validateNumRange(
    'nluIntentConfidenceThreshold',
    nluIntentConfidenceThreshold,
    0,
    1,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'nluIntentConfidenceThreshold': nluIntentConfidenceThreshold,
    if (audioFillerSettings != null)
      'audioFillerSettings': audioFillerSettings,
    if (description != null) 'description': description,
    if (generativeAISettings != null)
      'generativeAISettings': generativeAISettings,
    if (speechDetectionSensitivity != null)
      'speechDetectionSensitivity': speechDetectionSensitivity.value,
    if (speechRecognitionSettings != null)
      'speechRecognitionSettings': speechRecognitionSettings,
    if (unifiedSpeechSettings != null)
      'unifiedSpeechSettings': unifiedSpeechSettings,
    if (voiceSettings != null) 'voiceSettings': voiceSettings,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/bots/${Uri.encodeComponent(botId)}/botversions/${Uri.encodeComponent(botVersion)}/botlocales/${Uri.encodeComponent(localeId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateBotLocaleResponse.fromJson(response);
}