Skip to content

SageMakerRuntimeClient

Index > SageMakerRuntime > SageMakerRuntimeClient

Auto-generated documentation for SageMakerRuntime type annotations stubs module types-aiobotocore-sagemaker-runtime.

SageMakerRuntimeClient

Type annotations and code completion for session.client("sagemaker-runtime") boto3 documentation

Usage example
from aioboto3.session import Session
from types_aiobotocore_sagemaker_runtime.client import SageMakerRuntimeClient

session = Session()
async with session.client("sagemaker-runtime") as client:
    client: SageMakerRuntimeClient

Exceptions

aioboto3 client exceptions are generated in runtime. This class provides code completion for session.client("sagemaker-runtime").exceptions structure.

Usage example
async with session.client("sagemaker-runtime") as client:
    try:
        do_something(client)
    except (
            client.ClientError,
        client.InternalDependencyException,
        client.InternalFailure,
        client.ModelError,
        client.ModelNotReadyException,
        client.ServiceUnavailable,
        client.ValidationError,
    ) as e:
        print(e)
Type checking example
from types_aiobotocore_sagemaker_runtime.client import Exceptions

def handle_error(exc: Exceptions.ClientError) -> None:
    ...

Methods

can_paginate

Check if an operation can be paginated.

Type annotations and code completion for session.client("sagemaker-runtime").can_paginate method. boto3 documentation

Method definition
def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

close

Closes underlying endpoint connections.

Type annotations and code completion for session.client("sagemaker-runtime").close method. boto3 documentation

Method definition
await def close(
    self,
) -> None:
    ...

generate_presigned_url

Generate a presigned url given a client, its method, and arguments.

Type annotations and code completion for session.client("sagemaker-runtime").generate_presigned_url method. boto3 documentation

Method definition
await def generate_presigned_url(
    self,
    ClientMethod: str,
    Params: Mapping[str, Any] = ...,
    ExpiresIn: int = 3600,
    HttpMethod: str = ...,
) -> str:
    ...

invoke_endpoint

After you deploy a model into production using Amazon SageMaker hosting services, your client applications use this API to get inferences from the model hosted at the specified endpoint.

Type annotations and code completion for session.client("sagemaker-runtime").invoke_endpoint method. boto3 documentation

Method definition
await def invoke_endpoint(
    self,
    *,
    EndpointName: str,
    Body: Union[str, bytes, IO[Any], StreamingBody],
    ContentType: str = ...,
    Accept: str = ...,
    CustomAttributes: str = ...,
    TargetModel: str = ...,
    TargetVariant: str = ...,
    TargetContainerHostname: str = ...,
    InferenceId: str = ...,
) -> InvokeEndpointOutputTypeDef:  # (1)
    ...
  1. See InvokeEndpointOutputTypeDef
Usage example with kwargs
kwargs: InvokeEndpointInputRequestTypeDef = {  # (1)
    "EndpointName": ...,
    "Body": ...,
}

parent.invoke_endpoint(**kwargs)
  1. See InvokeEndpointInputRequestTypeDef

invoke_endpoint_async

.

Type annotations and code completion for session.client("sagemaker-runtime").invoke_endpoint_async method. boto3 documentation

Method definition
await def invoke_endpoint_async(
    self,
    *,
    EndpointName: str,
    InputLocation: str,
    ContentType: str = ...,
    Accept: str = ...,
    CustomAttributes: str = ...,
    InferenceId: str = ...,
    RequestTTLSeconds: int = ...,
) -> InvokeEndpointAsyncOutputTypeDef:  # (1)
    ...
  1. See InvokeEndpointAsyncOutputTypeDef
Usage example with kwargs
kwargs: InvokeEndpointAsyncInputRequestTypeDef = {  # (1)
    "EndpointName": ...,
    "InputLocation": ...,
}

parent.invoke_endpoint_async(**kwargs)
  1. See InvokeEndpointAsyncInputRequestTypeDef

__aenter__

Type annotations and code completion for session.client("sagemaker-runtime").__aenter__ method. boto3 documentation

Method definition
await def __aenter__(
    self,
) -> SageMakerRuntimeClient:
    ...

__aexit__

Type annotations and code completion for session.client("sagemaker-runtime").__aexit__ method. boto3 documentation

Method definition
await def __aexit__(
    self,
    exc_type: Any,
    exc_val: Any,
    exc_tb: Any,
) -> Any:
    ...