vania-janet/multiturn-rag-retrieval-data huggingface dataset:
For more information about the available instance methods, see [List of methods and properties](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-instance-methodslistofmethods) in the web chat API reference.
* Events: The web chat event system makes it possible for your website to respond to web chat events (such as opening or closing the web chat window, sending or receiving messages). By subscribing to events, you can implement custom behavior or even intercept and modify message content. For more information about the event system, see [Events](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-events) in the web chat API reference.



If you want to use the web chat API to customize your web chat implementation, you don't have to start from scratch. Tutorials are available that show examples of common web chat customizations. For more information, see [Web chat development tutorials](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-develop-tutorials).



 Development tasks 

You can use the web chat API to customize and extend the web chat in the following ways.

Web chat style and content
: 

* [Customizing the look of the web chat](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-web-chat-developlook)
* [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
:
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.watson.appdomain.cloud/loadWatsonAssistantChat.js";
document.head.appendChild(t);
});
</script>
Show more







 Global audience support 

The underlying skills understand customer messages that are written in any of the languages that are supported by the service. For more information, see [Supported languages](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-language-support). The responses from your assistant are defined by you in the underlying skill and can be written in any language you want.

Even if your skill includes responses in a language other than English, some of the phrases that are displayed in the web chat widget are added by the web chat itself and do not come from the underlying skill. These hardcoded phrases are specified in English unless you choose to apply a different language.

There are language files that contain translations of each English-language phrase that is used by the web chat. You can instruct the web chat to use one of these other languages files by using the instance.updateLanguagePack() method.

Likewise, the web chat applies an American English locale to content that is added by the web chat unless you specify something else. The locale setting affects how values such as dates and times are formatted.

To configure the web chat for customers outside the US, follow these steps:



1. To apply the appropriate syntax to dates and times and to use a translation of the English-language phrases, set the locale. Use the instance.updateLocale() method.
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.

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. This value must either be scoped to be locally unique in the context of the issuer or be globally unique. The value you specify for sub is used as the user_id.

