list_session_metrics
async
¶
list_session_metrics(
bot_id: Id,
start_date_time: Timestamp,
end_date_time: Timestamp,
metrics: AnalyticsSessionMetrics,
*,
config_overrides: Optional[AsyncLexModelsV2ClientConfig] = 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/async_lex_models_v2.py
5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 | |