vania-janet/multiturn-rag-retrieval-data huggingface dataset:
Response types reference 

You can use the JSON editor to specify responses of many different types.

For more information about using response types in the JSON editor, see [Defining responses using the JSON editor](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-assistant-responses-json).

The following response types are supported in the JSON editor.



 audio 

Plays an audio clip specified by a URL.



 Integration channel support 



 Web chat Phone SMS Slack Facebook WhatsApp 

 ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) ![Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) !
[UI location where the code that is triggered by named event handlers is authored](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/api-event-handlers.png)
* A node of type event_handler with an event_name of generic can have a parent of type slot or frame.
* A node of type event_handler with an event_name of focus, input, filled, or nomatch must have a parent of type slot.
* If more than one event_handler with the same event_name is associated with the same parent node, then the order of the siblings reflects the order in which the event handlers will be executed.
* For event_handler nodes with the same parent slot node, the order of execution is the same regardless of the placement of the node definitions. The events are triggered in this order by event_name:



1. focus
2. input
3. filled
4. generic*
5. nomatch



*If an event_handler with the event_name generic is defined for this slot or for the parent frame, then it is executed between the filled and nomatch event_handler nodes.



The following examples show how various modifications might cause cascading changes.



 Creating a node 

Consider the following simple dialog tree:

![Example dialog](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/dialog_api_1.png)

We can create a new node by making a POST request to /dialog_nodes with the following body:

{
"dialog_node": "node_8"
}

The dialog now looks like this:

!
: "What can I do for you today, " +
context"username"] + "?" ?>

For full SpEL expression syntax details, see Expression for accessing objects]] ! ! ! ! ! .
* Preventing returns: In some cases, you might want to prevent a return to the interrupted conversation flow based on a choice the user makes in the current dialog flow. You can use special syntax to prevent a return from a specific node.
For example, you might have a node that conditions on General_Connect_To_Agent or a similar intent. When triggered, if you want to get the user's confirmation before you transfer them to an external service, you might add a response such as, Do you want me to transfer you to an agent now? You could then add two child nodes that condition on yes and no respectively.

The best way to manage digressions for this type of branch is to set the root node to allow digression returns. However, on the yes node, include the SpEL expression <? clearDialogStack() ?> in the response. For example:

OK. I will transfer you now. <? clearDialogStack() ?>

This SpEL expression prevents the digression return from happening from this node. When a confirmation is requested, if the user says yes, the proper response is displayed, and the dialog flow that was interrupted is not resumed. If the user says no, then the user is returned to the flow that was interrupted.
<-- </ul> --><-- </section "id="section-dialog-runtime-digress-tips" "> --><-- <section "id="section-dialog-runtime-disable-digressions" "> --> Disabling digressions into a root node When a flow digresses into a root node, it follows the course of the dialog that is configured for that node. So, it might process a series of child nodes before it reaches the end of the node branch, and then, if configured to do so, goes back to the dialog flow that was interrupted.
Optional: Name the folder.
3. Optional: Define a condition for the folder.

If you do not specify a condition, true is used, meaning the nodes in the folder are always processed.
4. Add dialog nodes to the folder.



* To add existing dialog nodes to the folder, you must move them to the folder one at a time.

On the node that you want to move, click the More![More icon](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/kebab.png) icon, select Move, and then click the folder. Select To folder as the move-to target.

As you move nodes, they are added at the start of the tree within the folder. Therefore, if you want to retain the order of a set of consecutive root dialog nodes, for example, move them starting with the last node first.
* To add a new dialog node to the folder, click the More![More icon](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/kebab.png) icon on the folder, and then select Add node to folder.

The dialog node is added to the end of the dialog tree within the folder.









 Deleting a folder 

You can delete either a folder alone or the folder and all of the dialog nodes in it.

To delete a folder, complete the following steps:



1. From the tree view of the Dialog tab, find the folder that you want to delete.
2. Click the More!
* [Choosing nodes to disable](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-runtimedialog-runtime-disambig-choose-nodes)
* [Disabling disambiguation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-runtimedialog-runtime-disambig-disable)
* [Handling none of the above](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-runtimedialog-runtime-handle-none)
* [Testing disambiguation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-runtimedialog-runtime-disambig-test)



