Skip to content

Commit a04d0be

Browse files
authored
Merge branch 'main' into mehak/botbuilder
2 parents f615b8b + 4454bac commit a04d0be

File tree

57 files changed

+1187
-722
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1187
-722
lines changed

.github/copilot-instructions.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Microsoft Teams AI Library for Python
1+
# Microsoft Teams SDK for Python
22

3-
Microsoft Teams AI Library for Python is a comprehensive SDK for building Microsoft Teams applications, bots, and AI agents using Python. This is a monorepo with workspace structure containing core packages and test applications.
3+
Microsoft Teams SDK for Python is a comprehensive SDK for building Microsoft Teams applications, bots, and AI agents using Python. This is a monorepo with workspace structure containing core packages and test applications.
44

55
**Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.**
66

@@ -23,10 +23,10 @@ Microsoft Teams AI Library for Python is a comprehensive SDK for building Micros
2323
```bash
2424
# On Linux/Mac
2525
source .venv/bin/activate
26-
26+
2727
# On Windows
2828
.venv\Scripts\Activate
29-
29+
3030
# Alternative: Use uv run (no activation needed)
3131
# Example: uv run pytest packages
3232
```
@@ -89,15 +89,15 @@ Microsoft Teams AI Library for Python is a comprehensive SDK for building Micros
8989
```bash
9090
# These commands must pass:
9191
ruff format --check # Format validation
92-
ruff check # Linting validation
92+
ruff check # Linting validation
9393
pyright # Type checking validation
9494
```
9595

9696
## Repository Structure and Navigation
9797

9898
### Core Packages (`/packages`)
9999
- **microsoft-teams-apps**: Main application framework
100-
- **microsoft-teams-ai**: AI integration functionality
100+
- **microsoft-teams-ai**: AI integration functionality
101101
- **microsoft-teams-api**: Teams API client
102102
- **microsoft-teams-cards**: Adaptive cards support
103103
- **microsoft-teams-common**: Shared utilities
@@ -153,7 +153,7 @@ The CI pipeline (`.github/workflows/ci.yml`) runs:
153153

154154
### Common Problems
155155
- **Import errors**: Ensure virtual environment is activated (`source .venv/bin/activate`) or use `uv run` commands
156-
- **UV not found**: Install with pip: `python -m pip install uv`
156+
- **UV not found**: Install with pip: `python -m pip install uv`
157157
- **Test failures**: Run `uv sync --all-packages --group dev` to update dependencies
158158
- **Type errors**: Run `pyright` to catch type issues before CI
159159
- **Format issues**: Run `ruff format` to auto-fix formatting
@@ -163,7 +163,7 @@ The CI pipeline (`.github/workflows/ci.yml`) runs:
163163

164164
- **NEVER CANCEL builds or tests** - Commands complete in 3-18 seconds but network delays may occur
165165
- **ALWAYS use timeouts of 60+ seconds** for any UV or build commands
166-
- **ALWAYS activate virtual environment or use uv run** before running Python commands
166+
- **ALWAYS activate virtual environment or use uv run** before running Python commands
167167
- **ALWAYS validate with a test app** after making changes to core packages
168168
- **ALWAYS run pre-commit validation** (`poe check && pyright`) before committing
169169
- **NEVER skip manual testing** - Automated tests don't cover integration scenarios
@@ -175,7 +175,7 @@ The CI pipeline (`.github/workflows/ci.yml`) runs:
175175
.
176176
├── .github/ # GitHub workflows and configs
177177
├── packages/ # Core SDK packages
178-
├── tests/ # Test applications
178+
├── tests/ # Test applications
179179
├── templates/ # Cookiecutter templates
180180
├── scripts/ # Build and release scripts
181181
├── pyproject.toml # Workspace and tool configuration

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.12
1+
3.13

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Please refer to this sub-module's root repo Contributing guide at [Teams AI v2 Contributing](https://github.com/microsoft/teams-ai/blob/v2-preview/CONTRIBUTING.md)
1+
Please refer to this sub-module's root repo Contributing guide at [Teams SDK Contributing](https://github.com/microsoft/teams-ai/blob/main/CONTRIBUTING.md)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
> [!CAUTION]
22
> This project is in public preview. We’ll do our best to maintain compatibility, but there may be breaking changes in upcoming releases.
33
4-
# Microsoft Teams AI Library for Python
4+
# Microsoft Teams SDK for Python
55

