vania-janet/multiturn-rag-retrieval-data huggingface dataset:
From the WhatsApp with Twilio integration setup page, scroll to the Setup instructions section, and then copy the value from the Webhook URI (uniform resource identifier) field.
2. Go to your Twilio account web page and add the webhook you copied to the Twilio configuration to complete the connection to the WhatsApp integration in Twilio.







 Give your customers fast access to your assistant 

You can add an icon to your web page that customers can click to start a conversation over WhatsApp with your assistant.

To add an icon to your web page, complete the following steps:



1. From the WhatsApp with Twilio integration setup page, click the Click to chat tab.
2. In the Prefilled message field, add text that you want WhatsApp to send to your assistant on the customer's behalf to get the conversation started.

Specify a message that you know your assistant can answer in a useful way.
3. Copy the embed link and add it to your web page. Consider adding text in front of the icon that explains what the icon does. For example, you might add a <span> HTML tag in front of the icon's <span> element that says Have a question? Ask Watson Assistant for help.

When a user clicks the icon in your web page, it opens a WhatsApp messaging session that is connected to your assistant, and adds the text you specify into the user's text field, ready to be submitted.







 Dialog considerations 

The rich responses that you add to the dialog are displayed in WhatsApp as expected, with the following exceptions:



* Image: This response type embeds an image in the response. A title and description are displayed before the image.
* Audio: This response type embeds audio from various file formats in the response. A title and description are not displayed, whether or not you specify them. WhatsApp automatically shows a preview of content on supported platforms (such as SoundCloud and Mixcloud).
* Video: This response type embeds a native video from various file formats in the response. A title and description are not displayed, whether or not you specify them.
For more information about UUIDs, see [RFC 4122](https://tools.ietf.org/html/rfc4122.html).



* For web chat, if you do not pass an identifier for the user when the session begins, the web chat creates one for you. It creates a first-party cookie with a generated anonymous ID. The cookie remains active for 45 days. If the same user returns to your site later in the month and chats with your assistant again, the web chat integration recognizes the user.









 Service API versioning 

API requests require a version parameter that takes a date in the format version=YYYY-MM-DD. Whenever we change the API in a backwards-incompatible way, we release a new minor version of the API.

Send the version parameter with every API request. The service uses the API version for the date you specify, or the most recent version before that date. Don't default to the current date. Instead, specify a date that matches a version that is compatible with your app, and don't change it until your app is ready for a later version.

The current version for both V1 and V2 is 2020-04-01.

For API usage information, see the API reference documentation. Links for v1 and v2 are available from the table of contents.

For an example of using the API, see [Testing the search skill by using the API](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-skill-search-addsearch-skill-add-test-via-api).
By default, the option label Connect with agent is used. If your web chat is integrated with a service desk, this message initiates a conversation transfer, as long as your dialog is designed to handle transfer requests.

If your web chat is not integrated with a service desk, you can change the option label to a message that helps your customers reach whatever form of support you do offer. If you offer a toll-free support line, you might add Get the support line phone number. Or if you offer an online support request form, you might add Open a support ticket.

Whether you use the default option label or add your own, make sure your dialog is designed to recognize the message and respond to it appropriately. For more information, see [Connecting customers with support](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-support).



With web chat version 2.4 only, you cannot enable suggestions unless your web chat is connected to [a service desk solution](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-web-chatdeploy-web-chat-haa). Later releases allow you to enable suggestions whether or not you have human agent support configured.





 Dialog considerations 

The rich responses that you add to a dialog are displayed in the web chat as expected, with the following exceptions:



* Connect to human agent: If service desk support is enabled for the web chat, this response type triggers a chat transfer. If service desk support is not configured, this response type is ignored.
* Option: If your option list contains up to four choices, they are displayed as buttons. If your list contains five or more options, then they are displayed in a drop-down list.
* Pause: This response type pauses the assistant's activity in the chat. However, activity does not resume after the pause until another response is triggered. Whenever you include a pause response type, add another, different response type, such as text, after it.



For more information about rich response types, see [Rich responses](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overviewdialog-overview-multimedia).
If your CSP uses a nonce to add elements such as <script> and <style> tags to an allowlist, do not use unsafe-inline to allow all such elements. Instead, provide a nonce value to the web chat widget as a configuration option. The web chat will then set the nonce on any of the <script> and <style> elements that it generates dynamically.

A CSP that passes a nonce to the web chat widget might look like this:

<meta
http-equiv="Content-Security-Policy"
content="default-src 'self' .watson.appdomain.cloud fonts.gstatic.com 'nonce-<server generated value>';connect-src .watson.appdomain.cloud"
>

You can pass the nonce to the web chat by editing the embed script as follows:

window.watsonAssistantChatOptions = {
integrationID: "YOUR_INTEGRATION_ID",
region: "YOUR_REGION",
serviceInstanceID: "YOUR_SERVICE_INSTANCE",

cspNonce: "<server generated value>",

onLoad: function(instance) {
instance.render();
}
};







 Access to web chat hosts 

If the system that hosts your website has limited Internet access (for example, if you use a proxy or firewall), make sure the following URLs are accessible:



* https://web-chat.global.assistant.watson.appdomain.cloud: Hosts the code for the web chat widget, and is referenced by the script you embed on your website.
* https://integrations.{location}.assistant.watson.appdomain.cloud: Hosts the web chat server, which handles communication with your assistant. Replace {location} with the location of the data center where your service instance is located, which is part of the service endpoint URL. For more information, see [Finding and updating the endpoint URL](https://cloud.ibm.com/docs/watson?topic=watson-endpoint-changeendpoint-find-update).







 Reviewing security
Controlling the web chat version 

The web chat JavaScript code follows semantic versioning practices. Starting with web chat version 2.0.0, you can set the version of the web chat that you want to use as a configuration option.

If you don't specify a version, the latest version is used automatically (clientVersion: "latest"). When you apply the latest version, you benefit from the continuous improvements, feature additions, and bug fixes that are made to the web chat regularly.

However, if you apply extensive customizations to your deployment, such as overriding the theme with your own custom theme, you might want to lock your deployment to a specific version. Locking on a version enables you to test new versions before you apply them to your live web chat.

To use a specific version (clientVersion: "major.minor.patch"), specify it as follows:

The following examples show what to specify when the current version is 2.3.1.



*  If you want to stay on a major version, but get the latest minor and patch releases, specify clientVersion: "2".
*  If you want to stay on a minor version, but get the latest patch releases, specify clientVersion: "2.3".
*  If you want to lock on to a specific minor version and patch release, specify clientVersion: "2.3.1".



To test the updates in a version release of the web chat before you apply the version to your live web chat, follow these steps:



1.  Lock the web chat that is running in your production environment to a specific version.
2.  Embed your web chat deployment into a new page in a test environment, and then override the version lock setting. For example, specify clientVersion: "latest".
3.  Test the web chat, and make adjustments to the configuration if necessary.
4.  Update your production deployment to use the latest version and apply any other configuration changes that you determined to be necessary after testing.



For more information about features that were introduced in previous web chat versions, see the [Web chat release notes](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-release-notes-chat).
For more information, see the [instance.writeableElements() method](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-instance-methodswriteableelements) documentation.
* For information about CSS helper classes that you can use to change the home screen style, see the [prebuilt templates](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-renderhtml) documentation.







 Showing more suggestions ![Beta](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/beta.png) 

Suggestions give your customers a way to try something else when the current exchange with the assistant isn't delivering what they expect. A question mark icon ![Question mark icon](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/question-mark.png) is displayed in the web chat that customers can click at any time to see other topics that might be of interest or, if configured, to request support. Customers can click a suggested topic to submit it as input or click the X icon to close the suggestions list.

The suggestions are shown automatically in situations where the customer might otherwise become frustrated. For example, if a customer uses different wording to ask the same question multiple times in succession, and the same dialog node is triggered each time, then related topic suggestions are shown in addition to the triggered node's response. The suggestions that are offered give the customer a quick way to get the conversation back on track.

The suggestions list is populated with dialog nodes that condition on intents that are related in some way to the matched intent.
[Yes](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/checkmark-icon.svg) 





* Currently, the web chat integration ignores the description and image_url properties. Instead, the description and preview image are dynamically retrieved from the source at run time.







 Fields 



 Name Type Description Required? 

 response_type string iframe Y 
 source string The URL of the external content. The URL must specify content that is embeddable in an HTML iframe element. Y 
 title string The title to show before the embedded content. N 
 description string The text of the description that accompanies the embedded content. N 
 image_url string The URL of an image that shows a preview of the embedded content. N 
 channel_options.chat.display string The way web chat should render the response type (inline or panel). Default value is panel for this response type. N 
 channel_options.chat.dimensions.base_height number The base height (in pixels) to use to scale the content to a specific display size. This property only works when display is set to inline. N 



Note that different sites have varying restrictions for embedding content, and different processes for generating embeddable URLs. An embeddable URL is one that can be specified as the value of the src attribute of the iframe element.

For example, to embed an interactive map using Google Maps, you can use the Google Maps Embed API. (For more information, see [The Maps Embed API overview](https://developers.google.com/maps/documentation/embed/get-started).) Other sites have different processes for creating embeddable content.
* language: The default locale code of the browser, such as en-US.
* page_url: Full URL of the web page in which the web chat is embedded. For example: https://www.example.com/products
* screen_resolution: Specifies the height and width of the browser window in which the web page is displayed. For example: width: 1440, height: 900
* user_agent: Content from the User-Agent request header. For example: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:80.0) Gecko/20100101 Firefox/80.0
* client_ip_address: IP address of the customer's computer. For example: 183.49.92.42





 Example: Using page URL information in your dialog 

You might embed the web chat in multiple pages on your website. Let's say you want to route chat transfers from the web chat to different Salesforce agents based on the page from which the customer asks to speak to someone. If the customer is on the insurance plans page of your website (https://www.example.com/insurance.html), you want to route them to agents who are experts in your company's insurance plans. If the customer is on the investments web page (https://www.example.com/invest.html), you want to route them to agents who are experts in your company's investment opportunities. You can add multiple conditioned responses to the dialog node where the transfer takes place and add logic like this:

Conditioned response 1



* Condition: $integrations.chat.browser_info.page_url.contains('insurance.html')
* Response type: Connect to human agent
* Button ID: Z23453e25vv (The button that routes to the insurance experts agent queue)



Conditioned response 2



* Condition: $integrations.chat.browser_info.page_url.contains('invest.html')
* Response type: Connect to human agent
* Button ID: Z23453j24ty (The button that routes to the investment experts agent queue)
4.4.0 

Release date: 25 June 2021



* Bug fixes.







 4.3.0 

Release date: 7 June 2021



* Search suggestions: If a search skill is configured for your assistant, the suggestions include a new View related content section. This section contains search results that are relevant to the user input.
* Focus trap: A new enableFocusTrap option enables maintaining focus inside the web chat widget while it is open. For more information, see [Configuration options object](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-configurationconfigurationobject).







 4.2.1 

Release date: 6 May 2021



* Service URLs updated: The URLs used by the web chat to communicate with the Assistant service have been updated to remove the dependency on the deprecated watsonplatform.net domain. This change applies retroactively to version 3.3.0 and all subsequent web chat releases. Make sure the system that hosts the web chat widget has access to the new URL; for more information, see [Deploy your assistant in production](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-web-chatdeploy-web-chat-snippet).







 4.2.0 

Release date: 27 April 2021



* Conversation starters in suggestions: The conversation starters you configure for the home screen are now shown as suggestions. If suggestions are enabled, the conversation starters appear in a new section titled People are also interested in. This provides an easy way for customers to change the subject or start the conversation over. For more information about the suggestions feature, see [Showing more suggestions](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-web-chatdeploy-web-chat-alternate). For more information about the home screen, see [Configuring the home screen](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-web-chatdeploy-web-chat-home-screen).
From this page, you can see conversation logs and metrics that give you insights, such as what topics your customers are asking about and how often the assistant succeeds in addressing customer requests. For more information, see [Metrics overview](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-logs-overview).

Introducing the Web chat integration
: Deploy your assistant in minutes. Create a web chat integration to embed your assistant into a page on your website as a chat widget. Web chat version 3.3.0 is included in this release. For more information, see [Integrating the web chat with your website](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-deploy-web-chat).

Introducing the Preview link integration
: Deploy your assistant to an IBM-branded web site for testing purposes. When you add both a dialog skill and search skill to your assistant, you can test the overall interaction between the two skills by using the preview link integration. For more information, see [Testing your assistant from a web page](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-deploy-web-link).

Improved system entities
: A new interpretation property is returned for the system entities in all languages. The new property provides additional information about the recognized entity which can be leveraged by your dialog. For more information, see [System entities](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-system-entities).

Irrelevance detection
: The irrelevance detection classification algorithm was updated to make it even smarter out of the box. Now, even before you begin to teach the system about irrelevant requests, it is able to recognize user input that your skill is not designed to address. The new algorithm is enabled by default for any English-language skills that you import or create. For more information, see [Irrelevance detection](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-irrelevance-detection).
For more information, see [Adding the web chat to your mobile application](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-develop-mobile).





 Customizing the conversation 

Intercepting and modifying messages
: By [subscribing to events](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-eventssummary), your code can intercept messages that are sent and received between the customer and the assistant, and even modify their content.

Subscribe to the [pre:receive](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-eventsprereceive) event if you want to intercept a customer's message before it is sent to the assistant. For example, you might want to remove personally identifiable information from the message text or add context variables to the message payload.

Subscribe to the [pre:send](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-eventspresend) event if you want to intercept an incoming response from the assistant before it is shown to the customer. For example, you might want to add formatting, links, or other elements that are specific to the web chat.

![development icon](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/development-icon.png)Tutorial: For a tutorial showing how to use the pre:receive event to intercept and modify incoming messages, see [Tutorial: implementing custom option buttons in the web chat](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-develop-custom-buttons).

Rendering custom response types
: If your assistant sends specialized responses using a custom (user_defined) response type, you can implement a custom view to display these responses in the web chat window.
Tutorial: Providing a downloadable conversation transcript 

You can customize the web chat to offer your customers the option of downloading a transcript of the conversation history.

For a complete, working version of the example described in this tutorial, see [Download history for Watson Assistant web chat](https://github.com/watson-developer-cloud/assistant-toolkit/tree/master/integrations/webchat/examples/download-history).

To support downloading a conversation transcript, this example adds a custom menu option to the overflow menu in the header of the chat window:

![Screen capture showing "Download history" menu option](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/web-chat-download-history.png)

Clicking this menu option initiates downloading of a file containing the complete conversation history in comma-separated values (CSV) format.



1. Create a handler for the [send](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-eventssend) and [receive](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-eventsreceive) events. In this handler, save each incoming or outgoing message in a list (messages) in order to maintain a history of the conversation.

const messages = [];

function saveMessage(event) {
messages.push(event.data);
}
2. Create a handler for the [history:begin](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-eventshistorybegin) event, which is fired when the web chat is reloaded from the session history. In this handler, save any reloaded session history to the list.

function saveHistory(event) {
messages.push(...event.messages);
}
3.
If you want to use a different set of fonts, you can customize the CSS for your web chat implementation. For more information, see [Theming](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-instance-methodstheming).
* When your implementation does not specify a unique user ID, the web chat adds a first party cookie with a generated anonymous ID to use to identify the unique user. The generated cookie now expires after 45 days. For more information, see [GDPR and cookie policies](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=key-conceptsdatapolicy).







 1.5.2 

Release date: 2 April 2020



* Introduced the learningOptOut parameter: You can add the learningOptOut parameter and set it to true to add the X-Watson-Learning-Opt-Out header to each /message request that originates from the Web Chat. For more information about the header, see [Data collection](https://cloud.ibm.com/apidocs/assistant/assistant-v2data-collection). For more information about the parameter, see [Configuration](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-configuration).







 1.4.0 

Release date: 20 March 2020



* Customize the CSS theme: For more information, see [Theming](https://integrations.us-south.assistant.watson.cloud.ibm.com/web/developer-documentation/api-instance-methodstheming).
* Shadow DOM is no longer used: When you use custom response types or HTML in your dialog, you can apply CSS styles that are defined in your web page to the assistant's response. To override any default styling in the web chat, you must specify the !important modifier in your CSS.