vania-janet/multiturn-rag-retrieval-data huggingface dataset:
* agent:endChat changes: The [agent:endChat](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-eventsagentendchat) event now also fires if the customer cancels a live agent request before the agent has joined. If you want to show a post-chat form only after a live agent chat, you can use the new requestCancelled flag on the event to determine whether the request was canceled.
* New configuration options: The following new options are available in the configuration object:



* serviceDesk.availabilityTimeoutSeconds: Specifies how long the web chat waits for an available agent before automatically canceling the live agent request.
* serviceDesk.disableAgentSessionHistory: Disables storage of live agent chats in the session history. If this option is set to true, live agent chat history is not stored; this means that if the web chat is reloaded, the live agent chat history is lost.



For more information, see [Service desk options](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-configurationservicedeskoptions).
* elements instance property: A new [elements](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-configurationservicedeskoptions) instance property provides methods you can use to apply CSS styles to individual elements used by the web chat. (Currently, only the main window is supported.)
* skip_card option for journeys: The journeys beta feature has been updated to support a new skip_card property. You can use this property to start a journey immediately without waiting for the customer to click the introductory card, or even to start a journey from your website without opening the web chat at all. For more information, see [Guiding customers with journeys](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-journeys).
* Path changes: Some internal paths used for communication with the assistant have changed.
If your assistant has multiple skills attached to it, the dialog skill orchestrates the incoming messages. If you want an action that you created to respond to a conversation starter message, make sure your dialog is set up to call the action. For more information, see [Calling an actions skill from a dialog](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-call-action).

All three conversation starters are required.



A developer can customize the home screen even more:



* A Get started heading is displayed before the list of conversation starter messages. A developer can change the heading text by replacing the homeScreen_conversationStarterLabel in the web chat language strings file. For more information, see the [instance.updateLanguagePack() method](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-instance-methodsupdatelanguagepack) documentation.
* You can use the web chat API to add other elements to the home screen page. 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 

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 !
{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 

The web chat integration undergoes tests and scans on a regular basis to find and address potential security issues, such as cross-site scripting (XSS) vulnerabilities.

Be sure to run your own security reviews to see how the web chat fits in with your current website structure and policies. The web chat is hosted on your site and can inherit any vulnerabilities that your site has. Only serve content over HTTPS, use a Content Security Policy (CSP), and implement other basic web security precautions.







 Billing 

Watson Assistant charges based on the number of unique monthly active users (MAU).

By default, the web chat creates a unique, anonymous ID the first time a new user starts a session. This identifier is stored in a first-party cookie, which remains active for 45 days. If the same user returns to your site and chats with your assistant again while this cookie is still active, the web chat integration recognizes the user and uses the same user ID. This means that you are charged only once per month for the same anonymous user.

On Apple devices, the Intelligent Tracking Prevention feature automatically deletes any client-side cookie after 7 days. This means that if an anonymous customer accesses your website and then visits again two weeks later, the two visits are treated as two different MAUs. For information about how to avoid this problem, see [Managing user identity information](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-develop-userid).
[An example of the home screen](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/home-screen.png)



1. From the Home screen tab, turn the home screen feature On.
2. Add a greeting that is engaging and invites the user to interact with your assistant.

A greeting is required and replaces the greeting that is specified in the welcome node of the dialog.
3. Add three conversation starter messages.

These messages are displayed in the web chat as examples of the types of questions that customers can ask. Customers can click one of them to submit it to the assistant.

You must test each message that you add as a conversation starter. Use only questions that the assistant understands and knows how to answer well.

All three conversation starters are required.



A developer can customize the home screen even more:



* A Get started heading is displayed before the list of conversation starter messages. You can change the heading text by replacing the homeScreen_conversationStarterLabel in the web chat language strings file. For more information, see the [instance.updateLanguagePack() method](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-instance-methodsupdatelanguagepack) documentation.
* You can use the web chat API to add other elements to the home screen page. 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 !
Testing your assistant from a web page 

If you do not disable the preview link when you create an assistant, the assistant is immediately available for testing from a web page.

The preview link renders your assistant as a web chat integration that is embedded in a simple IBM-branded web page. You can test the skills that you added to the assistant by entering text into the chat window. Each preview link that is created is hosted within your private cluster environment. You can send the preview link URL to others with access to the cluster to enlist their help in testing and sharing feedback about the assistant.

Unlike when you test using the Try it out pane, any API calls that result from your interactions with the assistant hosted by the preview link URL do incur charges.



 Using the preview link integration to test your assistant 

To test the assistant from a web-hosted chat widget, complete the following steps:



1. From the Assistants page, click to open the assistant tile that you want to test.
2. From the Integrations section, click the Preview link tile.

If you did not enable the preview link when you created the assistant, then click Add integration, and then click the Preview link integration tile.
3. Optional: Change the preview web page name and description.
4. Click the URL link that is displayed to open the test page.

A separate web browser tab opens that contains a chat window where you can interact with your assistant.
5. Submit test utterances to see how the assistant responds.

No responses are returned until after you create a dialog skill and add it to the assistant.

The dialog flow for the current session is restarted after the inactivity period is passed. The inactivity period is 1 hour by default, but you can increase it to up to a maximum of 7 days. This means that if a user stops interacting with the assistant, after 1 hour or whatever time frame you configure, any context variable values that were set during the previous conversation are set to null or back to their default values. For more information, see [Changing the inactivity timeout setting](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-assistant-settings).
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).



 Integrating with Salesforce 

