GETTING STARTED
Kore.ai XO Platform
Virtual Assistants Overview
Natural Language Processing (NLP)
Concepts and Terminology
Quick Start Guide
Accessing the Platform
Navigating the Kore.ai XO Platform
Building a Virtual Assistant
Help & Learning Resources
Release Notes
Current Version
Recent Updates
Previous Versions
Deprecations
Request a Feature
CONCEPTS
Design
Storyboard
Overview
FAQs
Conversation Designer
Overview
Dialog Tasks
Mock Scenes
Dialog Tasks
Overview
Navigate Dialog Tasks
Build Dialog Tasks
Node Types
Overview
Intent Node
Dialog Node
Dynamic Intent Node
GenAI Node
GenAI Prompt
Entity Node
Form Node
Confirmation Node
Message Nodes
Logic Node
Bot Action Node
Service Node
Webhook Node
Script Node
Process Node
Agent Transfer
Node Connections
Node Connections Setup
Sub-Intent Scoping
Entity Types
Entity Rules
User Prompts or Messages
Voice Call Properties
Knowledge AI
Introduction
Knowledge Graph
Introduction
Terminology
Build a Knowledge Graph
Manage FAQs
Knowledge Extraction
Import or Export Knowledge Graph
Prepare Data for Import
Importing Knowledge Graph
Exporting Knowledge Graph
Auto-Generate Knowledge Graph
Knowledge Graph Analysis
Answer from Documents
Alert Tasks
Small Talk
Digital Skills
Overview
Digital Forms
Digital Views
Introduction
Widgets
Panels
Session and Context Variables
Context Object
Intent Discovery
Train
NLP Optimization
ML Engine
Overview
Model Validation
FM Engine
KG Engine
Traits Engine
Ranking and Resolver
Training Validations
NLP Configurations
NLP Guidelines
LLM and Generative AI
Introduction
LLM Integration
Kore.ai XO GPT Module
Prompts & Requests Library
Co-Pilot Features
Dynamic Conversations Features
Intelligence
Introduction
Event Handlers
Contextual Memory
Contextual Intents
Interruption Management
Multi-intent Detection
Amending Entities
Default Conversations
Conversation Driven Dialog Builder
Sentinment Management
Tone Analysis
Default Standard Responses
Ignore Words & Field Memory
Test & Debug
Overview
Talk to Bot
Utterance Testing
Batch Testing
Conversation Testing
Conversation Testing Overview
Create a Test Suite
Test Editor
Test Case Assertion
Test Case Execution Summary
Glossary
Health and Monitoring
NLP Health
Flow Health
Integrations
Actions
Actions Overview
Asana
Configure
Templates
Azure OpenAI
Configure
Templates
BambooHR
Configure
Templates
Bitly
Configure
Templates
Confluence
Configure
Templates
DHL
Configure
Templates
Freshdesk
Configure
Templates
Freshservice
Configure
Templates
Google Maps
Configure
Templates
Here
Configure
Templates
HubSpot
Configure
Templates
JIRA
Configure
Templates
Microsoft Graph
Configure
Templates
Open AI
Configure
Templates
Salesforce
Configure
Templates
ServiceNow
Configure
Templates
Stripe
Configure
Templates
Shopify
Configure
Templates
Twilio
Configure
Templates
Zendesk
Configure
Templates
Agents
Agent Transfer Overview
Custom (BotKit)
Drift
Genesys
Intercom
NiceInContact
NiceInContact(User Hub)
Salesforce
ServiceNow
Configure Tokyo and Lower versions
Configure Utah and Higher versions
Unblu
External NLU Adapters
Overview
Dialogflow Engine
Test and Debug
Deploy
Channels
Publishing
Versioning
Analyze
Introduction
Dashboard Filters
Overview Dashboard
Conversations Dashboard
Users Dashboard
Performance Dashboard
Custom Dashboards
Introduction
Custom Meta Tags
Create Custom Dashboard
Create Custom Dashboard Filters
LLM and Generative AI Logs
NLP Insights
Task Execution Logs
Conversations History
Conversation Flows
Conversation Insights
Feedback Analytics
Usage Metrics
Containment Metrics
Universal Bots
Introduction
Universal Bot Definition
Universal Bot Creation
Training a Universal Bot
Universal Bot Customizations
Enabling Languages
Store
Manage Assistant
Team Collaboration
Plan & Usage
Overview
Usage Plans
Templates
Support Plans
Invoices
Authorization
Conversation Sessions
Multilingual Virtual Assistants
Get Started
Supported Components & Features
Manage Languages
Manage Translation Services
Multiingual Virtual Assistant Behavior
Feedback Survey
Masking PII Details
Variables
Collections
IVR Settings
General Settings
Assistant Management
Manage Namespace
Data
Overview
Data Table
Table Views
App Definitions
Data as Service
HOW TOs
Build a Travel Planning Assistant
Travel Assistant Overview
Create a Travel Virtual Assistant
Design Conversation Skills
Create an ‘Update Booking’ Task
Create a Change Flight Task
Build a Knowledge Graph
Schedule a Smart Alert
Design Digital Skills
Configure Digital Forms
Configure Digital Views
Train the Assistant
Use Traits
Use Patterns
Manage Context Switching
Deploy the Assistant
Use Bot Functions
Use Content Variables
Use Global Variables
Use Web SDK
Build a Banking Assistant
Design Conversation Skills
Create a Sample Banking Assistant
Create a Transfer Funds Task
Create a Update Balance Task
Create a Knowledge Graph
Set Up a Smart Alert
Design Digital Skills
Configure Digital Forms
Configure Digital Views
Add Data to Data Tables
Update Data in Data Tables
Add Data from Digital Forms
Train the Assistant
Composite Entities
Use Traits
Use Patterns for Intents & Entities
Manage Context Switching
Deploy the Assistant
Configure an Agent Transfer
Use Assistant Functions
Use Content Variables
Use Global Variables
Intent Scoping using Group Node
Analyze the Assistant
Create a Custom Dashboard
Use Custom Meta Tags in Filters
Migrate External Bots
Google Dialogflow Bot
APIs & SDKs
API Reference
API Introduction
Rate Limits
API List
koreUtil Libraries
SDK Reference
SDK Introduction
Web SDK
How the Web SDK Works
SDK Security
SDK Registration
Web Socket Connect and RTM
Tutorials
Widget SDK Tutorial
Web SDK Tutorial
BotKit SDK
BotKit SDK Deployment Guide
Installing the BotKit SDK
Using the BotKit SDK
SDK Events
SDK Functions
Tutorials
BotKit - Blue Prism
BotKit - Flight Search Sample VA
BotKit - Agent Transfer
  1. Home
  2. Docs
  3. Virtual Assistants
  4. Builder
  5. Dialog Task
  6. User Prompts

