vania-janet/multiturn-rag-retrieval-data huggingface dataset:
You can set an environment variable instead of specifying -i with the following command: $ export KP_INSTANCE_ID=<INSTANCE_ID>.









 kp key-ring create 

Create a key ring within a kp instance.



 Example 

The example shows the use of the CLI plugin to create a key ring in the given instance.

ibmcloud kp key-ring create KEY_RING_ID -i <INSTANCE_ID>





 Required parameters 



* KEY_RING_ID

The alphanumeric reference longer than or equal to 2 characters and fewer than or equal to 100 for the key ring.
* -i, --instance-ID

The IBM Cloud instance ID that identifies your Key Protect instance.

You can set an environment variable instead of specifying -i with the following command: $ export KP_INSTANCE_ID=<INSTANCE_ID>.









 kp key-ring delete 

Delete a key ring within a kp instance.



 Example 

The example shows the use of the CLI plugin to delete a key ring in the given instance.

ibmcloud kp key-ring delete KEY_RING_ID -i <INSTANCE_ID>





 Required parameters 



* KEY_RING_ID

The alphanumeric reference longer than or equal to 2 characters and fewer than or equal to 100 for the key ring.
* -i, --instance-ID

The IBM Cloud instance ID that identifies your Key Protect instance.

You can set an environment variable instead of specifying -i with the following command: $ export KP_INSTANCE_ID=<INSTANCE_ID>.









 kp key rotate 

[Rotate a root key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-rotate-keys) that is stored in your Key Protect service.

When you rotate your root key, you replace the key with a new key material.

If Key Protect created the key (the key was not created with the -k parameter) then Key Protect creates a new key. You cannot specify kp key rotate with the -k parameter.
[More icon](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/kebab.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/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/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/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/close.png).
6. Click the More![More icon](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/kebab.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.]
set security address-book global address-set SERVICE address SL19
set security address-book global address-set SERVICE address SL20
set security screen ids-option untrust-screen icmp ping-death
set security screen ids-option untrust-screen ip source-route-option
set security screen ids-option untrust-screen ip tear-drop
set security screen ids-option untrust-screen tcp syn-flood alarm-threshold 1024
set security screen ids-option untrust-screen tcp syn-flood attack-threshold 200
set security screen ids-option untrust-screen tcp syn-flood source-threshold 1024
set security screen ids-option untrust-screen tcp syn-flood destination-threshold 2048
set security screen ids-option untrust-screen tcp syn-flood queue-size 2000
set security screen ids-option untrust-screen tcp syn-flood timeout 20
set security screen ids-option untrust-screen tcp land
set security policies from-zone trust to-zone trust policy default-permit match source-address any
set security policies from-zone trust to-zone trust policy default-permit match destination-address any
set security policies from-zone trust to-zone trust policy default-permit match application any
set security policies from-zone trust to-zone trust policy default-permit then permit
set security policies from-zone trust to-zone untrust policy default-permit match source-address any
set security policies from-zone trust to-zone untrust policy default-permit match destination-address any
set security policies from-zone trust to-zone untrust policy default-permit match application any
set security policies from-zone trust to-zone untrust policy default-permit then permit
set security zones security-zone trust tcp-rst
set security zones security-zone trust interfaces reth0.0 host-inbound-traffic system-services all
set security zones security-zone untrust screen untrust-screen
set security zones security-zone untrust interfaces reth1.0 host-inbound-traffic system-services all
set interfaces ge-0/0/1 gigether-options redundant-parent reth0
[Edit response](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/edit-slot.png).
2. Click the Options icon ![Advanced response](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/kebab.png), and then select Enable conditional responses.
3. Click the Edit response icon ![Edit response](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/edit-slot.png) next to the response with which you want to associate the context variable.
4. Click the Options icon ![Advanced response](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/kebab.png) in the response section, and then click Open context editor.
5. Add the variable name and value pair to the Variable and Value fields.



![Shows how to access the JSON editor associated with the conditional response for a slot.](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/contextvar-json-slot-multi-response.png)
* To add a context variable that is set or updated after a slot condition is met, complete the following steps:



1. Click the Edit slot icon !
* [Condition syntax details](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overviewdialog-overview-condition-syntax)



