vania-janet/multiturn-rag-retrieval-data huggingface dataset:
[Genesys simulate call](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/phone-genesys-simulate-call.png)
16. Go to Phone Management and click Create new. Specify the following information:



* In the Phone Name field, specify a descriptive name.
* In the Base Settings field, select WebRTCPhone.
* In the Site field, select the site you want to use.
* In the Person field, select yourself.



17. In the Watson Assistant user interface, [create a new phone integration](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-deploy-phonedeploy-phone-setup). Specify the following information:



* When prompted, select Use an existing phone number with an external provider.
* Specify the phone number you assigned in the Genesys Number Plans setting. This is not necessarily a real phone number; it is just the identifier you assigned.
* Complete the phone integration setup process. For more information, see [Integrating with phone](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-deploy-phone).
* After the phone integration is set up, go to the SIP trunk tab and uncheck the Don't place callers on hold while transferring to a live agent option.



18. In the Genesys Cloud console, click the circle in the upper left corner. Select Phone, and then choose the phone you created in the Phone management section. Set yourself as available. The phone icon on the left should now be active.
19. Click + to start a new call. Specify the number you assigned to Watson Assistant and then click Dial. You should now hear your assistant speak.



If you encounter any errors, click Performance -> Interactions and view the PCAP file to read the diagnostics.





 Transferring to a live agent
Time in the ISO format yyyy-MM-ddTHH:mm:ss.SSSZ Time when the request was sent to Watson Assistant. 
 assistant.response_milliseconds number Time between when the request was sent and when the response was received from Watson Assistant. 
 request JSON object A request sent to Watson Assistant. 
 response JSON array An array of the response objects associated with the request. 



The request object contains the following keys:



Keys for the request object

 Key Type Description 

 type string The request type: <br>start - an initial request to Watson Assistant <br>speech_to_text - a request is triggered on speech recognition <br>dtmf - a request is triggered when DTMF collection completes <br>sms - a request is triggered when a SMS message is received from the caller <br>post_response_timeout - a request is triggered when the post response timer expires <br>redirect - a request is triggered when a call is redirected <br>transfer - a request is triggered when a call is transferred <br>transfer_failed - a request is triggered when a call transfer fails <br>final_utterance_timeout - a request is triggered when the final utterance timer expires <br>no_input_turn - a request is triggered when no inpout turn is enabled <br>sms_failure - a request is triggered when a SMS message can't be sent to the caller <br>speech_to_text_result_filtered - a request is triggered when an utterance is filtered due to low confidence level <br>mrcp_recognition_unsuccessful - a request is triggered when the MRCP recognition completes without a final utterance <br>network_warning - a request is triggered when a network error is detected <br>media_capability_change - a request is triggered when media capabilities change in the middle of a call 
 streaming_statistics JSON object Contains information and statistics related to the Speech to Text recognition. 



The request.streaming_statistics object contains the following keys:



Keys for the request.streaming_statistics object

 Key Type Description 

 transaction_id string A unique identifier of the transaction. 
 start_timestamp string.
'message_type:': 'text',
'text': ''
}
context = {}

 Initialize with empty message to start the conversation.
message_input = {
'message_type:': 'text',
'text': ''
}
context = {}

 Main input/output loop
while message_input['text'] != 'quit':

 Send message to assistant.
result = assistant.message_stateless(
assistant_id,
input = message_input,
context = context
).get_result()

context = result['context']

 Print responses from actions, if any. Supports only text responses.
if result['output']:
for response in result['output']:
if response['response_type'] == 'text':
print(response['text'])

 Prompt for the next round of input unless skip_user_input is True.
if not result['context']['system'].get('skip_user_input', False):
user_input = input('>> ')
message_input = {
'text': user_input
}

Show more

// Example 3: Preserves context to maintain state.

const prompt = require('prompt-sync')();
const AssistantV2 = require('ibm-watson/assistant/v2');
const { IamAuthenticator } = require('ibm-watson/auth');

// Create Assistant service object.
const assistant = new AssistantV2({
version: '2021-11-27',
authenticator: new IamAuthenticator({
apikey: '{apikey}', // replace with API key
}),
url: '{url}', // replace with URL
});

const assistantId = '{environment_id}'; // replace with environment ID

// Start conversation with empty message
Watson Assistant 

