Skip to content

aws.lexv2_models.list_utterance_analytics_data

Example SQL Queries

SELECT * FROM
aws.lexv2_models.list_utterance_analytics_data
WHERE
"bot_id" = 'VALUE'
AND "start_date_time" = 'VALUE'
AND "end_date_time" = 'VALUE';

Description

To use this API operation, your IAM role must have permissions to perform the ListAggregatedUtterances operation, which provides access to utterance-related analytics. See Viewing utterance statistics for the IAM policy to apply to the IAM role.

Retrieves a list of metadata for individual user utterances to your bot. The following fields are required:

  • startDateTime and endDateTime – Define a time range for which you want to retrieve results.

Of the optional fields, you can organize the results in the following ways:

  • Use the filters field to filter the results and the sortBy field to specify the values by which to sort the results.

  • Use the maxResults field to limit the number of results to return in a single response and the nextToken field to return the next batch of results if the response does not return the full set of results.

Table Definition

Column NameColumn Data Type
bot_id Required Input Column

The unique identifier of the bot that the utterances belong to.

VARCHAR
end_date_time Required Input Column

The date and time that marks the end of the range of time for which you want to see utterance analytics.

TIMESTAMP_S
start_date_time Required Input Column

The date and time that marks the beginning of the range of time for which you want to see utterance analytics.

TIMESTAMP_S
filters Input Column

A list of objects, each of which describes a condition by which you want to filter the results.

STRUCT(
"name" VARCHAR,
"operator" VARCHAR,
"values" VARCHAR[]
)[]
Show child fields
filters[]
Show child fields
filters[].name

The category by which to filter the utterances. The descriptions for each option are as follows:

  • BotAlias – The name of the bot alias.

  • BotVersion – The version of the bot.

  • LocaleId – The locale of the bot.

  • Modality – The modality of the session with the bot (audio, DTMF, or text).

  • Channel – The channel that the bot is integrated with.

  • SessionId – The identifier of the session with the bot.

  • OriginatingRequestId – The identifier of the first request in a session.

  • UtteranceState – The state of the utterance.

  • UtteranceText – The text in the utterance.

filters[].operator

The operation by which to filter the category. The following operations are possible:

  • CO – Contains

  • EQ – Equals

  • GT – Greater than

  • LT – Less than

The operators that each filter supports are listed below:

  • BotAliasEQ.

  • BotVersionEQ.

  • LocaleIdEQ.

  • ModalityEQ.

  • ChannelEQ.

  • SessionIdEQ.

  • OriginatingRequestIdEQ.

  • UtteranceStateEQ.

  • UtteranceTextEQ, CO.

filters[].values[]
max_results Input Column

The maximum number of results to return in each page of results. If there are fewer results than the maximum page size, only the actual number of results are returned.

BIGINT
next_token Input Column

If the response from the ListUtteranceAnalyticsData operation contains more results than specified in the maxResults parameter, a token is returned in the response.

Use the returned token in the nextToken parameter of a ListUtteranceAnalyticsData request to return the next page of results. For a complete set of results, call the ListUtteranceAnalyticsData operation until the nextToken returned in the response is null.

VARCHAR
sort_by Input Column

An object specifying the measure and method by which to sort the utterance analytics data.

STRUCT(
"name" VARCHAR,
"order" VARCHAR
)
Show child fields
sort_by.name

The measure by which to sort the utterance analytics data.

  • Count – The number of utterances.

  • UtteranceTimestamp – The date and time of the utterance.

sort_by.order

Specifies whether to sort the results in ascending or descending order.

_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

utterances

A list of objects, each of which contains information about an utterance in a user session with your bot.

STRUCT(
"bot_alias_id" VARCHAR,
"bot_version" VARCHAR,
"locale_id" VARCHAR,
"session_id" VARCHAR,
"channel" VARCHAR,
"mode" VARCHAR,
"conversation_start_time" TIMESTAMP_S,
"conversation_end_time" TIMESTAMP_S,
"utterance" VARCHAR,
"utterance_timestamp" TIMESTAMP_S,
"audio_voice_duration_millis" BIGINT,
"utterance_understood" BOOLEAN,
"input_type" VARCHAR,
"output_type" VARCHAR,
"associated_intent_name" VARCHAR,
"associated_slot_name" VARCHAR,
"intent_state" VARCHAR,
"dialog_action_type" VARCHAR,
"bot_response_audio_voice_id" VARCHAR,
"slots_filled_in_session" VARCHAR,
"utterance_request_id" VARCHAR,
"bot_responses" STRUCT(
"content" VARCHAR,
"content_type" VARCHAR,
"image_response_card" STRUCT(
"title" VARCHAR,
"subtitle" VARCHAR,
"image_url" VARCHAR,
"buttons" STRUCT(
"text" VARCHAR,
"value" VARCHAR
)[]
)
)[]
)[]
Show child fields
utterances[]
Show child fields
utterances[].associated_intent_name

