vania-janet/multiturn-rag-retrieval-data huggingface dataset:
Select Topics in the Event Notifications console and click Create. Enter the following topic details:



* Name: enter a name for the topic.
* Description: add an optional description for the topic.
* Source: select a source from the dropdown list.
* Event type: select event type from the dropdown list.
* Event sub type select event sub type from the event sub type dropdown list.
* Severity: select severity from the severity dropdown list.
* Advanced conditions: write your own custom conditions, which must follow [jsonpath specifications](https://jsonpath.com/).







 Step 6: Create an Event Notifications subscription 

Click Subscriptions in the Event Notifications console. Enter the following subscription details:



* Click Create to display subscription wizard.
* Complete the following subscription details:



* Subscription name: name of the subscription.
* Subscription description: add an optional description.



* Under the Subscribe to a topic section, select a topic from the drop-down list and select a destination from the destination drop-down list.
* Destination type: select type under Destination and click Add.







 Step 7: Set up Event Notifications IOS SDK 

The iOS SDK enables iOS apps to receive push notifications. Complete the following steps to install Event Notifications iOS SDK, initialize the SDK, and register for notifications for your iOS app.





 Installation 

The current version of this SDK is: 0.0.1

To use the Event Notifications iOS destination SDK, define a dependency that contains the artifact coordinates (group ID, artifact ID, and version) for the service, like this:



 CocoaPods 

use_frameworks!

target 'MyApp' do
pod 'ENPushDestination', '> 0.0.1'
end





 Carthage 

To install ENPushDestination using Carthage, add the following to your Cartfile.

github "IBM/event-notifications-destination-ios-sdk" > 0.0.1

Then, run the following command to build the dependencies and frameworks:

carthage update --platform iOS





 Swift Package Manager
You successfully started to build your training data by adding prebuilt content from IBM.





 Step 4: Build a dialog 

A [dialog](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overview) defines the flow of your conversation in the form of a logic tree. It matches intents (what users say) to responses (what your virtual assistant says back). Each node of the tree has a condition that triggers it, based on user input.

We'll create a simple dialog that handles greeting and ending intents, each with a single node.



 Adding a start node 



1. From the Skills menu, click Dialog.

The following two dialog nodes are created for you automatically:



* Welcome: Contains a greeting that is displayed to your users when they first engage with the assistant.
* Anything else: Contains phrases that are used to reply to users when their input is not recognized.



![A new dialog with two built-in nodes](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/gs-new-dialog.png)
2. Click the Welcome node to open it in the edit view.
3. Replace the default response with the text, Welcome to the Watson Assistant tutorial!.

![Editing the welcome node response](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/gs-edit-welcome-node.png)
4. Click ![Close](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/close.png) to close the edit view.
* For the [WebSocket interface](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-websockets), you first specify the customization ID with the language_customization_id parameter of the /v1/recognize method. You use this method to establish a WebSocket connection with the service.

var access_token = {access_token};
var wsURI = '{ws_url}/v1/recognize'
+ '?access_token=' + access_token
+ '&language_customization_id={customization_id}';
var websocket = new WebSocket(wsURI);

You then specify the name of the grammar with the grammar_name parameter in the JSON start message for the active connection. Passing this value with the start message allows you to change the grammar dynamically for each request that you send over the connection.

function onOpen(evt) {
var message = {
action: 'start',
content-type: 'audio/l16;rate=22050',
grammar_name: '{grammar_name}'
};
websocket.send(JSON.stringify(message));
websocket.send(blob);
}
* For the [synchronous HTTP interface](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-http), pass both parameters with the POST /v1/recognize method.

IBM Cloud

curl -X POST -u "apikey:{apikey}" --header "Content-Type: audio/flac" --data-binary @audio-file.flac "{url}/v1/recognize?language_customization_id={customization_id}&grammar_name={grammar_name}"

IBM Cloud Pak for Data
It contains the full URL to use, including the appropriate {location} and {integration-id} values for your instance.
* For a Slack integration that is over 7 months old, make sure the Request URL is using the proper endpoint.



* Go to the [Slack API](https://api.slack.com/) web page. Click Your Apps to find your assistant app. Click Event Subscriptions from the navigation pane.
* Edit the Request URL.



For example, if the URL has the syntax: https://assistant-slack-{location}.watsonplatform.net/public/message, change it to have this syntax:

https://integrations.{location}.assistant.watson.appdomain.cloud/public/slack/{integration-id}/message?version=2020-09-24

Check the Generated request URL field in the Slack integration setup page for the full URL to use, which includes the appropriate {location} and {integration-id} values for your instance.
* For a Facebook Messenger integration that is over 7 months old, make sure the Callback URL is using the proper endpoint.



* Go to the [Facebook for Developers](https://developers.facebook.com/apps/) web page.
* Open your app, and then select Messenger>Settings from the navigation pane.
* Scroll down to the Webhooks section and edit the Callback URL field.

For example, if the URL has the syntax: https://assistant-facebook-{location}.watsonplatform.net/public/message/, change it to have this syntax:

https://integrations.{location}.assistant.watson.appdomain.cloud/public/facebook/{integration-id}/message?version=2020-09-24

Check the Generated callback URL field in the Facebook Messenger integration setup page for the full URL to use, which includes the appropriate {location} and {integration-id} values for your instance.
5. Delete the Say/Play widget and continue to the next step.
6. If this test did not work as expected, double check your phone number configuration to make sure its attached to your flow.







 Creating a Twilio function to handle incoming calls 

Now we need to configure the call flow to direct inbound calls to the assistant using a Twilio function. Follow these steps:



1. In the navigation menu, click the All Products & Services icon.
2. Click Services.
3. Click Create Service. Specify a service name and then click Next.
4. Click Add > Add Function to add a new function to your service. Name the new function /receive-call.
5. Replace the template in your /receive-call function with the following code:

exports.handler = function(context, event, callback) {
const VoiceResponse = require('twilio').twiml.VoiceResponse;
const response = new VoiceResponse();
const dial = response.dial({
answerOnBridge: "true",
referUrl: "/refer-handler"
});
const calledPhoneNumber = event.Called;
dial.sip(sip:${calledPhoneNumber}@{sip_uri_hostname};secure=true);
return callback(null, response);
}



* Replace {sip_uri_hostname} with the hostname portion of your assistant's phone integration SIP URI (everything that comes after sips:).. Note that Twilio does not support SIPS URIs, but does support secure SIP trunking by appending ;secure=true to the SIP URI.



6. Click Save.
7. Click Deploy All.







 Redirecting to the incoming call handler 

In this section you will use a TwiML Redirect** widget in your Studio Flow editor to call out to the /receive-call function created in the previous section.



1.
By default, the height of the component is 300 px and the height of the Visualforce page is 280 px. (The height of the Visualforce page is specified in the height attribute of the iframe HTML element in the code snippet that you copy and paste.)
* Click Activation, and then click the APP, RECORD TYPE, AND PROFILE tab.
* Select the apps to which you want to apply the page layout, and then click Next.
* Select the appropriate record type, such as Main, and then click Next.
* Select user profiles to give the appropriate set of users access to the page. Limit the group to include only those who you want to be able to view chat history information in the page.
* Click Next, and then click Save.



8. From the Salesforce configuration page in Watson Assistant, click Save and exit to finish setting up the connection.



When you test the service desk integration, make sure there is at least one agent with Available status.

Watch a 5-minute video that provides an overview of setting up a connection to a Salesforce service desk:





 Adding transfer support to your actions 

Update an action to make sure it understands when users request to speak to a person, and can transfer the conversation properly.



 Routing based on browser information 

When a customer interacts with the web chat, information about the current web browser session is collected. For example, the URL of the current page is collected. You can use this information to add custom routing rules to your actions. For example, if the customer is on the Products page when a transfer to a human is requested, you might want to route the chat transfer to agents who are experts in your product portfolio. If the customer is on the Returns page, you might want to route the chat transfer to agents who know how to help customers return merchandise.
For Slack webhook, follow the steps in this [link](https://api.slack.com/messaging/webhooks). You need to login with your Slack credentials and provide an existing channel name or create a new one. Copy the Webhook URL for later use.
2. Go back to view the list of [toolchains](https://cloud.ibm.com/devops/toolchains) and select your toolchain, then click on Add.
3. Search for Slack in the search box or scroll down to see Slack. Click to see the configuration page.

Zoom

![Configure the Slack integration](https://cloud.ibm.com/docs-content/v1/content/efbf7b33e3aca029f69f9244bced9dd4d8acb848/apps/includes/solution-tutorials/includes/solution-tutorials/images/solution21/configure_slack.png)

Configure the Slack integration
4. Once the Incoming webhook integration is added, copy the Webhook URL captured earlier and paste under Slack webhook.
5. The Slack channel is the channel name you provided while creating a webhook integration above.
6. Slack team name is the team-name(first part) of team-name.slack.com. for example, kube is the team name in kube.slack.com
7. Click Create Integration. A new tile will be added to your toolchain.

Zoom

![Toolchain with new Slack integration](https://cloud.ibm.com/docs-content/v1/content/efbf7b33e3aca029f69f9244bced9dd4d8acb848/apps/includes/solution-tutorials/includes/solution-tutorials/images/solution21/toolchain_slack.png)

Toolchain with new Slack integration
8.
You must create an SMS account with Twilio first. Complete the [Before you begin](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-smsdeploy-sms-service-setup) steps to create the account. Next, set up the integration.
* If your Voice Agent with Watson service instance uses Twilio as its SMS provider, you can go directly to setting up the integration.











 Set up the integration 

To set up the integration, complete the following steps:



1. From the Assistants page, click to open the assistant tile that you want to deploy.
2. From the Integrations section, click Add integration.
3. Click SMS with Twilio.
4. Click Create.
5. From the Twilio site, click the home icon to go to your project dashboard.

Copy the following values and store them temporarily, so you can paste them into the SMS with Twilio integration setup page in the next step.



* Account SID
* Auth token



6. Return to the SMS with Twilio integration setup page.

Paste the values that you copied in the previous step into the fields with the corresponding names in the Twilio account information section.



* Account SID
* Auth token



7. Scroll to the Setup instructions section, and then copy the value from the Webhook URI (uniform resource identifier) field.

You will add this URI to the webhook configuration in Twilio. If you want to support more than one phone number, you must add the URI to the webhook for each phone number separately.
8. Go to your Twilio account web page. From the All Products and Services menu, click Phone Numbers.
9. From the Active Numbers page, click one of your phone numbers. Scroll to the Messaging section, and then find the Webhook field that defines what to do when a message comes in.

Paste the value that you copied from the Webhook URI field into it.
10. If you want to support multiple phone numbers, repeat the previous step for each phone number that you want to use.
For more information, see [Adding an iframe response type](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overviewdialog-overview-add-iframe). Y 
 title string The title to show before the embedded content. N 
 description string The text of the description that accompanies the embedded content. N 
 image_url string The URL of an image that shows a preview of the embedded content. N 







 Example 

This example embeds an iframe with a title and description.

{
"output": {
"generic":[
{
"response_type": "iframe",
"source": "https://example.com/embeddable/example",
"title": "Example iframe",
"description": "An example of embeddable content returned as an iframe response."
}
]
}
}







 option 

Displays a set of buttons or a drop-down list users can use to choose an option. The specified value is then sent to the workspace as user input.



 Fields 



 Name Type Description Required? 

 response_type string option Y 
 title string The title to show before the options. Y 
 description string The text of the description that accompanies the options. N 
 preference string The preferred type of control to display, if supported by the channel (dropdown or button). The Watson Assistant connector currently supports only button. N 
 options list A list of key/value pairs specifying the options from which the user can choose. Y 
 options[].label string The user-facing label for the option. Y 
 options[].value object An object defining the response that will be sent to the Watson Assistant service if the user selects the option. Y 
 options[].value.input object An object that includes the message input corresponding to the option, including input text and any other field that is a valid part of a Watson Assistant message.
Integrating with WhatsApp 

IBM Cloud

Integrate with WhatsApp messaging so your assistant can exchange messages with your customers where they are.

Many customers use WhatsApp because it provides fast, simple, secure messaging for free, and is available on phones all over the world. WhatsApp uses the phone Internet connection to send messages so customers can avoid SMS fees.

This integration creates a connection between your assistant and WhatsApp by using Twilio as a provider.



 Before you begin 

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



1. Go to the [Twilio website](https://www.twilio.com/).
2. Create an account.
3. From the Develop tab, 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.



Keep the Twilio web page open in a web browser tab so you can refer to it again later.





 Ask WhatsApp for permission to enable your Twilio number for WhatsApp 

WhatsApp has a rigorous process that they use to review all businesses that want to interact with customers over their network. WhatsApp, which is owned by Facebook, requires that you register your business with the Facebook business directory.



1. To register, go to the [Facebook Business Manager](https://business.facebook.com/overview) website, and click Create account. Follow the instructions to create an account.
2. Get your Facebook Business Manager ID. In [Settings](https://business.facebook.com/settings), click the Business info tab. The Facebook Business Manager ID is at the top of the page.
3. Submit the Request to enable your Twilio numbers for WhatsApp form from the [Twilio API for WhatsApp](https://www.twilio.com/whatsapp/request-access) web page.

Tips for specifying the following values:
For information about how to call a client application, see [Calling a client application from a dialog node](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-actions-client).



 Defining the webhook 

You can define one webhook URL for a dialog skill, and then call the webhook from one or more dialog nodes.

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



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

For less efficient services that you need to call, you can manage the call through a client application and pass the information to the dialog as a separate step. For more information, see [Calling a client application from a dialog node](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-actions-client).



To add the webhook details, complete the following steps:



1. From the skill menu for the skill where you want to add the webhook, click Options.
2. Click Webhooks.
3. In the URL field, add the URL for the external application to which you want to send HTTP POST request callouts.

For example, to call the Language Translator service, specify the URL for your service instance.

https://api.us-south.language-translator.watson.cloud.ibm.com/v3/translate?version=2018-05-01

If the external application that you call returns a response, it must be able to send back a response in JSON format. For the Language Translator service, for example, you must specify the format in which you want the result to be returned. You can do so by passing a header to the service.
4. In the Headers section, add any headers that you want to pass to the service one at a time by clicking Add header.
If you do make changes, make sure the height of the Visualforce page is 20 px smaller than the height of the component that you add it to. By default, the height of the component is 300 px and the height of the Visualforce page is 280 px. (The height of the Visualforce page is specified in the height attribute of the iframe HTML element in the code snippet that you copy and paste.)
* Click Activation, and then click the APP, RECORD TYPE, AND PROFILE tab.
* Select the apps to which you want to apply the page layout, and then click Next.
* Select the appropriate record type, such as Main, and then click Next.
* Select user profiles to give the appropriate set of users access to the page. Limit the group to include only those who you want to be able to view chat history information in the page.
* Click Next, and then click Save.



8. From the Salesforce configuration page in Watson Assistant, click Save and exit to finish setting up the connection.



When you test the service desk integration, make sure there is at least one agent with Available status.

Watch a 5-minute video that provides an overview of setting up a connection to a Salesforce service desk:





 Adding transfer support to your dialog 

Update your dialog to make sure it understands when users request to speak to a person, and can transfer the conversation properly. For more information, see [Adding chat transfer support](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-supportdialog-support-transfers).





 Adding routing logic for transfers 

When you enable transfers to the Salesforce service desk, the default routing preference that you specify is used. However, there might be times when you want to route a customer to a different Salesforce agent queue. For example, your dialog might have a root dialog node that conditions on a close_account intent. For that branch of the conversation only, you want to transfer customers to agents in the sales queue who are authorized to offer incentives as a way to retain customers. You can direct transfers to specific agent queues by adding routing logic to your dialog.

You can specify alternate routing preferences based on:



* browser information
* Base URL: This URL is the REST API endpoint for the SMS service you are using.







 Optimize your dialog for messaging 

For the best customer experience, design your dialog with the capabilities of the Twilio integration in mind:



* Do not include HTML elements in your text responses.
* You can send media files or even documents in your response. These files can be intercepted and processed by a configured premessage webhook. For more details, see [Processing input attachments](https://cloud.ibm.com/docs/assistant?topic=assistant-api-input-attachments).
* The SMS with Twilio integration does not support chat transfers that are initiated with the Connect to human agent response type.
* The pause response type is ignored. If you want to add a pause, use a [vgwConversationResponseTimeout](https://cloud.ibm.com/docs/assistant?topic=assistant-commands-smscommands-sms-context-variables) context variable instead.
* Image, Audio, Video response types allow sending a message containing media. A title and description are sent along with the attachment. Note that depending on the carrier and device of the end user these messages may not be successfully received. For a list of the supported content types, see [Accepted Content Types for Media](https://www.twilio.com/docs/sms/accepted-mime-types).
* You can include search skill response types in dialog nodes that the phone integration will send as a message. The message includes the introductory text (I searched my knowledge base and so on), and then the body of only the first search result.



If you want to use the same dialog for an assistant that you deploy to many different platforms, add custom responses per integration type. You can add a conditioned response that tells the assistant to show the response only when the SMS with Twilio integration is being used. For more information, see [Building integration-specific responses](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-integrationsdialog-integrations-condition-by-type).