vania-janet/multiturn-rag-retrieval-data huggingface dataset:
When you enable security, your assistant takes an additional step to verify that messages originate from the web chat that is embedded in your website only.

The web chat uses an RSA signature with SHA-256 to encrypt communication. RS256 cryptography is a sophisticated type of RSA encryption. An RSA key pair includes a private and a public key. The RSA private key is used to generate digital signatures, and the RSA public key is used to verify digital signatures. The complexity of the RSA algorithm that is used to scramble the message makes it nearly impossible to unscramble the message without the key.

You can implement the following security measures:



* Ensure that messages sent from the web chat to your assistant come from your customers only
* Send private data from the web chat to your assistant



For more information about security, see [Security](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=key-conceptssecurity).



 Enable security 

The process you use to add the web chat to your website is simple. Its simplicity also means it can be misused. That's why it's important to verify that the messages sent to your assistant are coming from authorized users only.

After you enable security, users cannot submit messages through the web chat unless you take steps to prove their origin. Do not enable it until you have support for authentication in place.

Before you enable security, complete the following steps:



1. Create a RS256 private/public key pair.

You can use a tool such as the OpenSSL command line or PuTTYgen.



* For example, to create the key pair: openssl genrsa -out key.pem 2048



2. Use your private key to sign a JSON Web Token (JWT). You will pass the token with the messages that are sent from your website as proof of their origin.

The JWT payload must specify values for the following claims:



