vania-janet/multiturn-rag-retrieval-data huggingface dataset:
To use a webhook from a dialog node, you must enable webhooks on the node, and then add details for the callout.



1. Click the Dialog tab.
2. Find the dialog node where you want to add a callout. The callout to the webhook will occur whenever this node is triggered during a conversation with a user.

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 webhook section. Set the Callout to webhooks/actions skill switch to On.
5. Select Call a webhook, and then click Apply.

If you did not have it enabled already, the Multiple conditioned responses switch is set to 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.
6. Add any data that you want to pass to the external application as key and value pairs in the Parameters section.

Parameters are passed as request body properties. You cannot specify query parameters or URL parameters in a dialog node. These parameters can only be configired with static values as part of the webhook definition. For more information, see [Defining the webhook](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-webhooksdialog-webhooks-create).

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.
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).



 Adding custom dialog flows for integrations 

Use the JSON editor in dialog to access information that is submitted from the web chat integration.

Starting with API version 2020-04-01, the context object that is passed as part of the v2 /message API request contains an integrations object. This object makes it possible to pass information that is specific to a single integration type in the context. For more information about context variables, see [Context variables](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-runtime-contextdialog-runtime-context-variables).

The integrations object is available from the v2 API in version 2020-04-01 or later only.

To take advantage of the context.integrations object, you can create context variables that are named as follows to get and set values for different integrations:



Integration-specific context variables

 Integration type Context variable syntax 

 Phone $integrations.voice_telephony 
 Salesforce service desk from web chat $integrations.salesforce 
 SMS with Twilio $integrations.text_messaging 
 Web chat (and assistant preview) $integrations.chat 
 Zendesk service desk from web chat $integrations.zendesk 



The following sections describe how to use integration-specific context variables to do common tasks.



 Building integration-specific dialog flow 

Create a single dialog that is optimized to use the best features offered by each channel or client interface in which it is deployed.

You can customize the conversation in the following ways:



* To add an entire dialog branch that is only processed by a specific integration type, add the appropriate integration type context variable, such as $integrations.chat, to the If assistant recognizes field of the dialog root node.
* To add a single dialog node that is only processed by a specific integration type, add the appropriate integration type context variable, such as $integrations.zendesk, to the If assistant recognizes field of the dialog child node.
Click Save and exit.







 Testing the integration 

While you wait for WhatsApp to approve your request, you can test the integration by using the Twilio sandbox. With the sandbox, you can send and receive preapproved template messages to numbers that join your sandbox, using a shared Twilio test number.

Do not use the Twilio sandbox in production. Sandbox sessions expire after 3 days.



