This repository has been archived by the owner on Jun 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Docs] Added activity flow doc (#2740)
* updated docs * Update 4-edit-your-cognitive-models.md
- Loading branch information
1 parent
ec8b46c
commit a2cf1e2
Showing
5 changed files
with
64 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
category: Virtual Assistant | ||
subcategory: Handbook | ||
title: Activity Handling | ||
description: Manage routing incoming activities, including handling interruptions. | ||
order: 1 | ||
toc: true | ||
--- | ||
|
||
# {{ page.title }} | ||
{:.no_toc} | ||
{{ page.description }} | ||
|
||
## Introduction | ||
The Virtual Assistant provides foundational logic for handling incoming user activities. It uses a combination of concepts from the Bot Builder SDK v4 and base classes that enable additional scenarios. | ||
|
||
## Adapters and Middleware | ||
Incoming activities are initially received through the BotAdapter implementation, processed through the configured Middleware pipeline, then routed onto the Assistant's dialog stack. The **DefaultAdapter** in the Virtual Assistant template provides a set of Middleware out of the box including the following: | ||
|
||
- **Telemetry Middleware** - Configures Application Insights telemetry logging. | ||
- **Transcript Logger Middleware** - Configures conversation transcript logging. | ||
- **Show Typing Middleware** - Sends typing indicators from the bot. | ||
- **Feedback Middleware** - Configures the [Feedback]({{site.baseurl}}//virtual-assistant/feedback) feature. | ||
- **Set Locale Middleware** - Configures the CurrentUICulture to enable localization scenarios. | ||
- **Event Debugger Middleware** - Enables debugging for event activities. | ||
|
||
## Activity Handler | ||
After the activity is processed by the Adapter and Middleware pipeline, it is received by the **ActivityHandler** implementation. The **DefaultActivityHandler** in the template implements the TeamsActivityHandler which enables Teams scenarios out of the box. By default, the **DefaultActivityHandler** passes the incoming message into the **MainDialog**. However, this logic can be customized as needed. | ||
|
||
## Dialogs | ||
The **DefaultActivityHandler** passes incoming activities into the **MainDialog**. **MainDialog** implements the **ActivityHandlerDialog**, which provides its own routing logic for handling activities of different types, as well as enables interruptions. The following diagram shows how the activities flow through the different methods in **MainDialog**: | ||
|
||
![]({{site.baseurl}}/assets/images/virtual-assistant-main-dialog-flow.png) | ||
|
||
### Interruptions | ||
Once an activity flows into MainDialog, one of the first methods that will be called is OnInterruptDialogAsync(). The following interruptions are configured out of the box: | ||
- **Switching between Skills** - Switches between connected skills based on intent. | ||
- **Cancellation** - Cancels the current dialog. | ||
- **Help** - Sends a help message, then resumes the waiting dialog. | ||
- **Escalation** - Shows an escalation message. | ||
- **Log out** - Logs the user out. | ||
- **Repeat** - Repeats the last set of activities from the bot. Useful for speech scenarios. | ||
- **Start over** - Starts the current dialog over. | ||
- **Stop** - Can be implemented to stop readout in speech scenarios. | ||
|
||
### Activity Routing | ||
Once interruptions are evaluated, the activity is processed according to its activity type: | ||
|
||
- **OnMessageActivityAsync()** - Any incoming message activities that were not handled by a waiting dialog. | ||
- **OnMembersAddedAsync()** - Any incoming conversation update activity. Used for introduction logic. | ||
- **OnEventActivityAsync()** - Any incoming event activity | ||
- **OnUnhandledActivityTypeAsync()** - Any other incoming activity. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+173 KB
docs/assets/images/analytics/virtual-assistant-analytics-powerbi-13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.