vania-janet/multiturn-rag-retrieval-data huggingface dataset:
For more information about the Prompt for everything checkbox, see [Asking for everything at once](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-slotsdialog-slots-prompt-for-everything).
4. Add a slot for each unit of required information.

For each slot, specify these details:



* Check for: Identify the type of information you want to extract from the user's response to the slot prompt. In most cases, you check for entity values. In fact, the condition builder that is displayed suggests entities that you can check for. However, you can also check for an intent; just type the intent name into the field. You can use AND and OR operators here to define more complex conditions.

The Check for value is first used as a condition, but then becomes the value of the context variable that you name in the Save it as field. It specifies both what to check for and what to save. If you want to change how the value is saved, then add the expression that reformats the value to the Save it as field.

For example, if the entity is a pattern entity, such as @email, then after adding the entity name, append .literal to it. Adding .literal indicates that you want to capture the exact text that was entered by the user and was identified as an email address based on its pattern.

In some cases, you might want to use an expression to capture the value, but not apply the expression to what is saved. In such cases, you can use one value in the Check for field to capture the value, and then open the JSON editor to change the value of the context variable, so it saves something else.

Any edit you make to a slot's context variable value in the JSON editor is not reflected in the Check for field after you exit the JSON editor. You must reopen the JSON editor to see what will be saved as the context variable value.