* iss: Represents the issuer of the JWT. This value is a case-sensitive string.
* sub: Represents the principal that is the subject of the JWT.
(For the complete function, see the [full example](https://github.com/watson-developer-cloud/assistant-toolkit/tree/master/integrations/webchat/examples/content-carousel).)

carouselData.forEach((cardData) => {
const { url, title, description, alt } = cardData;
const cardElement = document.createElement('div');
cardElement.classList.add('swiper-slide');

cardElement.innerHTML = 
<div class="bx--tile Carousel__Card">
<img class="Carousel__CardImage" src="${url}" alt="${alt}" />
<div class="Carousel__CardText">
<div class="Carousel__CardTitle">${title}</div>
<div class="Carousel__CardDescription">${description}</div>
</div>

<a href="https://www.ibm.com" class="Carousel__CardButton bx--btn bx--btn--primary" target="_blank">
View more details
</a>

<button type="button" class="Carousel__CardButton Carousel__CardButtonMessage bx--btn bx--btn--primary">
Tell me more about this
</button>
</div>
;

...

});
Show more
4. 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 customResponse event, registering the carouselCustomResponseHandler() function as the callback.

instance.on({
You can [search your dialog](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-tasksdialog-tasks-search) to find out where you are currently using the entity, and remove it. Consider using a contextual entity to identify references to locations and people instead. After removing the entity from your dialog, disable the entity from the System entities page.





 13 May 2020 

Stateless v2 message API
: The v2 runtime API now supports a new stateless message method. If you have a client application that manages its own state, you can use this new method to take advantage of [many of the benefits](https://medium.com/ibm-watson/the-new-watson-assistant-v2-stateless-api-unlock-enterprise-features-today-2c02a4bbdef5) of the v2 API without the overhead of creating sessions. For more information, see the [API Reference](https://cloud.ibm.com/apidocs/assistant/assistant-v2message-stateless).





 30 April 2020 

Web chat is generally available!
: Add your assistant to your company website as a web chat widget that can help your customers with common questions and tasks. Service desk transfer support continues to be a beta feature. For more information, see [Integrating with your own website](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-web-chat).

Secure your web chat
: Enable the beta security feature of web chat so that you can verify that messages sent to your assistant come from only your customers and can pass sensitive information to your assistant.





 27 April 2020 

Add personality to your assistant in web chat
: You can add an assistant image to the web chat header to brand the window. You can add an avatar image that represents your assistant or a brand logo, for example. For more information, see [Integrating with your own web site](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-web-chat).

Know your plan
: Now your service plan is displayed in the page header.
See [Profiles](https://help.salesforce.com/articleView?id=admin_userprofiles.htm&type=5).
* A [chat deployment](https://help.salesforce.com/articleView?id=live_agent_create_deployments.htm&type=5).
* A [chat button deployment](https://help.salesforce.com/articleView?id=live_agent_create_buttons.htm&type=5).
* Routing must be configured for the chat button. See [Chat routing options](https://help.salesforce.com/articleView?id=live_agent_chat_routing_options.htm&type=5).
* If you choose omni-channel routing, be sure to include omni-channel as a utility in the chat app. See [Omni-Channel](https://help.salesforce.com/articleView?id=omnichannel_intro.htm&type=5).



You must have a level of access to your Salesforce service desk deployment that allows you to do the following things:



* Edit the chat app
* Get chat deployment and button code details
* Add custom fields to layout objects
* Create Visualforce pages



If you don't, ask someone with the appropriate level of access to perform this procedure for you.





 Setting up the Salesforce service desk connection 

To set up a Salesforce service desk integration, complete the following steps:



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 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.
* [Kustomer](https://github.com/watson-developer-cloud/assistant-web-chat-service-desk-starter/tree/main/src/kustomer/webChat)
* [Bring your own (starter kit)](https://github.com/watson-developer-cloud/assistant-web-chat-service-desk-starter)



Phone live agent integrations



* [Phone with Genesys Cloud](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-deploy-phone-genesys)
* [Phone with NICE CXone](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-deploy-phone-nicecxone)
* [Phone with Twilio Flex](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-deploy-phone-flex)
* [Bring your own live agent integration](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-phonedeploy-phone-transfer-service)



4. Follow instructions provided on the screen to complete the integration process.



![Plus or higher plans only](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/plus.png) For environments where private endpoints are in use, keep in mind that these integrations send traffic over the internet.





 How live agent integrations work 

Watch a 4-minute video about integrating your assistant with a live agent integration, such as Zendesk:

To learn about how live agent integrations with your assistant can benefit your business, read [Customer Service Just Got Smarter](https://medium.com/ibm-watson/contact-center-post-394dff427c8).
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.

See [Create Custom Fields](https://help.salesforce.com/articleView?id=adding_fields.htm&type=5).

From the Salesforce Data>Objects and Fields>Object Manager>Chat Transcript>Fields & Relationships page, create the following custom fields:



* Token: Stores a Watson Assistant authentication token that secures the communication between Salesforce and your assistant.



* Data Type: Text Area (Long)
* Field Label: x-watson-assistant-key
* Field Length: Specify the maximum length allowed to ensure it can hold a token that might contain over 100,000 characters.





6. Create a Visualforce page.

Visualforce pages are the mechanism that Salesforce provides for you to customize a live agent's console by adding your own pages to it. A Visualforce page is similar to a standard web page, but it provides ways for you to access, display, and update your organization’s data. Pages can be referenced and invoked by using a unique URL, just as HTML pages on a traditional web server can be. 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.
Adding contact center support 

IBM Cloud

You can configure the web chat to transfer a customer to a human customer support agent if the customer asks for help from a person. The following built-in contact center (service desk) integrations are available:



* [Zendesk](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-deploy-zendesk)
* [Salesforce](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-deploy-salesforce)





 Contact center starter kits 

If you are comfortable writing code, you can use the contact center starter kits to integrate with additional contact center platforms, or to develop your own integration with the contact center platform of your choice.

The starter kits are available from a [GitHub repo](https://github.com/watson-developer-cloud/assistant-web-chat-service-desk-starter). Fully functional reference implementations are provided for the following contact center platforms:



* [Genesys Cloud](https://github.com/watson-developer-cloud/assistant-web-chat-service-desk-starter/tree/main/src/genesys/webChat)
* [NICE inContact](https://github.com/watson-developer-cloud/assistant-web-chat-service-desk-starter/tree/main/src/incontact/webChat)
* [Twilio Flex](https://github.com/watson-developer-cloud/assistant-web-chat-service-desk-starter/tree/main/src/flex/webChat)
* [Kustomer](https://github.com/watson-developer-cloud/assistant-web-chat-service-desk-starter/tree/main/src/kustomer/webChat)
* [eGain Advisor Desktop](https://github.com/watson-developer-cloud/assistant-web-chat-service-desk-starter/tree/main/src/egain/webChat)
: For testing your assistant, the new Preview button replaces the previous Preview tile in Integrations.

New checklist with steps to go live
: Each assistant includes a checklist that you can use to ensure you're ready to go live.

Actions skill improvement
: Actions now include currency and percentage response types.

Learn what's new
: The What's new choice on the help menu opens a list of highlighting recent features.





 14 April 2021 

Actions skill improvement
: Actions now include a free text response type, allowing you to capture special instructions or requests that a customer wants to pass along.





 8 April 2021 

Deploy your assistant to WhatsApp - now generally available
: Make your assistant available through WhatsApp messaging so it can exchange messages with your customers where they are. This integration, which is now generally available, creates a connection between your assistant and WhatsApp by using Twilio as a provider. For more information, see [Integrating with WhatsApp](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-whatsapp).

Web chat home screen now generally available
: Ease your customers into the conversation by adding a home screen to your web chat window. The home screen greets your customers and shows conversation starter messages that customers can click to easily start chatting with the assistant. For more information about the home screen feature, see [Configuring the home screen](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-web-chatdeploy-web-chat-home-screen). The home screen feature is now enabled by default for all new web chat deployments. Also, you can now access context variables from the home screen. Note that initial context must be set using a conversation_start node. For more information, see [Starting the conversation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-startdialog-start-welcome).

Connect to human agent response type allows more text
: In a dialog skill, the response type Connect to human agent now allows 320 characters in the Response when agents are online and Response when no agents are online fields.
[Integrations icon](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/integrations-icon.png)) in the left menu.
2. Scroll to see available integrations.

Why do I have the Web chat integration? This integration is provisioned and added automatically to your first assistant only.

Watson Assistant comes with the web chat integration, which is an engaging and fully extensible front-end client that can be added to your website in minutes. It is designed to handle advanced conversational scenarios, including rich responses, such as images, video, and iframes, suggestions when the user gets stuck, and live agent escalation.
3. For any integration that you want to add, click Add. The options include:



* [Web chat](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-deploy-web-chat)
* [Phone](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-deploy-phone)
* [Facebook Messenger](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-deploy-facebook)
* [Microsoft Teams](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-deploy-microsoft-teams)
* [Slack](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-deploy-slack)
* [SMS](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-deploy-sms)
* [WhatsApp with Twilio](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-deploy-whatsapp)
* [Search](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-search-add)
[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) 





* Some channel integrations do not display audio titles or descriptions.







 Fields 



 Name Type Description Required? 

 response_type string audio Y 
 source string The https: URL of the audio clip. The URL can specify either an audio file or an audio clip on a supported hosting service. Y 
 title string The title to show before the audio player. N 
 description string The text of the description that accompanies the audio player. N 
 alt_text string Descriptive text that can be used for screen readers or other situations where the audio player cannot be seen. N 
 channel_options.voice_telephony.loop string Whether the audio clip should repeat indefinitely (phone integration only). N 



The URL specified by the source property can be either of the following:



* The URL of an audio file in any standard format such as MP3 or WAV. In the web chat, the linked audio clip will render as an embedded audio player.
* The URL of an audio clip on a supported streaming service. In the web chat, the linked audio clip will render using the embeddable player for the hosting service.
To support these user-based capabilities, add the [updateUserID() method](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-instance-methodsupdateuserid) in the code snippet before you paste it into your web page.

In the following example, the user ID L12345 is added to the script.

<script>
window.watsonAssistantChatOptions = {
integrationID: 'YOUR_INTEGRATION_ID',
region: 'YOUR_REGION',
serviceInstanceID: 'YOUR_SERVICE_INSTANCE',
onLoad: function(instance) {
instance.updateUserID('L12345');
instance.render();
}
};
setTimeout(function(){
const t=document.createElement('script');
t.src='https://web-chat.global.assistant.dev.watson.appdomain.cloud/versions/' +
(window.watsonAssistantChatOptions.clientVersion || 'latest') +
'/WatsonAssistantChatEntry.js';
document.head.appendChild(t);
});
</script>
Show more
The text in the Option label field has two functions:



* The text is shown in the suggestions list as an option for customers to select.
* When selected by a customer, the text is sent to your assistant as a new message. The label must be able to function as input that your dialog understands and knows how to handle.



By default, the option label Connect with agent is used. 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-data?topic=assistant-data-dialog-support).







 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: 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-data?topic=assistant-data-dialog-overviewdialog-overview-multimedia).





 Extending the web chat 

A developer can extend the capabilities of the web chat by using the Watson Assistant web chat toolkit on [GitHub](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html).

If you choose to use the provided methods, you implement them by editing the code snippet that was generated earlier.
If you want to perform a one-time action when certain conditions are met during a conversation, use a dialog webhook instead. For more information about the dialog webhook, see [Making a programmatic call from dialog](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-webhooks).

For environments where private endpoints are in use, keep in mind that a webhook sends traffic over the internet. For more information, see [Private network endpoints](https://cloud.ibm.com/docs/assistant-data?topic=assistant-securitysecurity-private-endpoints).



 Defining the webhook 

You can define one webhook URL to use for processing every message response before it is shared with the customer.

The programmatic call to the external service must meet these requirements:



* The call must be a POST HTTP request.
* The call must be completed in 8 seconds or less.
* The format of the request and response must be in JSON. For example: Content-Type: application/json.



Do not set up and test your webhook in a production environment where the assistant is deployed and is interacting with customers.

Use an external service that can execute and return a result in less than 8 seconds. Otherwise, the customer will experience a lag in the conversational exchange.

To add the webhook details, complete the following steps:



1. From your assistant, 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 > Post-message webhook.
3. Set the Post-message webhook switch to Enabled.
4. Decide whether to return an error if the webhook call fails.

When enabled, everything stops until the processing step is completed successfully.
"10.185.27.136",
"172.30.226.64"
]
}
},
"channel": {
"name": "Web chat",
"private": {
"user": {
"id": "anonymous_IBMuid-727c0302-6fd7-4abb-b7ee-f06b4bf30e99"
}
}
}
Show more





 Example expressions 



* This expression tests whether the customer is using the Chrome browser:

${system_integrations}.chat.browser_info.browser_name.equals("chrome")

You might specify this expression as the value for a boolean session variable, which you could then use in a step condition. For example, if your website supports only Chrome, you could have a step conditioned on this variable being false and has the following output: I see you aren't using the Chrome browser. Some features of our website work only on Chrome.
* This expression tests whether the current page URL contains the string payment.html:

${system_integrations}.chat.browser_info.page_url.contains("payment.html")

You might use this expression in a step condition in order to avoid telling customers to navigate to a page they are already viewing. For example, in an action for paying a bill, you could have a step conditioned on this variable being false and has the following output: First, click Pay bill to navigate to the bill payment page.









 voice_telephony 

Included only if the phone integration is in use.

The voice_telephony object contains both response and request properties. Response properties are output values that are set by the phone integration and provide information about the call. Request properties are input values that you can modify in your actions to send logging data or to change configuration options for the call.



 Response properties (set by the phone integration) 

Properties contained in the private object are treated as private variables, which are not included in logs.



Response properties of the voice_telephony object

 Name Type Description 

 sip_call_id String The SIP call ID associated with the phone call.