User Prompts

After creating an Entity, Confirmation, or Message node in the Dialog Builder, Kore.ai lets you do the following:

  • Modify the default message or user prompt displayed to the end-user.
  • Add new prompts or messages.
  • Add channel-specific prompts or messages.

Prompt Types

Dialog Tasks support two types of user prompts:

  • Standard: The prompt defined when adding a node in Dialog Builder is the standard or default prompt. When multiple standard prompts are defined for a node, the Platform chooses a random one to display to the end-user.
  • Channel-Specific: Optionally, define user prompts for specific channels such as email, SMS, Twitter, and more. Different widgets can be used based on channels such as a slider for numbers, date and time picker, and range selectors.

Prompt Editor

The prompt editor has three tabs to offer the following features:

  • Simple: Basic editor controls and HTML to define and format the user prompt. Enter text, and then format it using buttons for bold, italics, header styles, hyperlinks, ordered and unordered lists, and inserting lines.
  • Advanced: Advanced JavaScript editor to define, format, and render the user prompt.
  • Preview: View a sample of the rendered output message with markup as displayed to the end-user.

Below is the JavaScript message from the Book Flights VA that presents the response from a weather API to the users in a custom format:

 

In the case of Error Prompts, if you have enabled the Present Prompts in the Order of Retries toggle, the handlebar icon will be visible before each error prompt message. You can use this to re-order the messages so that it is displayed in that sequence.

