Examples#
Index > KendraRanking > Examples
Auto-generated documentation for KendraRanking type annotations stubs module types-aiobotocore-kendra-ranking.
Client#
Implicit type annotations#
Can be used with types-aioboto3[kendra-ranking]
package installed.
Write your KendraRanking
code as usual,
type checking and code completion should work out of the box.
# KendraRankingClient usage example
from aioboto3.session import Session
session = Session()
async with session.client("kendra-ranking") as client: # (1)
result = await client.create_rescore_execution_plan() # (2)
- client: KendraRankingClient
- result: CreateRescoreExecutionPlanResponseTypeDef
Explicit type annotations#
With types-aioboto3-lite[kendra-ranking]
or a standalone types_aiobotocore_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.
# KendraRankingClient usage example with type annotations
from aioboto3.session import Session
from types_aiobotocore_kendra_ranking.client import KendraRankingClient
from types_aiobotocore_kendra_ranking.type_defs import CreateRescoreExecutionPlanResponseTypeDef
from types_aiobotocore_kendra_ranking.type_defs import CreateRescoreExecutionPlanRequestRequestTypeDef
session = Session()
client: KendraRankingClient
async with session.client("kendra-ranking") as client: # (1)
kwargs: CreateRescoreExecutionPlanRequestRequestTypeDef = {...} # (2)
result: CreateRescoreExecutionPlanResponseTypeDef = await client.create_rescore_execution_plan(**kwargs) # (3)