vania-janet/multiturn-rag-retrieval-data huggingface dataset:
For example, you might want to send a callout to the webhook from the General_Greetings node.
3. Click to open the dialog node, and then click Customize.
4. Scroll down to the Webhooks section, and switch the toggle to On, and then click Apply.

If you did not have it enabled already, the Multiple conditional responses setting is switched on automatically and you cannot disable it. This setting is enabled to support adding different responses depending on the success or failure of the Webhook call. If you had a response specified for the node already, it becomes the first conditional response.
5. Add any data that you want to pass to the external application as key and value pairs in the Parameters section.

For example, if you call the Language Translator service, you must provide values for the following parameters:



Parameter example

 Key Value Description 
 model_id en-es Identifies the input and output languages. In this example, the request is for text in English (en) to be translated into Spanish (es). 
 text How are you? This parameter contains the text string that you want the service to translate. You can hard code this value, pass a context variable, such as $saved_text, or pass the user input to the service directly, by specifying ` ` as this value. 




In more complex use cases, you might collect information during a conversation with a user about their travel plans, for example. You can collect dates and destination information and save it in context variables that you can pass to an external application as parameters.



Travel parameters example

 Key Value 

 depart_date $departure 
 arrive_date $arrival 
 origin $origin 
 destination $destination 



6. Any response made by the callout is saved to the return variable. You can rename the variable that is automatically added to the Return variable field for you. If the callout results in an error, this variable is set to null.

The generated variable name has the syntax webhook_result_n, where the appended _n is incremented each time you add a webhook callout to a dialog node. This naming convention ensures that context variable names are unique across the dialog skill.
Calling a custom extension 

An extension is an integration with an external service. By calling an extension from an action, your assistant can send requests to the external service and receive response data it can use in the conversation.

For example, you might use an extension to interact with a ticketing or customer relationship management (CRM) system, or to retrieve real-time data such as mortgage rates or weather conditions. Response data from the extension is then available as action variables, which your assistant can use in the conversation.

For information about how to build a custom extension, see [Build a custom extension](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-build-custom-extension).



 Calling the extension from a step 

To call a custom extension from an action:



1. In the action editor, create or open the step from which you want to call the extension.
2. Optional: In the Assistant says field, type a message to be shown to the customer before the extension is called (for example, Please wait while I retrieve your account balance...).

The output from this step is sent to the channel with the global context variable skip_user_input set to true. This variable tells the channel to display the message but not to prompt the customer for a reply. Instead, the channel sends an empty message, enabling the assistant to proceed with the call to the extension.

All built-in channel integrations (such as the web chat) respect the skip_user_input context variable. If you are using the API to develop a custom client, it is your responsibility to include logic checking for this variable. For more information, see [Processing user input](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-api-clientapi-client-process-input).
3. In the step editor, click And then.
4. Click Use an extension.
5. In the Extension setup window, specify the following information:



* In the Extension field, select the extension you want to call.
* In the Operation field, select the operation you want to perform.
4. [End a recognition request](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-websocketsws-stop)
5. [Send additional requests and modify request parameters](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-websocketsws-more)
6. [Keep a connection alive](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-websocketsws-keep)
7. [Close a connection](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-websocketsws-close)



When the client sends data to the service, it must pass all JSON messages as text messages and all audio data as binary messages.