Configure the User Prompt

You can add or edit the prompts or VA messages from the Component Properties tab of an Entity, Confirmation, or Message node.
In the case of Entity and Confirmation nodes, you refer to Prompts whereas, for the Message node, they are referred to as Responses.

  1. On the dialog task builder, click the + icon next to the respective node for which you want to configure the prompts or responses.
  2. Select Confirmation (or Entity or Message) > New Confirmation (or Entity or Message) Node.
  3. The Confirmation (or Entity or Message) window is displayed with the Components Properties tab selected by default.
  4. Under the User Prompts (or VA Responses) section, click Manage.
    Note: If you want to make text edits to the default sample message, modify the message directly in the text box and press Enter without clicking Manage.
  5. Do one of the following:
    1. To edit the default sample message by adding context object variables or javascript code, click the sample message. The Message editor opens.
    2. To add a new prompt message, click Add Prompt Message/Manage Prompts. The Message editor opens.
  6. In the Channel drop-down list, All Channels is the default value. To create a channel-specific message, select the channel from the list.
  7. On the Message Editor, the Plain Text tab is the default selection. If you want to compose a Javascript message, click the Advanced tab.

    Note: You can use stored context variables with {{variable brackets}}. For example, ‘Hello {{context.session.UserContext.firstName}}. How can I help you?’

  8. Compose the message and click Save.

To add any more VA responses, repeat from step 2b.

Plain Text Prompts

Use the Plain Text tab in the editor to compose the user prompts using basic editor controls and HTML. You can enter text, and then format the text using the formatting buttons for bold, italics, header styles, hyperlinks, ordered and unordered lists, and inserting a line.

The plain text tab supports the following markups:

