vania-janet/multiturn-rag-retrieval-data huggingface dataset:
curl -H "Authorization: Bearer {token}" -H "Content-Type:application/json" -X POST -d "{"input": {"text": "Hello"}}" "https://{my-cluster-hostname}/assistant/api/v2/assistants/{assistant_id}/sessions/{session_id}/message?version=2019-02-28"



* {token} is the token that is generated in Step 3.
* {assistant_id} is the assistant ID you copied in Step 2.
* {session_id} is the ID of the session that you created in the previous step.



8. Review the response to make sure it includes the search results that you expect.
9. Repeat this procedure to submit queries that trigger the search.

You can continue to repeat the previous step to submit new inputs within the same session. However, if you stop interacting with the service for a period of time longer than the session timeout (60 minutes), you will have to create a new session to continue.



If you initiate any type of search from your dialog, test the dialog to ensure that the search is triggered as expected. Also test that a search is triggered only when no existing dialog nodes can address the user input. And any time a search is triggered, ensure that it returns meaningful results.





 Sending more requests to the search skill 

If you want the dialog skill to respond less often and to send more queries to the search skill instead, you can configure the dialog to do so.

You must add both a dialog skill and search skill to your assistant for this approach to work.

Follow this procedure to make it less likely that the dialog will respond by resetting the confidence level threshold from the default setting of 0.2 to 0.5. Changing the confidence level threshold to 0.5 instructs your assistant to not respond with an answer from the dialog unless the assistant is more than 50% confident that the dialog can understand the user's intent and can address it.



1. From the Dialog page of your dialog skill, make sure that the last node in the dialog tree has an anything_else condition with a search skill response type.
The speaker model serves as a baseline to distinguish prosodic features in the audio of the prompt.

When you create a speaker model, you provide enrollment audio and a name for the model that is unique within the context of the owning service instance:



* The enrollment audio must include speech that is spoken by the user who is associated with the model. The service extracts information about the speaker's voice from the audio sample that you provide.
* The name provides a human-readable handle for the model. The service returns a speaker ID, which is a globally unique identifier (GUID) (for example, 823068b2-ed4e-11ea-b6e0-7b6456aa95cc) that you use to identify the speaker in subsequent requests to the service.



The service uses the information that it extracts from the audio to train itself on the speaker's pitch, cadence, and intonation. This information can make a significant difference in the quality of prompts that are associated with the model, especially short prompts with relatively little audio.

You create a speaker model for a given instance of the service. A single speaker model can be associated with multiple prompts that are defined for multiple custom models within that service instance. The gender of the speaker who creates a speaker model does not need to match the gender of a voice that is used with prompts that are associated with that speaker model. For example, a speaker model that is created by a male speaker can be associated with prompts that are spoken by female voices.
From: <sip:a@atlanta.example.com>;tag=193402342
Call-ID: 898234234@agenta.atlanta.example.com
CSeq: 93809823 REFER
Max-Forwards: 70
Refer-To: sip:user@domain.com
User-to-User: 637573746f6d2d757365722d746f2d75736572;encoding=hex
X-Watson-Assistant-Session-History-Key: dev::latest::212033::0a64c30d-c558-4055-85ad-ef75ad6cc29d::978f1fd7-4e24-47d8-adb0-24a8a6eff69e::b5ffd6c2-902f-4658-b586-e3fc170a6cf3::7ad616a350cc48078f17e3ee3df551de
Contact: sip:a@atlanta.example.com
Content-Length: 0

This example shows the metadata passed into the Refer-To header as query parameters (as defined by [SIP RFC 3261](https://tools.ietf.org/html/rfc3261)).

REFER sip:b@atlanta.example.com SIP/2.0
Via: SIP/2.0/UDP agenta.atlanta.example.com;branch=z9hG4bK2293940223
To: <sip:b@atlanta.example.com>
From: <sip:a@atlanta.example.com>;tag=193402342
Call-ID: 898234234@agenta.atlanta.example.com
CSeq: 23 REFER
Max-Forwards: 70
Refer-To: sip:user@domain.com?User-to-User=637573746f6d2d757365722d746f2d75736572%3Bencoding%3Dhex
Contact: sip:a@atlanta.example.com
"location": "/v1/cb967e0d-43c1-454a-968d-0efa24766846/Users/34e1ea6d-cc02-4941-9462-7e9c5a40b360",
"lastModified": "2018-12-10T16:05:36.675Z",
"resourceType": "User"
},
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"name": {
"givenName": "test",
"familyName": "test",
"formatted": "test test"
},
"id": "34e1ea6d-cc02-4941-9462-7e9c5a40b360"
}







 Finding user-related events 

You can track the events of specific Cloud Directory users in Activity Tracker by using their email. Before you can begin tracking, the email must be mapped to a Cloud Directory GUID.



