vania-janet/multiturn-rag-retrieval-data huggingface dataset:
If necessary, you can disable changing the topic for all actions:



1. On the Change conversation topic tab, set the switch to Off.
2. Click Save, and then click Close.





 Allow change of topic between actions and dialog 

If you are using actions and dialog, you can ensure that customers can change topics between an action and a dialog node.

This setting is available if you activate dialog in Assistant settings. For more information, see [Activating dialog and migrating skills](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-activate-dialog).



1. Set the toggle Change topics from actions to dialog to On.
2. Click Save, and then click Close.









 Confirmation to return to previous topic 

By default, new assistants are set to ask a "yes or no" question to confirm that the customers want to return to the previous action. You can modify these settings in the Confirmation section. For more information, see [Confirmation to return to previous topic](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-change-topicchange-topic-confirmation).





 Autocorrection 

Autocorrection fixes misspellings that users make in their requests. The corrected words are used to match to an action.

Autocorrection is enabled automatically for all English-language assistants. It is also available in French-language assistants, but is disabled by default. The autocorrection setting isn't available for any other languages.

For more information, see [Autocorrecting user input](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-autocorrection).





 Display formats 

Use display formats for variables that use date, time, numbers, currency, or percentages. You can also choose a default locale to use if one isn't provided by the client application. You can ensure that the format of a variable in the web chat is what you want for your assistant.
browser String The browser that was used to send the message that started the session. 
 channel String The channel that started the session (for example, phone or chat). 
 device String The type of device that was used to send the message that started the session. 
 environment String The environment in which the session was started (such as draft or live.) 
 pageUrl String The URL of the web page from which the message that started the session was sent. 
 serviceInstance String The IBM Watson Assistant service instance. 
 sessionId String The ID of the session.
* After a user clicks one of the options, the choices disappear and are replaced by the user input that is generated by the user's choice. If you include multiple response types in a single response, position the option response type last. Otherwise, the output might contain a mix of responses and user inputs that can confuse the user.
* If the options are displayed in a drop-down list, then each option value must be 75 characters or fewer in length. When a list includes 5 or more options, it is displayed in a drop-down list automatically.



* Pause: This response type pauses the assistant's activity in the Slack channel. However, no visible indicator is shown to indicate that the assistant is paused, whether you choose to show typing or not.
* Search skill: The response type is supported, but you must test and curate your search results to ensure that each result is as concise as possible. The combined length of the title, body, and URL of the search result must be less than or equal to 2,990 characters.



See [Rich responses](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overviewdialog-overview-multimedia) for more information about response types.





 Chatting with the assistant 

To start a chat with the assistant, complete the following steps:



1. Open Slack, and go to the workspace associated with your app.
2. Click the application that you created from the Apps section.
3. Chat with the assistant.



The Welcome node of your dialog is not processed by the Slack integration. The welcome message is not displayed in the Slack channel like it is in the "Try it out" pane or in the assistant preview. It is not triggered from here because nodes with the welcome special condition are skipped in dialog flows that are started by users. Slack waits for the user to initiate the conversation. For more information about how to set context variable values consistently at the start of a conversation, see [Starting the dialog](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-start).

You can upload media files or even documents to the chat.
For more information, see [Activating dialog and migrating skills](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-activate-dialog).



1. Set the toggle Change topics from actions to dialog to On.
2. Click Save, and then click Close.







 Enabling changing the topic for free text and regex customer responses 

By default, changing the conversation topic works differently for free text and regex responses. Customers can't change topics when:



* The assistant is asking for a free text response
* An utterance matches the pattern in a regex response



If you want a customer to be able to digress and change topics while entering a free text or regex answer:



1. Within the step, click the Settings icon for the customer response.
2. Enable the toggle Allow customer to change topics during a free text response or Allow customer to change topics during a regex response.









 Confirmation to return to previous topic 

By default, new assistants are set to ask a "yes or no" question to confirm that the customers want to return to the previous action. You can modify these settings.

These settings aren't available when the assistant language is set to Another language, which uses the universal language model. For more information, see [Adding support for global audiences](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-admin-language-support).

