Registry /
communication / microsoft-agents-activity
Install & Compatibility
Where this runs
tested against v1.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 29.6MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 3.3s · import 0.000s · 29MB
28MB installed
● package 28MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Activity
✓ from microsoft_agents.activity import Activity
✗ from microsoft_agents.activity import Activity
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.
import asyncio
from microsoft_agents.activity import Activity, ActivityTypes
import os
async def main():
# Simulate an incoming message activity (e.g., from a user in Teams)
incoming_activity = Activity.from_object({
"type": ActivityTypes.Message,
"id": "msg123",
"timestamp": "2026-04-14T18:00:00Z",
"channelId": os.environ.get('TEST_CHANNEL_ID', 'test_channel'),
"from": {"id": "user123", "name": "Test User"},
"conversation": {"id": "conv123", "conversationType": "personal"},
"recipient": {"id": "bot456", "name": "Test Bot"},
"text": "Hello bot, how are you?",
"locale": "en-US"
})
print(f"Incoming Activity Text: {incoming_activity.text}")
print(f"Incoming Activity Sender: {incoming_activity.from_property.name}")
# Create a reply activity using the incoming activity's context
reply_activity = incoming_activity.create_reply("Hello there, Test User! I'm doing well, thanks for asking.")
print(f"\nReply Activity Type: {reply_activity.type}")
print(f"Reply Activity Text: {reply_activity.text}")
print(f"Reply Activity Recipient: {reply_activity.recipient.name}")
print(f"Reply Activity To ID: {reply_activity.reply_to_id}")
if __name__ == "__main__":
# Example of setting an environment variable for demonstration
os.environ['TEST_CHANNEL_ID'] = 'mock_channel_001'
asyncio.run(main())
Debug
Known issues
gotchaThe `microsoft-agents-activity` library defines the protocol (types and schemas) for interactions, but it does not provide agent hosting or core logic. To build a runnable AI agent, you must use additional packages from the Microsoft 365 Agents SDK, such as `microsoft-agents-hosting-aiohttp` for web hosting and `microsoft_agents.hosting.core.AgentApplication` for agent logic.fixEnsure you install and configure a hosting package (e.g., `microsoft-agents-hosting-aiohttp`) and implement your agent logic using `AgentApplication` or similar classes from the broader SDK.
affects: All versions
gotchaThe `microsoft-agents-hosting` SDK (which works with `microsoft-agents-activity` objects) does not fully support the `updateActivity` pattern commonly found in Bot Framework. Attempts to use `context.updateActivity()` will likely fail with a `TypeError: activity.applyConversationReference is not a function`.fixAs a workaround, instead of updating an existing activity (e.g., a 'thinking...' message), send a new activity (e.g., delete the 'thinking' message and send the final response). Monitor official documentation and GitHub issues for future support.
affects: < 1.0.0 of microsoft-agents-hosting (and related SDK components)
breakingThe broader Microsoft Agent Framework, of which `microsoft-agents-activity` is a part, has announced a v1.0 release as of April 2, 2026. Additionally, the Agent registry and Agent collections blades in the Entra admin center are being retired on May 1, 2026, with Agent 365 becoming the unified registry. The existing registry Graph API will be deprecated and replaced.fixWhile `microsoft-agents-activity` is still at 0.8.0, anticipate potential breaking changes in future minor or major releases to align with the framework's 1.0 status. For agent management, review `Agent 365` documentation for re-registration procedures if you are using the deprecated Entra admin center features.
affects: All pre-1.0 versions of `microsoft-agents-activity` and related SDK components. Impacts agent deployment and management.
gotchaSome advanced features and quickstarts related to the Microsoft 365 Agents SDK (e.g., specific Agent 365 capabilities) might require participation in the 'Frontier preview program'. This means not all documented features may be immediately available or stable for general production use.fixCheck the prerequisites for any advanced features you plan to use and verify access to preview programs if necessary.
affects: All versions, depending on the specific feature.
Upgrade
Version history
1.0.0latest on PyPI · released May 22, 2026
Audit
Dependencies
aiohttpoptionalRequired for web hosting a functional agent built with the Microsoft 365 Agents SDK, which utilizes `microsoft-agents-activity` types.
azure-identityoptionalNeeded for authentication when creating agents that interact with Azure AI services, a common use case within the broader Microsoft Agent Framework.