The name of the intent that the utterance is associated to.

utterances[].associated_slot_name

The name of the slot that the utterance is associated to.

utterances[].audio_voice_duration_millis

The duration in milliseconds of the audio associated with the utterance.

utterances[].bot_alias_id

The identifier of the alias of the bot that the utterance was made to.

utterances[].bot_response_audio_voice_id

The identifier for the audio of the bot response.

utterances[].bot_responses[]
Show child fields
utterances[].bot_responses[].content

The text of the response to the utterance from the bot.

utterances[].bot_responses[].content_type

The type of the response. The following values are possible:

  • PlainText – A plain text string.

  • CustomPayload – A response string that you can customize to include data or metadata for your application.

  • SSML – A string that includes Speech Synthesis Markup Language to customize the audio response.

  • ImageResponseCard – An image with buttons that the customer can select. See ImageResponseCard for more information.

utterances[].bot_responses[].image_response_card

A card that is shown to the user by a messaging platform. You define the contents of the card, the card is displayed by the platform.

When you use a response card, the response from the user is constrained to the text associated with a button on the card.

Show child fields
utterances[].bot_responses[].image_response_card.buttons[]
Show child fields
utterances[].bot_responses[].image_response_card.buttons[].text

The text that appears on the button. Use this to tell the user what value is returned when they choose this button.

utterances[].bot_responses[].image_response_card.buttons[].value

The value returned to Amazon Lex when the user chooses this button. This must be one of the slot values configured for the slot.

utterances[].bot_responses[].image_response_card.image_url

The URL of an image to display on the response card. The image URL must be publicly available so that the platform displaying the response card has access to the image.

utterances[].bot_responses[].image_response_card.subtitle

The subtitle to display on the response card. The format of the subtitle is determined by the platform displaying the response card.

utterances[].bot_responses[].image_response_card.title

The title to display on the response card. The format of the title is determined by the platform displaying the response card.

utterances[].bot_version

The version of the bot that the utterance was made to.

utterances[].channel

The channel that is integrated with the bot that the utterance was made to.

utterances[].conversation_end_time

The date and time when the conversation in which the utterance took place ended. A conversation is defined as a unique combination of a sessionId and an originatingRequestId.

utterances[].conversation_start_time

The date and time when the conversation in which the utterance took place began. A conversation is defined as a unique combination of a sessionId and an originatingRequestId.

utterances[].dialog_action_type

The type of dialog action that the utterance is associated to. See the type field in DialogAction for more information.

utterances[].input_type

The input type of the utterance. The possible values are as follows:

  • PCM format: audio data must be in little-endian byte order.

    • audio/l16; rate=16000; channels=1

    • audio/x-l16; sample-rate=16000; channel-count=1

    • audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false

  • Opus format

    • audio/x-cbr-opus-with-preamble;preamble-size=0;bit-rate=256000;frame-size-milliseconds=4

  • Text format

    • text/plain; charset=utf-8

utterances[].intent_state

The state of the intent that the utterance is associated to.

utterances[].locale_id

The locale of the bot that the utterance was made to.

utterances[].mode

The mode of the session. The possible values are as follows:

  • Speech – The session consisted of spoken dialogue.

  • Text – The session consisted of written dialogue.

  • DTMF – The session consisted of touch-tone keypad (Dual Tone Multi-Frequency) key presses.

  • MultiMode – The session consisted of multiple modes.

utterances[].output_type

The output type of the utterance. The possible values are as follows:

  • audio/mpeg

  • audio/ogg

  • audio/pcm (16 KHz)

  • audio/ (defaults to mpeg)

  • text/plain; charset=utf-8

utterances[].session_id

The identifier of the session that the utterance was made in.

utterances[].slots_filled_in_session

The slots that have been filled in the session by the time of the utterance.

utterances[].utterance

The text of the utterance.

utterances[].utterance_request_id

The identifier of the request associated with the utterance.

utterances[].utterance_timestamp

The date and time when the utterance took place.

utterances[].utterance_understood

Specifies whether the bot understood the utterance or not.