vania-janet/multiturn-rag-retrieval-data huggingface dataset:
Enter the following context variable name and value pair:



Order number context variable details

 Variable Value 

 $ordernumber <? @order_number.literal ?> 



The context variable value (<? @order_number.literal ?>) is a SpEL expression that captures the number that the user specifies that matches the pattern defined by the @order_number pattern entity. It saves it to the $ordernumber variable.
16. Add the following message in the response text field:

OK. The order $ordernumber is canceled. We hope we get the opportunity to bake a cake for you sometime soon.

![Shows the order number child node details.](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/gs-ass-order-number-child.png)
17. Click ![Close](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/close.png) to close the edit view.
18. Add another node to capture the case where a user provides a number, but it is not a valid order number. Click the More![More options](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/kebab.png) icon on the @order_number node, and then select Add node below.
19. Type true into the If assistant recognizes field of this node.
20. Add the following message in the response text field:

I need the order number to cancel the order for you. If you don't know the order number, please call us at 958-234-3456 to cancel over the phone.
The valid relation mention is between its and owner, because it is this part of the sentence in which the text explicitly defines the relationship between the dog and its owner. Owner might be a home owner, or the owner of some other dog, but this text makes it clear that the same dog that is mentioned in the beginning of the sentence is owned by this person.

VALID: The dog got a treat from its owner.

|ownedBy^

The requirement that both entity mentions and the text that defines the relation type between them must exist within a single sentence might seem strict. However, keep in mind that, as in the above example, as long as you also identify coreferences in the document, you can identify relation mentions in sentences that contain words that serve as more informal entity mentions, such as pronouns. For example, the second sentence in Mary is a scientist. She works for IBM. contains valid textual evidence of an employedBy relationship between Mary and IBM. The coreference, She, is understood to be a reference to the PERSON entity type Mary. It is the identification of a coreference between Mary and She plus the identification of a relation mention between She and IBM together that fully captures this relationship. The correct way to annotate the relation mention is like this:

Mary[1] is a scientist. She[1] works for IBM.

|----employedBy----^