66
A comprehensive SDK for building Microsoft Teams applications, bots, and AI agents using Python. This SDK provides a high-level framework with built-in Microsoft Graph integration, OAuth handling, and extensible plugin architecture.
77

8-
<a href="https://microsoft.github.io/teams-ai" target="_blank">
8+
<a href="https://microsoft.github.io/teams-sdk" target="_blank">
99
<img src="https://img.shields.io/badge/📖 Getting Started-blue?style=for-the-badge" />
1010
</a>
1111

@@ -91,7 +91,7 @@ cookiecutter templates/test -o tests
9191
> ⚠️ **WARNING** these apps are changed often and are not intended to be used outside the
9292
> projects monorepo. To easily setup a new project please use the **templates** available via
9393
> the [@microsoft/teams.cli](https://www.npmjs.com/package/@microsoft/teams.cli) and follow the
94-
> [Getting Started](https://microsoft.github.io/teams-ai/python/getting-started) documentation!
94+
> [Getting Started](https://microsoft.github.io/teams-sdk/python/getting-started) documentation!
9595
9696
- [`@tests/echo`](./tests/echo/README.md)
9797
- [`@tests/message-extensions`](./tests/message-extensions/README.md)

SUPPORT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This project uses GitHub Issues to track bugs and feature requests. Please searc
66
issues before filing new issues to avoid duplicates. For new issues, file your bug or
77
feature request as a new Issue.
88

9-
For help and questions about using this project, please join our [Teams AI Teams channel](https://teams.microsoft.com/l/channel/19%3A4PLRDRT5qVLpvXpfIHnoNohFElTC0aDzsNwfI0KHDxo1%40thread.tacv2/Support?groupId=1314f851-c930-4caa-b3e0-dbe9b8fe2737&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47)
9+
For help and questions about using this project, please join our [Teams SDK Teams channel](https://teams.microsoft.com/l/channel/19%3A4PLRDRT5qVLpvXpfIHnoNohFElTC0aDzsNwfI0KHDxo1%40thread.tacv2/Support?groupId=1314f851-c930-4caa-b3e0-dbe9b8fe2737&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47)
1010

1111
## Microsoft Support Policy
1212

packages/a2aprotocol/README.md

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,65 @@
77
<a href="https://pypi.org/project/microsoft-teams-a2a" target="_blank">
88
<img src="https://img.shields.io/pypi/dw/microsoft-teams-a2a" />
99
</a>
10+
<a href="https://microsoft.github.io/teams-sdk" target="_blank">
11+
<img src="https://img.shields.io/badge/📖 Getting Started-blue?style=for-the-badge" />
12+
</a>
1013
</p>
11-
<a href="https://microsoft.github.io/teams-ai" target="_blank">
12-
<img src="https://img.shields.io/badge/📖 Getting Started-blue?style=for-the-badge" />
13-
</a>
14+
15+
Agent-to-Agent (A2A) protocol support for Microsoft Teams AI applications.
16+
Enables Teams agents to communicate and collaborate with other AI agents using standardized protocols.
17+
18+
## Installation
19+
20+
```bash
21+
uv add microsoft-teams-a2a
22+
```
23+
24+
## Usage
25+
26+
### A2A Server (Expose Agent)
27+
28+
```python
29+
from microsoft.teams.apps import App
30+
from microsoft.teams.a2a import A2APlugin, A2APluginOptions
31+
from a2a.types import AgentCard, AgentCapabilities
32+
33+
app = App()
34+
35+
# Define agent card with capabilities
36+
agent_card = AgentCard(
37+
name="weather_agent",
38+
description="An agent that can tell you the weather",
39+
url="http://localhost:4000/a2a/",
40+
version="0.0.1",
41+
protocol_version="0.3.0",
42+
capabilities=AgentCapabilities(),
43+
default_input_modes=[],
44+
default_output_modes=[]
45+
)
46+
47+
a2a_server = A2APlugin(A2APluginOptions(agent_card=agent_card))
48+
app = App(plugins=[a2a_server])
49+
```
50+
51+
### A2A Client (Use Other Agents)
52+
53+
```python
54+
from microsoft.teams.a2a import A2AClientPlugin, A2APluginUseParams
55+
from microsoft.teams.ai import ChatPrompt
56+
from microsoft.teams.openai import OpenAICompletionsAIModel
57+
58+
model = OpenAICompletionsAIModel(api_key="your-api-key", model="gpt-4")
59+
60+
# Connect to another A2A agent
61+
a2a_client = A2AClientPlugin()
62+
a2a_client.on_use_plugin(
63+
A2APluginUseParams(
64+
key="my-weather-agent",
65+
base_url="http://localhost:4000/a2a",
66+
card_url=".well-known/agent-card.json"
67+
)
68+
)
69+
70+
prompt = ChatPrompt(model, plugins=[a2a_client])
71+
```

packages/a2aprotocol/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[project]
22
name = "microsoft-teams-a2a"
3-
version = "2.0.0a4"
3+
version = "2.0.0a5"
44
description = "plugin that enables your teams agent to be used as an a2a agent"
55
authors = [{ name = "Microsoft", email = "[email protected]" }]
66
readme = "README.md"
7-
requires-python = ">=3.12"
7+
requires-python = ">=3.12,<3.14"
88
repository = "https://github.com/microsoft/teams.py"
99
keywords = ["microsoft", "teams", "ai", "bot", "agents"]
1010
license = "MIT"

packages/ai/README.md

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Microsoft Teams AI
1+
# Microsoft Teams SDK
22

33
<p>
44
<a href="https://pypi.org/project/microsoft-teams-ai/" target="_blank">
@@ -7,10 +7,57 @@
77
<a href="https://pypi.org/project/microsoft-teams-ai/" target="_blank">
88
<img src="https://img.shields.io/pypi/dw/microsoft-teams-ai" />
99
</a>
10+
<a href="https://microsoft.github.io/teams-sdk" target="_blank">
11+
<img src="https://img.shields.io/badge/📖 Getting Started-blue?style=for-the-badge" />
12+
</a>
1013
</p>
1114

12-
AI tools and utilities.
15+
AI-powered conversational experiences for Microsoft Teams applications.
16+
Provides prompt management, action planning, and model integration for building intelligent Teams bots.
17+
18+
[📖 Documentation](https://microsoft.github.io/teams-sdk/python/in-depth-guides/ai/)
19+
20+
## Installation
21+
22+
```bash
23+
uv add microsoft-teams-ai
24+
```
25+
26+
## Usage
27+
28+
### ChatPrompt
29+
30+
```python
31+
from microsoft.teams.ai import ChatPrompt, Function
32+
from microsoft.teams.openai import OpenAICompletionsAIModel
33+
from pydantic import BaseModel
34+
35+
model = OpenAICompletionsAIModel(api_key="your-api-key", model="gpt-4")
36+
37+
# Create a ChatPrompt
38+
prompt = ChatPrompt(model)
39+
40+
result = await prompt.send(
41+
input="Hello!",
42+
instructions="You are a helpful assistant."
43+
)
44+
```
45+
46+
### Function Calling
47+
48+
```python
49+
class GetWeatherParams(BaseModel):
50+
location: str
51+
52+
async def get_weather(params: GetWeatherParams) -> str:
53+
return f"The weather in {params.location} is sunny"
54+
55+
weather_function = Function(
56+
name="get_weather",
57+
description="Get weather for a location",
58+
parameter_schema=GetWeatherParams,
59+
handler=get_weather
60+
)
1361

14-
<a href="https://microsoft.github.io/teams-ai" target="_blank">
15-
<img src="https://img.shields.io/badge/📖 Getting Started-blue?style=for-the-badge" />
16-
</a>
62+
prompt = ChatPrompt(model, functions=[weather_function])
63+
```

packages/ai/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[project]
22
name = "microsoft-teams-ai"
3-
version = "2.0.0a4"
3+
version = "2.0.0a5"
44
description = "package to handle interacting with ai or llms"
55
authors = [{ name = "Microsoft", email = "[email protected]" }]
66
readme = "README.md"
7-
requires-python = ">=3.12"
7+
requires-python = ">=3.12,<3.14"
88
repository = "https://github.com/microsoft/teams.py"
99
keywords = ["microsoft", "teams", "ai", "bot", "agents"]
1010
license = "MIT"

packages/ai/src/microsoft/teams/ai/ai_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class AIModel(Protocol):
1717
Protocol defining the interface for AI models that can generate text responses.
1818
1919
This protocol standardizes how different AI providers (OpenAI, Azure OpenAI, etc.)
20-
integrate with the Teams AI framework. Implementations should handle message
20+
integrate with the Teams SDK. Implementations should handle message
2121
processing, function calling, and optional streaming.
2222
"""
2323

0 commit comments

Comments
 (0)