Skip to content

delete_utterances async

delete_utterances(
    bot_name: BotName,
    user_id: UserId,
    *,
    config_overrides: Optional[AsyncLexModelBuildingServiceClientConfig] = None,
) -> None

Deletes stored utterances.

Amazon Lex stores the utterances that users send to your bot. Utterances are stored for 15 days for use with the GetUtterancesView operation, and then stored indefinitely for use in improving the ability of your bot to respond to user input.

Use the DeleteUtterances operation to manually delete stored utterances for a specific user. When you use the DeleteUtterances operation, utterances stored for improving your bot's ability to respond to user input are deleted immediately. Utterances stored for use with the GetUtterancesView operation are deleted after 15 days.

This operation requires permissions for the lex:DeleteUtterances action.

Parameters:

  • bot_name (BotName) –

    The name of the bot that stored the utterances.

  • user_id (UserId) –

    The unique identifier for the user that made the utterances. This is the user ID that was sent in the PostContent or PostText operation request that contained the utterance.

Raises:

  • BadRequestException –

    The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and try again.

  • InternalFailureException –

    An internal Amazon Lex error occurred. Try your request again.

  • LimitExceededException –

    The request exceeded a limit. Try your request again.

  • NotFoundException –

    The resource specified in the request was not found. Check the resource and try again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_lex_model_building_service/_services/async_lex_model_building_service.py
async def delete_utterances(
    self,
    bot_name: "capo_lex_model_building_service.types.bot_name.BotName",
    user_id: "capo_lex_model_building_service.types.user_id.UserId",
    *,
    config_overrides: Optional[AsyncLexModelBuildingServiceClientConfig] = None,
) -> None:
    """<p>Deletes stored utterances.</p> <p>Amazon Lex stores the utterances that users send to your bot. Utterances are stored for 15 days for use with the <a>GetUtterancesView</a> operation, and then stored indefinitely for use in improving the ability of your bot to respond to user input.</p> <p>Use the <code>DeleteUtterances</code> operation to manually delete stored utterances for a specific user. When you use the <code>DeleteUtterances</code> operation, utterances stored for improving your bot's ability to respond to user input are deleted immediately. Utterances stored for use with the <code>GetUtterancesView</code> operation are deleted after 15 days.</p> <p>This operation requires permissions for the <code>lex:DeleteUtterances</code> action.</p>

    Args:
        bot_name: <p>The name of the bot that stored the utterances.</p>
        user_id: <p> The unique identifier for the user that made the utterances. This is the user ID that was sent in the <a href="http://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostContent.html">PostContent</a> or <a href="http://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostText.html">PostText</a> operation request that contained the utterance.</p>

    Raises:
        capo_lex_model_building_service.errors.bad_request_exception.BadRequestException: <p>The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and try again.</p>
        capo_lex_model_building_service.errors.internal_failure_exception.InternalFailureException: <p>An internal Amazon Lex error occurred. Try your request again.</p>
        capo_lex_model_building_service.errors.limit_exceeded_exception.LimitExceededException: <p>The request exceeded a limit. Try your request again.</p>
        capo_lex_model_building_service.errors.not_found_exception.NotFoundException: <p>The resource specified in the request was not found. Check the resource and try again.</p>
        capo_lex_model_building_service.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_lex_model_building_service.types.delete_utterances_request.DeleteUtterancesRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_lex_model_building_service._operations.aws_deep_sense_model_building_service.delete_utterances

        (
            output,
            http_response,
        ) = await capo_lex_model_building_service._operations.aws_deep_sense_model_building_service.delete_utterances.async_delete_utterances(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteUtterances")
    )
    input_: capo_lex_model_building_service.types.delete_utterances_request.DeleteUtterancesRequest = {
        "bot_name": bot_name,
        "user_id": user_id,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output