Skip to content

PersonalizeRuntimeClient#

Index > PersonalizeRuntime > PersonalizeRuntimeClient

Auto-generated documentation for PersonalizeRuntime type annotations stubs module mypy-boto3-personalize-runtime.

PersonalizeRuntimeClient#

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

# PersonalizeRuntimeClient usage example

from boto3.session import Session
from mypy_boto3_personalize_runtime.client import PersonalizeRuntimeClient

def get_personalize-runtime_client() -> PersonalizeRuntimeClient:
    return Session().client("personalize-runtime")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("personalize-runtime").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("personalize-runtime")

try:
    do_something(client)
except (
    client.exceptions.ClientError,
    client.exceptions.InvalidInputException,
    client.exceptions.ResourceNotFoundException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_personalize_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 boto3.client("personalize-runtime").can_paginate method. boto3 documentation

# can_paginate method definition

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

close#

Closes underlying endpoint connections.

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

# close method definition

def close(
    self,
) -> None:
    ...

generate_presigned_url#

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

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

# generate_presigned_url method definition

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

get_action_recommendations#

Returns a list of recommended actions in sorted in descending order by prediction score.

Type annotations and code completion for boto3.client("personalize-runtime").get_action_recommendations method. boto3 documentation

# get_action_recommendations method definition

def get_action_recommendations(
    self,
    *,
    campaignArn: str = ...,
    userId: str = ...,
    numResults: int = ...,
    filterArn: str = ...,
    filterValues: Mapping[str, str] = ...,
) -> GetActionRecommendationsResponseTypeDef:  # (1)
    ...
  1. See GetActionRecommendationsResponseTypeDef
# get_action_recommendations method usage example with argument unpacking

kwargs: GetActionRecommendationsRequestRequestTypeDef = {  # (1)
    "campaignArn": ...,
}

parent.get_action_recommendations(**kwargs)
  1. See GetActionRecommendationsRequestRequestTypeDef

get_personalized_ranking#

Re-ranks a list of recommended items for the given user.

Type annotations and code completion for boto3.client("personalize-runtime").get_personalized_ranking method. boto3 documentation

# get_personalized_ranking method definition

def get_personalized_ranking(
    self,
    *,
    campaignArn: str,
    inputList: Sequence[str],
    userId: str,
    context: Mapping[str, str] = ...,
    filterArn: str = ...,
    filterValues: Mapping[str, str] = ...,
    metadataColumns: Mapping[str, Sequence[str]] = ...,
) -> GetPersonalizedRankingResponseTypeDef:  # (1)
    ...
  1. See GetPersonalizedRankingResponseTypeDef
# get_personalized_ranking method usage example with argument unpacking

kwargs: GetPersonalizedRankingRequestRequestTypeDef = {  # (1)
    "campaignArn": ...,
    "inputList": ...,
    "userId": ...,
}

parent.get_personalized_ranking(**kwargs)
  1. See GetPersonalizedRankingRequestRequestTypeDef

get_recommendations#

Returns a list of recommended items.

Type annotations and code completion for boto3.client("personalize-runtime").get_recommendations method. boto3 documentation

# get_recommendations method definition

def get_recommendations(
    self,
    *,
    campaignArn: str = ...,
    itemId: str = ...,
    userId: str = ...,
    numResults: int = ...,
    context: Mapping[str, str] = ...,
    filterArn: str = ...,
    filterValues: Mapping[str, str] = ...,
    recommenderArn: str = ...,
    promotions: Sequence[PromotionTypeDef] = ...,  # (1)
    metadataColumns: Mapping[str, Sequence[str]] = ...,
) -> GetRecommendationsResponseTypeDef:  # (2)
    ...
  1. See PromotionTypeDef
  2. See GetRecommendationsResponseTypeDef
# get_recommendations method usage example with argument unpacking

kwargs: GetRecommendationsRequestRequestTypeDef = {  # (1)
    "campaignArn": ...,
}

parent.get_recommendations(**kwargs)
  1. See GetRecommendationsRequestRequestTypeDef