vania-janet/multiturn-rag-retrieval-data huggingface dataset:
[Shows the My first assistant with the My first skill added to it](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/gs-my-first-skill.png)
7. Click the skill you just created to open it.







 Step 4: Add intents from a content catalog 

When you open the My first skill, you land on the Intents page.

![Shows the Intents page of My first skill](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/gs-intents-page.png)

Add training data that was built by IBM to your skill by adding intents from a content catalog. In particular, you will give your assistant access to the General content catalog so your dialog can greet users, and end conversations with them.



1. From the skill menu, click Content Catalog.
2. Find General in the list, and then click Add content.

![Shows the Content Catalog and highlights the Add to skill button for the General catalog.](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/gs-add-content-catalog.png)
3. Open the Intents tab to review the intents and associated example utterances that were added to your training data. You can recognize them because each intent name begins with the prefix General_. You will add the General_Greetings and General_Ending intents to your dialog in the next step.

![Shows the intents that are displayed in the Intents tab after the General catalog is added.]
Do not reuse a context variable that is used elsewhere in the dialog. If the context variable has a value already, then the slot's prompt is not displayed. It is only when the context variable for the slot is null that the prompt for the slot is displayed.
* Prompt: Write a statement that elicits the piece of the information you need from the user. After displaying this prompt, the conversation pauses and your assistant waits for the user to respond.

If you want the prompt to be something other than a text response, you can change the response type by clicking the Edit slot![Edit slot](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/edit-slot.png) icon. Click Text to choose a different response type.

