Quickstart
Get started with Teams AI Library (v2) quickly using the Teams CLI.
Set up a new project
Prerequisites
- Python v3.12 or higher. Install or upgrade from python.org/downloads.
- UV v0.8.11 or higher. Install or upgrade from https://docs.astral.sh/uv/getting-started/installation/
Instructions
Install the Teams CLI
Use your terminal to install the Teams CLI globally using npm:
npm install -g @microsoft/teams.cli@preview
The Teams CLI is a command-line tool that helps you create and manage Teams applications. It provides a set of commands to simplify the development process.
After installation, you can run teams --version
to verify the installation.
Our Python SDK is currently in Public Preview. As a result, we have the CLI under a feature flag. Please run the below command to enable this language.
$env:ENABLE_EXPERIMENTAL_PYTHON_OPTIONS = 1
Creating Your First Agent
Let's create a simple echo agent that responds to messages. Run:
teams new python quote-agent --template echo
This command:
- Creates a new directory called
quote-agent
. - Bootstraps the echo agent template files into it under
quote-agent/src
. - Creates your agent's manifest files, including a
manifest.json
file and placeholder icons in thequote-agent/appPackage
directory. The Teams app manifest is required for sideloading the app into Teams.
The
echo
template creates a basic agent that repeats back any message it receives - perfect for learning the fundamentals.
Running your agent
Navigate to your new agent's directory:
cd quote-agent
Start the development server:
uv run src\main.py
In the console, you should see a similar output:
[INFO] @teams/app Successfully initialized all plugins
[WARNING] @teams/app.DevToolsPlugin ⚠️ Devtools is not secure and should not be used in production environments ⚠️
[INFO] @teams/app.HttpPlugin Starting HTTP server on port 3978
INFO: Started server process [6436]
INFO: Waiting for application startup.
[INFO] @teams/app.DevToolsPlugin available at http://localhost:3979/devtools
[INFO] @teams/app.HttpPlugin listening on port 3978 🚀
[INFO] @teams/app Teams app started successfully
[INFO] @teams/app.DevToolsPlugin listening on port 3979 🚀
INFO: Application startup complete..
INFO: Uvicorn running on http://0.0.0.0:3979 (Press CTRL+C to quit)
When the application starts, you'll see:
- An http server starting up (on port 3978). This is the main server which handles incoming requests and serves the agent application.
- A devtools server starting up. This is a developer server that provides a web interface for debugging and testing your agent quickly, without having to deploy it to Teams.
Let's navigate to the devtools server. Open your browser and head to http://localhost:3978/devtools. You should see a simple interface where you can interact with your agent. Send it a message!
Next steps
Now that you have your first agent running, learn about the code basics to understand its components and structure.
Otherwise, if you want to run your agent in Teams, check out the Running in Teams guide.