You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Building AI plugins for discovery by Copilot (preview)
3
+
description: Building AI plugins for discovery by Copilot.
4
+
ms.date: 11/07/2023
5
+
author: mduelae
6
+
ms.author: mkaur
7
+
ms.reviewer: mkaur
8
+
ms.topic: how-to
9
+
ms.subservice: common
10
+
manager: tapanm
11
+
ms.custom: bap-template
12
+
search.audienceType:
13
+
- maker, admin
14
+
---
15
+
16
+
# Building AI plugins for discovery by Copilot (preview)
17
+
18
+
[This article is prerelease documentation and is subject to change.]
19
+
20
+
Microsoft Dataverse supports three types of AI plugins – Dataverse custom APIs, Dataverse Table Search, and Dataverse File Search. Before you start building AI plugins for discoverability by Copilots across Microsoft 365, you need to decide which one of the supported AI plugin types to create.
21
+
22
+
While other AI plugin types might be added as supported by Dataverse, the steps to define plugin are the same.
23
+
24
+
All components within AI plugins are solution-aware, and follow the standard application lifecycle management (ALM) principles.
25
+
26
+
In general, there's two main steps in defining AI plugins.
27
+
28
+
1. Define the core functionality that you want to expose as an AI plugin. <br>
29
+
This is a prerequisite and an existing step in Dataverse about defining a custom API or a custom connector. This means that you can define an AI plugin for your existing custom APIs or custom connectors without any major changes.
30
+
1. Define the metadata of the AI plugin that can be discovered by a Copilot.
31
+
This is a new step that lets you define the metadata for your AI plugin that is used by the Copilots to discover and invoke this plugin. The process includes the following three main components:
32
+
1. **AI plugin definition**: The metadata of your plugin. For example, **SalesAIPlugin/**.
33
+
1. **AI plugin operation**: A list of operations supported by your plugin. For example, **GetOpportunities**, **CreateOpportunity/**.
34
+
1. **AI plugin instance**: Controls the state of your plugin, which is **Enable** or **Disable**.
35
+
36
+
Let’s get started and define our first AI plugin. In this example, we're going to define an AI plugin of type custom API.
37
+
38
+
> [!Note]
39
+
> A basic understanding and knowledge of application lifecycle management (ALM) in Dataverse is required to follow this example. See [Solution concepts](/power-platform/alm/solution-concepts-alm) in Power Platform ALM to learn more.
40
+
41
+
42
+
## Defining a Dataverse custom API as an AI plugin
43
+
44
+
### Step 1 – Define custom API
45
+
46
+
You can create a custom API using the Power Apps. More information: [Create a custom API in Power Apps](../../developer/data-platform/create-custom-api-maker-portal.md)
47
+
48
+
The plugin infrastructure currently supports only custom APIs with ‘IsFunction=False’ and ‘IsPrivate=False’. Hence, ensure that your custom API isn't a function or private API. At this point, you can test your custom API using a Postman client.
49
+
50
+
### Step 2 – Define AI plugin
51
+
52
+
Once you define the custom API, you can define the AI plugin using Power Apps. First, [Create a solution](../data-platform/create-solution.md). Once you create a solution, follow these steps to create an AI plugin:
53
+
54
+
1. In your solution, select **New** > **More** > **Other** > **AI plugin** from the drop-down.
55
+
1. Enter the values for the required fields.
56
+
1.**Name**: Enter a name that starts with a prefix. For example, new_myAIPlugin
57
+
1.**PluginType**: Dataverse
58
+
1.**HumanName**, **HumanDescription**, **ModelName**, **Model Description** fields control how your plugin is discovered by the large language model (LLM). So, provide meaningful values for those for your plugins. The remaining fields you can leave blank for now.
59
+
1. Select **Save**.
60
+
61
+
### Step 3 – Define AI operations
62
+
63
+
Once you have defined an AI plugin, the next step is to add the operations you want the plugin to expose. This can be done by selecting **+ New AIPluginOperation** from the top menu bar.
64
+
65
+
Enter the following fields in this form:
66
+
67
+
-**Name**: Provide a name for your operation
68
+
-**OperationID**: this needs to be a value with a prefix like shown below
69
+
-**Custom API**: This will be a look up to the custom API you created in Step 1.
70
+
-**Description**: This field is currently used by BizChat for plugin matching, so don’t leave it blank
71
+
72
+
Select **Save and close**. If you have additional operations, you can add those following the same steps.
73
+
74
+
:::image type="content" source="media/plugin-define-ai-operation.png" alt-text="Defile AI operations":::
75
+
76
+
### Step 4 – Package as a solution
77
+
78
+
Once you add all the required plugin metadata to your solution, make sure that you add your custom API to the same solution as well. This can be done in your solution, select **Add Existing** > **More** > **Other** > **CustomAPI** from the drop-down and select the custom API you created in Step 1.
79
+
80
+
Go to **Solutions** section in Power apps and select your solution. Then, select **Export** from the menu > select **Managed**. You can download the exported zip file and import into another test environment and test your changes.
Formula columns are columns that display a calculated value in a Microsoft Dataverse table. Formulas use [Power Fx](/power-platform/power-fx/overview), a powerful but human-friendly programming language. Build a formula in a Dataverse formula column the same way you would build a formula in Microsoft Excel. As you type, Intellisense suggests functions and syntax, and even helps you fix errors.
1. Sign in to Power Apps at [https://make.powerapps.com](https://make.powerapps.com/?utm_source=padocs&utm_medium=linkinadoc&utm_campaign=referralsfromdoc).
32
24
1. Select **Tables**, and then select the table where you want to add a formula column. [!INCLUDE [left-navigation-pane](../../includes/left-navigation-pane.md)]
33
25
1. Select the **Columns** area, and then select **New column**.
34
26
1. Enter the following information:
35
-
36
27
- A **Display name** for the column.
37
28
- Optionally, enter a **Description** of the column.
38
-
- In **Data type**, select ***fx* Formula**.
39
-
- Enter the formula in the **Formula** box.
29
+
1. For **Data type** select ***fx* Formula**.
30
+
1. Type the formula or use formula suggestions:
31
+
32
+
# [Type a formula](#tab/type-or-paste)
33
+
34
+
Enter the Power Fx formula in the **Formula** box. More information: [Type a formula](#type-a-formula-1)
35
+
36
+
# [Get formula suggestions (preview)](#tab/natural-language)
a. Select the up and down arrows, and then select **Get formula suggestions**.<br />
40
+
:::image type="content" source="media/formula-suggestions-selector.png" alt-text="Select the formula suggestions selector":::
41
+
b. Type your question, such as *what is the Price times Quantity*, in the **Get formula suggestions** box. More information: [Get formula suggestions (preview)](#get-formula-suggestions-preview-1)
42
+
43
+
---
44
+
45
+
7. Select additional properties:
40
46
- Select **Searchable** if you want this column to be available in views, charts, dashboards and Advanced Find.
41
47
-**Advanced options**:
42
-
- If the formula entered evaluates to a decimal value, expand **Advanced options** to change the number of points of precision, between 0 and 10. The default value is 2.
43
-
5. Select **Save**.
48
+
- If the formula evaluates to a decimal value, expand **Advanced options** to change the number of points of precision, between 0 and 10. The default value is 2.
49
+
8. Select **Save**.
50
+
51
+
### Type a formula
44
52
45
53
The following example creates a formula column called *Total price*. The *Number of units* column is a whole number data type. The *Price* column is a decimal data type.
46
54
@@ -54,6 +62,62 @@ The formula that you enter determines the column type. You can't change a column
54
62
55
63
For example, the formula *price * discount* creates a column type of number. You can change *price * discount* to *price * (discount + 10%)* because that doesn't change the column type. However, you can't change *price * discount* to *Text(price * discount)* because that would require changing the column type to string.
Describe what you want the formula to do and get AI generated results. Formula suggestions accepts your natural language input to interpret and suggest a Power Fx formula using GPT-based AI model.
70
+
71
+
> [!IMPORTANT]
72
+
> This is a preview feature available only in US regions only.
> Currently, formula suggestions that reference a single table are supported. Formula suggestions that reference a column on a related table aren't supported.
77
+
78
+
#### Example natural language input
79
+
80
+
Imagine there's a **Customer rating** column that shows their rating by account.
In the **Get formula suggestions** box enter the formula in natural language, such as *If the rating on the rating column is equal or greater than 5 then indicate as Good and if less than 5 indicate as Average and if value is blank or zero then display as Bad*, and then select the arrow button (enter).
0 commit comments