The user ID that is specified in the sub claim is also sent in the customer_id section of the X-Watson-Metadata HTTP header. The customer_id can be used to make requests to delete user data. Because the ID is sent in a header field, the syntax must meet the requirements for header fields as defined in [RFC 7230](https://tools.ietf.org/html/rfc7230section-3.2) (all visible ASCII characters). For more information about deleting user data, see [Labeling and deleting data](https://cloud.ibm.com/docs/assistant?topic=assistant-information-securityinformation-security-gdpr-wa).
* exp: Represents the expiration time on or after which the JWT cannot be accepted for processing. Many libraries set this value for you automatically. Set a short-lived exp claim with whatever library you use.
From the Environments page, click Preview this environment.

Zoom

![Shows the draft environment with search extension enabled](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/discovery-data/images/tut-convo-test-0a.png)

Figure 31. Search extension enabled

A sample web page is displayed that includes a chat icon.

Zoom

![Shows a preview of a web page with a chat icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/discovery-data/images/tut-convo-test-1.png)

Figure 32. Web chat icon
2. Click the chat icon to open the web chat window.

Zoom

![Shows web chat welcome message](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/discovery-data/images/tut-convo-test-2.png)

Figure 33. Web chat welcome message
3. Enter the following text question:

What impact is inflation having on the real estate market?

This test question is not one of the questions that we used to train the assistant.

The correct answer is returned and it includes a link to the source documentation page.

Zoom

![Shows a preview of the assistant where the test question is answered](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/discovery-data/images/tut-convo-test-3a.png)

Figure 34.
* Can I export the user conversations from the Analytics page?

You cannot directly export conversations from the conversation page. However, you can use the /logs API to list events from the transcripts of conversations that occurred between your users and your assistant. For more information, see the [V2 API reference](https://cloud.ibm.com/apidocs/assistant/assistant-v2listlogs). Or, you can use a Python script to export logs. For more information, see [export_logs_py](https://github.com/watson-developer-cloud/community/blob/master/watson-assistant/export_logs_py.py).
* Can I change my plan to a Lite plan?

No, you cannot change from a Trial, Plus, or Standard plan to a Lite plan. And you cannot upgrade from a Trial to a Standard plan.
* How many Lite plan instances of Watson Assistant can I create?

You can have only one Lite plan instance of Watson Assistant per resource group.
* How do I create a webhook?

To define a webhook and add its details, go to the Live environment page and open the Environment settings page. From the Environment settings page, click Webhooks > Pre-message webhook. You can add details about your webhook. For more information, see [Making a call before processing a message](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-webhook-pre).
* Can I have more than one entry in the URL field for a webhook?

No, you can define only one webhook URL for an action. For more information, see [Defining the webhook](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-webhook-prewebhook-pre-create).
* Is there a range of IP addresses that are being used by a webhook?
* For Slack integrations, the user_id property is a concatenation of the team ID, such as T09LVDR7Y, and the member ID of the user, such has W4F8K9JNF. For example: T09LVDR7YW4F8K9JNF.
* For web chat, you can set the value of the user_id property.



Billing is managed per monthly active user per service instance. If a single user interacts with assistants that are hosted by different service instances that belong to the same plan, each interaction is treated as a separate use. You are billed for the user's interaction with each service instance separately.





 Test activity charges 

Test messages that you send from the Preview button are charged. For the preview, a random user_id is generated and stored in a cookie. The multiple interactions that a single tester has with the assistant embedded in the preview are recognized as coming from a single user and are charged accordingly. If you are doing your own test, running a scripted regression test for example, use a single user_id for all of the calls within your regression test. Other uses are flagged as abuse.





 Handling anonymous users 

If your custom application or assistant interacts with users who are anonymous, you can generate a randomized universally unique ID to represent each anonymous user. 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. And you are charged only once when the same anonymous user interacts with your assistant multiple times in a single month.



If an anonymous user logs in and later is identified as being the same person who submitted a request with a known ID, you are charged twice. Each message with a unique user ID is charged as an independent active user.
You can visualize how your assistant would look as a web chat widget on your organization's website. You can enter a URL or upload an image.



 Entering a URL 

You can enter a URL of your organization's website. Watson Assistant captures an image of your website to use as the Preview page background.

Your website must be publicly available to all users. Private or intranet sites can’t be accessed. Any login, splash, cookie, or warning screens might be captured in the image.

To enter a URL:



1. On the Preview page, click Change background.
2. Click Enter URL, then click Continue.
3. Enter the path of your website URL, for example, https://www.example.com or example.com.
4. Click Continue.







 Uploading an image 

You can upload an image of your organization's website. Images are stored for 24 hours. Maximum file size is 1 MB. Supported file types are JPEG and PNG.

To upload an image:



1. On the Preview page, click Change background.
2. Click Upload an image, then click Continue.
3. Drag a file or click to upload, then click Change background.



Images are stored for 24 hours. A warning message might appear on the Preview page about the time limit expiration. To clear this message:



1. On the Preview page, click Change background.
2. Click Clear background setting, then click Continue.
3. Click Remove background to finish.
* [View the Demo](https://www.youtube.com/watch?v=uigisF50F8s&feature=youtu.be)



[Cognitive Banking Chatbot](https://developer.ibm.com/patterns/create-cognitive-banking-chatbot/?cm_sp=Developer-_-code-_-banking_chatbot) Create a web UI chatbot using the IBM Watson Node.js SDK to include conversation interaction, anger detection, natural language understanding, and answer discovery. Answers are discovered from a collection of FAQ documents. Built as a fictional financial institution, this app calls out to simple banking services code as an example of how to include external business data in a conversation response.



* [Get the Code](https://github.com/IBM/watson-banking-chatbot?cm_sp=IBMCode-_-create-cognitive-banking-chatbot-_-Get-the-Code)
* [View the Demo](https://www.youtube.com/watch?v=Jxi7U7VOMYg&cm_sp=IBMCode-_-create-cognitive-banking-chatbot-_-View-the-Demo)
For more information, see [Webhook overview](https://cloud.ibm.com/docs/assistant?topic=assistant-webhook-overview).

New service desk support reference implementation
: You can use the reference implementation details to integrate the web chat with the NICE inContact service desk. For more information, see [Adding service desk support](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-web-chatdeploy-web-chat-haa).

Phone and SMS with Twilio integration updates
: The phone integration now enables you to specify more than one phone number, and the numbers can be imported from a comma-separated values (CSV) file. The SMS with Twilio integration no longer requires you to add your SMS phone number to the setup page.





 6 January 2021 

Import and export UI changes
: The label on buttons for importing intents and entities changed from Import to Upload. The label on buttons for exporting intents and entities changed from Export to Download.





 4 January 2021 

Dialog methods updates
: Documentation and examples were added for the following supported dialog methods:



* JSONArray.addAll(JSONArray)
* JSONArray.containsIgnoreCase(value)
* String.equals(String)
* String.equalsIgnoreCase(String)



For more information, see [Expression language methods](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-methods).





 17 December 2020 

Accessibility improvements
: The product was updated to provide enhanced accessibility features.





 14 December 2020 

Increased Phone and SMS with Twilio integrations availability
: These beta SMS and voice capabilities are now available from service instances that are hosted in Seoul, Tokyo, London, and Sydney.

Improved JSON editor
: The JSON editor in the dialog skill was updated. The editor now uses JSON syntax highlighting and allows you to expand and collapse objects.

Connect to agent from actions skill
: The actions skill now supports transferring a customer to an agent from within an action step.





 4 December 2020
For more information, see [instance.restartConversation()](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-instance-methodsrestartconversation), [pre:restartConversation](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-eventsprerestartconversation), and [restartConversation](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-eventsrestartconversation).
* New agentEndConversation() method: The new agentEndConversation() instance method immediately ends the conversation with a human agent without requesting confirmation from the user. For more information, see [instance.agentEndConversation()](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-instance-methodsagentendconversation).
* Bug fixes.







 6.2.0 

Release date: 7 March 2022



* Navigation: The web chat has been updated with new navigation features. For example, new “Back” and “Minimize” buttons make it easier to navigate between the home screen, the chat view, and panels. A new customizable drop-down menu appears near the avatar in both the assistant and agent chat views. This new functionality allows you to easily add new options to the menu of the web chat (for more information, see [updateCustomMenuOptions](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-instance-methodsupdatecustommenuoptions).

The experience of connecting to a human agent has also been improved to make it clearer how a user requests an agent, returns to chatting with the assistant, and ends the conversation.

The animations for the web chat panels have also been improved to make the whole experience more seamless and cohesive.
* Launcher: The new web chat launcher bounces on two different occasions to attract attention and encourage customer engagement.
Tutorial: Interacting with the host web page 

You can use custom responses and events to enable the web chat to interact with the web page where it appears.

For example, your customers might use your assistant to find information they need to complete a form. Rather than expecting the customer to then copy this information manually to the form, you can have the web chat automatically fill in the information.

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

This example uses a custom response to render a button in the web chat that populates a form field with the customer's account number:



1. Create a handler for the [customResponse](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-eventscustomresponse) event. This handler renders a custom button and creates a click handler for it. The click handler uses the Document.querySelector() method to interact with the DOM and fill in a form field with the customer's account number.

This example uses the hardcoded account number 1234567. In a typical production assistant, your assistant would retrieve this value from a session variable or query it from an external system.

function customResponseHandler(event) {
const { element } = event.data;

const button = document.createElement('button');
button.type = 'button';
button.innerHTML = 'Fill in account number';
button.addEventListener('click', () => {
// Look for the account number element in the document and fill in the account number.
document.querySelector('account-number').value = '1234567';
});

element.appendChild(button);
}
2.
(By default, a set of fewer than five options is rendered as a set of clickable buttons; five or more options are rendered as a drop-down list.)
* Dates: When the assistant asks the customer to specify a date, the web chat displays an interactive date picker. The customer can specify the date either by clicking the date picker or by typing a valid date value in the input field.
* Multimedia responses: The web chat supports all multimedia response types (audio, image, and video).
* iframe: The web chat supports the iframe response type, which embeds HTML content (such as a form or interactive map) directly in the web chat window.



For more information about how the web chat handles specific response types, see the [Response types reference](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-response-types-referenceiframe).



 Markdown formatting 

In text responses from your assistant, you can use Markdown formatting to apply highlighting such as italics, or to include elements like paragraphs and headings. Some common examples of Markdown formatting include:



* Headings:

 First-level heading

 Second-level heading
* Highlighting:

This text includes italic and bold highlighting, as well as a code snippet.
* Lists:

- ordered
- list

1. bulleted
2. list
* Tables:

 Column 1 Column 2 

 Row One 
 Row Two 
* Links:

[This link](https://www.ibm.com/products/watson-assistant/demos/lendyr/demo.html) opens in a new tab.

[This link](https://www.ibm.com/products/watson-assistant/demos/lendyr/demo.html){{target="_self" rel="noopener noreferrer"}} opens in the same tab.



For detailed information about the Markdown format, see the [CommonMark specification](https://spec.commonmark.org/).







 Live agent transfer 

The web chat supports transferring the customer to a human in situations the assistant can't handle.
[Learn more](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-tasks). 
 Web chat An integration that you can use to embed your assistant in your company website. [Learn more](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-deploy-web-chat). 
 Webhook A mechanism for calling out to an external program as part of the dialog. For example, if a customer asks the assistant to translate a string from English to French, the dialog can call an external language translation service to translate the phrase and return the translation to the customer in the course of the conversation. [Learn more](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-webhooks). 







 I don’t see the Analytics page 

You can only view the Analytics page if the system administrator enabled the feature in your deployment. A prerequisite service that is required by the feature is only available on OpenShift Red Hat 4.5; it is not available on 3.11.





 Where can I find an example for creating my first assistant? 

Follow the steps in the [Getting started with Watson Assistant](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-getting-started) tutorial for a product introduction and to get help creating your first assistant.





 Can I export the user conversations from the Analytics page? 

You cannot directly export conversations from the User conversation page. You can, however, use the /logs API to list events from the transcripts of conversations that occurred between your users and your assistant. For more information, see the [API reference](https://cloud.ibm.com/apidocs/assistant-data-v1listlogs) and the [Filter query reference](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-filter-reference).





 Can I export and import dialog nodes? 

No, you cannot export and import dialog nodes from the product user interface.
Choose Audio.
2. Add the full URL to the hosted audio clip into the Audio source field:



* To link directly to an audio file, specify the URL to a 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.
* To link to an audio clip on a supported audio hosting service, specify the URL to the audio clip. In the web chat, the linked audio clip will render using the embeddable player for the hosting service.

Specify the URL you would use to access the audio file in your browser (for example, https://soundcloud.com/ibmresearch/fallen-star-amped). You do not need to convert the URL to an embeddable form; the web chat will do this automatically.

You can embed audio hosted on the following services:



* [SoundCloud](https://soundcloud.com)
* [Mixcloud](https://mixcloud.com)





If you want to display a title and description above the embedded audio player in the response, then add them in the fields provided.

Some integration channels ignore titles or descriptions.

If you want the audio clip to loop indefinitely, select On in the Loop field. For example, you might want to use this option to play music while a user waits on the phone. (By default, the audio plays only once and then stops.)

The Loop option is currently supported only by the phone integration. This option has no effect if you are using the web chat integration or any other channel.
3. The Audio response type is supported in the web chat, Facebook, WhatsApp, Slack, SMS, and phone integrations.







 Adding an iframe response type 

Include iframes in your response to embed content from another website directly inside the chat window as an HTML iframe element. An iframe response is useful if you want to enable customers to perform some interaction with an external service without leaving the chat. For example, you might use an iframe response to display the following within the web chat: