vania-janet/multiturn-rag-retrieval-data huggingface dataset:
SEARCH_SKILL_POD="$(oc get pods -l component=skill-search --output custom-columns=NAME:.metadata.name --no-headers | head -n 1)"

c) Run the following command to see the selected pod:

echo "Selected search skill pod: ${SEARCH_SKILL_POD}"

d) Retrieve the truststore file. The cacerts file is the default truststore that is used by Java. It contains the list of the certificate authorities that Java trusts by default. Run the following command to copy the binary cacerts file from the pod into your current directory:

oc cp ${SEARCH_SKILL_POD}:/opt/ibm/java/jre/lib/security/cacerts cacerts
3. Run the following command to inject the ingress_ca.crt file into the cacerts file:
keytool -import -trustcacerts -keystore cacerts -storepass changeit -alias customer_ca -file ingress_ca.crt

You can run the keytool -list -keystore cacerts -storepass changeit | grep customer_ca -A 1 command to check that your CA certificate is included in the cacerts file.
4. Run the following command to create the configmap that contains the updated cacerts file:
oc create configmap watson-assistant-skill-cacerts --from-file=cacerts

Because the cacerts file is binary, the output of the oc describe configmap watson-assistant-skill-cacerts command shows an empty data section. To check whether the updated cacerts file is present in the configmap, run the oc get configmap watson-assistant-skill-cacerts --output yaml command.
5. Override the cacerts file in the search skill pods. In this step, you configure the Watson Assistant operator to override the cacerts file in the search skill pods with the updated cacerts file. In the following example file, the Watson Assistant instance is called watson-assistant---wa.
The search skill pods are then able to validate your certificate and communicate with the Watson Discovery service.<-- <ol> -->1. First, get your certificate. You might have this certificate, but in these steps you can retrieve the certificate directly from the cluster.
a) Run the following command to check that the secret exists:

oc get secret external-tls-secret

b) Run the following command to retrieve the certificate chain from the secret:

oc get secret external-tls-secret --output jsonpath='{.data.cert.crt}' | base64 -d | tee ingress_cert_chain.crt

c) Extract the CA certificate. The ingress_cert_chain.crt file typically contains multiple certificates. The last certificate in the file is usually your CA certificate. Copy the last certificate block that begins with -----BEGIN CERTIFICATE----- and ends with -----END CERTIFICATE-----. Save this certificate in the ingress_ca.crt file. When you save the ingress_ca.crt file, the -----BEGIN CERTIFICATE----- line must be the first line of the file, and the -----END CERTIFICATE----- line must be the last line of the file.
2. Retrieve the truststore that is used by the search skill pods.
a) Run the following command to list the search skill pods:

oc get pods -l component=skill-search

b) Run the following command to set the SEARCH_SKILL_POD environment variable with the search skill pod name:

SEARCH_SKILL_POD="$(oc get pods -l component=skill-search --output custom-columns=NAME:.metadata.name --no-headers | head -n 1)"

c) Run the following command to see the selected pod:

echo "Selected search skill pod: ${SEARCH_SKILL_POD}"

d) Retrieve the truststore file. The cacerts file is the default truststore that is used by Java. It contains the list of the certificate authorities that Java trusts by default.
The possible values are sequential, random, and multiline. N 
 delimiter string The delimiter to output as a separator between responses. Used only when selection_policy=multiline. The default delimiter is newline (). N 







 Example 

This examples displays a greeting message to the user.

{
"output": {
"generic":[
{
"response_type": "text",
"values":
{ "text": "Hello." },
{ "text": "Hi there." }
],
"selection_policy": "random"
}
]
}
}







 search 

Calls the search skill linked to the assistant to retrieve results that are relevant to the user's query.



 Fields 



 Name Type Description Required? 

 response_type string search_skill Y 
 query string The text to use for the search query. This string can be empty, in which case the user input is used as the query. Y 
 filter string An optional filter that narrows the set of documents to be searched. N 
 query_type string The type of search query to use (natural_language or discovery_query_language). Y 
 discovery_version string The version of the Discovery service API to use. The default is 2018-12-03. N 



