vania-janet/multiturn-rag-retrieval-data huggingface dataset:
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. Repeat the previous steps to add more options to the list.

You can add up to 20 options.
5. Add a list introduction in the Title field. The title can ask the user to pick from the list of options.

Some integration channels do not display the title.
6. Optionally, add additional information in the Description field. If specified, the description is displayed after the title and before the option list.



Some integration channels do not display the description.

For example, you can construct a response like this:



Response options

 List title List description Option label User input submitted when clicked 

 Insurance types Which of these items do you want to insure? 
 Boat I want to buy boat insurance 
 Car I want to buy car insurance 
 Home I want to buy home insurance 



* Pause. Add the length of time for the pause to last as a number of milliseconds (ms) to the Duration field.

The value cannot exceed 10,000 ms. Users are typically willing to wait about 8 seconds (8,000 ms) for someone to enter a response. To prevent a typing indicator from being displayed during the pause, choose Off.

Add another response type, such as a text response type, after the pause to clearly denote that the pause is over.



* If you want different follow-up statements to be shown based on whether the user provides the information you need in response to the initial slot prompt, you can edit the slot (by clicking the Edit slot!
In the current release, conditional settings are not applied in the Discovery product user interface.





 Conditional setting examples 

To enable a section by using a boolean condition, use code similar to the following snippet:

<declare type="boolean" name="use_key" initial-value="true" />

<condition name="use_key" enabled="true">
<declare type="string" name="key" hidden="false" />
</condition>

To enable a section by using an enum condition, use code similar to the following snippet:

<declare type="enum" name="type" enum-values="PROXY|BASIC|NTLM" initial-value="BASIC"/>

<condition name="type" in="BASIC|NTLM|PROXY">
</condition>

<condition name="type" in="PROXY">







 Template sections 

Each section includes one <declare /> element for each of its settings.



Template sections

 XPath expression Description 

 /function/@name The name (type) of the crawler. Not a display name for the UI. Cannot contain spaces. 
 /function/prototype/proto-section A section of the configuration. 





 Section: general_settings 

The XPath expression is /function/prototype/proto-section[@section="general_settings"]. It includes common settings for all crawlers, including the following settings:

<declare type="string" name="crawler_name" />
<declare type="string" name="description" />
<declare type="long" name="fetch_interval" initial-value="0" />
<declare type="long" name="number_of_max_threads" initial-value="10" />
<declare type="long" name="number_of_max_documents" initial-value="2000000000" />
<declare type="long" name="max_page_length" initial-value="32768" />
To define a node that triggers based on more than one condition, enter one condition, and then click the plus sign (+) icon next to it. If you want to apply an OR operator to the multiple conditions instead of AND, click the and that is displayed between the fields to change the operator type. AND operations are executed before OR operations, but you can change the order by using parentheses. For example: $isMember:true AND ($memberlevel:silver OR $memberlevel:gold)

The condition you define must be less than 2,048 characters in length.

For more information about how to test for values in conditions, see [Conditions](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overviewdialog-overview-conditions).
5. Optional: If you want to collect multiple pieces of information from the user in this node, then click Customize and enable Slots. See [Gathering information with slots](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-slots) for more details.
6. Enter a response.



* Add the text or multimedia elements that you want your assistant to display to the user as a response.
* If you want to define different responses based on certain conditions, then click Customize and enable Multiple responses.
* For information about conditional responses, rich responses, or how to add variety to responses, see [Responses](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overviewdialog-overview-responses).



7. Specify what to do after the current node is processed. You can choose from the following options:



* Wait for user input: Your assistant pauses until new input is provided by the user.
* Skip user input: Your assistant jumps directly to the first child node. This option is only available if the current node has at least one child node.
* Jump to: Your assistant continues the dialog by processing the node you specify. You can choose whether your assistant should evaluate the target node's condition or skip directly to the target node's response.
[More icon](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/kabob.png) menu in the Configure slot 4 header, select Enable conditional responses.
3. In the Found prompt, add a condition that checks for a No response (no). Use the response, Alright. Let's start over. I'll try to keep up this time. Otherwise, you can assume the user confirmed the reservation details and proceed with making the reservation.

When the no intent is found, you also must reset the context variables that you saved earlier to null, so you can ask for the information again. You can reset the context variable values by using the JSON editor. Click the Edit response![Edit response](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/edit-slot.png) icon for the conditional response you just added. From the Options![Advanced response](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/kabob.png) menu, click Open JSON editor. Add a context block that sets the slot context variables to null, as shown.

{
"output":{
"text": {
"values": [
"Alright. Let's start over. I'll try to keep up this time."
]
}
},
"context":{
"date": null,
"time": null,
"guests": null
}
}
4. Click Back, and then click Save.
5. Click the Edit slot!
This is useful for confirming information the customer has provided (for example, You want to transfer $153.14 to your checking account. Is that correct?), and for simply personalizing the conversation to make it more human (Hi, John. How can I help you today?).

To reference a variable in what your assistant says:



1. In the Assistant says field, start typing the text for the response.
2. When you reach a point where you want to insert a reference to a variable, type a dollar sign ($) or click the Insert a variable icon (![Insert a variable icon](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/action-variable-icon.png)). A list appears showing the variables you can choose from.
3. Click a variable to add a reference to it in the text.



When you reference a variable, it appears using a default format in your assistant's response. The format of the variable might differ from the way the value is stored; for example, a date value of 2021-08-11 is formatted as August 11, 2021 by default.

The default formats are as follows:



Default formats for variables

 Type Format Examples 

 Options As chosen by the user YesNo 
 Number Numerals only 1000 
 Date Mmm DD, YYYY Jun 30, 2021 
 Time H:MM:SS AM 5:15:00 PM 
 Currency Number only, no currency symbol 20 
 Percent Number only, no percentage symbol 20 
 Free text As entered by the user Please check that the apples aren't bruised 



When building an assistant response that includes variables, you concatenate multiple parts (text strings and variables). A single response can consist of no more than 30 concatenated parts (for example, 15 variables along with 15 text strings).



 Referencing expressions 

If you need to reference a dynamic value that is calculated using an expression, you must first assign this value to a session variable.
You must move this response so it comes before the original conditional response or it will never be triggered. Click the response you just added, and use the up arrow to move it up, and then click Save.
13. Test your changes by using the following script.





 Speaker Utterance 

 You i want to make a reservation 
 Watson I can make a reservation for you. Just tell me the day and time of the reservation, and how many people it is for. 
 You tomorrow 
 Watson Friday, December 29 it is. What time do you want the reservation to be made for? 
 You orange 
 Watson Please specify the time that you want to eat. The restaurant seats people between 9AM and 9PM. 
 You pink 
 Watson Please specify the time that you want to eat. The restaurant seats people between 9AM and 9PM. 
 You purple 
 Watson You seem to be having trouble choosing a time. I will make the reservation at 8PM for you. How many people will be dining? 







 Step 9: Connect to an external service 

Now that your dialog can collect and confirm a user's reservation details, you can call an external service to actually reserve a table in the restaurant's system or through a multi-restaurant online reservations service. See [Making programmatic calls from a dialog node](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-webhooks) for more details.

In the logic that calls the reservation service, be sure to check for has_skipped_slots and do not continue with the reservation if it is present.



 Summary 

In this tutorial you tested a node with slots and made changes that optimize how it interacts with real users. For more information about this subject, see [Gathering information with slots](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-slots).







 Next steps 

Deploy your dialog skill by first connecting it to an assistant, and then deploying the assistant. There are several ways you can do this.
Do not set a value in the first context variable in the list and expect to be able to use it in the second variable in the list, because there is no guarantee that the first context variable will be executed before the second one. For example, do not use two context variables to implement logic that checks whether the user input contains the word Yes in it.



Using two variables to get a value from user input

 Variable Value 

 user_input <? input.text ?> 
 contains_yes <? $user_input.contains('Yes') ?> 



Instead, use a slightly more complex expression to avoid having to rely on the value of the first variable in your list (user_input) being evaluated before the second variable (contains_yes) is evaluated.



Combining two variables into one

 Variable Value 

 contains_yes <? input.text.contains('Yes') ?> 







 Adding context variables to a node with slots 

For more information about slots, see [Gathering information with slots](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-slots).



1. Open the node with slots in the edit view.



* To add a context variable that is processed after a response condition for a slot is met, perform the following steps:



1. Click the Edit slot icon ![Edit response](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/edit-slot.png).
2. Click the Options icon ![Advanced response](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/kabob.png), and then select Enable conditional responses.
3. Click the Edit response icon !
For example, in a cURL request, you must set the servicekey header as follows:

-H "servicekey: <SERVICE_KEY>"





 Body parameters 

The following fields are body parameters that you can set in the API request:



 name (string) 

Specifies the name of the view.

The following table indicates when the name parameter is required:



Table 2. Required status per method

 Action Request Field required 

 Create a preset POST ![Check mark icon](https://cloud.ibm.com/docs-content/v1/content/f61dbc5d84bf0c89e477a05cab04c72f429e1b7a/log-analysis/alerts/images/checkmark-icon.svg) 
 Modify an existing preset PUT ![Check mark icon](https://cloud.ibm.com/docs-content/v1/content/f61dbc5d84bf0c89e477a05cab04c72f429e1b7a/log-analysis/alerts/images/checkmark-icon.svg) 
 Get preset information GET 
 Delete a preset DELETE 







 channels (array of objects) 

Specifies the notification channels configuration associated with the preset.

The following values can be specifed for all channels.



Channel configuration values for all preset types

 Value Description 

 integration The integration type. Valid values are: slack, email, webhook, pagerduty, pagerduty-auto-resolve, and sysdig. 
 immediate Specified if the alert is sent immediately after the line criteria is met ("immediate": true) or after the line and time criteria is met ("immediate": false). 
 triggerlimit The number of matching log lines to trigger the alert. 
 triggerinterval The amount of time to look for the number of matching log lines.
When you're finished accepting recommendations, click the X to close the recommendations panel.



4. If you want your assistant to recognize terms with syntax that is similar to the entity value and synonyms you specify, but without requiring an exact match, set the Fuzzy Matching switch to On.

For example, if you add apple as a value for a @fruit entity, and a user enters apples or appel, if fuzzy matching is enabled, your assistant will recognize the word as a @fruit mention. For more information, see [How fuzzy matching works](https://cloud.ibm.com/docs/assistant?topic=assistant-entitiesentities-fuzzy-matching).
5. Click Add value and repeat the process to add more entity values.

If you are adding many values, one after another, press Shift+Enter to finish adding the current value, and keep focus in the value field so you can add the next value.
6. After you add the entity values, click ![Close arrow](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/close_arrow.png) to finish creating the entity.



The entity you created is added, and the system begins to train itself on the new data.



 Adding entities that recognize patterns 

You can create an entity that looks for patterns in user input. For example, you can look for mentions of an email address by looking for occurrences of the pattern {word}+@+{word}+.com. Or, you might have product order numbers that follow a very specific format, such as TWEX3433JKL. You can create a pattern to look for strings with that syntax in the user utterance.

To add an entity that recognizes a pattern:



1. Follow the standard procedure to create a dictionary-based entity, but select Patterns from the Type drop-down menu instead of Synonyms.

!
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.
* 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. (A current limitation applies a 64-character limit, but is being addressed.)

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. Repeat the previous steps to add more options to the list.

You can add up to 20 options.
5. Add a list introduction in the Title field. The title can ask the user to pick from the list of options.

Some integration channels do not display the title.
6. Optionally, add additional information in the Description field. If specified, the description is displayed after the title and before the option list.



Some integration channels do not display the description.

For example, you can construct a response like this:



Response options

 List title List description Option label User input submitted when clicked 

 Insurance types Which of these items do you want to insure? 
 Boat I want to buy boat insurance 
 Car I want to buy car insurance 
 Home I want to buy home insurance 



* Pause. Add the length of time for the pause to last as a number of milliseconds (ms) to the Duration field.

The value cannot exceed 10,000 ms. Users are typically willing to wait about 8 seconds (8,000 ms) for someone to enter a response. To prevent a typing indicator from being displayed during the pause, choose Off.

Add another response type, such as a text response type, after the pause to clearly denote that the pause is over.
Mark the checkboxes to configure the values and click Save. For the purposes of this tutorial, configure each parameter as described in the following table.





Table 1. Deployment values for a virtual server image

 Parameter Description Required for users to specify? Hidden from users? 

 crn The Power Systems Virtual Server CRN True False 
 instance_name The name of the virtual server instance. True False 
 memory The amount of memory that you want to assign to your instance in gigabytes. False False 
 network_name The network ID or name to assign to the instance, as defined for the selected Power Systems Virtual Server CRN. True False 
 processor_type The type of processor mode in which the VM will run. Specify shared, capped, or dedicated. False False 
 processors The number of vCPUs to assign to the VM as visible within the guest OS. False False 
 ssh_key_name The name of the public SSH RSA key to use when creating the instance, as defined for the selected Power Systems Virtual Server CRN. True False 
 sys_type The type of system on which to create the VM: s922, e880, e980, e1080, or s1022. False False 



Next, update the configuration type of the crn and processors parameters:



1. From the Deployment values table, select the crn parameter and click Edit.
2. Open the Value details menu and select Power Systems Virtual Server.
3. Click Save.
4. From the Deployment values table, select the processors parameter and click Edit.
5. Open the Value details menu and select float.
6. Click Next.







 Step 4: Edit output value descriptions 

You can improve the descriptions for your Terraform template's output values to help users better understand the purpose of the parameters. The description of any output value that you include in your template can be updated.

To add output values, you need to include them in a new imported version of your Terraform template.

Complete the following steps to edit the product's output value descriptions:



1.
By adding the slot_in_focus property to the condition, a yes or no indicated by the user is applied to this slot only when the user is answering the prompt for this slot specifically.
2. Click the Edit slot![Edit slot](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/edit-slot.png) icon. From the Options![More icon](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/kebab.png) menu in the Configure slot 4 header, select Enable conditional responses.
3. In the Found prompt, add a condition that checks for a No response (no). Use the response, Alright. Let's start over. I'll try to keep up this time. Otherwise, you can assume the user confirmed the reservation details and proceed with making the reservation.

When the no intent is found, you also must reset the context variables that you saved earlier to null, so you can ask for the information again. You can reset the context variable values by using the JSON editor. Click the Edit response![Edit response](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/edit-slot.png) icon for the conditional response you just added. From the Options![Advanced response](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/kebab.png) menu, click Open JSON editor.
`!($time && $guests)` $date it is Move on 



9. Replace the true condition that is specified in the JSON snippet for the last conditional response in the @sys-time slot with !($date && $guests). For example:



Slot 2 conditional response 3 details

 Condition Response Action 

 `!($date && $guests)` Ok, the reservation is for $time. Move on 



10. Replace the true condition that is specified in the JSON snippet for the last conditional response in the @sys-number slot with !($date && $time). For example:



Slot 3 conditional response 2 details

 Condition Response Action 

 `!($date && $time)` Ok. The reservation is for $guests guests. Move on 





If you add more slots later, you must edit these conditions to account for the associated context variables for the additional slots. If you do not include a confirmation slot, you can specify !all_slots_filled only, and it would remain valid no matter how many slots you add later.





 Step 6: Reset the slot context variable values 

You might have noticed that before each test, you must clear the context variable values that were created during the previous test. You must do so because the node with slots only prompts users for information that it considers to be missing. If the slot context variables are all filled with valid values, no prompts are displayed. The same is true for the dialog at run time. You must build into the dialog a mechanism by which you reset the slot context variables to null so that the slots can be filled anew by the next user. To do so, you are going to add a parent node to the node with slots that sets the context variables to null.



1. From the tree view of the dialog, click the More!