{"id":6277,"library":"types-aiobotocore-bedrock-runtime","title":"Type annotations for aiobotocore BedrockRuntime","description":"Type annotations for `aiobotocore` BedrockRuntime service. This library provides static type checking for `aiobotocore` clients, resources, paginators, and service-specific `TypeDefs` and `Literals` for Amazon Bedrock Runtime. It is generated by `mypy-boto3-builder` and aims to be compatible with various IDEs and type checkers like mypy and pyright. The current version is 3.4.0 and it releases in sync with `aiobotocore` updates.","status":"active","version":"3.4.0","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["type-stubs","aws","aiobotocore","bedrock-runtime","async","mypy","pyright","typing"],"install":[{"cmd":"pip install types-aiobotocore-bedrock-runtime aiobotocore","lang":"bash","label":"Standalone installation"},{"cmd":"pip install 'types-aiobotocore[bedrock-runtime]' aiobotocore","lang":"bash","label":"Installation via types-aiobotocore extras"}],"dependencies":[{"reason":"Runtime dependency for the AWS SDK client.","package":"aiobotocore","optional":false},{"reason":"A type checker to leverage the provided type annotations.","package":"mypy","optional":true},{"reason":"An alternative type checker to leverage the provided type annotations.","package":"pyright","optional":true}],"imports":[{"symbol":"BedrockRuntimeClient","correct":"from types_aiobotocore_bedrock_runtime.client import BedrockRuntimeClient"},{"symbol":"InvokeModelResponseTypeDef","correct":"from types_aiobotocore_bedrock_runtime.type_defs import InvokeModelResponseTypeDef"},{"symbol":"AsyncInvokeStatusType","correct":"from types_aiobotocore_bedrock_runtime.literals import AsyncInvokeStatusType"}],"quickstart":{"code":"import asyncio\nfrom typing import TYPE_CHECKING\n\nimport aiobotocore.session\n\nif TYPE_CHECKING:\n    from types_aiobotocore_bedrock_runtime.client import BedrockRuntimeClient\n    from types_aiobotocore_bedrock_runtime.type_defs import InvokeModelResponseTypeDef\n\nasync def main():\n    session = aiobotocore.session.get_session()\n    async with session.create_client(\"bedrock-runtime\") as client:\n        client: BedrockRuntimeClient  # Explicit type hint (optional, but good practice)\n\n        response: InvokeModelResponseTypeDef = await client.invoke_model(\n            modelId=\"anthropic.claude-3-sonnet-20240229-v1:0\",\n            contentType=\"application/json\",\n            accept=\"application/json\",\n            body=b'{\"prompt\": \"Human: Hello, world!\\nAssistant:\"}'\n        )\n\n        async with response[\"body\"] as stream:\n            payload = stream.iter_bytes()\n            async for chunk in payload:\n                print(chunk.decode())\n\nif __name__ == \"__main__\":\n    asyncio.run(main())","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade your Python environment to version 3.9 or higher.","message":"Support for Python 3.8 has been removed. Users must upgrade to Python 3.9 or newer.","severity":"breaking","affected_versions":">=8.12.0 of mypy-boto3-builder generated packages (including types-aiobotocore-bedrock-runtime 3.4.0)"},{"fix":"Update your code to reflect the new `TypeDef` naming conventions as indicated by your type checker.","message":"TypeDef 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.","severity":"breaking","affected_versions":">=8.9.0 of mypy-boto3-builder generated packages"},{"fix":"Use mypy or pyright as your primary type checker, or consider `types-aiobotocore-lite` if performance is critical within PyCharm.","message":"When 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.","severity":"gotcha","affected_versions":"All versions (due to PyCharm's internal type checker limitations)"},{"fix":"Refer to the `types-aiobotocore` documentation for Pylint compatibility or configure Pylint to ignore these specific warnings.","message":"Pylint 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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure `aiobotocore` is installed in your environment alongside `types-aiobotocore-bedrock-runtime`.","message":"This package provides *only* type annotations. The `aiobotocore` library itself (the runtime dependency) must be installed separately for your code to function.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}