where the subscript [#1] indicates that Mary and She are both members of the first coreference chain in the document.





 Procedure 

To annotate relation mentions between entity mentions in a document:



1. Log in as a human annotator (or as an administrator or project manager who was assigned documents to annotate). Workspaces that contain tasks that are assigned to you are displayed.
2. Open a workspace, and then click Machine Learning Model > Annotations. Click the Annotation Tasks tab. The annotation tasks that are assigned to you are displayed.
3. Open the annotation task that you want to work on. The annotation sets that are assigned to you are displayed.
4. Click Annotate to open the annotation set you want to work on.
To learn about the impact of including references to entities in your user examples, see [How entity references are treated](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-intentsintents-entity-references).

Intent names and example text can be exposed in URLs when an application interacts with Watson Assistant. Do not include sensitive or personal information in these artifacts.
6. Click Add example to save the user example.

![Screen capture that shows adding a user example to an intent](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/intent-user-example.png)
7. Repeat the same process to add more examples.

Provide at least five examples for each intent.
8. When you are done adding examples, click ![Close arrow](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/close_arrow.png) to finish creating the intent.



The system begins to train itself on the intent and user examples you added.





 How entity references are treated 

When you include an entity mention in a user example, the machine learning model uses the information in different ways in these scenarios:



* [Referencing entity values and synonyms in intent examples](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-intentsintents-related-entities)
* [Annotated mentions](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-intentsintents-annotated-mentions)
* [Directly referencing an entity name in an intent example](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-intentsintents-entity-as-example)





 Referencing entity values and synonyms in intent examples
Using a model for speech recognition 

You use the model parameter of a speech recognition request to indicate the model that is to be used with the request. You can specify a previous- or next-generation model with the parameter.

For more information about the models that are available for speech recognition, see



* [Previous-generation languages and models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models)
* [Next-generation languages and models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-ng)





 Specify a previous-generation model example 

The following example HTTP request uses the previous-generation model en-US_NarrowbandModel for speech recognition:

IBM Cloud

curl -X POST -u "apikey:{apikey}" --header "Content-Type: audio/flac" --data-binary @{path}audio-file.flac "{url}/v1/recognize?model=en-US_NarrowbandModel"

IBM Cloud Pak for Data

curl -X POST --header "Authorization: Bearer {token}" --header "Content-Type: audio/flac" --data-binary @{path}audio-file.flac "{url}/v1/recognize?model=en-US_NarrowbandModel"





 Specify a next-generation model example 

The following example HTTP request uses the next-generation en-US_Telephony model for speech recognition:

IBM Cloud

curl -X POST -u "apikey:{apikey}" --header "Content-Type: audio/wav" --data-binary @{path}audio-file.wav "{url}/v1/recognize?model=en-US_Telephony"

IBM Cloud Pak for Data

curl -X POST --header "Authorization: Bearer {token}" --header "Content-Type: audio/wav" --data-binary @{path}audio-file.wav "{url}/v1/recognize?model=en-US_Telephony"





 Using the default model
* Plural form: SECONDS, MINUTES, DAYS, MONTHS, YEARS



Both singular and plural forms can be used interchangeably.

The following example demonstrates how to add and subtract several time units from the current timestamp.

-- add and subtract several time units from the current timestamp
SELECT
CURRENT_TIMESTAMP
- INTERVAL 2 YEARS
+ INTERVAL 1 MONTH
- INTERVAL 3 DAYS
+ INTERVAL 10 HOURS
+ interval 30 MINUTES
- INTERVAL 20 SECOND AS past_timestamp
FROM VALUES ("dummy")

The result of the example query is shown in the following table.



Table 30. Query result for example: add and subtract several time units from the current timestamp.

 PAST_TIMESTAMP 

 2016-11-13 20:23:43.621 



Since interval clauses can get long, especially if days, hours, minutes, and seconds are involved, it is possible to use an abbreviated syntax by specifying a format STRING and by using the TO keyword.

The format STRING can be used to specify the following time intervals:



* YEAR TO MONTH interval by using a format string that complies with signYEAR-MONTH with the following:



* sign: optional + or - sign
* YEAR: number of years
* MONTH: number of months



* DAY TO SECOND interval by using a format string that complies with signDAY HOUR:MINUTE:SECOND with the following:



* sign: optional + or - sign
* DAY: number of days
* HOUR: number of hours
* MINUTE: number of minutes
* SECOND: number of seconds





When you specify a time interval by using the keyword TO, only the singular form of a time unit identifier is supported.

The following table shows equivalent interval clauses.



Table 31. Equivalent INTERVAL clauses.

 INTERVAL expression INTERVAL TO expression 

 INTERVAL 1 DAY - INTERVAL 2 HOURS - INTERVAL 3 MINUTES - INTERVAL 4 SECONDS INTERVAL '1 2:3:4.100' DAY TO SECOND 
 INTERVAL 1 YEAR - INTERVAL 2 MONTH INTERVAL '1-2' YEAR TO MONTH 



The following example demonstrates equivalent interval expressions when you deal with YEAR and MONTH time units.

-- equivalent interval expressions with YEAR and MONTH time units
"result_variable": "context.my_forecast"
}
]
}

Normally, the service only returns to the client from a POST /message request when new user input is required, such as after executing a parent and before executing one of its child nodes. However, if you add a client action to a node, then after evaluation, the service always returns to the client so that the result of the action call can be returned. To prevent waiting for user input when it should not, such as for a node that is configured to jump directly to a child node, the service adds the following value to the message context:

{
"context": {
"skip_user_input": true
}
}

If you want the client to perform an action, but not get user input, then you can follow the same convention, and add the skip_user_input context variable to the parent node to communicate that to the client application.

