This article provides a comprehensive guide on how to extend bot-based message extensions as plugins for Copilot for Microsoft 365. By doing so, users can interact with third-party tools and services, enhancing their productivity. The article covers the concept of a plugin, prerequisites, and a step-by-step guide on creating a bot-based message extension.
Introduction
Microsoft Copilot for Microsoft 365, powered by an advanced processing and orchestration engine, integrates Microsoft 365 apps, Microsoft Graph, and Large Language Models (LLMs) to transform your words into a potent productivity tool. Although Copilot for Microsoft 365 can utilize apps and data within the Microsoft 365 ecosystem, many users rely on various external tools and services for work management and collaboration. By extending your message extension as a plugin in Copilot for Microsoft 365, you can enable users to interact with third-party tools and services, therefore empowering them to achieve more with Copilot for Microsoft 365. You can achieve this extension by developing a plugin or connecting to an external data source.
What is a plugin?
A plugin allows Copilot for Microsoft 365 to interact directly with third-party data, apps, and services, enhance its capabilities, and broaden its range of capabilities. Plugins allow Copilot for Microsoft 365 to:
- Fetch real-time information, such as the latest news coverage on a product launch.
- Retrieve knowledge-based information, such as a team’s design files in Figma.
- Perform actions on behalf of the user, such as creating a Contoso ticket.
Product & Services Copilot Plugin
Part of this article, we are going to build a Product & Servies Copilot Plugin. The Product and Services Copilot plugin uses a SharePoint list to provide the necessary data, removing the need to switch between applications. The plugin supports detailed searches based on various parameters such as Product Name, Product Description, Revenue Type, or Service Area. For example, searching for ‘Azure Cloud Migration’ can yield extensive details from the SharePoint list. The results are presented in a user-friendly table format.
High level steps
- The user poses a question in natural language, such as “Show me all the products related to PowerBI.“
- Copilot interprets the user’s intent and question.
- Copilot extracts the parameters from the user’s prompt, based on the commands specified in the manifest file.
- Copilot calls an Azure function, using the parameters it generated, to retrieve data from the Product & Service SharePoint list.
- Copilot transforms the API response to match the user’s prompt, for instance, presenting the data in a tabular format or as bullet points.
- Copilot automatically binds the Adaptive card with the response generated from the API.
Final output
Below is an example of how the Product & Service plugin operates: A user submits a query in natural language, and the Copilot responds by displaying results from the SharePoint list, seamlessly integrating the provided adaptive card.
Steps to buid Messaging Extension based Copilot Plugin
Prerequisites
To begin building message extension plugins for Microsoft Copilot for Microsoft 365, please follow the link below to set up your development environment:
Note
1. Ensure that Copilot for Microsoft 365 is available for your organization
2. Only bot-based message extensions with search commands can be extended as plugins for Copilot for Microsoft 365
STEP 1 - Create bot-based message extension
Create bot-based message extension
To create a bot-based search message extension plugin using Visual Studio Code, follow these steps:
- Open Visual Studio Code.
- From the left pane, select Teams Toolkit.
- Select Create a New App.
- Select Message Extension.
- Select Custom Search Results.
- Select Start with a Bot.
- Select a programming language.
- Select Default folder.
- Enter the name of your app and select Enter. Teams Toolkit scaffolds your app and creates a message extension.
STEP 2 - Manifest file updates
Here are mandatory requirements for building message extension plugins for Copilot for Microsoft 365
App description
A well-crafted description succinctly outlines the app’s functionalities, enabling Copilot for Microsoft 365 to effectively identify and carry out search tasks. For instance, when a user combines the app name with an action, like “Find all the products related to Power BI,” Copilot for Microsoft 365 should promptly trigger the corresponding message extension plugin.
1. Search command description
Command description maps user intent and utterance to search command inside a plugin and must be built based on the analysis of the user intent and keywords. Search command descriptions must:
- Focus on what and how the command searches (detailed list) in natural language.
- Include verbs and synonyms, if applicable.
- Focus on keywords that are likely to be used in the search function of your native apps.
|
2. Parameter Description
Every message extension command includes a parameters
property, capable of supporting up to five parameters. Importantly, the first parameter is required to be visible in the message extension search bar. It is essential for each parameter to have a comprehensive description, encompassing acceptable values, enums, acronyms, and the expected output format.
|
3. Compound utterances
In order to use compound utterances (multiple search terms) with Copilot for Microsoft 365, your message extension needs to support at least four parameters in its code. You can define these parameters in the app manifest file. Also, your web service needs to be updated to handle these extra parameters and potentially empty values from the user.
References
Prerequisites for extending Microsoft 365 Copilot with a message extension bot
Build a bot-based messaging extension for Microsoft Teams
High-quality message extension for Microsoft Teams
Adding the Chef’s Kiss to Your Teams App Descriptions for Copilot