vania-janet/multiturn-rag-retrieval-data huggingface dataset:
Manage Wason Knowledge Catalog(WKC) policy enforcement status.



 ibmcloud watson-query policy-status-update 

Turn on WKC policy enforcement status.

ibmcloud watson-query policy-status-update --status STATUS



 Command options 

--status (string)
: Set the status of WKC policy - can be 'enable' or 'disable'. Required.





 Examples 

Turn on or off WKC policy enforcement status

ibmcloud watson-query policy-status-update --enable







 ibmcloud watson-query policy-status 

Get WKC policy enforcement status, return enabled or disabled.

ibmcloud watson-query policy-status



 Examples 

Get WKC policy enforcement status

ibmcloud watson-query policy-status









 Virtualization 

Create virtualized table.



 ibmcloud watson-query virtualized-table-create 

Transform a given data source table into a virtualized table.

ibmcloud watson-query virtualized-table-create --source-table-name SOURCE-NAME --source-table-def-file SOURCE-TABLE-DEF-FILE --sources SOURCES --virtualized-table-name VIRTUALIZED-NAME --virtualized-schema VIRTUALIZED-SCHEMA --virtualized-table-def-file VIRTUALIZED-TABLE-DEF-FILE [--is-included-columns IS-INCLUDED-COLUMNS] [--replace REPLACE]



 Command options 

--source-table-name (string)
: The name of the source table. Required.