For tips on performing more advanced actions in conditions, see [Condition usage tips](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-tipsdialog-tips-condition-usage).



 Condition artifacts 

You can use one or more of the following artifacts in any combination to define a condition:



* Context variable: The node is used if the context variable expression that you specify is true. Use the syntax, $variable_name:value or $variable_name == 'value'.

For node conditions, this artifact type is typically used with an AND or OR operator and another condition value. That's because something in the user input must trigger the node; the context variable value being matched alone is not enough to trigger it. If the user input object sets the context variable value somehow, for example, then the node is triggered.

Do not define a node condition based on the value of a context variable in the same dialog node in which you set the context variable value.

For response conditions, this artifact type can be used alone. You can change the response based on a specific context variable value. For example, $city:Boston checks whether the $city context variable contains the value, Boston. If so, the response is returned.

For more information about context variables, see [Context variables](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-runtime-context).
* Entity: The node is used when any value or synonym for the entity is recognized in the user input. Use the syntax, @entity_name. For example, @city checks whether any of the city names that are defined for the @city entity were detected in the user input. If so, the node or response is processed.

Consider creating a peer node to handle the case where none of the entity's values or synonyms are recognized.

For more information about entities, see [Defining entities](https://cloud.ibm.com/docs/assistant?topic=assistant-entities).
replDocument.setTarget(targetDb);
replDocument.setFilter("mydesigndoc/myfilter");

Map queryParams = new HashMap<>();
queryParams.put("foo", "bar");
queryParams.put("baz", 5);
replDocument.setQueryParams(queryParams);

PutReplicationDocumentOptions replicationDocumentOptions =
new PutReplicationDocumentOptions.Builder()
.docId("repldoc-example")
.replicationDocument(replDocument)
.build();

DocumentResult response =
service.putReplicationDocument(replicationDocumentOptions).execute()
.getResult();

System.out.println(response);

const { CloudantV1 } = require('@ibm-cloud/cloudant');

const service = CloudantV1.newInstance({});

const sourceDb: CloudantV1.ReplicationDatabase = {
url: '<your-source-service-url>/source'
};

const targetDb: CloudantV1.ReplicationDatabase = {
auth: {
iam: {
'api_key': '<your-iam-api-key>'
}
},
url: '<your-target-service-url>/target'
};

const replDocument: CloudantV1.ReplicationDocument = {
id: 'repldoc-example',
filter: 'mydesigndoc/myfilter',
query_params: {'foo': 'bar', 'baz': 5},
source: sourceDb,
target: targetDb
}

service.putReplicationDocument({
docId: 'repldoc-example',
If you want to, you can specify a custom confidence level for a condition, for example, intents.size() > 0 && intents[0] == 'help' && intents[0].confidence > 0.1





 Accessing input 

The input JSON object contains one property only: the text property. The text property represents the text of the user input.



 Input property usage examples 

The following example shows how to access input:



* To execute a node if the user input is "Yes", add this expression to the node condition: input.text == 'Yes'



You can use any of the [String methods](https://cloud.ibm.com/docs/assistant/dialog-methodsdialog-methods-strings) to evaluate or manipulate text from the user input. For example:



* To check whether the user input contains "Yes", use: input.text.contains( 'Yes' ).
* Returns true if the user input is a number: input.text.matches( '[0-9]+' ).
* To check whether the input string contains ten characters, use: input.text.length() == 10.
[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 ![Edit response](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/edit-slot.png) next to the response with which you want to associate the context variable.
4. Click the Options icon ![Advanced response](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/kabob.png) in the response section, and then click Open context editor.
5. Add the variable name and value pair to the Variable and Value fields.



![Shows how to access the JSON editor associated with the conditional response for a slot.](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/contextvar-json-slot-multi-response.png)
* To add a context variable that is set or updated after a slot condition is met, complete the following steps:



1. Click the Edit slot icon !
* [Condition syntax details](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-overviewdialog-overview-condition-syntax)



For tips on performing more advanced actions in conditions, see [Condition usage tips](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-tipsdialog-tips-condition-usage).



 Condition artifacts 

You can use one or more of the following artifacts in any combination to define a condition:



* Context variable: The node is used if the context variable expression that you specify is true. Use the syntax, $variable_name:value or $variable_name == 'value'.

For node conditions, this artifact type is typically used with an AND or OR operator and another condition value. That's because something in the user input must trigger the node; the context variable value being matched alone is not enough to trigger it. If the user input object sets the context variable value somehow, for example, then the node is triggered.

Do not define a node condition based on the value of a context variable in the same dialog node in which you set the context variable value.

For response conditions, this artifact type can be used alone. You can change the response based on a specific context variable value. For example, $city:Boston checks whether the $city context variable contains the value, Boston. If so, the response is returned.

For more information about context variables, see [Context variables](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-runtime-contextdialog-runtime-context-variables).
* Entity: The node is used when any value or synonym for the entity is recognized in the user input. Use the syntax, @entity_name. For example, @city checks whether any of the city names that are defined for the @city entity were detected in the user input. If so, the node or response is processed.

Consider creating a peer node to handle the case where none of the entity's values or synonyms are recognized.
You need to replace the <...> placeholders with the actual values. For example, "<WORKSPACE_ID" as us-east.workspace.ID1231.

Syntax

[{
"query_type": "workspaces",
"query_condition":
{
"name": "workspace-id",
"value": "<WORKSPACE_ID>",
"description": "string"
},
{
"name": "resource-name",
"value": "<RESOURCE_NAME>",
"description": "string"
}
]
}]

Example

[{
"query_type": "workspaces",
"query_condition":
{
"name": "workspace-id",
"value": "us-east.workspace.ID1231",
"description": "string"
},
{
"name": "resource-name",
"value": "tf00vpc-pubpriv-frontend-vsi",
"description": "string"
}
]
}]

ibmcloud schematics resource-query create --name myquery --type vsi --query-file queries.json





 Using the interactive mode 

Instead of entering your resource query details by using the command options or a payload file, you can use the interactive mode for the command. This mode prompts you to enter the required values to create a resource query in Schematics. You can create resource conditions by using [resource queries](https://cloud.ibm.com/docs/schematics?topic=schematics-inventories-setupsupported-queries).



1. Enter the command to create the resource query without any command options.

ibmcloud schematics resource-query create
2. Enter a name for your resource query and press the return key.
3. Enter the path to your payload file.
Instance policies allow a user with the Manager role to set a policy which is then applied to all of the keys created by Writers or other Managers, unless those Managers overwrite the policy.



 Setting or editing a rotation policy on your instance using the console 

To set an instance policy, navigate to the Instance policies page in the left navigation and locate the Key rotation policy card. If no policy has been set, the button should be Disabled. To set a policy:



1. Click the button to enable the policy.
2. Then, set a rotation interval. Note that you can only set an automatic rotation policy in intervals of 30 days (or one month). If you set three months, for example, the key is rotated every 90 days. If a rotation policy has already been enabled for this instance, simply edit the value to the desired number of months.
3. Click Save.



Your key policy is now set. If no other action is taken, every root key created in Key Protect is issued this policy.

If you only need to edit the policy for a single key, and you are a Manager, the best policy is to change the rotation policy of the key at key creation time.







 Setting a rotation policy at key creation time 

If you are a Manager (or hold an equivalent level of permissions) it is also possible to set the rotation policy for a key during the process of creating a key. Note that it is possible to set a policy at key-creation time whether an instance-level rotation policy exists or not.



 Setting a rotation policy at key creation time using the console 

As shown in [Creating root keys in the console](https://cloud.ibm.com/docs/key-protect?topic=key-protect-create-root-keyscreate-root-key-gui), to create a key, navigate to the Keys page in your instance and click Add to open the key creation side panel. Then, open the Advanced options tab to reveal the Key alias, Key ring, and Rotation policy options.

If you do not see the Rotation policy option, check your level of permissions to ensure you are a Manager.

If an instance-level rotation policy exists, the rotation policy button shows as Enabled.
To store a value in a session variable:



1. From within a step, click Set variable values.
2. Click Set new value.
3. In the Set drop-down list, your choices are:



Set variable values

 Choice Description 

 Session variable The session variable that you want to store the value in. The new value replaces any previous value that is stored. 
 Integration variable The session variable that you want to store the value in. The new value replaces any previous value that is stored. 
 Expression Write an expression directly without first picking a variable. For more information, see [Writing expressions](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-expressions). 
 + New session variable You can create a new session variable, which is added to the list of session variables for the assistant. For more information, see [Creating a session variable](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-manage-infocreate-session-variable). 



4. In the To drop-down list, the choices vary depending on the type of variable you're setting. Possible choices include:



Set variable values

 Choice Description 

 Scalar value by type Set a specific value for each variable type. The choice varies depending on the variable type. For example, for a date variable, the choice is Enter a date, and you can use a date picker to set a date. Other choices appear for Boolean, confirmation, currency, date, free text, number, percentage, and time. 
 Expression Write an expression to define the value for the session variable. For more information about expressions, see [Writing expressions](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-expressions). 
 Action variables Select an action variable to use the value of a customer response in another step. The choices that are listed match the type of variable that you want to set. 
 Session variables Select another session variable to use its value. The choices that are listed match the type of variable that you want to set.
To add a single word/translation pair to a custom model, use the POST /v1/customizations/{customization_id}/words/{word} method. For more information, see [Adding a single word to a custom model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customWordscuWordAdd).
4. To add a speaker model, use the POST /v1/speakers method. For more information, see [Create a speaker model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-createtbe-create-speaker-model).
5. To add a custom prompt to a custom model, use the POST /v1/customizations/{customization_id}/prompts/{prompt_id} method. For more information, see [Add a custom prompt](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-createtbe-create-add-prompt).



You need to re-create your custom models, speaker models, and custom prompts individually. You can add all of your custom entries to a custom model at once, in groups, or one at a time.
For more information, see [Defining a context variable](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-runtime-contextdialog-runtime-context-var-define).

For example, your dialog might ask users for their email addresses. The dialog node condition will contain a condition similar to @contactInfo:email. You can use the following syntax in the dialog node's response section to define a context variable that captures and stores the user's email address text:



Saving a pattern

 Variable Value 

 email <? @contactInfo.literal ?> 



This syntax indicates that you want to find the part of the user input that matches the email pattern and save that subset of text into a context variable named email.



 Capture groups 

For regular expressions, any part of a pattern inside a pair of normal parentheses will be captured as a group. For example, the entity @ContactInfo has a pattern value named fullUSphone that contains three captured groups:



* (d{3}) - US area code
* (d{3}) - Prefix
* (d{4}) - Line number



Grouping can be helpful if, for example, you want your assistant to ask a user for a phone number, and then use only the area code of the provided number in a response.

To assign the user-entered area code as a context variable, use the following syntax in the dialog node's response section to capture the group match:



Saving a capture group

 Variable Value 

 area_code <? @ContactInfo.groups[1] ?> 



For more information about using capture groups in your dialog, see [Storing and recognizing entity pattern groups in input](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-tipsdialog-tips-get-pattern-groups).







 How fuzzy matching works 

Fuzzy matching is available for languages noted in the [Supported languages](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-language-support) topic.

Fuzzy matching has these components:
Remember, this response is only triggered when the user does not provide a valid time value. Click the Edit response![Edit response](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/edit-slot.png) icon.
8. Click the Options![More icon](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/kabob.png) icon, and select Open JSON editor. Add the following context variable definition.

{
"output": {
"text": {
"values": [
"Please specify the time that you want to eat.
The restaurant seats people between 9AM and 9PM."
]
}
},
"context": {
"counter": "<? context['counter'] + 1 ?>"
}
}

This expression adds a 1 to the current counter tally.
9. Click Back, and then click Save.
10. Reopen the @sys-time slot by clicking the Edit slot![Edit slot](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/edit-slot.png) icon.

You will add a second conditional response to the Not found section that checks whether the counter is greater than 1, which indicates that the user has provided an invalid response 3 times previously. In this case, the dialog assigns the time value on the user's behalf to the popular dinner reservation time of 8 PM. Don't worry; the user will have a chance to change the time value when the confirmation slot is triggered. Click Add a response.
11.