Events¶
Events are triggered when specific actions occur during a conversation with the Virtual Assistant or when specific events are triggered on any active channels.
To access Events, navigate to Automation AI > Virtual Assistant > Conversation Intelligence > Events.
Event Actions¶
Developers can define what action the VA should take when an event is triggered using one of the following options:
Initiate a Task¶
Select a Dialog task (Standard or Hidden) to be invoked when the event triggers. Once the event is triggered, the dialog starts executing. If it is interrupted by other intent detections, the Hold and Resume settings come into play. During execution, the event is discarded if the selected Dialog is not published in the VA.
In some cases, the Dialog may not be available to the user during a conversation for various reasons, such as the task not being published, suspended, or simply not having been assigned to the user. In such cases, the VA shows an error message that the task is not currently available for execution.
Developers can preempt such situations by testing the VA in Debug mode. The Debug Console shows full details about the error, including why the task is not available.
Run a Script¶
Define a JavaScript to run when the event triggers. The script can use all applicable components, such as session, context objects, variables, and functions. You can also fix the code using the Debug mode.
Show a Message¶
When the event triggers, define a simple or advanced message for the user. It supports all messaging formatting features available in the XO Platform, including multiple messages with channel override options.
Multilingual VA Behavior for Messages¶
- You can define language-specific messages;
- If a message is deleted from an Event for a specific language, then it will be removed from all other languages of the VA;
- If a message is added for a language, then the message would be added in all other languages using the same content;
- If a message is modified in a language, the modifications will be applied only to that language. Learn more.
Event Types¶
Events are classified as Intent Events, Conversation Events, and Sentiment Events.
You can configure the following events to trigger responses:
EVENT | TRIGGER |
Intent Events | |
Intent not Identified | Runs every time the VA cannot understand the user’s intent. |
Ambiguous Intents Identified | On identifying ambiguous intents from the user utterance |
Conversation Events | |
End of Task | On completing a task (Dialog Task or FAQ) |
Task Execution Failure | On encountering an error in dialog task execution like:
|
RCS Opt-in Event | On receiving the message that a user has opted for the RCS Messaging channel. |
RCS Opt-out Event | On receiving the message that a user has opted out of the RCS Messaging channel. |
Repeat Bot Response Event | On identifying the user's request to repeat the bot responses. |
Sentiment Events | |
You can define multiple sentiment events. Click + New Event to define an event based on which to capture the user’s emotion. |
Event Configuration¶
Intent Events¶
Intent not Identified¶
When the VA cannot understand the user’s intent, this event determines the subsequent behavior. You can choose one of the following options:
- Show a standard message from the standard responses. Learn more.
- Automatically run a dialog task. You can use the dropdown to select the task you want to run.
Ambiguous Intents Identified¶
When the NLP engine identifies ambiguous intents from user utterances, by default, the virtual assistant displays a list of those intents during the conversation and requests the user to make a selection.
This default behavior is ideal for most of the use cases. However, using the Ambiguous Intents Identified event, you can customize this behavior for specific use cases. The event is triggered in the following scenarios:
- Two or more ‘definite’ intents are identified.
- Two or more ‘possible’ intents are identified and their scores lie within the defined proximity thresholds.
- Only low-confidence intents are identified from the Knowledge Graph, and no other intents are identified from other engines.
You can build custom business logic to analyze ambiguous intents, define appropriate conversation flow using a Dialog Task, and associate it with the Ambiguous Intents Identified event.
By customizing the flow, you can avoid displaying ambiguous intents to the end user and redirect the conversation to the desired task. You can use the koreUtil.getAmbiguousIntents()
function to retrieve the list of ambiguous intents and their confidence scores. For more information on the function, click here.
Event Configuration¶
To configure the Ambiguous Intents Identified event follow these steps:
- Go to Conversation Intelligence > Events > Intent Events. By default, this event is disabled for all existing and new VA..
-
Click Configure to enable the event.
Note
If not enabled, the list of ambiguous intents is presented to the user during the conversation.
-
You can select the following options in the Configuration panel:
-
Present all the qualified intents to the end-user for disambiguation: This is the default selection in which the standard response related to the ambiguous intent(s) is presented. Learn more.
-
Automatically run a Dialog Task: This option lets you select a Dialog Task. Select this option if you want to build custom business logic to analyze the ambiguous intents, define appropriate conversation flow using a Dialog Task, and associate it with the Ambiguous Intents Identified event. Learn more.
-
-
Click the button Save & Enable to enable the event.
Note
During the conversation with your Virtual Assistant, if there are ambiguous intents, a message is displayed in the Debug Log that Multiple intents are identified, and the Ambiguous Intents Identified event is initiated.
Interruption Management¶
When the event is enabled, interruption behavior is handled as defined at the node, dialog, or VA level for ambiguous intents.
The only exception is when you select the Continue the current task and add a new task to the follow-up task list option. The conversation continues as is with the current task, and any interrupting task will not be added to the follow-up list. Learn more.
Conversation Events¶
End of Task¶
End of Task is triggered when the VA is not expected to send any message to the user or receive any message from the user.
A new flag indicating the reason for ending the task, added to the end of task event, will help decide the end of the conversation behavior. Client-side implementations of BotKits, RTM, and Webhook channels can use this reason for the task completion flag to determine an appropriate course of action.
On triggering this event, the context will be updated with the following details:
- Reason for triggering event (see the table below).
- Name of the task that has just ended. If it’s an FAQ, then the task name will be set to ‘FAQ’.
SCENARIO | END OF TASK FLAG |
Reached the last node of the dialog | Fulfilled |
The task is canceled by the user | Canceled |
Error in a task or FAQs execution (without Task Failure Event, no hold tasks) | Failed |
Linked dialog completed without returning to the parent dialog | Fulfilled_LinkedDialog |
On answering a FAQ | Fulfilled |
Successful event execution with Run Script or Show Message (no tasks on hold) | Fulfilled_Event |
Error in executing an event with Run Script or Show Message (no tasks on hold) | Failed_Event |
The user declines to resume the on-hold task (when no other task is on hold) | Canceled |
Task Execution Failure Event¶
- By default, this event is always enabled with the Show Message option. This event cannot be disabled.
-
This VA-level behavior can be overridden for specific tasks by defining task-specific failure events from the dialog task settings. Learn more.
RCS Opt-In / Opt-Out Events¶
These events trigger on receiving opt-in or opt-out requests from users via the RCS channel. These events allow you to configure a response to be sent to the user as a follow-up for their action.
Repeat Bot Response Event¶
The Repeat Bot Response event is triggered to repeat the last bot response when certain predefined or custom-trained utterances are detected in voice channels such as IVR, Audiocodes, or Twilio Voice.
To enable this event, the developer must define the context object as a precondition for triggering the event. This context object contains the specific set of utterances that should be recognized to repeat the bot’s most recent or last response.
By configuring the context object with appropriate utterances, the bot can understand specific phrases or keywords from the user to trigger the Repeat Bot Response event. When one of these utterances is detected, the bot will repeat the last response.
A developer can activate the Repeat Bot Response event and custom-train when this event can be triggered with conditions at any point in the conversation and can ask the bot to repeat its recent responses.
Note
The Repeat Bot Response event uses the NLU multilingual model for non-English languages.
The following are some of the scenarios and the repeat bot response event behavior in those scenarios:
SCENARIO | REPEAT BOT RESPONSE EVENT BEHAVIOR |
In the middle of the conversation | Repeat event gets triggered. |
Conflict between Intent and Repeat event | Intent gets prioritized. |
Conflict between Sub-Intent and Repeat | Sub-intent gets prioritized. |
Conflict between FAQ and Repeat event | FAQ gets prioritized. |
Conflict between group node sub-intent and repeat event | Group node sub-intent gets prioritized. |
If the repeat event is enabled in a Standard VA and disabled in the Universal Bot (UB) | UB settings take precedence, and the event defined in UB is triggered even if the current conversation context is in a Linked Bot. |
Use Case Scenario¶
Problem Statement
In the Flight Booking VA, the user couldn’t hear the last response on an IVR channel, and the user said, "Sorry, I can't hear you. Can you please repeat it again?"
In this conversation, the dialog has reached the end, and the last response says, "Thank you. Your flight has been booked successfully. Your booking reference number is XYZ789 and you will receive a message shortly "
(Dialog reached to END).
Solution
If the conversation session is not closed or the call is not disconnected after the end of the dialog, the Repeat Bot Response event is triggered, and the last message of the dialog task is repeated when you configure a task in the End of Task event with a message that says "Is there anything else I can help you with?"
. For more information, see the End of Task section.
Now the ‘Repeat Bot Responses’ event considers the end of dialog after the ‘Last User Input’ configuration, the repeat response will say, "Thank you. Your flight has been booked successfully. Your booking reference number is XYZ789 and you will receive a message shortly. Is there anything else I can help you with?".
Enabling the Repeat Bot Response Event¶
The developer uses the Repeat Bot Response to allow you to repeat the responses that users might have missed or if it is not clear during the conversation on an IVR channel.
Steps to Enable the Repeat Bot Response Event
- Navigate to Conversation Intelligence > Events.
-
Turn on the toggle to enable the to enable the Repeat Bot Response Event.
-
Click Manage Utterance to review the pre-trained utterances that are added to the VA by default.
-
Once Utterances are trained, you can add the following preconditions:
- Channels – Allows you to add voice channels such as IVR, IVR Audiocodes, or Twilio Voice.
- Context Tags – Allows you to add the context objects to trigger the Repeat Bot Response event. For more information, read the Context Object article.
Note
The context tags are added to trigger the repeat bot responses whenever the dialog task with that particular context is executed. For example, when a book a flight dialog task is executed, then the context tag will trigger the repeat bot response event for that particular dialog task.
- Select the Event Configuration options to define how to repeat the response:
- Repeat Only Last Bot Response – By default, this option is selected with a filler message: "Sure, I will repeat it for you." You can edit or add the filler message for the repeat bot response event before it is triggered.
- Click +Add Filler Message, select the IVR channel, enter the filler messages and then click Done.
- When the Repeat Bot Response event is triggered, these filler messages are used in the IVR channel conversation before repeating the response.
- Auto-generate Response – When you select this option, you are redirected to enable the Advanced NLU model, if not enabled, to generate the bot response using the LLM and Generative AI engine.
- Click Enable Now to define the Advanced NLU Settings for the LLM and Generative model and enable the Repeat Responses feature.
Note
When the Auto-generate response option is enabled, the repeat bot response event will not use the filler messages that were defined in the previous step. The responses are automatically sent from the LLM and Generative model when the event is triggered.
- Expand the Advanced Settings and define the following options to repeat the response:
- Repeat Attempts Limit – Set the number of retry attempts to repeat a response. The accepted value is between 1 and 10. The default is 5.
- Behavior on Exceeding Repeat Attempts – Define what VA must do after exceeding the number of retry attempts to repeat the response. You can choose either the End of Dialog or Initiate Dialog option. When you select the Initiate Dialog option, you can choose the task to which the conversation must be redirected after a number of retry attempts to repeat.
- Click Save & Enable to trigger the Repeat Bot Response event with the configurations.
Sentiment Events¶
Refer to Sentiment Events for Sentiment Management.
Variable Namespaces¶
You can configure Variable Namespaces for Events by going to More Options > Manage Variable Namespaces at the top of the Events screen.
You can use the Manage Variable Namespaces to associate the Variable Namespaces to be used with the Events. This option will be visible only when the Variable Namespace is enabled for the VA. For more information. Learn more.