Your client application should always check for the skip_user_input variable on context. If present, then it knows not to request new input from the user, but instead execute the action, add its result into the message, and pass it back to the service. The new POST message request should include the message returned by the previous POST message response (namely, the context, input, intents, entities, and optionally the output section) and, instead of the JSON object that defines the programmatic call to make, it should include the result that was returned from the programmatic call.

In a child node that you jump to after this node, add the response to show the user:

{
"output": {
"text": {
"values": [
"It will be $my_forecast $date.literal in $location.literal."
]
}
}
The external node name field serves two purposes. It provides information about the node to customers when it is included in a disambiguation list. It also describes the node in a chat summary that is shared with service desk agents when a conversation is transferred to a person. The external node name field is only visible in skills that are part of a paid plan instance. If the external node name field contains text, its text is used, whether or not there is text in the name field.

!]<-- </ul> -->For each node, test scenarios in which you expect the node to be included in the disambiguation options list. Testing gives you a chance to make adjustments to the node order or other factors that might impact how well disambiguation works at run time. See Testing disambiguation]] .Watson Assistant can recognize intent conflicts, which occur when two or more intents have user examples that overlap. Resolve any such conflicts]] ! ! !! ! ! ! ! ! ! ! ! first to ensure that the intents themselves are as unique as possible, which helps your assistant attain better intent confidence scores.<-- <section "id="section-dialog-runtime-prevent-disambiguation" "> --> Prioritizing a node over disambiguation Some nodes are important enough to your customer's satisfaction that you want them to be returned on their own, outside of a disambiguation list, when the assistant is confident enough that the node will meet a customer need.For example, you might have a node that matches the stolen_card intent. Whenever an incoming message suggests that a customer wants to report a stolen credit card, you don't want your assistant's response to be lost in a disambiguation list of options. You want the assistant to respond with a single answer that assures the customer that it can address this urgent matter.To design your dialog to prioritize a single node over disambiguation, complete the following steps:<-- <ol> -->1. In the node that conditions on the intent, enable multiple conditioned responses (Customize > Multiple conditioned responses).2.
"key": "herbivore",
"value": 1
},
{
"id": "llama", // <-- append u0000 to the startkey_docid to of the next request
"key": "herbivore",
"value": 1
}
]
}
Show more
See the following example of a second request: get next page of animals by diet
curl -H "Authorization: Bearer $API_BEARER_TOKEN" "$SERVICE_URL/animaldb/_design/views101/_view/diet?limit=3&startkey="herbivore"&endkey="herbivore"&startkey_docid=llama%00"
See the following example of a second response: {
"total_rows": 10,
"offset": 5,
"rows":
{
"id": "zebra",
"key": "herbivore",
"value": 1
}
]
}
The previous Go example requires the following import block: import (
"encoding/json"
"fmt"
"github.com/IBM/cloudant-go-sdk/cloudantv1"
"github.com/IBM/go-sdk-core/core"
)
All Go examples require the service object to be initialized. For more information, see the API documentation's Authentication section]] ! ! ! ! ! ! ! ! for examples.In other words, the second request has a value of startkey_docid that is the last document ID from the previous page of results (llama) plus the magic u0000 character (which becomes llama%00 in the URL).The startkey_docid parameter works only if a startkey is supplied and where all index entries share a key. If they don't share a key, then pagination can be achieved with manipulation of startkey/endkey parameters only.
<savedResponse>,<value>,<synonyms>

Where <savedResponse> is the name of a saved customer response, <value> is a value for the saved customer response, and <synonyms> is a comma-separated list of synonyms for that value. For example:

genres,science fiction,sci-fi,SF
genres,historical fiction,HF
genres,young adult,YA
genres,autobiography
genres,biography
genres,fantasy
locations,Adams Street
locations,Central
locations,South End

Uploading a CSV file also supports patterns. Any string that is wrapped with / is considered a pattern, as opposed to a synonym. For example:

