Deletes stored utterances.
Amazon Lex stores the utterances that users send to your bot. Utterances are stored for 15 days for use with the ListAggregatedUtterances 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 utterances for a specific session. 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 ListAggregatedUtterances operation are deleted after 15 days.
Parameters:
-
bot_id
(Id)
–
The unique identifier of the bot that contains the utterances.
-
locale_id
(Optional[LocaleId], default:
None
)
–
The identifier of the language and locale where the utterances were collected. The string must match one of the supported locales. For more information, see Supported languages.
-
session_id
(Optional[SessionId], default:
None
)
–
Raises:
Source code in docs_src/capo_lex_models_v2/_services/async_lex_models_v2.py
| async def delete_utterances(
self,
bot_id: "capo_lex_models_v2.types.id.Id",
*,
config_overrides: Optional[AsyncLexModelsV2ClientConfig] = None,
locale_id: Optional["capo_lex_models_v2.types.locale_id.LocaleId"] = None,
session_id: Optional["capo_lex_models_v2.types.session_id.SessionId"] = None,
) -> "capo_lex_models_v2.types.delete_utterances_response.DeleteUtterancesResponse":
"""<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 href="https://docs.aws.amazon.com/lexv2/latest/APIReference/API_ListAggregatedUtterances.html">ListAggregatedUtterances</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 utterances for a specific session. 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>ListAggregatedUtterances</code> operation are deleted after 15 days.</p>
Args:
bot_id: <p>The unique identifier of the bot that contains the utterances.</p>
locale_id: <p>The identifier of the language and locale where the utterances were collected. 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>
session_id: <p>The unique identifier of the session with the user. The ID is returned in the response from the <a href="https://docs.aws.amazon.com/lexv2/latest/APIReference/API_runtime_RecognizeText.html">RecognizeText</a> and <a href="https://docs.aws.amazon.com/lexv2/latest/APIReference/API_runtime_RecognizeUtterance.html">RecognizeUtterance</a> operations.</p>
Raises:
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.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.
"""
async def _handler(
req: "AsyncOperationRequest[capo_lex_models_v2.types.delete_utterances_request.DeleteUtterancesRequest]",
) -> AsyncOperationResponse[
"capo_lex_models_v2.types.delete_utterances_response.DeleteUtterancesResponse"
]:
import capo_lex_models_v2._operations.lex_model_building_service_v2.delete_utterances
(
output,
http_response,
) = await capo_lex_models_v2._operations.lex_model_building_service_v2.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_models_v2.types.delete_utterances_request.DeleteUtterancesRequest = {
"bot_id": bot_id
}
if locale_id is not None:
input_["locale_id"] = locale_id
if session_id is not None:
input_["session_id"] = session_id
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|