Integrate your web chat with a Salesforce service desk solution so your customers always get the help they need.

Integrate with a Salesforce service desk by deploying your assistant with the web chat integration. The web chat serves as the client interface for your assistant. If, in the course of a conversation with your assistant, a customer asks to speak to a person, you can transfer the conversation directly to a Salesforce agent.

Salesforce is a customer relationship management solution that brings companies and customers together. It is one integrated CRM platform that gives all your departments, including marketing, sales, commerce, and service, a single, shared view of every customer.



 Before you begin 

To connect to a Salesforce service desk, your organization must have a Salesforce Service Cloud plan that supports Live Agent Chat. Chat support is available in Salesforce Service Cloud Unlimited and Enterprise plans. It is also available with Performance or Developer plans that were created after 14 June 2012.

Your organization must have a [Salesforce chat app](https://help.salesforce.com/articleView?id=dev_tabsets.htm&type=5) with the following characteristics:



* Console navigation
* Navigation items: Cases, Chat sessions, Chat transcripts
* User profiles: Apply the appropriate profiles to ensure that agents can access the app and view chat history information. You can limit access to this page later. 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.
[checkbox](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/discovery-data/images/checkbox.png) Deploy your solution. [Deploying your project](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-deploy) 







 Enhance your chatbot 

Delight your customers by fortifying your chatbot with an answer to every question. Discovery is designed to work seemlessly with Watson Assistant to search and deliver answers from help content that you already own.

Zoom

![Shows a chat bot with emphasize the answer enabled.](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/discovery-data/images/convo-search.png)

Figure 3. Answer finding enabled in the Watson Assistant web chat

If enhancing your chatbot is your goal, complete the steps that are listed in the following table.



Checklist for enhancing your chatbot

 Step Task Related information 

 ![checkbox](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/discovery-data/images/checkbox.png) Create a Conversational Search project. [Creating projects](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-projects) 
 ![checkbox](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/discovery-data/images/checkbox.png) Add a collection that connects to an external data source or contains uploaded files.
* [Customizing the home screen](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-develophome-screen)
* [Customizing strings](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-developstrings)
* [Supporting global audiences](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-developglobal-audiences)



Opening, closing, and rendering the web chat window
: 

* [Replacing the default launcher](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-developreplace-launcher)
* [Keeping the web chat always open](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-developkeep-open)
* [Changing the size or position of the web chat](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-developsize-position)
* [Adding the web chat to your mobile application](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-developmobile)



Customizing the conversation
: 

* [Intercepting and modifying messages](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-developmodify-messages)
* [Rendering custom response types](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-developcustom-response-types)
* [Implementing a contact center integration](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-developcontact-center)



Managing data
:
You can edit all or a subset of the phrases in a JSON file, and then configure the web chat to use your version by specifying the instance.updateLanguagePack() method.

For more information, see [Languages](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-instance-methodslanguages).







 Versioning 

Web chat follows semantic versioning practices. Starting with web chat version 2.0.0, you can set the version of 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, for example, 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 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.
<a href="https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-about" target="_blank">

![Shows the extension setup page](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/tut-neural-edit-url.png){: caption="Figure 15. Change the URL for the More information link" caption-side="bottom"}
10. Save your changes, and then click the X to close the step.



Congratulations! You successfully created an action that recognizes questions about Discovery, and gets its answers from the connected NeuralSeek extension.





 Step 9: Configure the web chat for your assistant 

To preview your assistant, you will use the built-in web chat as the chat user interface for interacting with the assistant.



1. From the navigation panel in Watson Assistant, click Environments.

The draft environment is displayed. It shows that a web chat is connected to your assistant. You also can see that the web chat is connected to the NeuralSeek extension.

Zoom

![Shows the Environments page where NeuralSeek is connected to the assistant.](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/tut-neural-enviro.png)

Figure 16. Environment diagram
2. Click the Web chat tile to edit the web chat.

We don't want to add multiple starter questions, so we're going to turn off the home screen for the web chat. Click the Home screen tab. Set the switcher to Off, and then click Save and exit.

Zoom

![Shows the web chat home screen set to Off.]
iss: 'yourdomain.com' // Required
};
// The "expiresIn" option adds an "exp" claim to the payload.
return jwt.sign(payload, process.env.YOUR_PRIVATE_RSA_KEY, { algorithm: 'RS256', expiresIn: '10000ms' });
}
Show more







 Enable security 

