Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 65 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,58 @@

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.

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

- [Getting Started](#getting-started)
- [Packages](#packages)
- [Test Apps](#test-apps)
- [Links](#links)

## Getting Started

### Prerequisites

Note: Ensure uv version is >= 0.8.11
Install [uv](https://docs.astral.sh/uv/getting-started/installation/)

### Installing
- UV version is >= 0.8.11. Install and upgrade from [docs.astral.sh/uv](https://docs.astral.sh/uv/getting-started/installation/).
- Python version is >= 3.12. Install or upgrade from [python.org/downloads](https://www.python.org/downloads/).

1. `uv sync --all-packages --group dev` - it installs the virtual env and dependencies
- If you are using Windows, you may need to manually install [cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html)
2. Activate virtual env
### Installation

- Mac: `source .venv/bin/activate`
- Windows: `.venv\Scripts\Activate`
#### 1. Install the dependencies.
```bash
uv sync --all-packages --group dev
```

#### 2. Activate the virtual env
> **Note:** After the initial setup, you need to activate the virtual environment each time you start a new terminal session
```bash
# On Mac
`source .venv/bin/activate`

# On Windows
`.venv\Scripts\Activate`
```

3. Install pre-commit hooks: `pre-commit install`
#### 3. Install the pre-commit hooks
```bash
pre-commit install
```

## Creating a new package
## Packages

> ℹ️ core packages used to build client/server apps for Teams.

- [`microsoft-teams-apps`](./packages/apps/README.md)
- [`microsoft-teams-ai`](./packages/ai/README.md)
- [`microsoft-teams-api`](./packages/api/README.md)
- [`microsoft-teams-cards`](./packages/cards/README.md)
- [`microsoft-teams-common`](./packages/common/README.md)
- [`microsoft-teams-devtools`](./packages/devtools/README.md)
- [`microsoft-teams-graph`](./packages/graph/README.md)
- [`microsoft-teams-openai`](./packages/openai/README.md)
Comment on lines +48 to +57
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a huge fan of keeping lists like this, because they inevitably go out of sync. We can just point to the packages folder?


### Create a New Package

We use [cookiecutter](https://cookiecutter.readthedocs.io/en/latest/README.html) to create new packages. To create a new package, run:

Expand All @@ -35,10 +66,32 @@ cookiecutter templates/package -o packages

Follow the prompts to name the package and the directory. It should create the package folder in the `packages` directory.

## Creating a new test package
### Create A New Test Package

Similarly, to create a new test package, run:

```bash
cookiecutter templates/test -o tests
```

## Test Apps

> ℹ️ used to test the SDK or as a visual sample of how certain features can be implemented.

> ⚠️ **WARNING** these apps are changed often and are not intended to be used outside the
> projects monorepo. To easily setup a new project please use the **templates** available via
> the [@microsoft/teams.cli](https://www.npmjs.com/package/@microsoft/teams.cli) and follow the
> [Getting Started](https://microsoft.github.io/teams-ai/python/getting-started) documentation!

- [`@tests/echo`](./tests/echo/README.md)
- [`@tests/message-extensions`](./tests/message-extensions/README.md)
- [`@tests/dialogs`](./tests/dialogs/README.md)
- [`@tests/graph`](./tests/graph/README.md)
- [`@tests/ai-test`](./tests/ai-test/README.md)
- [`@tests/stream`](./tests/stream/README.md)
- [`@tests/oauth`](./tests/oauth/README.md)

## Links

- [Teams Developer Portal: Apps](https://dev.teams.microsoft.com/apps)
- [Teams Toolkit](https://www.npmjs.com/package/@microsoft/teamsapp-cli)
16 changes: 16 additions & 0 deletions packages/ai/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Microsoft Teams AI

<p>
<a href="https://www.npmjs.com/package/@microsoft/teams.api" target="_blank">
<img src="https://img.shields.io/pypi/v/microsoft-teams-ai" />
</a>
<a href="https://www.npmjs.com/package/@microsoft/teams.api" target="_blank">
<img src="https://img.shields.io/pypi/dw/microsoft-teams-ai" />
</a>
</p>

AI tools and utilities.

<a href="https://microsoft.github.io/teams-ai" target="_blank">
<img src="https://img.shields.io/badge/📖 Getting Started-blue?style=for-the-badge" />
</a>
14 changes: 14 additions & 0 deletions packages/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,23 @@
# Microsoft Teams API Client

<p>
<a href="https://www.npmjs.com/package/@microsoft/teams.api" target="_blank">
<img src="https://img.shields.io/pypi/v/microsoft-teams-api" />
</a>
<a href="https://www.npmjs.com/package/@microsoft/teams.api" target="_blank">
<img src="https://img.shields.io/pypi/dw/microsoft-teams-api" />
</a>
</p>

Core API client library for Microsoft Teams Bot Framework integration.
Provides HTTP clients, authentication, and typed models for Teams Bot Framework APIs.

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


## Features

- **API Clients**: Bot, User, Conversation, Team, and Meeting clients
Expand Down
15 changes: 14 additions & 1 deletion packages/apps/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
> [!CAUTION]
> This project is in active development and not ready for production use. It has not been publicly announced yet.
# Microsoft Teams App Framework
# Microsoft Teams Apps Framework

<p>
<a href="https://www.npmjs.com/package/@microsoft/teams.api" target="_blank">
<img src="https://img.shields.io/pypi/v/microsoft-teams-apps" />
</a>
<a href="https://www.npmjs.com/package/@microsoft/teams.api" target="_blank">
<img src="https://img.shields.io/pypi/dw/microsoft-teams-apps" />
</a>
</p>

High-level framework for building Microsoft Teams applications.
Handles activity routing, authentication, and provides Microsoft Graph integration.

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

## Features

- **Activity Routing**: Decorator-based routing for different activity types
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/src/microsoft/teams/apps/app_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def initialize_plugins(self, plugins: List[PluginBase]) -> List[PluginBase]:
if class_name != name:
self.container.set_provider(class_name, providers.Object(plugin))

self.logger.info("Successfully initialized all plugins")
self.logger.debug("Successfully initialized all plugins")
return self.plugins

def get_plugin(self, name: str) -> Optional[PluginBase]:
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/src/microsoft/teams/apps/http_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ async def _handle_activity_request(self, request: Request) -> Any:
activity_type = body.get("type", "unknown")
activity_id = body.get("id", "unknown")

self.logger.info(f"Received activity: {activity_type} (ID: {activity_id})")
self.logger.debug(f"Received activity: {activity_type} (ID: {activity_id})")

# Create Future for async response coordination
response_future = asyncio.get_event_loop().create_future()
Expand Down
13 changes: 13 additions & 0 deletions packages/cards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,22 @@
# Microsoft Teams Cards

<p>
<a href="https://www.npmjs.com/package/@microsoft/teams.api" target="_blank">
<img src="https://img.shields.io/pypi/v/microsoft-teams-cards" />
</a>
<a href="https://www.npmjs.com/package/@microsoft/teams.api" target="_blank">
<img src="https://img.shields.io/pypi/dw/microsoft-teams-cards" />
</a>
</p>

Adaptive Cards models and specialized action types for Microsoft Teams applications.
Provides Pydantic-based models for creating Adaptive Cards and Teams-specific actions.

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

## Features

- **Adaptive Card Models**: Pydantic models for Adaptive Card schema
Expand Down
13 changes: 13 additions & 0 deletions packages/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,22 @@
# Microsoft Teams Common Utilities

<p>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add these to the cookie cutter template too?

<a href="https://www.npmjs.com/package/@microsoft/teams.api" target="_blank">
<img src="https://img.shields.io/pypi/v/microsoft-teams-common" />
</a>
<a href="https://www.npmjs.com/package/@microsoft/teams.api" target="_blank">
<img src="https://img.shields.io/pypi/dw/microsoft-teams-common" />
</a>
</p>

Shared utilities including HTTP client, logging, storage, and event handling.
Provides common functionality used across other Teams SDK packages.

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

## Features

- **HTTP Client**: Async HTTP client with token support and interceptors
Expand Down
13 changes: 13 additions & 0 deletions packages/devtools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,21 @@
# Microsoft Teams DevTools

<p>
<a href="https://www.npmjs.com/package/@microsoft/teams.api" target="_blank">
<img src="https://img.shields.io/pypi/v/microsoft-teams-devtools" />
</a>
<a href="https://www.npmjs.com/package/@microsoft/teams.api" target="_blank">
<img src="https://img.shields.io/pypi/dw/microsoft-teams-devtools" />
</a>
</p>

Developer tools for locally testing and debugging Teams applications. Streamlines the development process by eliminating the need to deploy apps or expose public endpoints during development.

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

## Features

- **Local Testing**: Test Teams apps locally without deployment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ async def on_socket_connection(self, websocket: WebSocket):
while True:
try:
data = await websocket.receive_text()
self.logger.info(f"Received WebSocket message: {data}")
self.logger.debug(f"Received WebSocket message: {data}")
except WebSocketDisconnect:
self.logger.info(f"WebSocket {socket_id} disconnected")
self.logger.debug(f"WebSocket {socket_id} disconnected")
break
finally:
del self.sockets[socket_id]
Expand Down Expand Up @@ -244,7 +244,7 @@ async def emit_activity_to_sockets(self, event: DevToolsActivityEvent):
try:
await websocket.send_json(data)
except WebSocketDisconnect:
self.logger.info(f"WebSocket {socket_id} disconnected")
self.logger.debug(f"WebSocket {socket_id} disconnected")
del self.sockets[socket_id]

def add_page(self, page: Page) -> "DevToolsPlugin":
Expand Down
13 changes: 13 additions & 0 deletions packages/graph/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
# Microsoft Teams Graph Integration

<p>
<a href="https://www.npmjs.com/package/@microsoft/teams.api" target="_blank">
<img src="https://img.shields.io/pypi/v/microsoft-teams-graph" />
</a>
<a href="https://www.npmjs.com/package/@microsoft/teams.api" target="_blank">
<img src="https://img.shields.io/pypi/dw/microsoft-teams-graph" />
</a>
</p>

This package provides seamless access to Microsoft Graph APIs from Teams bots and agents built with the Microsoft Teams AI SDK for Python.

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

## Key Features

- **Token Integration**: Unified token handling using the Token type from microsoft-teams-common
Expand Down
16 changes: 16 additions & 0 deletions packages/openai/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Microsoft Teams OpenAI

<p>
<a href="https://www.npmjs.com/package/@microsoft/teams.api" target="_blank">
<img src="https://img.shields.io/pypi/v/microsoft-teams-openai" />
</a>
<a href="https://www.npmjs.com/package/@microsoft/teams.api" target="_blank">
<img src="https://img.shields.io/pypi/dw/microsoft-teams-openai" />
</a>
</p>

OpenAI model implementations to be used with @microsoft-teams-ai. Supports all OpenAI-like API models.

<a href="https://microsoft.github.io/teams-ai" target="_blank">
<img src="https://img.shields.io/badge/📖 Getting Started-blue?style=for-the-badge" />
</a>
Empty file added tests/dialogs/README.md
Empty file.