Skip to content

Commit 629dd48

Browse files
cleemullinsChris Mullins
andauthored
Author Readme files for each library and integrate into the PyPi descriptions. Fixes #156 (#157)
* Author Readme files for each library and integrate those into the long descriptions. Those descriptions should show up in PyPi. This is following thie guidance found on Python Packaging here: https://packaging.python.org/en/latest/guides/making-a-pypi-friendly-readme/ * Add long description to setup.py for PyPi compatibility * Fix formatting in setup.py by removing unnecessary line breaks in setup parameters * Remove long description from setup.py and ensure readme is specified in pyproject.toml for PyPi compatibility Lean into the newer PEP 621 metadata approach we're already using, rather than using the older long_description approach. * Add readme specification to pyproject.toml for all libraries and remove long description from setup.py * Revert setup.py changes - restore to main branch state * Enhance README files across multiple libraries to include comprehensive SDK descriptions, package overviews, and sample application links for improved developer guidance. * Review all sample code, remove AI written sample code. Simplify readme's for maintainability. * Removed erronous class * Added in a "This library is still evolving" message. --------- Co-authored-by: Chris Mullins <[email protected]>
1 parent 45bce82 commit 629dd48

File tree

16 files changed

+966
-0
lines changed

16 files changed

+966
-0
lines changed

