Choosing what to do at the end of a step
By default, the steps in an action are executed in sequence from first to last. However, you can change this default in order to change what happens next. Used in combination with step conditions, this capability makes it possible for the conversation to follow many different flows depending on the customer's input.
To specify what happens when a step finishes, click And then.
Select an option from the drop-down list. The following options are available:
- Continue to next step
- Re-ask previous step(s)
- Go to a subaction
- Use an extension
- Search for the answer
- Connect to agent
- End the action
Continue to next step
This option processes the next step in the steps list. As always, the conditions for the next step are evaluated first to determine whether to show the step's response to the customer. This is the default selection.
Re-ask previous step(s)
This option repeats one or more steps that are listed earlier in the current action. These might be steps that the customer already completed, or steps that were skipped previously based on their step conditions.
You can use this option to handle situations where the customer has made a mistake and asks to go back to a previous point in the conversation. For example, you might include a confirmation step at the end of a process that asks the user whether the collected information is correct; if the user says no, you can return to the beginning of the process. This option is only available from a step that comes third or later in the steps list.
To repeat previous steps:
-
In the And then field, select Re-ask previous step(s).
-
In the Settings window, click to select any previous steps you want to repeat. You can select any step that precedes the step you are editing.
Note that only the selected steps will repeat, regardless of their And then settings. Therefore, if you want to repeat the entire action up to this point, you must select all of the previous steps.
The current step you are editing is automatically included in the list of steps to be repeated. To avoid an infinite loop, use step conditions to ensure that this step only executes when it is appropriate for previous steps to be repeated. For example, you might have a step that repeats previous steps only if the user answered
No
to a confirmation question; this way, if the user answersYes
, nothing is repeated and the action continues. -
Click Apply.
Any session variable values that were defined based on choices that the customer made in the repeated steps are cleared and replaced with the new responses.
There is no option to jump to a later step. Instead of jumping directly to a later step, control the flow through the intervening steps with step conditions or skipping steps.
Go to a subaction
An action that is called from another action is referred to as a subaction. This option switches the conversation flow to another action. If you have an action flow that can be applied across multiple actions, you can use a subaction to build it once and then call it from each action that needs it. For example, as part of an action to place an order, you might call a subaction that enables a new customer to create an account.
To call a subaction:
-
In the And then field, select Go to a subaction.
-
In the Settings window, click the Go to field and select the action that you want to call.
-
If you do not want to continue with the current action, click End this action after the other action is completed. You might use this option in cases where the customer decides to do something different; in this case, you want the conversation flow to switch to the subaction and not return.
By default, the assistant returns to the current action after the subaction completes. Any action variables or session variables that are defined in the subaction are accessible from subsequent steps in the calling action.
-
Click Apply.
Passing values to a subaction
Optionally, you can pass values to the subaction so the customer does not need to specify them again. For example, if your order-placement action collects the customer's name, you can then pass that information to the account-creation subaction. The step in the subaction that asks for the customer's name is skipped, and the value that is already specified is used instead.
External skill providers must implement the Get Conversational Skill endpoint to use this feature. For more information, see Get Conversational Skill.
To pass values to the subaction:
-
Click Edit passed values.
-
In the Edit passed variables window, click Set new value.
-
Select an action variable that you want to pass a value for. (The available action variables are based on the customer responses that are defined in the subaction.)
-
Select the value that you want to pass from the current action. You can select any available variable, or select Expression if you want to specify a different value.
-
Click Apply.
You can choose to hide or display the skill output that is stored as an assistant variable. Click Response behavior and select your choice.
Use an extension
You can call an extension that has been added to your assistant in order to interact with an external service. For example, you might use an extension to interact with a ticketing or customer relationship management (CRM) system, or to retrieve real-time data such as mortgage rates or weather conditions. For more information about calling an extension, see Calling an extension.
Search for the answer
Plus
This option indicates that the assistant can use a search integration to search an external data source for information that is related to the customer's question.
For more information about configuring search integration, see Adding search.
Configuring the responses
Perform the following procedure to configure how the responses are stored and displayed:
-
In the And then field go to Search for answer.
-
Click Edit settings > After Generation.
-
Enable conversational search to do post-processing.
-
You can configure settings in 3 different ways to store or display your responses after generation.
-
Only display the results and not store it.
Select this option to display the response to the end user without storing it in an action variable.
-
Display and store the result.
Select this option to store the response in an action variable and display it to your user.
-
Only store and do not display
Select this option to store the response in an action variable only and do not display the response to the user.
-
When you are storing the response, you can choose to expand the citations to see the full search results. Use the Search results check box to include or exclude the full search results in the stored action variable. The exclude option is selected by default.
Conditioning the responses
You can view the action variable that will store the response under Conditions. You can see the list of conversational search responses in an action as Conversational search (step n), where n
is the number of the current step.
You can have multiple conversational searches in a single action. Click Conversational search(step n) to add a condition to the search status, to the search response text or to the action variable that will store the conversational search response.
Conversational search status
When storing the results of a conversational search, the search response will contain a search status corresponding to the results of the search. The possible values of this status field are:
- Generated and below confidence threshold
- Generated and above confidence threshold
- Failed to generate: no search results
- Failed to generate: search result confidence too low
- Failed to generate: unable to connect to search system or got error
Conversational search response
It is the text displayed as a response for your conversational search query.
Conversational search response type
A conversational search response type is available in actions where a conversational search step exists and the search results are saved in an action variable for post-processing. You can select the overall conversational search response to use in the response type. You can choose from the list of available conversational search responses.
Even if streaming is enabled in an assistant, when using this new response type, the output will not be streamed.
You can print the results of the individual components of your search results by defining them in the Variable values in the rich text editor window. The printed results will not be formatted like they are in the response type, but is printed just as a string of text.
In the preview, go to Variable values > Action variables to view the action variables.
For a conversational search step which stores the response, selecting end action after step will not be honored. If the action should end after a conversational search occurs, use the default after generation setting Display the response to the end user without storing it in an action variable.
Connect to agent
This option indicates that the assistant should transfer the conversation to a human agent. For more information, see Connecting to a live agent.
End the action
This option indicates that this action is complete. Any action variable values that were defined based on choices that the customer made during the action are reset.
This option can be applied to more than one step in a single action because an action can define more than one branch of a conversation, controlled by step conditions. For example, the open an account action might have one conversational flow for creating a checking account and a separate one for creating a savings account. Each branch might have its own final step. Identifying the final step helps analytical tools that follow a customer's progress through an action to identify the success or failure of the action.
Using “End the action” in the last step functions like “Continue to next step”.