The installable IBM Watson® Assistant service combines machine learning, natural language understanding, and integrated dialog tools to create conversation flows between your apps and your users. For more information about this service, see [IBM Watson® Assistant](https://cloud.ibm.com/docs/assistant?topic=assistant-getting-started).

The Watson packages are deprecated. Please use the [Watson SDKs](https://cloud.ibm.com/docs/watson?topic=watson-using-sdks) to perform Watson related functionality. For more information about which Watson SDK is included in the available runtimes, see the [Functions runtime](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-runtimes) documentation.

The Watson Assistant package contains the following entities. For more information, see the [Watson Assistant API reference](https://cloud.ibm.com/apidocs/assistant-v1introduction).



Table 1. Watson assistant package entities

 Entity Type Parameters Description 

 assistant-v1 Package username, password, iam_access_token, iam_apikey, iam_url, headers, headers[X-Watson-Learning-Opt-Out], url Work with the Watson Assistant service. 
 message Action username, password, iam_access_token, iam_apikey, iam_url, headers, headers[X-Watson-Learning-Opt-Out], url, assistant_id, Get the response to user input. 
 create-workspace Action username, password, iam_access_token, iam_apikey, iam_url, headers, headers[X-Watson-Learning-Opt-Out], url, name, description, language, intents, entities, dialog_nodes, counterexamples, metadata, learning_opt_out Create a workspace.
* Build conversations with actions, which represent the tasks you want your assistant to help your customers with. Each action contains a series of steps that represent individual exchanges with a customer.
* A new way to publish lets you review and debug your work in a draft environment before going live to your customers.
* Use a new suite of analytics to improve your assistant. Review which actions are being completed to see what your customers want help with, determine if your assistant understands and addresses customer needs, and decide how can you make your assistant better.
* New [documentation](https://cloud.ibm.com/docs/watson-assistant) focuses on the workflow of building, deploying, and improving your assistant.



Older release notes might link to the [documentation for the classic Watson Assistant experience](https://cloud.ibm.com/docs/assistant).





 21 September 2021 

Analytics Overview change
: To improve reliability, the Values column has been removed from Top entities on the Analytics Overview page. Top Entities continues to provide counts of entity types. For more information, see [Top intents and top entities](https://cloud.ibm.com/docs/assistant?topic=assistant-logs-overviewlogs-overview-tops)





 16 September 2021 

Enhanced intent detection for French, Italian, and Spanish dialog skills
: The new intent detection model improves your assistant's ability to understand what customers want. This model is now available in dialog skills using French, Italian, and Spanish. For more information, see [Improved intent recognition](https://cloud.ibm.com/docs/assistant?topic=assistant-intent-detection).

Change to the irrelevance detection option
: As of this release, new English dialog skills no longer include the option to choose between the Enhanced or Existing irrelevance detection. By default, intent detection and irrelevance detection are paired like this:



* If you use the dialog skill options to choose enhanced intent detection, it is automatically paired with enhanced irrelevance detection.
* If you use the dialog skill options to choose existing intent detection, it is automatically paired with existing irrelevance detection.
As part of development that is in progress to help the assistant learn automatically from user choices, the actions that are included and their order in the list is randomized on purpose. Randomizing the order helps to prevent bias that can be introduced by a percentage of people who always pick the first option without carefully reviewing all of their choices beforehand.



 Customizing clarifying questions 

To customize clarification, you can:



* Change settings like the wording your assistant uses to introduce the clarification list or when no action matches.
* Enable response modes to modify the assistant's behavior when it asks questions. For more information, see [Response modes](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-action-response-modes).



To change settings, complete the following steps:



1. From the Actions page of the assistant, click Global settings![Gear icon](https://cloud.ibm.com/docs-content/v1/content/icons/settings.svg).
2. On the Clarifying questions tab, you can edit the Ask clarifying questions section:



Ask clarifying question settings

 Field Default text Description 

 Assistant says Did you mean: The text that is displayed before the list of clarification choices. You can change it to something else, such as What do you want to do? or Pick what to do next. 
 No action matches None of the above The choice that customers can click when none of the other choices are right. If the customer picks this choice, the assistant uses your No action matches action. You can change it to something else, such as I need something else or These aren't what I want. Or, you can remove the text to omit offering this choice. 



3. If you enable response modes, you can modify this text:



Response modes settings

 Field Default text Description 

 One action matches Something else If an assistant prioritizes one action that it thinks matches the customer need, it can clarify the match by asking the customer to confirm. This choice accompanies the single action in case the customer needs something else.
This feature enables you to, for example, call an action to retrieve weather information from within a dialog node, and then condition on the returned information in the dialog response. Currently, you can call an action from a Cloud Functions instance that is hosted in the US South region from Watson Assistant instances that are hosted in the US South region. See [Making programmatic calls from a dialog node](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-actions-client) for more details.





 5 December 2017 

Redesigned UI for Intents and Entities
: The Intents and Entities tabs have been redesigned to provide an easier, more efficient workflow when creating and editing entities and intents. See [Defining intents](https://cloud.ibm.com/docs/assistant?topic=assistant-intents-create-task) and [Defining entities](https://cloud.ibm.com/docs/assistant?topic=assistant-entitiesentities-creating-task) for information about working with these tabs.





 30 November 2017 

Eastern Arabic numeral support
: Eastern Arabic numerals are now supported in Arabic system entities.





 29 November 2017 

Improving understanding of user input across workspaces
: You can now improve a workspace with utterances that were sent to other workspaces within your instance. For example, you might have multiple versions of production workspaces and development workspaces; you can use the same utterance data to improve any of these workspaces. See [Improving across workspaces](https://cloud.ibm.com/docs/assistant?topic=assistant-logslogs-deploy-id).





 20 November 2017 

GB18030 compliance
: GB18030 is a Chinese standard that specifies an extended code page for use in the Chinese market. This code page standard is important for the software industry because the China National Information Technology Standardization Technical Committee has mandated that any software application that is released for the Chinese market after September 1, 2001, be enabled for GB18030. The Watson Assistant service supports this encoding, and is certified GB18030-compliant.





 9 November 2017 

Intent examples can directly reference entities
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.

If you want to copy dialog nodes from one skill into another skill, follow these steps:



1. Download as JSON files both the dialog skill that you want to copy the dialog nodes from and the dialog skill that you want to copy the nodes to.
2. In a text editor, open the JSON file for the dialog skill that you want to copy the dialog nodes from.
3. Find the dialog_nodes array, and copy it.
4. In a text editor, open the JSON file for the dialog skill that you want to copy the dialog nodes to, and then paste the dialog_nodes array into it.
5. Import the JSON file that you edited in the previous step to create a new dialog skill with the dialog nodes you wanted.



* How long are log files kept for a workspace?

Messages are retained for 90 days. For more information, see [Log limits](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-logslogs-limits).
* How do I create a webhook?

To define a webhook and add its details, open the skill where you want to add the webhook.
Follow the steps in the [Getting started with Watson Assistant](https://cloud.ibm.com/docs/assistant?topic=assistant-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/assistant-v1listlogs) and the [Filter query reference](https://cloud.ibm.com/docs/assistant?topic=assistant-filter-reference). 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 export and import dialog nodes? 

No, you cannot export and import dialog nodes from the product user interface.

If you want to copy dialog nodes from one skill into another skill, follow these steps:



1. Download as JSON files both the dialog skill that you want to copy the dialog nodes from and the dialog skill that you want to copy the nodes to.
2. In a text editor, open the JSON file for the dialog skill that you want to copy the dialog nodes from.
3. Find the dialog_nodes array, and copy it.
4. In a text editor, open the JSON file for the dialog skill that you want to copy the dialog nodes to, and then paste the dialog_nodes array into it.
5. Import the JSON file that you edited in the previous step to create a new dialog skill with the dialog nodes you wanted.







 Is it possible to recover a deleted skill?
The Watson SDKs for other languages provide equivalent mechanisms for instantiating a service object.

After creating the service object, we use it to send a message to the assistant, using the stateless message method. In this example, the message is empty; we just want to trigger the Greet customer action to start the conversation, so we don't need any input text. We then print any text responses returned in the generic array in the returned output.

Use the node <filename.js> command to run the example application.

Use the python3 <filename.py> command to run the example application.

Note: Make sure you have installed the Watson SDK for Node.js using npm install ibm-watson.

Note: Make sure you have installed the Watson SDK for Python using pip install --upgrade ibm-watson or easy_install --upgrade ibm-watson.

Assuming everything works as expected, the assistant returns the output from the assistant, which the app then prints to the console:

Welcome to the Watson Assistant example. What's your name?

This output tells us that we have successfully communicated with the assistant and received the greeting message specified by the Greet customer action. But we don't yet have a way of responding to the assistant's question.





 Processing user input 

To be able to process user input, we need to add a user interface to our client application. For this example, we'll keep things simple and use standard input and output. We can use the Node.js prompt-sync module to do this. (You can install prompt-sync using npm install prompt-sync.) We can use the Python 3 input function to do this.



* Python
* Node



 Example 2: Adds user input.

from ibm_watson import AssistantV2
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator

 Create Assistant service object.
authenticator = IAMAuthenticator('{apikey}') replace with API key
assistant = AssistantV2(
version = '2021-11-27',
authenticator = authenticator
)
The assistant_interaction_summaries object contains the following keys:



Keys for the assistant_interaction_summaries object

 Key Type Description 

 assistant_id string The unique identifier of the assistant. 
 session_id string The unique identifier of the session. 
 turns JSON array An array of the Watson Assistant transactions that took place during the conversation. 



The turn object contains the following keys:



Keys for the turn object

 Key Type Description 

 assistant.log_id string A unique identifier for the logged transaction. Can be used to correlate between message logs and CDR events. 
 assistant.start_timestamp string. Time in the ISO format yyyy-MM-ddTHH:mm:ss.SSSZ Time when the request was sent to Watson Assistant. 
 assistant.response_milliseconds number Time between when the request was sent and when the response was received from Watson Assistant. 
 request JSON object A request sent to Watson Assistant. 
 response JSON array An array of the response objects associated with the request. 



The request object contains the following keys:



Keys for the request object

 Key Type Description
If you use Twilio as your SIP trunk provider, you cannot enable SIP authentication for outbound SIP trunks to Watson Assistant.







 Applying advanced SIP trunk configuration settings 

To configure how your assistant interacts with a SIP trunk from an external provider, go to the SIP trunk tab in the phone integration settings, and update the following options in the SIP trunking integration section:



* SIP INVITE headers to extract: List the headers that you want your assistant to use.

The SIP INVITE request can include metadata about the call in headers that can be extracted and sent to your assistant using context variables. For example, many companies use Interactive Voice Response (IVR) systems that pass information about an incoming call by using SIP headers. If you want to make use of any of these headers, list the header names here.

The specified headers, if present in the request, are stored in the context variable sip_custom_invite_headers, along with other related metadata that is automatically extracted from the SIP INVITE. This variable is an array in which each key/value pair represents a header from the request, as in this example:

{
"input": {
"text": "",
...
},
"context" : {
"global" : {...},
"skills" : {...},
"integrations" : {
"voice_telephony": {
"private":{
"user_phone_number":"+18594213456",
},
"sip_call_id": "Aob2-2743-5678-1234",
"assistant_phone_number":"+18882346789",
"sip_custom_invite_headers": {
"X-customer-name": "my_name",
"X-account-number": "12345"
}
}
}
}
}
Show more

You can then reference these headers in your assistant. For example, you might check the header value in a step condition to determine the next step.
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 SMS with Twilio 

Add a text messaging integration so your assistant can exchange messages with your customers.

The Short Messaging Service (SMS) supports text-only messages. Typically, SMS restricts the text message length to 160 characters. The Multimedia Messaging Service (MMS) supports sending images and text messages that are over 160 characters in length. When you create a phone number with Twilio, MMS message support is included automatically.

Customers send text messages to your Twilio-hosted phone number. Twilio uses a messaging webhook that you set up to send a POST request with the text message body to your assistant. Each response from the assistant is sent back to Twilio to be converted to an outbound SMS message that is sent to the customer. The responses are sent to the Twilio API for processing. You provide your Twilio account SID and project authentication token information, which serve as your Twilio API access credentials.

This feature is available only to Plus plan users.



 Before you begin 

If you don't have a text messaging phone number, set up a SMS with Twilio account and get a phone number.



1. Go to the [Twilio website](https://www.twilio.com/).
2. Create an account or start a free trial.
3. From the All Products and Services menu ![Twilio All products and services icon](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/twilio-products.png), click Phone numbers.
4. Follow the instructions to get a phone number.

When you get a Twilio phone number, it supports voice, SMS, and MMS automatically. Your new phone number is listed as an active number.