A protocol library for Microsoft Agents
Project description
Microsoft Agents Activity
Core types and schemas for building conversational AI agents that work across Microsoft 365 platforms like Teams, Copilot Studio, and Webchat.
What is this?
This library is part of the Microsoft 365 Agents SDK for Python - a comprehensive framework for building enterprise-grade conversational AI agents. The SDK enables developers to create intelligent agents that work across multiple platforms including Microsoft Teams, M365 Copilot, Copilot Studio, and web chat, with support for third-party integrations like Slack, Facebook Messenger, and Twilio.
Release Notes
| Version | Date | Release Notes |
|---|---|---|
| 0.5.0 | 2025-10-22 | 0.5.0 Release Notes |
Packages Overview
We offer the following PyPI packages to create conversational experiences based on Agents:
Additionally we provide a Copilot Studio Client, to interact with Agents created in CopilotStudio:
| Package Name | PyPI Version | Description |
|---|---|---|
microsoft-agents-copilotstudio-client |
Direct to Engine client to interact with Agents created in CopilotStudio |
Architecture
The SDK follows a modular architecture:
- Activity Layer: Protocol definitions for cross-platform messaging
- Hosting Layer: Core agent lifecycle, middleware, and web hosting
- Storage Layer: Persistent state management with Azure backends
- Authentication Layer: Secure identity and token management
- Integration Layer: Platform-specific adapters (Teams, Copilot Studio)
Installation
pip install microsoft-agents-activity
Quick Start
Code below taken from the Quick Start sample.
@AGENT_APP.conversation_update("membersAdded")
async def on_members_added(context: TurnContext, _state: TurnState):
await context.send_activity(
"Welcome to the empty agent! "
"This agent is designed to be a starting point for your own agent development."
)
return True
@AGENT_APP.message(re.compile(r"^hello$"))
async def on_hello(context: TurnContext, _state: TurnState):
await context.send_activity("Hello!")
@AGENT_APP.activity("message")
async def on_message(context: TurnContext, _state: TurnState):
await context.send_activity(f"you said: {context.activity.text}")
Common Use Cases
Rich Messages with Cards
Code below taken from the Cards sample.
@staticmethod
async def send_animation_card(context: TurnContext):
card = CardFactory.animation_card(
AnimationCard(
title="Microsoft Agents Framework",
image=ThumbnailUrl(
url="https://i.giphy.com/Ki55RUbOV5njy.gif", alt="Cute Robot"
),
media=[MediaUrl(url="https://i.giphy.com/Ki55RUbOV5njy.gif")],
subtitle="Animation Card",
text="This is an example of an animation card using a gif.",
aspect="16:9",
duration="PT2M",
)
)
await CardMessages.send_activity(context, card)
@staticmethod
async def send_activity(context: TurnContext, card: Attachment):
activity = Activity(type=ActivityTypes.message, attachments=[card])
await context.send_activity(activity)
Activity Types
The library supports different types of communication:
- Message - Regular chat messages with text, cards, attachments
- Typing - Show typing indicators
- ConversationUpdate - People joining/leaving chats
- Event - Custom events and notifications
- Invoke - Direct function calls
- EndOfConversation - End chat sessions
Key Features
✅ Type-safe - Built with Pydantic for automatic validation
✅ Rich content - Support for cards, images, videos, and interactive elements
✅ Teams ready - Full Microsoft Teams integration
✅ Cross-platform - Works across all Microsoft 365 chat platforms
✅ Migration friendly - Easy upgrade from Bot Framework
Quick Links
Sample Applications
Explore working examples in the Python samples repository:
| Name | Description | README |
|---|---|---|
| Quickstart | Simplest agent | Quickstart |
| Auto Sign In | Simple OAuth agent using Graph and GitHub | auto-signin |
| OBO Authorization | OBO flow to access a Copilot Studio Agent | obo-authorization |
| Semantic Kernel Integration | A weather agent built with Semantic Kernel | semantic-kernel-multiturn |
| Streaming Agent | Streams OpenAI responses | azure-ai-streaming |
| Copilot Studio Client | Console app to consume a Copilot Studio Agent | copilotstudio-client |
| Cards Agent | Agent that uses rich cards to enhance conversation design | cards |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file microsoft_agents_activity-0.6.1.tar.gz.
File metadata
- Download URL: microsoft_agents_activity-0.6.1.tar.gz
- Upload date:
- Size: 57.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: RestSharp/106.13.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
744f16ae73ddc22315880b8ae94d8909da8aee25128cc85106591c593e6bdab9
|
|
| MD5 |
5807ea8d57a3368e20b6cb955bcbee5d
|
|
| BLAKE2b-256 |
738ed19b8e9a595058b915f3bd65ba0d2d16b366ffe63bba57699e9cc15d722b
|
File details
Details for the file microsoft_agents_activity-0.6.1-py3-none-any.whl.
File metadata
- Download URL: microsoft_agents_activity-0.6.1-py3-none-any.whl
- Upload date:
- Size: 131.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: RestSharp/106.13.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca5b86bf6e1e9ebe31836031b0aad5726c8112734cfe20ce8144603fa6edfbfa
|
|
| MD5 |
6957a65c72804d39c5cec99091c44333
|
|
| BLAKE2b-256 |
c937327604224d546a7148a1b67ae7929f67aa3be0efad896b36c753b54a632f
|