Registry /
type-stubs / types-aiobotocore-bedrock-runtime
Install & Compatibility
Where this runs
tested against v3.7.0 · 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.940 runs
installs and imports cleanly · install 0.0s · import 1.102s · 61MB
glibcpy 3.10–3.940 runs
installs and imports cleanly · install 7.6s · import 0.989s · 63MB
61MB installed
● package 61MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
BedrockRuntimeClient
✓ from types_aiobotocore_bedrock_runtime.client import BedrockRuntimeClient
InvokeModelResponseTypeDef
✓ from types_aiobotocore_bedrock_runtime.type_defs import InvokeModelResponseTypeDef
AsyncInvokeStatusType
✓ from types_aiobotocore_bedrock_runtime.literals import AsyncInvokeStatusType
This example demonstrates how to use `aiobotocore` with the `types-aiobotocore-bedrock-runtime` stubs for type-checked asynchronous interaction with the Amazon Bedrock Runtime service. It explicitly types the client and a response, then invokes a model and streams its output. Note that `aiobotocore` itself must be installed alongside the type stubs.
import asyncio
from typing import TYPE_CHECKING
import aiobotocore.session
if TYPE_CHECKING:
from types_aiobotocore_bedrock_runtime.client import BedrockRuntimeClient
from types_aiobotocore_bedrock_runtime.type_defs import InvokeModelResponseTypeDef
async def main():
session = aiobotocore.session.get_session()
async with session.create_client("bedrock-runtime") as client:
client: BedrockRuntimeClient # Explicit type hint (optional, but good practice)
response: InvokeModelResponseTypeDef = await client.invoke_model(
modelId="anthropic.claude-3-sonnet-20240229-v1:0",
contentType="application/json",
accept="application/json",
body=b'{"prompt": "Human: Hello, world!\nAssistant:"}'
)
async with response["body"] as stream:
payload = stream.iter_bytes()
async for chunk in payload:
print(chunk.decode())
if __name__ == "__main__":
asyncio.run(main())
Debug
Known issues
breakingSupport for Python 3.8 has been removed. Users must upgrade to Python 3.9 or newer.fixUpgrade your Python environment to version 3.9 or higher.
affects: >=8.12.0 of mypy-boto3-builder generated packages (including types-aiobotocore-bedrock-runtime 3.4.0)
breakingTypeDef names for method arguments and conflicting names may have changed to be shorter or use different postfixes (e.g., `RequestRequestTypeDef` -> `RequestTypeDef`, `ExtraRequestTypeDef` -> `RequestExtraTypeDef`). This can break existing explicit type annotations.fixUpdate your code to reflect the new `TypeDef` naming conventions as indicated by your type checker.
affects: >=8.9.0 of mypy-boto3-builder generated packages
gotchaWhen using PyCharm, slow performance or high CPU usage might occur due to how it handles Literal overloads in type stubs. It's recommended to either use an external type checker like mypy/pyright or consider the '-lite' version of types-aiobotocore if available for less strict type checking in the IDE.fixUse mypy or pyright as your primary type checker, or consider `types-aiobotocore-lite` if performance is critical within PyCharm.
affects: All versions (due to PyCharm's internal type checker limitations)
gotchaPylint might report false positives about undefined variables when using type stubs with the `TYPE_CHECKING` flag. To resolve this, you might need to configure Pylint or explicitly set types to `object` in non-`TYPE_CHECKING` mode.fixRefer to the `types-aiobotocore` documentation for Pylint compatibility or configure Pylint to ignore these specific warnings.
affects: All versions
gotchaThis package provides *only* type annotations. The `aiobotocore` library itself (the runtime dependency) must be installed separately for your code to function.fixEnsure `aiobotocore` is installed in your environment alongside `types-aiobotocore-bedrock-runtime`.
affects: All versions
Upgrade
Version history
3.7.0latest on PyPI · released May 10, 2026
Audit
Dependencies
aiobotocorerequiredRuntime dependency for the AWS SDK client.
mypyoptionalA type checker to leverage the provided type annotations.
pyrightoptionalAn alternative type checker to leverage the provided type annotations.