vania-janet/multiturn-rag-retrieval-data huggingface dataset:
Incorrect usage error message when configuring an Event Streams target 

When attempting to create an IBM Cloud Activity Tracker Event Routing event_streams target using the CLI, you are unable to do so and are getting errors indicating your command has an incorrect usage.

  What’s happening 

Your CLI command return the message: Incorrect usage. Check the command syntax and retry your request.

  Why it’s happening 

Configuration of event_streams targets using the CLI requires the atracker CLI plug-in at 0.3.2 or later.

  How to fix it 

Upgrade the atracker CLI plug-in by running ibmcloud plugin update atracker and retry your CLI command.
Names for classes, structs, or types SHOULD be simple, descriptive, and meaningful to developers. Such names should generally be nouns or noun phrases.

For example:



* Use Trait rather than TraitTreeNode
* Use Classifier rather than GetClassifiersTopLevelBrief







 Methods 

Names for methods or functions SHOULD follow the convention of <verb>_<noun>, where the noun is typically the resource type

[1].

The following table describes the standard naming conventions for methods and functions that map to operations on resources in a resource-oriented API.



Table 1. Naming conventions for methods and functions

 Verb Return type Maps to operation Comments 

 list Resource collection GET to the /resources endpoint Return a possibly paginated list of resources. 
 create or add Resource POST to the /resources endpoint Create new resource. 
 get Resource GET to the /resources/{id} endpoint Return the resource with identifier {id}. 
 update Resource POST or PATCH to the /resources/{id} endpoint Partial or selective update an existing resource. 
 replace Resource PUT to the /resources/{id} endpoint Replace an existing resource. 
 delete (None) DELETE to the /resources/{id} endpoint Delete the resource with identifier {id}. 
 set Resource PUT to the /resources/{id} endpoint Create a new resource or update the existing resource with identifier {id}. 
 check Resource GET to the /resources/{id} endpoint Success response if resource exists, else error. 



Operations that do not fit into one of the standard verb forms SHOULD use an "action" verb form, such as "translate" or "synthesize", and MAY omit the noun where it is implied or otherwise unnecessary.

Action methods generally map to either a POST or a GET operation, where GET is only permitted if the action is safe and idempotent.





 Namespaces 

All classes and methods of the SDK SHOULD be encapsulated in a namespace whenever possible in the language. Using namespaces minimizes the potential for naming conflicts with other packages and provides structure to the reference documentation.
The Voice add-on use is charged separately and in addition to your service plan charges.

Plan usage is measured based on the number of monthly active users, where a user is identified by the caller's unique phone number. An MD5 hash is applied to the phone number and the 128-bit hash value is used for billing purposes.

The number of concurrent calls that your assistant can participate in at one time depends on your plan type.



Plan details

 Plan Concurrent calls 

 Enterprise 1,000 
 Plus 100 
 Trial 5
For API usage examples, see the following resources:



