list_utterance_metrics
¶
list_utterance_metrics(
bot_id: Id,
start_date_time: Timestamp,
end_date_time: Timestamp,
metrics: AnalyticsUtteranceMetrics,
*,
config_overrides: Optional[LexModelsV2ClientConfig] = None,
bin_by: Optional[AnalyticsBinByList] = None,
group_by: Optional[AnalyticsUtteranceGroupByList] = None,
attributes: Optional[AnalyticsUtteranceAttributes] = None,
filters: Optional[AnalyticsUtteranceFilters] = None,
max_results: Optional[MaxResults] = None,
next_token: Optional[NextToken] = None,
) -> ListUtteranceMetricsResponse
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 summary metrics for the utterances in your bot. The following fields are required:
-
metrics– A list of AnalyticsUtteranceMetric objects. In each object, use thenamefield to specify the metric to calculate, thestatisticfield to specify whether to calculate theSum,Average, orMaxnumber, and theorderfield to specify whether to sort the results inAscendingorDescendingorder. -
startDateTimeandendDateTime– 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
filtersfield to filter the results, thegroupByfield to specify categories by which to group the results, and thebinByfield to specify time intervals by which to group the results. -
Use the
maxResultsfield to limit the number of results to return in a single response and thenextTokenfield to return the next batch of results if the response does not return the full set of results.
Note that an order field exists in both binBy and metrics. Currently, you can specify it in either field, but not in both.
Parameters:
-
bot_id(Id) –The identifier for the bot for which you want to retrieve utterance metrics.
-
start_date_time(Timestamp) –The date and time that marks the beginning of the range of time for which you want to see utterance metrics.
-
end_date_time(Timestamp) –The date and time that marks the end of the range of time for which you want to see utterance metrics.
-
metrics(AnalyticsUtteranceMetrics) –A list of objects, each of which contains a metric you want to list, the statistic for the metric you want to return, and the method by which to organize the results.
-
bin_by(Optional[AnalyticsBinByList], default:None) –A list of objects, each of which contains specifications for organizing the results by time.
-
group_by(Optional[AnalyticsUtteranceGroupByList], default:None) –A list of objects, each of which specifies how to group the results. You can group by the following criteria:
-
UtteranceText– The transcription of the utterance. -
UtteranceState– The state of the utterance. The possible states are detailed in Key definitions in the user guide.
-
-
attributes(Optional[AnalyticsUtteranceAttributes], default:None) –A list containing attributes related to the utterance that you want the response to return. The following attributes are possible:
-
LastUsedIntent– The last used intent at the time of the utterance.
-
-
filters(Optional[AnalyticsUtteranceFilters], default:None) –A list of objects, each of which describes a condition by which you want to filter the results.
-
max_results(Optional[MaxResults], default:None) –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.
-
next_token(Optional[NextToken], default:None) –If the response from the ListUtteranceMetrics 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 ListUtteranceMetrics request to return the next page of results. For a complete set of results, call the ListUtteranceMetrics operation until the nextToken returned in the response is null.
Raises:
-
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
6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 | |