You can author a search_skill response_type that calls out to your search skill, and then return a search response_type that you can render in a different format. Go to Message > Response > output > MessageOutput > generic > RuntimeResponseTypeSearch in [Watson Assistant v2 API](https://cloud.ibm.com/apidocs/assistant-v2message-response) to view how response_type search renders when search_skill response is processed..





 Example 

This example uses the user input text to send a natural-language query to the search skill.

{
"output": {
"generic": [
{
"response_type": "search_skill",
[checkmark icon](https://cloud.ibm.com/docs-content/v1/content/icons/checkmark-icon.svg) 
 Test in actions skill Preview pane ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/icons/checkmark-icon.svg) ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/icons/checkmark-icon.svg) ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/icons/checkmark-icon.svg) 
 Test in search skill "Try it out" pane ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/icons/checkmark-icon.svg) ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/icons/checkmark-icon.svg) ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/icons/checkmark-icon.svg) 
 Add, edit, or delete context variables in dialog skills or session variables in actions skills ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/icons/checkmark-icon.svg) ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/icons/checkmark-icon.svg) 
 Improve data from dialog skill "Try it out" pane ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/icons/checkmark-icon.svg) ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/icons/checkmark-icon.svg) 
 View analytics !
For instructions on adding the built-in search integration, see [IBM Watson® Discovery search integration setup](https://cloud.ibm.com/docs/watson-assistant/?topic=watson-assistant-search-add).





 Add a search extension 

With a search extension, you can "bring your own search" and use content from your website, knowledge base, or content management system.

For instructions on adding a search extension, see:



* [Coveo search extension setup](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-search-extension-coveo)
* [Google custom search extension setup](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-search-extension-google)
* [NeuralSeek extension setup](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-search-extension-neuralseek)
Case-sensitive search configuration with Presto 

When you deal with character data, case sensitivity is important when you search for specific matches or patterns. However, not all databases and query engines behave in the same way. Some are case-insensitive by default, while others are not. The case-sensitive search can lead to unexpected results if the case of the data is not considered.
Additional resources 



 Features at-a-glance 



* [Custom categories (Beta)](https://github.com/watson-developer-cloud/doc-tutorial-downloads/blob/master/natural-language-understanding/Explainers/Custom%20Categories%20One%20Pager-2023.pdf): Learn how the custom categories feature works, and best practices for training your model.







 Case studies 





 Content Recommendation Course Hero Understand user preferences and recommend videos based on their interests 
 Advertising Optimization [BuzzRadar](https://www.ibm.com/case-studies/buzz-radar-cloud-marketing-performance-optimization) Optimizing campaigns for clients through instant insight into consumers, influencers, brand health and more 
 [Equals3](https://www.ibm.com/watson/stories/equals-3/?cm_mmc=OSocial_Twitter-_-Watson+Core_Watson+Core+-+Platform-_-WW_WW-_-Watson+Equals+3+Twitter+May+2018&cm_mmca1=000000OF&cm_mmca2=10000408&) Understanding natural language queries and building profiles according to user specifications, inputs, and other data 
 [Influential](https://www.ibm.com/case-studies/influential) Amplifying marketing messages by influencers throughout social media campaigns 
 Voice-of-Customer Analysis [Guardio](https://www.ibm.com/case-studies/guardio-cloud-bullying-detection-application) Helping parents protect children from cyberbullying by flagging and detecting certain messages across social media accounts 
 Data Mining [Bradesco](https://www.ibm.com/watson/stories/bradesco/) Addressing and resolving customer conversations at scale through a trained virtual assistant 
 [Legalmation](https://www.ibm.com/case-studies/legalmation) Detecting citizens' civic concerns with 97% accuracy using IBM Watson 
 Accrete Delivering highly accurate insight into financial markets with artificial intelligence 







 Blogs
If you want the search for an answer to be the last step in the action, select End the action after returning results.
4. Click Apply.







 Test the search integration 

After you configure search, you can send test queries to see the search results that get returned from Discovery by using the Preview page.

To test the full experience that customers have when they ask questions that are either answered by the action or trigger a search, use the Preview for your assistant.





 Use search when no action matches 

You can use the search integration with the built-in [No action matches](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-handle-errorsno-action-matches) capability. By adding search to No action matches, you can have your assistant refer to search when a customer asks a question that isn't addressed by an existing action.

To update No action matches to use search:



1. In your assistant, click Actions, then click Set by assistant.
2. Click No action matches to open it in the editor.
3. Click New step.
4. In the And then section, click Continue to next step, then choose Search for the answer.
5. Because you're adding search, you no longer need step 2, which is the step for when the No action matches count is 3 or less. Click the delete (trash can) icon to remove it.
6. Close No action matches. Now your assistant uses search to provide customers with potentially useful answers, if the customer question does not trigger any of the existing actions.
More about text indexes 

The basic premise for full text indexes is that a document is "expanded" into a list of key:value pairs that are indexed by Lucene. This expansion enables the use of Lucene's search syntax as a basis for the query capability.

This technique supports enhanced searches, but does have certain limitations. For example, it might not always be clear whether content for an expanded document came from individual elements or an array.

The query mechanism resolves this uncertainty by preferring to return "false positive" results. In other words, if a match was found because of a search for either an individual element, or an element from an array, then the match is considered a success.

Like IBM® Cloudant® for IBM Cloud® Search indexes, IBM Cloudant Query indexes of type: text are limited to 200 results when queried.



 Selector conversion 

A standard Lucene search expression might not fully implement the wanted JSON-based IBM Cloudant query syntax. Therefore, a conversion between the two formats takes place.

In the following example, the JSON query approximates to the English phrase, Match if the age expressed as a number is greater than five and less than or equal to infinity. The Lucene query corresponds to that phrase, where the text _3a within the field name corresponds to the age:number field, and is an example of the document content expansion that was mentioned earlier.

See the following example query to be converted:

{
"age": {
"$gt": 5
}
}





 A more complex example 

The following example illustrates some important points.



 JSON query to be converted to Lucene 

{
"$or": [
{
"age": {
"$gt": 5
}
},
{
"twitter": {
"$exists":true
}
},
{
"type": {
"$in":
"starch",
"protein"
]
}
}
]
}
Show more
", "conf": { "spark.hadoop.fs.cos.<cos-reference-name>.endpoint": "https://s3.direct.us-south.cloud-object-storage.appdomain.cloud", "spark.hadoop.fs.cos.<cos-reference-name>.access.key": "<access_key>", "spark.hadoop.fs.cos.<cos-reference-name>.secret.key": "<secret_key>", "spark.app.name": "MySparkApp" } }' -X POST https://api.us-south.ae.cloud.ibm.com/v3/analytics_engines/<instance-id>/livy/batches

Request body for a submitted batch job using the Livy batches API:



Table 1. Request body for batch jobs

 Name Description Type 

 file File containing the application to execute string (required) 
 className Application Java/Spark main class string 
 args Command line arguments for the application list of string 
 jars jars to be used in this session list of string 
 pyFiles Python files to be used in this session list of string 
 files files to be used in this session list of string 
 driverMemory Amount of memory to use for the driver process string 
 driverCores Number of cores to use for the driver process int 
 executorMemory Amount of memory to use per executor process string 
 executorCores Number of cores to use for each executor int 
 numExecutors Number of executors to launch for this session int 
 name The name of this session string 
 conf Spark configuration properties map of key=val 



The proxyUser, archives and queue properties are not supported in the request body although they are supported in the open source Livy REST interface.

Response body of a submitted batch job using the Livy batches API:



Table 2. Response body of a submitted batch job

 Name Description Type 

 id The batch ID int 
 appId The Spark application ID string 
 appInfo Detailed application information map of key=val
Livy batch APIs 

Livy batches API is a REST interface for submitting Spark batch jobs. This interface is very similar to the open source Livy REST interface (see [Livy](https://github.com/cloudera/livy)) except for a few limitations which are described in the following topic.

The open source Livy batches log API to retrieve log lines from a batch job is not supported. The logs are added to the IBM Cloud Object Storage bucket that was referenced as the service instance "instance_home". At a later time during the beta release, the logs can be forwarded to IBM Log Analysis.

Gets the log lines from this batch.



 Submitting Spark batch jobs 

To submit a Spark batch job by using the Livy batches API, enter:

curl -H 'Authorization: Bearer <TOKEN>' -H 'Content-Type: application/json' -d '{ "file": "/ cos://<application-bucket-name>.<cos-reference-name>/my_spark_application.py"
", "conf": { "spark.hadoop.fs.cos.<cos-reference-name>.endpoint": "https://s3.direct.us-south.cloud-object-storage.appdomain.cloud", "spark.hadoop.fs.cos.<cos-reference-name>.access.key": "<access_key>", "spark.hadoop.fs.cos.<cos-reference-name>.secret.key": "<secret_key>", "spark.app.name": "MySparkApp" } }' -X POST https://api.us-south.ae.cloud.ibm.com/v3/analytics_engines/<instance-id>/livy/batches

Request body for a submitted batch job using the Livy batches API:



Table 1. Request body for batch jobs

 Name Description Type 

 file File containing the application to execute string (required) 
 className Application Java/Spark main class string 
 args Command line arguments for the application list of string
conf Spark configuration properties map of key=val 



The proxyUser, archives and queue properties are not supported in the request body although they are supported in the open source Livy REST interface.

Response body of a submitted batch job using the Livy batches API:



Table 2. Response body of a submitted batch job

 Name Description Type 

 id The batch ID int 
 appId The Spark application ID string 
 appInfo Detailed application information map of key=val 
 state State of submitted batch job string 







 Examples using the Livy API 

The following sections show you how to use the Livy batches APIs.



 Submit a batch job with job file in IBM Cloud Object Storage 

To submit a batch job where the job file is located in an IBM Cloud Object Storage bucket, enter:

curl -i -X POST https://api.us-south.ae.cloud.ibm.com/v3/analytics_engines/<instance-id>/livy/batches -H 'content-type: application/json' -H "Authorization: Bearer $TOKEN" -d @livypayload.json

The endpoint to your IBM Cloud Object Storage instance in the payload JSON file should be the public endpoint.

Sample payload:

{
"file": "cos://<bucket>.mycos/wordcount.py",
"className": "org.apache.spark.deploy.SparkSubmit",
"args": ["/opt/ibm/spark/examples/src/main/resources/people.txt"],
"conf": {
"spark.hadoop.fs.cos.mycos.endpoint": "https://s3.direct.us-south.cloud-object-storage.appdomain.cloud",
"spark.hadoop.fs.cos.mycos.access.key": "XXXX",
"spark.hadoop.fs.cos.mycos.secret.key": "XXXX",
"spark.app.name": "MySparkApp"
}
}

Sample response:
For more information about using Terraform with toolchains, see [Creating a toolchain with Terraform](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-toolchains_getting_started&interface=terraformcreating_a_toolchain_terraform), [Deleting a toolchain with Terraform](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-toolchains-using&interface=terraformdeleting_a_toolchain_terraform), [Working with tool integrations](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-integrations&interface=terraform), and the [ibm_cd_toolchain resources documentation](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cd_toolchain).
* Can I manage toolchains by using an API?

You can use HTTP APIs or selected programming language SDKs to create, read, update, and delete toolchains and tool integrations. For more information about using toolchains and tool integrations with the API, see [Creating a toolchain with the API](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-toolchains_getting_started&interface=apicreating_a_toolchain_api), [Deleting a toolchain with the API](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-toolchains-using&interface=apideleting_a_toolchain_api), [Working with tool integrations](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-integrations&interface=api), and the [CD Toolchain API docs](https://cloud.ibm.com/apidocs/toolchain).
* Can I use the console, APIs, or CLI to modify resources that are managed by Terraform?
For more information about using Terraform with toolchains, see [Creating a toolchain with Terraform](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-toolchains_getting_started&interface=terraformcreating_a_toolchain_terraform), [Deleting a toolchain with Terraform](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-toolchains-using&interface=terraformdeleting_a_toolchain_terraform), [Working with tool integrations](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-integrations&interface=terraform), and the [ibm_cd_toolchain resources documentation](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cd_toolchain).





 Can I manage toolchains by using an API? 

You can use HTTP APIs or selected programming language SDKs to create, read, update, and delete toolchains and tool integrations. For more information about using toolchains and tool integrations with the API, see [Creating a toolchain with the API](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-toolchains_getting_started&interface=apicreating_a_toolchain_api), [Deleting a toolchain with the API](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-toolchains-using&interface=apideleting_a_toolchain_api), [Working with tool integrations](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-integrations&interface=api), and the [CD Toolchain API docs](https://cloud.ibm.com/apidocs/toolchain).





 Can I use the console, APIs, or CLI to modify resources that are managed by Terraform?
The following examples make use of the IBM COS SDKs for Python, Node.js, and Go, as well as a Terraform script, although the implementation of object versioning should be fully compatible with any S3-compatible library or tool that allows for the setting of custom endpoints. Using third-party tools requires HMAC credentials in order to calculate AWS V4 signatures. For more information on HMAC credentials, [see the documentation](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-uhc-hmac-credentials-main).



 Python 

Enabling Object Lock using the IBM COS SDK for Python can be done using the [low-level client](https://ibm.github.io/ibm-cos-sdk-python/reference/services/s3.htmlclient) syntax.

Using a client:

import ibm_boto3
from ibm_botocore.client import Config
from ibm_botocore.exceptions import ClientError
from datetime import datetime, timedelta
import time

 Create new bucket with Object Lock enabled.
def create_bucket_with_objectlock(bucket_name):
cos_cli.create_bucket(
Bucket=bucket_name,
ObjectLockEnabledForBucket=True,
)
print("Bucket: {0} created with objectlock enabled".format(bucket_name))

def objectlock_configuration_on_bucket(bucket_name):

 Putting default retenion on the COS bucket.
default_retention_rule = {'DefaultRetention': {'Mode': 'COMPLIANCE', 'Years': 1}}
object_lock_config = {'ObjectLockEnabled': 'Enabled', 'Rule': default_retention_rule}
cos_cli.put_object_lock_configuration(Bucket=bucket_name, ObjectLockConfiguration=object_lock_config)
 Reading the objectlock configuration set on the bucket.
* [Next steps](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ibp-tutorial-extcaibp-tutorial-extca-next-steps)





 Using Ansible Playbooks 

[Getting started with Ansible playbooks on the IBM Blockchain Platform](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ansibleansible)



* [What is Ansible](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ansibleansible-whatis)
* [How does the IBM Blockchain Platform Ansible collection work?](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ansibleansible-how)
* [Why would I want to use an Ansible playbook?](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ansibleansible-why)
* [Considerations and Limitations](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ansibleansible-limits)
* [Getting started](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ansibleansible-getting-started)
* [Next steps](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ansibleansible-next-steps)
* [Where to find support](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ansibleansible-support)



[Building an IBM Blockchain Platform network using Ansible playbooks](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ansible-buildansible-build)



* [Prerequisites](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ansible-buildansible-build-prereqs)