Response type options{: #dialog-slots-response-types}:



* Image. Add the full URL to the hosted image file into the Image source field. The image must be in .jpg, .gif, or .png format. The image file must be stored in a location that is publicly addressable by URL.

For example: https://www.example.com/assets/common/logo.png.

If you want to display an image title and description before the embedded image in the response, then add them in the fields provided.

Slack integrations require a title. Other integration channels ignore titles or descriptions.
* Option. Complete the following steps:



1. Click Add option.
2. In the List label field, enter the option to display in the list. The label must be less than 2,048 characters in length.
3. In the corresponding Value field, enter the user input to pass to your assistant when this option is selected. The value must be less than 2,048 characters in length.

Specify a value that you know will trigger the correct intent when it is submitted. For example, it might be a user example from the training data for the intent.
4.
2. Try again to upload the edited skill into the original service instance on the plan you want.









 Adding the skill to an assistant 

You can add one dialog skill to an assistant. You must open the assistant tile and add the skill to the assistant from the assistant configuration page; you cannot choose the assistant that will use the skill from within the skill configuration page. One dialog skill can be used by more than one assistant.



1. From the Assistants page, click to open the tile for the assistant to which you want to add the skill.
2. Click Add an actions or dialog skill.
3. Click Add existing skill.

Click the skill that you want to add from the available skills that are displayed.



When you add a dialog skill from here, you get the development version. If you want to add a specific skill version, add it from the skill's Versions page instead.







 Sharing a dialog skill with team members 

After you create the service instance, you can give other people access to it. Together, you can define the training data and build the dialog.

Only one person can edit an intent, entity, or a dialog node at a time. If multiple people work on the same item at the same time, then the changes made by the person who saves their changes last are the only changes applied. Changes that are made during the same time frame by someone else and are saved first are not retained. Coordinate the updates that you plan to make with your team members to prevent anyone from losing their work.

To share a dialog skill with other people, you must give them access to the service instance that hosts the skill. Note that the person you invite will be able to access any skill or assistant in this service instance.



1. Click the User ![User](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/user-icon2.png) icon in the page header.
2.
instance.updateHomeScreenConfig({
is_on: true,
greeting: 'What can I tell you about credit cards?',
starters: {
is_on: true,
buttons: [
{ label: 'Card interest rates' },
{ label: 'Cards with rewards' },
{ label: 'Business cards' }
]
}
});



For complete working code, see the [Change launcher and home screen text for Watson Assistant web chat](https://github.com/watson-developer-cloud/assistant-toolkit/tree/master/integrations/webchat/examples/change-launcher-and-home-screen-text) example.
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.

For example, this header indicates that the request is in JSON format.



Header example

 Header name Header value 

 Content-Type application/json 



5. If the external service requires that you pass basic authentication credentials with the request, then provide them. Click Add authorization, add your credentials to the User name and Password fields, and then click Save.

The product creates a base-64 encoded ASCII string from the credentials and generates a header that it adds to the page for you.



Header example

 Header name Header value 

 Authorization Basic ` ` 



If you use the web chat integration and enable security, you can use the same token you use to secure the web chat in the Authorization header. For more information, see [Web chat: Reusing the JWT for webhook authentication](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-integrationsdialog-integrations-chat-jwt).



Your webhook details are saved automatically.





 Adding a webhook callout to a dialog node 

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.
For more information, see [Updating endpoint URLs from watsonplatform.net](https://cloud.ibm.com/docs/watson?topic=watson-endpoint-change).



* If your service instance API credentials show the old endpoint, create a new credential and start using it today. After you update your custom applications to use the new credential, you can delete the old one.
* For a web chat integration, you might need to take action depending on when and how you created your integration.



* If you tied your deployment to a specific web chat version by using the clientVersion parameter and specified a version earlier than version 3.3.0, update the parameter value to use version 3.3.0 or later. Web chat integrations that use the latest or 3.3.0 and later versions will not be impacted by the endpoint deprecation.
* If you created your web chat integration before May 2020, check the code snippet that you embedded in your web page to see if it refers to watsonplatform.net. If so, you must edit the code snippet to use the new URL syntax. For example, change the following URL:

<script src="https://assistant-web.watsonplatform.net/loadWatsonAssistantChat.js"></script>

The correct syntax to use for the source service URL looks like this:

src="https://web-chat.global.assistant.watson.appdomain.cloud/loadWatsonAssistantChat.js"



* If your web chat integration connects to a Salesforce service desk, then you must edit the API call that is included in the code snippet that you added to the Visualforce Page that you created in Salesforce. From Salesforce, search for Visualforce Pages, and find your page. In the <iframe> snippet that you pasted into the page, make the following change:

Replace: src=“https://assistant-integrations-{location}.watsonplatform.net/public/salesforceweb” with a url with this syntax:
function doDownload() {
const downloadContent = createDownload();

const blob = new Blob([downloadContent], { type: 'text/csv' });
const url = URL.createObjectURL(blob);

// To automatically trigger a download, we have to create a fake "a" element and then click it.
const timestamp = new Date().toISOString().replace(/[_:]/g, '-').replace(/.[0-9][0-9]Z/, '');
const a = document.createElement('a');
a.setAttribute('href', url);
a.setAttribute('download', Chat History ${timestamp}.csv);
a.click();
}
6. In your onLoad event handler, use the [updateCustomMenuOptions()](https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-instance-methodsupdatecustommenuoptions) instance method to add a custom menu option that customers can use to download the conversation history. Add this line immediately before the call to the render() instance method.

instance.updateCustomMenuOptions('bot', [{ text: 'Download history', handler: doDownload }]);



For complete working code, see the [Download history for Watson Assistant web chat](https://github.com/watson-developer-cloud/assistant-toolkit/tree/master/integrations/webchat/examples/download-history) example.
Last, in a new step, ask What is the URL (web address) for the event? and let the customer respond with Free text.
9. Now, to confirm the input, create a new step. Use Is this correct? and as bulleted list show the gathered data. Add an item for Name, Location, Begin, End, and Contact and use Action variables relating to the input steps for the data (see screen capture below). Use Confirmation as customer response type.

Zoom

![Confirmation step](https://cloud.ibm.com/docs-content/v1/content/f84e2238288b7f0355715a4c355609ce7ac48fb0/solution-tutorials/images/solution19/Slackbot_confirmation.png)

Confirmation step
10. Add a new step with the condition the previous confirmation being No. The Assistant could say Ok, let's start over. Set And then to Re-ask previous step(s) and select all previous steps.
11. In a new step, which should be step 8, react to the confirmation being Yes. Under And then select Use an extension. Configure the events extension with Insert a new event record as operation. Match the parameters to the Action variables for the steps, for example, shortname to 1. How do you want to name the event?
12. Create a new step with a condition 8 Ran successfully being true. Let the Assistant say A new record with ID VARIABLE was created. For VARIABLE select 8 body.eid from events (Step 8). End the action under And then.
13. Create a new step with the condition for 8 Ran successfully being false. Use something like It seems there was a problem creating the new event record for the Assistant to say and end the action under And then. Save and close the action with the icons in the upper right.
14. Test the new action by clicking on Preview on the left and using the webchat. Type add new event and submit.
You will need this value in a subsequent step.







 Configuring the phone number 



1. In the navigation menu, click the All Products & Services icon.
2. Click Phone Numbers.
3. Under Manage Numbers, configure the phone number you want your assistant to use. Select Buy a Number to buy a new number, or Port & Host to port an existing phone number.
4. In the Active Numbers list, click the new phone number.
5. Under Voice and Fax, configure the following settings:



* For CONFIGURE WITH field, select Webhook, TwiML Bins, Functions, Studio, or Proxy.
* For A CALL COMES IN, select Studio Flow. Select your flow from the drop-down list.
* For PRIMARY HANDLER FAILS, select Studio Flow. Select your flow from the drop-down list.



6. Go to the Watson Assistant user interface, open the phone integration settings for your assistant.
7. In the Phone number field, type the phone number you configured in Flex Studio.
8. Click Save and exit.







 Test your phone number 

You can now test that your phone number is connected to your flow by triggering a Say/Play widget in the Twilio Flex Flow editor.



1. Drag a Say/Play widget onto your flow canvas.
2. Configure the Say/Play widget with a simple phrase like I'm alive..
3. Connect the Incoming call node on your Trigger widget to your Say/Play widget.
4. Call your phone number. You should hear your Twilio flow respond with your test phrase.
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.
At a minimum, you need a subscription to the Inbox product from Intercom to be able to create a workspace.
3. From the assistant email account you created earlier, find the invitation from Intercom. Click the link in the email to join the team. Sign up using the assistant's functional email address, and then join the team.
4. Optional: Update the profile for your assistant.

You can edit the name and profile picture for your assistant. This profile represents the assistant in private agent communications within your workspace, and in public interactions with customers through your Intercom apps. Create a profile that reflects your brand.

Click the Intercom profile icon in the navigation bar to access profile and workspace settings.

![Screenshot of the Intercom Setting page.](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/intercom-settings.png)







 Preparing the dialog 

If you do not have a dialog skill associated with your assistant, create one or add one to your assistant now. See [Building a dialog](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overview) for more details.

Triggering a search through a search skill is not currently supported from an Intercom integration.

Complete these steps in your dialog skill so the assistant can handle user requests, and can pass the conversation to a human agent when a customer asks for one.



1. Add an intent to your skill that can recognize a user's request to speak to a human.

You can create your own intent or add the prebuilt intent named General_Connect_to_Agent that is provided with the General content catalog developed by IBM.
2. Add a root node to your dialog that conditions on the intent that you created in the previous step. Choose Connect to human agent as the response type.
3. Prepare each dialog branch to be triggered by the assistant from the Intercom app.
Do not add more than one option response type to a single dialog node because both lists are displayed at once, but the customer can choose an option from only one of them.
3. If you added more than one response type, you can click the Move up or down arrows to arrange the response types in the order you want your assistant to process them.







 Adding a Connect to human agent response type 

If your client application is able to transfer a conversation to a person, such as a customer support agent, then you can add a Connect to human agent response type to initiate the transfer. Some of the built-in integrations, such as web chat and Intercom, support making transfers to service desk agents. If you are using a custom application, you must program the application to recognize when this response type is triggered.

If you want to take advantage of the containment metric to track your assistant's success rate, add this response type to your dialog or use an alternate method to identify when customers are directed to outside support. For more information, see [Measuring containment](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-supportdialog-support-containment).

To add a Connect to human agent response type, complete the following steps:



1. From the dialog node where you want to add the response type, click the dropdown menu in the Assistant responds field, and then choose Connect to human agent.
2. Optional. Add a message to share with the human agent to whom the conversation is transferred in the Message to human agent field.
3. Add a message to show to the customer to explain that they are being transferred.

You can add a message to show when agents are available and a message to show when agents are unavailable. Each message can be up to 320 characters in length.

Web chat built-in service desk integrations only: The text you add to the Response when agents are online and Response when no agents are online fields is used for transfers in web chat version 3 and later. If you don't add your own messages, the hint text (the grayed out text that is displayed as the example messages) is used.
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/cbb80bf851fb762a838129cba09d5674f8bfffda/Registry/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/cbb80bf851fb762a838129cba09d5674f8bfffda/Registry/includes/solution-tutorials/includes/solution-tutorials/images/solution21/toolchain_slack.png)

Toolchain with new Slack integration
8.
Adding a dialog skill 

The natural-language processing for the Watson Assistant service is defined in a dialog skill, which is a container for all of the artifacts that define a conversation flow.

You can add one dialog skill to an assistant.



 Create the dialog skill 

You can create a skill from scratch, use a sample skill that is provided by IBM, or import a skill from a JSON file.

To add a skill, complete the following steps:



1. Click the Skills icon ![Skills menu icon](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/nav-skills-icon.png).

v1.3: Click the Skills tab. If you don't see the Skills tab, click the breadcrumb link in the page header.
2. Click Create skill.
3. Select the dialog skill option, and then click Next.
4. Take one of the following actions:



* To create a skill from scratch, click Create skill.
* To add a sample skill that is provided with the product as a starting point for your own skill or as an example to explore before you create one yourself, click Use sample skill, and then click the sample you want to use.

The sample skill is added to your list of skills. It is not associated with any assistants. Skip the remaining steps in this procedure.
* To add an existing skill to this service instance, you can import it as a JSON file. Click Import skill, and then click Choose JSON File, and select the JSON file you want to import.

Important:



* The imported JSON file must use UTF-8 encoding, without byte order mark (BOM) encoding.
* The maximum size for a skill JSON file is 10MB. If you need to import a larger skill, consider importing the intents and entities separately after you have imported the skill. (You can also import larger skills using the REST API.
For more information, see [Transfer a call to a human agent](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-voice-actionsdialog-voice-actions-transfer).





 Optimize your dialog for voice 

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



* Do not include HTML elements in your dialog text responses. To add formatting, use Markdown. For more information, see [Simple text response](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overviewdialog-overview-simple-text).
* Use the Connect to human agent response type to initiate a transfer to a human agent. For more information, see [Transferring a call to a human agent](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-voice-actionsdialog-voice-actions-transfer).
* Use the Channel transfer response type to initiate a transfer to the web chat integration. For more information, see [Transferring the caller to the web chat integration](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-voice-actionsdialog-voice-actions-transfer-channel).
* The pause response type is not supported. If you want to add a pause, use the turn_settings.timeout_count context variable (for more information, see [Context variables that are set by your dialog or actions](https://cloud.ibm.com/docs/assistant?topic=assistant-phone-contextphone-context-variables-set-by-dialog)).
* You can include search skill response types in dialog nodes that the phone integration will read. The introductory message (I searched my knowledge base and so on), and then the body of only the first search result is read.

The search skill response (meaning the introductory message plus the body of the first search result) must be less than 5,000 characters long or the response will not be read at all. Be sure to test the search results that are returned and curate the data collection that you use as necessary.