For information about how disambiguation works with actions skills, see [Disambiguation](https://cloud.ibm.com/docs/assistant?topic=assistant-actionsactions-disambiguation).



 Disambiguation example 

For example, you have a dialog that has two nodes with intent conditions that address cancellation requests. The conditions are:



* eCommerce_Cancel_Product_Order
* Customer_Care_Cancel_Account



If the user input is i must cancel it today, then the following intents might be detected in the input:

[ Shows the top 3 intents recognized in the user input from the Try it out pane.Shows the top 3 intents recognized in the user input from the Try it out pane_.]
{"intent":"Customer_Care_Cancel_Account","confidence":0.5602024316787719},
{"intent":"eCommerce_Cancel_Product_Order","confidence":0.46903514862060547},
{"intent":"Customer_Care_Appointments","confidence":0.29033891558647157},
{"intent":"General_Greetings","confidence":0.2894785046577454},
When you choose this option, after processing the current node, your assistant jumps directly to the first child node of the current node. This option is similar to the existing Jump to next step option, except that it allows for more flexibility. You do not need to specify the exact node to jump to. At run time, your assistant always jumps to whichever node is the first child node, even if the child nodes are reordered or new nodes are added after the next step behavior is defined.
* You can add conditional responses for slots. For both Found and Not found responses, you can customize how your assistant responds based on whether certain conditions are met. This feature enables you to check for possible misinterpretations and correct them before saving the value provided by the user in the slot's context variable. For example, if the slot saves the user's age, and uses @sys-number in the Check for field to capture it, you can add a condition that checks for numbers over 100, and responds with something like, Please provide a valid age in years. See [Adding conditions to Found and Not found responses](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-slotsdialog-slots-handler-next-steps) for more details.
* The interface you use to add conditional responses to a node has been redesigned to make it easier to list each condition and its response. To add node-level conditional responses, click Customize, and then enable the Multiple responses option.



The Multiple responses toggle sets the feature on or off for the node-level response only. It does not control the ability to define conditional responses for a slot. The slot multiple response setting is controlled separately.



* To keep the page where you edit a slot simple, you now select menu options to a.) add a condition that must be met for the slot to be processed, and b.) add conditional responses for the Found and Not found conditions for a slot. Unless you choose to add this extra functionality, the slot condition and multiple responses fields are not displayed, which declutters the page and makes it easier to use.







 25 October 2017 

Updates to Simplified Chinese
: Language support has been enhanced for Simplified Chinese.
Note: When a response is split into multiple messages, the Watson Assistant connector sends these messages to the channel in sequence. It is the responsibility of the channel to deliver these messages to the end user; this can be affected by network or server issues.





 Native JSON format 

In addition to the generic JSON format, the dialog node JSON also supports channel-specific responses written using the native Slack and Facebook Messenger formats. These formats are also supported by the Watson Assistant connector. You might want to use the native JSON formats if you know your workspace will only be integrated with one channel type, and you need to specify a response type that is not currently supported by the generic JSON format.

You can specify native JSON for Slack or Facebook using the appropriate field in the dialog node response:



