Updates from: 05/24/2024 04:45:55
Service Microsoft Docs article Related commit history on GitHub Change details
platform How Conversation Ai Core Capabilities https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/bots/how-to/Teams conversational AI/how-conversation-ai-core-capabilities.md
You can send and receive messages using the Bot Framework. The app listens for t
# [JavaScript](#tab/javascript6)
-* [Code sample](https://github.com/microsoft/teams-ai/tree/main/js/samples/01.messaging.a.echoBot)
+* [Code sample](https://github.com/microsoft/teams-ai/tree/main/js/samples/01.getting-started/a.echoBot)
-* [Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/01.messaging.a.echoBot/src/index.ts#L83)
+* [Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/01.getting-started/a.echoBot/src/index.ts#L74)
```typescript // Listen for user to say '/reset' and then delete conversation state
Now, the app class has `messageExtensions` features to simplify creating the
* `state`: `TurnState` * `query`: The data passed from message extension interaction
-* [Code sample](https://github.com/microsoft/teams-ai/tree/main/js/samples/02.messageExtensions.a.searchCommand)
+* [Code sample](https://github.com/microsoft/teams-ai/tree/main/js/samples/02.teams-features/a.messageExtensions.searchCommand)
-* [Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/02.messageExtensions.a.searchCommand/src/index.ts#L81)
+* [Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/02.teams-features/a.messageExtensions.searchCommand/src/index.ts#L79)
```javascript import { MessagingExtensionAttachment } from "botbuilder";
You can register Adaptive Card action handlers using theΓÇ»`app.adaptiveCards` p
# [JavaScript](#tab/javascript4)
-* [Code sample](https://github.com/microsoft/teams-ai/tree/main/js/samples/03.adaptiveCards.a.typeAheadBot)
+* [Code sample](https://github.com/microsoft/teams-ai/tree/main/js/samples/02.teams-features/b.adaptiveCards.typeAheadBot)
-* [Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/03.adaptiveCards.a.typeAheadBot/src/index.ts#L95)
+* [Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/02.teams-features/b.adaptiveCards.typeAheadBot/src/index.ts#L86)
```javascript // Listen for messages that trigger returning an adaptive card
builder.Services.AddTransient<IBot>(sp =>
# [JavaScript](#tab/javascript3)
-* [Code sample](https://github.com/microsoft/teams-ai/tree/main/js/samples/04.ai.c.actionMapping.lightBot)
+* [Code sample](https://github.com/microsoft/teams-ai/tree/main/js/samples/03.ai-concepts/c.actionMapping-lightBot)
-* [Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/04.ai.c.actionMapping.lightBot/src/index.ts#L93)
+* [Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/03.ai-concepts/c.actionMapping-lightBot/src/index.ts#L87)
```typescript
The following is an example of how you can structure their code to handle a mess
* [Code sample](https://github.com/microsoft/teams-ai/tree/main/dotnet/samples/02.messageExtensions.a.searchCommand)
-* [Sample code reference](https://github.com/microsoft/teams-ai/blob/main/dotnet/samples/02.messageExtensions.a.searchCommand/Program.cs#L47)
+* [Search actions sample code reference](https://github.com/microsoft/teams-ai/blob/main/dotnet/samples/02.messageExtensions.a.searchCommand/Program.cs#L47)
-* [Sample code reference](https://github.com/microsoft/teams-ai/blob/main/dotnet/samples/02.messageExtensions.a.searchCommand/ActivityHandlers.cs#L39)
+* [Search results sample code reference](https://github.com/microsoft/teams-ai/blob/main/dotnet/samples/02.messageExtensions.a.searchCommand/ActivityHandlers.cs#L39)
```csharp // Listen for search actions
The following is an example of how you can structure their code to handle a mess
# [JavaScript](#tab/javascript2)
-* [Code sample](https://github.com/microsoft/teams-ai/tree/main/js/samples/02.messageExtensions.a.searchCommand)
+* [Code sample](https://github.com/microsoft/teams-ai/tree/main/js/samples/02.teams-features/a.messageExtensions.searchCommand)
-* [Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/02.messageExtensions.a.searchCommand/src/index.ts#L81)
+* [Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/02.teams-features/a.messageExtensions.searchCommand/src/index.ts#L78)
```typescript
All entities are required parameters to actions.
# [JavaScript](#tab/javascript1)
-* [Code sample](https://github.com/microsoft/teams-ai/tree/main/js/samples/04.ai.d.chainedActions.listBot)
+* [Code sample](https://github.com/microsoft/teams-ai/tree/main/js/samples/03.ai-concepts/d.chainedActions-listBot)
-* [Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/04.ai.d.chainedActions.listBot/src/index.ts#L154)
+* [Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/03.ai-concepts/d.chainedActions-listBot/src/index.ts#L161)
```typescript app.ai.action('addItems', async (context: TurnContext, state: ApplicationTurnState, parameters: ListAndItems) => {
platform How Conversation Ai Get Started https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/bots/how-to/Teams conversational AI/how-conversation-ai-get-started.md
builder.Services.AddSingleton<BotAdapter>(sp => sp.GetService<CloudAdapter>());
# [JavaScript](#tab/javascript4)
-[Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/04.ai.a.teamsChefBot/src/index.ts#L9)
+[Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/04.ai-apps/a.teamsChefBot/src/index.ts#L9)
```javascript // Import required bot services.
app = Application[TurnState](
Import all the classes from `@microsoft/teams-ai` to build your bot and use the Teams AI library capabilities.
-[Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/04.ai.a.teamsChefBot/src/index.ts#L70)
+[Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/04.ai-apps/a.teamsChefBot/src/index.ts#L13)
```javascript // import Teams AI library
Add AI capabilities to your existing app or a new Bot Framework app.
# [JavaScript](#tab/javascript1)
-[Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/04.ai.a.teamsChefBot/src/index.ts#L82)
+[Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/03.ai-concepts/c.actionMapping-lightBot/src/index.ts#L86)
```javascript /// Create AI components
The application object automatically manages the conversation and user state of
# [JavaScript](#tab/javascript3)
-[Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/04.ai.a.teamsChefBot/src/index.ts#L108)
+[Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/03.ai-concepts/c.actionMapping-lightBot/src/index.ts#L112)
```javascript // Define storage and application
app = Application[AppTurnState](
A vector data source makes it easy to add RAG to any prompt. You can register a named data source with the planner and then specify the name[s] of the data sources to augment the prompt within the prompt's `config.json` file. Data sources allow AI to inject relevant information from external sources into the prompt, such as vector databases or cognitive search. You can register named data sources with the planner and then specify the name[s] of the data sources they wish to augment the prompt within the prompt's `config.json` file.
-[Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/04.ai.a.teamsChefBot/src/index.ts#L117)
+[Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/04.ai-apps/a.teamsChefBot/src/index.ts#L118)
```typescript // Register your data source with planner
Create a folder called prompts and define your prompts in the folder. When the u
* `config.json`: Contains the prompt model settings. Provide the right configuration to ensure bot responses are aligned with your requirement.
- [Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/04.ai.a.teamsChefBot/src/prompts/chat/config.json)
+ [Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/03.ai-concepts/c.actionMapping-lightBot/src/prompts/sequence/config.json)
```json {
Actions handle events triggered by AI components.
`FlaggedInputAction` and `FlaggedOutputAction` are the built-in action handlers to handle the moderator flags. If the moderator flags an incoming message input, the moderator redirects to the `FlaggedInputAction` handler and the `context.sendActivity` sends a message to the user about the flag. If you want to stop the action, you must add `AI.StopCommandName`.
-[Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/04.ai.a.teamsChefBot/src/index.ts#L127)
+[Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/04.ai-apps/a.teamsChefBot/src/index.ts#L132)
```javascript // Register other AI actions
public class LightBotActions
# [JavaScript](#tab/javascript2)
-[Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/04.ai.c.actionMapping.lightBot/src/index.ts#L133)
+[Sample code reference](https://github.com/microsoft/teams-ai/blob/main/js/samples/03.ai-concepts/c.actionMapping-lightBot/src/index.ts#L126)
```javascript // Register action handlers
platform Bot Copilot Handoff https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/bots/how-to/conversations/bot-copilot-handoff.md
+
+ Title: Copilot handoff
+description: Learn how to allow users to continue their conversation with custom engine copilot from the copilot for Microsoft 365.
Last updated : 05/07/2024+++++
+# Copilot handoff
+
+> [!NOTE]
+>
+> * Copilot handoff is only available in [public developer preview](../../../resources/dev-preview/developer-preview-intro.md).
+> * Copilot handoff is only supported in one-on-one chat with bot.
+
+Copilot handoffs are plugin-provided deep links that carry over chat context, enabling users to seamlessly transition their chat with Copilot for Microsoft 365 to your bot service. You can enhance your Copilot message extension plugin to hand off a conversation to your custom engine copilot to handle scenarios where specialized knowledge or actions are required, such as
+complex IT support queries, detailed product inquiries, or interactive order management.
+
+In the following graphic, a user looks for help on tech issues using Copilot and receives results from the enterprise dataset. The user finds the available information insufficient and wants to continue the interaction with a Contoso bot plugin.ΓÇï When the user selects the Contoso bot, a new chat starts and the conversation continues in the Contoso bot. This seamless switch from Copilot to the Contoso bot, without losing the conversation context is called a *copilot handoff*.
++
+## How copilot handoff works
+
+A [custom engine copilot](/microsoft-365-copilot/extensibility/overview-custom-engine-copilot) sends a deep link with a continuation token to Copilot for Microsoft 365. The deep link query parameter with a continuation token ensures that any information from your plugin invocation parameters is referenced. When the user selects the deep link, Copilot sends an invoke call to the bot with the continuation token, and the bot then resumes the conversation based on the context. This process enables a seamless transition from Copilot for Microsoft 365 to your custom engine copilot, maintaining the conversationΓÇÖs continuity and context, which optimizes the user experience.
++
+You must create a deep link URL with a `continuation` query parameter for the action button and assign a continuation token to the parameter to facilitate the handoff process. When the user selects the action button, Microsoft Teams reads the continuation token from the URL and initiates an invoke call to the bot. The bot or plugin uses the continuation token to create a response, which is then displayed to the user in the plugin chat window.
+
+## Enable copilot handoff
+
+To enable copilot handoff in Teams, follow these steps:
+
+1. **Configure a deep link URL**: Create a [deep link to a chat](../../../concepts/build-and-test/deep-link-teams.md#configure-deep-link-to-start-a-chat-manually) and add the `28:<botId>` and `continuationToken` to the deep link format. The deep link format must be `https://teams.microsoft.com/l/chat/0/0?users=28:${botId}&continuation=${continuationToken}`.
+
+ **Example**:
+
+ ```JSON
+ {
+ "type": "Action.OpenUrl",
+ "title": "Handoff to Bot",
+ "url": "https://teams.microsoft.com/l/chat/0/0?users=28:${botId}&continuation=${continuationToken}"
+ }
+ ```
+
+ The `Action.OpenUrl` property allows the user to hand off the conversation to a bot. When a user selects the action button, the deep link is activated and opens a new chat window with the bot. The bot receives an invoke call with a payload, which contains the continuation token from the URL and uses the token to maintain the context of the conversation.
+
+ **Sample payload**
+
+ ```json
+ {
+ "name": "handoff/action",
+ "type": "invoke",
+ "timestamp": "2024-04-15T19:50:32.945Z",
+ "localTimestamp": "2024-04-15T19:50:32.945Z",
+ "id": "f:00000000-0000-0000-0000-000000000000",
+ "channelId": "msteams",
+ "serviceUrl": "https://smba.trafficmanager.net/amer/",
+ "from": {
+ "id": "29:1jzORtjcfpYTLQDR9O4TyLz9LDwHskubQN1Ljc-aFO4L8dnZatjFpSw1PCGa-Mm-Jo4uLp67Lvekcjq2hkPoxdA",
+ "aadObjectId": "00000000-0000-0000-0000-000000000000"
+ },
+ "conversation": {
+ "conversationType": "personal",
+ "tenantId": "00000000-0000-0000-0000-000000000000",
+ "id": "a:13tOiSzRqeub3zaqoTHKpvOkk8Y1zFxk-g8WKdAUM2tjhTBFMt4RSuL8YWi7uwFNBmbxsyzYYktJEyfimYXYiEoplQ34aJs1y8trDb7EIcG09xOjSUieHVzFZ2b8tkagZ"
+ },
+ "recipient": {
+ "id": "28:00000000-0000-0000-0000-000000000000",
+ "name": "NorthwindProducts"
+ },
+ "entities": [
+ {
+ "locale": "en-US",
+ "country": "US",
+ "platform": "Android",
+ "timezone": "America/Chicago",
+ "type": "clientInfo"
+ }
+ ],
+ "channelData": {
+ "tenant": {
+ "id": "00000000-0000-0000-0000-000000000000"
+ },
+ "source": {
+ "name": "message"
+ },
+ "legacy": {
+ "replyToId": "1:1_qLAAGcfze29QAWxzicc7gvR3vuNAlKvth08vavxYYs"
+ }
+ },
+ "replyToId": "1713210583687",
+ "value": {
+ "continuation": "test-continuation-token"
+ },
+ "locale": "en-US",
+ "localTimezone": "America/Chicago",
+ "rawTimestamp": "2024-04-15T19:50:32.945Z",
+ "rawLocalTimestamp": "2024-04-15T14:50:32.945-05:00",
+ "callerId": "urn:botframework:azure"
+ }
+ ```
+
+ The `handoff/action` invoke type allows the bot to transfer control of the conversation to another service or initiate a specific action that requires further processing. When the bot receives the `handoff/action` invoke activity, it uses the continuation token to look up any necessary information to continue the conversation seamlessly. This involves retrieving conversation history, user preferences, or any other context needed to provide a consistent experience.
+
+1. **Handle the invoke type**: In your bot code, manage the `handoff/action` invoke using the `onInvokeActivity` handler. In your bot code, manage the `handoff/action` invoke using the `onInvokeActivity` handler. You must override the `onInvokeActivity` method to handle the invoke call. If the invoke call is successful, the bot must return an HTTP status code of **200**. If there's an error, the bot must respond with an appropriate HTTP status code in the range of **400- or 500-**. If the user receives an error, they must wait and retry while the errors are logged in the backend service.
+
+ > [!NOTE]
+ > Don't send any payload with this response as it doesn't render in the chat window. The responses based on the continuation token must be sent to the user separately.
+
+ Here's an example of how to handle the invoke call in `searchApp.ts` file:
+
+ ```typescript
+ case "handoff/action": {
+ // TODO: Save continuation token and use it to process final response to user later
+ return {status: 200}; // return just the http status
+ }
+ ```
+
+ When the bot receives the invoke call, `context.activity.value.continuation` contains the `continuationToken` that was set in the deep link URL. If the app isn't installed during the handoff the user is redirected to the Teams Store to install the app.
+
+## Best practices
+
+* Bot must notify users when they're directed to the bot chat after selecting the action button, as there's no visual indication. This helps manage expectations as there might be a delay before the bot returns a response due to network latency and processing time. For instance, the bot can send a series of activities to keep the user informed of the progress:
+
+ ```typescript
+ await context.sendActivities([
+ {
+ type: ActivityTypes.Message,
+ text: "Continuing conversation from copilot...",
+ },
+ { type: ActivityTypes.Typing },
+ { type: "delay", value: 1000 },
+ {
+ type: ActivityTypes.Message,
+ text: `Fetching more details using the continuation token passed: ${continuationToken}`,
+ },
+ { type: ActivityTypes.Typing },
+ { type: "delay", value: 4000 },
+ {
+ type: ActivityTypes.Message,
+ text: `Handoff successful!`,
+ }
+ ]);
+
+ ```
+
+* We recommended that you manage the lifecycle of the continuation token to ensure it expires after a reasonable period and handle scenarios where the user replays the request for continuation token. For example, if the same token comes up, let the user know they need to start a new conversation with the bot because the handoff from copilot can't continue.
+
+## Code samples
+
+|Sample name | Description | Node.js|
+| -| | -- |
+| Northwind inventory message extension | This sample implements a Teams message extension that can be used as a plugin for Microsoft Copilot for Microsoft 365. The message extension showcases copilot handoff along with allowings users to query the Northwind Database. | [View](https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/msgext-copilot-handoff/ts) |
platform Glossary https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/get-started/glossary.md
Common terms and definitions used in Microsoft Teams developer documentation.
| Conversation | A series of messages sent between your Microsoft Teams app (tab or bot) and one or more users. A conversation can have three scopes: channel, personal, and group chat. <br>**See also**: [One-on-one chat](#o); [Group chat](#g); [Channel](#c) | | [Conversational bot](../bots/how-to/conversations/conversation-messages.md) | It lets a user interact with your web service using text, interactive cards, and dialogs. <br>**See also** [Chat bot](#c); [Standalone app](#s) | | [Copilot](../messaging-extensions/build-bot-based-plugin.md)|Microsoft 365 Copilot is powered by an advanced processing and orchestration engine that seamlessly integrates Microsoft 365 apps, Microsoft Graph, and Large Language Models (LLMs) to turn your words into the most powerful productivity tool. |
+| [Copilot handoff](../bots/how-to/conversations/bot-copilot-handoff.md) | Copilot handoffs are plugin-provided deep links that carry over chat context, enabling users to seamlessly transition their chat with Copilot for Microsoft 365 to your bot service. |
+| [Custom engine copilot](/microsoft-365-copilot/extensibility/overview-custom-engine-copilot) | Custom engine copilots are conversational Teams bots designed to harness the powerful capabilities of Large Language Models (LLMs) for seamless user interaction. These advanced bots mark a significant departure from traditional bots, offering an extensive range of features that elevate the overall user experience. |
| Customer-owned apps | An app created by you or your organization that is meant for use by other Teams app users outside the organization. It can be made available on Microsoft Teams Store. <br> **See also**: [Teams Store validation guidelines](#s); [Microsoft Store](#s); [LOB apps](#l); [Personal tab](#p); [Shared apps](#s) | | Custom app built for your org (LOB app) | An app created only for Teams by you or your organization. | | [Custom app upload](../toolkit/publish.md#publish-to-individual-scope-or-custom-app-upload-permission) | A process where a Teams app is loaded to the Teams client to test it in the Teams environment before distributing it. |
platform Extend M365 Meeting App https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/m365-apps/extend-m365-meeting-app.md
To preview your Teams meeting app in Outlook, ensure the following:
* A [Microsoft 365 developer sandbox](./prerequisites.md#prepare-a-developer-tenant-for-testing) tenant with uploading enabled. * A test environment with Outlook for Windows desktop installed from the [Microsoft 365 Apps *Current Channel*](./prerequisites.md#install-microsoft-365-apps-in-your-test-environment). * [NodeJS](https://nodejs.org/download) (with npm) installed.
-* [TeamsFx CLI v2](../toolkit/TeamsFx-CLI.md) library installed from npm.
+* [TeamsFx CLI v2](~/toolkit/teams-toolkit-cli.md) library installed from npm.
* [Visual Studio Code](https://code.visualstudio.com/) installed to your development environment. * [Teams Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension) extension for Visual Studio Code.
platform Bots Conv Proactive https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/resources/bot-v3/bot-conversations/bots-conv-proactive.md
Alternatively, you can use the REST API and issue a POST request to [`/conversat
# [C#](#tab/csharp)
-The .NET example is from [this sample](https://github.com/OfficeDev/Microsoft-Teams-Samples/blob/main/samples/app-complete-sample/csharp/src/dialogs/examples/teams/ProactiveMsgTo1to1Dialog.cs)
+The .NET example is from [this sample](https://github.com/OfficeDev/Microsoft-Teams-Samples/blob/main/samples/app-complete-sample/csharp/AppCompleteSample/src/dialogs/examples/teams/ProactiveMsgTo1to1Dialog.cs)
```csharp using Microsoft.Bot.Builder.Dialogs;
platform Open Content In Stageview https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/tabs/open-content-in-stageview.md
Title: Open content in Stageview
+ Title: Open content in multi-window
description: Learn about the types of Stageview, a full screen UI component invoked to surface your app content. Open content in multi-window experiences using deep links, Adaptive Cards, or Teams JavaScript client library (TeamsJS).
ms.localizationpriority: high
Last updated 06/05/2023
-# Open content in Stageview
+# Open content in multi-window
Microsoft Teams provides multiple methods to open your app content in immersive canvas experiences. Stageview allows users to adopt multitasking inside Teams, for example, you can open your app content in a new Teams window with a specific chat in the side panel. Stageview is designed to:
platform Whats New https://github.com/MicrosoftDocs/msteams-docs/commits/main/msteams-platform/whats-new.md
Explore updates from the previous GA releases listed here.
Discover Microsoft Teams platform features that are in developer preview. You can now get latest Teams platform updates by subscribing to the RSS feed [![download feed](~/assets/images/RSSfeeds.png)](https://aka.ms/TeamsPlatformUpdates). For more information, see [configure RSS feed](#get-latest-updates).
+## Microsoft Build 2024 :::image type="icon" source="assets/images/bullhorn.png" border="false"
+
+| **Date** | **Update** | **Find here** |
+| -- | | -|
+| May 23, 2024 | Enhance your Copilot message extension plugin to hand off a conversation to your custom engine copilot.| Build message extensions > Build message extensions using Bot Framework > Search commands > [Copilot handoff](bots/how-to/conversations/bot-copilot-handoff.md)|
+ ## Developer preview :::row:::