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
+59-20Lines changed: 59 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -131,13 +131,13 @@ This section creates the fallback topic conversation flow.
131
131
132
132
## Create Power Automate Flow to connect to your knowledge base
133
133
134
-
The following procedure creates an action that:
134
+
The following procedure creates a **Power Automate** flow that:
135
135
* takes the incoming user text
136
136
* sends it to QnA Maker
137
137
* assigns the QnA Maker response to a variable
138
138
* sends only the top answer as the response back to your agent
139
139
140
-
1. In **Power Automate**, the **Flow Template** is started. On the **Power Virtual Agents** item, select **Edit** to configure the input variable coming from your agent to your knowledge base. The text-based input variable is the user-submitted text question from your agent.
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.
141
141
142
142
> [!div class="mx-imgBorder"]
143
143
> 
@@ -154,7 +154,7 @@ The following procedure creates an action that:
154
154
> [!div class="mx-imgBorder"]
155
155
> 
156
156
157
-
The connections settings for QnA Maker appear in the action.
157
+
The three (3) required connections settings for QnA Maker appear in the action and the question settings from the virtual agent..
158
158
159
159
> [!div class="mx-imgBorder"]
160
160
> 
@@ -181,14 +181,16 @@ The following procedure creates an action that:
181
181
182
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.
183
183
184
+
1. Search for and select **Set variable**.
185
+
184
186
1. In the **Set variable** box, select the text box for **Name**, then select **OutgoingQnAAnswer** from the list.
185
187
186
188
Select the text box for **Value**, then select **Answers Answer** from the list.
187
189
188
190
> [!div class="mx-imgBorder"]
189
191
> 
190
192
191
-
1. To return the variable (and its value), select the **Return value(s) to Power Virtual Agent** then select **Add an output**. Select a **Text** output type then enter the **Title** of `FinalAnswer`. Select the text box for the **Value**, then select the `OutgoingQnAAnswer` variable.
193
+
1. To return the variable (and its value), select the **Return value(s) to Power Virtual Agent**flow item then select**Edit**, then**Add an output**. Select a **Text** output type then enter the **Title** of `FinalAnswer`. Select the text box for the **Value**, then select the `OutgoingQnAAnswer` variable.
192
194
193
195
> [!div class="mx-imgBorder"]
194
196
> 
@@ -201,37 +203,38 @@ In order for the Power Virtual Agent to find and connect to the flow, the flow m
201
203
202
204
1. While still in Power Automate, select **Solutions** from the left-side navigation.
203
205
204
-
1. Select **+ New solution** and configure the solution. Select **Create** to finish the process.
206
+
1. Select **+ New solution**.
205
207
206
-
> [!div class="mx-imgBorder"]
207
-
> 
208
+
1. Enter a display name. The list of solutions includes every solution in your organization or school. Choose a naming convention that helps you filter to just your solutions such as prefixing your email to your solution name: `jondoe-power-virtual-agent-qnamaker-fallback`.
208
209
209
-
1.In the list of solutions, select the solution you just created. It should be at the top of the list.
210
+
1.Select your publisher from the list of choices.
210
211
211
-
1.In the solution, select **+ Add existing**, then select **Flow** from the list.
212
+
1.Accept the default values for the name and version.
212
213
213
-
1. Select the **Outside solutions** tab, then select the flow you just created. Select **Add** to finish the process.
214
+
1. Select **Create** to finish the process.
214
215
215
-
> [!div class="mx-imgBorder"]
216
-
> 
216
+
## Add flow to solution
217
+
218
+
1. In the list of solutions, select the solution you just created. It should be at the top of the list. If it isn't, search by your email name, which is part of the solution name.
219
+
220
+
1. In the solution, select **+ Add existing**, then select **Flow** from the list.
221
+
222
+
1. Find your flow, then select **Add** to finish the process. If there are many flows, look at the **Modified** column to find the most recent flow.
217
223
218
224
## Add solution's flow to Power Virtual Agent
219
225
220
226
1. Return to the browser tab with your Power Virtual Agent. The authoring canvas should still be open.
221
227
222
-
1. Select the **+** connector under the **Trigger Phrases** action box to insert a new step in the flow, then select **Call an action**.
223
-
224
-
> [!div class="mx-imgBorder"]
225
-
> 
228
+
1. Select the **+** connector under the **Message** action box to insert a new step in the flow, then select **Call an action**.
226
229
227
-
1. In the new action, select the input value of **UnrecognizedTriggerPhrase**.
230
+
1. In the new action, select the input value of **UnrecognizedTriggerPhrase**. This passes the text from the agent to the flow.
228
231
229
232
> [!div class="mx-imgBorder"]
230
233
> 
231
234
232
235
1. Select the **+** connector under the **Action** box to insert a new step in the flow, then select **Show a message**.
233
236
234
-
1. Enter the message text and the`FinalAnswer`from the Power Automate Flow.
237
+
1. Enter the `Your answer is:`message text and select`FinalAnswer`as a context variable using the function of the in-place toolbar.
235
238
236
239
> [!div class="mx-imgBorder"]
237
240
> 
@@ -245,10 +248,46 @@ The final canvas is shown below.
245
248
246
249
## Test Power Virtual Agent
247
250
248
-
Test the agent by typing in a question that your knowledge base can answer. The authoring canvas reports the successful steps with a green check mark.
251
+
1. In the test pane, toggle **Track between topics**. This allows you to watch the progression between topics as well as in topic.
252
+
253
+
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
+
255
+
|Question order|Test questions|Purpose|
256
+
|--|--|--|
257
+
|1|Hello|Begin conversation|
258
+
|2|Store hours|Sample topic - configured for you without any additional work on your part.|
259
+
|3|Yes|In reply to `Did that answer your question?`|
260
+
|4|Excellent|In reply to `Please rate your experience.`|
261
+
|5|Yes|In reply to `Can I help with anything else?`|
262
+
|6|What is a knowledge base?|This question triggers the fallback action which sends the text to your knowledge base to answer, then the answer is displayed. |
249
263
250
264
> [!div class="mx-imgBorder"]
251
-
> [](../media/how-to-integrate-power-virtual-agent/power-virtual-agent-test.png#lightbox)
0 commit comments