* output.slack: insert any JSON you want to be included in the attachment field of the Slack response. For more information about the Slack JSON format, see the Slack [documentation](https://api.slack.com/messaging/composing).
* output.facebook: insert any JSON you want included in the message.attachment.payload field of the Facebook response. For more information about the Facebook JSON format, see the Facebook [documentation](https://developers.facebook.com/docs/messenger-platform/send-messages/templates).







 Response types 

The following response types are supported by the generic JSON format.



 Image 

Displays an image specified by a URL.



 Fields {: 



 Name Type Description Required? 

 response_type enum image Y 
 source string The URL of the image. The specified image must be in .jpg, .gif, or .png format. Y 
 title string The title to show before the image. N 
 description string The text of the description that accompanies the image. N 







 Example 

This example displays an image with a title and descriptive text.

{
"output": {
"generic":[
{
"response_type": "image",
"source": "http://example.com/image.jpg",
"title": "Example image",
See [Activity Tracker events](https://cloud.ibm.com/docs/assistant?topic=assistant-at-events).





 5 February 2020 

New API version
: The current API version is now 2020-02-05. The following changes were made with this version:



* When a dialog node's response type is connect-to-agent, the node's title is used as the topic value. Previously, user_label was used.
* The alternate_intents property is stored as a Boolean value instead of a String.







 4 February 2020 

Product user interface makeover
: The UI has been updated to be more intuitive, responsive, and consistent across its pages. While the look and feel of the UI elements has changed, their function has not.

Requesting early access
: The button you click to request participation in the early access program has moved from the Skills page to the user account menu. For more information, see [Feedback](https://cloud.ibm.com/docs/assistant?topic=assistant-feedbackfeedback-beta).





 24 January 2020 

New system entities are now generally available in multiple languages
: The new and improved numeric system entities are now generally available in all supported languages, except Arabic, Chinese, Japanese, and Korean, where they are available as a beta feature. They are not used by your dialog skill unless you enable them from the Options>System entities page. For more information, see [New system entities](https://cloud.ibm.com/docs/assistant?topic=assistant-system-entities).





 14 January 2020 

Fixed an error message that was displayed when opening an instance
: An error that was displayed when you launched Watson Assistant from the IBM Cloud® dashboard has been fixed. Previously, an error message that said, Module 'ui-router' is not available! You either misspelled the module name or forgot to load it would sometimes be displayed.





 12 December 2019 

Support for private network endpoints
: Users of Premium plans can create private network endpoints to connect to Watson Assistant over a private network. Connections to private network endpoints do not require public internet access.
New version 2016-09-20
: To take advantage of the changes in a new version, change the value of the version parameter to the new date. If you're not ready to update to this version, don't change your version date.



* version 2016-09-20: dialog_stack changed from an array of strings to an array of JSON objects.







 29 August 2016 

Updates
: This release includes the following updates:



* You can move dialog nodes from one branch to another, as siblings or peers. For details, see [Moving a dialog node](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-tasksdialog-tasks-move-node).
* You can expand the JSON editor window.
* You can view chat logs of your bot's conversations to help you understand it's behavior. You can filter by intents, entities, date, and time. For details, see [Improving your skill](https://cloud.ibm.com/docs/assistant?topic=assistant-logs)







 11 July 2016 

General Availability
: This General Availability release enables you to work with entities and dialogs to create a fully functioning bot.





 18 May 2016 

Experimental release
: This Experimental release of the Watson Assistant introduces the user interface and enables you to work with workspaces, intents, and examples.
You update context for each individual conditional response; there is no common context editor or JSON editor for all conditional responses.
* Add rich responses. To add more than one text response or to add response types other than text responses to a single conditional response, you must open the edit response view.
* Configure a jump. To instruct your assistant to jump to a different node after this conditional response is processed, select Jump to from the And finally section of the response edit view. Identify the node that you want your assistant to process next. See [Configuring the Jump to action](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-overviewdialog-overview-jump-to-config) for more information.

A Jump to action that is configured for the node is not processed until all of the conditional responses are processed. Therefore, if a conditional response is configured to jump to another node, and the conditional response is triggered, then the jump configured for the node is never processed, and so does not occur.



3. Click Add response to add another conditional response.



The conditions within a node are evaluated in order, just as nodes are. Be sure that your conditional responses are listed in the correct order. If you need to change the order, select a condition and response pair and move it up or down in the list using the arrows that are displayed.







 Defining what to do next 

After making the specified response, you can instruct your assistant to do one of the following things:



* Wait for user input: Your assistant waits for the user to provide new input that the response elicits. For example, the response might ask the user a yes or no question. The dialog will not progress until the user provides more input.
* Skip user input: Use this option when you want to bypass waiting for user input and go directly to the first child node of the current node instead.

The current node must have at least one child node for this option to be available.
* Jump to another dialog node: Use this option when you want the conversation to go directly to an entirely different dialog node.
You can return responses with multimedia or interactive elements such as images or clickable buttons to simplify the interaction model of your application and enhance the user experience.

In addition to the default response type of Text, for which you specify the text to return to the user as a response, the following response types are supported:



* Connect to human agent: The dialog calls a service that you designate, typically a service that manages human agent support ticket queues, to pass off the conversation to a person. You can optionally include a message that summarizes the user's issue to be provided to the human agent. It is the responsibility of the external service to display a message that is shown to the user that explains that the conversation is being transferred. The dialog does not manage that communication itself. The dialog transfer does not occur when you are testing nodes with this response type in the Try it out pane. You must access a node that uses this response type from a test deployment to see how your users will experience it.
* Image: Embeds an image into the response. The source image file must be hosted somewhere and have a URL that you can use to reference it. It cannot be a file that is stored in a directory that is not publicly accessible.
* Option: Adds a list of one or more options. When a user clicks one of the options, an associated user input value is sent to your assistant. How options are rendered can differ depending on where you deploy the dialog. For example, in one integration channel the options might be displayed as clickable buttons, but in another they might be displayed as a dropdown list.
* Pause: Forces the application to wait for a specified number of milliseconds before continuing with processing. You can choose to show an indicator that the dialog is working on typing a response. Use this response type if you need to perform an action that might take some time. For example, a parent node makes a Cloud Function call and displays the result in a child node. You could use this response type as the response for the parent node to give the programmatic call time to complete, and then jump to the child node to show the result. This response type does not render in the Try it out pane.
* [Enabling disambiguation](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-runtimedialog-runtime-disambig-enable)
* [Choosing nodes](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-runtimedialog-runtime-choose-nodes)
* [Handling none of the above](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-runtimedialog-runtime-handle-none)
* [Testing disambiguation](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-runtimedialog-runtime-disambig-test)





 Disambiguation example 

For example, you have a dialog that has two nodes with intent conditions that address cancellation requests. The conditions are:



* eCommerce_Cancel_Product_Order
* Customer_Care_Cancel_Account



If the user input is i must cancel it today, then the following intents might be detected in the input:

[ Shows the top 3 intents recognized in the user input from the Try it out pane.Shows the top 3 intents recognized in the user input from the Try it out pane_.] Service prompts the user to choose from a list of dialog options, including Cancel an account, Cancel a product order, and None of the above.Service prompts the user to choose from a list of dialog options_ including Cancel an account_ Cancel a product order_ and None of the above_.] Service prompts the user to choose from a list of dialog options, including Capture date information.Service prompts the user to choose from a list of dialog options_ including Capture date information_.] ! ! ! ! !
{"intent":"Customer_Care_Cancel_Account","confidence":0.5602024316787719},
(https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/sauce.png)

After responding to the off-topic question, the prompt associated with the current empty slot is displayed.

This condition is triggered if the user provides input that matches the slot handler conditions at any time during the dialog node flow up until the node-level response is displayed. See [Handling requests to exit a process](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-slotsdialog-slots-node-level-handler) for more ways to use the slot handler.
7. Add a node-level response. The node-level response is not executed until after all of the required slots are filled. You can add a response that summarizes the information you collected. For example, A $size pizza is scheduled for delivery at $time. Enjoy!

You can alternatively show an image or list of options as a response instead of a text response. See [Response type options](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-slotsdialog-slots-response-types).

If you want to define different responses based on certain conditions, click Customize, and then click the Multiple responses toggle to turn it On. For information about conditional responses, see [Conditional responses](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-overviewdialog-overview-multiple).
8. Add logic that resets the slot context variables. As you collect answers from the user per slot, they are saved in context variables. You can use the context variables to pass the information to another node or to an application or external service for use. However, after passing the information, you must set the context variables to null to reset the node so it can start collecting information again. You cannot null the context variables within the current node because your assistant will not exit the node until the required slots are filled.