Skip to content

Examples#

Index > KendraRanking > Examples

Auto-generated documentation for KendraRanking type annotations stubs module mypy-boto3-kendra-ranking.

Client#

Implicit type annotations#

Can be used with boto3-stubs[kendra-ranking] package installed.

Write your KendraRanking code as usual, type checking and code completion should work out of the box.

Client method usage example#

# KendraRankingClient usage example

from boto3.session import Session


session = Session()

client = session.client("kendra-ranking")  # (1)
result = client.create_rescore_execution_plan()  # (2)
  1. client: KendraRankingClient
  2. result: CreateRescoreExecutionPlanResponseTypeDef

Explicit type annotations#

With boto3-stubs-lite[kendra-ranking] or a standalone mypy_boto3_kendra_ranking package, you have to explicitly specify client: KendraRankingClient type annotation.

All other type annotations are optional, as types should be discovered automatically. However, these type annotations can be helpful in your functions and methods.

Client method usage example#

# KendraRankingClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_kendra_ranking.client import KendraRankingClient
from mypy_boto3_kendra_ranking.type_defs import CreateRescoreExecutionPlanResponseTypeDef
from mypy_boto3_kendra_ranking.type_defs import CreateRescoreExecutionPlanRequestTypeDef


session = Session()

client: KendraRankingClient = session.client("kendra-ranking")

kwargs: CreateRescoreExecutionPlanRequestTypeDef = {...}
result: CreateRescoreExecutionPlanResponseTypeDef = client.create_rescore_execution_plan(**kwargs)