Skip to content

Commit 1fbd604

Browse files
Merge branch 'main' into pranjalb-teamssdk-sample-code-updation-11
2 parents eb2c79e + acfc66e commit 1fbd604

138 files changed

Lines changed: 1123 additions & 720 deletions

File tree

Some content is hidden

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

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,6 +1560,11 @@
15601560
"source_path": "msteams-platform/bots/how-to/create-a-bot-commands-menu.md",
15611561
"redirect_url": "/microsoftteams/platform/agents-in-teams/agent-slash-commands",
15621562
"redirect_document_id": false
1563+
},
1564+
{
1565+
"source_path": "msteams-platform/agents-in-teams/build-first-agent.md",
1566+
"redirect_url": "quickstart-create-agent-teams-sdk",
1567+
"redirect_document_id": false
15631568
}
15641569
]
15651570
}

msteams-platform/TOC.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@
66
- name: What's new?
77
href: whats-new.md
88
displayName: Teams platform features, latest updates, RSS feed, deprecated, announcement, preview
9-
- name: Glossary
10-
href: get-started/glossary.md
11-
displayName: App tray, terminologies, definitions, welcome, new word, meaning
9+
- name: "Quickstart: Create and chat with an agent"
10+
href: agents-in-teams/quickstart-create-agent-teams-sdk.md
11+
displayName: Get started, chat, start, introduction, tutorial, demo, SDK, Teams, bot, developer, CLI, agent, sideload, devtunnel
1212
- name: Build agents using Teams SDK
1313
items:
1414
- name: Agents in Teams
1515
href: agents-in-teams/overview.md
16-
- name: Build your first agent
17-
href: agents-in-teams/build-first-agent.md
18-
displayName: create, run, first agent, Teams AI library, Teams SDK, custom engine agent, AI bot, JavaScript, Python, C#, code sample
1916
- name: Agents user experience
2017
href: bots/how-to/teams-conversational-ai/ai-ux.md
2118
displayName: AI bot user experience, AI bot UX, custom engine agent, AI label, citation, feedback loop
@@ -67,7 +64,7 @@
6764
href: toolkit/tools-prerequisites.md
6865
displayName: accounts to build your Teams app
6966
- name: Create new Teams agent project
70-
href: agents-in-teams/build-first-agent.md
67+
href: agents-in-teams/build-agent-toolkit.md
7168
- name: Create new Teams app project
7269
href: toolkit/create-new-project.md
7370
- name: Develop your app in VSC
@@ -1191,6 +1188,9 @@
11911188
displayName: Purchase, Teams apps, License, manage, buy subscriptions, ISVs, Manage, License, third party, SaaS, Partner Center
11921189
- name: Frequently asked questions
11931190
href: teams-faq.md
1191+
- name: Glossary
1192+
href: get-started/glossary.md
1193+
displayName: App tray, terminologies, definitions, new word, meaning
11941194
- name: Support and feedback
11951195
href: feedback.md
11961196
displayName: Developer community help, questions, suggestions, contact, issues

msteams-platform/agents-in-teams/agent-reactions.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Build Agents that Use Emoji Reactions in Teams Chat
33
description: Reactions are emoji markers on messages in Teams chat. Learn how to make an agent that adds, removes, and listens reactions with practical code examples.
44
#customer intent: As a Teams agent developer, I want to add emoji reactions to chat messages so that my agent can acknowledge messages without interrupting the conversation.
55
ms.localizationpriority: high
6-
ms.date: 07/01/2026
6+
ms.date: 07/10/2026
77
author: nickwalkmsft
88
ms.author: nickwalk
99
ms.reviewer: nickwalk
@@ -13,10 +13,6 @@ zone_pivot_groups: teams-sdk-languages
1313

1414
# Use emoji reactions in Teams chat
1515

16-
> [!NOTE]
17-
>
18-
> Support for agent reactions in Teams is available in [public developer preview](../resources/dev-preview/developer-preview-intro.md).
19-
2016
In Teams chat, reactions are lightweight emoji markers that participants can attach to anyone's messages. Agents can use reactions to acknowledge messages, display workflow status, and present other information without interrupting the flow of the conversation. Agents can also listen for and respond to reactions.
2117

2218
# [Desktop](#tab/desktop)
@@ -72,11 +68,11 @@ The following example illustrates adding a reaction to a received message, then
7268
```typescript
7369
app.on('message', async ({ activity, api }) => {
7470
// First, add a reaction
75-
await api.conversations.reactions.add(activity.conversation.id, activity.id, '1f44b_wavinghand');
71+
await api.reactions.add(activity.conversation.id, activity.id, '1f44b_wavinghand');
7672

7773
// Wait a bit, then remove it
7874
await new Promise((resolve) => setTimeout(resolve, 2000));
79-
await api.conversations.reactions.delete(activity.conversation.id, activity.id, '1f44b_wavinghand');
75+
await api.reactions.delete(activity.conversation.id, activity.id, '1f44b_wavinghand');
8076
});
8177
```
8278

