Skip to content

get_utterances_view async

get_utterances_view(
    bot_name: BotName,
    bot_versions: BotVersions,
    status_type: StatusType,
    *,
    config_overrides: Optional[AsyncLexModelBuildingServiceClientConfig] = None,
) -> GetUtterancesViewResponse

Use the GetUtterancesView operation to get information about the utterances that your users have made to your bot. You can use this list to tune the utterances that your bot responds to.

For example, say that you have created a bot to order flowers. After your users have used your bot for a while, use the GetUtterancesView operation to see the requests that they have made and whether they have been successful. You might find that the utterance "I want flowers" is not being recognized. You could add this utterance to the OrderFlowers intent so that your bot recognizes that utterance.

After you publish a new version of a bot, you can get information about the old version and the new so that you can compare the performance across the two versions.

Utterance statistics are generated once a day. Data is available for the last 15 days. You can request information for up to 5 versions of your bot in each request. Amazon Lex returns the most frequent utterances received by the bot in the last 15 days. The response contains information about a maximum of 100 utterances for each version.

If you set childDirected field to true when you created your bot, if you are using slot obfuscation with one or more slots, or if you opted out of participating in improving Amazon Lex, utterances are not available.

This operation requires permissions for the lex:GetUtterancesView action.

Parameters:

  • bot_name (BotName) –

    The name of the bot for which utterance information should be returned.

  • bot_versions (BotVersions) –

    An array of bot versions for which utterance information should be returned. The limit is 5 versions per request.

  • status_type (StatusType) –

    To return utterances that were recognized and handled, use Detected. To return utterances that were not recognized, use Missed.

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.

  • 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 get_utterances_view(
    self,
    bot_name: "capo_lex_model_building_service.types.bot_name.BotName",
    bot_versions: "capo_lex_model_building_service.types.bot_versions.BotVersions",
    status_type: "capo_lex_model_building_service.types.status_type.StatusType",
    *,
    config_overrides: Optional[AsyncLexModelBuildingServiceClientConfig] = None,
) -> "capo_lex_model_building_service.types.get_utterances_view_response.GetUtterancesViewResponse":
    """<p>Use the <code>GetUtterancesView</code> operation to get information about the utterances that your users have made to your bot. You can use this list to tune the utterances that your bot responds to.</p> <p>For example, say that you have created a bot to order flowers. After your users have used your bot for a while, use the <code>GetUtterancesView</code> operation to see the requests that they have made and whether they have been successful. You might find that the utterance "I want flowers" is not being recognized. You could add this utterance to the <code>OrderFlowers</code> intent so that your bot recognizes that utterance.</p> <p>After you publish a new version of a bot, you can get information about the old version and the new so that you can compare the performance across the two versions. </p> <p>Utterance statistics are generated once a day. Data is available for the last 15 days. You can request information for up to 5 versions of your bot in each request. Amazon Lex returns the most frequent utterances received by the bot in the last 15 days. The response contains information about a maximum of 100 utterances for each version.</p> <p>If you set <code>childDirected</code> field to true when you created your bot, if you are using slot obfuscation with one or more slots, or if you opted out of participating in improving Amazon Lex, utterances are not available.</p> <p>This operation requires permissions for the <code>lex:GetUtterancesView</code> action.</p>

    Args:
        bot_name: <p>The name of the bot for which utterance information should be returned.</p>
        bot_versions: <p>An array of bot versions for which utterance information should be returned. The limit is 5 versions per request.</p>
        status_type: <p>To return utterances that were recognized and handled, use <code>Detected</code>. To return utterances that were not recognized, use <code>Missed</code>.</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.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_lex_model_building_service.types.get_utterances_view_request.GetUtterancesViewRequest]",
    ) -> AsyncOperationResponse[
        "capo_lex_model_building_service.types.get_utterances_view_response.GetUtterancesViewResponse"
    ]:
        import capo_lex_model_building_service._operations.aws_deep_sense_model_building_service.get_utterances_view

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetUtterancesView")
    )
    input_: capo_lex_model_building_service.types.get_utterances_view_request.GetUtterancesViewRequest = {
        "bot_name": bot_name,
        "bot_versions": bot_versions,
        "status_type": status_type,
    }

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