{"library":"mypy-boto3-bedrock-runtime","title":"mypy-boto3-bedrock-runtime Type Annotations","description":"mypy-boto3-bedrock-runtime provides comprehensive type annotations for the `boto3` Bedrock Runtime service, version 1.42.82. Generated by `mypy-boto3-builder` (version 8.12.0), it enhances developer experience by offering static type checking, auto-completion, and error detection in IDEs like VSCode and PyCharm, and with type checkers like Mypy and Pyright. The library is actively maintained and frequently updated to synchronize with `boto3` releases and schema changes.","language":"python","status":"active","last_verified":"Wed May 13","install":{"commands":["pip install mypy-boto3-bedrock-runtime boto3"],"cli":null},"imports":["from mypy_boto3_bedrock_runtime import BedrockRuntimeClient","from mypy_boto3_bedrock_runtime.paginator import ListAsyncInvokesPaginator","from mypy_boto3_bedrock_runtime.literals import AsyncInvokeStatusType","from mypy_boto3_bedrock_runtime.type_defs import AppliedGuardrailDetailsTypeDef"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\nimport os\n\nif TYPE_CHECKING:\n    from mypy_boto3_bedrock_runtime import BedrockRuntimeClient\n    from mypy_boto3_bedrock_runtime.type_defs import InvokeModelResponseTypeDef\n    from mypy_boto3_bedrock_runtime.paginator import ListAsyncInvokesPaginator\n\ndef get_bedrock_runtime_client() -> \"BedrockRuntimeClient\":\n    \"\"\"Returns a typed BedrockRuntime client.\"\"\"\n    return boto3.client(\n        \"bedrock-runtime\",\n        region_name=os.environ.get('AWS_REGION', 'us-east-1'),\n        aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', ''),\n        aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', ''),\n        aws_session_token=os.environ.get('AWS_SESSION_TOKEN', '')\n    )\n\ndef invoke_model_example():\n    client: BedrockRuntimeClient = get_bedrock_runtime_client()\n    # Example: Invoke a model (replace with actual model_id and body)\n    response: InvokeModelResponseTypeDef = client.invoke_model(\n        modelId=\"anthropic.claude-v2\",\n        contentType=\"application/json\",\n        accept=\"application/json\",\n        body='{\"prompt\": \"Human: Hello, how are you? Assistant:\", \"max_tokens_to_sample\": 200}'\n    )\n    print(f\"Model invocation response: {response['body'].read().decode('utf-8')}\")\n\ndef list_async_invokes_paginator_example():\n    client: BedrockRuntimeClient = get_bedrock_runtime_client()\n    paginator: ListAsyncInvokesPaginator = client.get_paginator(\"list_async_invokes\")\n    for page in paginator.paginate():\n        print(f\"Async invokes page: {page.get('asyncInvokes')}\")\n\nif __name__ == \"__main__\":\n    invoke_model_example()\n    list_async_invokes_paginator_example()","lang":"python","description":"This quickstart demonstrates how to obtain a type-annotated BedrockRuntime client using `mypy-boto3-bedrock-runtime`. It shows how to call a client method (`invoke_model`) and how to use a paginator (`list_async_invokes`), leveraging `TYPE_CHECKING` for conditional imports. Ensure `boto3` is installed and AWS credentials are configured in your environment or via standard AWS configuration methods.","tag":null,"tag_description":null,"last_tested":"2026-04-25","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-13","installed_version":"1.43.0","pypi_latest":"1.43.0","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":3.7,"avg_import_s":0.68,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"mypy-boto3-bedrock-runtime","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.6,"mem_mb":13.5,"disk_size":"51.2M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"mypy-boto3-bedrock-runtime","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.59,"mem_mb":13.4,"disk_size":"51.1M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"mypy-boto3-bedrock-runtime","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4.2,"import_time_s":0.44,"mem_mb":13.5,"disk_size":"52M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"mypy-boto3-bedrock-runtime","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.63,"mem_mb":13.4,"disk_size":"52M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"mypy-boto3-bedrock-runtime","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.77,"mem_mb":15.2,"disk_size":"54.2M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"mypy-boto3-bedrock-runtime","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.94,"mem_mb":15.1,"disk_size":"54.1M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"mypy-boto3-bedrock-runtime","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.6,"import_time_s":0.69,"mem_mb":15.2,"disk_size":"55M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"mypy-boto3-bedrock-runtime","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.98,"mem_mb":15.1,"disk_size":"55M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"mypy-boto3-bedrock-runtime","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.72,"mem_mb":14.4,"disk_size":"45.4M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"mypy-boto3-bedrock-runtime","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.72,"mem_mb":14.3,"disk_size":"45.3M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"mypy-boto3-bedrock-runtime","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.2,"import_time_s":0.68,"mem_mb":14.4,"disk_size":"46M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"mypy-boto3-bedrock-runtime","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.76,"mem_mb":14.3,"disk_size":"46M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"mypy-boto3-bedrock-runtime","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.64,"mem_mb":15.5,"disk_size":"45.2M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"mypy-boto3-bedrock-runtime","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.72,"mem_mb":15.4,"disk_size":"45.0M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"mypy-boto3-bedrock-runtime","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.9,"import_time_s":0.67,"mem_mb":15.5,"disk_size":"46M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"mypy-boto3-bedrock-runtime","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":1.07,"mem_mb":15.4,"disk_size":"45M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"mypy-boto3-bedrock-runtime","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.45,"mem_mb":12.6,"disk_size":"50.6M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"mypy-boto3-bedrock-runtime","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.49,"mem_mb":12.6,"disk_size":"50.6M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"mypy-boto3-bedrock-runtime","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4.5,"import_time_s":0.47,"mem_mb":12.7,"disk_size":"51M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"mypy-boto3-bedrock-runtime","exit_code":0,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":0.6,"mem_mb":12.7,"disk_size":"51M"}]}}