Avoid checking for context variable values in the Check for field. Because the value you check for is also the value that is saved, using a context variable in the condition can lead to unexpected behavior.
1. In the browser URL field, enter about:config. If you are shown a warning from Firefox, click the action to disregard the warning and continue. For information about editing about:config properties, see [http://kb.mozillazine.org/About:config_entries](http://kb.mozillazine.org/About:config_entries).
2. Type bidi in the search filter field.
3. Select the bidi.numeral property, which controls how numerals are displayed, and press Enter.
4. Change the value of this property as required. For example, enter 3 and then click OK.



* 0: Nominal numerals (the default value)
* 1: Regular context numerals
* 2: Hindi context numerals
* 3: Arabic numerals
* 4: Hindi numerals



> Important: When the bidi.numeral property is used, Firefox completely ignores the code point of specific digit characters in the content of a web page.





 Related reference 

[Language support](https://cloud.ibm.com/docs/watson-knowledge-studio?topic=watson-knowledge-studio-language-support)
For example, "Your account balance is $500" contains variable data: namely, "$500," which is a variable value that changes depending on a user's account balance. In this case, the prompt needs to speak "Your account balance is," and a second synthesis request needs to say the balance.
* Escape XML sensitive characters (double quotes, single quotes, ampersands, angle brackets, and slashes) that appear in the text of a prompt by applying the same rules that you use to provide text for a synthesis request. For more information, see [Escaping XML control characters](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-usingHTTPescape).
* You can include SSML elements in the text of a prompt. For example, the pronunciation of words such as read or input that includes things like dates or numbers might be ambiguous. You might need to tell the service how to pronounce such words so that it knows for certain how to synchronize the input text with the audio. In most cases, however, the mapping of the phonemes and the text is obvious.

For example, the SSML <say-as> element is used to indicate how the services says numbers, letters, and dates. This example directs the service to speak the individual digits of the value 123456 rather than to speak the value as a quantity in the hundreds of thousands:

<speak version="1.1">
<say-as interpret-as="digits">123456</say-as>
</speak>

For more information, see [SSML elements](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-elements) and [The say-as element](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-elementssay-as_element).







 Rules for prompt audio 

For the spoken audio of a prompt:



* The audio must be in WAV format and must have a minimum sampling rate of 16 kHz. The service accepts audio with higher sampling rates, which it transcodes to 16 kHz before processing it.
From the Output value descriptions section, provide a new description for the parameter that you want to update.
3. Click Next.







 Step 6: Define IAM access 

After you configure your deployment values, you can add the service access and platform access roles that are required to install your product.

Use the following steps to define your product's access:



1. Click Configure version > Next > Next.
2. Click Add.
3. Select the service and the required service and platform access.



* The service access role allows access for using the service and performing service API calls.
* The platform access role enables actions to be performed on platform resources, such as creating an instance, connecting instances to apps, and assigning user access.



4. Click Save.



The following table lists the string comparison operators that you can use to build access policies with /v2/policies syntax. For more information about each version, see [Comparing /v1/policies and /v2/policies syntax](https://cloud.ibm.com/docs/account?topic=account-known-issuescompare-syntax).



Table 3. The string comparison operators available for conditions in access policies.

 Operator Description 

 stringEquals Case-sensitive string comparison. Boolean or number values are converted into a string before comparison. 
 stringMatch Case-sensitive string match is performed between the pattern and the target string by using either an asterisk (), question mark (?), or both. An asterisk () represents any sequence of zero or more characters in the string, and a question mark (?) represents any single character. You can also express an asterisk * and question mark ? as a literal value by enclosing each within two sets of curly brackets {{}}. 
 stringExists String must be present but can have any none zero value. 
 stringEqualsAnyOf Case-sensitive exact string matching any of the strings in an array of strings. 
 stringMatchAnyOf Case-sensitive string matching any of the strings in an array of strings.
In this example, your assistant asks for the pizza size. It lets the user answer the question incorrectly 3 times before applying a size (medium) to the variable for the user. (You can include a confirmation slot where users can always correct the size when they are asked to confirm the order information.)

Check for: @size Save as: $size Not found catchall condition:

{
"output": {
"text": {
"values": [
"What size did you want? We have small, medium, and large."
],
"selection_policy": "sequential"
}
},
"context": {
"counter": "<? context['counter'] + 1 ?>"
}
}

To respond differently after 3 attempts, add another Not found condition like this:

{
"conditions": "$counter > 1",
"output": {
"text": {
"values": [
"We will bring you a size medium pizza."
]
}
},
"context": {
"size": "medium"
}

This Not found condition is more precise than the Not found catchall condition, which defaults to true. Therefore, you must move this response so it comes before the original conditional response or it will never be triggered. Select the conditional response and use the up arrow to move it up.





 Preventing a Found response from displaying when it is not needed 

If you specify Found responses for multiple slots, then if a user provides values for multiple slots at once, the Found response for at least one of the slots will be displayed. You probably want either the Found response for all of them or none of them to be returned.

To prevent Found responses from being displayed, you can do one of the following things to each Found response:



* Add a condition to the response that prevents it from being displayed if particular slots are filled. For example, you can add a condition, like !($size && $time), that prevents the response from being displayed if the $size and $time context variables are both provided.
When configuring dynamically from Watson Assistant using the configure command, note that only the root level fields, such as narrowband or broadband, are updated. If these fields are omitted from the command, the original configuration settings persist. You can use the update_strategy values merge and merge_once to merge configuration parameters with the existing configuration.





 Using a custom language model 

When you set up the phone integration, you can configure the integration to use a custom language model all the time. However, you might want to use a standard language model most of the time, and specify a custom language model to use only for specific topics that your assistant is designed to help customers with. For example, you might want to use a custom model that specializes in medical terms for a dialog branch that helps with medical bills only. You can apply a custom language model for a specific dialog node or action step.

For more information, about custom language models, see [Creating a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageCreate).

To apply a custom language model to a specific dialog node or action step, use the speech_to_text command.

{
"output": {
"generic": [
{
"response_type": "speech_to_text",
"command_info": {
"type": "configure",
"parameters": {
"narrowband_recognize": {
"x-watson-learning-opt-out": true,
"model": "en-US_NarrowbandModel",
"profanity_filter": true,
"smart_formatting": true,
"language_customization_id": "81d3630-ba58-11e7-aa4b-41bcd3f6f24d",
"acoustic_customization_id": "e4766090-ba51-11e7-be33-99bd3ac8fa93"
}
}
}
}
]
}
}
If you're using multiple conditioned responses, you must click the Customize response icon ![gear icon](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/customize-response-icon.png) to see the menu that is associated with the response.
* Click Open context editor.

![Shows the Open context editor menu option selected from the list](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/open-context-editor.png)
* Add the following variable name and value to define the context variable:



Special containment context variable

 Variable Value 

 `context_connect_to_agent` `true` 



* Click X to close the dialog node. Your change is saved automatically.

If you're using multiple conditioned responses, you must click Save first.





To track containment for your assistant, go to the Analytics page. For more information, see [Metrics overview](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-logs-overviewlogs-overview-graphs).

Previous topic:[Dialog building tips](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-tips)

Next topic:[Correcting user input](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-runtime-spell-check)
* [Order of operation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-runtime-contextdialog-runtime-context-order-of-ops)
* [Adding context variables to a node with slots](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-runtime-contextdialog-runtime-context-var-slots)





 Passing context from the application 

Pass information from the application to the dialog by setting a context variable and passing the context variable to the dialog.

For example, your application can set a $time_of_day context variable, and pass it to the dialog which can use the information to tailor the greeting it displays to the user.

![Shows a Welcome node that uses response conditions to check for the value of the $time_of_day context variable that is passed to the dialog from the application.](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/set-context.png)

In this example, the dialog knows that the application sets the variable to one of these values: morning, afternoon, or evening. It can check for each value, and depending on which value is present, return the appropriate greeting. If the variable is not passed or has a value that does not match one of the expected values, then a more generic greeting is displayed to the user.





 Passing context from node to node 

The dialog can also add context variables to pass information from one node to another or to update the values of context variables. As the dialog asks for and gets information from the user, it can keep track of the information and reference it later in the conversation.

For example, in one node you might ask users for their name, and in a later node address them by name.

![Shows an introductions node that asks the user for their name, and stores it as a context variable. The next node refers to the user by name by using the $username context variable.]
See [Context variables](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-runtime-contextdialog-runtime-context-variables) for more information about how to store information collected from the user.

![Shows a node that shows a user ask, Where are you located, and the dialog has three different responses depending on conditions that use info from the $state context variable to specify locations in those states.](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/multiple-responses.png)

This single node now provides the equivalent function of four separate nodes.

To add conditional responses to a node, complete the following steps:



1. Click Customize, and then click the Multiple responses toggle to turn it On.

The node response section changes to show a pair of condition and response fields. You can add a condition and a response into them.
2. To customize a response further, click the Edit response![Edit response](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/edit-slot.png) icon next to the response.

You must open the response for editing to complete the following tasks:



* Update context. To change the value of a context variable when the response is triggered, specify the context value in the context editor. You update context for each individual conditional response; there is no common context editor or JSON editor for all conditional responses.
* Add rich responses. To add more than one text response or to add response types other than text responses to a single conditional response, you must open the edit response view.
* Configure a jump. To instruct your assistant to jump to a different node after this conditional response is processed, select Jump to from the And finally section of the response edit view.
void setAttribute(@NonNull String name, @NonNull String value, UserAttributeResponseListener listener);
void setAttribute(@NonNull String name, @NonNull String value, @NonNull AccessToken accessToken, UserAttributeResponseListener listener);

void getAttribute(@NonNull String name, UserAttributeResponseListener listener);
void getAttribute(@NonNull String name, @NonNull AccessToken accessToken, UserAttributeResponseListener listener);

void deleteAttribute(@NonNull String name, UserAttributeResponseListener listener);
void deleteAttribute(@NonNull String name, @NonNull AccessToken accessToken, UserAttributeResponseListener listener);

void getAllAttributes(@NonNull UserAttributeResponseListener listener);
void getAllAttributes(@NonNull AccessToken accessToken, @NonNull UserAttributeResponseListener listener);

const userProfileManager = require("ibmcloud-appid").UserProfileManager;
userProfileManager.init();
var accessToken = req.session[WebAppStrategy.AUTH_CONTEXT].accessToken;

// get all attributes
userProfileManager.getAllAttributes(accessToken).then(function (attributes) {

});

// get single attribute
userProfileManager.getAttribute(accessToken, name).then(function (attributes) {

});

// set attribute value
userProfileManager.setAttribute(accessToken, name, value).then(function (attributes) {

});

// delete attribute
[More icon](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/kabob.png) icon next to the node response, and then click Open JSON editor. Add an entry for each slot context variable that you defined in the node with slots, and set it equal to null.

{
"context": {
"date": null,
"time": null,
"guests": null,
"confirmation": null
},
"output": {}
}

![Shows the dialog tree with two #reservation conditioned nodes and the first one is setting the slot context variables to null](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/slots-adding-parent.png)
4. Click to edit the other #reservation node, the one you created previously and to which you added the slots.
5. Change the node condition from reservation to ($date == null && $time == null), and then close the node edit view by clicking ![Close](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/close.png).
6. Click the More![More icon](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/kabob.png) icon on the node with slots, and then select Move.

![Shows the dialog tree. The user is clicking the Move action on the node with slots.]
Return to the Dialog tab, and then click to edit the node with slots. Click Add slot to add a fourth slot, and then specify the following values for it:



Confirmation slot details

 Check for Save it as If not present, ask 

 `(#yes || #no) && slot_in_focus` $confirmation I'm going to reserve you a table for $guests on $date at $time. Should I go ahead? 



This condition checks for either answer. You will specify what happens next depending on whether the user answer Yes or No by using conditional slot responses. The slot_in_focus property forces the scope of this condition to apply to the current slot only. This setting prevents random statements that could match against a yes or no intent that the user might make from triggering this slot.

For example, the user might be answering the number of guests slot, and say something like, Yes, there will be 5 of us. You do not want the Yes included in this response to accidentally fill the confirmation slot. 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/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/edit-slot.png) icon. From the Options![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.
[Edit response](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/edit-slot.png) icon for the response with which you want to associate the context variable.

![Shows how to access the JSON editor associated with a standard node that has multiple conditional responses enabled for it.](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/contextvar-json-multi-response.png)
3. Add a "context":{} block if one is not present.

{
"context":{},
"output":{}
}
4. In the context block, add a "name" and "value" pair for each context variable that you want to define.

{
"context":{
"name": "value"
},
"output": {}
}

In this example, a variable named new_variable is added to a context block that already contains a variable.

{
"context":{
"existing_variable": "value",
"new_variable":"value"
}
}

To subsequently reference the context variable, use the syntax $name where name is the name of the context variable that you defined. For example, $new_variable.



Learn more:



* [Deleting a context variable in JSON](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-runtime-contextdialog-runtime-context-delete-json)
* [Updating a context variable value in JSON](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-runtime-contextdialog-runtime-context-update-json)
For example, when you use @appliance == 'air conditioner', you are evaluating only the value of the first detected @appliance entity. But, using @appliance:(air conditioner) gets expanded to entity['appliance'].contains('air conditioner'), which matches whenever there is at least one @appliance entity of value 'air conditioner' detected in the user input.







 Condition usage tips 



* Checking for values with special characters: If you want to check whether an entity or context variable contains a value, and the value includes a special character, such as an apostrophe ('), then you must surround the value that you want to check with parentheses. For example, to check if an entity or context variable contains the name O'Reilly, you must surround the name with parentheses.

@person:(O'Reilly) and $person:(O'Reilly)

Your assistant converts these shorthand references into these full SpEL expressions:

entities['person']?.contains('O''Reilly') and context['person'] == 'O''Reilly'

SpEL uses a second apostrophe to escape the single apostrophe in the name.
* Checking for multiple values: If you want to check for more than one value, you can create a condition that uses OR operators (||) to list multiple values in the condition. For example, to define a condition that is true if the context variable $state contains the abbreviations for Massachusetts, Maine, or New Hampshire, you can use this expression:

$state:MA || $state:ME || $state:NH
* Checking for number values: When comparing numbers, first make sure the entity or variable you are checking has a value. If the entity or variable does not have a number value, it is treated as having a null value (0) in a numeric comparison.

For example, you want to check whether a dollar value that a user specified in user input is less than 100. If you use the condition @price < 100, and the @price entity is null, then the condition is evaluated as true because 0 is less than 100, even though the price was never set.