Examples#
Index > BedrockAgentCore > Examples
Auto-generated documentation for BedrockAgentCore type annotations stubs module mypy-boto3-bedrock-agentcore.
Client#
Implicit type annotations#
Can be used with boto3-stubs[bedrock-agentcore] package installed.
Write your BedrockAgentCore code as usual,
type checking and code completion should work out of the box.
Client method usage example#
# BedrockAgentCoreClient usage example
from boto3.session import Session
session = Session()
client = session.client("bedrock-agentcore") # (1)
result = client.batch_create_memory_records() # (2)
- client: BedrockAgentCoreClient
- result: BatchCreateMemoryRecordsOutputTypeDef
Paginator usage example#
# ListActorsPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("bedrock-agentcore") # (1)
paginator = client.get_paginator("list_actors") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: BedrockAgentCoreClient
- paginator: ListActorsPaginator
- item: ListActorsOutputTypeDef
Explicit type annotations#
With boto3-stubs-lite[bedrock-agentcore]
or a standalone mypy_boto3_bedrock_agentcore package, you have to explicitly specify client: BedrockAgentCoreClient 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#
# BedrockAgentCoreClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_bedrock_agentcore.client import BedrockAgentCoreClient
from mypy_boto3_bedrock_agentcore.type_defs import BatchCreateMemoryRecordsOutputTypeDef
from mypy_boto3_bedrock_agentcore.type_defs import BatchCreateMemoryRecordsInputTypeDef
session = Session()
client: BedrockAgentCoreClient = session.client("bedrock-agentcore")
kwargs: BatchCreateMemoryRecordsInputTypeDef = {...}
result: BatchCreateMemoryRecordsOutputTypeDef = client.batch_create_memory_records(**kwargs)
Paginator usage example#
# ListActorsPaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_bedrock_agentcore.client import BedrockAgentCoreClient
from mypy_boto3_bedrock_agentcore.paginator import ListActorsPaginator
from mypy_boto3_bedrock_agentcore.type_defs import ListActorsOutputTypeDef
session = Session()
client: BedrockAgentCoreClient = session.client("bedrock-agentcore")
paginator: ListActorsPaginator = client.get_paginator("list_actors")
for item in paginator.paginate(...):
item: ListActorsOutputTypeDef
print(item)