Standard Responses
In the Kore.ai Bot Builder tool, you can view the default Natural Language Processing, or NLP interpreter responses to user inputs or events.
For example, a reply to a user input of Hi! The bot replies with one of the following responses, chosen randomly at runtime:
- Hi!
- Hello
- Hi there!
- Hey 🙂
The NLP interpreter displays pre-defined text responses to users based on an event, condition, trigger, or user input. Depending on your custom bot and users of that bot, you may want to modify the default responses to users displayed for an event or request for input.
Example
- User Input – When were you born?
- Event – Authorization Failure
- Trigger – Task canceled
You can define both standard bot responses, or if desired, add a channel override response that is displayed only in the specified channel the user is in, otherwise, one of the standard default responses is displayed. Click here for a comprehensive list of default standard responses.
For example, in the SMS channel, you may only want to use short bot responses to save data.
Default Responses
To access and manage the default responses in bot builder, follow the below steps:
- Select the Build tab from the top menu
- From the left menu, click Intelligence > Standard Responses.
For each standard response category tab, the event or user input is listed followed by one or more NLP interpreter standard responses. You can modify the default response, and if needed, add additional responses selected randomly by the NLP interpreter in response to user input or system event.
In the Standard Response section, the standard bot responses are categorized in the following tabs:
- Statements – Responses displayed to the user as the result of an action by the bot or user. For example, a user cancels a task, or a user gives an invalid response to your bot request.
- Queries – Statements from the bot to the user to ask for more information. For example, Which field do you want to change?
- Error & Warnings – Statements from the bot to the user when an error occurs during the scenario, such as the End date cannot be before or same as the start date!
- Questions – Questions the bot may pose to the user when not included in any other category.
- Choices – The bot is asking for Yes/No input. For example, Would you like to receive push notifications every time this task occurs?
- Greeting – Initial responses by the bot when the bot is installed, or other initial contacts. For example, when a user returns to the interaction after a period of inactivity.
Add and Edit Responses
Add a New Standard Response
Note: If the standard responses are updated at the conditions wherein an ambiguity is presented to the user, the bot response will not display the ambiguous choices to the user and you need to use the function getChoices() to present the ambiguity list (refer to point 6 below).
- Select a tab category for the standard response. For example, Greeting, and then hover the situation for which you want to add the response. Click Add Response:
- The Add Channel Overrides dialog is displayed.
- In the Choose a channel drop-down list, select a channel to create a channel-specific response. You can go with the Any Channel option to enable the response for all channels.
- In the case of channel-specific response, from the Choose a Task drop-down list, select Any Task to apply this channel-specific response to all tasks or select a specific task.
- When a specific task is selected, the Choose a Field is drop-down is displayed. Select Any Field or a specific field for this channel-specific response.
- In the bot Response editor, you can override the default Bot Response for this channel using basic editor controls on the Simple Mode tab, or write custom JavaScript for the response on the Advanced Mode tab. For the:
- Using the getChoices() function, you can also customize the response display format using the message formatting templates. When the getChoices() function is called and there is an ambuguity, the platform returns the ambiguous choices information as an array which can be used to present the options to the end users.
For example, to display the standard response for Did you mean in a button format, you can use the following code:
var info =getChoices() ;
var message = {
"type": "template",
"payload": {
"template_type": "button",
"text": "Did you mean",
"subText": "You can now customize response for did you mean",
"buttons": []
}
};
for (i = 0; i < info.length; i++) {
var button = {
"type": "postback",
"title": info[i],
"payload": "payload1"
};
message.payload.buttons.push(button);
}
print(JSON.stringify(message));
- Click Done to save and close the Edit Response dialog and apply the new standard response.