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
Copy file name to clipboardExpand all lines: articles/cognitive-services/QnAMaker/Tutorials/integrate-with-power-virtual-assistant-fallback-topic.md
+26-34Lines changed: 26 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,13 +20,13 @@ Create and extend a [Power Virtual Agent](https://powervirtualagents.microsoft.c
20
20
> * Publish Power Virtual Agent
21
21
> * Test Power Virtual Agent, recieve answer from QnA Maker knowledge base
22
22
23
-
## Integrate a Power Virtual agent with a knowledge base
23
+
## Integrate a Power Virtual Agent with a knowledge base
24
24
25
25
[Power Virtual Agents](https://powervirtualagents.microsoft.com/) allows teams to easily create powerful bots using a guided, no-code graphical interface without the need for data scientists or developers.
26
26
27
27
A Power Virtual Agent is created with a series of topics (subject areas), in order to answer user questions by performing actions. If an answer can't be found, a system fallback can return an answer.
28
28
29
-
Configure the agent to send the question to your knowledge base as part of a topic's action or as part of the System Fallback topic path. They both use the same mechanism of an action to connect to your knowledge base and return an answer.
29
+
Configure the agent to send the question to your knowledge base as part of a topic's action or as part of the **System Fallback** topic path. They both use the same mechanism of an action to connect to your knowledge base and return an answer.
30
30
31
31
## Power Automate connects to GenerateAnswer action
32
32
@@ -36,7 +36,7 @@ Once the **flow** is designed and saved, it is available from a Power Automate *
36
36
37
37
## Process steps to connect an agent to your knowledge base
38
38
39
-
The following steps are presented as an overview to help you understand how the steps relate the goal of connecting Power Virtual Agent to a QnA Maker knowledge base.
39
+
The following steps are presented as an overview to help you understand how the steps relate to the goal of connecting a Power Virtual Agent to a QnA Maker knowledge base.
40
40
41
41
Steps to use a Power Virtual agent with QnA Maker:
42
42
* In [QnA Maker](https://www.qnamaker.ai/) portal
@@ -60,36 +60,34 @@ Steps to use a Power Virtual agent with QnA Maker:
60
60
61
61
## Create and publish a knowledge base
62
62
63
-
Follow the [quickstart](../Quickstarts/create-publish-knowledge-base.md) to create a knowledge base. Do not complete the last section to create a bot. This tutorial uses the Power Virtual Agent instead of the Bot Framework bot in the quickstart.
63
+
1.Follow the [quickstart](../Quickstarts/create-publish-knowledge-base.md) to create a knowledge base. Do not complete the last section to create a bot. This tutorial is a replacement for the last section of the quickstart because this tutorial uses the Power Virtual Agent to create a bot, instead of the Bot Framework bot in the quickstart.
64
64
65
-
## Get your published knowledge base information
66
-
67
-
Before you build your agent, create and publish your knowledge base. Next, find the endpoint key, endpoint host, and knowledge base ID on the **Settings** page in the QnA Maker portal.
65
+
> [!div class="mx-imgBorder"]
66
+
>  portal.](../media/how-to-integrate-power-virtual-agent/published-knowledge-base-settings.png)
68
67
69
-
> [!div class="mx-imgBorder"]
70
-
>  portal.](../media/how-to-integrate-power-virtual-agent/published-knowledge-base-settings.png)
68
+
You will need this information for the [Power Automate step](#create-power-automate-flow-to-connect-to-your-knowledge-base) to configure your QnA Maker GenerateAnswer connection.
71
69
72
-
You will need this information for the [Power Automate step](#create-power-automate-flow-to-connect-to-your-knowledge-base) to configure your QnA Maker GenerateAnswer connection.
70
+
1. Find the endpoint key, endpoint host, and knowledgebase ID on the **Settings** page in the QnA Maker portal.
73
71
74
72
## Create Power Virtual Agent
75
73
76
74
1.[Sign into](https://go.microsoft.com/fwlink/?LinkId=2108000&clcid=0x409) the Power Virtual Agent with your school or work email account.
77
-
1. If this is not your first Power Virtual Agent, select the bot from the top-right navigation and select **+ New Bot**. If this is your first bot, you should be on the **Home** page of the agent.
75
+
1. If this is your first bot, you should be on the **Home** page of the agent. If this is not your first Power Virtual Agent, select the bot from the top-right navigation and select **+ New Bot**.
78
76
79
77
> [!div class="mx-imgBorder"]
80
78
>  portal.](../media/how-to-integrate-power-virtual-agent/power-virtual-agent-home.png)
81
79
82
80
## Several topics are provided in the bot
83
81
84
-
The agent uses the topic collection to answer questions in your subject area. In this tutorial, the agent has many topics provided for divided into **User Topics** and **System topics**.
82
+
The agent uses the topic collection to answer questions in your subject area. In this tutorial, the agent has many topics provided for you, divided into **User Topics** and **System topics**.
85
83
86
84
> [!div class="mx-imgBorder"]
87
85
> 
88
86
89
87
90
88
## Create Power Virtual Agent's System fallback topic
91
89
92
-
While the agent can connect to your knowledge base from any topic, this tutorial uses the System **Fallback** topic. The fallback topic is used when the agent can't find an answer in the current topic. The agent passes the user's text to QnA Maker's GenerateAnswer API, receives the answer, and displays it back to the user as a message.
90
+
While the agent can connect to your knowledge base from any topic, this tutorial uses the System **Fallback** topic. The fallback topic is used when the agent can't find an answer. The agent passes the user's text to QnA Maker's GenerateAnswer API, receives the answer from your knowledge base, and displays it back to the user as a message.
93
91
94
92
1. In the [Power Virtual Agents](https://powerva.microsoft.com/#/) portal, on the top-right corner of the navigation, select the **Settings** page. The icon for this page is the gear. Select **System Fallback**.
95
93
@@ -108,7 +106,7 @@ While the agent can connect to your knowledge base from any topic, this tutorial
108
106
109
107
## Use authoring canvas to add an action
110
108
111
-
Use the Power Virtual Agents authoring canvas to connect the Fallback topic to your knowledge base. The topic starts with the **unrecognized user text**. Add an action that passes that text to QnA Maker, then shows the answer as a message. The last step of displaying an answer is handled as a separate step later.
109
+
Use the Power Virtual Agents authoring canvas to connect the Fallback topic to your knowledge base. The topic starts with the **unrecognized user text**. Add an action that passes that text to QnA Maker, then shows the answer as a message. The last step of displaying an answer is handled as a [separate step](#add-solutions-flow-to-power-virtual-agent) later in this tutorial.
112
110
113
111
This section creates the fallback topic conversation flow.
114
112
@@ -127,17 +125,15 @@ This section creates the fallback topic conversation flow.
127
125
> [!div class="mx-imgBorder"]
128
126
> 
129
127
130
-
A new browser window opens to the **Power Automate** portal.
131
-
132
128
## Create Power Automate Flow to connect to your knowledge base
133
129
134
130
The following procedure creates a **Power Automate** flow that:
135
131
* takes the incoming user text
136
132
* sends it to QnA Maker
137
-
* assigns the QnA Maker response to a variable
138
-
* sends only the top answer as the response back to your agent
133
+
* assigns the QnA Maker top answer to a variable
134
+
* sends the variable (top answer) as the response back to your agent
139
135
140
-
1. In **Power Automate**, the **Flow Template** is started. On the **Power Virtual Agents** flow item, select **Edit** to configure the input variable coming from the agent to your knowledge base. The text-based input variable is the user-submitted text question from your agent.
136
+
1. In **Power Automate**, the **Flow Template** is started for you. On the **Power Virtual Agents** flow item, select **Edit** to configure the input variable coming from the agent to your knowledge base. The text-based input variable is the user-submitted text question from your agent.
141
137
142
138
> [!div class="mx-imgBorder"]
143
139
> 
@@ -154,7 +150,7 @@ The following procedure creates a **Power Automate** flow that:
154
150
> [!div class="mx-imgBorder"]
155
151
> 
156
152
157
-
The three (3) required connections settings for QnA Maker appear in the action and the question settings from the virtual agent..
153
+
The three (3) required connection settings for QnA Maker appear in the action and the question settings from the Power Virtual Agent.
158
154
159
155
> [!div class="mx-imgBorder"]
160
156
> 
@@ -166,7 +162,7 @@ The following procedure creates a **Power Automate** flow that:
166
162
167
163
1. To configure the **Question**, select the text box, then select the `InputText` from the list.
168
164
169
-
1.Select the **+** connector flowing from the **Generate answer** action box to insert a new step in the flow, then select **Add an action**.
165
+
1.To insert a new step in the flow, select the **+** connector flowing from the **Generate answer** action box, then select **Add an action**.
170
166
171
167
1. To add a variable to capture the answer text returned from GenerateAnswer, search for and select the `Initialize variable` action.
172
168
@@ -175,15 +171,13 @@ The following procedure creates a **Power Automate** flow that:
175
171
> [!div class="mx-imgBorder"]
176
172
> 
177
173
178
-
1. Select the **+** connector flowing from the **Initialize variable** action box to insert a new step in the flow, then select **Add an action**.
179
-
180
-
1. To set the knowledge base answer to the variable, search for and select the`Apply to each` action.
174
+
1. To insert a new step in the flow, select the **+** connector flowing from the **Initialize variable** action box, then select **Add an action**.
181
175
182
-
Select the GenerateAnswer `answers`, which is the entire JSON from the GenerateAnswer API call. In the same **Apply to each** box, select **Add an action**. This subsequent action gets only the top answer and sets that to the variable.
176
+
1. To set the entire knowledge base JSON response to the variable, search for and select the`Apply to each`action. Select the GenerateAnswer `answers`.
183
177
184
-
1. Search for and select **Set variable**.
178
+
1.To return only the top answer, in the same **Apply to each** box, select **Add an action**. Search for and select **Set variable**.
185
179
186
-
1. In the **Set variable** box, select the text box for **Name**, then select **OutgoingQnAAnswer** from the list.
180
+
In the **Set variable** box, select the text box for **Name**, then select **OutgoingQnAAnswer** from the list.
187
181
188
182
Select the text box for **Value**, then select **Answers Answer** from the list.
189
183
@@ -201,7 +195,7 @@ The following procedure creates a **Power Automate** flow that:
201
195
202
196
In order for the Power Virtual Agent to find and connect to the flow, the flow must be included in a Power Automate Solution.
203
197
204
-
1. While still in Power Automate, select **Solutions** from the left-side navigation.
198
+
1. While still in the Power Automate portal, select **Solutions** from the left-side navigation.
205
199
206
200
1. Select **+ New solution**.
207
201
@@ -234,7 +228,7 @@ In order for the Power Virtual Agent to find and connect to the flow, the flow m
234
228
235
229
1. Select the **+** connector under the **Action** box to insert a new step in the flow, then select **Show a message**.
236
230
237
-
1. Enter the `Your answer is:` message text and select `FinalAnswer` as a context variable using the function of the in-place toolbar.
231
+
1. Enter the message text, `Your answer is:`, and select `FinalAnswer` as a context variable using the function of the in-place toolbar.
238
232
239
233
> [!div class="mx-imgBorder"]
240
234
> 
@@ -248,7 +242,7 @@ The final canvas is shown below.
248
242
249
243
## Test Power Virtual Agent
250
244
251
-
1. In the test pane, toggle **Track between topics**. This allows you to watch the progression between topics as well as in topic.
245
+
1. In the test pane, toggle **Track between topics**. This allows you to watch the progression between topics as well as in a single topic.
252
246
253
247
1. Test the agent by entering the user text in the order provided below. The authoring canvas reports the successful steps with a green check mark.
254
248
@@ -266,11 +260,9 @@ The final canvas is shown below.
266
260
267
261
## Publish your bot
268
262
269
-
In order to make the agent available to all members of your school or organization, you need to publish it to a channel.
270
-
271
-
1. Select **Publish** from the left-navigation.
263
+
In order to make the agent available to all members of your school or organization, you need to publish it.
272
264
273
-
1. Select **Publish** on the page.
265
+
1. Select **Publish**from the left-navigation, then select **Publish**on the page.
274
266
275
267
1. Try your bot on the demo website, provided as a link below the **Publish** button .
0 commit comments