1. To create a sandbox, go to the [Twilio Try WhatsApp](https://www.twilio.com/console/sms/whatsapp/learn) web page. An Activate your sandbox prompt is displayed. Agree to have a sandbox created, and confirm your choice.
2. Follow the instructions to create the sandbox.
3. Connect to the sandbox by sending a WhatsApp message from your device to the Sandbox phone number.
4. From the Programmable Messaging menu, expand Settings, and then click WhatsApp Sandbox Settings.
5. In the Sandbox Configuration section, paste the webhook URI that you copied earlier into the when a message comes in field, and then save the configuration.
6. You can test the integration by sending a message from WhatsApp to the shared phone number that is assigned to your Twilio sandbox.







 Finish the product integration 

After WhatsApp grants permission for your Twilio phone number or number to access the WhatsApp network, update the integration to use your dedicated Twilio phone number instead of the sandbox number.



1. From the WhatsApp with Twilio integration setup page, scroll to the Setup instructions section, and then copy the value from the Webhook URI (uniform resource identifier) field.
2. Go to your Twilio account web page and add the webhook you copied to the Twilio configuration to complete the connection to the WhatsApp integration in Twilio.







 Give your customers fast access to your assistant 

You can add an icon to your web page that customers can click to start a conversation over WhatsApp with your assistant.

To add an icon to your web page, complete the following steps:
6. On the Connect to channels page, click Configure Microsoft Teams channel in the Add a featured channel section.
7. On the Configure Microsoft Teams page, specify options in the Messaging, Calling, and Publish tabs that fit your bot needs, and then click Save.
8. In your Watson Assistant Microsoft Teams integration, click Next to create your Teams app.







 Create your Teams app 



1. Go to the [Microsoft Teams Developer Portal](https://dev.teams.microsoft.com/home), and log in with your admin credentials.
2. On the Apps tab, click New App.
3. Enter a name, and click Add.
4. On the Basic information page, enter app names, app ID, descriptions, developer information, and app URLs, and then copy and paste your app ID into Application (client) ID. Click Save.
5. In the Configure section, select App features, and then Bot.
6. On the Identify your bot page, select your bot.
7. In the Select the scope in which people can use this command section, select Personal, Team, and Group Chat.
8. Click Save, but keep the window open.
9. In your Watson Assistant Microsoft Teams integration, click Finish.
10. Click Publish to publish your bot.









 Publishing your Teams app 



1. In the Microsoft Teams Developer Portal window where you created and saved your Teams app, click Publish to publish your bot.
2. Click Download the app package.
3. Go to [Microsoft Teams](https://teams.microsoft.com), and log in with your admin credentials.
4. Click Apps in the sidebar menu, and then click Manage your apps and Upload an app.
5. Select Upload a custom app and specify the app package .zip file you downloaded.
6. Click Add to finish.
7. Test your actions and responses in the Chat section of your Teams app.







 Response types
[Try it](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/ask_watson.png) icon to open the "Try it out" pane.
2. Click Clear to restart the conversation session.
3. Enter, Who are you?

Your assistant recognizes the General_About_You intent. Its response ends with the question, What should I call you?
4. Enter, Jane.

Your assistant saves Jane in the $username variable.
5. Enter, Hello.

Your assistant recognizes the General_Greetings intent and says, Good day to you, Jane! It uses the conditional response that includes the user's name because the $username context variable contains a value at the time that the greeting node is triggered.



You can add a conditional response that conditions on and includes the user's name for any other responses where personalization would add value to the conversation.







 Step 6: Test the assistant from your web page integration 

Now that you have built a more sophisticated version of the assistant, return to the public web page that you deployed as part of the previous tutorial, and then test the new capabilities you added.



1. Open the assistant.
2. Click Preview.
3. Copy and paste the URL from Share this link into a web browser.

An IBM-branded page is displayed with your assistant embedded in it as a chat window.
4. Repeat a few of the test utterances that you submited to the "Try it out" pane to see how the assistant behaves in a real integration.

Unlike when you send test utterances to your assistant from the "Try it out" pane, standard usage charges apply to API calls that result from utterances that are submited to the chat widget.







 Next steps 

Now that you have built and tested your dialog skill, you can share it with customers. Deploy your skill by first connecting it to an assistant, and then deploying the assistant. There are several ways you can do this.
Open the Options page, and then click Webhooks to add details about your webhook. To invoke the webhook, call it from one or more of your dialog nodes. For more information, see [Making a programmatic call from dialog](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-webhooks).





 Can I have more than one entry in the URL field for a webhook? 

No, you can define only one webhook URL for a dialog skill. For more information, see [Defining the webhook](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-webhooksdialog-webhooks-create).





 Can I extend the webhook time limit? 

No. The service that you call from the webhook must return a response in 8 seconds or less, or the call is canceled. You cannot increase this time limit. For more information about strategies for handling complex actions with a webhook, watch the video in [Making a programmatic call from dialog](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-webhooks).
[Screens icon](https://cloud.ibm.com/docs-content/v1/content/f61dbc5d84bf0c89e477a05cab04c72f429e1b7a/log-analysis/images/screens.png).
3. Click NEW SCREEN.
4. To save the screen, click Save Screen. Enter the following and then click Save.

Name: The name you want to give to your screen.

Category: Select an existing category or enter a new category name. If adding a new category, click Add this as a new screen category to add the category to the list.
5. Click Add Widget and select Count. A widget is added to your screen.
6. Click the widget. The configuration for the widget is displayed.
7. Change the Field and Field Value to change what is counted. For example, you might change Field to host and Field Value to a host in your account. The widget will now count the log messages in the past day. You can also change the Duration of time counted.
8. Change the Label of the widget to something meaningful to you.
9. Click Save Screen > Save to save your changes.
10. Add a table widget by clicking Add Widget > Table.
11. Click the table widget. The configuration for the widget is displayed.
12. Change the Field and Field Value to change what is displayed in the table. In Group By, specify the field used to group the data . For example, you might change Field to host and Field Value to a host in your account. You then might want to group that data by app. The widget will display a table of the counts for the host grouped by app during the past day. You can also change the Duration of time counted and specify a Label for your widget.

If you need a table with more rows, change the Data FormatNumber of Rows to your preferred value.
13.
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.
14. If you want to support multiple phone numbers, repeat the previous step for each phone number that you want to use.
15. Click Save.
16. From the Develop tab in the sidebar, click Messaging > Settings > Geo permissions. If Messaging is not present, go to the Search Bar at the top and search for 'Messaging', then select SMS Geographic Permissions.
17. From the Messaging Geographic Permissions page, select the country codes of the phone numbers that can text your Twilio number. By default, no country codes are allowed to text your Twilio number.
18. Return to the SMS with Twilio integration setup page. Click Finish.









 Integrating with SMS with IntelePeer 



 Before you begin 

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



1. Go to the [IntelePeer website](https://www.intelepeer.com/).
2. Create an account or start a free trial.

When you get an IntelePeer phone number, it supports voice and SMS. If the number is not automatically enabled for SMS, you will need to enable it manually. Your new phone number is listed as an active number. Refer to the [Atmosphere Messaging Quick Start Guide](https://docs.intelepeer.com/atmosphere/Content/Atmosphere-SMS-Messaging/Atmosphere-SMS-Messaging-Quick-Start-Guide.htm)







 Set up the integration 

To set up the integration, complete the following steps:



1. Go to the Integrations page by clicking the integrations icon (!
If you have a toolchain and are adding this tool integration to it, from the IBM Cloud console, click the menu icon ![hamburger icon](https://cloud.ibm.com/docs-content/v1/content/562806c0b18119f4d21cb66f5ae6d051634b4a16/ContinuousDelivery/images/icon_hamburger.svg) and select DevOps. On the Toolchains page, click the toolchain to open its Overview page. Alternatively, on your app's Overview page, on the Continuous delivery card, click View toolchain. Then, click Overview.

a. Click Add tool.

b. In the Tool Integrations section, click Slack.
3. Type the Slack webhook URL, which is generated by Slack as an incoming webhook. You need a Slack webhook URL for a Slack channel to receive notifications about your toolchain from the tool integrations. For instructions to create or find your webhook, see [Incoming Webhooks](https://api.slack.com/incoming-webhooks).



If you use an API key for your Slack channel to receive notifications about your toolchain from the tool integrations, you must update your configuration to use a webhook instead.



1. Type the name of the Slack channel that you want notifications to be sent to. The channel must exist and be active in your Slack team.
2. Type the URL host name for your Slack team, which is the word or phrase before .slack.com in your team URL. For example, if your team URL is https://team.slack.com, the host name is team.
3. Click Create Integration.

If the Slack channel and team that you specified cannot be reached, the Setup Failed error is displayed on the Slack card. Hover over the Setup Failed message and click Reconfigure. Make sure that you are using valid configuration parameters for the Slack webhook URL, Slack channel, and URL host name for your Slack team.
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:



* Phone Number: Specify the Twilio phone number that you created earlier.

Consider provisioning more than one phone number and going through the process of getting permission for the numbers in parallel. If your number was used by a different business previously (because Twilio assigned you a number that was used before, for example), WhatsApp will reject it.
* Are you working with an ISV: Select No.
* Twilio Account SID: From the Twilio site, click the home icon to go to your project dashboard to find the SID.
* Facebook Business Manager ID: Add the ID for the account that you created in the previous step.



4. Click Request Now.



Give WhatsApp time to evaluate and approve your request. It can take up to 7 days for your request to be approved.





 Set up the integration 

To set up the integration, complete the following steps:



1. Go to the Integrations page by clicking the integrations icon (![Integrations icon](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/integrations-icon.png)) in the left menu.
2. Click Add on the WhatsApp with Twilio tile.
3. Click Confirm.
4. From the Twilio site, click on your account name in the upper left menu to go to your account dashboard.

Copy the following values and store them temporarily, so you can paste them into the WhatsApp with Twilio integration setup page in the upcoming steps.



* Account SID
* Auth token
Go to [Microsoft Teams](https://teams.microsoft.com), and log in with your admin credentials.
4. Click Apps in the sidebar menu, and then click Manage your apps and Upload an app.
5. Select Upload a custom app and specify the app package .zip file you downloaded.
6. Click Add to finish.
7. Test your actions and responses in the Chat section of your Teams app.







 Response types 

These [response types](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-respond) are supported and displayed as expected when your assistant is deployed for Microsoft Teams direct messages, channels, or group chats.



* date
* image
* option
* suggestion
* text
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 more information, see [Web chat: Accessing browser information](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-integrationsdialog-integrations-chat-browser-info).





 Routing by topic 

You can specify a routing preference for specific topics of conversation in your dialog. When specified, the chat is transferred to the department that you designate. You can choose a department that you know has agents who are best able to address the topic.

Before you perform this procedure, determine which department you want users to be routed to.

To add custom routing logic, complete the following steps:



1. From the Dialog page, find the root dialog node for the branch of the conversation that you want to route to a specific Zendesk department.
2. Find the dialog node in the branch where you want the transfer to take place, and then add the Connect to human agent response type as the dialog node response type.

For more information, see [Adding a Connect to human agent response type](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overviewdialog-overview-add-connect-to-human-agent).
3. After you add the response type and customize the transfer messages, select Zendesk from the Service desk routing field.
4. In the Department field, add the department to which you want the assistant to transfer customers who want to discuss this topic. For example, sales.

Be sure to specify the exact right syntax for the department name. The value is not validated by the service as you add it to your dialog.
In your Watson Assistant install:



1. Go to the Integrations page by clicking the integrations icon (![Integrations icon](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/integrations-icon.png)) in the left menu. For more information, see [Integrating the web chat with your website](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-deploy-web-chat).
2. Click Web chat and then click Open.
3. Select an environment, and click Confirm.
4. Go to the Live agent tab.
5. Click Zendesk.





 Connect Zendesk to your assistant 

In the Live agent tab of your Zendesk web chat integration:



1. Toggle on Transfers enabled. Two tasks should display: Connect Zendesk and Private app Install.
2. Copy the Account key from your Zendesk account in the tab you kept open.

![Screen capture of the connection dialog.](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/zd-account-key.png)
3. Paste into the Account key field in your assistant.
4. Click Connect account. A checkmark indicates successful completion.







 Install app in Zendesk 

IBM provides an application to install in your Zendesk Service subdomain. When a customer asks to speak to someone, your assistant shares a chat summary for the transferred conversation with the Zendesk agent via this private app.



1. Click Private app Install.
2. Click the arrow next to Download the Watson Assistant Zendesk app. The app appears in the location of your downloads.
You created a dialog node that is triggered by the welcome condition. (welcome is a special condition that functions like an intent, but does not begin with a .) It is triggered when a new conversation starts. Your node specifies that when a new conversation starts, the system should respond with the welcome message that you add to the response section of this first node.





 Testing the start node 

You can test your dialog at any time to verify the dialog. Let's test it now.



* Click the ![Try it](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/try-it.png) icon to open the Try it out pane. You should see your welcome message.







 Adding nodes to handle intents 

Now let's add nodes between the Welcome node and the Anything else node that handle our intents.



1. Click the More icon ![More options](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/kebab-grey.png) on the Welcome node, and then select Add node below.
2. In the If assistant recognizes field of this node, start to type General_Greetings. Then, select the General_Greetings option.
3. Add the response text, Good day to you!



![Adding a general greeting node to the dialog.](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/gs-add-greeting-node.png)



1. Click !