Skip to content

list_inference_profiles

list_inference_profiles(
    *,
    config_overrides: Optional[BedrockClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[PaginationToken] = None,
    type_equals: Optional[InferenceProfileType] = None,
) -> ListInferenceProfilesResponse

Returns a list of inference profiles that you can use. For more information, see Increase throughput and resilience with cross-region inference in Amazon Bedrock. in the Amazon Bedrock User Guide.

Parameters:

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

    The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

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

    If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

  • type_equals (Optional[InferenceProfileType], default: None ) –

    Filters for inference profiles that match the type you specify.

    • SYSTEM_DEFINED – The inference profile is defined by Amazon Bedrock. You can route inference requests across regions with these inference profiles.

    • APPLICATION – The inference profile was created by a user. This type of inference profile can track metrics and costs when invoking the model in it. The inference profile may route requests to one or multiple regions.

Raises:

Source code in docs_src/capo_bedrock/_services/bedrock.py
def list_inference_profiles(
    self,
    *,
    config_overrides: Optional[BedrockClientConfig] = None,
    max_results: Optional["capo_bedrock.types.max_results.MaxResults"] = None,
    next_token: Optional[
        "capo_bedrock.types.pagination_token.PaginationToken"
    ] = None,
    type_equals: Optional[
        "capo_bedrock.types.inference_profile_type.InferenceProfileType"
    ] = None,
) -> "capo_bedrock.types.list_inference_profiles_response.ListInferenceProfilesResponse":
    """<p>Returns a list of inference profiles that you can use. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">Increase throughput and resilience with cross-region inference in Amazon Bedrock</a>. in the Amazon Bedrock User Guide.</p>

    Args:
        max_results: <p>The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the <code>nextToken</code> field when making another request to return the next batch of results.</p>
        next_token: <p>If the total number of results is greater than the <code>maxResults</code> value provided in the request, enter the token returned in the <code>nextToken</code> field in the response in this field to return the next batch of results.</p>
        type_equals: <p>Filters for inference profiles that match the type you specify.</p> <ul> <li> <p> <code>SYSTEM_DEFINED</code> – The inference profile is defined by Amazon Bedrock. You can route inference requests across regions with these inference profiles.</p> </li> <li> <p> <code>APPLICATION</code> – The inference profile was created by a user. This type of inference profile can track metrics and costs when invoking the model in it. The inference profile may route requests to one or multiple regions.</p> </li> </ul>

    Raises:
        capo_bedrock.errors.access_denied_exception.AccessDeniedException: <p>The request is denied because of missing access permissions.</p>
        capo_bedrock.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_bedrock.errors.throttling_exception.ThrottlingException: <p>The number of requests exceeds the limit. Resubmit your request later.</p>
        capo_bedrock.errors.validation_exception.ValidationException: <p>Input validation failed. Check your request parameters and retry the request.</p>
        capo_bedrock.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_bedrock.types.list_inference_profiles_request.ListInferenceProfilesRequest]",
    ) -> OperationResponse[
        "capo_bedrock.types.list_inference_profiles_response.ListInferenceProfilesResponse"
    ]:
        import capo_bedrock._operations.amazon_bedrock_control_plane_service.list_inference_profiles

        output, http_response = (
            capo_bedrock._operations.amazon_bedrock_control_plane_service.list_inference_profiles.list_inference_profiles(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_bedrock.types.list_inference_profiles_response.ListInferenceProfilesResponse",
    ) -> dict[str, Any]:
        import capo_bedrock.types.list_inference_profiles_response

        return capo_bedrock.types.list_inference_profiles_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListInferenceProfiles", redact_output=_redact_output),
    )
    input_: capo_bedrock.types.list_inference_profiles_request.ListInferenceProfilesRequest = {}
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if type_equals is not None:
        input_["type_equals"] = type_equals

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