{"id":21410,"date":"2019-06-11T06:23:47","date_gmt":"2019-06-11T05:23:47","guid":{"rendered":"https:\/\/developer.kore.ai\/v10-1\/?p=21410"},"modified":"2023-09-12T06:50:33","modified_gmt":"2023-09-12T05:50:33","slug":"prompt-editor","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/bot-builder-tool\/dialog-task\/prompt-editor\/","title":{"rendered":"User Prompts"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>After creating an Entity, Confirmation, or Message node in the Dialog Builder, Kore.ai lets you do the following:<\/p>\n<ul>\n<li>Modify the default message or user prompt displayed to the end-user.<\/li>\n<li>Add new prompts or messages.<\/li>\n<li>Add channel-specific prompts or messages.<\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h4>Prompt Types<\/h4>\n<p>Dialog Tasks support two types of user prompts:<\/p>\n<ul>\n<li><strong>Standard<\/strong>: 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.<\/li>\n<li><strong>Channel-Specific<\/strong>: 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.<\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h4>Prompt Editor<\/h4>\n<p>The prompt editor has three tabs to offer the following features:<\/p>\n<ul>\n<li><strong>Simple<\/strong>: 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.<\/li>\n<li><strong>Advanced<\/strong>: Advanced JavaScript editor to define, format, and render the user prompt.<\/li>\n<li><strong>Preview<\/strong>: View a sample of the rendered output message with markup as displayed to the end-user.<\/li>\n<\/ul>\n<p>Below is the JavaScript message from the <em>Book Flights<\/em> VA that presents the response from a weather API to the users in a custom format:<\/p>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20230912063927\/Req-3_Updated-pro-tip-for-manage-user-prompt.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-59368 size-large\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20230912063927\/Req-3_Updated-pro-tip-for-manage-user-prompt-1024x500.png\" alt=\"\" width=\"640\" height=\"313\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20230912063927\/Req-3_Updated-pro-tip-for-manage-user-prompt-1024x500.png 1024w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20230912063927\/Req-3_Updated-pro-tip-for-manage-user-prompt-300x147.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20230912063927\/Req-3_Updated-pro-tip-for-manage-user-prompt.png 1591w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>In the case of <strong>Error Prompts<\/strong>, if you have enabled the <em>Present Prompts<\/em> in the <strong>Order of Retries<\/strong> 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.<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h2><span class=\"ez-toc-section\" id=\"Configure_the_User_Prompt\">Configure the User Prompt<\/span><\/h2>\n<p>You can add or edit the prompts or VA messages from the <strong>Component Properties<\/strong> tab of an Entity, Confirmation, or Message node.<br \/>\nIn the case of Entity and Confirmation nodes, you refer to Prompts whereas, for the Message node, they are referred to as Responses.<\/p>\n<ol>\n<li>On the dialog task builder, click the <strong>+<\/strong> icon next to the respective node for which you want to configure the prompts or responses.<\/li>\n<li>Select <strong>Confirmation (or Entity or Message) <\/strong>&gt; <strong>New Confirmation (or Entity or Message) Node<\/strong>.<\/li>\n<li>The <strong>Confirmation<\/strong> <strong>(or Entity or Message) <\/strong>window is displayed with the <strong>Components Properties<\/strong> tab selected by default.<\/li>\n<li>Under the <strong>User Prompts<\/strong> (or VA Responses) section, click <b>Manage<\/b>.<br \/>\n<b>Note<\/b>: If you want to make text edits to the default sample message, modify the message directly in the text box and press <strong>Enter<\/strong>\u00a0without clicking <b>Manage<\/b>.<br \/>\n<a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20210707090239\/userPrompt_manage.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-28398\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20210707090239\/userPrompt_manage.png\" alt=\"\" width=\"727\" height=\"523\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20210707090239\/userPrompt_manage.png 727w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20210707090239\/userPrompt_manage-300x216.png 300w\" sizes=\"auto, (max-width: 727px) 100vw, 727px\" \/><\/a><\/li>\n<li>Do one of the following:\n<ol>\n<li>To edit the default sample message by adding context object variables or javascript code, click the sample message. The Message editor opens.<\/li>\n<li>To add a new prompt message, click <b>Add Prompt Message\/Manage Prompts<\/b>. The Message editor opens.<\/li>\n<\/ol>\n<\/li>\n<li>In the <b>Channel <\/b>drop-down list,<b> All Channels<\/b> is the default value. To create a channel-specific message, select the channel from the list.<\/li>\n<li>On the Message Editor, the <b>Plain Text <\/b>tab is the default selection. If you want to compose a Javascript message, click the <b>Advanced<\/b> tab.<a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20230912063927\/Req-3_Updated-pro-tip-for-manage-user-prompt.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-59368 size-large\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20230912063927\/Req-3_Updated-pro-tip-for-manage-user-prompt-1024x500.png\" alt=\"\" width=\"640\" height=\"313\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20230912063927\/Req-3_Updated-pro-tip-for-manage-user-prompt-1024x500.png 1024w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20230912063927\/Req-3_Updated-pro-tip-for-manage-user-prompt-300x147.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20230912063927\/Req-3_Updated-pro-tip-for-manage-user-prompt.png 1591w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a>\n<p><b>Note<\/b>: You can use stored context variables with {{variable brackets}}. For example, &#8216;Hello {{context.session.UserContext.firstName}}. How can I help you?&#8217;<\/li>\n<li>Compose the message and click <b>Save<\/b>.<\/li>\n<\/ol>\n<p>To add any more VA responses, repeat from step 2b.<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<\/div><\/div><\/div><\/div><\/div><\/section><section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h2><span class=\"ez-toc-section\" id=\"Plain_Text_Prompts\">Plain Text Prompts<\/span><\/h2>\n<p>Use the <strong>Plain Text<\/strong> 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.<\/p>\n<p>The plain text tab supports the following markups:<\/p>\n<table>\n<tbody>\n<tr>\n<th>Markdown<\/th>\n<th>Output<\/th>\n<\/tr>\n<\/tbody>\n<tbody>\n<tr>\n<td>#h1<\/td>\n<td>Heading One<\/td>\n<\/tr>\n<tr>\n<td>#h2<\/td>\n<td>Heading Two<\/td>\n<\/tr>\n<tr>\n<td>#h3<\/td>\n<td>Heading Three<\/td>\n<\/tr>\n<tr>\n<td>#h4<\/td>\n<td>Heading Four<\/td>\n<\/tr>\n<tr>\n<td>#h5<\/td>\n<td>Heading Five<\/td>\n<\/tr>\n<tr>\n<td>#h6<\/td>\n<td>Heading Six<\/td>\n<\/tr>\n<tr>\n<td>&#8220;`Hello&#8220;`<\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13620\" src=\"\/wp-content\/uploads\/sites\/35\/hello-1.png\" alt=\"\" width=\"221\" height=\"57\" \/><\/td>\n<\/tr>\n<tr>\n<td>*Bold*<\/td>\n<td><b>Bold<\/b><\/td>\n<\/tr>\n<tr>\n<td>~Italic~<\/td>\n<td><i>Italic<\/i><\/td>\n<\/tr>\n<tr>\n<td>[Link](http:\/\/www.google.com)<\/td>\n<td><a href=\"http:\/\/www.google.com\/\">Link<\/a><\/td>\n<\/tr>\n<tr>\n<td>![Image](https:\/\/kbob.github.io\/images\/sample-4.jpg)<\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-13621\" src=\"\/wp-content\/uploads\/sites\/35\/Image-2-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" \/><\/td>\n<\/tr>\n<tr>\n<td>Order<br \/>\n1. This is one<br \/>\n2. This is two<\/td>\n<td>Order<\/p>\n<ol>\n<li>This is one<\/li>\n<li>This is two<\/li>\n<\/ol>\n<\/td>\n<\/tr>\n<tr>\n<td>Bullet<br \/>\n* This is one<br \/>\n* This is two<\/td>\n<td>Bullet<\/p>\n<ul>\n<li>This is one<\/li>\n<li>This is two<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td>This is<br \/>\n&gt;&gt;indented<\/td>\n<td>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13622\" src=\"\/wp-content\/uploads\/sites\/35\/Indentation-Formatting-Example.jpg\" alt=\"\" width=\"236\" height=\"87\" \/><\/td>\n<\/tr>\n<tr>\n<td>This is line ___<\/td>\n<td>This is line ___<\/td>\n<\/tr>\n<tr>\n<td>This is &lt;br&gt; new line<\/td>\n<td>This is<br \/>\nnew line<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"w-message color_blue\"><div class=\"w-message-body\"><p>Default formatting of user prompts may not be supported on all channels.\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t\r\n\t\t<\/div>\r\n\t<\/div><\/div><\/div>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h2><span class=\"ez-toc-section\" id=\"JavaScript_Prompts_or_Responses\">JavaScript Prompts or Responses<\/span><\/h2>\n<p>On the <strong>Advanced<\/strong> tab of the editor, you can add custom code to handle the user prompt\u00a0message using system and session variables. The following is a sample code for displaying the weather forecast for a location:<\/p>\n<pre class=\"toolbar:1 lang:default decode:true\">var loc=context.weatherapi.response.body.query.results.channel.item.condition.text.toLowerCase();\r\nprint(\"Here are the details:\\n\");\r\nif(loc.indexOf(\"clear\")&gt;=0)\r\n{\r\nprint('Its clear outside.');\r\n}\r\n else if(loc.indexOf(\"sunny\")&gt;=0)\r\n{\r\n    print(\"Its sunny outside\");\r\n}\r\nelse if(loc.indexOf(\"cloud\")&gt;=0)\r\n{\r\n    print(\"Its very cloudy day\");\r\n}\r\nelse if (loc.indexOf('snow')&gt;=0)\r\n{\r\n    print('Its snowy day');\r\n}\r\nelse if(loc.indexOf('rain')&gt;=0)\r\n{\r\nprint('Yes, it looks like rainy day.');\r\n}\r\nelse if(loc.indexOf('breeze')&gt;=0)\r\n{\r\n    print(\"It's very breezy out there.\");\r\n}\r\nelse if(loc.indexOf('wind')&gt;=0)\r\n{\r\n     print(\"It's very windy out there.\");\r\n}\r\nelse if(loc.indexOf('shower')&gt;=0)\r\n{\r\n    print(\"It showering outside.\");\r\n}\r\nprint(\"Weather condition: \" + context.weather +\"\\n\");\r\nprint(\"Updated at: \" + context.lastupdate+\"\\n\");\r\nprint(\"Temperature: \" + context.temp+\"\\n\");\r\nprint(\"Wind: \" + context.wind+\"\\n\");\r\nprint(\"Pressure: \" + context.pressure+\"\\n\");\r\nprint(\"Visibility: \" + context.humidity+\"\\n\");\r\nprint(\"Humidity: \" + context.visibility+\"\\n\");<\/pre>\n<p>For more information, see <a href=\"\/docs\/bots\/bot-builder-tool\/dialog-task\/using-session-and-context-variables-in-tasks\/\">Using Session and Context Variables in Tasks<\/a>.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Customize_JavaScript_Responses\">Customize JavaScript Responses<\/span><\/h3>\n<p>JavaScript will not have any list of templates displayed (see the following screenshot), because one template\/JSON may not work for \u2018All\u2019 channels.<\/p>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20230912064207\/Req-3_Updated-pro-tip-for-manage-user-prompt_Bl-e1694497773163.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-59371 size-large\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20230912064207\/Req-3_Updated-pro-tip-for-manage-user-prompt_Bl-e1694497773163-1024x317.png\" alt=\"\" width=\"640\" height=\"198\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20230912064207\/Req-3_Updated-pro-tip-for-manage-user-prompt_Bl-e1694497773163-1024x317.png 1024w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20230912064207\/Req-3_Updated-pro-tip-for-manage-user-prompt_Bl-e1694497773163-300x93.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20230912064207\/Req-3_Updated-pro-tip-for-manage-user-prompt_Bl-e1694497773163.png 1919w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Key Points<\/strong><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">If JavaScript template is used for an \u2018<em>All channel<\/em>\u2019 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.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">If any channel-specific override is present, the platform will use that over the<em> \u2018All channel\u2019<\/em> 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 \u2018All channel\u2019 response.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">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.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">If your bot has multiple channels, most probably each channel has its own template. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">For a few channel options in the <\/span><b>Channel <\/b><span style=\"font-weight: 400;\">drop-down, you can see a list of templates displayed for <\/span><b>JavaScript <\/b><span style=\"font-weight: 400;\">response. <\/span><span style=\"font-weight: 400;\">For example, select the <\/span><b>Web\/Mobile Client<\/b><span style=\"font-weight: 400;\"> channel and choose any template from the <\/span><b>Channel Templates<\/b><span style=\"font-weight: 400;\"> list for your response as illustrated below.<\/span><\/p>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20230912064525\/Req-3_Updated-pro-tip-for-manage-user-prompt_Web-Mobile.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-59374 size-large\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20230912064525\/Req-3_Updated-pro-tip-for-manage-user-prompt_Web-Mobile-1024x333.png\" alt=\"\" width=\"640\" height=\"208\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20230912064525\/Req-3_Updated-pro-tip-for-manage-user-prompt_Web-Mobile-1024x333.png 1024w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20230912064525\/Req-3_Updated-pro-tip-for-manage-user-prompt_Web-Mobile-300x97.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20230912064525\/Req-3_Updated-pro-tip-for-manage-user-prompt_Web-Mobile.png 1912w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">For more information on templates, see <\/span><a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/sdks\/widget-sdk-message-formatting-and-templates\/\"><span style=\"font-weight: 400;\">Widget SDK \u2013 Message Formatting and Templates<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The same message configuration rules and principles apply while configuring any entity prompt or KG responses too.<\/span><\/p>\n<div class=\"w-message color_blue\"><div class=\"w-message-body\"><p><b>Note: <\/b><span style=\"font-weight: 400;\">The channel template options are different for each channel<\/span><span style=\"font-weight: 400;\">. <\/span><span style=\"font-weight: 400;\">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.<\/span>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t\r\n\t\t<\/div>\r\n\t<\/div><\/div><\/div>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h2><span class=\"ez-toc-section\" id=\"Preview_the_Prompt_or_Response\">Preview the Prompt or Response<\/span><\/h2>\n<p>On the <strong>Preview<\/strong> 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 <strong>Key<\/strong> and <strong>Value<\/strong> boxes in the tab to render a valid sample output for preview.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Channel-Specific_User_Prompts\">Channel-Specific User Prompts<\/span><\/h2>\n<p>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 <strong>Default<\/strong> response.<br \/>\nTo define a channel-specific response, select a channel, for example, <strong>Kore.ai<\/strong>, and then define the user prompt on the <b>Advanced<\/b> tab as needed. Only one response can be defined for each channel.<\/p>\n<p class=\"note\"><strong>Note:<\/strong>\u00a0Use the following keys to return default values for:<br \/>\n<span style=\"color: red; font-family: courier;\">response.message<\/span> &#8211; Returns the default message as a string.<br \/>\n<span style=\"color: red; font-family: courier;\">response.message.choices<\/span> &#8211; Returns the options choice or confirmation message types as an array.<\/p>\n<ul>\n<li><strong>Slack Channel Override Example<\/strong>\n<pre class=\"lang:default decode:true\">var message = {};\r\nvar attachments = [];\r\nvar attachment = {\r\n    'text': \"Exception occurred during API execution\",\r\n    'color': '#FFCC00',\r\n    'attachment_type': 'default'\r\n};\r\nattachments.push(attachment);\r\nmessage.attachments = attachments;\r\nprint(JSON.stringify(message));<\/pre>\n<\/li>\n<li><strong>FaceBook Channel Override Example<\/strong>\n<pre class=\"lang:default decode:true \">var message = {\r\n    text: response.message\r\n};\r\nvar buttons = [];\r\nfor (var i = 0; i &lt; response.choices.length; i++) {\r\n    var choiceItem = response.choices[i];\r\n    if (choiceItem.length &gt; 20) {\r\n        choiceItem = choiceItem.substring(\r\n            0, 18) + '..';\r\n    }\r\n    var element = {\r\n        content_type: 'text',\r\n        title: choiceItem,\r\n        payload: choiceItem\r\n    };\r\n    buttons.push(element);\r\n}\r\nmessage.quick_replies = buttons;\r\nprint(JSON.stringify(message));<\/pre>\n<\/li>\n<li><strong>Email Channel Override Example<\/strong>\n<pre class=\"lang:default decode:true \">var message = {};\r\nvar text = response.message + ' &lt;br&gt; ';\r\nfor (var i = 0; i &lt; response.choices.length; i++) {\r\n    text = text.concat(\r\n        '&lt;u&gt; + response.choices[i] + ' &lt;\r\n        \/u&gt; &lt;br&gt;');\r\n    }\r\n    message.text = text;\r\n    print(JSON.stringify(message));<\/pre>\n<\/li>\n<li><strong>SMS Channel Override Example<\/strong>\n<pre class=\"lang:default decode:true \">var message = {};\r\n    var indexArray = ['a', 'b', 'c',\r\n        'd', 'e',\r\n        'f', 'g', 'h', 'i', 'j',\r\n        'k', 'l', 'm', 'n', 'o',\r\n        'p', 'q', 'r', 's', 't',\r\n        'u', 'v', 'w', 'x', 'y',\r\n        'z'\r\n    ];\r\n    var text = response.message + '\\\\n';\r\n    for (var i = 0; i &lt; response.choices\r\n        .length; i++) {\r\n        text = text.concat(indexArray[i] +\r\n            ') ' + response.choices[\r\n                i] + '\\\\n');\r\n    }\r\n    message.text = text;\r\n    print(JSON.stringify(message));<\/pre>\n<\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_medium\"><\/div><\/div><\/div><\/div><\/div><\/div><\/section><section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_medium\"><\/div><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"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...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-21410","post","type-post","status-publish","format-standard","hentry","category-dialog-task"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/21410","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/comments?post=21410"}],"version-history":[{"count":60,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/21410\/revisions"}],"predecessor-version":[{"id":59377,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/21410\/revisions\/59377"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/media?parent=21410"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/categories?post=21410"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/tags?post=21410"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}