Markdown Output
#h1 Heading One
#h2 Heading Two
#h3 Heading Three
#h4 Heading Four
#h5 Heading Five
#h6 Heading Six
“`Hello“`  
*Bold* Bold
~Italic~ Italic
[Link](http://www.google.com) Link
![Image](https://kbob.github.io/images/sample-4.jpg)  
Order
1. This is one
2. This is two
Order

  1. This is one
  2. This is two
Bullet
* This is one
* This is two
Bullet

  • This is one
  • This is two
This is
>>indented
 
This is line ___ This is line ___
This is <br> new line This is
new line

Default formatting of user prompts may not be supported on all channels.

JavaScript Prompts or Responses

On the Advanced tab of the editor, you can add custom code to handle the user prompt message using system and session variables. The following is a sample code for displaying the weather forecast for a location:

var loc=context.weatherapi.response.body.query.results.channel.item.condition.text.toLowerCase();
print("Here are the details:\n");
if(loc.indexOf("clear")>=0)
{
print('Its clear outside.');
}
 else if(loc.indexOf("sunny")>=0)
{
    print("Its sunny outside");
}
else if(loc.indexOf("cloud")>=0)
{
    print("Its very cloudy day");
}
else if (loc.indexOf('snow')>=0)
{
    print('Its snowy day');
}
else if(loc.indexOf('rain')>=0)
{
print('Yes, it looks like rainy day.');
}
else if(loc.indexOf('breeze')>=0)
{
    print("It's very breezy out there.");
}
else if(loc.indexOf('wind')>=0)
{
     print("It's very windy out there.");
}
else if(loc.indexOf('shower')>=0)
{
    print("It showering outside.");
}
print("Weather condition: " + context.weather +"\n");
print("Updated at: " + context.lastupdate+"\n");
print("Temperature: " + context.temp+"\n");
print("Wind: " + context.wind+"\n");
print("Pressure: " + context.pressure+"\n");
print("Visibility: " + context.humidity+"\n");
print("Humidity: " + context.visibility+"\n");

For more information, see Using Session and Context Variables in Tasks.

Customize JavaScript Responses

JavaScript will not have any list of templates displayed (see the following screenshot), because one template/JSON may not work for ‘All’ channels.

 

Key Points

  • If JavaScript template is used for an ‘All channel’ response, the template will be shown as is in JSON format and may not render correctly on the channel. You need to choose a channel-specific template for rendering a specific template for your channel.
  • If any channel-specific override is present, the platform will use that over the ‘All channel’ response while responding on that specific channel. For example, if you have a specific message or template for MS Teams, the bot prefers that specific template while responding to a user over the MS Teams channel instead of the ‘All channel’ response.
  • You can have more than one response configured for a channel. The bot randomly chooses if more than one response is configured for any given channel. This holds true for all-channel responses too if no other channel-specific responses are configured.

If your bot has multiple channels, most probably each channel has its own template.

For a few channel options in the Channel drop-down, you can see a list of templates displayed for JavaScript response. For example, select the Web/Mobile Client channel and choose any template from the Channel Templates list for your response as illustrated below.

 

For more information on templates, see Widget SDK – Message Formatting and Templates.

The same message configuration rules and principles apply while configuring any entity prompt or KG responses too.

Note: The channel template options are different for each channel. The template definitions provided in the platform are only for reference purposes. Please refer to the documentation of the channel provider to obtain the latest template definitions.

Preview the Prompt or Response

On the Preview tab, you can view a sample of the rendered output message that is displayed to the end-user with markup. To render the output for the code involving context variables, define them to use the Key and Value boxes in the tab to render a valid sample output for preview.

Channel-Specific User Prompts

By default, the Dialog Tasks configures the standard user prompts for all channels. However, you can define a specific response for one or more channels to display to the end-user in that channel instead of the Default response.
To define a channel-specific response, select a channel, for example, Kore.ai, and then define the user prompt on the Advanced tab as needed. Only one response can be defined for each channel.

Note: Use the following keys to return default values for:
response.message – Returns the default message as a string.
response.message.choices – Returns the options choice or confirmation message types as an array.

  • Slack Channel Override Example
    var message = {};
    var attachments = [];
    var attachment = {
        'text': "Exception occurred during API execution",
        'color': '#FFCC00',
        'attachment_type': 'default'
    };
    attachments.push(attachment);
    message.attachments = attachments;
    print(JSON.stringify(message));
  • FaceBook Channel Override Example
    var message = {
        text: response.message
    };
    var buttons = [];
    for (var i = 0; i < response.choices.length; i++) {
        var choiceItem = response.choices[i];
        if (choiceItem.length > 20) {
            choiceItem = choiceItem.substring(
                0, 18) + '..';
        }
        var element = {
            content_type: 'text',
            title: choiceItem,
            payload: choiceItem
        };
        buttons.push(element);
    }
    message.quick_replies = buttons;
    print(JSON.stringify(message));
  • Email Channel Override Example
    var message = {};
    var text = response.message + ' <br> ';
    for (var i = 0; i < response.choices.length; i++) {
        text = text.concat(
            '<u> + response.choices[i] + ' <
            /u> <br>');
        }
        message.text = text;
        print(JSON.stringify(message));
  • SMS Channel Override Example
    var message = {};
        var indexArray = ['a', 'b', 'c',
            'd', 'e',
            'f', 'g', 'h', 'i', 'j',
            'k', 'l', 'm', 'n', 'o',
            'p', 'q', 'r', 's', 't',
            'u', 'v', 'w', 'x', 'y',
            'z'
        ];
        var text = response.message + '\\n';
        for (var i = 0; i < response.choices
            .length; i++) {
            text = text.concat(indexArray[i] +
                ') ' + response.choices[
                    i] + '\\n');
        }
        message.text = text;
        print(JSON.stringify(message));

User Prompts

After creating an Entity, Confirmation, or Message node in the Dialog Builder, Kore.ai lets you do the following:

  • Modify the default message or user prompt displayed to the end-user.
  • Add new prompts or messages.
  • Add channel-specific prompts or messages.

Prompt Types

Dialog Tasks support two types of user prompts:

  • Standard: The prompt defined when adding a node in Dialog Builder is the standard or default prompt. When multiple standard prompts are defined for a node, the Platform chooses a random one to display to the end-user.
  • Channel-Specific: Optionally, define user prompts for specific channels such as email, SMS, Twitter, and more. Different widgets can be used based on channels such as a slider for numbers, date and time picker, and range selectors.

Prompt Editor

The prompt editor has three tabs to offer the following features:

  • Simple: Basic editor controls and HTML to define and format the user prompt. Enter text, and then format it using buttons for bold, italics, header styles, hyperlinks, ordered and unordered lists, and inserting lines.
  • Advanced: Advanced JavaScript editor to define, format, and render the user prompt.
  • Preview: View a sample of the rendered output message with markup as displayed to the end-user.

Below is the JavaScript message from the Book Flights VA that presents the response from a weather API to the users in a custom format:

 

In the case of Error Prompts, if you have enabled the Present Prompts in the Order of Retries toggle, the handlebar icon will be visible before each error prompt message. You can use this to re-order the messages so that it is displayed in that sequence.

Configure the User Prompt

You can add or edit the prompts or VA messages from the Component Properties tab of an Entity, Confirmation, or Message node.
In the case of Entity and Confirmation nodes, you refer to Prompts whereas, for the Message node, they are referred to as Responses.

  1. On the dialog task builder, click the + icon next to the respective node for which you want to configure the prompts or responses.
  2. Select Confirmation (or Entity or Message) > New Confirmation (or Entity or Message) Node.
  3. The Confirmation (or Entity or Message) window is displayed with the Components Properties tab selected by default.
  4. Under the User Prompts (or VA Responses) section, click Manage.
    Note: If you want to make text edits to the default sample message, modify the message directly in the text box and press Enter without clicking Manage.
  5. Do one of the following:
    1. To edit the default sample message by adding context object variables or javascript code, click the sample message. The Message editor opens.
    2. To add a new prompt message, click Add Prompt Message/Manage Prompts. The Message editor opens.
  6. In the Channel drop-down list, All Channels is the default value. To create a channel-specific message, select the channel from the list.
  7. On the Message Editor, the Plain Text tab is the default selection. If you want to compose a Javascript message, click the Advanced tab.

    Note: You can use stored context variables with {{variable brackets}}. For example, ‘Hello {{context.session.UserContext.firstName}}. How can I help you?’

  8. Compose the message and click Save.

To add any more VA responses, repeat from step 2b.

Plain Text Prompts

Use the Plain Text tab in the editor to compose the user prompts using basic editor controls and HTML. You can enter text, and then format the text using the formatting buttons for bold, italics, header styles, hyperlinks, ordered and unordered lists, and inserting a line.

The plain text tab supports the following markups:

Markdown Output
#h1 Heading One
#h2 Heading Two
#h3 Heading Three
#h4 Heading Four
#h5 Heading Five
#h6 Heading Six
“`Hello“`  
*Bold* Bold
~Italic~ Italic
[Link](http://www.google.com) Link
![Image](https://kbob.github.io/images/sample-4.jpg)  
Order
1. This is one
2. This is two
Order

  1. This is one
  2. This is two
Bullet
* This is one
* This is two
Bullet

  • This is one
  • This is two
This is
>>indented
 
This is line ___ This is line ___
This is <br> new line This is
new line

Default formatting of user prompts may not be supported on all channels.

JavaScript Prompts or Responses

On the Advanced tab of the editor, you can add custom code to handle the user prompt message using system and session variables. The following is a sample code for displaying the weather forecast for a location:

var loc=context.weatherapi.response.body.query.results.channel.item.condition.text.toLowerCase();
print("Here are the details:\n");
if(loc.indexOf("clear")>=0)
{
print('Its clear outside.');
}
 else if(loc.indexOf("sunny")>=0)
{
    print("Its sunny outside");
}
else if(loc.indexOf("cloud")>=0)
{
    print("Its very cloudy day");
}
else if (loc.indexOf('snow')>=0)
{
    print('Its snowy day');
}
else if(loc.indexOf('rain')>=0)
{
print('Yes, it looks like rainy day.');
}
else if(loc.indexOf('breeze')>=0)
{
    print("It's very breezy out there.");
}
else if(loc.indexOf('wind')>=0)
{
     print("It's very windy out there.");
}
else if(loc.indexOf('shower')>=0)
{
    print("It showering outside.");
}
print("Weather condition: " + context.weather +"\n");
print("Updated at: " + context.lastupdate+"\n");
print("Temperature: " + context.temp+"\n");
print("Wind: " + context.wind+"\n");
print("Pressure: " + context.pressure+"\n");
print("Visibility: " + context.humidity+"\n");
print("Humidity: " + context.visibility+"\n");

For more information, see Using Session and Context Variables in Tasks.

Customize JavaScript Responses

JavaScript will not have any list of templates displayed (see the following screenshot), because one template/JSON may not work for ‘All’ channels.

 

Key Points

  • If JavaScript template is used for an ‘All channel’ response, the template will be shown as is in JSON format and may not render correctly on the channel. You need to choose a channel-specific template for rendering a specific template for your channel.
  • If any channel-specific override is present, the platform will use that over the ‘All channel’ response while responding on that specific channel. For example, if you have a specific message or template for MS Teams, the bot prefers that specific template while responding to a user over the MS Teams channel instead of the ‘All channel’ response.
  • You can have more than one response configured for a channel. The bot randomly chooses if more than one response is configured for any given channel. This holds true for all-channel responses too if no other channel-specific responses are configured.

If your bot has multiple channels, most probably each channel has its own template.

For a few channel options in the Channel drop-down, you can see a list of templates displayed for JavaScript response. For example, select the Web/Mobile Client channel and choose any template from the Channel Templates list for your response as illustrated below.

 

For more information on templates, see Widget SDK – Message Formatting and Templates.

The same message configuration rules and principles apply while configuring any entity prompt or KG responses too.

Note: The channel template options are different for each channel. The template definitions provided in the platform are only for reference purposes. Please refer to the documentation of the channel provider to obtain the latest template definitions.

Preview the Prompt or Response

On the Preview tab, you can view a sample of the rendered output message that is displayed to the end-user with markup. To render the output for the code involving context variables, define them to use the Key and Value boxes in the tab to render a valid sample output for preview.

Channel-Specific User Prompts

By default, the Dialog Tasks configures the standard user prompts for all channels. However, you can define a specific response for one or more channels to display to the end-user in that channel instead of the Default response.
To define a channel-specific response, select a channel, for example, Kore.ai, and then define the user prompt on the Advanced tab as needed. Only one response can be defined for each channel.

Note: Use the following keys to return default values for:
response.message – Returns the default message as a string.
response.message.choices – Returns the options choice or confirmation message types as an array.

  • Slack Channel Override Example
    var message = {};
    var attachments = [];
    var attachment = {
        'text': "Exception occurred during API execution",
        'color': '#FFCC00',
        'attachment_type': 'default'
    };
    attachments.push(attachment);
    message.attachments = attachments;
    print(JSON.stringify(message));
  • FaceBook Channel Override Example
    var message = {
        text: response.message
    };
    var buttons = [];
    for (var i = 0; i < response.choices.length; i++) {
        var choiceItem = response.choices[i];
        if (choiceItem.length > 20) {
            choiceItem = choiceItem.substring(
                0, 18) + '..';
        }
        var element = {
            content_type: 'text',
            title: choiceItem,
            payload: choiceItem
        };
        buttons.push(element);
    }
    message.quick_replies = buttons;
    print(JSON.stringify(message));
  • Email Channel Override Example
    var message = {};
    var text = response.message + ' <br> ';
    for (var i = 0; i < response.choices.length; i++) {
        text = text.concat(
            '<u> + response.choices[i] + ' <
            /u> <br>');
        }
        message.text = text;
        print(JSON.stringify(message));
  • SMS Channel Override Example
    var message = {};
        var indexArray = ['a', 'b', 'c',
            'd', 'e',
            'f', 'g', 'h', 'i', 'j',
            'k', 'l', 'm', 'n', 'o',
            'p', 'q', 'r', 's', 't',
            'u', 'v', 'w', 'x', 'y',
            'z'
        ];
        var text = response.message + '\\n';
        for (var i = 0; i < response.choices
            .length; i++) {
            text = text.concat(indexArray[i] +
                ') ' + response.choices[
                    i] + '\\n');
        }
        message.text = text;
        print(JSON.stringify(message));
Menu