Migrating from Teams AI v1
Welcome, fellow agent developer! You've made it through a full major release of Teams AI, and now you want to take the plunge into v2. In this guide, we'll walk you through everything you need to know, from migrating core features like message handlers and auth, to optional AI features like ActionPlanner
. We'll also discuss how you can migrate features over incrementally via the botbuilder adapter.
Installing Teams AI v2​
First, let's install Teams AI v2 into your project. Notably, this won't replace any existing installation of Teams AI v1. When you've completed your migration, you can safely remove the @microsoft/teams-ai
dependency from your package.json
file.
npm install @microsoft/teams.apps
Migrate Application class​
First, migrate your Application
class from v1 to the new App
class.
Teams AI v1 | Teams AI v2 |
|
|
Migrate activity handlers​
Both Teams AI v1 and v2 are built atop incoming Activity
requests, which trigger handlers in your code when specific type of activities are received. The syntax for how you register different types of Activity
handlers differs between the v1 and v2 versions of our SDK.
Message handlers​
Teams AI v1 | Teams AI v2 |
|
|
Task modules​
Teams AI v1 | Teams AI v2 |
|
|
Learn more here.
Adaptive cards​
In Teams AI v2, cards have much more rich type validation than existed in v1. However, assuming your cards were valid, it should be easy to migrate to v2.
Teams AI v1 | Teams AI v2 (Option 1) | Teams AI v2 (Option 2) |
| For existing cards like this, the simplest way to convert that to Teams AI v2 is this:
| For a more thorough port, you could also do the following:
|
Learn more here.
Authentication​
Most agents feature authentication for user identification, interacting with APIs, etc. Whether your Teams AI v1 app used Entra SSO or custom OAuth, porting to v2 should be simple.
Teams AI v1 | Teams AI v2 |
|
|
AI​
Action planner​
When we created Teams AI v1, LLM's didn't natively support tool calling or orchestration. A lot has changed since then, which is why we decided to deprecate ActionPlanner
from Teams AI v1, and replace it with something a bit more lightweight. Notably, Teams AI v1 had two similar concepts: functions and actions. In Teams AI v2, these are consolidated into functions.
Teams AI v1 | Teams AI v2 |
And the corresponding
| In Teams AI v2, there is no
|
Feedback​
If you supported feedback for AI generated messages, migrating is simple.
Teams AI v1 | Teams AI v2 |
|
Note: In Teams AI v2, you do not need to opt into feedback at the |
You can learn more about feedback in Teams AI v2 here.
Incrementally migrating code via botbuilder plugin​
Comparison code coming soon!
If you aren't ready to migrate all of your code, you can run your existing Teams AI v1 code in parallel with Teams AI v2. Learn more here.