{"id":3342,"library":"mypy-boto3-chatbot","title":"mypy-boto3-chatbot Type Annotations","description":"mypy-boto3-chatbot provides comprehensive type annotations for the `boto3` AWS Chatbot service. Generated by `mypy-boto3-builder` (currently version 8.12.0), this library enables static type checking with tools like `mypy` and `pyright`, offering improved autocompletion and early error detection in IDEs like VSCode and PyCharm. It is updated frequently to synchronize with the latest `boto3` service definitions (current `chatbot` version 1.42.3).","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["typing","type-hints","boto3","aws","chatbot","stubs","mypy","pyright","autocompletion"],"install":[{"cmd":"pip install mypy-boto3-chatbot","lang":"bash","label":"Standalone package"},{"cmd":"pip install 'types-boto3[chatbot]'","lang":"bash","label":"Recommended (integrates with types-boto3)"}],"dependencies":[],"imports":[{"symbol":"ChatbotClient","correct":"from mypy_boto3_chatbot.client import ChatbotClient"},{"symbol":"AccountPreferencesTypeDef","correct":"from mypy_boto3_chatbot.type_defs import AccountPreferencesTypeDef"},{"symbol":"CustomActionAttachmentCriteriaOperatorType","correct":"from mypy_boto3_chatbot.literals import CustomActionAttachmentCriteriaOperatorType"},{"note":"Paginator types are in the `paginator` submodule, not directly in `client`.","wrong":"from mypy_boto3_chatbot.client import ListMicrosoftTeamsChannelConfigurationsPaginator","symbol":"ListMicrosoftTeamsChannelConfigurationsPaginator","correct":"from mypy_boto3_chatbot.paginator import ListMicrosoftTeamsChannelConfigurationsPaginator"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING, Dict, Any\n\n# Ensure boto3 is installed for runtime functionality\n# pip install boto3\n\nif TYPE_CHECKING:\n    from mypy_boto3_chatbot.client import ChatbotClient\n    from mypy_boto3_chatbot.type_defs import DescribeChatbotSourcesResponseTypeDef\n\ndef get_chatbot_sources(aws_region: str = \"us-east-1\") -> Dict[str, Any]:\n    \"\"\"\n    Retrieves and type-checks AWS Chatbot sources using mypy-boto3-chatbot stubs.\n    \"\"\"\n    # boto3.client returns an untyped client by default\n    client: ChatbotClient = boto3.client(\"chatbot\", region_name=aws_region)\n    \n    # The response is now type-checked, providing autocompletion and validation\n    response: DescribeChatbotSourcesResponseTypeDef = client.describe_chatbot_sources()\n    \n    print(f\"Chatbot sources response: {response}\")\n    return response\n\nif __name__ == \"__main__\":\n    # This assumes AWS credentials are configured (e.g., via environment variables or ~/.aws/credentials)\n    try:\n        sources = get_chatbot_sources()\n        print(f\"Successfully retrieved chatbot sources with HTTP status: {sources['ResponseMetadata']['HTTPStatusCode']}\")\n    except Exception as e:\n        print(f\"An error occurred while fetching chatbot sources: {e}\")","lang":"python","description":"This example demonstrates how to use `mypy-boto3-chatbot` to add type hints to your `boto3` Chatbot client. By explicitly annotating the client and its response, you gain static analysis benefits like autocompletion and type validation."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer, or pin `mypy-boto3-builder` and associated stub packages to versions older than 8.12.0.","message":"Starting with `mypy-boto3-builder` version 8.12.0, support for Python 3.8 has been removed for all generated stub packages, including `mypy-boto3-chatbot`. The library now requires Python >=3.9.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0"},{"fix":"Update your code to use the new `TypeDef` names. Refer to the specific service's documentation or your IDE's autocompletion for the correct names.","message":"Version 8.9.0 of `mypy-boto3-builder` introduced breaking changes to `TypeDef` naming conventions. Some TypeDefs (e.g., method argument types) now use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`).","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.9.0"},{"fix":"Always explicitly type your `boto3.client()` calls, e.g., `client: ChatbotClient = boto3.client(\"chatbot\")`.","message":"When using `mypy-boto3-chatbot` as a standalone package or the `types-boto3-lite` variants, explicit type annotations are necessary for `boto3.client()` and `session.client()` calls to leverage full static analysis and IDE autocompletion. The full `types-boto3` package provides function overloads for automatic type inference.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consider installing `types-boto3-lite[chatbot]` instead of `types-boto3[chatbot]` or the standalone `mypy-boto3-chatbot`, and explicitly type your client and responses.","message":"PyCharm users might experience performance slowdowns when working with `Literal` overloads in `mypy-boto3` packages. As a workaround, the `types-boto3-lite` versions are often recommended, which typically necessitate explicit type annotations.","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"}