libraries/microsoft-agents-activity/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ build-backend = "setuptools.build_meta"
66
name = "microsoft-agents-activity"
77
dynamic = ["version"]
88
description = "A protocol library for Microsoft Agents"
9+
readme = {file = "readme.md", content-type = "text/markdown"}
910
authors = [{name = "Microsoft Corporation"}]
1011
license = "MIT"
1112
license-files = ["LICENSE"]
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Microsoft Agents Activity
2+
3+
[![PyPI version](https://img.shields.io/pypi/v/microsoft-agents-activity)](https://pypi.org/project/microsoft-agents-activity/)
4+
5+
Core types and schemas for building conversational AI agents that work across Microsoft 365 platforms like Teams, Copilot Studio, and Webchat.
6+
7+
# What is this?
8+
9+
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.
10+
11+
## Packages Overview
12+
13+
We offer the following PyPI packages to create conversational experiences based on Agents:
14+
15+
| Package Name | PyPI Version | Description |
16+
|--------------|-------------|-------------|
17+
| `microsoft-agents-activity` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-activity)](https://pypi.org/project/microsoft-agents-activity/) | Types and validators implementing the Activity protocol spec. |
18+
| `microsoft-agents-hosting-core` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-hosting-core)](https://pypi.org/project/microsoft-agents-hosting-core/) | Core library for Microsoft Agents hosting. |
19+
| `microsoft-agents-hosting-aiohttp` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-hosting-aiohttp)](https://pypi.org/project/microsoft-agents-hosting-aiohttp/) | Configures aiohttp to run the Agent. |
20+
| `microsoft-agents-hosting-teams` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-hosting-teams)](https://pypi.org/project/microsoft-agents-hosting-teams/) | Provides classes to host an Agent for Teams. |
21+
| `microsoft-agents-storage-blob` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-storage-blob)](https://pypi.org/project/microsoft-agents-storage-blob/) | Extension to use Azure Blob as storage. |
22+
| `microsoft-agents-storage-cosmos` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-storage-cosmos)](https://pypi.org/project/microsoft-agents-storage-cosmos/) | Extension to use CosmosDB as storage. |
23+
| `microsoft-agents-authentication-msal` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-authentication-msal)](https://pypi.org/project/microsoft-agents-authentication-msal/) | MSAL-based authentication for Microsoft Agents. |
24+
25+
Additionally we provide a Copilot Studio Client, to interact with Agents created in CopilotStudio:
26+
27+
| Package Name | PyPI Version | Description |
28+
|--------------|-------------|-------------|
29+
| `microsoft-agents-copilotstudio-client` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-copilotstudio-client)](https://pypi.org/project/microsoft-agents-copilotstudio-client/) | Direct to Engine client to interact with Agents created in CopilotStudio |
30+
31+
## Architecture
32+
33+
The SDK follows a modular architecture:
34+
- **Activity Layer**: Protocol definitions for cross-platform messaging
35+
- **Hosting Layer**: Core agent lifecycle, middleware, and web hosting
36+
- **Storage Layer**: Persistent state management with Azure backends
37+
- **Authentication Layer**: Secure identity and token management
38+
- **Integration Layer**: Platform-specific adapters (Teams, Copilot Studio)
39+
40+
## Installation
41+
42+
```bash
43+
pip install microsoft-agents-activity
44+
```
45+
46+
## Quick Start
47+
Code below taken from the [Quick Start](https://github.com/microsoft/Agents/tree/main/samples/python/quickstart) sample.
48+
```python
49+
@AGENT_APP.conversation_update("membersAdded")
50+
async def on_members_added(context: TurnContext, _state: TurnState):
51+
await context.send_activity(
52+
"Welcome to the empty agent! "
53+
"This agent is designed to be a starting point for your own agent development."
54+
)
55+
return True
56+
57+
58+
@AGENT_APP.message(re.compile(r"^hello$"))
59+
async def on_hello(context: TurnContext, _state: TurnState):
60+
await context.send_activity("Hello!")
61+
62+
63+
@AGENT_APP.activity("message")
64+
async def on_message(context: TurnContext, _state: TurnState):
65+
await context.send_activity(f"you said: {context.activity.text}")
66+
```
67+
68+
## Common Use Cases
69+
70+
### Rich Messages with Cards
71+
Code below taken from the [Cards](https://github.com/microsoft/Agents/tree/main/samples/python/cards) sample.
72+
73+
74+
```python
75+
@staticmethod
76+
async def send_animation_card(context: TurnContext):
77+
card = CardFactory.animation_card(
78+
AnimationCard(
79+
title="Microsoft Agents Framework",
80+
image=ThumbnailUrl(
81+
url="https://i.giphy.com/Ki55RUbOV5njy.gif", alt="Cute Robot"
82+
),
83+
media=[MediaUrl(url="https://i.giphy.com/Ki55RUbOV5njy.gif")],
84+
subtitle="Animation Card",
85+
text="This is an example of an animation card using a gif.",
86+
aspect="16:9",
87+
duration="PT2M",
88+
)
89+
)
90+
await CardMessages.send_activity(context, card)
91+
92+
@staticmethod
93+
async def send_activity(context: TurnContext, card: Attachment):
94+
activity = Activity(type=ActivityTypes.message, attachments=[card])
95+
await context.send_activity(activity)
96+
```
97+
98+
## Activity Types
99+
100+
The library supports different types of communication:
101+
102+
- **Message** - Regular chat messages with text, cards, attachments
103+
- **Typing** - Show typing indicators
104+
- **ConversationUpdate** - People joining/leaving chats
105+
- **Event** - Custom events and notifications
106+
- **Invoke** - Direct function calls
107+
- **EndOfConversation** - End chat sessions
108+
109+
## Key Features
110+
111+
**Type-safe** - Built with Pydantic for automatic validation
112+
**Rich content** - Support for cards, images, videos, and interactive elements
113+
**Teams ready** - Full Microsoft Teams integration
114+
**Cross-platform** - Works across all Microsoft 365 chat platforms
115+
**Migration friendly** - Easy upgrade from Bot Framework
116+
117+
# Quick Links
118+
119+
- 📦 [All SDK Packages on PyPI](https://pypi.org/search/?q=microsoft-agents)
120+
- 📖 [Complete Documentation](https://aka.ms/agents)
121+
- 💡 [Python Samples Repository](https://github.com/microsoft/Agents/tree/main/samples/python)
122+
- 🐛 [Report Issues](https://github.com/microsoft/Agents-for-python/issues)
123+
124+
# Sample Applications
125+
Explore working examples in the [Python samples repository](https://github.com/microsoft/Agents/tree/main/samples/python):
126+
127+
|Name|Description|README|
128+
|----|----|----|
129+
|Quickstart|Simplest agent|[Quickstart](https://github.com/microsoft/Agents/blob/main/samples/python/quickstart/README.md)|
130+
|Auto Sign In|Simple OAuth agent using Graph and GitHub|[auto-signin](https://github.com/microsoft/Agents/blob/main/samples/python/auto-signin/README.md)|
131+
|OBO Authorization|OBO flow to access a Copilot Studio Agent|[obo-authorization](https://github.com/microsoft/Agents/blob/main/samples/python/obo-authorization/README.md)|
132+
|Semantic Kernel Integration|A weather agent built with Semantic Kernel|[semantic-kernel-multiturn](https://github.com/microsoft/Agents/blob/main/samples/python/semantic-kernel-multiturn/README.md)|
133+
|Streaming Agent|Streams OpenAI responses|[azure-ai-streaming](https://github.com/microsoft/Agents/blob/main/samples/python/azureai-streaming/README.md)|
134+
|Copilot Studio Client|Console app to consume a Copilot Studio Agent|[copilotstudio-client](https://github.com/microsoft/Agents/blob/main/samples/python/copilotstudio-client/README.md)|
135+
|Cards Agent|Agent that uses rich cards to enhance conversation design |[cards](https://github.com/microsoft/Agents/blob/main/samples/python/cards/README.md)|

libraries/microsoft-agents-authentication-msal/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ build-backend = "setuptools.build_meta"
66
name = "microsoft-agents-authentication-msal"
77
dynamic = ["version", "dependencies"]
88
description = "A msal-based authentication library for Microsoft Agents"
9+
readme = {file = "readme.md", content-type = "text/markdown"}
910
authors = [{name = "Microsoft Corporation"}]
1011
license = "MIT"
1112
license-files = ["LICENSE"]
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Microsoft Agents MSAL Authentication
2+
3+
[![PyPI version](https://img.shields.io/pypi/v/microsoft-agents-authentication-msal)](https://pypi.org/project/microsoft-agents-authentication-msal/)
4+
5+
Provides secure authentication for your agents using Microsoft Authentication Library (MSAL). It handles getting tokens from Azure AD so your agent can securely communicate with Microsoft services like Teams, Graph API, and other Azure resources.
6+
7+
# What is this?
8+
9+
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.
10+
11+
## Packages Overview
12+
13+
We offer the following PyPI packages to create conversational experiences based on Agents:
14+
15+
| Package Name | PyPI Version | Description |
16+
|--------------|-------------|-------------|
17+
| `microsoft-agents-activity` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-activity)](https://pypi.org/project/microsoft-agents-activity/) | Types and validators implementing the Activity protocol spec. |
18+
| `microsoft-agents-hosting-core` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-hosting-core)](https://pypi.org/project/microsoft-agents-hosting-core/) | Core library for Microsoft Agents hosting. |
19+
| `microsoft-agents-hosting-aiohttp` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-hosting-aiohttp)](https://pypi.org/project/microsoft-agents-hosting-aiohttp/) | Configures aiohttp to run the Agent. |
20+
| `microsoft-agents-hosting-teams` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-hosting-teams)](https://pypi.org/project/microsoft-agents-hosting-teams/) | Provides classes to host an Agent for Teams. |
21+
| `microsoft-agents-storage-blob` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-storage-blob)](https://pypi.org/project/microsoft-agents-storage-blob/) | Extension to use Azure Blob as storage. |
22+
| `microsoft-agents-storage-cosmos` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-storage-cosmos)](https://pypi.org/project/microsoft-agents-storage-cosmos/) | Extension to use CosmosDB as storage. |
23+
| `microsoft-agents-authentication-msal` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-authentication-msal)](https://pypi.org/project/microsoft-agents-authentication-msal/) | MSAL-based authentication for Microsoft Agents. |
24+
25+
Additionally we provide a Copilot Studio Client, to interact with Agents created in CopilotStudio:
26+
27+
| Package Name | PyPI Version | Description |
28+
|--------------|-------------|-------------|
29+
| `microsoft-agents-copilotstudio-client` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-copilotstudio-client)](https://pypi.org/project/microsoft-agents-copilotstudio-client/) | Direct to Engine client to interact with Agents created in CopilotStudio |
30+
31+
## Installation
32+
33+
```bash
34+
pip install microsoft-agents-authentication-msal
35+
```
36+
37+
## Quick Start
38+
39+
### Basic Setup with Client Secret
40+
41+
Define your client secrets in the ENV file
42+
```python
43+
CONNECTIONS__SERVICE_CONNECTION__SETTINGS__CLIENTID=client-id
44+
CONNECTIONS__SERVICE_CONNECTION__SETTINGS__CLIENTSECRET=client-secret
45+
CONNECTIONS__SERVICE_CONNECTION__SETTINGS__TENANTID=tenant-id
46+
```
47+
48+
Load the Configuration (Code from [main.py Quickstart Sample](https://github.com/microsoft/Agents/blob/main/samples/python/quickstart/src/main.py))
49+
50+
```python
51+
from .start_server import start_server
52+
53+
start_server(
54+
agent_application=AGENT_APP,
55+
auth_configuration=CONNECTION_MANAGER.get_default_connection_configuration(),
56+
)
57+
```
58+
Then start the Agent (code snipped from (start_server.py Quickstart Sample](https://github.com/microsoft/Agents/blob/main/samples/python/quickstart/src/start_server.py)):
59+
60+
```python
61+
def start_server(
62+
agent_application: AgentApplication, auth_configuration: AgentAuthConfiguration
63+
):
64+
async def entry_point(req: Request) -> Response:
65+
agent: AgentApplication = req.app["agent_app"]
66+
adapter: CloudAdapter = req.app["adapter"]
67+
return await start_agent_process(
68+
req,
69+
agent,
70+
adapter,
71+
)
72+
[...]
73+
```
74+
75+
## Authentication Types
76+
The M365 Agents SDK in Python supports the following Auth types:
77+
```python
78+
class AuthTypes(str, Enum):
79+
certificate = "certificate"
80+
certificate_subject_name = "CertificateSubjectName"
81+
client_secret = "ClientSecret"
82+
user_managed_identity = "UserManagedIdentity"
83+
system_managed_identity = "SystemManagedIdentity"
84+
```
85+
86+
## Key Classes
87+
88+
- **`MsalAuth`** - Core authentication provider using MSAL
89+
- **`MsalConnectionManager`** - Manages multiple authentication connections
90+
91+
## Features
92+
93+
**Multiple auth types** - Client secret, certificate, managed identity
94+
**Token caching** - Automatic token refresh and caching
95+
**Multi-tenant** - Support for different Azure AD tenants
96+
**Agent-to-agent** - Secure communication between agents
97+
**On-behalf-of** - Act on behalf of users
98+
99+
# Security Best Practices
100+
101+
- Store secrets in Azure Key Vault or environment variables
102+
- Use managed identities when possible (no secrets to manage)
103+
- Regularly rotate client secrets and certificates
104+
- Use least-privilege principle for scopes and permissions
105+
106+
# Quick Links
107+
108+
- 📦 [All SDK Packages on PyPI](https://pypi.org/search/?q=microsoft-agents)
109+
- 📖 [Complete Documentation](https://aka.ms/agents)
110+
- 💡 [Python Samples Repository](https://github.com/microsoft/Agents/tree/main/samples/python)
111+
- 🐛 [Report Issues](https://github.com/microsoft/Agents-for-python/issues)
112+
113+
# Sample Applications
114+
115+
w

libraries/microsoft-agents-copilotstudio-client/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ build-backend = "setuptools.build_meta"
66
name = "microsoft-agents-copilotstudio-client"
77
dynamic = ["version", "dependencies"]
88
description = "A client library for Microsoft Agents"
9+
readme = {file = "readme.md", content-type = "text/markdown"}
910
authors = [{name = "Microsoft Corporation"}]
1011
license = "MIT"
1112
license-files = ["LICENSE"]

0 commit comments

Comments
 (0)