list_session_metrics
¶
list_session_metrics(
bot_id: Id,
start_date_time: Timestamp,
end_date_time: Timestamp,
metrics: AnalyticsSessionMetrics,
*,
config_overrides: Optional[LexModelsV2ClientConfig] = None,
bin_by: Optional[AnalyticsBinByList] = None,
group_by: Optional[AnalyticsSessionGroupByList] = None,
filters: Optional[AnalyticsSessionFilters] = None,
max_results: Optional[MaxResults] = None,
next_token: Optional[NextToken] = None,
) -> ListSessionMetricsResponse
Retrieves summary metrics for the user sessions with your bot. The following fields are required:
-
metrics– A list of AnalyticsSessionMetric 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 session metrics.
-
start_date_time(Timestamp) –The date and time that marks the beginning of the range of time for which you want to see session metrics.
-
end_date_time(Timestamp) –The date and time that marks the end of the range of time for which you want to see session metrics.
-
metrics(AnalyticsSessionMetrics) –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[AnalyticsSessionGroupByList], default:None) –A list of objects, each of which specifies how to group the results. You can group by the following criteria:
-
ConversationEndState– The final state of the conversation. The possible end states are detailed in Key definitions in the user guide. -
LocaleId– The unique identifier of the bot locale.
-
-
filters(Optional[AnalyticsSessionFilters], 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 ListSessionMetrics 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 ListSessionMetrics request to return the next page of results. For a complete set of results, call the ListSessionMetrics 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
5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 | |