Registry /
type-stubs / mypy-boto3-bedrock-agent
Install & Compatibility
Where this runs
tested against v1.43.83 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 52.4MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.8s · import 0.000s · 53MB
51MB installed
● package 51MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
BedrockAgentClient
✓ from mypy_boto3_bedrock_agent import BedrockAgentClient
BedrockAgentClient
✓ from mypy_boto3_bedrock_agent.client import BedrockAgentClient
Both import paths are typically valid, the first is often preferred for brevity.
This quickstart demonstrates how to instantiate a `bedrock-agent` client with type hints from `mypy-boto3-bedrock-agent` and perform a basic operation (`list_agents`). It highlights how the stubs provide static type checking for `boto3` client methods and their responses.
import os
import boto3
from mypy_boto3_bedrock_agent import BedrockAgentClient
from botocore.exceptions import ClientError
# Ensure boto3 is installed and configured (e.g., via AWS environment variables
# AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, or IAM roles).
# For local testing, ensure these are set or provide dummy values.
# Type hint the client to enable static analysis by Mypy
# region_name is typically required for Bedrock services.
client: BedrockAgentClient = boto3.client(
"bedrock-agent",
region_name=os.environ.get("AWS_REGION", "us-east-1")
)
try:
# Example operation: List existing agents
print("Attempting to list Bedrock Agents...")
response = client.list_agents(maxResults=5)
agents = response.get("agentSummaries", [])
if agents:
print("Successfully listed agents:")
for agent_summary in agents:
print(f" - Agent ID: {agent_summary['agentId']}, Name: {agent_summary['agentName']}")
else:
print("No Bedrock agents found in this region.")
except ClientError as e:
error_code = e.response.get("Error", {}).get("Code")
error_message = e.response.get("Error", {}).get("Message")
if error_code == "AccessDeniedException":
print(f"Access Denied: You might not have permissions to list agents. Error: {error_message}")
else:
print(f"An AWS Client Error occurred: {error_code} - {error_message}")
except Exception as e:
print(f"An unexpected error occurred: {e}")
# Mypy will now correctly type-check method calls on `client`
# and the structure of `response` based on the AWS API definition.
Debug
Known issues
breakingSupport for Python 3.8 has been removed. Projects using `mypy-boto3-bedrock-agent` (and other `mypy-boto3` generated stubs) must use Python 3.9 or newer.fixUpgrade your Python environment to 3.9 or a later version.
affects: >=8.12.0 of mypy-boto3-builder (corresponds to mypy-boto3-bedrock-agent >=1.42.83)
breakingTypeDef naming conventions were changed in `mypy-boto3-builder`, potentially affecting direct references to generated TypeDefs. For example, `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef` and `CreateDistributionExtraRequestTypeDef` became `CreateDistributionRequestExtraTypeDef`.fixReview your code for any direct references to `boto3` TypeDefs and adjust their names according to the new conventions. Refer to the specific service's `TypeDefs` for updated names.
affects: >=8.9.0 of mypy-boto3-builder (corresponds to mypy-boto3-bedrock-agent versions after approximately 1.30.x)
gotchaThis package provides *only* type annotations (stubs). `boto3` itself must be installed and available at runtime for your application to function correctly.fixEnsure `boto3` is included in your project's dependencies (e.g., `pip install boto3`).
affects: All versions
gotchaInstalling `mypy-boto3-bedrock-agent` only provides stubs for the `bedrock-agent` service. If you use other `boto3` services (e.g., S3, EC2), you will need to install their respective `mypy-boto3-*` packages, or install the overarching `boto3-stubs` package for full coverage.fixInstall `boto3-stubs` (or `mypy-boto3` for legacy projects) for comprehensive `boto3` type checking, or install specific `mypy-boto3-{service_name}` packages for each service you use. affects: All versions
Upgrade
Version history
1.43.83latest on PyPI · released Aug 28, 2026
Audit
Dependencies
boto3requiredProvides the runtime functionality for AWS SDK. This package only provides type stubs.