ContactInfo,localPhone,/(d{3})-(d{4})/
ContactInfo,fullUSphone,/(d{3})-(d{3})-(d{4})/
ContactInfo,internationalPhone,/^((?+?[0-9])?)?[0-9_- ()]$/
ContactInfo,email,/b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,}b/
ContactInfo,website,/(https?://)?([da-z.-]+).([a-z.]{2,6})([/w .-])/?$/
2. Go to the Saved responses page.
3. Click the Upload icon ![Upload icon](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/upload-icon.png).
4. Select a file from your computer. The maximum CSV file size is 10 MB.
[Shows an intent list with a conflict](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/intent-conflicts.png)
2. Click an intent with a conflict to open it. Find the user example that is causing the conflict, and then click Resolve conflicts.

![Shows an intent with a user example list where one of the user examples has a Resolve conflicts button](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/intent-resolve-conflicts.png)
3. Choose whether to delete the example from the intent or to move it to another intent.

![Shows the intent conflict details page](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/intent-fix-conflict.png)

Similar user examples are displayed for each intent. These examples are not necessarily in conflict. They are shown to give you a quick view of the other types of user examples that are defined for each intent. It provides you with context that can help you make a more informed decision.

Keep each intent as distinct and focused on one goal as possible. If you have two intents with multiple user examples that overlap, maybe you don't need two separate intents. You can move or delete user examples that don't directly overlap into one intent, and then delete the other.
4. To move a user example, click Move, and then click the intent where you want to move the example.

!
Review the section on [blueprint versioning](https://cloud.ibm.com/docs/schematics?topic=schematics-blueprint-versioning) to understand how Blueprints versioning can be used.

The use of input versioning is summarized in the table.



Usage of input version

 Blueprint layer Development and unregulated environments Regulated environments 

 Dynamic (override) inputs Any input, no version control. Override values specified in input file Sensitive values only 
 Input files Optional, un-versioned Versioned (tag or branch) 
 Templates Un-versioned Versioned (tag or branch) 
 Modules Un-versioned Versioned (tag) 







 Blueprint input value precedence 

All template inputs must have an input value at blueprint config create time. Missing template input values will result in an error at config create time.

A template input can have one of three value definitions:



* No value
* Default value
* Specified value



Blueprints loads input values in the following order with later sources taking precedence over earlier ones:



 No value 



* Blueprint template input - no value: one of the following is mandatory
* Blueprint input file value
* Blueprint (override) input value







 Default value 



* Blueprint template input - default value, one of the following is optional
* Blueprint input file
* Blueprint (override) input value







 Specified value 



* Blueprint template input - value intended for settings of values internal to the template. Can be optionally overridden by one of the following during template development.
* Blueprint input file
* Blueprint (override) input value
: Returns the tangent of expr.
: Example of an SQL function usage fragment

> SELECT tan(0)
: Result value

0.0





 tanh 

tanh(expr)
: Returns the hyperbolic tangent of expr.
: Example of an SQL function usage fragment

> SELECT tanh(0)
: Result value

0.0





 timestamp 

timestamp(expr)
: Casts the value expr to the target data type timestamp.





 tinyint 

tinyint(expr)
: Casts the value expr to the target data type tinyint.





 to_date 

to_date(date_str[, fmt])
: Parses the date_str expression with the fmt expression to a date. Returns null with invalid input. By default, it follows casting rules to a date if the fmt is omitted.
: Example of an SQL function usage fragment

> SELECT to_date('2009-07-30 04:17:52')
: Result value

2009-07-30
: Example of an SQL function usage fragment

> SELECT to_date('2016-12-31', 'yyyy-MM-dd')
: Result value

2016-12-31





 to_json 

to_json(expr[, options])
: Returns a JSON string with a indicated struct value.
: Example of an SQL function usage fragment

> SELECT to_json(named_struct('a', 1, 'b', 2))
: Result value

{"a":1,"b":2}
: Example of an SQL function usage fragment

> SELECT to_json(named_struct('time', to_timestamp('2015-08-26', 'yyyy-MM-dd')), map('timestampFormat', 'dd/MM/yyyy'))
: Result value

{"time":"26/08/2015"}
: Example of an SQL function usage fragment
The JSONElement that is returned by this method is the JSONElement that is being removed.

For this Dialog runtime context:

{
"context": {
"user": {
"first_name": "John",
"last_name": "Snow"
}
}
}

Dialog node output:

{
"context": {
"attribute_removed": "<? $user.remove('first_name') ?>"
}
}

Result:

{
"context": {
"user": {
"last_name": "Snow"
},
"attribute_removed": {
"first_name": "John"
}
}
}





 com.google.gson.JsonObject support 

In addition to the built-in methods, you can use standard methods of the com.google.gson.JsonObject class.







 Strings 

There methods help you work with text.

For information about how to recognize and extract certain types of Strings, such as people names and locations, from user input, see [System entities](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-system-entities).

For methods that involve regular expressions, see [RE2 Syntax reference](https://github.com/google/re2/wiki/Syntax) for details about the syntax to use when you specify the regular expression.



 String.append(Object) 

This method appends an input object to the string as a string and returns a modified string.

For this Dialog runtime context:

{
"context": {
"my_text": "This is a text."
}
}

This syntax:

{
"context": {
"my_text": "<? $my_text.append(' More text.') ?>"
}
}

Results in this output:

{
"context": {
"usage": "attribute",
"regularAggregate": "none"
},
{
"datatype": "BIGINT",
"nullable": true,
"name": "Year_",
"description": "Year",
"label": "Year",
"usage": "attribute",
"regularAggregate": "none",
"taxonomyFamily": "cYear"
},
{
"datatype": "NVARCHAR(7)",
"nullable": true,
"name": "Quarter",
"description": "Quarter",
"label": "Quarter",
"usage": "attribute",
"regularAggregate": "none",
"taxonomyFamily": "cQuarter"
},
{
"datatype": "DOUBLE",
"nullable": true,
"name": "Revenue",
"description": "Revenue",
"label": "Revenue",
"usage": "fact",
"regularAggregate": "total"
},
{
"datatype": "DECIMAL(38, 0)",
"nullable": true,
"name": "Quantity",
"description": "Quantity",
"label": "Quantity",
"usage": "fact",
"regularAggregate": "total"
},
{
"datatype": "DOUBLE",
"nullable": true,
"name": "Gross_margin",
"description": "Gross margin",
"label": "Gross margin",
"usage": "fact",
"regularAggregate": "minimum"
}
]
},
"label": "Module Name",
"identifier": "moduleId"
}
Show more









 Table section of the data source specification
If neither is specified the bucket's DefaultRetention period will be used. 
 Retention-legal-hold-id string A single legal hold to apply to the object. A legal hold is a Y character long string. The object cannot be overwritten or deleted until all legal holds associated with the object are removed. 



public static void putObjectAddLegalHold(String bucketName, String objectName, String fileText, String legalHoldId) {
System.out.printf("Add legal hold %s to %s in bucket %s with a putObject operation.n", legalHoldId, objectName, bucketName);

InputStream newStream = new ByteArrayInputStream(fileText.getBytes(StandardCharsets.UTF_8));

ObjectMetadata metadata = new ObjectMetadata();
metadata.setContentLength(fileText.length());

PutObjectRequest req = new PutObjectRequest(
bucketName,
objectName,
newStream,
metadata
);
req.setRetentionLegalHoldId(legalHoldId);

cos.putObject(req);

System.out.printf("Legal hold %s added to object %s in bucket %sn", legalHoldId, objectName, bucketName);
}

public static void copyProtectedObject(String sourceBucketName, String sourceObjectName, String destinationBucketName, String newObjectName) {
System.out.printf("Copy protected object %s from bucket %s to %s/%s.n", sourceObjectName, sourceBucketName, destinationBucketName, newObjectName);

CopyObjectRequest req = new CopyObjectRequest(
sourceBucketName,
sourceObjectName,
destinationBucketName,
newObjectName
);
req.setRetentionDirective(RetentionDirective.COPY);

cos.copyObject(req);