The snippets of example code that follow are written in JavaScript and are based on the HTML5 WebSocket API. For more information about the WebSocket protocol, see the Internet Engineering Task Force (IETF) [Request for Comment (RFC) 6455](https://tools.ietf.org/html/rfc6455).



 Open a connection 

The Speech to Text service uses the WebSocket Secure (WSS) protocol to make the /v1/recognize method available at the following endpoint:

wss://api.{location}.speech-to-text.watson.cloud.ibm.com/instances/{instance_id}/v1/recognize

where {location} indicates where your application is hosted:



* us-south for Dallas
* us-east for Washington, DC
* eu-de for Frankfurt
* au-syd for Sydney
* jp-tok for Tokyo
* eu-gb for London
* kr-seo for Seoul



And {instance_id} is the unique identifier of your service instance.

The examples in the documentation abbreviate wss://api.
+ '&voice=en-US_AllisonV3Voice';
var websocket = new WebSocket(wsURI);

websocket.onopen = function(evt) { onOpen(evt) };
websocket.onclose = function(evt) { onClose(evt) };
websocket.onmessage = function(evt) { onMessage(evt) };
websocket.onerror = function(evt) { onError(evt) };





 Send input text 

To synthesize text, the client passes a simple JSON text message to the service with the following parameters:

text (required string)
: Provides the text that is to be synthesized. The client can pass plain text or text that is annotated with the Speech Synthesis Markup Language (SSML). The client can pass a maximum of 5 KB of input text with the request. The limit includes any SSML that you specify. For more information, see [Specifying input text](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-usingHTTPinput) and the sections that follow it. (SSML input can also include the <mark> element. For more information, see [Specifying an SSML mark](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-timingtiming-mark).)

accept (required string)
: Specifies the requested format (MIME type) of the audio. Use / to request the default audio format, audio/ogg;codecs=opus. For more information, see [Using audio formats](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-audio-formats).

The Ogg audio format is not supported with the Safari browser. If you are using the the Text to Speech service with the Safari browser, you must specify a different format in which you want the service to return the audio.
If it is not practical to set the frame size, the client can set the maximum message size to less than 4 MB and send the audio data as a sequence of messages. For more information about WebSocket frames, see [IETF RFC 6455](https://tools.ietf.org/html/rfc6455).

How the service sends recognition results over a WebSocket connection depends on whether the client requests interim results. For more information, see [How the service sends recognition results](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-websocketsws-results).

The following snippet of JavaScript code sends audio data to the service as a binary message (blob):

websocket.send(blob);

The following snippet receives recognition hypotheses that the service returns asynchronously. The results are handled by the client's onMessage function.

function onMessage(evt) {
console.log(evt.data);
}

Your code must be prepared to handle return return codes from the service. For more information, see [WebSocket return codes](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-websocketsws-return).





 End a recognition request 

When it is done sending the audio data for a request to the service, the client must signal the end of the binary audio transmission to the service in one of the following ways:



* By sending a JSON text message with the action parameter set to the value stop:

{action: 'stop'}
* By sending an empty binary message, one in which the specified blob is empty:

websocket.send(blob)



If the client fails to signal that the transmission is complete, the connection can time out without the service sending final results. To receive final results between multiple recognition requests, the client must signal the end of transmission for the previous request before it sends a subsequent request.
Add a step or edit an existing step to transfer the conversation to a live agent.

Transferring the conversation to a live agent ends the action. If there are situations where you want the conversation to continue within the assistant rather than being transferred, use step conditions as needed.
2. In the And then field at the end of the step, select Connect to agent.
3. In the Settings window, you can customize messages the assistant displays as part of the transfer:

![Connect to agent settings](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/connect-agent-settings.png)



* Response if agents are online: The message the assistant sends to the customer when the conversation is being transferred to an agent. The default message is Let's send you to an available agent.
* Response if agents are offline: The message the assistant sends to the customer when no agents are currently available to take over the conversation. The default message is There are no agents available at this time. When one becomes available, we'll connect you.
* Message to agent: An optional message the assistant sends to the live agent when transferring the conversation.
* Route to a specific queue: An optional selection to route customers to a specific integration, which can be helpful if you have more than one set up.



4. Click Apply.



If you want to edit the transfer settings later, click Edit settings in the And then field.





 Fallback escalations 

Examples of fallback escalations include:



* The customer repeatedly asks a question or makes a request that the assistant cannot match to any defined action.
* The customer repeatedly gives an invalid answer to a question.
* The customer explicitly asks to speak to a human.



Fallback escalations use the Fallback action, which is a built-in system action that is automatically triggered in any of these fallback scenarios. By default, the Fallback action handles these error conditions by initiating a transfer to a live agent.
For more information about supported audio formats, see [audio/webm format](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-audio-formatsaudio-formats-webm).

New support for Cross-Origin Resource Sharing
: The service now supports Cross-Origin Resource Sharing (CORS) to allow browser-based clients to call the service directly. For more information, see [Leveraging CORS support](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-service-featuresfeatures-cors).

New method to unregister a callback URL with asynchronous HTTP interface
: The asynchronous HTTP interface now offers a POST /v1/unregister_callback method that removes the registration for an allowlisted callback URL. For more information, see [Unregistering a callback URL](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-asyncunregister).

Defect fix: Eliminate timeouts for long audio with WebSocket interface
: Defect fix: The WebSocket interface no longer times out for recognition requests for especially long audio files. You no longer need to request interim results with the JSON start message to avoid the timeout. (This issue was described in the [update for 10 March 2016](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-release-notesspeech-to-text-10march2016).)

New HTTP error codes
: The following language model customization methods can now return the following HTTP error codes:



* The DELETE /v1/customizations/{customization_id} method now returns HTTP response code 401 if you attempt to delete a nonexistent custom model.
* The DELETE /v1/customizations/{customization_id}/corpora/{corpus_name} method now returns HTTP response code 400 if you attempt to delete a nonexistent corpus.







 8 March 2017
To do so, add a new intent or entity, and then delete it. This action starts a new training process.





 Is there a range of IP addresses that are being used by a webhook? 

Unfortunately, the IP address ranges from which Watson Assistant may call a webhook URL are subject to change, which in turn prevent using them in any static firewall configuration. Please use the https transport and specify an authorization header to control access to the webhook.





 How do I see my monthly active users in Watson Assistant? 

To see your monthly active users (MAU) do the following:



1. Sign in to [https://cloud.ibm.com](https://cloud.ibm.com)
2. Click on the Manage menu, then choose Billing and usage.
3. Click on Usage.
4. For Watson Assistant, select View Plans.
5. Under Time Frame, select the month you need.
6. Select your Plus plans or Plus Trial plans to see monthly active users and the API calls.







 Error: New Off Topic not supported 

You see the error New Off Topic not supported after editing the JSON file for a dialog skill and changing the skill language from English to another language.

To resolve this issue, modify the JSON file by setting off_topic to false. For more information about this feature, see [Defining what's irrelevant](https://cloud.ibm.com/docs/assistant?topic=assistant-irrelevance-detection).





 Is it possible to increase the number of intents per skill 

No, it is not possible to increase the number of intents per skill.
For information about how to address this problem, see [Troubleshooting skill import issues](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-skill-dialog-addskill-dialog-add-import-errors).

If a timeout occurs due to the size of the skill but no plan limits are exceeded, you can reduce the number of elements that are imported at a time by completing the following steps:



1. Make a copy of the JSON file that you are trying to import.
2. Open the copy of the JSON file in an editor, and delete the entities array.
3. Import the edited JSON file as a new skill.
4. If this step is successful, edit the original copy of the JSON file.
5. Remove the dialog_nodes, intents, and counterexamples arrays.
6. Update the skill by using the API. Be sure to include the workspace ID and the append=true flag, as in this example:



curl -X POST -H "content-type: application/json" -H "accept: application/json" -u "apikey:{apikey}" -d@./skill.json "url/api/v1/workspaces/{workspace_id}?version=2019-02-28&append=true"





 The training process takes a long time and appears stuck 

If the training process gets stuck, first check whether there is an outage for the service by going to the [Cloud status page](https://cloud.ibm.com/status). You can start a new training process to stop the current process and start over. To do so, add a new intent or entity, and then delete it. This action starts a new training process.





 Is there a range of IP addresses that are being used by a webhook? 

Unfortunately, the IP address ranges from which Watson Assistant may call a webhook URL are subject to change, which in turn prevent using them in any static firewall configuration. Please use the https transport and specify an authorization header to control access to the webhook.
Extending your assistant with webhooks 

A webhook is a mechanism that allows you to call out to an external program based on events in your program. You can use webhooks to make calls from your assistant to an external service or application during a conversation.

Watson Assistant supports the following types of webhooks:



*  [Premessage](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-webhook-pre)
*  [Postmessage](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-webhook-post)
*  [Logs](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-webhook-log)



These webhooks are called with every exchange in a conversation between the customer and the assistant.

If you want to limit webhook processing so it happens only in certain situations, any condition to check for before taking an action must be defined in the external application code. For example, if your webhook performs a simple language translation, you might want to use a condition to check the language of the incoming message before sending the text to the translation service.

You don't need to define a condition for the log webhook unless you want to filter the messages somehow. In most cases, the goal is to write out every message that is submitted, so the messages can be stored for as long as you want, and analyzed by an external application or service.

Webhooks are configured separately for each environment:



1.  Go to the Environments page and open the environment where you want to configure webhooks.
2.  On the Environments page, click the ![Environment settings icon](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/gear-icon-black.png) icon beside the environment title to open the environment settings.
Subsequently, the previous configuration is used.<br> * merge: Merges the new configuration with the existing configuration for the rest of the session. Only changed parameters are overwritten; any other configuration parameters are unchanged.<br> * merge_once: Merges the new configuration with the existing configuration only for the next turn of the conversation. Subsequently, the previous configuration is used.<br><br><br> no replace 



The parameters that you can set for narrowband_recognize and broadband_recognize reflect the parameters that are made available by the Speech to Text WebSocket interface. The WebSocket API sends two types of parameters: query parameters, which are sent when the phone integration connects to the service, and message parameters, which are sent as part of the JSON data in the request body. For example, model is a query parameter, and smart_formatting is a WebSocket message parameter. For a full list of parameters, see the [Speech to Text API documentation](https://cloud.ibm.com/apidocs/speech-to-text).

You can define the following query parameters for the phone integration's connection to the Speech to Text service. Any other parameter that you define for narrowband or broadband is passed through as part of the WebSocket message request.



* model
* acoustic_customization_id
* version
* x-watson-learning-opt-out
* base_model_version
* language_customization_id



The following parameters from the Speech to Text service can't be modified because they have fixed values that are used by the phone integration.



* action
* content-type
* interim_results
* continuous
* inactivity_timeout



When configuring dynamically from Watson Assistant using the configure command, note that only the root level fields, such as narrowband or broadband, are updated. If these fields are omitted from the command, the original configuration settings persist. You can use the update_strategy values merge and merge_once to merge configuration parameters with the existing configuration.





 Using a custom language model 

When you set up the phone integration, you can configure the integration to use a custom language model all the time.
(For more information, see [Building a custom extension](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-build-custom-extension).)
2. Make sure the extension has been added to the assistant. (For more information, see [Adding an extension to your assistant](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-add-custom-extension).)
3. In the action editor, edit the action step that calls the extension and check whether the call to the extension is correctly configured. If Watson Assistant recognizes the required extension, the extension configuration is automatically restored.

If you see the message Extension not fully configured, this means that Watson Assistant did not find the required extension. Click Edit extension.
4. In the Extension setup window, select the extension you want to call.

If Watson Assistant recognizes an available extension that was built using the same OpenAPI document, a message appears suggesting that you select this extension. However, you can select any available extension.
5. Verify that the correct values are specified in the Operation and Parameters fields.
6. Click Apply.
7. If you selected an extension that is not identical to the one that was used to build the action, you might need to modify subsequent steps that access the extension response properties. Check any later steps that refer to the response properties and make sure the references are still valid and correct.
* By sending a JSON text message with the action parameter set to the value stop:

{action: 'stop'}
* By sending an empty binary message, one in which the specified blob is empty:

websocket.send(blob)



If the client fails to signal that the transmission is complete, the connection can time out without the service sending final results. To receive final results between multiple recognition requests, the client must signal the end of transmission for the previous request before it sends a subsequent request. After it returns the final results for the first request, the service returns another {"state":"listening"} message to the client. This message indicates that the service is ready to receive another request.





 Send additional requests and modify request parameters 

While the WebSocket connection remains active, the client can continue to use the connection to send further recognition requests with new audio. By default, the service continues to use the parameters that were sent with the previous start message for all subsequent requests that are sent over the same connection.

To change the parameters for subsequent requests, the client can send another start message with the new parameters after it receives the final recognition results and a new {"state":"listening"} message from the service. The client can change any parameters except for those parameters that are specified when the connection is opened (model, language_customization_id, and so on).

The following example sends a start message with new parameters for subsequent recognition requests that are sent over the connection. The message specifies the same content-type as the previous example, but it directs the service to return confidence measures and timestamps for the words of the transcription.

var message = {
action: 'start',
content-type: 'audio/l16;rate=22050',
word_confidence: true,
timestamps: true
};
websocket.send(JSON.stringify(message));





 Keep a connection alive 

The service terminates the session and closes the connection if an inactivity or session timeout occurs:



* An inactivity timeout occurs if audio is being sent by the client but the service detects no speech. The inactivity timeout is 30 seconds by default.