{"id":3033,"library":"mypy-boto3-bedrock-agentcore-control","title":"Type Annotations for Boto3 Bedrock Agent Core Control","description":"This library provides PEP 561-compliant type annotations for the `boto3` Bedrock Agent Core Control service, enabling static type checking with tools like `mypy`. It helps developers catch type-related errors early and improves IDE autocompletion for `boto3`. The current version is 1.42.87, and it is updated frequently to align with new `boto3` releases.","status":"active","version":"1.42.87","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hints","bedrock","agent-core-control","static-analysis"],"install":[{"cmd":"pip install boto3 mypy-boto3-bedrock-agentcore-control","lang":"bash","label":"Install with boto3"}],"dependencies":[{"reason":"This package provides type stubs for boto3; boto3 itself must be installed for runtime.","package":"boto3","optional":false},{"reason":"Required for static type checking against the provided type annotations.","package":"mypy","optional":true},{"reason":"May be required for older Python versions (e.g., <3.9) for full type annotation support.","package":"typing-extensions","optional":true}],"imports":[{"note":"Boto3 itself does not export specific client types; stubs are needed for type hints.","wrong":"from boto3.client import BedrockAgentCoreControlClient","symbol":"BedrockAgentCoreControlClient","correct":"from mypy_boto3_bedrock_agent_core_control.client import BedrockAgentCoreControlClient"},{"note":"The generated package name uses underscores for `bedrock_agent_core_control`, not hyphens or direct concatenation.","wrong":"from mypy_boto3_bedrock_agentcorecontrol.type_defs import ListAgentsResponseTypeDef","symbol":"ListAgentsResponseTypeDef","correct":"from mypy_boto3_bedrock_agent_core_control.type_defs import ListAgentsResponseTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_bedrock_agent_core_control.client import BedrockAgentCoreControlClient\nfrom mypy_boto3_bedrock_agent_core_control.type_defs import ListAgentsRequestRequestTypeDef, ListAgentsResponseTypeDef\nfrom typing import TYPE_CHECKING, cast\n\n# Ensure boto3 is configured, e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION_NAME env vars\n# This example does not use actual credentials, but they would be needed for a real call.\n\n# Use TYPE_CHECKING for type hints that are not needed at runtime\nif TYPE_CHECKING:\n    # Cast the boto3 client to the specific type stub for better type checking\n    client: BedrockAgentCoreControlClient = cast(BedrockAgentCoreControlClient, boto3.client(\"bedrock-agent-core-control\"))\nelse:\n    client = boto3.client(\"bedrock-agent-core-control\")\n\n# Example of using a typed request and response\ntry:\n    request: ListAgentsRequestRequestTypeDef = {\n        \"maxResults\": 10\n    }\n    response: ListAgentsResponseTypeDef = client.list_agents(**request)\n\n    print(f\"Successfully listed agents. Total agents found: {len(response.get('agentSummaries', []))}\")\n    for agent in response.get('agentSummaries', []):\n        print(f\"  - Agent ID: {agent['agentId']}, Status: {agent['agentStatus']}\")\nexcept Exception as e:\n    print(f\"Error listing agents: {e}\")\n    print(\"Ensure your AWS credentials and region are configured correctly and Bedrock Agent Core Control is available.\")\n","lang":"python","description":"This quickstart demonstrates how to initialize a `boto3` client with `mypy-boto3` type hints for the Bedrock Agent Core Control service. It shows typical usage of type-hinted request and response dictionaries. Remember to install `boto3` separately."},"warnings":[{"fix":"Upgrade to Python 3.9 or newer to continue receiving updates and full type-checking support. If unable to upgrade, pin to an older `mypy-boto3` version compatible with Python 3.8.","message":"Python 3.8 support has been removed from `mypy-boto3-builder` versions 8.12.0 and later, which affects generated stub packages. Users on Python 3.8 will encounter issues.","severity":"breaking","affected_versions":"1.42.x and newer (generated by `mypy-boto3-builder 8.12.0+`)"},{"fix":"Review `mypy` configuration files (e.g., `mypy.ini`, `pyproject.toml`) to ensure `mypy` can correctly locate type stubs under the new PEP 561 structure. Typically, this change is seamless.","message":"Migration to PEP 561 package structure (`mypy-boto3-builder 8.12.0+`) might require updates to custom `mypy` configurations that rely on older module resolution paths. This primarily affects advanced `mypy` setups.","severity":"breaking","affected_versions":"1.42.x and newer (generated by `mypy-boto3-builder 8.12.0+`)"},{"fix":"Update `TypeDef` import names in your codebase according to the new conventions. Consult the `mypy-boto3` documentation or generated stub files for the correct names.","message":"TypeDef naming conventions were changed in `mypy-boto3-builder 8.9.0` to resolve conflicts and shorten names (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`). If you directly import specific `TypeDef` names, they might have changed.","severity":"breaking","affected_versions":"1.42.x and newer (generated by `mypy-boto3-builder 8.9.0+`)"},{"fix":"Always install `boto3` alongside `mypy-boto3-bedrock-agentcore-control` to ensure runtime functionality.","message":"This library provides *only* type annotations for `boto3`. You must explicitly install `boto3` (e.g., `pip install boto3`) for your code to run at runtime.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Regularly run `pip install --upgrade mypy-boto3-bedrock-agentcore-control` to keep your stubs synchronized with the latest `boto3` versions.","message":"AWS service APIs (and thus `boto3`'s implementation) are constantly updated. To ensure your type hints are accurate and reflect the latest API, you should periodically update `mypy-boto3-bedrock-agentcore-control`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always use `boto3.client(\"bedrock-agent-core-control\")` when creating the client instance that you intend to type-hint with `BedrockAgentCoreControlClient`.","message":"When initializing the client, ensure the service name passed to `boto3.client()` exactly matches the service for which the stubs are provided. The correct name is 'bedrock-agent-core-control'.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}