To change the confirmation settings:



1. From the Actions page of the assistant, click Global settings![Gear icon](https://cloud.ibm.com/docs-content/v1/content/icons/settings.svg).
2. On the Change conversation topic tab, click the Confirmation section.



Settings that you can change are:



Confirmation settings

 Setting Description 

 Ask a confirmation question Change the toggle to Off to disable the confirmation question for all actions. 
 Assistant says By default, the assistant asks Do you want to return to your previous topic? and uses the system variable Digressed from to include the name of the previous action. Use the editor to modify the confirmation question.
We can then implement a custom rendering for these responses.



1. Create a handler for the [pre:receive](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-eventsprereceive) event. In this handler, look for any option responses in the message payload, and convert them into user_defined responses.

function preReceiveHandler(event) {
const message = event.data;
if (message.output.generic) {
message.output.generic.forEach(messageItem => {
if (messageItem.response_type === 'option') {
messageItem.response_type = 'user_defined';
}
})
}
}
2. Create a handler for the [customResponse](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-eventscustomresponse) event. This handler renders the custom buttons, using a custom CardButton style we can define in the CSS. (You can see the definition of this style in the [full example](https://github.com/watson-developer-cloud/assistant-toolkit/tree/master/integrations/webchat/examples/custom-buttons).)

function customResponseHandler(event) {
const { message, element, fullMessage } = event.data;
message.options.forEach((messageItem, index) => {
const button = document.createElement('button');
button.innerHTML = messageItem.label;
button.classList.add('CardButton');
button.addEventListener('click', () => onClick(messageItem, button, fullMessage, index));
element.appendChild(button);
});
}
3.
[An example of the desktop launcher](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/desktop-launcher.png)

The expanded launcher remains in its expanded state even if the customer reloads the page or navigates to a different page. It stays in its expanded state until the customer either opens it by clicking on either of the two primary buttons, or closes it, at which point it returns to its initial small state for the rest of the session.
* For mobile browsers, the launcher shows only a single primary button.

![An example of the mobile launcher](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/mobile-launcher.png)

The customer can close the launcher by scrolling on the page, swiping right on the expanded launcher, or waiting 10 seconds, at which point the expanded launcher shrinks back to its initial small state automatically. If the user reloads the page or navigates to a different page while the laucher is expanded, it stays in its expanded state, and the 10-second timer restarts.



After the next page refresh, if the launcher remains in its small state without being clicked, it bounces up and down to attract the customer's attention. The first bounce happens 15 seconds after the page refresh; if the customer still does not click the launcher, it bounces again 60 seconds later. (The timing of the second bounce might be affected if the user refreshes the page or navigates to a different page.) If the user still does not click the launcher, it does not bounce again.

The language of the default text shown within the launcher depends on the locale configured for the web chat. If you customize the greeting text, the text you provide is used regardless of the locale settings.

You can configure the color of the launcher, as well as the greeting message text, in the web chat settings.
We'll create a simple dialog that handles greeting and ending intents, each with a single node.



 Adding a start node 



1. From the Skills menu, click Dialog.
2. Two nodes were added to the dialog for you:



* Welcome: Contains a greeting that is displayed to your users when they first engage with the assistant.
* Anything else: Contains phrases that are used to reply to users when their input is not addressed by any of the existing dialog nodes.



![A new dialog with two built-in nodes](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/gs-new-dialog.png)
3. Click the Welcome node to open it in the edit view.
4. Replace the default response with the text, Welcome to the Watson Assistant tutorial!.

![Editing the welcome node response](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/gs-edit-welcome-node.png)
5. Click ![Close](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/close.png) to close the edit view.



You created a dialog node that is triggered by the welcome condition. (welcome is a special condition that functions like an intent, but does not begin with a .) It is triggered when a new conversation starts. Your node specifies that when a new conversation starts, the system should respond with the welcome message that you add to the response section of this first node.





 Testing the start node 

You can test your dialog at any time to verify the dialog. Let's test it now.
action: 'start',
content-type: 'audio/l16;rate=22050',
interim_results: true
};
websocket.send(JSON.stringify(message));
websocket.send(blob);
}

websocket.onmessage = function(evt) { onMessage(evt) };
function onMessage(evt) {
console.log(evt.data);
}
Show more

The response includes a single utterance with no pauses.

{
"result_index": 0,
"results": [
{
"alternatives":
{
"transcript": "several to "
}
],
"final": false
}
]
}{
"result_index": 0,
"results": [
{
"alternatives":
{
"transcript": "several tornadoes "
}
],
"final": false
}
]
}{
"result_index": 0,
"results": [
{
"alternatives":
{
"transcript": "several tornadoes swept through "
}
],
"final": false
}
]
}{
. . .
}{
"result_index": 0,
"results": [
{
"alternatives":
{
"confidence": 0.96,
"transcript": "several tornadoes swept through Colorado on Sunday "
}
],
"final": true
}
]
}
Show more







 Low latency 

