Skip to content

describe_bot_analyzer_recommendation

describe_bot_analyzer_recommendation(
    bot_id: Id,
    bot_analyzer_request_id: UUID,
    *,
    config_overrides: Optional[LexModelsV2ClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> DescribeBotAnalyzerRecommendationResponse

Retrieves the analysis results and recommendations for bot optimization. The analysis must be in Available status before recommendations can be retrieved.

Recommendations are returned with pagination support. Each recommendation includes the issue location, priority level, detailed description, and proposed fix.

Parameters:

  • bot_id (Id) –

    The unique identifier of the bot.

  • bot_analyzer_request_id (UUID) –

    The unique identifier of the analysis request.

  • next_token (Optional[NextToken], default: None ) –

    If the response from a previous request was truncated, the nextToken value is used to retrieve the next page of recommendations.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of recommendations to return in the response. The default is 5.

Raises:

  • InternalServerException –

    The service encountered an unexpected condition. Try your request again.

  • ResourceNotFoundException –

    You asked to describe a resource that doesn't exist. Check the resource that you are requesting and try again.

  • 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
def describe_bot_analyzer_recommendation(
    self,
    bot_id: "capo_lex_models_v2.types.id.Id",
    bot_analyzer_request_id: "capo_lex_models_v2.types.uuid.UUID",
    *,
    config_overrides: Optional[LexModelsV2ClientConfig] = None,
    next_token: Optional["capo_lex_models_v2.types.next_token.NextToken"] = None,
    max_results: Optional["capo_lex_models_v2.types.max_results.MaxResults"] = None,
) -> "capo_lex_models_v2.types.describe_bot_analyzer_recommendation_response.DescribeBotAnalyzerRecommendationResponse":
    """<p>Retrieves the analysis results and recommendations for bot optimization. The analysis must be in <code>Available</code> status before recommendations can be retrieved.</p> <p>Recommendations are returned with pagination support. Each recommendation includes the issue location, priority level, detailed description, and proposed fix.</p>

    Args:
        bot_id: <p>The unique identifier of the bot.</p>
        bot_analyzer_request_id: <p>The unique identifier of the analysis request.</p>
        next_token: <p>If the response from a previous request was truncated, the <code>nextToken</code> value is used to retrieve the next page of recommendations.</p>
        max_results: <p>The maximum number of recommendations to return in the response. The default is 5.</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.resource_not_found_exception.ResourceNotFoundException: <p>You asked to describe a resource that doesn't exist. Check the resource that you are requesting and try again.</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.describe_bot_analyzer_recommendation_request.DescribeBotAnalyzerRecommendationRequest]",
    ) -> OperationResponse[
        "capo_lex_models_v2.types.describe_bot_analyzer_recommendation_response.DescribeBotAnalyzerRecommendationResponse"
    ]:
        import capo_lex_models_v2._operations.lex_model_building_service_v2.describe_bot_analyzer_recommendation

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeBotAnalyzerRecommendation")
    )
    input_: capo_lex_models_v2.types.describe_bot_analyzer_recommendation_request.DescribeBotAnalyzerRecommendationRequest = {
        "bot_id": bot_id,
        "bot_analyzer_request_id": bot_analyzer_request_id,
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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