{"library":"microsoft-agents-activity","title":"Microsoft Agents Activity Protocol Library","description":"The `microsoft-agents-activity` library is a fundamental component of the Microsoft 365 Agents SDK for Python. It provides the core types and schemas, implementing the Activity Protocol Specification, which standardizes communication between AI agents, users, and various channels such as Microsoft Teams, M365 Copilot, Copilot Studio, and web chat. This protocol handles diverse interaction types including messages, typing indicators, conversation updates, events, invokes, and end-of-conversation signals. The SDK aims to facilitate the creation of robust, multichannel, and trusted agents for enterprise systems, allowing developers to integrate agents regardless of their underlying provider or technology stack. The current version of this specific library is 0.8.0.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install microsoft-agents-activity"],"cli":null},"imports":["from microsoft_agents.activity import Activity","from microsoft_agents.activity import ActivityTypes"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import asyncio\nfrom microsoft_agents.activity import Activity, ActivityTypes\nimport os\n\nasync def main():\n    # Simulate an incoming message activity (e.g., from a user in Teams)\n    incoming_activity = Activity.from_object({\n        \"type\": ActivityTypes.Message,\n        \"id\": \"msg123\",\n        \"timestamp\": \"2026-04-14T18:00:00Z\",\n        \"channelId\": os.environ.get('TEST_CHANNEL_ID', 'test_channel'),\n        \"from\": {\"id\": \"user123\", \"name\": \"Test User\"},\n        \"conversation\": {\"id\": \"conv123\", \"conversationType\": \"personal\"},\n        \"recipient\": {\"id\": \"bot456\", \"name\": \"Test Bot\"},\n        \"text\": \"Hello bot, how are you?\",\n        \"locale\": \"en-US\"\n    })\n\n    print(f\"Incoming Activity Text: {incoming_activity.text}\")\n    print(f\"Incoming Activity Sender: {incoming_activity.from_property.name}\")\n\n    # Create a reply activity using the incoming activity's context\n    reply_activity = incoming_activity.create_reply(\"Hello there, Test User! I'm doing well, thanks for asking.\")\n\n    print(f\"\\nReply Activity Type: {reply_activity.type}\")\n    print(f\"Reply Activity Text: {reply_activity.text}\")\n    print(f\"Reply Activity Recipient: {reply_activity.recipient.name}\")\n    print(f\"Reply Activity To ID: {reply_activity.reply_to_id}\")\n\nif __name__ == \"__main__\":\n    # Example of setting an environment variable for demonstration\n    os.environ['TEST_CHANNEL_ID'] = 'mock_channel_001'\n    asyncio.run(main())\n","lang":"python","description":"This quickstart demonstrates how to create and manipulate `Activity` objects, the core data structure handled by the `microsoft-agents-activity` library. It simulates an incoming message and then shows how to generate a reply activity using built-in methods, showcasing the protocol's core functionality.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":"0.4.0","pypi_latest":"0.9.1","is_stale":true,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":3.3,"avg_import_s":null,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"microsoft-agents-activity","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"29.6M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"microsoft-agents-activity","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":3.7,"import_time_s":null,"mem_mb":null,"disk_size":"29M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"microsoft-agents-activity","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"32.3M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"microsoft-agents-activity","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":3.1,"import_time_s":null,"mem_mb":null,"disk_size":"32M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"microsoft-agents-activity","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"24.0M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"microsoft-agents-activity","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":2.6,"import_time_s":null,"mem_mb":null,"disk_size":"24M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"microsoft-agents-activity","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"23.7M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"microsoft-agents-activity","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":2.7,"import_time_s":null,"mem_mb":null,"disk_size":"23M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"microsoft-agents-activity","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"29.0M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"microsoft-agents-activity","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":4.5,"import_time_s":null,"mem_mb":null,"disk_size":"29M"}]}}