To enable security, complete the following steps:



1. From the Security tab of the web chat integration setup page in Watson Assistant, set the Secure your web chat switch to On.
2. Add your public key to the Your public key field.

The public key that you add is used to verify that data that claims to come from your web chat instance is coming from your web chat instance.
3. To prove that a message is coming from your website, each message that is submitted from your web chat implementation must include the JSON Web Token (JWT) that you created earlier.

Add the token to the web chat code snippet that you embed in your website page. Specify the token in the identityToken property.

Starting with web chat version 3.2.0, this step is optional. You do not have to add the identityToken property initially. You can skip this step as long as you perform the next step where you add the identityTokenExpired event. The event is fired when the web chat is first opened, and if a token wasn't provided, it obtains one from your handler at that time.

For example:

<script>
window.watsonAssistantChatOptions = {
integrationID: 'YOUR_INTEGRATION_ID',
region: 'YOUR_REGION',
serviceInstanceID: 'YOUR_SERVICE_INSTANCE',
identityToken: 'YOUR_JWT',
onLoad: function(instance) {
instance.render();
}
};
setTimeout(function(){
const t=document.createElement('script');
* [Intercepting and modifying messages](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-developmodify-messages)
* [Rendering custom response types](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-developcustom-response-types)
* [Implementing a contact center integration](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-developcontact-center)



Managing data
: 

* [Managing user identity information](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-developuser-id)



Security and administration
: 

* [Securing the web chat](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-developsecure-web-chat)
* [Controlling the web chat version](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-developweb-chat-version)





 Web chat style and content 

Customizing the look of the web chat
: If you want to customize the style and appearance of the web chat beyond the options that are available on the Style tab in the web chat settings, you can do so by choosing a different Carbon Design theme.

The supported themes are color themes that are defined by [IBM Carbon Design](https://v10.carbondesignsystem.com/guidelines/color/usage/). To set the Carbon theme, use the [carbonTheme](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-configurationoptionscarbonTheme) configuration option.

You can also set individual variables within the theme to customize specific UI elements. For example, the text that is displayed in the chat window uses the fonts IBMPlexSans, Arial, Helvetica, sans-serif.
Tutorial: Customizing the greeting action based on the current page 

This tutorial shows how you can dynamically customize the greeting action that is triggered by the web chat based on the page the user is currently viewing.

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

If you do not have the home screen enabled, the default behavior when the web chat opens is to send an empty message to the assistant to start the conversation. This empty message triggers the Greet customer action, which typically sends a welcome message.

Rather than starting the conversation with a generic greeting, you might want your users to see a prompt that is specific to the page they are already viewing. For example, if a user has already navigated to a page about credit cards and then opens the web chat, you might want to start the conversation with a message that is specific to credit cards.

Although this example shows how to adapt the text based on the current page, you can use the same basic approach to adapt the text based on any client condition (such as the time of day or the user's geographical location).

To change the greeting action based on the current page the user is viewing, follow these steps:



1. Determine what page the user is currently viewing. Depending on the design of your application, there are various ways to do this, but one simple mechanism is to check the value of a URL query parameter (in this example, page):

const page = new URLSearchParams(window.location.search).get('page');
2. Create a handler for the [pre:send](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-eventspresend) event, which is fired before a message is sent to the assistant.