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