Skip to content

update_intent

update_intent(
    intent_id: Id,
    intent_name: Name,
    bot_id: Id,
    bot_version: DraftBotVersion,
    locale_id: LocaleId,
    *,
    config_overrides: Optional[LexModelsV2ClientConfig] = None,
    intent_display_name: Optional[DisplayName] = None,
    description: Optional[Description] = None,
    parent_intent_signature: Optional[IntentSignature] = None,
    sample_utterances: Optional[SampleUtterancesList] = None,
    dialog_code_hook: Optional[DialogCodeHookSettings] = None,
    fulfillment_code_hook: Optional[FulfillmentCodeHookSettings] = None,
    slot_priorities: Optional[SlotPrioritiesList] = None,
    intent_confirmation_setting: Optional[IntentConfirmationSetting] = None,
    intent_closing_setting: Optional[IntentClosingSetting] = None,
    input_contexts: Optional[InputContextsList] = None,
    output_contexts: Optional[OutputContextsList] = None,
    kendra_configuration: Optional[KendraConfiguration] = None,
    initial_response_setting: Optional[InitialResponseSetting] = None,
    qn_a_intent_configuration: Optional[QnAIntentConfiguration] = None,
    q_in_connect_intent_configuration: Optional[QInConnectIntentConfiguration] = None,
) -> UpdateIntentResponse

Updates the settings for an intent.

