Skip to content

list_intent_paths

list_intent_paths(
    bot_id: Id,
    start_date_time: Timestamp,
    end_date_time: Timestamp,
    intent_path: AnalyticsPath,
    *,
    config_overrides: Optional[LexModelsV2ClientConfig] = None,
    filters: Optional[AnalyticsPathFilters] = None,
) -> ListIntentPathsResponse

Retrieves summary statistics for a path of intents that users take over sessions with your bot. The following fields are required:

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

  • intentPath – Define an order of intents for which you want to retrieve metrics. Separate intents in the path with a forward slash. For example, populate the intentPath field with /BookCar/BookHotel to see details about how many times users invoked the BookCar and BookHotel intents in that order.

Use the optional filters field to filter the results.

Parameters:

  • bot_id (Id) –

    The identifier for the bot for which you want to retrieve intent path metrics.

  • start_date_time (Timestamp) –

    The date and time that marks the beginning of the range of time for which you want to see intent path metrics.

  • end_date_time (Timestamp) –

    The date and time that marks the end of the range of time for which you want to see intent path metrics.

  • intent_path (AnalyticsPath) –

    The intent path for which you want to retrieve metrics. Use a forward slash to separate intents in the path. For example:

    • /BookCar

    • /BookCar/BookHotel

    • /BookHotel/BookCar

  • filters (Optional[AnalyticsPathFilters], default: None ) –

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

Raises:

Source code in docs_src/capo_lex_models_v2/_services/lex_models_v2.py
def list_intent_paths(
    self,
    bot_id: "capo_lex_models_v2.types.id.Id",
    start_date_time: "capo_lex_models_v2.types.timestamp.Timestamp",
    end_date_time: "capo_lex_models_v2.types.timestamp.Timestamp",
    intent_path: "capo_lex_models_v2.types.analytics_path.AnalyticsPath",
    *,
    config_overrides: Optional[LexModelsV2ClientConfig] = None,
    filters: Optional[
        "capo_lex_models_v2.types.analytics_path_filters.AnalyticsPathFilters"
    ] = None,
) -> "capo_lex_models_v2.types.list_intent_paths_response.ListIntentPathsResponse":
    """<p>Retrieves summary statistics for a path of intents that users take over sessions with your bot. The following fields are required:</p> <ul> <li> <p> <code>startDateTime</code> and <code>endDateTime</code> – Define a time range for which you want to retrieve results.</p> </li> <li> <p> <code>intentPath</code> – Define an order of intents for which you want to retrieve metrics. Separate intents in the path with a forward slash. For example, populate the <code>intentPath</code> field with <code>/BookCar/BookHotel</code> to see details about how many times users invoked the <code>BookCar</code> and <code>BookHotel</code> intents in that order.</p> </li> </ul> <p>Use the optional <code>filters</code> field to filter the results.</p>

    Args:
        bot_id: <p>The identifier for the bot for which you want to retrieve intent path metrics.</p>
        start_date_time: <p>The date and time that marks the beginning of the range of time for which you want to see intent path metrics.</p>
        end_date_time: <p>The date and time that marks the end of the range of time for which you want to see intent path metrics.</p>
        intent_path: <p>The intent path for which you want to retrieve metrics. Use a forward slash to separate intents in the path. For example:</p> <ul> <li> <p>/BookCar</p> </li> <li> <p>/BookCar/BookHotel</p> </li> <li> <p>/BookHotel/BookCar</p> </li> </ul>
        filters: <p>A list of objects, each describes a condition by which you want to filter the results.</p>

    Raises:
        capo_lex_models_v2.errors.internal_server_exception.InternalServerException: <p>The service encountered an unexpected condition. Try your request again.</p>
        capo_lex_models_v2.errors.precondition_failed_exception.PreconditionFailedException: <p>Your request couldn't be completed because one or more request fields aren't valid. Check the fields in your request and try again.</p>
        capo_lex_models_v2.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have reached a quota for your bot. </p>
        capo_lex_models_v2.errors.throttling_exception.ThrottlingException: <p>Your request rate is too high. Reduce the frequency of requests.</p>
        capo_lex_models_v2.errors.validation_exception.ValidationException: <p>One of the input parameters in your request isn't valid. Check the parameters and try your request again.</p>
        capo_lex_models_v2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_lex_models_v2.types.list_intent_paths_request.ListIntentPathsRequest]",
    ) -> OperationResponse[
        "capo_lex_models_v2.types.list_intent_paths_response.ListIntentPathsResponse"
    ]:
        import capo_lex_models_v2._operations.lex_model_building_service_v2.list_intent_paths

        output, http_response = (
            capo_lex_models_v2._operations.lex_model_building_service_v2.list_intent_paths.list_intent_paths(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListIntentPaths")
    )
    input_: capo_lex_models_v2.types.list_intent_paths_request.ListIntentPathsRequest = {
        "bot_id": bot_id,
        "start_date_time": start_date_time,
        "end_date_time": end_date_time,
        "intent_path": intent_path,
    }
    if filters is not None:
        input_["filters"] = filters

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output