The low_latency parameter is available for most next-generation models. The parameter is not available with previous-generation models.

The next-generation multimedia and telephony models have generally faster response times than the previous-generation models. But there might be cases where you want to receive results even more quickly.
: The "Try it out" pane now renders HTML formatting that is included in response text. Previously, if you included a hypertext link as an HTML anchor tag in a text response, you would see the HTML source in the "Try it out" pane during testing. It used to look like this:

Contact us at <a href="https://www.ibm.com">ibm.com</a>.

Now, the hypertext link is rendered as if on a web page. It is displayed like this:

Contact us at[ibm.com](https://www.ibm.com).

Remember, you must use the appropriate type of syntax in your responses for the client application to which you will deploy the conversation. Only use HTML syntax if your client application can interpret it properly. Other integration channels might expect other formats.

Deployment changes
: The Test in Slack option was removed.





 11 May 2018 

Information security
: The documentation includes some new details about data privacy. Read more in [Information security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security).





 7 May 2018 

Sydney, Australia data center opens
: You can now create Watson Assistant service instances that are hosted in the Sydney, Australia data center. See [IBM Cloud global data centers](https://www.ibm.com/cloud/data-centers/) for more details.





 4 April 2018 

Search dialogs
: You can now [search dialog nodes](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-tasksdialog-tasks-search) for a given word or phrase.





 15 March 2018 

Introducing IBM Watson® Assistant
: IBM Watson® Conversation has been renamed. It is now called IBM Watson® Assistant. The name change reflects the fact that Watson Assistant is expanding to provide prebuilt content and tools that help you more easily share the virtual assistants you build.
Add the response text, Good day to you!



![Adding a general greeting node to the dialog.](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/gs-add-greeting-node.png)



1. Click ![Close](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/close.png) to close the edit view.
2. Click the More icon ![More options](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/kebab-grey.png) on the #General_Greetings node, and then select Add node below to create a peer node. In the peer node, specify General_Ending in the If assistant recognizes field, and enter OK. See you later. as the response text.
3. Click ![Close](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/close.png) to close the edit view.



![An ending node was added to the dialog also.](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/gs-ending-node-added.png)





 Testing intent recognition 

You built a simple dialog to recognize and respond to both greeting and ending inputs.
welcome This condition is evaluated as true during the first dialog turn (when the conversation starts), only if the initial request from the application does not contain any user input. It is evaluated as false in all subsequent dialog turns. The Welcome node is triggered by this condition. Typically, a node with this condition is used to greet the user, for example, to display a message such as Welcome to our Pizza ordering app. This node is never processed during interactions that occur through channels such as Facebook or Slack. 







 Condition syntax details 

Use one of these syntax options to create valid expressions in conditions:



* Shorthand notations to refer to intents, entities, and context variables. See [Accessing and evaluating objects](https://cloud.ibm.com/docs/assistant?topic=assistant-expression-language).
* Spring Expression (SpEL) language, which is an expression language that supports querying and manipulating an object graph at run time. See [Spring Expression Language (SpEL) language](https://docs.spring.io/spring/docs/current/spring-framework-reference/core.htmlexpressions) for more information.



You can use regular expressions to check for values to condition against. To find a matching string, for example, you can use the String.find method. See [Methods](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-methods) for more details.







 Responses 

The dialog response defines how to reply to the user.

You can reply in the following ways:



* [Simple text response](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overviewdialog-overview-simple-text)
* [Rich responses](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overviewdialog-overview-multimedia)
* [Conditional responses](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overviewdialog-overview-multiple)





 Simple text response 

If you want to provide a text response, simply enter the text that you want your assistant to display to the user.
This documentation is for the classic Watson Assistant experience. To see the documentation for the new Watson Assistant, please go [here](https://cloud.ibm.com/docs/watson-assistant).



 Starting and ending the dialog 

Learn more about how to use the nodes that are added to your dialog automatically to start and end the conversation.

When you add a dialog to your dialog skill, the following dialog nodes are added to it automatically:



* Welcome: Defines how the assistant greets the user and starts the conversation.
* Anything else: What the assistant says when a customer's request cannot be satisfied by any of the defined intents.





 Starting the conversation 

The Welcome node is defined using the welcome special condition, which is triggered when the assistant, rather than the user, starts the conversation. This happens when the integration or client application starts the session with an empty message and then waits for the assistant to greet the user, as in the following situations:



* Preview for the assistant
* "Try it out" pane
* Web chat integration with home screen disabled



However, the Welcome node is skipped in situations when the user initiates the conversation by sending a message, such as with the Slack and Facebook integrations. It is also skipped when using the Web chat integration with the home screen enabled, because in this situation the home screen provides the greeting. (Note that the home screen is enabled by default.)

Unlike the welcome special condition, the conversation_start special condition is always triggered at the start of a conversation. You can use a combination of nodes with these two special conditions (welcome and conversation_start) to manage the start of your dialog in a consistent way.

For more information, see [Special conditions](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overviewdialog-overview-special-conditions).



 Setting initial context 

If you need to set initial context variables at the beginning of each conversation, make sure you do so in a way that works with all of the integrations you plan to use. Do not use the Welcome node to set initial context variables unless you are certain your dialog will only be accessed in situations where the welcome special condition is triggered.
"skip_card": true|false,
"card_title": "{title}",
"card_description": "{description}",
"steps": [
...
]
}

where:

user_defined_type
: The specific type of user-defined response you are defining. To define a journey, always set this property to IBM_BETA_JOURNEYS_TOUR.

skip_card
: An optional property that specifies whether the web chat should start the journey immediately without waiting for the customer to click the introductory card in the web chat window. (The default value is false.)

You can use this option to start a journey directly from your website, even if the web chat is not open. For more information, see [Starting a journey without opening the web chat](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-journeysjourneys-no-web-chat).

card_title
: The title to display on the introductory card that appears in the web chat when a journey is available (for example, Website tour or Disputing a charge).

card_description
: The description to display on the introductory card. Describe the journey so your customers can decide whether they want to open it.

steps
: An array of responses defining the steps in the journey.





 Defining steps 

Each step in a journey is defined as a JSON object describing a response to be shown to the customer, using a format that is similar to how you define assistant responses directly in the generic array. Steps in a journey are shown to the customer one at a time, in the order in which you list them in the steps array.

As with assistant responses, the response_type property identifies the type of response:

text
: A step that shows only text.

{
"response_type": "text",
"text": "This is the text of the response."
}

Markdown formatting and links are supported in text steps.
params.payload.output.generic[0].text = res.translations[0].translation;
return {
body : params
}
})
}
return {
body : params
}
};
Show more





 Removing the webhook 

If you decide you do not want to process message responses, complete the following steps:



1. From the assistant overview page, click the ![Overflow menu](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/kebab.png) icon, and then choose Settings.
2. Click Webhooks > Pre-message webhook.
3. Do one of the following things:



* To change the webhook that you want to call, click Delete webhook to delete the currently specified URL and secret. You can then add a new URL and other details.
* To stop calling a webhook to process every message response, click the Post-message webhook switch to disable the webhook altogether.