Parameters:

  • intent_id (Id) –

    The unique identifier of the intent to update.

  • intent_name (Name) –

    The new name for the intent.

  • intent_display_name (Optional[DisplayName], default: None ) –

    The new display name for the intent.

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

    The new description of the intent.

  • parent_intent_signature (Optional[IntentSignature], default: None ) –

    The signature of the new built-in intent to use as the parent of this intent.

  • sample_utterances (Optional[SampleUtterancesList], default: None ) –

    New utterances used to invoke the intent.

  • dialog_code_hook (Optional[DialogCodeHookSettings], default: None ) –

    The new Lambda function to use between each turn of the conversation with the bot.

  • fulfillment_code_hook (Optional[FulfillmentCodeHookSettings], default: None ) –

    The new Lambda function to call when all of the intents required slots are provided and the intent is ready for fulfillment.

  • slot_priorities (Optional[SlotPrioritiesList], default: None ) –

    A new list of slots and their priorities that are contained by the intent.

  • intent_confirmation_setting (Optional[IntentConfirmationSetting], default: None ) –

    New prompts that Amazon Lex sends to the user to confirm the completion of an intent.

  • intent_closing_setting (Optional[IntentClosingSetting], default: None ) –

    The new response that Amazon Lex sends the user when the intent is closed.

  • input_contexts (Optional[InputContextsList], default: None ) –

    A new list of contexts that must be active in order for Amazon Lex to consider the intent.

  • output_contexts (Optional[OutputContextsList], default: None ) –

    A new list of contexts that Amazon Lex activates when the intent is fulfilled.

  • kendra_configuration (Optional[KendraConfiguration], default: None ) –

    New configuration settings for connecting to an Amazon Kendra index.

  • bot_id (Id) –

    The identifier of the bot that contains the intent.

  • bot_version (DraftBotVersion) –

    The version of the bot that contains the intent. Must be DRAFT.

  • locale_id (LocaleId) –

    The identifier of the language and locale where this intent is used. The string must match one of the supported locales. For more information, see Supported languages.

  • initial_response_setting (Optional[InitialResponseSetting], default: None ) –

    Configuration settings for a response sent to the user before Amazon Lex starts eliciting slots.

  • qn_a_intent_configuration (Optional[QnAIntentConfiguration], default: None ) –

    Specifies the configuration of the built-in Amazon.QnAIntent. The AMAZON.QnAIntent intent is called when Amazon Lex can't determine another intent to invoke. If you specify this field, you can't specify the kendraConfiguration field.

  • q_in_connect_intent_configuration (Optional[QInConnectIntentConfiguration], default: None ) –

    Qinconnect intent configuration details for the update intent request.

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_intent(
    self,
    intent_id: "capo_lex_models_v2.types.id.Id",
    intent_name: "capo_lex_models_v2.types.name.Name",
    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",
    *,
    config_overrides: Optional[LexModelsV2ClientConfig] = None,
    intent_display_name: Optional[
        "capo_lex_models_v2.types.display_name.DisplayName"
    ] = None,
    description: Optional[
        "capo_lex_models_v2.types.description.Description"
    ] = None,
    parent_intent_signature: Optional[
        "capo_lex_models_v2.types.intent_signature.IntentSignature"
    ] = None,
    sample_utterances: Optional[
        "capo_lex_models_v2.types.sample_utterances_list.SampleUtterancesList"
    ] = None,
    dialog_code_hook: Optional[
        "capo_lex_models_v2.types.dialog_code_hook_settings.DialogCodeHookSettings"
    ] = None,
    fulfillment_code_hook: Optional[
        "capo_lex_models_v2.types.fulfillment_code_hook_settings.FulfillmentCodeHookSettings"
    ] = None,
    slot_priorities: Optional[
        "capo_lex_models_v2.types.slot_priorities_list.SlotPrioritiesList"
    ] = None,
    intent_confirmation_setting: Optional[
        "capo_lex_models_v2.types.intent_confirmation_setting.IntentConfirmationSetting"
    ] = None,
    intent_closing_setting: Optional[
        "capo_lex_models_v2.types.intent_closing_setting.IntentClosingSetting"
    ] = None,
    input_contexts: Optional[
        "capo_lex_models_v2.types.input_contexts_list.InputContextsList"
    ] = None,
    output_contexts: Optional[
        "capo_lex_models_v2.types.output_contexts_list.OutputContextsList"
    ] = None,
    kendra_configuration: Optional[
        "capo_lex_models_v2.types.kendra_configuration.KendraConfiguration"
    ] = None,
    initial_response_setting: Optional[
        "capo_lex_models_v2.types.initial_response_setting.InitialResponseSetting"
    ] = None,
    qn_a_intent_configuration: Optional[
        "capo_lex_models_v2.types.qn_a_intent_configuration.QnAIntentConfiguration"
    ] = None,
    q_in_connect_intent_configuration: Optional[
        "capo_lex_models_v2.types.q_in_connect_intent_configuration.QInConnectIntentConfiguration"
    ] = None,
) -> "capo_lex_models_v2.types.update_intent_response.UpdateIntentResponse":
    """<p>Updates the settings for an intent.</p>

    Args:
        intent_id: <p>The unique identifier of the intent to update.</p>
        intent_name: <p>The new name for the intent.</p>
        intent_display_name: <p>The new display name for the intent.</p>
        description: <p>The new description of the intent.</p>
        parent_intent_signature: <p>The signature of the new built-in intent to use as the parent of this intent.</p>
        sample_utterances: <p>New utterances used to invoke the intent.</p>
        dialog_code_hook: <p>The new Lambda function to use between each turn of the conversation with the bot.</p>
        fulfillment_code_hook: <p>The new Lambda function to call when all of the intents required slots are provided and the intent is ready for fulfillment.</p>
        slot_priorities: <p>A new list of slots and their priorities that are contained by the intent.</p>
        intent_confirmation_setting: <p>New prompts that Amazon Lex sends to the user to confirm the completion of an intent.</p>
        intent_closing_setting: <p>The new response that Amazon Lex sends the user when the intent is closed.</p>
        input_contexts: <p>A new list of contexts that must be active in order for Amazon Lex to consider the intent.</p>
        output_contexts: <p>A new list of contexts that Amazon Lex activates when the intent is fulfilled.</p>
        kendra_configuration: <p>New configuration settings for connecting to an Amazon Kendra index.</p>
        bot_id: <p>The identifier of the bot that contains the intent.</p>
        bot_version: <p>The version of the bot that contains the intent. Must be <code>DRAFT</code>.</p>
        locale_id: <p>The identifier of the language and locale where this intent is used. 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>
        initial_response_setting: <p>Configuration settings for a response sent to the user before Amazon Lex starts eliciting slots.</p>
        qn_a_intent_configuration: <p>Specifies the configuration of the built-in <code>Amazon.QnAIntent</code>. The <code>AMAZON.QnAIntent</code> intent is called when Amazon Lex can't determine another intent to invoke. If you specify this field, you can't specify the <code>kendraConfiguration</code> field.</p>
        q_in_connect_intent_configuration: <p>Qinconnect intent configuration details for the update intent request.</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_intent_request.UpdateIntentRequest]",
    ) -> OperationResponse[
        "capo_lex_models_v2.types.update_intent_response.UpdateIntentResponse"
    ]:
        import capo_lex_models_v2._operations.lex_model_building_service_v2.update_intent

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateIntent")
    )
    input_: capo_lex_models_v2.types.update_intent_request.UpdateIntentRequest = {
        "intent_id": intent_id,
        "intent_name": intent_name,
        "bot_id": bot_id,
        "bot_version": bot_version,
        "locale_id": locale_id,
    }
    if intent_display_name is not None:
        input_["intent_display_name"] = intent_display_name
    if description is not None:
        input_["description"] = description
    if parent_intent_signature is not None:
        input_["parent_intent_signature"] = parent_intent_signature
    if sample_utterances is not None:
        input_["sample_utterances"] = sample_utterances
    if dialog_code_hook is not None:
        input_["dialog_code_hook"] = dialog_code_hook
    if fulfillment_code_hook is not None:
        input_["fulfillment_code_hook"] = fulfillment_code_hook
    if slot_priorities is not None:
        input_["slot_priorities"] = slot_priorities
    if intent_confirmation_setting is not None:
        input_["intent_confirmation_setting"] = intent_confirmation_setting
    if intent_closing_setting is not None:
        input_["intent_closing_setting"] = intent_closing_setting
    if input_contexts is not None:
        input_["input_contexts"] = input_contexts
    if output_contexts is not None:
        input_["output_contexts"] = output_contexts
    if kendra_configuration is not None:
        input_["kendra_configuration"] = kendra_configuration
    if initial_response_setting is not None:
        input_["initial_response_setting"] = initial_response_setting
    if qn_a_intent_configuration is not None:
        input_["qn_a_intent_configuration"] = qn_a_intent_configuration
    if q_in_connect_intent_configuration is not None:
        input_["q_in_connect_intent_configuration"] = (
            q_in_connect_intent_configuration
        )

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