--source-table-def-file ([VirtualizeTableSourceTableDefFile](https://cloud.ibm.com/docs/watson-query-cli-plugin?topic=watson-query-cli-plugin-CLI-namecli-virtualize-table-parameter-source-table-def-item-example-schema))
: Required.

--sources ([]string)
: The name of data source. Required.

--virtualized-table-name (string)
: The name of the table that will be virtualized. Required.
For more information, see [Setting the Admin Password](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-admin-password).
* Group Scaling groups represent the various resources that are allocated to a deployment. To see an example for configuring and deploying a database that uses group attributes, see [Sample database instance by using group attributes.](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/databasesample-database-instance-by-using-group-attributes)
* Group values - Memory, disk, and CPU values are all based on minimum requirements for provisioning a Databases for PostgreSQL instance.
* Timeouts - Create, update, and delete values for this resource. ICD create typically takes in the range of 30 - 45 minutes. delete and update typically take 1 minute. Provisioning times are unpredictable. If the deployment fails due to a timeout, import the database resource once the create is complete.







 Step 4: Test your configuration 

Now that you configured the IBM Cloud® Provider plug-in for your resource, you can use Terraform on IBM Cloud® to initialize, run, plan, and apply commands to provision the resource. You need the following commands:



Table 1. Terrarform provisioning commands

 Command Description Command 

 [terraform init](https://www.terraform.io/cli/commands/init) The terraform init command is used to initialize a working directory containing Terraform configuration files. 
 [terraform fmt](https://www.terraform.io/cli/commands/fmt) The terraform fmt command is used to rewrite Terraform configuration files to a canonical format and style. 
 [terraform validate](https://www.terraform.io/cli/commands/validate) The terraform validate command validates the configuration files in a directory
Editing blueprint templates 

Create and customize a blueprint template to deploy the infrastructure for your solution. Templates are written in YAML and can be created and edited in any editor or IDE with YAML language support.

The instructions here outline using [VSCode](https://code.visualstudio.com/) to edit and configure blueprint templates and input files. The [Red Hat YAML VSCode extension](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) provides a framework for editing blueprint YAML files, using a [blueprint schema](https://github.com/Cloud-Schematics/vscode-blueprint-schema) defined using [JSON-Schema](https://json-schema.org).

The YAML language extension and blueprint schema provide:



* Validation of YAML structure and blueprint keywords



* Blueprint specific schema validation



* Autocomplete



* Auto complete for blueprint template keywords and schema sections



* Hover support



* Hovering over a keyword reveals the related schema description and links to Blueprints documentation



* Outlining for complex templates



The following steps outline editing and creating blueprint templates using VSCode and the YAML language extension.



 Configure your VSCode environment 

Install the YAML extension and blueprint schema. Follow the Blueprints YAML language extension and blueprint schema [installation and configuration instructions](https://github.com/Cloud-Schematics/vscode-blueprint-schema).

Schematics Blueprints works with definitions sourced from a version control system. All input files, templates, and modules are all maintained in online Git source control. Optionally [configure VScode](https://code.visualstudio.com/docs/sourcecontrol/overview) for your Git environment.





 Sourcing a blueprint template
"$SERVICE_URL/my-movies/_find" 	-d '{"selector": {"Person_name":"Zoe Saldana"}}'

import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.cloudant.v1.model.FindResult;
import com.ibm.cloud.cloudant.v1.model.PostFindOptions;

import java.util.Collections;
import java.util.Map;

Cloudant service = Cloudant.newInstance();

Map<String, Object> selector = Collections.singletonMap(
"Person_name", "Zoe Saldana");

PostFindOptions findOptions = new PostFindOptions.Builder()
.db("my-movies")
.selector(selector)
.build();

FindResult response =
service.postFind(findOptions).execute()
.getResult();

System.out.println(response);

import { CloudantV1 } from '@ibm-cloud/cloudant';

const service = CloudantV1.newInstance({});

let selector: CloudantV1.JsonObject = {
Person_name: 'Zoe Saldana'
};

service.postFind({
db: 'my-movies',
selector: selector,
}).then(response => {
console.log(response.result);
});

from ibmcloudant.cloudant_v1 import CloudantV1

service = CloudantV1.new_instance()

response = service.post_find(
db='my-movies',
selector={'Person_name': 'Zoe Saldana'}
).get_result()

print(response)

postFindOptions := service.NewPostFindOptions(
"my-movies",
map[string]interface{}{
"Person_name": "Robert De Niro",
"Movie_year": map[string][]interface{}{
"$in": []interface{}{1978, 2009},
},
},
)

findResult, _, err := service.PostFind(postFindOptions)
if err != nil {
panic(err)
}

b, _ := json.MarshalIndent(findResult, "", " ")
fmt.Println(string(b))

The previous Go example requires the following import block:

import (
"encoding/json"
"fmt"
"github.com/IBM/cloudant-go-sdk/cloudantv1"
)

See the following example result from the search:

{
"docs": [
{
"_id": "d9e6a7ae2363d6cfe81af75a392eb9f2",
"_rev": "1-9faa75d7ea524448b1456a6c69a4391a",
"Movie_runtime": 183,
"Movie_rating": "R",
"Person_name": "Robert De Niro",
"Movie_genre": "DW",
"Movie_name": "Deer Hunter, The",
"Person_pob": "New York, New York, USA",
"Movie_year": 1978,
"Person_dob": "1943-08-17"
}
],
"bookmark": "g2w ... c2o"
}
Show more
curl -X GET "$SERVICE_URL/products/_partition/small-appliances/_design/appliances/_view/byApplianceProdId?include_docs=true&limit=10"

import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.cloudant.v1.model.PostPartitionViewOptions;
import com.ibm.cloud.cloudant.v1.model.ViewResult;

Cloudant service = Cloudant.newInstance();

PostPartitionViewOptions viewOptions =
new PostPartitionViewOptions.Builder()
.db("products")
.ddoc("appliances")
.includeDocs(true)
.limit(10)
.partitionKey("small-appliances")
.view("byApplianceProdId")
.build();

ViewResult response =
service.postPartitionView(viewOptions).execute()
.getResult();

System.out.println(response);

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

const service = CloudantV1.newInstance({});

service.postPartitionView({
db: 'products',
ddoc: 'appliances',
includeDocs: true,
limit: 10,
partitionKey: 'small-appliances',
view: 'byApplianceProdId'
}).then(response => {
console.log(response.result);
});

from ibmcloudant.cloudant_v1 import CloudantV1

service = CloudantV1.new_instance()

response = service.post_partition_view(
db='products',
ddoc='appliances',
include_docs=True,
limit=10,
partition_key='small-appliances',
view='byApplianceProdId'
Map<String, Object> selector = new HashMap<>();
selector.put("Person_name", "Robert De Niro");
selector.put("Movie_year", 1978);

PostFindOptions findOptions = new PostFindOptions.Builder()
.db("my-movies")
.selector(selector)
.build();

FindResult response =
service.postFind(findOptions).execute()
.getResult();

System.out.println(response);

import { CloudantV1 } from '@ibm-cloud/cloudant';

const service = CloudantV1.newInstance({});

let selector: CloudantV1.JsonObject = {
Person_name: 'Robert De Niro',
Movie_year: 1978
};

service.postFind({
db: 'my-movies',
selector: selector,
}).then(response => {
console.log(response.result);
});

from ibmcloudant.cloudant_v1 import CloudantV1

service = CloudantV1.new_instance()

response = service.post_find(
db='my-movies',
selector={'Person_name': 'Robert De Niro', 'Movie_year': 1978}
).get_result()

print(response)

postFindOptions := service.NewPostFindOptions(
"my-movies",
map[string]interface{}{
"Person_name": "Robert De Niro",
"Movie_year": 1978,
},
)

findResult, _, err := service.PostFind(postFindOptions)
if err != nil {
panic(err)
}

b, _ := json.MarshalIndent(findResult, "", " ")
const service = CloudantV1.newInstance({});

service.postChanges({
db: 'animaldb',
filter: '_view',
view: 'views101/latin_name'
}).then(response => {
console.log(response.result);
});

from ibmcloudant.cloudant_v1 import CloudantV1

service = CloudantV1.new_instance()

response = service.post_changes(
db='animaldb',
filter='_view',
view='views101/latin_name'
).get_result()

print(response)

postChangesOptions := service.NewPostChangesOptions(
"animaldb",
)
postChangesOptions.SetFilter("_view")
postChangesOptions.SetView("views101/latin_name")

changesResult, _, err := service.PostChanges(postChangesOptions)
if err != nil {
fmt.Println(err)
}

b, _ := json.MarshalIndent(changesResult, "", " ")
fmt.Println(string(b))

See the following example response (abbreviated) after you filter by using a map function:

{
"last_seq": "5-g1A...o5i",
"results": [
{
"changes":
{
"rev": "13-bcb...29e"
}
],
"id": "ExampleID",
"seq": "5-g1A...HaA"
}
]
}









 Update validators 

Design documents with options.partitioned set to true can't contain a validate_doc_update field.

Update validators determine whether a document must be written to disk when insertions and updates are attempted.
selector: {"_id": { "$regex": "^_design/"}},
}).then(response => {
console.log(response.result);
});

from ibmcloudant.cloudant_v1 import CloudantV1

service = CloudantV1.new_instance()

response = service.post_changes(
db='orders',
filter='_selector',
selector={'_id': { '$regex': '^_design/'}}
).get_result()

print(response)

postChangesOptions := service.NewPostChangesOptions(
"$DATABASE",
)
postChangesOptions.SetFilter("_selector")
postChangesOptions.SetSelector(map[string]interface{}{
"_id": map[string]string{ "$regex": "^_design/"}})

changesResult, response, err := service.PostChanges(postChangesOptions)
if err != nil {
panic(err)
}

b, _ := json.MarshalIndent(changesResult, "", " ")
fmt.Println(string(b))

The previous Go example requires the following import block:

import (
"encoding/json"
"fmt"
"github.com/IBM/cloudant-go-sdk/cloudantv1"
)

See the following example JSON document that includes the selector expression to use during filtering:

{
"selector":{
"_id":{
"$regex":"^_design/"
}
}
}

See the following example response (abbreviated) after you filter by using a selector:

{
"last_seq":"11-g1A...OaA",
"pending":0,
"results":[
{
"changes":
"keys" : [
"1000043",
"1000044"
]
}

See the example request to obtain the full content of documents that match the listed keys within the products partition:



* Curl
* Java
* Node
* Python
* Go



curl -X POST "$SERVICE_URL/products/_partition/small-appliances/_design/appliances/_view
/byApplianceProdId" -H "Content-Type: application/json" --data '{
"include_docs": true,
"keys" : [
"1000043",
"1000044"
]
}'

import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.cloudant.v1.model.PostPartitionViewOptions;
import com.ibm.cloud.cloudant.v1.model.ViewResult;

import java.util.Arrays;

Cloudant service = Cloudant.newInstance();

PostPartitionViewOptions viewOptions =
new PostPartitionViewOptions.Builder()
.db("products")
.ddoc("appliances")
.keys(Arrays.asList("1000043", "1000044"))
.includeDocs(true)
.partitionKey("small-appliances")
.view("byApplianceProdId")
.build();

ViewResult response =
service.postPartitionView(viewOptions).execute()
.getResult();

System.out.println(response);

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

const service = CloudantV1.newInstance({});

service.postPartitionView({
db: 'products',
ddoc: 'appliances',
keys: ['1000043', '1000044'],
includeDocs: true,
* [Confidence scores](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-reviewreview-debug-confidence)
* [Step locator](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-reviewreview-debug-step-locator)
* [Follow along](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-reviewreview-debug-follow-along)





 Start and end of an action 

The assistant marks the spots in the conversation when a customer enters an input that fits within an action. The assistant also marks when an action completes, and how it completes.

Completion options include ending:



* With an end step
* Without an end step
* With a human agent escalation
* With a search to a knowledge base







 Action confidence score 

Every input that you enter that can start a new topic shows a confidence score icon. Hover over this icon to see a list of actions with different confidence scores.

These scores represent the assistant’s confidence that the sentence or phrase that you entered can be solved by the steps that are built into a specific action.

Zoom

![Debug mode](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/rn-debug-confidence.png)

Debug mode

The top score in green represents the action with the highest confidence and the one the assistant used.

The remaining two are actions that were considered because of their confidence score, but weren't used because thee confidence scores were lower.

If no action scores higher than 20% confidence, you see the built-in action No action matches.





 Step locator 

Sometimes you might find an error in the middle of a test conversation, and need to find which step and action is involved. A locator icon next to each assistant response lets you find the associated steps in the editor.
* To search for all your resources named ABC, enter the following command:

ibmcloud resource search ‘name:ABC’
* To search for all Cloud Foundry applications whose name starts with my, enter the following command:

ibmcloud resource search 'name:my* AND type:cf-application'
* To search for all service instances of Message Hub, enter the following command:

ibmcloud resource search 'service_name:messagehub'
* To search for all resources in either the a07181ca-f917-4ee6-af22-b2c0c2a2d5d7 Cloud Foundry organization or the c900d9671b235c00461c5e311a8aeced resource group in the us-south region, enter the following command:

ibmcloud resource search (organization_id:a07181ca-f917-4ee6-af22-b2c0c2a2d5d7 OR doc.resource_group_id:c900d9671b235c00461c5e311a8aeced) AND 'region:us-south'
* To search for resources that are not classic infrastructure that were created between 16 May 2020 and 20 May 2020, enter the following command:

ibmcloud resource search "creation_date:[2020-05-16T00:00:00Z TO 2020-05-20T00:00:00Z]"
* To search for resources that are not classic infrastructure whose name starts with "my", ordered by type, enter the following command:

ibmcloud resource search 'name:my' -s type
* To search for resources that are not classic infrastructure and have been tagged with MyTag, enter the following command:

ibmcloud resource search 'tags:MyTag'
* To search for all classic infrastructure virtual servers whose fully qualified domain name is MyVM, enter the following command:

ibmcloud resource search “doc.fullyQualifiedDomainName:MyVM AND service_name:virtual-server”
* To search for all classic infrastructure resources that have been tagged with MyTag, enter the following command:
This method returns true if the specified string equals the action variable or session variable irrespective of case.

${step_297}.equalsIgnoreCase('Yes')





 String.extract(String regexp, Integer groupIndex) 

This method returns a string from the input that matches the specified regular expression group pattern. It returns an empty string if no match is found.

This method is designed to extract matches for different regex pattern groups, not different matches for a single regex pattern. To find different matches, see the [getMatch()](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-expression-methods-actionsexpression-methods-actions-strings-getMatch) method.

In this example, the action variable is saving a string that matches the regex pattern group that you specify. In the expression, two regex patterns groups are defined, each one enclosed in parentheses. There is an inherent third group that is comprised of the two groups together. This is the first (groupIndex 0) regex group; it matches with a string that contains the full number group and text group together. The second regex group (groupIndex 1) matches with the first occurrence of a number group. The third group (groupIndex 2) matches with the first occurrence of a text group after a number group.

${step_297}.extract('([d]+)(b [A-Za-z]+)', <n>)

If action varibale contains:

Hello 123 this is 456.

the results are as follows:



* When <n>=0, the value is 123 this.
* When <n>=1, the value is 123.
* When <n>=2, the value is this.







 String.find(String regexp) 

This method returns true if any segment of the string matches the input regular expression. You can call this method against a JSONArray or JSONObject element, and it will convert the array or object to a string before making the comparison.
* [Asking for everything at once](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-slotsdialog-slots-prompt-for-everything)
* [Capturing multiple values](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-slotsdialog-slots-multiple-entity-values)
* [Reformatting values](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-slotsdialog-slots-reformat-values)
* [Dealing with zeros](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-slotsdialog-slots-zero)
* [Getting confirmation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-slotsdialog-slots-get-confirmation)
* [Collecting summary information from the customer](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-slotsdialog-slots-get-summary)
* [Replacing a slot context variable value](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-slotsdialog-slots-found-handler-event-properties)
* [Avoiding number confusion](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-slotsdialog-slots-avoid-slot-confusion)
* [Adding conditions to Found and Not found responses](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-slotsdialog-slots-handler-next-steps)
* [Moving on after multiple failed attempts](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-slotsdialog-slots-stop-trying-after-3)
* [Preventing a Found response from displaying when it is not needed](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-slotsdialog-slots-stifle-found-responses)
![Shows the first step selected.](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/discovery-data/images/tut-convo-action-6.png)

Figure 12. First step
7. Add the following text to the Assistant says field:

I'll check the Federal Reserve Economic Data website.
8. Do not add a customer response. Instead, in the And then section, click Continue to next step, and then choose Search for the answer.

Zoom

![Shows the And then section of the action step.](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/discovery-data/images/tut-convo-action-8.png)

Figure 13. And then options
9. Click Edit settings.

Zoom

![Shows the Search step details.](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/discovery-data/images/tut-convo-action-9.png)

Figure 14. Search step
10. Select End the action after returning results, and then click Apply.

Zoom

![Shows the search step with End the action checkbox selected.](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/discovery-data/images/tut-convo-action-10.png)

Figure 15. Search step settings
11.
* To search for a CRN segment that is prefixed by <string>, use a colon followed by <string> on the last segment of the CRN query.

crn:v1:bluemix:public:cloud-object-storage:global:a/e1bb63d6a20dc57c87501ac4c4c99dcb::bucket:prod

This query returns all Cloud Object Storage bucket registrations within account e1bb63d6a20dc57c87501ac4c4c99dcb that are prefixed by prod.

crn:v1:bluemix:public:databases-for-postgresql:us-south:a/e1bb63d6a20dc57c87501ac4c4c99dcb:76b98bfd-f730-47b8-b163-515187e070a7::<string>

This query returns all Cloud Databases registrations for deployment ID 76b98bfd-f730-47b8-b163-515187e070a7 that are prefixed by <string>.



The following tables provide a list of CRN query examples before and after URL encoding. To view the URL encoded values, click the URL encoded tab.

Original

URL encoded



Table 9. CRN query examples

 Value 

 crn:v1:bluemix:public:databases-for-redis:us-south:a/274074dce64e9c423ffc238516c755e1:29caf0e7-120f-4da8-9551-3abf57ebcfc7:: 
 crn:v1:bluemix:public:cloud-object-storage:global:a/e1bb63d6a20dc57c87501ac4c4c99dcb::bucket:prod
ibmcloud resource search "(type:resource-instance OR type:resource-alias) AND (doc.resource_group_id:c900d9671b235c00461c5e311a8aeced)"

Search for resource groups with name default:

ibmcloud resource search "name:default AND type:resource-group"

Search for resource bindings for the specified service name:

ibmcloud resource search "service_name:cloud-object-storage AND type:resource-binding"

Search for a resource with the specified Cloud Resource Name (CRN):

ibmcloud resource search "crn:"crn:v1:bluemix:public:cloudantnosqldb:us-south:s/4948af7e-cc78-4321-998a-e549dd5e9210:41a031cd-e9e5-4c46-975d-9e4a6391322e:cf-service-instance:""

Search for a resource with the specified tag:

ibmcloud resource search "tags:"mykey:myvalue""

Search for Classic Infrastructure Virtual Guest resource with the specified id (only with -p classic-infrastructure):

ibmcloud resource search "id:12345678 _objectType:SoftLayer_Virtual_Guest"

Search for Classic Infrastructure Hardware resource with the specified tag name (only with -p classic-infrastructure):

ibmcloud resource search "tagReferences.tag.name:name _objectType:SoftLayer_Hardware"







 ibmcloud resource tags 

List all tags in your billing account

ibmcloud resource tags [-o, --offset OFFSET] [-l, --limit LIMIT] [-p, --provider classic-infrastructure] [-d, --details true] [-a, --attached true] [--output FORMAT] [--tag-type TAG_TYPE] [--account-id ACCOUNT_ID]



 Command options 

--offset value, -o value
: Starting resource position number (default: 0).

--limit value, -l value