* [Understanding and building an order using the SoftLayer API order CLI](https://softlayer.github.io/article/understanding-ordering/)
* [SoftLayer API Examples - Release Notes](https://softlayer.github.io/)
* [Python examples](https://softlayer.github.io/python/)





 Dedicated virtual servers usage examples 



* [Virtual_DedicatedHost API examples](https://sldn.softlayer.com/reference/services/SoftLayer_Virtual_DedicatedHost/)







 Public virtual servers usage examples 



* [Virtual_guest API examples](https://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/)
Table 2 describes the context variables that are set by your action. Table 3 describes the context variables that you can set by the SMS integration.



 Table 2. Context variables that are set by your action 



Table 2. SMS context variables set by the action

 Context variable name Expected value Description 

 smsConversationResponseTimeout Time in ms The amount of time in milliseconds that the integration waits to receive a response from the action. If the time limit is exceeded, the integration attempts to contact the action again. If the service still can't be reached, the SMS response fails. 







 Table 3. Context variables that are set by the integration 



Table 3. SMS context variables set by the integration

 Context variable name Description 

 smsTenantPhoneNumber The integration tenant phone number that the user is messaging. 
 smsUserPhoneNumber The phone number of the user that is exchanging messages with the integration. 
 smsUserData Data in JSON format to be passed verbatim to the service orchestration engine or Watson Assistant service. This variable is sent only if the session is started from the integration tenant and the data is sent through the REST API. 
 smsSessionTimeoutCount The session timeout value. This variable is sent only if the timeout value is defined through the REST API. 
 smsError When the integration fails to send an SMS message, this variable contains details about the error that occurred. 
 smsSessionID The globally unique identifier (GUID) for the related SMS Gateway session. 
 smsMedia The arraylist of mediaURL and corresponding mediaContentType. This context variable is cleared at the end of each conversation turn.
The following table shows examples of the shorthand syntax that you can use to write context variables in condition expressions.



 Shorthand syntax Full syntax in SpEL 

 $card_type context['card_type'] 
 $(card-type) context['card-type'] 
 $card_type:VISA context['card_type'] == 'VISA' 
 $card_type:(MASTER CARD) context['card_type'] == 'MASTER CARD' 



You can include special characters, such as hyphens or periods, in context variable names. However, doing so can lead to problems when the SpEL expression is evaluated. The hyphen could be interpreted as a minus sign, for example. To avoid such problems, reference the variable by using either the full expression syntax or the shorthand syntax $(variable-name) and do not use the following special characters in the name:



* Parentheses ()
* More than one apostrophe ''
* Quotation marks "



When you refer to a context variable in a text response or a dialog node condition, you can use the short syntax.

For example, Hello, $name. If the $name context variable contains Sam, then the response is shown as Hello, Sam.

If you want to reference a context variable by using the full syntax in a text response, be sure to surround the context variable in <? ?>. For example, Hello, <? context['name'] ?>.

If you want to reference a context variable that has multiple fields, such as $context.integrations.chat.browser_info.page_url. To use the full sytnax, specify <? context['integrations']['browser_info'] ?>.





 Shorthand syntax for entities 

The following table shows examples of the shorthand syntax that you can use when referring to entities.



 Shorthand syntax Full syntax in SpEL 

 @year entities['year']?.value 
 @year == 2016 entities['year']?.value == 2016 
 @year != 2016 entities['year']?.value != 2016
* replace - A string expression. If replace is not specified or is an empty string, nothing replaces the string that is removed from str.



: Example of an SQL function usage fragment

> SELECT replace('ABCabc', 'abc', 'DEF')
: Result value

ABCDEF





 reverse 

reverse(str)
: Returns the reversed indicated string.
: Example of an SQL function usage fragment

> SELECT reverse('Spark SQL')
: Result value

LQS krapS





 right 

right(str, len)
: Returns the rightmost len(len can be string type) characters from the string str, if len is less or equal than 0 the result is an empty string.
: Example of an SQL function usage fragment

> SELECT right('Spark SQL', 3)
: Result value

SQL





 rint 

rint(expr)
: Returns the double value that is closest in value to the argument and is equal to a mathematical integer.
: Example of an SQL function usage fragment

> SELECT rint(12.3456)
: Result value

12.0





 rlike 

str rlike regexp
: Returns true if str matches regexp, or false otherwise.
: Arguments



* str - A string expression.
* regexp - A string expression. The pattern string is a Java™ regular expression.



String literals (including regex patterns) are unescaped in our SQL parser. For example, to match "\abc", a regular expression for regexp can be "^\abc$".

: Example of an SQL function usage fragment

> SELECT '%SystemDrive%UsersJohn' rlike '%SystemDrive%\Users.'

: Result value

true

Note:

Use LIKE to match with simple string pattern.





 rollup 





 round 

round(expr, d)
: Returns expr rounded to d decimal places by using HALF_UP rounding mode.
: Example of an SQL function usage fragment

> SELECT round(2.5, 0)
: Result value
SMS integration reference 

Add action commands to the message context object to manage the flow of conversations with customers who interact with your assistant by submitting SMS messages over the telephone.

Learn about the supported commands and reserved context variables that are used by the SMS integration.



 Supported commands 

Each action consists of a command property, followed by an optional parameter property to define parameters for commands that require them. The commands that are described in the following table are supported by the SMS integration.



Table 1. Actions that you can initiate from the action

 Action command Description Parameters 

 terminateSession Ends the current SMS session. Use this command to ensure that the subsequent text message starts a new assistant-level session which does not retain any context values from the current session. None 
 smsActSendMedia Enables MMS messaging. mediaURL: Specifies a JSON array of publicly accessible media URLs that are sent to the user. 
 smsActSetDisambiguationConfig Configures how to handle the choices that are displayed in a disambiguation list. prefixText: Text to include before each option. For example, Press %s for where %s represents the number corresponding to a list choice; this is replaced with the actual number at run time. 
 smsActSetOptionsConfig Configures how to handle option response types. prefixText: Text to include before each option. For example, Press %s for where %s represents the number corresponding to a list choice; this is replaced with the actual number at run time. 







 Reserved context variables 

The following table describes the context variables that have special meaning in the context of the SMS integration. They should not be used for any purpose other than the documented use.

Table 2 describes the context variables that are set by your action. Table 3 describes the context variables that you can set by the SMS integration.



 Table 2. Context variables that are set by your action 



Table 2. SMS context variables set by the action

 Context variable name Expected value Description 

 smsConversationResponseTimeout Time in ms The amount of time in milliseconds that the integration waits to receive a response from the action.
"context": {
"input_lower_case": "<? input.text.toLowerCase() ?>"
}
}

Results in this output:

{
"context": {
"input_lower_case": "this is a dog!"
}
}





 String.toUpperCase() 

This method returns the original String converted to uppercase letters.

For this input:

"hi there".

This syntax:

{
"context": {
"input_upper_case": "<? input.text.toUpperCase() ?>"
}
}

Results in this output:

{
"context": {
"input_upper_case": "HI THERE"
}
}





 String.trim() 

This method trims any spaces at the beginning and the end of the string and returns the modified string.

For this Dialog runtime context:

{
"context": {
"my_text": " something is here "
}
}

This syntax:

{
"context": {
"my_text": "<? $my_text.trim() ?>"
}
}

Results in this output:

{
"context": {
"my_text": "something is here"
}
}





 java.lang.String support 

In addition to the built-in methods, you can use standard methods of the java.lang.String class.



 java.lang.String.format() 

You can apply the standard Java String format() method to text. See [java.util.formatter reference](https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.htmlsyntax) for information about the syntax to use to specify the format details.

For example, the following expression takes three decimal integers (1, 1, and 2) and adds them to a sentence.

{
This section explains events that are generated when a user looks at the information that is provided through the Manage > Billing and usage > Usage section, or request an export of the data.

You can get events with reason.reasonCode = 404 that are generated when there is no usage data available for the request. The severity is set to normal.



 requestData fields 

The following table lists the fields that are available through the requestData field in the events with actions billing.account-summary.read, billing.account-summary.download, and billing.account-instances-usage-report.download:



Table 16. Account usage summary requestData fields

 Field Type Description Status 

 month String Indicates the month that the user selects to view usage data. Included always in the event 



The following table lists the fields that are available through the requestData field in the events with actions billing.account-usage-report.read:



Table 17. Account usage requestData fields

 Field Type Description Status 

 month String Indicates the month that the user selects to view usage data. Included always in the event 
 usage_report_type String Indicates the type of report. <br>Valid values are instances and rollup. Included always in the event 
 sub_account_id String Indicates the sub-account ID. Optional 
 resource_group String Indicates the resource group. Optional <br>Included if the user filters data by resource group. 
 organization_id String Indicates the organization ID. Optional 
 daily Boolean Indicates the frequency of the report. Optional 



The following table lists the fields that are available through the requestData field in the events with actions billing.enterprise-usage-report.read and billing.enterprise-usage-report.download:



Table 18. Enterprise usage requestData fields

 Field Type Description Status 

 month String Indicates the month that the user selects to view usage data. Included always in the event 
 children Boolean Indicates whether the usage is aggregated at account level. Included always in the event 
 enterprise_id String Indicates the ID of the enterprise. Included always in the event 
 account_id String Indicates the sub-account ID that is requested in the report. Optional
Define a finite set of terms with a dictionary 

Recognize terms and synonyms for terms that are significant to you, such as the names of products that you sell.

Help Discovery find terms that have meaning to your use case by adding a dictionary. You can define multiple synonyms for a term or a set of words in the same category.

You can create a dictionary by adding the terms one by one or by uploading a CSV file that lists the terms.

To add dictionary terms one by one, complete the following steps:



1. From the Teach domain concepts section of the Improvement tools panel, choose Dictionaries.
2. Click New.
3. Name your dictionary.

For example, Transportation.
4. Choose the language. A dictionary can contain terms in only one language.
5. Optional: Expand Advanced options, and edit the facet name for the dictionary.

Facets are used to categorize documents. A user can choose a facet type to narrow their search results. The dictionary name in lowercase is used as the facet name by default. You might want to change the facet to be uppercase.
6. Enter a term, and then select the + button to add it.

For example vehicle and engine.

In English dictionaries, specify the dictionary terms in lowercase. Only use uppercase if you want Discovery to ignore lowercase mentions of the term when they occur in text. When terms are analyzed to determine whether they are occurrences of the dictionary enrichment, the surface form of the term with uppercase match is used. For example, a vehicle entry in the dictionary results in annotations for vehicle, Vehicle, or VEHICLE mentions when they occur in text. For a Sat entry in the dictionary, annotations are added for Sat or SAT, but not for sat.

Dictionary matching is case-sensitive for Arabic, Chinese, Korean, Japanese, and Hebrew.
7. To add synonyms for the term, click the Edit icon, and then enter synonyms in the Other terms field. Separate multiple synonyms with a comma. Click Save term.
If the node response is, You said: $repeat, then the response would be displayed as, You said: I want to order a device.

To store the value of an entity in a context variable, use this syntax:



Capturing an entity mention

 Variable Value 

 place @place 



For example, the user input is, I want to go to Paris. If your @place entity recognizes Paris, then your assistant saves Paris in the $place context variable.

To store the value of a string that you extract from the user's input, you can include a SpEL expression that uses the extract method to apply a regular expression to the user input. The following expression extracts a number from the user input, and saves it to the $number context variable.



Using a Sting method

 Variable Value 

 number <?input.text.extract('[d]+',0)?> 



To store the value of a pattern entity, append .literal to the entity name. Using this syntax ensures that the exact span of text from user input that matched the specified pattern is stored in the variable.



Capturing a patten entity value

 Variable Value 

 email <? @email.literal ?> 



For example, the user input is Contact me at joe@example.com. Your entity named @email recognizes the name@domain.com email format. By configuring the context variable to store @email.literal, you indicate that you want to store the part of the input that matched the pattern. If you omit the .literal property from the value expression, then the entity value name that you specified for the pattern is returned instead of the segment of user input that matched the pattern.

Many of these value examples use methods to capture different parts of the user input. For more information about the methods available for you to use, see [Expression language methods](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-methods).





 Deleting a context variable 

To delete a context variable, set the variable to null.



Nulling a context variable

 Variable Value 

 order_form null 



Alternatively you can delete the context variable in your application logic.
{
"context": {
"my_text": "This is a text."
}
}

This syntax:

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

Results in this output:

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





 String.contains(String) 

This method returns true if the string contains the input substring.

Input: "Yes, I'd like to go."

This syntax:

{
"conditions": "input.text.contains('Yes')"
}

Results: The condition is true.





 String.endsWith(String) 

This method returns true if the string ends with the input substring.

For this input:

"What is your name?".

This syntax:

{
"conditions": "input.text.endsWith('?')"
}

Results: The condition is true.





 String.equals(String) 

This method returns true if the specified string equals the input string exactly.

Input: "Yes"

This syntax:

{
"conditions": "input.text.equals('Yes')"
}

Results: The condition is true.

If the input is Yes., then the result is false because the user included a period and the expression expects only the exact text, Yes without any punctuation.





 String.equalsIgnoreCase(String) 

This method returns true if the specified string equals the input string, regardless of whether the case of the letters match.

Input: "yes"

This syntax:

{
"conditions": "input.text.equalsIgnoreCase('Yes')"
}

Results: The condition is true.
Defining intents 

Intents are purposes or goals that are expressed in a customer's input, such as answering a question or processing a bill payment. By recognizing the intent expressed in a customer's input, the Watson Assistant service can choose the correct dialog flow for responding to it.



 Intent creation overview 



* Plan the intents for your application.

Consider what your customers might want to do, and what you want your application to be able to handle on their behalf. For example, you might want your application to help your customers make a purchase. If so, you can add a buy_something intent. (The that is added as a prefix to the intent name helps to clearly identify it as an intent.)
* Teach Watson about your intents.

After you decide which business requests that you want your application to handle for your customers, you must teach Watson about them. For each business goal (such as buy_something), you must provide at least 5 examples of utterances that your customers typically use to indicate their goal. For example, I want to make a purchase.

Ideally, find real-world user utterance examples that you can extract from existing business processes. The user examples should be tailored to your specific business. For example, if you are an insurance company, a user example might look more like this, I want to buy a new XYZ insurance plan.

The examples that you provide are used by your assistant to build a machine learning model that can recognize the same and similar types of utterances and map them to the appropriate intent.



Start with a few intents, and test them as you iteratively expand the scope of the application.





 Creating intents 



1. Open your dialog skill. The skill opens to the Intents page.
2. Select Create intent.
3. In the Intent name field, type a name for the intent.



* The intent name can contain letters (in Unicode), numbers, underscores, hyphens, and periods.
* The name cannot consist of .. or any other string of only periods.
* Intent names cannot contain spaces and must not exceed 128 characters. The following are examples of intent names:



* weather_conditions
"toppings_array": "<? $toppings_array.removeValue('onion') ?>"
}
}

Result:

{
"context": {
"toppings_array": ["olives"]
}
}
* Remove by position: Removing an element from an array by its index position:

For this Dialog runtime context:

{
"context": {
"toppings_array": ["onion", "olives"]
}
}

Make this update:

{
"context": {
"toppings_array": "<? $toppings_array.remove(0) ?>"
}
}

Result:

{
"context": {
"toppings_array": ["olives"]
}
}



* Overwrite: To overwrite the values in an array, simply set the array to the new values:

For this Dialog runtime context:

 {: codeblock}
{
"context": {
"toppings_array": ["onion", "olives"]
}
}


Make this update:

 {: codeblock}
{
"context": {
"toppings_array": ["ketchup", "tomatoes"]
}
}


Result:

 {: codeblock}
{
"context": {
"toppings_array": ["ketchup", "tomatoes"]
}
}




See [Expression language methods](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-methodsdialog-methods-arrays) for more information about methods you can perform on arrays.







 Setting one context variable equal to another 

When you set one context variable equal to another context variable, you define a pointer from one to the other. If the value of one of the variables subsequently changes, then the value of the other variable is changed also.