1. Obtain an IAM token, a tenant ID, and a region as described in the previous section.
2. Insert the IAM token, the tenant ID, and the email into the following command to obtain the user information.

curl -X GET
--header 'Accept: application/json'
--header 'Authorization: Bearer <IAMToken>'
'https://<region>.appid.cloud.ibm.com/<tenantID>/users?email=<emailAddress>'

The email address must be escaped. For example, myTest%40yahoo.com instead of myTest@yahoo.com.

Alternatively, you can use the [Management APIs](https://us-south.appid.cloud.ibm.com/swagger-ui//Config/getAuditStatus). Your output would look similar to the following JSON object:

{
"users": [
When the call returns with a 201 response code to indicate success, the audio is fully processed and the speaker enrollment is complete.





 Add a custom prompt 

To add a prompt to a custom model, use the POST /v1/customizations/{customization_id}/prompts/{prompt_id} method. You pass a unique identifier for the prompt as a path parameter. You then use that ID to specify the prompt in speech synthesis and other requests to the service.

You pass the required text of the prompt and the optional speaker ID with the prompt_text and speaker_id fields as a JSON object by using the multipart form parameter named metadata. You pass the audio for the prompt with a multipart form parameter named file. The audio must be in WAV format and must have a sampling rate of no less that 16 kHz. For more information about the rules and guidelines for the prompt ID, text, and audio, see [Rules for creating custom prompts](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-rulestbe-rules-prompts).

It is very important that the text and audio of the prompt match exactly. Discrepancies can reduce the quality of the synthesized prompt or even result in failure of the request.

The following example creates a custom prompt named goodbye that contains a simple farewell message. The request specifies the speaker ID for the speaker named speaker_one and the customization ID for the custom model that was created in the first step. The Content-Type header of the request must be multipart/form-data.

IBM Cloud

curl -X POST -u apikey:{apikey} --header "Content-Type:multipart/form-data" --form metadata="{"prompt_text": "Thank you and good-bye!"
For example, to find any detected intents with intent names that start with 'User_', you can use a syntax like this in the condition:

intents[0].intent.startsWith("User_")

However, when you do so, all of the detected intents are considered, even those with a confidence lower than 0.2. Also check that intents which are considered irrelevant by Watson based on their confidence score are not returned. To do so, change the condition as follows:

!irrelevant && intents[0].intent.startsWith("User_")
* How fuzzy matching impacts entity recognition: If you use an entity as the condition and fuzzy matching is enabled, then @entity_name evaluates to true only if the confidence of the match is greater than 30%. That is, only if @entity_name.confidence > .3.







 Storing and recognizing entity pattern groups in input 

To store the value of a pattern entity in a context variable, 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.



 Variable Value 

 email 



To store the text from a single group in a pattern entity with groups defined, specify the array number of the group that you want to store. For example, assume that the entity pattern is defined as follows for the @phone_number entity. (Remember, the parentheses denote pattern groups):

b((958)|(555))-(d{3})-(d{4})b

To store only the area code from the phone number that is specified in user input, you can use the following syntax:



 Variable Value 

 area_code 



The groups are delimited by the regular expression that is used to define the group pattern. For example, if the user input that matches the pattern defined in the entity @phone_number is: 958-234-3456, then the following groups are created:



Group details

 Group number Regex engine value Dialog value Explanation 

 groups[0] 958-234-3456 958-234-3456 The first group is always the full matching string.
"id": "a342dbfb-3ea7-48d1-96e8-2825ec5feab4"
}
}

A successful response looks like the following example.

{
"id": "8948ad59-bc0f-7510-812f-5dc64f59fab8",
"crn": "crn:[...]",
"name": "my-volume-1",
"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/8948ad59-bc0f-7510-812f-5dc64f59fab8",
"capacity": 20,
"iops": 100,
"encryption_key": {
"crn": "crn:[...key:...]"
},
"encryption": "user_managed",
"status": "available",
"zone": {
"name": "us-south-3",
"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/
us-south-3"
},
"profile": {
"name": "general-purpose",
"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/
general-purpose"
},
"resource_group": {
"id": "a342dbfb-3ea7-48d1-96e8-2825ec5feab4",
"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/
a342dbfb-3ea7-48d1-96e8-2825ec5feab4",
"name": "Default"
},
"volume_attachments": [],
If you do not take action, the same text response is displayed a second time to let users know they have returned to the node they digressed away from. You can make it clearer to users that they have returned to the original conversation thread by specifying a unique message to be displayed when they return.

For example, if the original text response for the node is, What's the order number?, then you might want to display a message like, Now let's get back to where we were. What is the order number? when users return to the node.

To do so, use the following syntax to specify the node text response:

<? (returning_from_digression)? "post-digression message" : "first-time message" ?>

For example:

<? (returning_from_digression)? "Now, let's get back to where we were.
What is the order number?" : "What's the order number?" ?>

You cannot include SpEL expressions or shorthand syntax in the text responses that you add. In fact, you cannot use shorthand syntax at all. Instead, you must build the message by concatenating the text strings and full SpEL expression syntax together to form the full response.

For example, use the following syntax to include a context variable in a text response that you would normally specify as, What can I do for you, $username?:

<? (returning_from_digression)? "Where were we, " +
context["username"] + "? Oh, I was asking what can I do
for you today." : "What can I do for you today, " +
context["username"] + "?" ?>

For full SpEL expression syntax details, see [Expression for accessing objects](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-expression-languageexpression-language-shorthand-syntax).
US Health Insurance Portability and Accountability Act (HIPAA) support is available for Premium plans that are hosted in the Washington, DC, (us-east) and Dallas (us-south) locations. For more information, see [Enabling EU and HIPAA supported settings](https://cloud.ibm.com/docs/account?topic=account-eu-hipaa-supportedeu-hipaa-supported).

Do not include personal health information (PHI) in data that is to be added to custom models. Specifically, be sure to remove any PHI from data that you use for custom language models or custom acoustic models.





 Labeling and deleting data in the Speech to Text service 

The IBM Watson® Speech to Text service enables you to delete all data that is associated with recognition requests, custom language models, and custom acoustic models. To delete data, you must do the following:



1. Use the X-Watson-Metadata header to associate a customer ID with data that is passed by a request to the service; see [Specifying a customer ID](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-information-securityspecify-customer-id).
2. Use the DELETE /v1/user_data method to delete all data that is associated with a specified customer ID; see [Deleting data](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-information-securitydelete-pi).



By default, no customer ID is associated with data.

Experimental and beta features are not intended for use with a production environment and therefore are not guaranteed to function as expected when labeling and deleting data. Experimental and beta features should not be used when implementing a solution that requires the labeling and deletion of data.



 Specifying a customer ID 

To associate a customer ID with data, include the X-Watson-Metadata header with the request that passes the information. You pass the string customer_id={id} as the argument of the header.

A customer ID can include any characters except for the ; (semicolon) and = (equals sign).
A resource's self-referential id field MUST be required in any object schema used in a response and representing the resource. An identifier field that expresses an optional binding to a related resource MAY be optional.



Schema guidance for identifiers in responses

 Constraint Recommended value Description 

 type string type MUST be string. 
 format identifier format MUST be identifier. 
 maxLength 128 maxLength SHOULD be present. 
 pattern ^[-0-9a-z]+$ pattern SHOULD be present. 







 Request formats 

For requests, an identifier field MUST have a documented maximum length and SHOULD have a maximum length of 128 characters or fewer. An identifier MUST have a permissible character set limited to printable ASCII and SHOULD have a permissible character set further constrained to alphanumeric characters and the hyphen (-).

Length and character set constraints MUST be checked prior to any other processing (including case normalization

[1]) of an identifier included in a request. For fields containing system-generated identifiers, documented constraints MAY be more permissive (allowing for a longer value or larger character set) than the implementation permits. Failure to match constraints MUST cause the entire request to fail with a 400 status code and appropriate error response model.

In request bodies and query parameters, identifier values SHOULD be matched case-insensitively.

A resource's self-referential id field MUST be excluded

[2]from any object schema used in a request to mutate that resource.



Schema guidance for identifiers in requests

 Constraint Recommended value Description 

 type string type MUST be string. 
 format identifier format MUST be identifier. 
 maxLength 128 maxLength MUST be present. 
 pattern ^[-0-9A-Za-z]+$ pattern MUST be present. 









 Boolean 

The boolean type contains either a true or false value.



 Response format 

A boolean value MUST be returned as the JSON keyword true or the JSON keyword false.

[3]

In a response body, a boolean field MUST be required.
The @sys-location and @sys-person system entities were removed
: The @sys-location and @sys-person system entities are no longer listed on the System entities page. If your dialog uses one of these entities, a red Entity not created notification is displayed to inform you that the entity is not recognized.

Skill menu actions moved
: The menu that was displayed in the header of the skill while you were working with a skill was removed. The actions that were available from the menu, such as import and export, are still available. Go to the Skills page, and click the menu on the skill tile.

The import skill process was updated to support overwriting an existing skill on import. For more information, see [Overwriting a skill](https://cloud.ibm.com/docs/assistant?topic=assistant-skill-tasksskill-tasks-overwrite).

Dialog issues were addressed
: These dialog issues were addressed:



* Fixed an issue with adding a jump-to from a conditional response in one node to a conditional response in another node.
* The page now responds better when you scroll horizontally to see multiple levels of child nodes.







 15 July 2020 

Support ended for @sys-location and @sys-person
: The person and location system entities, which were available as a beta feature in English dialog skills only, are no longer supported. You cannot enable them. If your dialog uses them, they are ignored by the service.

Use contextual entities to teach your skill to recognize the context in which such names are used. For more information about contextual entities, see [Annotation-based method](https://cloud.ibm.com/docs/assistant?topic=assistant-entitiesentities-annotations-overview).

For more information about how to use contextual entites to identify names of people, see the [Detecting Names And Locations With Watson Assistant](https://medium.com/ibm-watson/detecting-names-and-locations-with-watson-assistant-e3e1fa2a8427) blog post on Medium.

How legacy numeric system entities are processed has changed
To delete messages for one or more individuals, you first need to associate a message with a unique Customer ID for each individual. To specify the Customer ID for any message sent using the /message API, include the X-Watson-Metadata: customer_id property in your header. You can pass multiple Customer ID entries with semicolon separated field=value pairs, using customer_id, as in the following example:

curl -X POST -u "apikey:3Df... ...Y7Pc9" --header "Content-Type: application/json" "X-Watson-Metadata: customer_id={first-customer-ID};customer_id={second-customer-ID}" --data "{"input":{"text":"hello"}}" "{url}/v2/assistants/{assistant_id}/sessions/{session_id}/message?version=2019-02-28"

where {url} is the appropriate URL for your instance. For more details, see [Service endpoint](https://cloud.ibm.com/apidocs/assistant/assistant-v2service-endpoint) }.

The customer_id string cannot include the semicolon (;) or equal sign (=) characters. You are responsible for ensuring that each Customer ID parameter is unique across your customers.

To delete messages using customer_id values, see the [Information security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-securityinformation-security-gdpr-wa) topic.
},
'skills': {
'main skill': {
'user_defined': {
'account_number': '123456'
}
}
}
}
).get_result()

print(json.dumps(response, indent=2))

service
.message({
assistant_id: '{assistant_id}',
session_id: '{session_id}',
input: {
message_type: 'text',
text: 'Hello',
options: {
'return_context': true
}
},
context: {
'global': {
'system': {
'user_id': 'my_user_id'
}
},
'skills': {
'main skill': {
'user_defined': {
'account_number': '123456'
}
}
}
}
})
.then(res => {
console.log(JSON.stringify(res, null, 2));
})
.catch(err => {
console.log(err);
});

In this example request, the application specifies a value for user_id as part of the global context. In addition, it sets one user-defined context variable (account_number) as part of the skill-specific context. This context variable can be accessed by dialog nodes as $account_number. (For more information about using the context in your dialog, see [How the dialog is processed](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-runtime).)

You can specify any variable name you want to use for a user-defined context variable. If the specified variable already exists, it is overwritten with the new value; if not, a new variable is added to the context.

The output from this request includes not only the usual output, but also the context, showing that the specified values have been added.
message Required Description of the log that is generated. 
 msg_timestamp Required UTC timestamp of the message. 
 messageID Required ID of the log that is generated. 
 resolution Optional Guidance on how to proceed if you receive this log record. 
 documentsURL Optional More information on how to proceed if you receive this log record. 
 sourceID Required CRN of the IBM Cloud service that sends the notification through the Event Notifications service. 
 notificationID Optional ID of the notification that is sent to a destination. 
 destinationID Optional ID of the destination for which the status is being reported. 
 level Required Type of log. Valid values are INFO, WARN, ERROR 







 Log messages 

The following table lists the message IDs that are generated by the Event Notifications service:



Table 5. Message IDs

 Message ID Log type Description 

 event-notifications.00001I INFO A notification event from source <sourceID> has been received. CRN is used for IBM Cloud services. SourceID can be an IBM Cloud service or a human, for example 
 event-notifications.00002I INFO The notification ID <NOTIFICATION-ID> has been assigned to the event that is originated from source <sourceID>. 
 event-notifications.00003I INFO A notification event with ID <NOTIFICATION-ID> is published through the following topic IDs: [<LIST-OF-TOPIC-IDS>] 
 event-notifications.00004I INFO A notification request with ID <NOTIFICATION-ID> is processed by the following subscribers: [<LIST-OF-SUBSCRIPTIONS>] 
 event-notifications.00006I INFO No devices found for platform: push_chrome Valid platforms are [push_chrome, push_firefox, push_android, push_ios, push_safari] 
 event-notifications.00007I INFO An SMS is dispatched to the following numbers: [<LIST-OF-TELEPHONE-NUMBERS]. 
 event-notifications.00008I INFO An email is sent to each of the following destinataries: [<LIST-OF-EMAIL-ADDRESSES>] 
 event-notifications.00009I INFO A webhook is successfully served.