Skip to content

Examples#

Index > AgentsforBedrock > Examples

Auto-generated documentation for AgentsforBedrock type annotations stubs module types-boto3-bedrock-agent.

Client#

Implicit type annotations#

Can be used with types-boto3[bedrock-agent] package installed.

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

# AgentsforBedrockClient usage example

from boto3.session import Session


session = Session()

client = session.client("bedrock-agent")  # (1)
result = client.associate_agent_collaborator()  # (2)
  1. client: AgentsforBedrockClient
  2. result: AssociateAgentCollaboratorResponseTypeDef
# ListAgentActionGroupsPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("bedrock-agent")  # (1)

paginator = client.get_paginator("list_agent_action_groups")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: AgentsforBedrockClient
  2. paginator: ListAgentActionGroupsPaginator
  3. item: ListAgentActionGroupsResponseTypeDef

Explicit type annotations#

With types-boto3-lite[bedrock-agent] or a standalone types_boto3_bedrock_agent package, you have to explicitly specify client: AgentsforBedrockClient 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.

# AgentsforBedrockClient usage example with type annotations

from boto3.session import Session

from types_boto3_bedrock_agent.client import AgentsforBedrockClient
from types_boto3_bedrock_agent.type_defs import AssociateAgentCollaboratorResponseTypeDef
from types_boto3_bedrock_agent.type_defs import AssociateAgentCollaboratorRequestRequestTypeDef


session = Session()

client: AgentsforBedrockClient = session.client("bedrock-agent")

kwargs: AssociateAgentCollaboratorRequestRequestTypeDef = {...}
result: AssociateAgentCollaboratorResponseTypeDef = client.associate_agent_collaborator(**kwargs)
# ListAgentActionGroupsPaginator usage example with type annotations

from boto3.session import Session

from types_boto3_bedrock_agent.client import AgentsforBedrockClient
from types_boto3_bedrock_agent.paginator import ListAgentActionGroupsPaginator
from types_boto3_bedrock_agent.type_defs import ListAgentActionGroupsResponseTypeDef


session = Session()
client: AgentsforBedrockClient = session.client("bedrock-agent")

paginator: ListAgentActionGroupsPaginator = client.get_paginator("list_agent_action_groups")
for item in paginator.paginate(...):
    item: ListAgentActionGroupsResponseTypeDef
    print(item)