@@ -96,15 +92,15 @@ import asyncio
9692
@app.on_message
9793
async def handle_message(ctx: ActivityContext[MessageActivity]):
9894
# First, add a reaction
99-
await ctx.api.conversations.reactions.add(
95+
await ctx.api.reactions.add(
10096
ctx.activity.conversation.id,
10197
ctx.activity.id,
10298
'1f44b_wavinghand'
10399
)
104100

105101
# Wait a bit, then remove it
106102
await asyncio.sleep(2)
107-
await ctx.api.conversations.reactions.delete(
103+
await ctx.api.reactions.delete(
108104
ctx.activity.conversation.id,
109105
ctx.activity.id,
110106
'1f44b_wavinghand'

msteams-platform/agents-in-teams/build-first-agent.md renamed to msteams-platform/agents-in-teams/build-agent-toolkit.md

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
---
2-
title: Create your first agent
3-
description: Learn how to build your agent in Microsoft Teams with the help of GitHub codespaces that opens Toolkit extension and step-by-step guides.
4-
ms.localizationpriority: high
5-
ms.date: 12/11/2024
6-
ms.topic: reference
2+
title: Build a Teams Agent with Microsoft 365 Agents Toolkit
3+
description: Build a Teams agent using Microsoft 365 Agents Toolkit. Follow a step-by-step guide to create, run, and deploy your AI agent in Teams.
4+
ms.date: 07/06/2026
5+
author: nickwalkmsft
6+
ms.author: nickwalk
7+
ms.reviewer: nickwalk
8+
ms.topic: quickstart
79
---
810

9-
# Build your first agent
11+
# Build a Teams agent with Microsoft 365 Agents Toolkit
1012

1113
Agents utilize AI to automate and execute business processes, functioning alongside or on behalf of a person, team, or organization. Agents range from simple prompt-and-response agents to more advanced, fully autonomous agents.
1214

@@ -111,36 +113,6 @@ Microsoft 365 Agents Toolkit creates and scaffolds the agent project workspace.
111113

112114
Congratulations! You've created and ran your first agent in Microsoft Teams.
113115

114-
## Choose your programming language
115-
116-
Teams SDK is available for JavaScript, C#, and Python (dev preview). It provides a simplified SDK, support for Model Context Protocol (MCP), Agent-to-Agent communication (A2A), and streamlined tools to enable developers to build intelligent agents for Microsoft Teams.
117-
118-
:::row:::
119-
:::column:::
120-
**Description**
121-
:::column-end:::
122-
:::column span="3":::
123-
            **Choose your build environment**
124-
:::column-end:::
125-
:::row-end:::
126-
:::row:::
127-
:::column:::
128-
Build with ...
129-
:::column-end:::
130-
:::column:::
131-
> [!div class="nextstepaction"]
132-
> [C#](/microsoftteams/platform/teams-ai-library/getting-started/quickstart?pivots=csharp)
133-
:::column-end:::
134-
:::column:::
135-
> [!div class="nextstepaction"]
136-
> [TypeScript](/microsoftteams/platform/teams-ai-library/getting-started/quickstart?pivots=typescript)
137-
:::column-end:::
138-
:::column:::
139-
> [!div class="nextstepaction"]
140-
> [Python](/microsoftteams/platform/teams-ai-library/getting-started/quickstart?pivots=python)
141-
:::column-end:::
142-
:::row-end:::
143-
144116
## Code sample
145117

146118
| Sample name | Description | .NET | Node.js | Python |
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## Prerequisites
2+
3+
- Node.js 24 or later ([installer download](https://nodejs.org))
4+
- .NET 10 or later ([installer download](https://dotnet.microsoft.com/download))
5+
- Teams, with a Microsoft 365 work or school account that has permissions to install custom Teams apps (you'll confirm these permissions at the very beginning of the quickstart)
6+
7+
If you don't have a Microsoft 365 work or school account, see [Microsoft 365 Developer Program](/office/developer-program/microsoft-365-developer-program) for information about getting a developer sandbox subscription that you can use to try your agent in Teams.
8+
9+
## Install tools, log in and confirm permissions
10+
11+
Install the Teams developer CLI and Microsoft 365 Agents Playground, then log in to the developer CLI.
12+
13+
```console
14+
npm install -g @microsoft/teams.cli
15+
teams login
16+
```
17+
18+
The CLI will confirm your login, your account's permissions to install custom apps ("sideloading"), and check for the presence of an Azure CLI installation (not required for this quickstart).
19+
20+
```output
21+
✔ Logged in as user@contoso.com
22+
✔ Sideloading: enabled
23+
24+
Azure CLI: installed, not logged in
25+
```
26+
27+
**To continue with this quickstart, sideloading must be enabled.** If it is disabled, you will need your organization's Microsoft 365 administrator to enable it for your account. See [Allow users to upload custom apps](/microsoftteams/teams-custom-app-policies-and-settings#allow-users-to-upload-custom-apps) for administrator instructions for enabling this permission.
28+
29+
## Create code for an agent
30+
31+
1. Use `teams project new` to create the code for a new agent from a template.
32+
33+
```console
34+
teams project new csharp EchoBot
35+
cd EchoBot/EchoBot
36+
```
37+
38+
1. Start the agent to confirm it runs. Once it's running, you'll see a confirmation that it's running on port 3978.
39+
40+
```console
41+
dotnet run
42+
```
43+
44+
1. Use <kbd>Ctrl+C</kbd> in the console window to stop your agent. Leave the console window open, you'll need it again soon.
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
## Prerequisites
2+
3+
This quickstart is divided into two sections. In the first section, you'll need:
4+
5+
- Node.js 24 or later ([installer download](https://nodejs.org))
6+
- Python 3.12 or later ([installer download](https://python.org/downloads))
7+
- Visual Studio Code ([installer download](https://code.visualstudio.com/download))
8+
9+
In the second part, you'll also need Teams, with a Microsoft 365 work or school account that has permissions to install custom Teams apps.
10+
11+
If you don't have an account, or you aren't sure about your permissions, you can still begin. The quickstart will address those requirements when they're needed.
12+
13+
## Create code for an agent and try it in Microsoft 365 Agents Playground
14+
15+
1. Install the Teams developer CLI and Microsoft 365 Agents Playground.
16+
17+
```console
18+
npm install -g @microsoft/teams.cli @microsoft/m365agentsplayground
19+
```
20+
21+
1. Use `teams project new` to create the code for a new agent from a template and open it in Visual Studio Code.
22+
23+
```console
24+
teams project new python echo-bot
25+
cd echo-bot
26+
code .
27+
```
28+
29+
1. Open `src/main.py`. Find the line that reads `app = App()` and modify it to read:
30+
31+
```python
32+
app = App(skip_auth=True)
33+
```
34+
35+
This is a temporary modification to enable Microsoft 365 Agents Playground to communicate with the agent.
36+
37+
1. Start the agent. Once it's running, you'll see a confirmation that it's running on port 3978.
38+
39+
### [Bash](#tab/bash)
40+
41+
```bash
42+
python -m venv .venv
43+
source .venv/bin/activate
44+
pip install -e .
45+
python src/main.py
46+
```
47+
48+
### [PowerShell](#tab/powershell)
49+
50+
```powershell
51+
python -m venv .venv
52+
.\.venv\Scripts\Activate.ps1
53+
pip install -e .
54+
python src/main.py
55+
```
56+
57+
### [Cmd](#tab/cmd)
58+
59+
```cmd
60+
python -m venv .venv
61+
.venv\Scripts\activate.bat
62+
pip install -e .
63+
python src/main.py
64+
```
65+
66+
---
67+
68+
1. In a new console window, start Microsoft 365 Agents Playground.
69+
70+
```console
71+
agentsplayground
72+
```
73+
74+
This will connect Agents Playground to your agent and open the interface in a new browser tab.
75+
76+
1. Use the compose box to send your agent a message and see it respond in the chat. Your agent's up and running locally!
77+
78+
:::image type="content" source="../../assets/images/agents-in-teams/agents-playground-interaction.png" alt-text="Screenshot of a short agent interaction in Microsoft 365 Agents Playground." lightbox="../../assets/images/agents-in-teams/agents-playground-interaction.png":::
79+
80+
1. Close the Agents Playground tab in your browser, and use <kbd>Ctrl+C</kbd> in both console windows to stop Agents Playground and your agent. Leave open the console window you used to create your agent, you'll need it again soon.
81+
82+
1. In your editor, undo the modification you made in step 3. This will ensure a secure connection with Teams in the next steps.
83+
84+
```python
85+
app = App()
86+
```
87+
88+
## Log in and confirm permissions
89+
90+
> [!NOTE]
91+
> The next part of this quickstart requires Teams, logged in to a Microsoft 365 work or school account with permissions to install custom Teams apps. This step will check for that permission.
92+
>
93+
>If you don't have a Microsoft 365 account, you can proceed to [Next steps](#next-steps) to continue working on your agent's code and complete the rest of this quickstart later. See [Microsoft 365 Developer Program](/office/developer-program/microsoft-365-developer-program) for information about getting a developer sandbox subscription that you can use to try your app in Teams.
94+
95+
Log in to your Microsoft 365 account from the Teams developer CLI.
96+
97+
```console
98+
teams login
99+
```
100+
101+
The CLI will confirm your login, your account's permissions to install custom apps ("sideloading"), and check for the presence of an Azure CLI installation (not required for this quickstart).
102+
103+
```output
104+
✔ Logged in as user@contoso.com
105+
✔ Sideloading: enabled
106+
107+
Azure CLI: installed, not logged in
108+
```
109+
110+
**To continue with this quickstart, sideloading must be enabled.** If it is disabled, you will need your organization's Microsoft 365 administrator to enable it for your account. See [Allow users to upload custom apps](/microsoftteams/teams-custom-app-policies-and-settings#allow-users-to-upload-custom-apps) for administrator instructions for enabling this permission. In the meantime, you can proceed to [Next steps](#next-steps) to continue working on your agent's code

0 commit comments

Comments
 (0)