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