vania-janet/multiturn-rag-retrieval-data huggingface dataset:
See [Create Visualforce Pages](https://help.salesforce.com/articleView?id=pages_creating.htm&type=5)



* From the web chat integration page in Watson Assistant, copy the code snippet from the Visualforce page markup field.
* Switch to your Salesforce web page. Search for Visualforce Pages. Create a page. Add a label and name to the page. Select the Available for Lightning Experience, Lightning Communities, and the mobile app checkbox. Paste the code snippet that you copied in the previous step into the page markup field.



7. Add the Visualforce page that you created to the Salesforce chat app.

To ensure the Salesforce agents can see history of the chat between the customer and your assistant, you must add the page that you created earlier into the console that they use to keep track of their work. See [Create and Configure Lightning Experience Record Pages](https://help.salesforce.com/articleView?id=lightning_app_builder_customize_lex_pages.htm&type=5).



* From the Salesforce App Launcher, open the chat app that you created for your agents to talk to customers.
* Open the Chat Transcripts object, and then select a transcript page.
* Click the Setup icon, and then select Edit Page.
* Drag the Visualforce component and drop it into the Chat Transcript Record page layout where you want the chat window to be displayed.
* In the component editor, select the Visualforce page that you created earlier, make any adjustments to the component height that you want, and then click Save.

If you do make changes, make sure the height of the Visualforce page is 20 px smaller than the height of the component that you add it to. By default, the height of the component is 300 px and the height of the Visualforce page is 280 px. (The height of the Visualforce page is specified in the height attribute of the iframe HTML element in the code snippet that you copy and paste.)
* Click Activation, and then click the APP, RECORD TYPE, AND PROFILE tab.
For more information, see [Integrating the web chat with your website](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-web-chat).
2. From the web chat integration page in Watson Assistant, set the Allow transfers to live agents switch to On, and then choose Salesforce as the service desk type. Click Next.
3. For Watson Assistant to connect to a Salesforce service desk, it needs information about your organization's Salesforce chat deployment and button implementations. Specifically, it needs the API endpoint, organization ID, deployment ID, and button ID. The service can derive the values that it needs from code snippets that you copy and paste to this configuration page.

In a separate browser tab or window, open your Salesforce account settings page. Log in with a user ID that has administrative privileges. You must switch back and forth between your Salesforce and Watson Assistant web chat integration setup pages. It's easier to do so if you have both pages open at once.



* Get the deployment code for your Salesforce Agent Configuration chat deployment.

Go to the Salesforce Feature Settings>Service>Chat>Deployments page. Find your organization's deployment. Scroll to the end of the chat deployment configuration page and copy the Deployment Code snippet.
* Paste the deployment code snippet into the Deployment code field in the Watson Assistant Salesforce configuration page.
* Get the Chat Button code.

Go to the Salesforce Feature Settings>Service>Chat>Chat Buttons & Invitations page. Find your organization's button implementation. Scroll to the end of the page, and then copy the Chat Button Code snippet.
* Paste the chat button code snippet into the Chat button code field in the Watson Assistant Salesforce configuration page, and then click Next.



4. Add a chat app that enables the Salesforce agent to see a history of the chat. To do so, create a Visualforce page, and then add a chat app to the page.
5. Add custom fields to the Salesforce chat transcript layout.

This is a one-time task. If the fields already exist for your organization, you can skip this step.
2. Click Add on the WhatsApp with Twilio tile.
3. Click Confirm.
4. From the Twilio site, click on your account name in the upper left menu to go to your account dashboard.

Copy the following values and store them temporarily, so you can paste them into the WhatsApp with Twilio integration setup page in the upcoming steps.



* Account SID
* Auth token



5. Return to the WhatsApp with Twilio integration setup page. Click Next to go to Step 1 of your WhatsApp with Twilio integration setup.
6. Enter your Account SID information. Click Next to go to Step 2 of your WhatsApp with Twilio integration setup.
7. Enter your Auth token information. Click Next to go to Step 3 of your WhatsApp with Twilio integration setup.
8. Copy the value from the Webhook URI field.

You can use this webhook URI to test your integration in the following section.
9. Click Finish.







 Testing the integration 

While you wait for WhatsApp to approve your request, you can test the integration by using the Twilio sandbox. With the sandbox, you can send and receive preapproved template messages to numbers that join your sandbox, using a shared Twilio test number.

Do not use the Twilio sandbox in production. Sandbox sessions expire after 3 days.



1. To create a sandbox, go to the [Twilio Try WhatsApp](https://www.twilio.com/console/sms/whatsapp/learn) web page. An Activate your sandbox prompt is displayed. Agree to have a sandbox created, and confirm your choice.
2. Follow the instructions to create the sandbox.
3. Connect to the sandbox by sending a WhatsApp message from your device to the sandbox phone number.
4. From the Develop tab, click Messaging > Settings > WhatsApp sandbox settings.
5.
[Shows a small options list in the Preview that is displayed as buttons.](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/options-buttons.png)

Otherwise, the options are displayed as a list.

To add an Option response type, complete the following steps:



1. From the dialog node where you want to add the response type, click the dropdown menu in the Assistant responds field, and then choose Option.
2. Click Add option.
3. In the List label field, enter the option to display in the list.

The label must be less than 2,048 characters in length.
4. In the corresponding Value field, enter the user input to pass to your assistant when this option is selected.

The value must be less than 2,048 characters in length.

For Slack integrations where the options are displayed as a list, each value must be 75 characters or less in length.

Specify a value that you know will trigger the correct intent when it is submitted. For example, it might be a user example from the training data for the intent.
5. Repeat the previous steps to add more options to the list.

You can add up to 20 options.
6. Add a list introduction in the Title field. The title can ask the user to pick from the list of options.

Some integration channels do not display the title.
7. Optionally, add additional information in the Description field. If specified, the description is displayed after the title and before the option list.

Some integration channels do not display the description.
8. Optional: If you want to indicate a preference for how the options are displayed, as buttons or in a list, you can add a preference property for the response.

To do so, open the JSON editor for the response, and then add a preference name and value pair before the response_type name and value pair. You can set the preference to dropdown or button.

{
"output": {
1. Create a web chat integration. For more information, see [Integrating the web chat with your website](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-web-chat).
2. From the web chat integration page in Watson Assistant, set the Allow transfers to live agents switch to On, and then choose Zendesk as the service desk type, and then click Next.
3. Add the account key for your Zendesk account, and then click Next.

To get the account key for your Zendesk account, follow these steps:



* Log in to your Zendesk subdomain.
* Open the Zendesk Chat Dashboard.

From the Zendesk Support dashboard, you can click the Zendesk Products icon in the header, and then click the Chat icon.

![Screen capture of the chat icon in the header.](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/zd-open-chat.png)
* Click your profile, and then click Check Connection.

![Screen capture of the Zendesk user interface to show where the profile is located.](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/zd-status-dropdown.png)
* Copy the account key value.

![Screen capture of the connection dialog.](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/zd-account-key.png)
* Return to the setup page in Watson Assistant, and then paste the key into the field.



4.
Add a root node to your dialog that conditions on the intent you created in the previous step. Choose Connect to human agent as the response type.

For more information, see [Adding a Connect to human agent response type](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overviewdialog-overview-add-connect-to-human-agent).
3. Add meaningful names to the dialog nodes in your dialog.

When a conversation is transferred to an agent, the name of the most-recently processed dialog node is sent with it. To ensure that a useful summary is provided to service desk agents when a conversation is transferred to them, add short dialog node names that reflect the node's purpose. For example, Find a store.

Some older skills specify the purpose of the node in the external node name field instead.

![Screen capture of the field in the node edit view where you add the node purpose summary.](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/disambig-node-purpose.png)

Every dialog branch can be processed by the assistant while it chats with a customer, including branches with root nodes in folders.
4. If a child node in any dialog branch conditions on a request or question that you do not want the assistant to handle, add a Connect to human agent response type to the child node.

At run time, if the conversation reaches this child node, the dialog is passed to a human agent at that point.



Your dialog is now ready to support transfers from your assistant to a service desk agent.

For more information about different service desk solutions, see the following resources:



* [Adding service desk support to the web chat](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-web-chatdeploy-web-chat-haa)
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. In your onLoad event handler, use the [on()](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-instance-methodson) instance method to subscribe to the pre:receive and customResponse events, registering the handlers as callbacks.

instance.on({ type: 'customResponse', handler: customResponseHandler });
instance.on({ type: 'pre:receive', handler: preReceiveHandler });
4. Create a click handler to respond when the customer clicks on one of the custom buttons. In the handler, use the [send()](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-instance-methodssend) instance method to send a message to the assistant, using the button label as the message text.

In addition, we're adding the custom CSS class CardButton--selected to the clicked button, changing its appearance to show that it was selected. (This class is also defined in the [full example](https://github.com/watson-developer-cloud/assistant-toolkit/tree/master/integrations/webchat/examples/custom-buttons).)

function onClick(messageItem, button, fullMessage, itemIndex) {
webChatInstance.send({ input: { text: messageItem.label }});
button.classList.add('CardButton--selected');
}
5.
To add a context variable, specify the variable name, and press Enter.
2. To define a default value for the context variable, find the context variable you added in the list, and then specify a value for it.



See [Context variables](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-runtime-context) for more information.
8. Continue to interact with the dialog to see how the conversation flows through it.



* To find and resubmit a test utterance, you can press the Up key to cycle through your recent inputs.
* To remove prior test utterances from the chat pane and start over, click the Clear link. Not only are the test utterances and responses removed, but this action also clears the values of any context variables that were set as a result of your interactions with the dialog.







 What to do next 

Make changes to the dialog to address issues you see when testing:



* If you determine that the wrong intents or entities are being recognized, you might need to modify your intent or entity definitions.
* If the correct intents and entities are being recognized, but the wrong nodes are being triggered in your dialog, make sure your conditions are written properly.



If you are ready to put the conversation to work helping your users, integrate your assistant with a messaging platform or custom application. See [Adding integrations](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-integration-add).







 Searching your dialog 

You can search the dialog to find one or more dialog nodes that mention a given word or phrase.



1. Select the Search icon: ![Search icon](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/search_icon.png)
2. Enter a search term or phrase.

The first time you search, an index is created. You might be asked to wait while the text in your dialog nodes is indexed.
Type the name of the page you created earlier.
3. After the page comes up, click it, and then start chatting with the assistant.



The Welcome node of your dialog is not processed by the Facebook Messenger integration. The welcome message is not displayed in the Facebook chat 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. Facebook Messenger 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. Files shared in the chat can be intercepted and processed by a configured premessage webhook. For more details, see [Processing input attachments](https://cloud.ibm.com/docs/assistant?topic=assistant-api-input-attachments).
From the web chat integration page in Watson Assistant, set the Allow transfers to live agents switch to On, and then choose Salesforce as the service desk type. Click Next.
3. For Watson Assistant to connect to a Salesforce service desk, it needs information about your organization's Salesforce chat deployment and button implementations. Specifically, it needs the API endpoint, organization ID, deployment ID, and button ID. The service can derive the values that it needs from code snippets that you copy and paste to this configuration page.

In a separate browser tab or window, open your Salesforce account settings page. Log in with a user ID that has administrative privileges. You must switch back and forth between your Salesforce and Watson Assistant web chat integration setup pages. It's easier to do so if you have both pages open at once.



* Get the deployment code for your Salesforce Agent Configuration chat deployment.

Go to the Salesforce Feature Settings>Service>Chat>Deployments page. Find your organization's deployment. Scroll to the end of the chat deployment configuration page and copy the Deployment Code snippet.
* Paste the deployment code snippet into the Deployment code field in the Watson Assistant Salesforce configuration page.
* Get the Chat Button code.

Go to the Salesforce Feature Settings>Service>Chat>Chat Buttons & Invitations page. Find your organization's button implementation. Scroll to the end of the page, and then copy the Chat Button Code snippet.
* Paste the chat button code snippet into the Chat button code field in the Watson Assistant Salesforce configuration page, and then click Next.



4. Add a chat app that enables the Salesforce agent to see a history of the chat. To do so, create a Visualforce page, and then add a chat app to the page.
5. Add custom fields to the Salesforce chat transcript layout.

This is a one-time task. If the fields already exist for your organization, you can skip this step.

These custom fields are referenced from the Visualforce page code that you will use in the next step.
* To add an entire dialog branch that is only processed by a specific integration type, add the appropriate integration type context variable, such as $integrations.chat, to the If assistant recognizes field of the dialog root node.
* To add a single dialog node that is only processed by a specific integration type, add the appropriate integration type context variable, such as $integrations.zendesk, to the If assistant recognizes field of the dialog child node.
* To add slightly different responses for a single dialog node based on the integration type, complete the following steps:



* From the node's edit view, click Customize and then set the Multiple conditioned responses switch to On. Click Apply.
* In the dialog node response section, add the appropriate condition and corresponding response for each custom response type.



The following examples show how to specify a hypertext link in the best format for the integration where the text response will be displayed. For the Web chat integration, which supports Markdown formatting, you can include a link label in the response text to make the response look nicer. For the SMS with Twilio integration, you can skip the formatting that makes sense in a web page, and add the straight URL.



Custom conditioned responses

 Integration type Condition Sample text response 

 SMS with Twilio `$integrations.text_messaging` `For more information, go to https://www.ibm.com.` 
 Web chat `$integrations.chat` `For more information, go to [the ibm.com site](https://www.ibm.com).` 
 Response to show if no other conditions are met. `true` `For more information, go to ibm.com.` 





The rich response types often behave differently when they are displayed in different built-in integrations or in the assistant preview. For more information about these unique behaviors, see the following topics:



* [Web chat](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-web-chatdeploy-web-chat-dialog)





* [Phone](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-phonedeploy-phone-dialog)
In the IBM Cloud console, click the Actions icon ![Actions icon](https://cloud.ibm.com/docs-content/v1/content/4d8c6eec891cff72b666dc24bd3211810c77fb42/icons/action-menu-icon.svg), and select Edit.
2. Use the dashboard panel to add and remove widgets, and adjust the scope of your resources. To view a list of the available widgets, see [Dashboard widgets](https://cloud.ibm.com/account?topic=account-add-widgetsdashboard-widget).



You can't directly edit the default console dashboard. When you click Edit on the default console dashboard, a duplicate version is created that you can edit. You can return to the original default console dashboard by selected the dashboard with the default label.



 Dashboard widgets 

When you customize a dashboard, you can add widgets to ensure what is displayed is relevant to you. The widgets range from development centric to management centric, and you can add and remove them at any time. The following widgets are available to add to a dashboard:



* Apps: Create and manage your apps by using this widget.
* Classic infrastructure: View all useful links for classic infrastructure users.
* Compliance and security: Monitor your overall security and compliance to internal and external regulations.
* For you: This widget displays recommendations that are selected for you.
* IBM Cloud status: Stay up to date on the status of resources in specific locations.
* Kubernetes: View and track your clusters after you create them.
* News: Stay up to date with the latest IBM Cloud News.
* Notes: You can use this widget to provide essential information that's custom to your team.
* Planned maintenance: View upcoming and planned maintenance events.
* Quick start: Personalized tasks to help you get started with IBM Cloud.
* Recent support cases: View a summary of your support cases.
* Resource summary: Track and view the status of your resources.
* Spending summary: View a summary of total spending over the past year.
From the Watson Assistant Slack integration configuration page, paste the verification token that you copied in the previous step into the Verification token field.
15. Click Generate request URL, and then copy the generated request URL.
16. Return to the Slack app settings page. Open the Event Subscriptions page, and then turn on Enable Events. Paste the request URL that you copied in the previous step into the field.
17. On the Event Subscriptions page in Slack, find the Subscribe to Bot Events section. Click Add Bot User Event, and then select the event types you want to subscribe to. You must select at least one of the following types:



* message.im: Listens for message events that are posted in a direct message channel.
* app_mention: Listens for only message events that mention your app or bot.

Choose the app_mention entry in normal font, not the app_mention entry that is in bold font.



18. Click Save Changes.
19. Optional: To add support for showing buttons, menus, and disambiguation options in the Slack app, go to the Interactive Components tab and enable the feature. Paste your request URL in the provided text entry field, and then click Enable Interactive Components.







 Action considerations 

The rich responses that you add to an action are displayed in a Slack channel as expected, with the following exceptions:



* Connect to live agent: This response type is ignored.
* Option: This response type shows a list of options that the user can choose from.



* 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.









 Chatting with the assistant 

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



1.