Introduction
The IBM® watsonx™ Assistant service combines machine learning, natural language understanding, and an integrated dialog editor to create conversation flows between your apps and your users.
The Assistant v2 API provides runtime methods your client application can use to send user input to an assistant and receive a response.
You need a paid Plus plan or higher to use the watsonx Assistant v2 API.
This documentation describes Java SDK major version 9. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes Node SDK major version 6. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes Python SDK major version 5. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes Ruby SDK major version 2. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes .NET Standard SDK major version 5. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes Go SDK major version 2. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes Swift SDK major version 4. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes Unity SDK major version 5. For more information about how to update your code from the previous version, see the migration guide.
If you need to change a skill programmatically (rather than by using the watsonx Assistant user interface), you can use the workspace authoring methods that are provided by the v1 API.
If you need to change a skill programmatically (rather than by using the watsonx Assistant user interface), you can use the workspace authoring methods that are provided by the v1 API.
If you need to change a skill programmatically (rather than by using the watsonx Assistant user interface), you can use the workspace authoring methods that are provided by the v1 API.
If you need to change a skill programmatically (rather than by using the watsonx Assistant user interface), you can use the workspace authoring methods that are provided by the v1 API reference.
If you need to change a skill programmatically (rather than by using the watsonx Assistant user interface), you can use the workspace authoring methods that are provided by the v1 API.
If you need to change a skill programmatically (rather than by using the watsonx Assistant user interface), you can use the workspace authoring methods that are provided by the v1 API.
If you need to change a skill programmatically (rather than by using the watsonx Assistant user interface), you can use the workspace authoring methods that are provided by the v1 API.
If you need to change a skill programmatically (rather than by using the watsonx Assistant user interface), you can use the workspace authoring methods that are provided by the v1 API.
If you need to change a skill programmatically (rather than by using the watsonx Assistant user interface), you can use the workspace authoring methods that are provided by the v1 API.
The IBM Watson Unity SDK has the following requirements.
- The SDK requires Unity version 2018.2 or later to support Transport Layer Security (TLS) 1.2.
- Set the project settings for both the Scripting Runtime Version and the Api Compatibility Level to
.NET 4.x Equivalent
. - For more information, see TLS 1.0 support.
- Set the project settings for both the Scripting Runtime Version and the Api Compatibility Level to
- The SDK doesn't support the WebGL projects. Change your build settings to any platform except
WebGL
.
For more information about how to install and configure the SDK and SDK Core, see https://github.com/watson-developer-cloud/unity-sdk.
The code examples on this tab use the client library that is provided for Java.
Maven
<dependency>
<groupId>com.ibm.watson</groupId>
<artifactId>ibm-watson</artifactId>
<version>13.0.0</version>
</dependency>
Gradle
compile 'com.ibm.watson:ibm-watson:13.0.0'
GitHub
The code examples on this tab use the client library that is provided for Node.js.
Installation
npm install ibm-watson@^9.1.0
GitHub
The code examples on this tab use the client library that is provided for Python.
Installation
pip install --upgrade "ibm-watson>=8.1.0"
GitHub
The code examples on this tab use the client library that is provided for Ruby.
Installation
gem install ibm_watson
GitHub
The code examples on this tab use the client library that is provided for Go.
go get -u github.com/watson-developer-cloud/go-sdk/v2@v3.0.0
GitHub
The code examples on this tab use the client library that is provided for Swift.
Cocoapods
pod 'IBMWatsonAssistantV2', '~> 5.0.0'
Carthage
github "watson-developer-cloud/swift-sdk" ~> 5.0.0
Swift Package Manager
.package(url: "https://github.com/watson-developer-cloud/swift-sdk", from: "5.0.0")
GitHub
The code examples on this tab use the client library that is provided for .NET Standard.
Package Manager
Install-Package IBM.Watson.Assistant.v2 -Version 7.0.0
.NET CLI
dotnet add package IBM.Watson.Assistant.v2 --version 7.0.0
PackageReference
<PackageReference Include="IBM.Watson.Assistant.v2" Version="7.0.0" />
GitHub
The code examples on this tab use the client library that is provided for Unity.
GitHub
URLs for the AI assistant builder of watsonx Orchestrate
The AI assistant builder of watsonx Orchestrate integrates the power of large language models (LLMs) with the conversational capabilities of watsonx Assistant to enable responsive and interactive conversation between the users and watsonx Orchestrate through AI assistants. The methods on the watsonx Assistant API are applicable to watsonx Orchestrate.
To get the endpoint URL of your watsonx Orchestrate instance and generate the authentication API key, see Getting started with IBM watsonx Orchestrate API, then use the endpoint URL and the API key on the methods of this API.
IBM Cloud URLs
The base URLs come from the service instance. To find the URL, view the service credentials by clicking the name of the service in the Resource list. Use the value of the URL. Add the method to form the complete API endpoint for your request.
The following example URL represents a watsonx Assistant instance that is hosted in Washington, DC:
https://api.us-east.assistant.watson.cloud.ibm.com/instances/6bbda3b3-d572-45e1-8c54-22d6ed9e52c2
The following URLs represent the base URLs for watsonx Assistant. When you call the API, use the URL that corresponds to the location of your service instance.
- Dallas:
https://api.us-south.assistant.watson.cloud.ibm.com
- Washington, DC:
https://api.us-east.assistant.watson.cloud.ibm.com
- Frankfurt:
https://api.eu-de.assistant.watson.cloud.ibm.com
- Sydney:
https://api.au-syd.assistant.watson.cloud.ibm.com
- Tokyo:
https://api.jp-tok.assistant.watson.cloud.ibm.com
- London:
https://api.eu-gb.assistant.watson.cloud.ibm.com
- Seoul:
https://api.kr-seo.assistant.watson.cloud.ibm.com
Set the correct service URL by calling the setServiceUrl()
method of the service instance.
Set the correct service URL by specifying the serviceUrl
parameter when you create the service instance.
Set the correct service URL by calling the set_service_url()
method of the service instance.
Set the correct service URL by specifying the service_url
property of the service instance.
Set the correct service URL by calling the SetServiceURL()
method of the service instance.
Set the correct service URL by setting the serviceURL
property of the service instance.
Set the correct service URL by calling the SetServiceUrl()
method of the service instance.
Set the correct service URL by calling the SetServiceUrl()
method of the service instance.
Dallas API endpoint example for services managed on IBM Cloud
curl -X {request_method} -u "apikey:{apikey}" "https://api.us-south.assistant.watson.cloud.ibm.com/instances/{instance_id}"
Your service instance might not use this URL
Default URL
https://api.us-south.assistant.watson.cloud.ibm.com
Example for the Washington, DC location
IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
Assistant assistant = new Assistant("{version}", authenticator);
assistant.setServiceUrl("https://api.us-east.assistant.watson.cloud.ibm.com");
Default URL
https://api.us-south.assistant.watson.cloud.ibm.com
Example for the Washington, DC location
const AssistantV2 = require('ibm-watson/assistant/v2');
const { IamAuthenticator } = require('ibm-watson/auth');
const assistant = new AssistantV2({
version: '{version}',
authenticator: new IamAuthenticator({
apikey: '{apikey}',
}),
serviceUrl: 'https://api.us-east.assistant.watson.cloud.ibm.com',
});
Default URL
https://api.us-south.assistant.watson.cloud.ibm.com
Example for the Washington, DC location
from ibm_watson import AssistantV2
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
authenticator = IAMAuthenticator('{apikey}')
assistant = AssistantV2(
version='{version}',
authenticator=authenticator
)
assistant.set_service_url('https://api.us-east.assistant.watson.cloud.ibm.com')
Default URL
https://api.us-south.assistant.watson.cloud.ibm.com
Example for the Washington, DC location
require "ibm_watson/authenticators"
require "ibm_watson/assistant_v2"
include IBMWatson
authenticator = Authenticators::IamAuthenticator.new(
apikey: "{apikey}"
)
assistant = AssistantV2.new(
version: "{version}",
authenticator: authenticator
)
assistant.service_url = "https://api.us-east.assistant.watson.cloud.ibm.com"
Default URL
https://api.us-south.assistant.watson.cloud.ibm.com
Example for the Washington, DC location
assistant, assistantErr := assistantv2.NewAssistantV2(options)
if assistantErr != nil {
panic(assistantErr)
}
assistant.SetServiceURL("https://api.us-east.assistant.watson.cloud.ibm.com")
Default URL
https://api.us-south.assistant.watson.cloud.ibm.com
Example for the Washington, DC location
let authenticator = WatsonIAMAuthenticator(apiKey: "{apikey}")
let assistant = Assistant(version: "{version}", authenticator: authenticator)
assistant.serviceURL = "https://api.us-east.assistant.watson.cloud.ibm.com"
Default URL
https://api.us-south.assistant.watson.cloud.ibm.com
Example for the Washington, DC location
IamAuthenticator authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
AssistantService assistant = new AssistantService("{version}", authenticator);
assistant.SetServiceUrl("https://api.us-east.assistant.watson.cloud.ibm.com");
Default URL
https://api.us-south.assistant.watson.cloud.ibm.com
Example for the Washington, DC location
var authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
while (!authenticator.CanAuthenticate())
yield return null;
var assistant = new AssistantService("{version}", authenticator);
assistant.SetServiceUrl("https://api.us-east.assistant.watson.cloud.ibm.com");
Cloud Pak for Data URLs
For services installed on Cloud Pak for Data, the base URLs come from both the cluster and service instance.
You can find the base URL from the Cloud Pak for Data web client in the details page about the instance. Click the name of the service in your list of instances to see the URL.
Use that URL in your requests to watsonx Assistant v2. For Cloud Pak for Data System, use a hostname that resolves to an IP address in the cluster.
Set the URL by calling the setServiceUrl()
method of the service instance. For Cloud Pak for Data System, use a hostname that resolves to an IP address in the cluster.
Set the correct service URL by specifying the serviceUrl
parameter when you create the service instance. For Cloud Pak for Data System, use a hostname that resolves to an IP address in the cluster.
Set the correct service URL by specifying the url
parameter when you create the service instance or by calling the set_url()
method of the service instance. For Cloud Pak for Data System, use a hostname that resolves to an IP address in the cluster.
Set the correct service URL by specifying the url
parameter when you create the service instance or by calling the url=
method of the service instance. For Cloud Pak for Data System, use a hostname that resolves to an IP address in the cluster.
Set the correct service URL by specifying the URL
parameter when you create the service instance or by calling the SetURL=
method of the service instance. For Cloud Pak for Data System, use a hostname that resolves to an IP address in the cluster.
Set the correct service URL by setting the serviceURL
property of the service instance. For Cloud Pak for Data System, use a hostname that resolves to an IP address in the cluster.
Set the correct service URL by calling the SetEndpoint()
method of the service instance. For Cloud Pak for Data System, use a hostname that resolves to an IP address in the cluster.
Set the correct service URL by setting the Url
property of the service instance. For Cloud Pak for Data System, use a hostname that resolves to an IP address in the cluster.
Endpoint example for Cloud Pak for Data
curl -X {request_method} -H "Authorization: Bearer {token}" "https://{cpd_cluster_host}{:port}/assistant/{deployment_id}/instances/{instance_id}/api"
Endpoint example for Cloud Pak for Data
CloudPakForDataAuthenticator authenticator = new CloudPakForDataAuthenticator("https://{cpd_cluster_host}{:port}", "{username}", "{password}");
Assistant assistant = new Assistant("{version}", authenticator);
assistant.setServiceUrl("https://{cpd_cluster_host}{:port}/assistant/{deployment_id}/instances/{instance_id}/api");
Endpoint example for Cloud Pak for Data
const AssistantV2 = require('ibm-watson/assistant/v2');
const { CloudPakForDataAuthenticator } = require('ibm-watson/auth');
const assistant = new AssistantV2({
version: '{version}',
authenticator: new CloudPakForDataAuthenticator({
username: '{username}',
password: '{password}',
url: 'https://{cpd_cluster_host}{:port}',
}),
serviceUrl: 'https://{cpd_cluster_host}{:port}/assistant/{deployment_id}/instances/{instance_id}/api',
});
Endpoint example for Cloud Pak for Data
from ibm_watson import AssistantV2
from ibm_cloud_sdk_core.authenticators import CloudPakForDataAuthenticator
authenticator = CloudPakForDataAuthenticator(
'{username}',
'{password}',
'https://{cpd_cluster_host}{:port}'
)
assistant = AssistantV2(
version='{version}',
authenticator=authenticator
)
assistant.set_service_url('https://{cpd_cluster_host}{:port}/assistant/{deployment_id}/instances/{instance_id}/api')
Endpoint example for Cloud Pak for Data
require "ibm_watson/authenticators"
require "ibm_watson/assistant_v2"
include IBMWatson
authenticator = Authenticators::CLoudPakForDataAuthenticator.new(
username: "{username}",
password: "{password}",
url: "https://{cpd_cluster_host}{:port}"
)
assistant = AssistantV2.new(
version: "{version}",
authenticator: authenticator
)
assistant.service_url = "https://{cpd_cluster_host}{:port}/assistant/{deployment_id}/instances/{instance_id}/api"
Endpoint example for Cloud Pak for Data
assistant, assistantErr := assistantv2.NewAssistantV2(options)
if assistantErr != nil {
panic(assistantErr)
}
assistant.SetServiceURL("https://{cpd_cluster_host}{:port}/assistant/{deployment_id}/instances/{instance_id}/api")
Endpoint example for Cloud Pak for Data
let authenticator = CloudPakForDataAuthenticator(username: "{username}", password: "{password}", url: "https://{cpd_cluster_host}{:port}")
let assistant = Assistant(version: "{version}", authenticator: authenticator)
assistant.serviceURL = "https://{cpd_cluster_host}{:port}/assistant/{deployment_id}/instances/{instance_id}/api"
Endpoint example for Cloud Pak for Data
CloudPakForDataAuthenticator authenticator = new CloudPakForDataAuthenticator(
url: "https://{cpd_cluster_host}{:port}",
username: "{username}",
password: "{password}"
);
AssistantService assistant = new AssistantService("{version}", authenticator);
assistant.SetServiceUrl("https://{cpd_cluster_host}{:port}/assistant/{deployment_id}/instances/{instance_id}/api");
Endpoint example for Cloud Pak for Data
var authenticator = new CloudPakForDataAuthenticator(
url: "https://{cpd_cluster_host}{:port}",
username: "{username}",
password: "{password}"
);
while (!authenticator.CanAuthenticate())
yield return null;
var assistant = new AssistantService("{version}", authenticator);
assistant.SetServiceUrl("https://{cpd_cluster_host}{:port}/assistant/{deployment_id}/instances/{instance_id}/api");
Disabling SSL verification
All Watson services use Secure Sockets Layer (SSL) (or Transport Layer Security (TLS)) for secure connections between the client and server. The connection is verified against the local certificate store to ensure authentication, integrity, and confidentiality.
If you use a self-signed certificate, you need to disable SSL verification to make a successful connection.
Enabling SSL verification is highly recommended. Disabling SSL jeopardizes the security of the connection and data. Disable SSL only if necessary, and take steps to enable SSL as soon as possible.
To disable SSL verification for a curl request, use the --insecure
(-k
) option with the request.
To disable SSL verification, create an HttpConfigOptions
object and set the disableSslVerification
property to true
. Then, pass the object to the service instance by using the configureClient
method.
To disable SSL verification, set the disableSslVerification
parameter to true
when you create the service instance.
To disable SSL verification, specify True
on the set_disable_ssl_verification
method for the service instance.
To disable SSL verification, set the disable_ssl_verification
parameter to true
in the configure_http_client()
method for the service instance.
To disable SSL verification, call the DisableSSLVerification
method on the service instance.
To disable SSL verification, call the disableSSLVerification()
method on the service instance. You cannot disable SSL verification on Linux.
To disable SSL verification, set the DisableSslVerification
method to true
on the service instance.
To disable SSL verification, set the DisableSslVerification
method to true
on the service instance.
Example to disable SSL verification with a service managed on IBM Cloud. Replace {apikey}
and {url}
with your service credentials.
curl -k -X {request_method} -u "apikey:{apikey}" "{url}/{method}"
Example to disable SSL verification with a service managed on IBM Cloud
IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
Assistant assistant = new Assistant("{version}", authenticator);
assistant.setServiceUrl("{url}");
HttpConfigOptions configOptions = new HttpConfigOptions.Builder()
.disableSslVerification(true)
.build();
assistant.configureClient(configOptions);
Example to disable SSL verification with a service managed on IBM Cloud
const AssistantV2 = require('ibm-watson/assistant/v2');
const { IamAuthenticator } = require('ibm-watson/auth');
const assistant = new AssistantV2({
version: '{version}',
authenticator: new IamAuthenticator({
apikey: '{apikey}',
}),
serviceUrl: '{url}',
disableSslVerification: true,
});
Example to disable SSL verification with a service managed on IBM Cloud
from ibm_watson import AssistantV2
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
authenticator = IAMAuthenticator('{apikey}')
assistant = AssistantV2(
version='{version}',
authenticator=authenticator
)
assistant.set_service_url('{url}')
assistant.set_disable_ssl_verification(True)
Example to disable SSL verification with a service managed on IBM Cloud
require "ibm_watson/authenticators"
require "ibm_watson/assistant_v2"
include IBMWatson
authenticator = Authenticators::IamAuthenticator.new(
apikey: "{apikey}"
)
assistant = AssistantV2.new(
version: "{version}",
authenticator: authenticator
)
assistant.service_url = "{url}"
assistant.configure_http_client(disable_ssl_verification: true)
Example to disable SSL verification with a service managed on IBM Cloud
assistant, assistantErr := assistantv2.NewAssistantV2(options)
if assistantErr != nil {
panic(assistantErr)
}
assistant.SetServiceURL("{url}")
assistant.DisableSSLVerification()
Example to disable SSL verification with a service managed on IBM Cloud
let authenticator = WatsonIAMAuthenticator(apiKey: "{apikey}")
let assistant = Assistant(version: "{version}", authenticator: authenticator)
assistant.serviceURL = "{url}"
assistant.disableSSLVerification()
Example to disable SSL verification with a service managed on IBM Cloud
IamAuthenticator authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
AssistantService assistant = new AssistantService("{version}", authenticator);
assistant.SetServiceUrl("{url}");
assistant.DisableSslVerification(true);
Example to disable SSL verification with a service managed on IBM Cloud
var authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
while (!authenticator.CanAuthenticate())
yield return null;
var assistant = new AssistantService("{version}", authenticator);
assistant.SetServiceUrl("{url}");
assistant.DisableSslVerification = true;
Example to disable SSL verification with an installed service
curl -k -X {request_method} -H "Authorization: Bearer {token}" "{url}/v2/{method}"
Example to disable SSL verification with an installed service
CloudPakForDataAuthenticator authenticator = new CloudPakForDataAuthenticator("https://{cpd_cluster_host}{:port}", "{username}", "{password}");
Assistant assistant = new Assistant("{version}", authenticator);
assistant.setServiceUrl("{url}";
HttpConfigOptions configOptions = new HttpConfigOptions.Builder()
.disableSslVerification(true)
.build();
assistant.configureClient(configOptions);
Example to disable SSL verification with an installed service
const AssistantV2 = require('ibm-watson/assistant/v2');
const { CloudPakForDataAuthenticator } = require('ibm-watson/auth');
const assistant = new AssistantV2({
version: '{version}',
authenticator: new CloudPakForDataAuthenticator({
username: '{username}',
password: '{password}',
url: 'https://{cpd_cluster_host}{:port}',
}),
serviceUrl: '{url}',
disableSslVerification: true,
});
Example to disable SSL verification with an installed service
from ibm_watson import AssistantV2
from ibm_cloud_sdk_core.authenticators import CloudPakForDataAuthenticator
authenticator = CloudPakForDataAuthenticator(
'{username}',
'{password}'
)
assistant = AssistantV2(
version='{version}',
authenticator=authenticator
)
assistant.set_service_url('{url}')
assistant.set_disable_ssl_verification(True)
Example to disable SSL verification with an installed service
require "ibm_watson/authenticators"
require "ibm_watson/assistant_v2"
include IBMWatson
authenticator = Authenticators::CLoudPakForDataAuthenticator.new(
username: "{username}",
password: "{password}",
url: "https://{cpd_cluster_host}{:port}"
)
assistant = AssistantV2.new(
version: "{version}",
authenticator: authenticator
)
assistant.service_url = "{url}"
assistant.configure_http_client(disable_ssl_verification: true)
Example to disable SSL verification with an installed service
assistant, assistantErr := assistantv2.NewAssistantV2(options)
if assistantErr != nil {
panic(assistantErr)
}
assistant.SetServiceURL("{url}")
assistant.DisableSSLVerification()
Example to disable SSL verification with an installed service
let authenticator = WatsonCloudPakForDataAuthenticator(username: "{username}", password: "{password}", url: "https://{cpd_cluster_host}{:port}")
let assistant = Assistant(version: "{version}", authenticator: authenticator)
assistant.serviceURL = "{url}"
assistant.disableSSLVerification()
Example to disable SSL verification with an installed service
CloudPakForDataAuthenticator authenticator = new CloudPakForDataAuthenticator(
url: "https://{cpd_cluster_host}{:port}",
username: "{username}",
password: "{password}"
);
AssistantService assistant = new AssistantService("{version}", authenticator);
assistant.SetServiceUrl("{url}");
assistant.DisableSslVerification(true);
Example to disable SSL verification with an installed service
var authenticator = new CloudPakForDataAuthenticator(
url: "https://{cpd_cluster_host}{:port}",
username: "{username}",
password: "{password}"
);
while (!authenticator.CanAuthenticate())
yield return null;
var assistant = new AssistantService("{version}", authenticator);
assistant.SetServiceUrl("{url}");
assistant.DisableSslVerification = true;
Authenticating to services in watsonx Orchestrate
To get the endpoint URLs for watsonx Orchestrate, see Getting API endpoint.
To get an API key, see Generating an API key.
watsonx Orchestrate. Replace {request-body}
with your service credentials.
curl --request POST --url https://iam.platform.saas.ibm.com/siusermgr/api/1.0/apikeys/token --header 'accept: application/json' --header 'content-type: application/json' --data {request-body}
watsonx Orchestrate. Replace {request-body}
with your service credentials.
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "{request-body}");
Request request = new Request.Builder()
.url("https://iam.platform.saas.ibm.com/siusermgr/api/1.0/apikeys/token")
.post(body)
.addHeader("content-type", "application/json")
.addHeader("accept", "application/json")
.build();
Response response = client.newCall(request).execute();
watsonx Orchestrate. Replace {request-body}
with your service credentials.
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://iam.platform.saas.ibm.com/siusermgr/api/1.0/apikeys/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{request-body}"
response = http.request(request)
puts response.read_body
watsonx Orchestrate. Replace {request-body}
with your service credentials.
import http.client
conn = http.client.HTTPSConnection("iam.platform.saas.ibm.com")
payload = "{request-body}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/siusermgr/api/1.0/apikeys/token", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
watsonx Orchestrate. Replace {request-body}
with your service credentials.
const request = require('request');
const options = {
method: 'POST',
url: 'https://iam.platform.saas.ibm.com/siusermgr/api/1.0/apikeys/token',
headers: {'content-type': 'application/json', accept: 'application/json'},
body: '{request-body}'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
IBM Cloud
For IBM Cloud instances, you authenticate to the API by using IBM Cloud Identity and Access Management (IAM).
You can pass either a bearer token in an authorization header or an API key. Tokens support authenticated requests without embedding service credentials in every call. API keys use basic authentication. For more information, see Authenticating to Watson services.
- For testing and development, you can pass an API key directly.
- For production use, unless you use the Watson SDKs, use an IAM token.
If you pass in an API key, use apikey
for the username and the value of the API key as the password. For example, if the API key is f5sAznhrKQyvBFFaZbtF60m5tzLbqWhyALQawBg5TjRI
in the service credentials, include the credentials in your call like this:
curl -u "apikey:f5sAznhrKQyvBFFaZbtF60m5tzLbqWhyALQawBg5TjRI"
For IBM Cloud instances, the SDK provides initialization methods for each form of authentication.
- Use the API key to have the SDK manage the lifecycle of the access token. The SDK requests an access token, ensures that the access token is valid, and refreshes it if necessary.
- Use the access token to manage the lifecycle yourself. You must periodically refresh the token.
For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.
The service access role that is associated with the API key determines which endpoints and methods you can access. For more information, see Resource-level role impact on available actions.
IBM Cloud. Replace {apikey}
and {url}
with your service credentials.
curl -X {request_method} -u "apikey:{apikey}" "{url}/v2/{method}"
IBM Cloud. SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
Assistant assistant = new Assistant("{version}", authenticator);
assistant.setServiceUrl("{url}");
IBM Cloud. SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
const AssistantV2 = require('ibm-watson/assistant/v2');
const { IamAuthenticator } = require('ibm-watson/auth');
const assistant = new AssistantV2({
version: '{version}',
authenticator: new IamAuthenticator({
apikey: '{apikey}',
}),
serviceUrl: '{url}',
});
IBM Cloud. SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
from ibm_watson import AssistantV2
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
authenticator = IAMAuthenticator('{apikey}')
assistant = AssistantV2(
version='{version}',
authenticator=authenticator
)
assistant.set_service_url('{url}')
IBM Cloud. SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
require "ibm_watson/authenticators"
require "ibm_watson/assistant_v2"
include IBMWatson
authenticator = Authenticators::IamAuthenticator.new(
apikey: "{apikey}"
)
assistant = AssistantV2.new(
version: "{version}",
authenticator: authenticator
)
assistant.service_url = "{url}"
IBM Cloud. SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
import (
"github.com/IBM/go-sdk-core/core"
"github.com/watson-developer-cloud/go-sdk/assistantv2"
)
func main() {
authenticator := &core.IamAuthenticator{
ApiKey: "{apikey}",
}
options := &assistantv2.AssistantV2Options{
Version: "{version}",
Authenticator: authenticator,
}
assistant, assistantErr := assistantv2.NewAssistantV2(options)
if assistantErr != nil {
panic(assistantErr)
}
assistant.SetServiceURL("{url}")
}
IBM Cloud. SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
let authenticator = WatsonIAMAuthenticator(apiKey: "{apikey}")
let assistant = Assistant(version: "{version}", authenticator: authenticator)
assistant.serviceURL = "{url}"
IBM Cloud. SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
IamAuthenticator authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
AssistantService assistant = new AssistantService("{version}", authenticator);
assistant.SetServiceUrl("{url}");
IBM Cloud. SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
var authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
while (!authenticator.CanAuthenticate())
yield return null;
var assistant = new AssistantService("{version}", authenticator);
assistant.SetServiceUrl("{url}");
Cloud Pak for Data
For Cloud Pak for Data, you pass a bearer token in an Authorization
header to authenticate to the API. The token is associated with a username.
- For testing and development, you can use the bearer token that's displayed in the Cloud Pak for Data web client. To find this token, view the details for the service instance by clicking the name of the service in your list of instances. The details also include the service endpoint URL. Don't use this token in production because it does not expire.
- For production use, create a user in the Cloud Pak for Data web client to use for authentication. Generate a token from that user's credentials with the
POST /v1/authorize
method.
For more information, see the Get authorization token method of the Cloud Pak for Data API reference.
For Cloud Pak for Data instances, pass either username and password credentials or a bearer token that you generate to authenticate to the API. Username and password credentials use basic authentication. However, the SDK manages the lifecycle of the token. Tokens are temporary security credentials. If you pass a token, you maintain the token lifecycle.
For production use, create a user in the Cloud Pak for Data web client to use for authentication, and decide which authentication mechanism to use.
- To have the SDK manage the lifecycle of the token, use the username and password for that new user in your calls.
- To manage the lifecycle of the token yourself, generate a token from that user's credentials. Call the
POST /v1/authorize
method to generate the token, and then pass the token in anAuthorization
header in your calls. You can see an example of the method on the Curl tab.
For more information, see the Get authorization token method of the Cloud Pak for Data API reference.
Don't use the bearer token that's displayed in the web client for the instance except during testing and development because that token does not expire.
To find your value for {url}
, view the details for the service instance by clicking the name of the service in your list of instances in the Cloud Pak for Data web client.
Cloud Pak for Data. Generating a bearer token.
Replace {cpd_cluster_host}
and {port}
with the details for the service instance. Replace {username}
and {password}
with your Cloud Pak for Data credentials.
curl -k -X POST -H "cache-control: no-cache" -H "Content-Type: application/json" -d "{\"username\":\"{username}\",\"password\":\"{password}\"}" "https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize"
The response includes a token
property.
Authenticating to the API. Replace {token}
with your details.
curl -H "Authorization: Bearer {token}" "{url}/v2/{method}"
Cloud Pak for Data. SDK managing the token.
Replace {username}
and {password}
with your Cloud Pak for Data credentials. Replace {version}
with the service version date. For {url}
, see Endpoint URLs.
CloudPakForDataAuthenticator authenticator = new CloudPakForDataAuthenticator("https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize", "{username}", "{password}");
Assistant assistant = new Assistant("{version}", authenticator);
assistant.setServiceUrl("{url}");
Cloud Pak for Data. SDK managing the token.
Replace {username}
and {password}
with your Cloud Pak for Data credentials. Replace {version}
with the service version date. For {url}
, see Endpoint URLs.
const AssistantV2 = require('ibm-watson/assistant/v2');
const { CloudPakForDataAuthenticator } = require('ibm-watson/auth');
const assistant = new AssistantV2({
version: '{version}',
authenticator: new CloudPakForDataAuthenticator({
username: '{username}',
password: '{password}',
url: 'https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize',
}),
serviceUrl: '{url}',
});
Cloud Pak for Data. SDK managing the token.
Replace {username}
and {password}
with your Cloud Pak for Data credentials. Replace {version}
with the service version date. For {url}
, see Endpoint URLs.
from ibm_watson import AssistantV2
from ibm_cloud_sdk_core.authenticators import CloudPakForDataAuthenticator
authenticator = CloudPakForDataAuthenticator(
'{username}',
'{password}',
'https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize'
)
assistant = AssistantV2(
version='{version}',
authenticator=authenticator
)
assistant.set_service_url('{url}')
Cloud Pak for Data. SDK managing the token.
Replace {username}
and {password}
with your Cloud Pak for Data credentials. Replace {version}
with the service version date. For {url}
, see Endpoint URLs.
require "ibm_watson/authenticators"
require "ibm_watson/assistant_v2"
include IBMWatson
authenticator = Authenticators::CloudPakForDataAuthenticator.new(
username: "{username}",
password: "{password}",
url: "https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize"
)
assistant = AssistantV2.new(
version: "{version}",
authenticator: authenticator
)
assistant.service_url = "{url}"
Cloud Pak for Data. SDK managing the token.
Replace {username}
and {password}
with your Cloud Pak for Data credentials. Replace {version}
with the service version date. For {url}
, see Endpoint URLs.
import (
"github.com/IBM/go-sdk-core/core"
"github.com/watson-developer-cloud/go-sdk/assistantv2"
)
func main() {
authenticator := &core.CloudPakForDataAuthenticator{
URL: "https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize",
Username: "{username}",
Password: "{password}",
}
options := &assistantv2.AssistantV2Options{
Version: "{version}",
Authenticator: authenticator,
}
assistant, assistantErr := assistantv2.NewAssistantV2(options)
if assistantErr != nil {
panic(assistantErr)
}
assistant.SetServiceURL("{url}")
}
Cloud Pak for Data. SDK managing the token.
Replace {username}
and {password}
with your Cloud Pak for Data credentials. Replace {version}
with the service version date. For {url}
, see Endpoint URLs.
let authenticator = WatsonCloudPakForDataAuthenticator(username: "{username}", password: "{password}", url: "https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize")
let assistant = Assistant(version: "{version}", authenticator: authenticator)
assistant.serviceURL = "{url}"
Cloud Pak for Data. SDK managing the token.
Replace {username}
and {password}
with your Cloud Pak for Data credentials. Replace {version}
with the service version date. For {cpd_cluster_host}
, {port}
, {release}
, and {instance_id}
, see Endpoint URLs.
CloudPakForDataAuthenticator authenticator = new CloudPakForDataAuthenticator(
url: "https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize",
username: "{username}",
password: "{password}"
);
AssistantService assistant = new AssistantService("{version}", authenticator);
assistant.SetServiceUrl("{url}");
Cloud Pak for Data. SDK managing the token.
Replace {username}
and {password}
with your Cloud Pak for Data credentials. Replace {version}
with the service version date. For {cpd_cluster_host}
, {port}
, {release}
, and {instance_id}
, see Endpoint URLs.
var authenticator = new CloudPakForDataAuthenticator(
url: "https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize",
username: "{username}",
password: "{password}"
);
while (!authenticator.CanAuthenticate())
yield return null;
var assistant = new AssistantService("{version}", authenticator);
assistant.SetServiceUrl("{url}");
Access between services
Your application might use more than one Watson service. You can grant access between services and you can grant access to more than one service for your applications.
For IBM Cloud services, the method to grant access between Watson services varies depending on the type of API key. For more information, see IAM access.
- To grant access between IBM Cloud services, create an authorization between the services. For more information, see Granting access between services.
- To grant access to your services by applications without using user credentials, create a service ID, add an API key, and assign access policies. For more information, see Creating and working with service IDs.
When you give a user ID access to multiple services, use an endpoint URL that includes the service instance ID (for example, https://api.us-south.assistant.watson.cloud.ibm.com/instances/6bbda3b3-d572-45e1-8c54-22d6ed9e52c2
). You can find the instance ID in two places:
-
By clicking the service instance row in the Resource list. The instance ID is the GUID in the details pane.
-
By clicking the name of the service instance in the list and looking at the credentials URL.
If you don't see the instance ID in the URL, the credentials predate service IDs. Add new credentials from the Service credentials page and use those credentials.
Because the Cloud Pak for Data bearer token is associated with a username, you can use the token for all CPD Watson services that are associated with the username.
Versioning
API requests require a version parameter that takes a date in the format version=YYYY-MM-DD
. When the API is updated with any breaking changes, the service introduces a new version date for the API.
Send the version parameter with every API request. The service uses the API version for the date you specify, or the most recent version before that date. Don't default to the current date. Instead, specify a date that matches a version that is compatible with your app, and don't change it until your app is ready for a later version.
Specify the version to use on API requests with the version parameter when you create the service instance. The service uses the API version for the date you specify, or the most recent version before that date. Don't default to the current date. Instead, specify a date that matches a version that is compatible with your app, and don't change it until your app is ready for a later version.
This documentation describes the current version of watsonx Assistant, 2024-08-25
. In some cases, differences in earlier versions are noted in the descriptions of parameters and response models.
Error handling
watsonx Assistant uses standard HTTP response codes to indicate whether a method completed successfully. HTTP response codes in the 2xx range indicate success. A response in the 4xx range is some sort of failure, and a response in the 5xx range usually indicates an internal system error that cannot be resolved by the user. Response codes are listed with the method.
ErrorResponse
Name | Description |
---|---|
code integer |
The HTTP response code. |
error string |
General description of an error. |
errors ErrorDetail[] |
Collection of specific constraint violations associated with the error. |
ErrorDetail
Name | Description |
---|---|
message string |
Description of a specific constraint violation. |
path string |
The location of the constraint violation. |
The Java SDK generates an exception for any unsuccessful method invocation. All methods that accept an argument can also throw an IllegalArgumentException
.
Exception | Description |
---|---|
IllegalArgumentException | An invalid argument was passed to the method. |
When the Java SDK receives an error response from the watsonx Assistant service, it generates an exception from the com.ibm.watson.developer_cloud.service.exception
package. All service exceptions contain the following fields.
Field | Description |
---|---|
statusCode | The HTTP response code that is returned. |
message | A message that describes the error. |
When the Node SDK receives an error response from the watsonx Assistant service, it creates an Error
object with information that describes the error that occurred. This error object is passed as the first parameter to the callback function for the method. The contents of the error object are as shown in the following table.
Error
Field | Description |
---|---|
code | The HTTP response code that is returned. |
message | A message that describes the error. |
The Python SDK generates an exception for any unsuccessful method invocation. When the Python SDK receives an error response from the watsonx Assistant service, it generates an ApiException
with the following fields.
Field | Description |
---|---|
code | The HTTP response code that is returned. |
message | A message that describes the error. |
info | A dictionary of additional information about the error. |
When the Ruby SDK receives an error response from the watsonx Assistant service, it generates an ApiException
with the following fields.
Field | Description |
---|---|
code | The HTTP response code that is returned. |
message | A message that describes the error. |
info | A dictionary of additional information about the error. |
The Go SDK generates an error for any unsuccessful service instantiation and method invocation. You can check for the error immediately. The contents of the error object are as shown in the following table.
Error
Field | Description |
---|---|
code | The HTTP response code that is returned. |
message | A message that describes the error. |
The Swift SDK returns a WatsonError
in the completionHandler
any unsuccessful method invocation. This error type is an enum that conforms to LocalizedError
and contains an errorDescription
property that returns an error message. Some of the WatsonError
cases contain associated values that reveal more information about the error.
Field | Description |
---|---|
errorDescription | A message that describes the error. |
When the .NET Standard SDK receives an error response from the watsonx Assistant service, it generates a ServiceResponseException
with the following fields.
Field | Description |
---|---|
Message | A message that describes the error. |
CodeDescription | The HTTP response code that is returned. |
When the Unity SDK receives an error response from the watsonx Assistant service, it generates an IBMError
with the following fields.
Field | Description |
---|---|
Url | The URL that generated the error. |
StatusCode | The HTTP response code returned. |
ErrorMessage | A message that describes the error. |
Response | The contents of the response from the server. |
ResponseHeaders | A dictionary of headers returned by the request. |
Example error handling
try {
// Invoke a method
} catch (NotFoundException e) {
// Handle Not Found (404) exception
} catch (RequestTooLargeException e) {
// Handle Request Too Large (413) exception
} catch (ServiceResponseException e) {
// Base class for all exceptions caused by error responses from the service
System.out.println("Service returned status code "
+ e.getStatusCode() + ": " + e.getMessage());
}
Example error handling
assistant.method(params)
.catch(err => {
console.log('error:', err);
});
Example error handling
from ibm_watson import ApiException
try:
# Invoke a method
except ApiException as ex:
print "Method failed with status code " + str(ex.code) + ": " + ex.message
Example error handling
require "ibm_watson"
begin
# Invoke a method
rescue IBMWatson::ApiException => ex
print "Method failed with status code #{ex.code}: #{ex.error}"
end
Example error handling
import "github.com/watson-developer-cloud/go-sdk/assistantv2"
// Instantiate a service
assistant, assistantErr := assistantv2.NewAssistantV2(options)
// Check for errors
if assistantErr != nil {
panic(assistantErr)
}
// Call a method
result, _, responseErr := assistant.MethodName(&methodOptions)
// Check for errors
if responseErr != nil {
panic(responseErr)
}
Example error handling
assistant.method() {
response, error in
if let error = error {
switch error {
case let .http(statusCode, message, metadata):
switch statusCode {
case .some(404):
// Handle Not Found (404) exception
print("Not found")
case .some(413):
// Handle Request Too Large (413) exception
print("Payload too large")
default:
if let statusCode = statusCode {
print("Error - code: \(statusCode), \(message ?? "")")
}
}
default:
print(error.localizedDescription)
}
return
}
guard let result = response?.result else {
print(error?.localizedDescription ?? "unknown error")
return
}
print(result)
}
Example error handling
try
{
// Invoke a method
}
catch(ServiceResponseException e)
{
Console.WriteLine("Error: " + e.Message);
}
catch (Exception e)
{
Console.WriteLine("Error: " + e.Message);
}
Example error handling
// Invoke a method
assistant.MethodName(Callback, Parameters);
// Check for errors
private void Callback(DetailedResponse<ExampleResponse> response, IBMError error)
{
if (error == null)
{
Log.Debug("ExampleCallback", "Response received: {0}", response.Response);
}
else
{
Log.Debug("ExampleCallback", "Error received: {0}, {1}, {3}", error.StatusCode, error.ErrorMessage, error.Response);
}
}
Additional headers
Some Watson services accept special parameters in headers that are passed with the request.
You can pass request header parameters in all requests or in a single request to the service.
To pass a request header, use the --header
(-H
) option with a curl request.
To pass header parameters with every request, use the setDefaultHeaders
method of the service object. See Data collection for an example use of this method.
To pass header parameters in a single request, use the addHeader
method as a modifier on the request before you execute it.
To pass header parameters with every request, specify the headers
parameter when you create the service object. See Data collection for an example use of this method.
To pass header parameters in a single request, use the headers
method as a modifier on the request before you execute it.
To pass header parameters with every request, specify the set_default_headers
method of the service object. See Data collection for an example use of this method.
To pass header parameters in a single request, include headers
as a dict
in the request.
To pass header parameters with every request, specify the add_default_headers
method of the service object. See Data collection for an example use of this method.
To pass header parameters in a single request, specify the headers
method as a chainable method in the request.
To pass header parameters with every request, specify the SetDefaultHeaders
method of the service object. See Data collection for an example use of this method.
To pass header parameters in a single request, specify the Headers
as a map
in the request.
To pass header parameters with every request, add them to the defaultHeaders
property of the service object. See Data collection for an example use of this method.
To pass header parameters in a single request, pass the headers
parameter to the request method.
To pass header parameters in a single request, use the WithHeader()
method as a modifier on the request before you execute it. See Data collection for an example use of this method.
To pass header parameters in a single request, use the WithHeader()
method as a modifier on the request before you execute it.
Example header parameter in a request
curl -X {request_method} -H "Request-Header: {header_value}" "{url}/v2/{method}"
Example header parameter in a request
ReturnType returnValue = assistant.methodName(parameters)
.addHeader("Custom-Header", "{header_value}")
.execute();
Example header parameter in a request
const parameters = {
{parameters}
};
assistant.methodName(
parameters,
headers: {
'Custom-Header': '{header_value}'
})
.then(result => {
console.log(response);
})
.catch(err => {
console.log('error:', err);
});
Example header parameter in a request
response = assistant.methodName(
parameters,
headers = {
'Custom-Header': '{header_value}'
})
Example header parameter in a request
response = assistant.headers(
"Custom-Header" => "{header_value}"
).methodName(parameters)
Example header parameter in a request
result, _, responseErr := assistant.MethodName(
&methodOptions{
Headers: map[string]string{
"Accept": "application/json",
},
},
)
Example header parameter in a request
let customHeader: [String: String] = ["Custom-Header": "{header_value}"]
assistant.methodName(parameters, headers: customHeader) {
response, error in
}
Example header parameter in a request for a service managed on IBM Cloud
IamAuthenticator authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
AssistantService assistant = new AssistantService("{version}", authenticator);
assistant.SetServiceUrl("{url}");
assistant.WithHeader("Custom-Header", "header_value");
Example header parameter in a request for an installed service
CloudPakForDataAuthenticator authenticator = new CloudPakForDataAuthenticator(
url: "https://{cpd_cluster_host}{:port}",
username: "{username}",
password: "{password}"
);
AssistantService assistant = new AssistantService("{version}", authenticator);
assistant.SetServiceUrl("https://{cpd_cluster_host}{:port}/assistant/{release}/instances/{instance_id}/api");
assistant.WithHeader("Custom-Header", "header_value");
Example header parameter in a request for a service managed on IBM Cloud
var authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
while (!authenticator.CanAuthenticate())
yield return null;
var assistant = new AssistantService("{version}", authenticator);
assistant.SetServiceUrl("{url}");
assistant.WithHeader("Custom-Header", "header_value");
Example header parameter in a request for an installed service
var authenticator = new CloudPakForDataAuthenticator(
url: "https://{cpd_cluster_host}{:port}",
username: "{username}",
password: "{password}"
);
while (!authenticator.CanAuthenticate())
yield return null;
var assistant = new AssistantService("{version}", authenticator);
assistant.SetServiceUrl("https://{cpd_cluster_host}{:port}/assistant/{release}/instances/{instance_id}/api");
assistant.WithHeader("Custom-Header", "header_value");
Response details
The watsonx Assistant service might return information to the application in response headers.
To access all response headers that the service returns, include the --include
(-i
) option with a curl request. To see detailed response data for the request, including request headers, response headers, and extra debugging information, include the --verbose
(-v
) option with the request.
Example request to access response headers
curl -X {request_method} {authentication_method} --include "{url}/v2/{method}"
To access information in the response headers, use one of the request methods that returns details with the response: executeWithDetails()
, enqueueWithDetails()
, or rxWithDetails()
. These methods return a Response<T>
object, where T
is the expected response model. Use the getResult()
method to access the response object for the method, and use the getHeaders()
method to access information in response headers.
Example request to access response headers
Response<ReturnType> response = assistant.methodName(parameters)
.executeWithDetails();
// Access response from methodName
ReturnType returnValue = response.getResult();
// Access information in response headers
Headers responseHeaders = response.getHeaders();
All response data is available in the Response<T>
object that is returned by each method. To access information in the response
object, use the following properties.
Property | Description |
---|---|
result |
Returns the response for the service-specific method. |
headers |
Returns the response header information. |
status |
Returns the HTTP status code. |
Example request to access response headers
assistant.methodName(parameters)
.then(response => {
console.log(response.headers);
})
.catch(err => {
console.log('error:', err);
});
The return value from all service methods is a DetailedResponse
object. To access information in the result object or response headers, use the following methods.
DetailedResponse
Method | Description |
---|---|
get_result() |
Returns the response for the service-specific method. |
get_headers() |
Returns the response header information. |
get_status_code() |
Returns the HTTP status code. |
Example request to access response headers
assistant.set_detailed_response(True)
response = assistant.methodName(parameters)
# Access response from methodName
print(json.dumps(response.get_result(), indent=2))
# Access information in response headers
print(response.get_headers())
# Access HTTP response status
print(response.get_status_code())
The return value from all service methods is a DetailedResponse
object. To access information in the response
object, use the following properties.
DetailedResponse
Property | Description |
---|---|
result |
Returns the response for the service-specific method. |
headers |
Returns the response header information. |
status |
Returns the HTTP status code. |
Example request to access response headers
response = assistant.methodName(parameters)
# Access response from methodName
print response.result
# Access information in response headers
print response.headers
# Access HTTP response status
print response.status
The return value from all service methods is a DetailedResponse
object. To access information in the response
object or response headers, use the following methods.
DetailedResponse
Method | Description |
---|---|
GetResult() |
Returns the response for the service-specific method. |
GetHeaders() |
Returns the response header information. |
GetStatusCode() |
Returns the HTTP status code. |
Example request to access response headers
import (
"github.com/IBM/go-sdk-core/core"
"github.com/watson-developer-cloud/go-sdk/assistantv2"
)
result, response, responseErr := assistant.MethodName(
&methodOptions{})
// Access result
core.PrettyPrint(response.GetResult(), "Result ")
// Access response headers
core.PrettyPrint(response.GetHeaders(), "Headers ")
// Access status code
core.PrettyPrint(response.GetStatusCode(), "Status Code ")
All response data is available in the WatsonResponse<T>
object that is returned in each method's completionHandler
.
Example request to access response headers
assistant.methodName(parameters) {
response, error in
guard let result = response?.result else {
print(error?.localizedDescription ?? "unknown error")
return
}
print(result) // The data returned by the service
print(response?.statusCode)
print(response?.headers)
}
The response contains fields for response headers, response JSON, and the status code.
DetailedResponse
Property | Description |
---|---|
Result |
Returns the result for the service-specific method. |
Response |
Returns the raw JSON response for the service-specific method. |
Headers |
Returns the response header information. |
StatusCode |
Returns the HTTP status code. |
Example request to access response headers
var results = assistant.MethodName(parameters);
var result = results.Result; // The result object
var responseHeaders = results.Headers; // The response headers
var responseJson = results.Response; // The raw response JSON
var statusCode = results.StatusCode; // The response status code
The response contains fields for response headers, response JSON, and the status code.
DetailedResponse
Property | Description |
---|---|
Result |
Returns the result for the service-specific method. |
Response |
Returns the raw JSON response for the service-specific method. |
Headers |
Returns the response header information. |
StatusCode |
Returns the HTTP status code. |
Example request to access response headers
private void Example()
{
assistant.MethodName(Callback, Parameters);
}
private void Callback(DetailedResponse<ResponseType> response, IBMError error)
{
var result = response.Result; // The result object
var responseHeaders = response.Headers; // The response headers
var responseJson = reresponsesults.Response; // The raw response JSON
var statusCode = response.StatusCode; // The response status code
}
Data labels (IBM Cloud)
You can remove data associated with a specific customer if you label the data with a customer ID when you send a request to the service.
-
Use the
X-Watson-Metadata
header to associate a customer ID with the data. By adding a customer ID to a request, you indicate that it contains data that belongs to that customer.Specify a random or generic string for the customer ID. Do not include personal data, such as an email address. Pass the string
customer_id={id}
as the argument of the header.Labeling data is used only by methods that accept customer data.
-
Use the Delete labeled data method to remove data that is associated with a customer ID.
Use this process of labeling and deleting data only when you want to remove the data that is associated with a single customer, not when you want to remove data for multiple customers. For more information about watsonx Assistant and labeling data, see Information security.
For more information about how to pass headers, see Additional headers.
Data collection (IBM Cloud)
By default, watsonx Assistant service instances managed on IBM Cloud that are not part of Enterprise plans collect data about API requests and their results. This data is collected only to improve the services for future users. The collected data is not shared or made public. Data is not collected for services that are part of Enterprise plans.
To prevent IBM usage of your data for an API request, set the X-Watson-Learning-Opt-Out header parameter to true
. You can also disable request logging at the account level. For more information, see Controlling request logging for Watson services.
You must set the header on each request that you do not want IBM to access for general service improvements.
You can set the header by using the setDefaultHeaders
method of the service object.
You can set the header by using the headers
parameter when you create the service object.
You can set the header by using the set_default_headers
method of the service object.
You can set the header by using the add_default_headers
method of the service object.
You can set the header by using the SetDefaultHeaders
method of the service object.
You can set the header by adding it to the defaultHeaders
property of the service object.
You can set the header by using the WithHeader()
method of the service object.
Example request with a service managed on IBM Cloud
curl -u "apikey:{apikey}" -H "X-Watson-Learning-Opt-Out: true" "{url}/{method}"
Example request with a service managed on IBM Cloud
Map<String, String> headers = new HashMap<String, String>();
headers.put("X-Watson-Learning-Opt-Out", "true");
assistant.setDefaultHeaders(headers);
Example request with a service managed on IBM Cloud
const AssistantV2 = require('ibm-watson/assistant/v2');
const { IamAuthenticator } = require('ibm-watson/auth');
const assistant = new AssistantV2({
version: '{version}',
authenticator: new IamAuthenticator({
apikey: '{apikey}',
}),
serviceUrl: '{url}',
headers: {
'X-Watson-Learning-Opt-Out': 'true'
}
});
Example request with a service managed on IBM Cloud
assistant.set_default_headers({'x-watson-learning-opt-out': "true"})
Example request with a service managed on IBM Cloud
assistant.add_default_headers(headers: {"x-watson-learning-opt-out" => "true"})
Example request with a service managed on IBM Cloud
import "net/http"
headers := http.Header{}
headers.Add("x-watson-learning-opt-out", "true")
assistant.SetDefaultHeaders(headers)
Example request with a service managed on IBM Cloud
assistant.defaultHeaders["X-Watson-Learning-Opt-Out"] = "true"
Example request with a service managed on IBM Cloud
IamAuthenticator authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
AssistantService assistant = new AssistantService("{version}", authenticator);
assistant.SetServiceUrl("{url}");
assistant.WithHeader("X-Watson-Learning-Opt-Out", "true");
Example request with a service managed on IBM Cloud
var authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
while (!authenticator.CanAuthenticate())
yield return null;
var assistant = new AssistantService("{version}", authenticator);
assistant.SetServiceUrl("{url}");
assistant.WithHeader("X-Watson-Learning-Opt-Out", "true");
Synchronous and asynchronous requests
The Java SDK supports both synchronous (blocking) and asynchronous (non-blocking) execution of service methods. All service methods implement the ServiceCall interface.
- To call a method synchronously, use the
execute
method of theServiceCall
interface. You can call theexecute
method directly from an instance of the service. - To call a method asynchronously, use the
enqueue
method of theServiceCall
interface to receive a callback when the response arrives. The ServiceCallback interface of the method's argument providesonResponse
andonFailure
methods that you override to handle the callback.
The Ruby SDK supports both synchronous (blocking) and asynchronous (non-blocking) execution of service methods. All service methods implement the Concurrent::Async module. When you use the synchronous or asynchronous methods, an IVar object is returned. You access the DetailedResponse
object by calling ivar_object.value
.
For more information about the Ivar object, see the IVar class docs.
-
To call a method synchronously, either call the method directly or use the
.await
chainable method of theConcurrent::Async
module.Calling a method directly (without
.await
) returns aDetailedResponse
object. -
To call a method asynchronously, use the
.async
chainable method of theConcurrent::Async
module.
You can call the .await
and .async
methods directly from an instance of the service.
Example synchronous request
ReturnType returnValue = assistant.method(parameters).execute();
Example asynchronous request
assistant.method(parameters).enqueue(new ServiceCallback<ReturnType>() {
@Override public void onResponse(ReturnType response) {
. . .
}
@Override public void onFailure(Exception e) {
. . .
}
});
Example synchronous request
response = assistant.method_name(parameters)
or
response = assistant.await.method_name(parameters)
Example asynchronous request
response = assistant.async.method_name(parameters)
Pagination
Some API requests might return many results. To avoid performance issues, these results are returned one page at a time, with a limited number of results on each page. The starting point for each page of results is identified by a token called a cursor.
The default page size is 100 objects. To use a different page size, use the page_limit query parameterpage_limit parameterpageLimit parameterPageLimit parameter.
To change the attribute by which results are sorted, use the sort query parametersort parameterSort parameter. If you include multiple sortSort parameters on the same request, the results are sorted first by the first sorting attribute, then the second, and so on.
The supported sorting attributes vary by endpoint. For more information, see the API Reference information for each method.
For any request that uses pagination, the response includes a pagination object that specifies pagination information. This object includes two URLs that you can use to make subsequent requests:
- refresh_url: The URL for requesting the same page of results again.
- next_url: The URL for requesting the next page of results. The next_url property is omitted if no more results exist.
Each URL specifies the appropriate cursor parameter and retains the same page_limit and sort parameters that were used for the initial request.
For any request that uses pagination, the response includes a paginationPagination object that specifies pagination information. This object includes two cursor tokens, refreshCursorrefresh_cursorRefreshCursor and nextCursornext_cursorNextCursor, that you can specify on subsequent requests.
To request a specific page of results, specify the appropriate value by using the cursorCursor parameter. When you request subsequent pages, do not change the values of the sort and pageLimitsort and page_limitSort and PageLimit parameters (if any).
Pagination
Name | Description |
---|---|
refreshCursorrefresh_cursorRefreshCursor string |
The cursor value for the current page of results. |
nextCursornext_cursorNextCursor string |
The cursor value for the next page of results, if any. |
refreshUrlrefreshURLrefresh_urlRefreshUrl string |
The URL that returns the same page of results. |
nextUrlnextURLnext_urlNextUrl string |
The URL that returns the next page of results, if any. |
totalTotal integer |
Reserved for future use. |
matchedMatched integer |
Reserved for future use. |
Using cursor
parameter to request a specific page of results:
curl -u "apikey:{apikey}" "{url}/v1/workspaces/{workspace_id}/intents/hello/examples?cursor=eyJ0ZXh0Ijp7Im9yZGVyIjoiYXNjIiwiaW5kZXgiOjAsInZhbHVlIjoiSGV5In0sInBfcyI6NH0=&version=2019-02-28"
Example that retrieves and displays results one page at a time:
IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
Assistant assistant = new Assistant("2019-02-28", authenticator);
assistant.setServiceUrl("{url}");
String workspaceId = "{workspace_id}";
String intent = "hello";
String cursor = "";
do {
ListExamplesOptions options = new ListExamplesOptions.Builder(workspaceId, intent)
.pageLimit(3)
.cursor(cursor)
.build();
ExampleCollection response = assistant.listExamples(options).execute().getResult();
List<Example> examples = response.getExamples();
cursor = response.getPagination().getNextCursor();
for (Example example : examples) {
System.out.println(example.text());
}
}
while(cursor != null);
Example that retrieves and displays results one page at a time:
const AssistantV1 = require('ibm-watson/assistant/v1');
const { IamAuthenticator } = require('ibm-watson/auth');
const assistant = new AssistantV1({
version: '2019-02-28',
authenticator: new IamAuthenticator({
apikey: '{apikey}',
}),
serviceUrl: '{url}',
});
const cursor = null;
getNextPage(cursor);
function getNextPage(cursor) {
const params = {
workspaceId: '{workspace_id}',
intent: 'hello',
cursor,
pageLimit: 3,
};
assistant.listExamples(params)
.then(res => {
for (const example in res.result.examples) {
console.log(res.result.examples[example]['text']);
}
if(res.result.pagination.next_cursor) {
getNextPage(res.result.pagination.next_cursor)
}
})
.catch(err => {
console.log(err)
});
}
Example that retrieves and displays results one page at a time:
from ibm_watson import AssistantV1
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
authenticator = IAMAuthenticator('{apikey}')
assistant = AssistantV1(
version='2019-02-28',
authenticator = authenticator
)
assistant.set_service_url('{url}')
cursor = None
while True:
response=assistant.list_examples(
workspace_id='{workspace_id}',
intent='hello',
cursor=cursor,
page_limit=3
).get_result()
for example in response.get('examples'):
print(example.get('text'))
cursor=response.get('pagination').get('next_cursor')
if not cursor:
break
Example that retrieves and displays results one page at a time:
require "ibm_watson/authenticators"
require "ibm_watson/assistant_v1"
include IBMWatson
authenticator = Authenticators::IamAuthenticator.new(
apikey: "{apikey}"
)
assistant = AssistantV1.new(
version: "2019-02-28",
authenticator: authenticator
)
assistant.service_url = "{url}"
cursor = nil
loop do
response = assistant.list_examples(
workspace_id: "{workspace_id}",
intent: "hello",
page_limit: 3,
cursor: cursor
)
response.result["examples"].each { |example|
puts example["text"]
}
cursor = response.result["pagination"]["next_cursor"]
if cursor.nil?
break
end
end
Example that retrieves and displays results one page at a time:
package main
import (
"fmt"
"github.com/IBM/go-sdk-core/core"
"github.com/watson-developer-cloud/go-sdk/assistantv1"
)
func main() {
authenticator := &core.IamAuthenticator{
ApiKey: "{apikey}",
}
options := &assistantv1.AssistantV1Options{
Version: "2019-02-28",
Authenticator: authenticator,
}
assistant, assistantErr := assistantv1.NewAssistantV1(options)
if assistantErr != nil {
panic(assistantErr)
}
assistant.SetServiceURL("{url}")
cursor := core.StringPtr("")
pageLimit := int64(3)
for {
result, _, responseErr := assistant.ListExamples(
&assistantv1.ListExamplesOptions{
WorkspaceID: core.StringPtr("{workspace_id}"),
Intent: core.StringPtr("hello"),
PageLimit: &pageLimit,
Cursor: cursor,
},
)
if responseErr != nil {
panic(responseErr)
}
for _, example := range result.Examples {
fmt.Println(*example.Text)
}
cursor = result.Pagination.NextCursor
if cursor == nil {
break
}
}
}
Example that retrieves and displays results one page at a time:
import Foundation
import AssistantV1
let authenticator = WatsonIAMAuthenticator.init(apiKey: "{apikey}")
assistant = Assistant(version: "2019-02-28", authenticator: authenticator)
assistant.serviceURL = "{url}"
func getNextPage(cursor: String?) {
assistant.listExamples(workspaceID: "{workspace_id}", intent: "hello", pageLimit: 2, cursor: cursor) {
response, error in
if let error = error {
print(error.localizedDescription)
return
}
guard let results = response?.result else {
print("No results found")
return
}
for example in results.examples {
print(example)
}
if let cursor = examples.pagination.nextCursor {
getNextPage(cursor?)
}
}
}
getNextPage(cursor: nil)
Example that retrieves and displays results one page at a time:
public class ListExamplesWithPagination
{
public ListExamplesWithPagination()
{
IamAuthenticator authenticator = new IamAuthenticator(apikey: "{apikey}");
AssistantService service = new AssistantService("2019-02-28", authenticator);
service.SetServiceUrl("{url}");
string workspaceId = "{workspace_id}";
string intent = "hello";
long? pageLimit = 3;
string cursor = "";
ListExamples(service, workspaceId, intent, pageLimit, cursor);
}
public void ListExamples(AssistantService service, string workspaceId, string intent, long? pageLimit, string cursor)
{
var result = service.ListExamples(
workspaceId: workspaceId,
intent: intent,
pageLimit: 3,
cursor: cursor
);
foreach (Example example in result.Result.Examples)
{
Console.WriteLine(example.Text);
}
var nextCursor = result.Result.Pagination.NextCursor;
if (!string.IsNullOrEmpty(nextCursor))
{
ListExamples(service, workspaceId, intent, pageLimit, nextCursor);
}
}
}
Example that retrieves and displays results one page at a time:
public void ListExamples(AssistantService service, string workspaceId, string intent, long? pageLimit, string cursor)
{
ExampleCollection listExamplesResponse = null;
service.ListExamples(
callback: (DetailedResponse<ExampleCollection> response, IBMError error) =>
{
Log.Debug("AssistantServiceV1", "ListExamples result: {0}", response.Response);
listExamplesResponse = response.Result;
foreach (Example example in listExamplesResponse.Examples)
{
Log.Debug("AssistantServiceV1", "Example text: {0}", example.Text);
}
var nextCursor = listExamplesResponse.Pagination.NextCursor;
if (!string.IsNullOrEmpty(nextCursor))
{
ListExamples(service, workspaceId, intent, pageLimit, nextCursor);
}
else
{
paginationDone = true;
}
},
workspaceId: workspaceId,
intent: intent,
pageLimit: 3,
cursor: cursor
);
}
var authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
while (!authenticator.CanAuthenticate())
yield return null;
var assistant = new AssistantService("2019-02-28", authenticator);
assistant.SetServiceUrl("{url}");
bool isPaginationDone = false;
string workspaceId = "{workspace_id}";
string intent = "hello";
long? pageLimit = 3;
string cursor = "";
ListExamples(service, workspaceId, intent, pageLimit, cursor);
while (isPaginationDone == false)
yield return null;
Rate limiting
Rate limits for API requests are enforced on a per-service-instance basis. If the number of requests for a particular method and endpoint reaches the request limit within the specified time window, no further requests are accepted until the timer expires. After the timer expires, a new time window begins with the next accepted request.
The response to each HTTP request includes headers you can use to determine whether you are close to the rate limit:
X-RateLimit-Reset
: the time the current timer expires (in UNIX epoch time)X-RateLimit-Remaining
: the number of requests that remain in the current time windowX-RateLimit-Limit
: the total number of requests allowed within the time window
An HTTP status code of 429 indicates that the rate limit has been exceeded.
The number of allowed requests, and the length of the time window, vary by method and endpoint. The reference information for each endpoint specifies the rate limit that applies.
Related information
- watsonx Assistant v1 API reference
- watsonx Assistant v1 API reference
- watsonx Assistant v1 API reference
- watsonx Assistant v1 API reference
- watsonx Assistant v1 API reference
- watsonx Assistant v1 API reference
- watsonx Assistant v1 API reference
- watsonx Assistant v1 API reference
- watsonx Assistantv1 API reference
- watsonx Assistant docs
- Release notes
- Javadoc for Assistant
- Javadoc for sdk-core
Methods
Create a conversational skill provider
Create a new conversational skill provider.
Create a new conversational skill provider.
Create a new conversational skill provider.
Create a new conversational skill provider.
POST /v2/providers
ServiceCall<ProviderResponse> createProvider(CreateProviderOptions createProviderOptions)
createProvider(params)
create_provider(
self,
*,
provider_id: Optional[str] = None,
specification: Optional['ProviderSpecification'] = None,
private: Optional['ProviderPrivate'] = None,
**kwargs,
) -> DetailedResponse
Request
Use the CreateProviderOptions.Builder
to create a CreateProviderOptions
object that contains the parameter values for the createProvider
method.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.
The properties of the new conversational skill provider.
The unique identifier of the provider.
Possible values: 1 ≤ length ≤ 256
The specification of the provider.
Private information of the provider.
The createProvider options.
The unique identifier of the provider.
Possible values: 1 ≤ length ≤ 256
The specification of the provider.
- specification
An array of objects defining all endpoints of the provider.
Note: Multiple array items are reserved for future use.
Possible values: number of items = 1
- servers
The URL of the conversational skill provider.
An object defining various reusable definitions of the provider.
- components
The definition of the security scheme for the provider.
- securitySchemes
The authentication method required for requests made from watsonx Assistant to the conversational skill provider.
Allowable values: [
basic
,bearer
,api_key
,oauth2
,none
]Non-private settings for basic access authentication.
- basic
The username for basic access authentication.
- username
The type of property observed in "value".
Allowable values: [
value
]The stored information of the value.
Non-private settings for oauth2 authentication.
- oauth2
The preferred "flow" or "grant type" for the API client to fetch an access token from the authorization server.
Allowable values: [
password
,client_credentials
,authorization_code
,<$custom_flow_name>
]Non-private authentication settings for resource owner password flow.
- flows
The token URL.
The refresh token URL.
The client authorization type.
Allowable values: [
Body
,BasicAuthHeader
]The content type.
The prefix fo the header.
The username for oauth2 authentication when the preferred flow is "password".
- username
The type of property observed in "value".
Allowable values: [
value
]The stored information of the value.
Private information of the provider.
- xPrivate
The private data for bearer authentication.
- authentication
The token for bearer authentication.
- token
The type of property observed in "value".
Allowable values: [
value
]The stored information of the value.
parameters
The unique identifier of the provider.
Possible values: 1 ≤ length ≤ 256
The specification of the provider.
- specification
An array of objects defining all endpoints of the provider.
Note: Multiple array items are reserved for future use.
Possible values: number of items = 1
- servers
The URL of the conversational skill provider.
An object defining various reusable definitions of the provider.
- components
The definition of the security scheme for the provider.
- securitySchemes
The authentication method required for requests made from watsonx Assistant to the conversational skill provider.
Allowable values: [
basic
,bearer
,api_key
,oauth2
,none
]Non-private settings for basic access authentication.
- basic
The username for basic access authentication.
- username
The type of property observed in "value".
Allowable values: [
value
]The stored information of the value.
Non-private settings for oauth2 authentication.
- oauth2
The preferred "flow" or "grant type" for the API client to fetch an access token from the authorization server.
Allowable values: [
password
,client_credentials
,authorization_code
,<$custom_flow_name>
]Non-private authentication settings for resource owner password flow.
- flows
The token URL.
The refresh token URL.
The client authorization type.
Allowable values: [
Body
,BasicAuthHeader
]The content type.
The prefix fo the header.
The username for oauth2 authentication when the preferred flow is "password".
- username
The type of property observed in "value".
Allowable values: [
value
]The stored information of the value.
Private information of the provider.
- private
The private data for bearer authentication.
- authentication
The token for bearer authentication.
- token
The type of property observed in "value".
Allowable values: [
value
]The stored information of the value.
parameters
The unique identifier of the provider.
Possible values: 1 ≤ length ≤ 256
The specification of the provider.
- specification
An array of objects defining all endpoints of the provider.
Note: Multiple array items are reserved for future use.
Possible values: number of items = 1
- servers
The URL of the conversational skill provider.
An object defining various reusable definitions of the provider.
- components
The definition of the security scheme for the provider.
- security_schemes
The authentication method required for requests made from watsonx Assistant to the conversational skill provider.
Allowable values: [
basic
,bearer
,api_key
,oauth2
,none
]Non-private settings for basic access authentication.
- basic
The username for basic access authentication.
- username
The type of property observed in "value".
Allowable values: [
value
]The stored information of the value.
Non-private settings for oauth2 authentication.
- oauth2
The preferred "flow" or "grant type" for the API client to fetch an access token from the authorization server.
Allowable values: [
password
,client_credentials
,authorization_code
,<$custom_flow_name>
]Non-private authentication settings for resource owner password flow.
- flows
The token URL.
The refresh token URL.
The client authorization type.
Allowable values: [
Body
,BasicAuthHeader
]The content type.
The prefix fo the header.
The username for oauth2 authentication when the preferred flow is "password".
- username
The type of property observed in "value".
Allowable values: [
value
]The stored information of the value.
Private information of the provider.
- private
The private data for bearer authentication.
- authentication
The token for bearer authentication.
- token
The type of property observed in "value".
Allowable values: [
value
]The stored information of the value.
Response
The unique identifier of the provider.
Possible values: 1 ≤ length ≤ 256
The specification of the provider.
- specification
An array of objects defining all endpoints of the provider.
Note: Multiple array items are reserved for future use.
Possible values: number of items = 1
- servers
The URL of the conversational skill provider.
An object defining various reusable definitions of the provider.
- components
The definition of the security scheme for the provider.
- securitySchemes
The authentication method required for requests made from watsonx Assistant to the conversational skill provider.
Possible values: [
basic
,bearer
,api_key
,oauth2
,none
]Non-private settings for basic access authentication.
- basic
The username for basic access authentication.
- username
The type of property observed in "value".
Possible values: [
value
]The stored information of the value.
Non-private settings for oauth2 authentication.
The unique identifier of the provider.
Possible values: 1 ≤ length ≤ 256
The specification of the provider.
- specification
An array of objects defining all endpoints of the provider.
Note: Multiple array items are reserved for future use.
Possible values: number of items = 1
- servers
The URL of the conversational skill provider.
An object defining various reusable definitions of the provider.
- components
The definition of the security scheme for the provider.
- securitySchemes
The authentication method required for requests made from watsonx Assistant to the conversational skill provider.
Possible values: [
basic
,bearer
,api_key
,oauth2
,none
]Non-private settings for basic access authentication.
- basic
The username for basic access authentication.
- username
The type of property observed in "value".
Possible values: [
value
]The stored information of the value.
Non-private settings for oauth2 authentication.
- oauth2
The preferred "flow" or "grant type" for the API client to fetch an access token from the authorization server.
Possible values: [
password
,client_credentials
,authorization_code
,<$custom_flow_name>
]Non-private authentication settings for resource owner password flow.
- flows
The token URL.
The refresh token URL.
The client authorization type.
Possible values: [
Body
,BasicAuthHeader
]The content type.
The prefix fo the header.
The username for oauth2 authentication when the preferred flow is "password".
- username
The type of property observed in "value".
Possible values: [
value
]The stored information of the value.
The unique identifier of the provider.
Possible values: 1 ≤ length ≤ 256
The specification of the provider.
- specification
An array of objects defining all endpoints of the provider.
Note: Multiple array items are reserved for future use.
Possible values: number of items = 1
- servers
The URL of the conversational skill provider.
An object defining various reusable definitions of the provider.
- components
The definition of the security scheme for the provider.
- securitySchemes
The authentication method required for requests made from watsonx Assistant to the conversational skill provider.
Possible values: [
basic
,bearer
,api_key
,oauth2
,none
]Non-private settings for basic access authentication.
- basic
The username for basic access authentication.
- username
The type of property observed in "value".
Possible values: [
value
]The stored information of the value.
Non-private settings for oauth2 authentication.
- oauth2
The preferred "flow" or "grant type" for the API client to fetch an access token from the authorization server.
Possible values: [
password
,client_credentials
,authorization_code
,<$custom_flow_name>
]Non-private authentication settings for resource owner password flow.
- flows
The token URL.
The refresh token URL.
The client authorization type.
Possible values: [
Body
,BasicAuthHeader
]The content type.
The prefix fo the header.
The username for oauth2 authentication when the preferred flow is "password".
- username
The type of property observed in "value".
Possible values: [
value
]The stored information of the value.
The unique identifier of the provider.
Possible values: 1 ≤ length ≤ 256
The specification of the provider.
- specification
An array of objects defining all endpoints of the provider.
Note: Multiple array items are reserved for future use.
Possible values: number of items = 1
- servers
The URL of the conversational skill provider.
An object defining various reusable definitions of the provider.
- components
The definition of the security scheme for the provider.
- security_schemes
The authentication method required for requests made from watsonx Assistant to the conversational skill provider.
Possible values: [
basic
,bearer
,api_key
,oauth2
,none
]Non-private settings for basic access authentication.
- basic
The username for basic access authentication.
- username
The type of property observed in "value".
Possible values: [
value
]The stored information of the value.
Non-private settings for oauth2 authentication.
- oauth2
The preferred "flow" or "grant type" for the API client to fetch an access token from the authorization server.
Possible values: [
password
,client_credentials
,authorization_code
,<$custom_flow_name>
]Non-private authentication settings for resource owner password flow.
- flows
The token URL.
The refresh token URL.
The client authorization type.
Possible values: [
Body
,BasicAuthHeader
]The content type.
The prefix fo the header.
The username for oauth2 authentication when the preferred flow is "password".
- username
The type of property observed in "value".
Possible values: [
value
]The stored information of the value.
Status Code
Successful request.
Invalid request.
{ "provider_id": "myProCodeProvider-noSpaces_no_special_chars", "specification": { "servers": [ { "url": "https://myProCodeProvider.com" } ], "components": { "securitySchemes": { "authentication_method": "api_key" } } } }
{ "provider_id": "myProCodeProvider-noSpaces_no_special_chars", "specification": { "servers": [ { "url": "https://myProCodeProvider.com" } ], "components": { "securitySchemes": { "authentication_method": "api_key" } } } }
List conversational skill providers
List the conversational skill providers associated with a Watson Assistant service instance.
List the conversational skill providers associated with a Watson Assistant service instance.
List the conversational skill providers associated with a Watson Assistant service instance.
List the conversational skill providers associated with a Watson Assistant service instance.
GET /v2/providers
ServiceCall<ProviderCollection> listProviders(ListProvidersOptions listProvidersOptions)
listProviders(params)
list_providers(
self,
*,
page_limit: Optional[int] = None,
include_count: Optional[bool] = None,
sort: Optional[str] = None,
cursor: Optional[str] = None,
include_audit: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
Request
Use the ListProvidersOptions.Builder
to create a ListProvidersOptions
object that contains the parameter values for the listProviders
method.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.The number of records to return in each page of results.
Default:
100
Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true
, thepagination
object in the response includes thetotal
property.Default:
false
The attribute by which returned conversational skill providers will be sorted. To reverse the sort order, prefix the value with a minus sign (
-
).Allowable values: [
name
,updated
]A token identifying the page of results to retrieve.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
The listProviders options.
The number of records to return in each page of results.
Default:
100
Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true
, thepagination
object in the response includes thetotal
property.Default:
false
The attribute by which returned conversational skill providers will be sorted. To reverse the sort order, prefix the value with a minus sign (
-
).Allowable values: [
name
,updated
]A token identifying the page of results to retrieve.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
parameters
The number of records to return in each page of results.
Default:
100
Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true
, thepagination
object in the response includes thetotal
property.Default:
false
The attribute by which returned conversational skill providers will be sorted. To reverse the sort order, prefix the value with a minus sign (
-
).Allowable values: [
name
,updated
]A token identifying the page of results to retrieve.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
parameters
The number of records to return in each page of results.
Default:
100
Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true
, thepagination
object in the response includes thetotal
property.Default:
false
The attribute by which returned conversational skill providers will be sorted. To reverse the sort order, prefix the value with a minus sign (
-
).Allowable values: [
name
,updated
]A token identifying the page of results to retrieve.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
Response
An array of objects describing the conversational skill providers associated with the instance.
The pagination data for the returned objects. For more information about using pagination, see Pagination.
An array of objects describing the conversational skill providers associated with the instance.
- conversationalSkillProviders
The unique identifier of the provider.
Possible values: 1 ≤ length ≤ 256
The specification of the provider.
- specification
An array of objects defining all endpoints of the provider.
Note: Multiple array items are reserved for future use.
Possible values: number of items = 1
- servers
The URL of the conversational skill provider.
An object defining various reusable definitions of the provider.
- components
The definition of the security scheme for the provider.
- securitySchemes
The authentication method required for requests made from watsonx Assistant to the conversational skill provider.
Possible values: [
basic
,bearer
,api_key
,oauth2
,none
]Non-private settings for basic access authentication.
- basic
The username for basic access authentication.
- username
The type of property observed in "value".
Possible values: [
value
]The stored information of the value.
Non-private settings for oauth2 authentication.
- oauth2
The preferred "flow" or "grant type" for the API client to fetch an access token from the authorization server.
Possible values: [
password
,client_credentials
,authorization_code
,<$custom_flow_name>
]Non-private authentication settings for resource owner password flow.
- flows
The token URL.
The refresh token URL.
The client authorization type.
Possible values: [
Body
,BasicAuthHeader
]The content type.
The prefix fo the header.
The username for oauth2 authentication when the preferred flow is "password".
- username
The type of property observed in "value".
Possible values: [
value
]The stored information of the value.
The pagination data for the returned objects. For more information about using pagination, see Pagination.
- pagination
The URL that will return the same page of results.
The URL that will return the next page of results.
The total number of objects that satisfy the request. This total includes all results, not just those included in the current page.
Reserved for future use.
A token identifying the current page of results.
A token identifying the next page of results.
An array of objects describing the conversational skill providers associated with the instance.
- conversational_skill_providers
The unique identifier of the provider.
Possible values: 1 ≤ length ≤ 256
The specification of the provider.
- specification
An array of objects defining all endpoints of the provider.
Note: Multiple array items are reserved for future use.
Possible values: number of items = 1
- servers
The URL of the conversational skill provider.
An object defining various reusable definitions of the provider.
- components
The definition of the security scheme for the provider.
- securitySchemes
The authentication method required for requests made from watsonx Assistant to the conversational skill provider.
Possible values: [
basic
,bearer
,api_key
,oauth2
,none
]Non-private settings for basic access authentication.
- basic
The username for basic access authentication.
- username
The type of property observed in "value".
Possible values: [
value
]The stored information of the value.
Non-private settings for oauth2 authentication.
- oauth2
The preferred "flow" or "grant type" for the API client to fetch an access token from the authorization server.
Possible values: [
password
,client_credentials
,authorization_code
,<$custom_flow_name>
]Non-private authentication settings for resource owner password flow.
- flows
The token URL.
The refresh token URL.
The client authorization type.
Possible values: [
Body
,BasicAuthHeader
]The content type.
The prefix fo the header.
The username for oauth2 authentication when the preferred flow is "password".
- username
The type of property observed in "value".
Possible values: [
value
]The stored information of the value.
The pagination data for the returned objects. For more information about using pagination, see Pagination.
- pagination
The URL that will return the same page of results.
The URL that will return the next page of results.
The total number of objects that satisfy the request. This total includes all results, not just those included in the current page.
Reserved for future use.
A token identifying the current page of results.
A token identifying the next page of results.
An array of objects describing the conversational skill providers associated with the instance.
- conversational_skill_providers
The unique identifier of the provider.
Possible values: 1 ≤ length ≤ 256
The specification of the provider.
- specification
An array of objects defining all endpoints of the provider.
Note: Multiple array items are reserved for future use.
Possible values: number of items = 1
- servers
The URL of the conversational skill provider.
An object defining various reusable definitions of the provider.
- components
The definition of the security scheme for the provider.
- security_schemes
The authentication method required for requests made from watsonx Assistant to the conversational skill provider.
Possible values: [
basic
,bearer
,api_key
,oauth2
,none
]Non-private settings for basic access authentication.
- basic
The username for basic access authentication.
- username
The type of property observed in "value".
Possible values: [
value
]The stored information of the value.
Non-private settings for oauth2 authentication.
- oauth2
The preferred "flow" or "grant type" for the API client to fetch an access token from the authorization server.
Possible values: [
password
,client_credentials
,authorization_code
,<$custom_flow_name>
]Non-private authentication settings for resource owner password flow.
- flows
The token URL.
The refresh token URL.
The client authorization type.
Possible values: [
Body
,BasicAuthHeader
]The content type.
The prefix fo the header.
The username for oauth2 authentication when the preferred flow is "password".
- username
The type of property observed in "value".
Possible values: [
value
]The stored information of the value.
The pagination data for the returned objects. For more information about using pagination, see Pagination.
- pagination
The URL that will return the same page of results.
The URL that will return the next page of results.
The total number of objects that satisfy the request. This total includes all results, not just those included in the current page.
Reserved for future use.
A token identifying the current page of results.
A token identifying the next page of results.
Status Code
Successful request.
Invalid request.
{ "conversational_skill_providers": [ { "created": "2024-05-30T00:52:08.368Z", "updated": "2024-05-30T00:52:08.368Z", "provider_id": "myProCodeProvider-noSpaces_no_special_chars", "specification": { "servers": [ { "url": "https://myProCodeProvider.com" } ], "components": { "securitySchemes": { "basic": { "username": { "type": "value", "value": "myBasicUsername" } }, "authentication_method": "basic" } } } } ], "pagination": { "refresh_url": "/v2/providers?version=2021-11-27&include_count=true&include_audit=true&verbose=true", "total": 1, "matched": 1 } }
{ "conversational_skill_providers": [ { "created": "2024-05-30T00:52:08.368Z", "updated": "2024-05-30T00:52:08.368Z", "provider_id": "myProCodeProvider-noSpaces_no_special_chars", "specification": { "servers": [ { "url": "https://myProCodeProvider.com" } ], "components": { "securitySchemes": { "basic": { "username": { "type": "value", "value": "myBasicUsername" } }, "authentication_method": "basic" } } } } ], "pagination": { "refresh_url": "/v2/providers?version=2021-11-27&include_count=true&include_audit=true&verbose=true", "total": 1, "matched": 1 } }
Update a conversational skill provider
Update a new conversational skill provider.
Update a new conversational skill provider.
Update a new conversational skill provider.
Update a new conversational skill provider.
POST /v2/providers/{provider_id}
ServiceCall<ProviderResponse> updateProvider(UpdateProviderOptions updateProviderOptions)
updateProvider(params)
update_provider(
self,
provider_id: str,
*,
new_provider_id: Optional[str] = None,
new_specification: Optional['ProviderSpecification'] = None,
new_private: Optional['ProviderPrivate'] = None,
**kwargs,
) -> DetailedResponse
Request
Use the UpdateProviderOptions.Builder
to create a UpdateProviderOptions
object that contains the parameter values for the updateProvider
method.
Path Parameters
Unique identifier of the conversational skill provider.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.
The properties of the new conversational skill provider.
The specification of the provider.
Private information of the provider.
The updateProvider options.
Unique identifier of the conversational skill provider.
The unique identifier of the provider.
Possible values: 1 ≤ length ≤ 256
The specification of the provider.
- newSpecification
An array of objects defining all endpoints of the provider.
Note: Multiple array items are reserved for future use.
Possible values: number of items = 1
- servers
The URL of the conversational skill provider.
An object defining various reusable definitions of the provider.
- components
The definition of the security scheme for the provider.
- securitySchemes
The authentication method required for requests made from watsonx Assistant to the conversational skill provider.
Allowable values: [
basic
,bearer
,api_key
,oauth2
,none
]Non-private settings for basic access authentication.
- basic
The username for basic access authentication.
- username
The type of property observed in "value".
Allowable values: [
value
]The stored information of the value.
Non-private settings for oauth2 authentication.
- oauth2
The preferred "flow" or "grant type" for the API client to fetch an access token from the authorization server.
Allowable values: [
password
,client_credentials
,authorization_code
,<$custom_flow_name>
]Non-private authentication settings for resource owner password flow.
- flows
The token URL.
The refresh token URL.
The client authorization type.
Allowable values: [
Body
,BasicAuthHeader
]The content type.
The prefix fo the header.
The username for oauth2 authentication when the preferred flow is "password".
- username
The type of property observed in "value".
Allowable values: [
value
]The stored information of the value.
Private information of the provider.
- newPrivate
The private data for bearer authentication.
- authentication
The token for bearer authentication.
- token
The type of property observed in "value".
Allowable values: [
value
]The stored information of the value.
parameters
Unique identifier of the conversational skill provider.
The unique identifier of the provider.
Possible values: 1 ≤ length ≤ 256
The specification of the provider.
- newSpecification
An array of objects defining all endpoints of the provider.
Note: Multiple array items are reserved for future use.
Possible values: number of items = 1
- servers
The URL of the conversational skill provider.
An object defining various reusable definitions of the provider.
- components
The definition of the security scheme for the provider.
- securitySchemes
The authentication method required for requests made from watsonx Assistant to the conversational skill provider.
Allowable values: [
basic
,bearer
,api_key
,oauth2
,none
]Non-private settings for basic access authentication.
- basic
The username for basic access authentication.
- username
The type of property observed in "value".
Allowable values: [
value
]The stored information of the value.
Non-private settings for oauth2 authentication.
- oauth2
The preferred "flow" or "grant type" for the API client to fetch an access token from the authorization server.
Allowable values: [
password
,client_credentials
,authorization_code
,<$custom_flow_name>
]Non-private authentication settings for resource owner password flow.
- flows
The token URL.
The refresh token URL.
The client authorization type.
Allowable values: [
Body
,BasicAuthHeader
]The content type.
The prefix fo the header.
The username for oauth2 authentication when the preferred flow is "password".
- username
The type of property observed in "value".
Allowable values: [
value
]The stored information of the value.
Private information of the provider.
- newPrivate
The private data for bearer authentication.
- authentication
The token for bearer authentication.
- token
The type of property observed in "value".
Allowable values: [
value
]The stored information of the value.
parameters
Unique identifier of the conversational skill provider.
The unique identifier of the provider.
Possible values: 1 ≤ length ≤ 256
The specification of the provider.
- new_specification
An array of objects defining all endpoints of the provider.
Note: Multiple array items are reserved for future use.
Possible values: number of items = 1
- servers
The URL of the conversational skill provider.
An object defining various reusable definitions of the provider.
- components
The definition of the security scheme for the provider.
- security_schemes
The authentication method required for requests made from watsonx Assistant to the conversational skill provider.
Allowable values: [
basic
,bearer
,api_key
,oauth2
,none
]Non-private settings for basic access authentication.
- basic
The username for basic access authentication.
- username
The type of property observed in "value".
Allowable values: [
value
]The stored information of the value.
Non-private settings for oauth2 authentication.
- oauth2
The preferred "flow" or "grant type" for the API client to fetch an access token from the authorization server.
Allowable values: [
password
,client_credentials
,authorization_code
,<$custom_flow_name>
]Non-private authentication settings for resource owner password flow.
- flows
The token URL.
The refresh token URL.
The client authorization type.
Allowable values: [
Body
,BasicAuthHeader
]The content type.
The prefix fo the header.
The username for oauth2 authentication when the preferred flow is "password".
- username
The type of property observed in "value".
Allowable values: [
value
]The stored information of the value.
Private information of the provider.
- new_private
The private data for bearer authentication.
- authentication
The token for bearer authentication.
- token
The type of property observed in "value".
Allowable values: [
value
]The stored information of the value.
Response
The unique identifier of the provider.
Possible values: 1 ≤ length ≤ 256
The specification of the provider.
- specification
An array of objects defining all endpoints of the provider.
Note: Multiple array items are reserved for future use.
Possible values: number of items = 1
- servers
The URL of the conversational skill provider.
An object defining various reusable definitions of the provider.
- components
The definition of the security scheme for the provider.
- securitySchemes
The authentication method required for requests made from watsonx Assistant to the conversational skill provider.
Possible values: [
basic
,bearer
,api_key
,oauth2
,none
]Non-private settings for basic access authentication.
- basic
The username for basic access authentication.
- username
The type of property observed in "value".
Possible values: [
value
]The stored information of the value.
Non-private settings for oauth2 authentication.
The unique identifier of the provider.
Possible values: 1 ≤ length ≤ 256
The specification of the provider.
- specification
An array of objects defining all endpoints of the provider.
Note: Multiple array items are reserved for future use.
Possible values: number of items = 1
- servers
The URL of the conversational skill provider.
An object defining various reusable definitions of the provider.
- components
The definition of the security scheme for the provider.
- securitySchemes
The authentication method required for requests made from watsonx Assistant to the conversational skill provider.
Possible values: [
basic
,bearer
,api_key
,oauth2
,none
]Non-private settings for basic access authentication.
- basic
The username for basic access authentication.
- username
The type of property observed in "value".
Possible values: [
value
]The stored information of the value.
Non-private settings for oauth2 authentication.
- oauth2
The preferred "flow" or "grant type" for the API client to fetch an access token from the authorization server.
Possible values: [
password
,client_credentials
,authorization_code
,<$custom_flow_name>
]Non-private authentication settings for resource owner password flow.
- flows
The token URL.
The refresh token URL.
The client authorization type.
Possible values: [
Body
,BasicAuthHeader
]The content type.
The prefix fo the header.
The username for oauth2 authentication when the preferred flow is "password".
- username
The type of property observed in "value".
Possible values: [
value
]The stored information of the value.
The unique identifier of the provider.
Possible values: 1 ≤ length ≤ 256
The specification of the provider.
- specification
An array of objects defining all endpoints of the provider.
Note: Multiple array items are reserved for future use.
Possible values: number of items = 1
- servers
The URL of the conversational skill provider.
An object defining various reusable definitions of the provider.
- components
The definition of the security scheme for the provider.
- securitySchemes
The authentication method required for requests made from watsonx Assistant to the conversational skill provider.
Possible values: [
basic
,bearer
,api_key
,oauth2
,none
]Non-private settings for basic access authentication.
- basic
The username for basic access authentication.
- username
The type of property observed in "value".
Possible values: [
value
]The stored information of the value.
Non-private settings for oauth2 authentication.
- oauth2
The preferred "flow" or "grant type" for the API client to fetch an access token from the authorization server.
Possible values: [
password
,client_credentials
,authorization_code
,<$custom_flow_name>
]Non-private authentication settings for resource owner password flow.
- flows
The token URL.
The refresh token URL.
The client authorization type.
Possible values: [
Body
,BasicAuthHeader
]The content type.
The prefix fo the header.
The username for oauth2 authentication when the preferred flow is "password".
- username
The type of property observed in "value".
Possible values: [
value
]The stored information of the value.
The unique identifier of the provider.
Possible values: 1 ≤ length ≤ 256
The specification of the provider.
- specification
An array of objects defining all endpoints of the provider.
Note: Multiple array items are reserved for future use.
Possible values: number of items = 1
- servers
The URL of the conversational skill provider.
An object defining various reusable definitions of the provider.
- components
The definition of the security scheme for the provider.
- security_schemes
The authentication method required for requests made from watsonx Assistant to the conversational skill provider.
Possible values: [
basic
,bearer
,api_key
,oauth2
,none
]Non-private settings for basic access authentication.
- basic
The username for basic access authentication.
- username
The type of property observed in "value".
Possible values: [
value
]The stored information of the value.
Non-private settings for oauth2 authentication.
- oauth2
The preferred "flow" or "grant type" for the API client to fetch an access token from the authorization server.
Possible values: [
password
,client_credentials
,authorization_code
,<$custom_flow_name>
]Non-private authentication settings for resource owner password flow.
- flows
The token URL.
The refresh token URL.
The client authorization type.
Possible values: [
Body
,BasicAuthHeader
]The content type.
The prefix fo the header.
The username for oauth2 authentication when the preferred flow is "password".
- username
The type of property observed in "value".
Possible values: [
value
]The stored information of the value.
Status Code
Successful request.
Invalid request.
{ "provider_id": "myProCodeProvider-noSpaces_no_special_chars", "specification": { "servers": [ { "url": "https://myProCodeProvider.com" } ], "components": { "securitySchemes": { "authentication_method": "api_key" } } } }
{ "provider_id": "myProCodeProvider-noSpaces_no_special_chars", "specification": { "servers": [ { "url": "https://myProCodeProvider.com" } ], "components": { "securitySchemes": { "authentication_method": "api_key" } } } }
Create an assistant
Create a new assistant.
Create a new assistant.
Create a new assistant.
Create a new assistant.
POST /v2/assistants
ServiceCall<AssistantData> createAssistant(CreateAssistantOptions createAssistantOptions)
createAssistant(params)
create_assistant(
self,
*,
language: Optional[str] = None,
name: Optional[str] = None,
description: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Use the CreateAssistantOptions.Builder
to create a CreateAssistantOptions
object that contains the parameter values for the createAssistant
method.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.
The properties of the new assistant.
The language of the assistant.
The name of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
The createAssistant options.
The name of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
The language of the assistant.
parameters
The language of the assistant.
The name of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
parameters
The language of the assistant.
The name of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
curl -X POST -u "apikey:{apikey}" --header "Content-Type: application/json" --data "{\"name\":\"API test assistant\",\"language\":\"en\",\"description\":\"Example assistant created using API.\"}" "{url}/v2/assistants?version=2021-11-27"
curl -X POST --header "Authorization: Bearer {token}" --header "Content-Type: application/json" --data "{\"name\":\"API test assistant\",\"language\":\"en\",\"description\":\"Example assistant created using API.\"}" "{url}/v2/assistants?version=2021-11-27"
Response
The unique identifier of the assistant.
Possible values: length ≥ 1
The language of the assistant.
An array of skill references identifying the skills associated with the assistant.
An array of objects describing the environments defined for the assistant.
The name of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
The unique identifier of the assistant.
Possible values: length ≥ 1
The name of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
The language of the assistant.
An array of skill references identifying the skills associated with the assistant.
- assistantSkills
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]
An array of objects describing the environments defined for the assistant.
- assistantEnvironments
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The unique identifier of the environment.
The type of the environment. All environments other than the draft and live environments have the type
staging
.Possible values: [
draft
,live
,staging
]
The unique identifier of the assistant.
Possible values: length ≥ 1
The name of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
The language of the assistant.
An array of skill references identifying the skills associated with the assistant.
- assistant_skills
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]
An array of objects describing the environments defined for the assistant.
- assistant_environments
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The unique identifier of the environment.
The type of the environment. All environments other than the draft and live environments have the type
staging
.Possible values: [
draft
,live
,staging
]
The unique identifier of the assistant.
Possible values: length ≥ 1
The name of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
The language of the assistant.
An array of skill references identifying the skills associated with the assistant.
- assistant_skills
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]
An array of objects describing the environments defined for the assistant.
- assistant_environments
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The unique identifier of the environment.
The type of the environment. All environments other than the draft and live environments have the type
staging
.Possible values: [
draft
,live
,staging
]
Status Code
Successful request.
Invalid request.
{ "name": "test-assistant-1670429383", "language": "en", "description": "testing", "assistant_id": "0e8d77d9-07f4-47ac-95f6-25af1036a7e8", "assistant_skills": [ { "type": "action", "skill_id": "8d5fd4f9-dcc1-436c-b273-659de6f84fa4" }, { "type": "dialog", "skill_id": "eaf1b687-2e72-449b-b820-071433bb70bf" } ], "assistant_environments": [ { "name": "draft", "environment": "draft", "environment_id": "6475b599-17e1-4632-8793-154738d52263" }, { "name": "live", "environment": "live", "environment_id": "c990dacd-a41f-48b9-981a-11a24275108b" } ] }
{ "name": "test-assistant-1670429383", "language": "en", "description": "testing", "assistant_id": "0e8d77d9-07f4-47ac-95f6-25af1036a7e8", "assistant_skills": [ { "type": "action", "skill_id": "8d5fd4f9-dcc1-436c-b273-659de6f84fa4" }, { "type": "dialog", "skill_id": "eaf1b687-2e72-449b-b820-071433bb70bf" } ], "assistant_environments": [ { "name": "draft", "environment": "draft", "environment_id": "6475b599-17e1-4632-8793-154738d52263" }, { "name": "live", "environment": "live", "environment_id": "c990dacd-a41f-48b9-981a-11a24275108b" } ] }
List assistants
List the assistants associated with a watsonx Assistant service instance.
List the assistants associated with a watsonx Assistant service instance.
List the assistants associated with a watsonx Assistant service instance.
List the assistants associated with a watsonx Assistant service instance.
GET /v2/assistants
ServiceCall<AssistantCollection> listAssistants(ListAssistantsOptions listAssistantsOptions)
listAssistants(params)
list_assistants(
self,
*,
page_limit: Optional[int] = None,
include_count: Optional[bool] = None,
sort: Optional[str] = None,
cursor: Optional[str] = None,
include_audit: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
Request
Use the ListAssistantsOptions.Builder
to create a ListAssistantsOptions
object that contains the parameter values for the listAssistants
method.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.The number of records to return in each page of results.
Default:
100
Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true
, thepagination
object in the response includes thetotal
property.Default:
false
The attribute by which returned assistants will be sorted. To reverse the sort order, prefix the value with a minus sign (
-
).Allowable values: [
name
,updated
]A token identifying the page of results to retrieve.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
The listAssistants options.
The number of records to return in each page of results.
Default:
100
Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true
, thepagination
object in the response includes thetotal
property.Default:
false
The attribute by which returned assistants will be sorted. To reverse the sort order, prefix the value with a minus sign (
-
).Allowable values: [
name
,updated
]A token identifying the page of results to retrieve.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
parameters
The number of records to return in each page of results.
Default:
100
Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true
, thepagination
object in the response includes thetotal
property.Default:
false
The attribute by which returned assistants will be sorted. To reverse the sort order, prefix the value with a minus sign (
-
).Allowable values: [
name
,updated
]A token identifying the page of results to retrieve.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
parameters
The number of records to return in each page of results.
Default:
100
Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true
, thepagination
object in the response includes thetotal
property.Default:
false
The attribute by which returned assistants will be sorted. To reverse the sort order, prefix the value with a minus sign (
-
).Allowable values: [
name
,updated
]A token identifying the page of results to retrieve.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
curl -X GET -u "apikey:{apikey}" "{url}/v2/assistants?version=2021-11-27"
curl -X GET --header "Authorization: Bearer {token}" "{url}/v2/assistants?version=2021-11-27"
Response
An array of objects describing the assistants associated with the instance.
The pagination data for the returned objects. For more information about using pagination, see Pagination.
An array of objects describing the assistants associated with the instance.
- assistants
The unique identifier of the assistant.
Possible values: length ≥ 1
The name of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
The language of the assistant.
An array of skill references identifying the skills associated with the assistant.
- assistantSkills
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]
An array of objects describing the environments defined for the assistant.
- assistantEnvironments
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The unique identifier of the environment.
The type of the environment. All environments other than the draft and live environments have the type
staging
.Possible values: [
draft
,live
,staging
]
The pagination data for the returned objects. For more information about using pagination, see Pagination.
- pagination
The URL that will return the same page of results.
The URL that will return the next page of results.
The total number of objects that satisfy the request. This total includes all results, not just those included in the current page.
Reserved for future use.
A token identifying the current page of results.
A token identifying the next page of results.
An array of objects describing the assistants associated with the instance.
- assistants
The unique identifier of the assistant.
Possible values: length ≥ 1
The name of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
The language of the assistant.
An array of skill references identifying the skills associated with the assistant.
- assistant_skills
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]
An array of objects describing the environments defined for the assistant.
- assistant_environments
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The unique identifier of the environment.
The type of the environment. All environments other than the draft and live environments have the type
staging
.Possible values: [
draft
,live
,staging
]
The pagination data for the returned objects. For more information about using pagination, see Pagination.
- pagination
The URL that will return the same page of results.
The URL that will return the next page of results.
The total number of objects that satisfy the request. This total includes all results, not just those included in the current page.
Reserved for future use.
A token identifying the current page of results.
A token identifying the next page of results.
An array of objects describing the assistants associated with the instance.
- assistants
The unique identifier of the assistant.
Possible values: length ≥ 1
The name of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the assistant. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
The language of the assistant.
An array of skill references identifying the skills associated with the assistant.
- assistant_skills
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]
An array of objects describing the environments defined for the assistant.
- assistant_environments
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The unique identifier of the environment.
The type of the environment. All environments other than the draft and live environments have the type
staging
.Possible values: [
draft
,live
,staging
]
The pagination data for the returned objects. For more information about using pagination, see Pagination.
- pagination
The URL that will return the same page of results.
The URL that will return the next page of results.
The total number of objects that satisfy the request. This total includes all results, not just those included in the current page.
Reserved for future use.
A token identifying the current page of results.
A token identifying the next page of results.
Status Code
Successful request.
Invalid request.
{ "assistants": [ { "name": "test-assistant-1670279073", "language": "en", "description": "testing", "assistant_id": "824bb521-2c2a-4d12-9dc2-ae24c3a70e0c", "assistant_skills": [ { "type": "action", "skill_id": "da42f04e-1d52-4394-b700-7814d51dd9e2" } ], "assistant_environments": [ { "name": "draft", "environment": "draft", "environment_id": "add81cf1-7bc2-448a-a6f5-87cf7874c58a" }, { "name": "live", "environment": "live", "environment_id": "e6d2ed90-cbbc-4bd2-8808-fbd1ac13197e" } ] } ], "pagination": { "refresh_url": "/v2/assistants?version=2021-10-10" } }
{ "assistants": [ { "name": "test-assistant-1670279073", "language": "en", "description": "testing", "assistant_id": "824bb521-2c2a-4d12-9dc2-ae24c3a70e0c", "assistant_skills": [ { "type": "action", "skill_id": "da42f04e-1d52-4394-b700-7814d51dd9e2" } ], "assistant_environments": [ { "name": "draft", "environment": "draft", "environment_id": "add81cf1-7bc2-448a-a6f5-87cf7874c58a" }, { "name": "live", "environment": "live", "environment_id": "e6d2ed90-cbbc-4bd2-8808-fbd1ac13197e" } ] } ], "pagination": { "refresh_url": "/v2/assistants?version=2021-10-10" } }
Delete assistant
Delete an assistant.
Delete an assistant.
Delete an assistant.
Delete an assistant.
DELETE /v2/assistants/{assistant_id}
ServiceCall<Void> deleteAssistant(DeleteAssistantOptions deleteAssistantOptions)
deleteAssistant(params)
delete_assistant(
self,
assistant_id: str,
**kwargs,
) -> DetailedResponse
Request
Use the DeleteAssistantOptions.Builder
to create a DeleteAssistantOptions
object that contains the parameter values for the deleteAssistant
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.
The deleteAssistant options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
curl -X DELETE -u "apikey:{apikey}" "{url}/v2/assistants/{assistant_id}?version=2021-11-27"
curl -X DELETE --header "Authorization: Bearer {token}" "{url}/v2/assistants/{assistant_id}?version=2021-11-27"
Create a session
Create a new session. A session is used to send user input to a skill and receive responses. It also maintains the state of the conversation. A session persists until it is deleted, or until it times out because of inactivity. (For more information, see the documentation.)
Create a new session. A session is used to send user input to a skill and receive responses. It also maintains the state of the conversation. A session persists until it is deleted, or until it times out because of inactivity. (For more information, see the documentation.).
Create a new session. A session is used to send user input to a skill and receive responses. It also maintains the state of the conversation. A session persists until it is deleted, or until it times out because of inactivity. (For more information, see the documentation.).
Create a new session. A session is used to send user input to a skill and receive responses. It also maintains the state of the conversation. A session persists until it is deleted, or until it times out because of inactivity. (For more information, see the documentation.).
POST /v2/assistants/{assistant_id}/sessions
ServiceCall<SessionResponse> createSession(CreateSessionOptions createSessionOptions)
createSession(params)
create_session(
self,
assistant_id: str,
*,
analytics: Optional['RequestAnalytics'] = None,
**kwargs,
) -> DetailedResponse
Request
Use the CreateSessionOptions.Builder
to create a CreateSessionOptions
object that contains the parameter values for the createSession
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
The createSession options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
curl -X POST -u "apikey:{apikey}" "{url}/v2/assistants/{environment_id}/sessions?version=2021-11-27"
curl --header "Authorization: Bearer {token}" -X POST "{url}/v2/assistants/{environment_id}/sessions?version=2021-11-27"
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Assistant assistant = new Assistant("2021-06-14", authenticator); assistant.setServiceUrl("{url}"); CreateSessionOptions options = new CreateSessionOptions.Builder("{environment_id}").build(); SessionResponse response = assistant.createSession(options).execute().getResult(); System.out.println(response);
CloudPakForDataAuthenticator authenticator = new CloudPakForDataAuthenticator("https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize", "{username}", "{password}"); Assistant assistant = new Assistant("2020-04-01", authenticator); assistant.setServiceUrl("{url}"); CreateSessionOptions options = new CreateSessionOptions.Builder("{assistant_id}").build(); SessionResponse response = assistant.createSession(options).execute().getResult(); System.out.println(response);
const AssistantV2 = require('ibm-watson/assistant/v2'); const { IamAuthenticator } = require('ibm-watson/auth'); const assistant = new AssistantV2({ version: '2021-06-14', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); assistant.createSession({ assistantId: '{environment_id}' }) .then(res => { console.log(JSON.stringify(res.result, null, 2)); }) .catch(err => { console.log(err); });
const AssistantV2 = require('ibm-watson/assistant/v2'); const { CloudPakForDataAuthenticator } = require('ibm-watson/auth'); const assistant = new AssistantV2({ version: '2020-04-01', authenticator: new CloudPakForDataAuthenticator({ username: '{username}', password: '{password}', url: 'https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize', }), serviceUrl: '{url}', }); assistant.createSession({ assistantId: '{assistant_id}' }) .then(res => { console.log(JSON.stringify(res.result, null, 2)); }) .catch(err => { console.log(err); });
import json from ibm_watson import AssistantV2 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') assistant = AssistantV2( version='2021-06-14', authenticator = authenticator ) assistant.set_service_url('{url}') response = assistant.create_session( assistant_id='{environment_id}' ).get_result() print(json.dumps(response, indent=2))
import json from ibm_watson import AssistantV2 from ibm_cloud_sdk_core.authenticators import CloudPakForDataAuthenticator authenticator = CloudPakForDataAuthenticator( '{username}', '{password}', 'https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize' ) assistant = AssistantV2( version='2020-04-01', authenticator = authenticator ) assistant.set_service_url('{url}') response = assistant.create_session( assistant_id='{assistant_id}' ).get_result() print(json.dumps(response, indent=2))
Delete session
Deletes a session explicitly before it times out. (For more information about the session inactivity timeout, see the documentation).
Deletes a session explicitly before it times out. (For more information about the session inactivity timeout, see the documentation).
Deletes a session explicitly before it times out. (For more information about the session inactivity timeout, see the documentation).
Deletes a session explicitly before it times out. (For more information about the session inactivity timeout, see the documentation).
DELETE /v2/assistants/{assistant_id}/sessions/{session_id}
ServiceCall<Void> deleteSession(DeleteSessionOptions deleteSessionOptions)
deleteSession(params)
delete_session(
self,
assistant_id: str,
session_id: str,
**kwargs,
) -> DetailedResponse
Request
Use the DeleteSessionOptions.Builder
to create a DeleteSessionOptions
object that contains the parameter values for the deleteSession
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Unique identifier of the session.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.
The deleteSession options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the session.
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the session.
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the session.
curl -X DELETE -u "apikey:{apikey}" "{url}/v2/assistants/{environment_id}/sessions/{session_id}?version=2021-11-27"
curl --header "Authorization: Bearer {token}" -X DELETE "{url}/v2/assistants/{environment_id}/sessions/{session_id}?version=2021-11-27"
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Assistant assistant = new Assistant("2021-06-14", authenticator); assistant.setServiceUrl("{url}"); DeleteSessionOptions options = new DeleteSessionOptions.Builder("{environment_id}", "{session_id}").build(); assistant.deleteSession(options).execute();
CloudPakForDataAuthenticator authenticator = new CloudPakForDataAuthenticator("https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize", "{username}", "{password}"); Assistant assistant = new Assistant("2020-04-01", authenticator); assistant.setServiceUrl("{url}"); DeleteSessionOptions options = new DeleteSessionOptions.Builder("{assistant_id}", "{session_id}").build(); assistant.deleteSession(options).execute();
const AssistantV2 = require('ibm-watson/assistant/v2'); const { IamAuthenticator } = require('ibm-watson/auth'); const assistant = new AssistantV2({ version: '2021-06-14', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); assistant.deleteSession({ assistantId: '{environment_id}', sessionId: '{session_id}', }) .then(res => { console.log(JSON.stringify(res.result, null, 2)); }) .catch(err => { console.log(err); });
const AssistantV2 = require('ibm-watson/assistant/v2'); const { CloudPakForDataAuthenticator } = require('ibm-watson/auth'); const assistant = new AssistantV2({ version: '2020-04-01', authenticator: new CloudPakForDataAuthenticator({ username: '{username}', password: '{password}', url: 'https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize', }), serviceUrl: '{url}', }); assistant.deleteSession({ assistantId: '{assistant_id}', sessionId: '{session_id}', }) .then(res => { console.log(JSON.stringify(res.result, null, 2)); }) .catch(err => { console.log(err); });
import json from ibm_watson import AssistantV2 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') assistant = AssistantV2( version='2021-06-14', authenticator = authenticator ) assistant.set_service_url('{url}') response = assistant.delete_session( assistant_id='{environment_id}', session_id='{session_id}' ).get_result() print(json.dumps(response, indent=2))
import json from ibm_watson import AssistantV2 from ibm_cloud_sdk_core.authenticators import CloudPakForDataAuthenticator authenticator = CloudPakForDataAuthenticator( '{username}', '{password}', 'https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize' ) assistant = AssistantV2( version='2020-04-01', authenticator = authenticator ) assistant.set_service_url('{url}') response = assistant.delete_session( assistant_id='{assistant_id}', session_id='{session_id}' ).get_result() print(json.dumps(response, indent=2))
Send user input to assistant (stateful)
Send user input to an assistant and receive a response, with conversation state (including context data) stored by watsonx Assistant for the duration of the session.
Send user input to an assistant and receive a response, with conversation state (including context data) stored by watsonx Assistant for the duration of the session.
Send user input to an assistant and receive a response, with conversation state (including context data) stored by watsonx Assistant for the duration of the session.
Send user input to an assistant and receive a response, with conversation state (including context data) stored by watsonx Assistant for the duration of the session.
POST /v2/assistants/{assistant_id}/sessions/{session_id}/message
ServiceCall<StatefulMessageResponse> message(MessageOptions messageOptions)
message(params)
message(
self,
assistant_id: str,
session_id: str,
*,
input: Optional['MessageInput'] = None,
context: Optional['MessageContext'] = None,
user_id: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Use the MessageOptions.Builder
to create a MessageOptions
object that contains the parameter values for the message
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click API Details. Note: Currently, the API does not support creating environments.
Unique identifier of the session.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.
The message to be sent. This includes the user's input, along with optional content such as intents and entities.
{
"input": {
"message_type": "text",
"text": "Hello",
"options": {
"return_context": true,
"export": true
}
},
"context": {
"global": {
"system": {
"user_id": "my_user_id"
}
}
}
}
An input object that includes the input text.
Context data for the conversation. You can use this property to set or modify context variables, which can also be accessed by dialog nodes. The context is stored by the assistant on a per-session basis.
Note: The total size of the context data stored for a stateful session cannot exceed 100KB.
- context
Session context data that is shared by all skills used by the assistant.
Context data specific to particular skills used by the assistant.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context. If user_id is specified in both locations, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
The message options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the session.
An input object that includes the input text.
- input
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Allowable values: [
text
,search
]Default:
text
The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Allowable values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Allowable values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Default:
false
Whether to return more than one intent. Set to
true
to return all matching intents.Default:
false
Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Default:
false
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property. If you also specify return_context=true
, the returned skill context includes thesystem.state
property.Default:
false
Whether to return session context with the response. If you specify
true
, the response includes thecontext
property. If you also specify debug=true
, the returned skill context includes thesystem.state
property.Default:
false
Whether to return session context, including full conversation state. If you specify
true
, the response includes thecontext
property, and the skill context includes thesystem.state
property.Note: If export=
true
, the context is returned regardless of the value of return_context.Default:
false
Context data for the conversation. You can use this property to set or modify context variables, which can also be accessed by dialog nodes. The context is stored by the assistant on a per-session basis.
Note: The total size of the context data stored for a stateful session cannot exceed 100KB.
- context
Session context data that is shared by all skills used by the assistant.
- global
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Allowable values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- mainSkill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill. Private variables are persisted, but not shown.
- actionsSkill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context. If user_id is specified in both locations, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the session.
An input object that includes the input text.
- input
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Allowable values: [
text
,search
]Default:
text
The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Allowable values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Allowable values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Default:
false
Whether to return more than one intent. Set to
true
to return all matching intents.Default:
false
Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Default:
false
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property. If you also specify return_context=true
, the returned skill context includes thesystem.state
property.Default:
false
Whether to return session context with the response. If you specify
true
, the response includes thecontext
property. If you also specify debug=true
, the returned skill context includes thesystem.state
property.Default:
false
Whether to return session context, including full conversation state. If you specify
true
, the response includes thecontext
property, and the skill context includes thesystem.state
property.Note: If export=
true
, the context is returned regardless of the value of return_context.Default:
false
- context
Session context data that is shared by all skills used by the assistant.
- global
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Allowable values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- 'main skill'
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill. Private variables are persisted, but not shown.
- 'actions skill'
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context. If user_id is specified in both locations, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the session.
An input object that includes the input text.
- input
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Allowable values: [
text
,search
]Default:
text
The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Allowable values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Allowable values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Default:
false
Whether to return more than one intent. Set to
true
to return all matching intents.Default:
false
Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Default:
false
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property. If you also specify return_context=true
, the returned skill context includes thesystem.state
property.Default:
false
Whether to return session context with the response. If you specify
true
, the response includes thecontext
property. If you also specify debug=true
, the returned skill context includes thesystem.state
property.Default:
false
Whether to return session context, including full conversation state. If you specify
true
, the response includes thecontext
property, and the skill context includes thesystem.state
property.Note: If export=
true
, the context is returned regardless of the value of return_context.Default:
false
- context
Session context data that is shared by all skills used by the assistant.
- global_
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Allowable values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- main_skill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill. Private variables are persisted, but not shown.
- actions_skill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context. If user_id is specified in both locations, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
curl -X POST -u "apikey:{apikey}" --header "Content-Type:application/json" --data "{\"input\": {\"text\": \"Hello\"}}" "{url}/v2/assistants/{environment_id}/sessions/{session_id}/message?version=2024-08-25"
curl -X POST -u "apikey:{apikey}" --header "Content-Type: application/json" --data "{\"input\": {\"text\": \"Hello\", \"options\": {\"return_context\": true}}, \"context\": {\"global\": {\"system\": {\"user_id\": \"my_user_id\"}}, \"skills\": {\"main skill\": {\"user_defined\": {\"account_number\": \"123456\"}}}}}" "{url}/v2/assistants/{environment_id}/sessions/{session_id}/message?version=2024-08-25"
curl -H "Authorization: Bearer {token}" -X POST -H "Content-Type:application/json" -d "{\"input\": {\"text\": \"Hello\"}}" "{url}/v2/assistants/{environment_id}/sessions/{session_id}/message?version=2024-08-25"
curl -H "Authorization: Bearer {token}" -X POST -H "Content-Type: application/json" -d "{\"input\": {\"text\": \"Hello\", \"options\": {\"return_context\": true}}, \"context\": {\"global\": {\"system\": {\"user_id\": \"my_user_id\"}}, \"skills\": {\"main skill\": {\"user_defined\": {\"account_number\": \"123456\"}}}}}" "{url}/v2/assistants/{environment_id}/sessions/{session_id}/message?version=2024-08-25"
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Assistant assistant = new Assistant("2021-06-14", authenticator); assistant.setServiceUrl("{url}"); MessageInput input = new MessageInput.Builder() .messageType("text") .text("Hello") .build(); MessageOptions options = new MessageOptions.Builder("{environment_id}", "{session_id}") .input(input) .build(); MessageResponse response = assistant.message(options).execute().getResult(); System.out.println(response);
Authenticator authenticator = new IamAuthenticator("{apikey}"); Assistant assistant = new Assistant("2021-06-14", authenticator); assistant.setServiceUrl("{url}"); MessageInputOptions inputOptions = new MessageInputOptions.Builder() .returnContext(true) .build(); MessageInput input = new MessageInput.Builder() .messageType("text") .text("Hello") .options(inputOptions) .build(); MessageContextGlobalSystem system = new MessageContextGlobalSystem.Builder() .userId("my_user_id") .build(); MessageContextGlobal globalContext = new MessageContextGlobal.Builder() .system(system) .build(); Map<String, Object> userDefinedContext = new HashMap<>(); userDefinedContext.put("account_num","123456"); MessageContextSkill mainSkillContext = new MessageContextSkill.Builder() .userDefined(userDefinedContext) .build(); MessageContextSkills skillsContext = new MessageContextSkills(); skillsContext.put("main skill", mainSkillContext); MessageContext context = new MessageContext.Builder() .global(globalContext) .skills(skillsContext) .build(); MessageOptions options = new MessageOptions.Builder() .assistantId("{environment_id}") .sessionId("{session_id}") .input(input) .context(context) .build(); MessageResponse response = service.message(options).execute().getResult(); System.out.println(response);
CloudPakForDataAuthenticator authenticator = new CloudPakForDataAuthenticator("https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize", "{username}", "{password}"); Assistant assistant = new Assistant("2020-04-01", authenticator); assistant.setServiceUrl("{url}"); MessageInput input = new MessageInput.Builder() .messageType("text") .text("Hello") .build(); MessageOptions options = new MessageOptions.Builder("{assistant_id}", "{session_id}") .input(input) .build(); MessageResponse response = assistant.message(options).execute().getResult(); System.out.println(response);
CloudPakForDataAuthenticator authenticator = new CloudPakForDataAuthenticator("https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize", "{username}", "{password}"); Assistant assistant = new Assistant("2020-04-01", authenticator); assistant.setServiceUrl("{url}"); MessageInputOptions inputOptions = new MessageInputOptions.Builder() .returnContext(true) .build(); MessageInput input = new MessageInput.Builder() .messageType("text") .text("Hello") .options(inputOptions) .build(); MessageContextGlobalSystem system = new MessageContextGlobalSystem.Builder() .userId("my_user_id") .build(); MessageContextGlobal globalContext = new MessageContextGlobal.Builder() .system(system) .build(); Map<String, Object> userDefinedContext = new HashMap<>(); userDefinedContext.put("account_num","123456"); MessageContextSkill mainSkillContext = new MessageContextSkill.Builder() .userDefined(userDefinedContext) .build(); MessageContextSkills skillsContext = new MessageContextSkills(); skillsContext.put("main skill", mainSkillContext); MessageContext context = new MessageContext.Builder() .global(globalContext) .skills(skillsContext) .build(); MessageOptions options = new MessageOptions.Builder() .assistantId("{assistant_id}") .sessionId("{session_id}") .input(input) .context(context) .build(); MessageResponse response = service.message(options).execute().getResult(); System.out.println(response);
const AssistantV2 = require('ibm-watson/assistant/v2'); const { IamAuthenticator } = require('ibm-watson/auth'); const assistant = new AssistantV2({ version: '2021-06-14', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); assistant.message({ assistantId: '{environment_id}', sessionId: '{session_id}', input: { 'message_type': 'text', 'text': 'Hello' } }) .then(res => { console.log(JSON.stringify(res.result, null, 2)); }) .catch(err => { console.log(err); });
const AssistantV2 = require('ibm-watson/assistant/v2'); const { IamAuthenticator } = require('ibm-watson/auth'); const assistant = new AssistantV2({ version: '2021-06-14', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); assistant.message({ assistantId: '{environment_id}', sessionId: '{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.result, null, 2)); }) .catch(err => { console.log(err); });
const AssistantV2 = require('ibm-watson/assistant/v2'); const { CloudPakForDataAuthenticator } = require('ibm-watson/auth'); const assistant = new AssistantV2({ version: '2020-04-01', authenticator: new CloudPakForDataAuthenticator({ username: '{username}', password: '{password}', url: 'https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize', }), serviceUrl: '{url}', }); assistant.message({ assistantId: '{assistant_id}', sessionId: '{session_id}', input: { 'message_type': 'text', 'text': 'Hello' } }) .then(res => { console.log(JSON.stringify(res.result, null, 2)); }) .catch(err => { console.log(err); });
const AssistantV2 = require('ibm-watson/assistant/v2'); const { CloudPakForDataAuthenticator } = require('ibm-watson/auth'); const assistant = new AssistantV2({ version: '2020-04-01', authenticator: new CloudPakForDataAuthenticator({ username: '{username}', password: '{password}', url: 'https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize', }), serviceUrl: '{url}', }); assistant.message({ assistantId: '{assistant_id}', sessionId: '{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.result, null, 2)); }) .catch(err => { console.log(err); });
import json from ibm_watson import AssistantV2 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') assistant = AssistantV2( version='2021-06-14', authenticator = authenticator ) assistant.set_service_url('{url}') response = assistant.message( assistant_id='{environment_id}', session_id='{session_id}', input={ 'message_type': 'text', 'text': 'Hello' } ).get_result() print(json.dumps(response, indent=2))
import json from ibm_watson import AssistantV2 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') assistant = AssistantV2( version='2021-06-14', authenticator = authenticator ) assistant.set_service_url('{url}') response=assistant.message( assistant_id='{environment_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' } } } } ).get_result() print(json.dumps(response, indent=2))
import json from ibm_watson import AssistantV2 from ibm_cloud_sdk_core.authenticators import CloudPakForDataAuthenticator authenticator = CloudPakForDataAuthenticator( '{username}', '{password}', 'https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize' ) assistant = AssistantV2( version='2020-04-01', authenticator = authenticator ) assistant.set_service_url('{url}') response = assistant.message( assistant_id='{assistant_id}', session_id='{session_id}', input={ 'message_type': 'text', 'text': 'Hello' } ).get_result() print(json.dumps(response, indent=2))
import json from ibm_watson import AssistantV2 from ibm_cloud_sdk_core.authenticators import CloudPakForDataAuthenticator authenticator = CloudPakForDataAuthenticator( '{username}', '{password}', 'https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize' ) assistant = AssistantV2( version='2020-04-01', authenticator = authenticator ) assistant.set_service_url('{url}') response=assistant.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' } } } } ).get_result() print(json.dumps(response, indent=2))
Response
A response from the watsonx Assistant service.
Assistant output to be rendered or processed by the client.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context.
Context data for the conversation. You can use this property to access context variables. The context is stored by the assistant on a per-session basis.
Note: The context is included in message responses only if return_context=
true
in the message request. Full context is always included in logs.- context
Session context data that is shared by all skills used by the assistant.
Context data specific to particular skills used by the assistant.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
Assistant output to be rendered or processed by the client. All private data is masked or removed.
An input object that includes the input text. All private data is masked or removed.
A response from the watsonx Assistant service.
Assistant output to be rendered or processed by the client.
- output
Output intended for any channel. It is the responsibility of the client application to implement the supported response types.
- generic
- RuntimeResponseGeneric
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text of the response.
An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
- channels
A channel for which the response is intended.
An array of intents recognized in the user input, sorted in descending order of confidence.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of entities identified in the user input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of objects describing any actions requested by the dialog node.
- actions
The name of the action.
The type of action to invoke.
Possible values: [
client
,server
,web-action
,cloud-function
]A map of key/value pairs to be provided to the action.
The location in the dialog context where the result of the action is stored.
The name of the context variable that the client application will use to pass in credentials for the action.
Additional detailed information about a message response and how it was generated.
- debug
An array of objects containing detailed diagnostic information about dialog nodes that were visited during processing of the input message.
- nodesVisited
A dialog node that was visited during processing of the input message.
The title of the dialog node.
The conditions that trigger the dialog node.
An array of up to 50 messages logged with the request.
- logMessages
The severity of the log message.
Possible values: [
info
,error
,warn
]The text of the log message.
A code that indicates the category to which the error message belongs.
An object that identifies the dialog element that generated the error message.
- source
A string that indicates the type of dialog element that generated the error message.
The unique identifier of the dialog node that generated the error message.
Assistant sets this to true when this message response concludes or interrupts a dialog.
When
branch_exited
is set totrue
by the assistant, thebranch_exited_reason
specifies whether the dialog completed by itself or got interrupted.Possible values: [
completed
,fallback
]An array of objects containing detailed diagnostic information about dialog nodes and actions that were visited during processing of the input message.
This property is present only if the assistant has an action skill.
- turnEvents
- MessageOutputDebugTurnEvent
The type of turn event.
- source
The type of turn event.
Possible values: [
action
]An action that was visited during processing of the message.
The title of the action.
The condition that triggered the dialog node.
The time when the action started processing the message.
The type of condition (if any) that is defined for the action.
Possible values: [
user_defined
,welcome
,anything_else
]The reason the action was visited.
Possible values: [
intent
,invoke_subaction
,subaction_return
,invoke_external
,topic_switch
,topic_return
,agent_requested
,step_validation_failed
,no_action_matches
]The variable where the result of the call to the action is stored. Included only if reason=
subaction_return
.
An object containing any custom properties included in the response. This object includes any arbitrary properties defined in the dialog JSON editor as part of the dialog node output.
Properties describing any spelling corrections in the user input that was received.
- spelling
The user input text that was used to generate the response. If spelling autocorrection is enabled, this text reflects any spelling corrections that were applied.
The original user input text. This property is returned only if autocorrection is enabled and the user input was corrected.
Any suggested corrections of the input text. This property is returned only if spelling correction is enabled and autocorrection is disabled.
Context data for the conversation. You can use this property to access context variables. The context is stored by the assistant on a per-session basis.
Note: The context is included in message responses only if return_context=
true
in the message request. Full context is always included in logs.- context
Session context data that is shared by all skills used by the assistant.
- global
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Possible values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
The session ID.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- mainSkill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill. Private variables are persisted, but not shown.
- actionsSkill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context.
Assistant output to be rendered or processed by the client. All private data is masked or removed.
- maskedOutput
Output intended for any channel. It is the responsibility of the client application to implement the supported response types.
- generic
- RuntimeResponseGeneric
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text of the response.
An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
- channels
A channel for which the response is intended.
An array of intents recognized in the user input, sorted in descending order of confidence.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of entities identified in the user input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of objects describing any actions requested by the dialog node.
- actions
The name of the action.
The type of action to invoke.
Possible values: [
client
,server
,web-action
,cloud-function
]A map of key/value pairs to be provided to the action.
The location in the dialog context where the result of the action is stored.
The name of the context variable that the client application will use to pass in credentials for the action.
Additional detailed information about a message response and how it was generated.
- debug
An array of objects containing detailed diagnostic information about dialog nodes that were visited during processing of the input message.
- nodesVisited
A dialog node that was visited during processing of the input message.
The title of the dialog node.
The conditions that trigger the dialog node.
An array of up to 50 messages logged with the request.
- logMessages
The severity of the log message.
Possible values: [
info
,error
,warn
]The text of the log message.
A code that indicates the category to which the error message belongs.
An object that identifies the dialog element that generated the error message.
- source
A string that indicates the type of dialog element that generated the error message.
The unique identifier of the dialog node that generated the error message.
Assistant sets this to true when this message response concludes or interrupts a dialog.
When
branch_exited
is set totrue
by the assistant, thebranch_exited_reason
specifies whether the dialog completed by itself or got interrupted.Possible values: [
completed
,fallback
]An array of objects containing detailed diagnostic information about dialog nodes and actions that were visited during processing of the input message.
This property is present only if the assistant has an action skill.
- turnEvents
- MessageOutputDebugTurnEvent
The type of turn event.
- source
The type of turn event.
Possible values: [
action
]An action that was visited during processing of the message.
The title of the action.
The condition that triggered the dialog node.
The time when the action started processing the message.
The type of condition (if any) that is defined for the action.
Possible values: [
user_defined
,welcome
,anything_else
]The reason the action was visited.
Possible values: [
intent
,invoke_subaction
,subaction_return
,invoke_external
,topic_switch
,topic_return
,agent_requested
,step_validation_failed
,no_action_matches
]The variable where the result of the call to the action is stored. Included only if reason=
subaction_return
.
An object containing any custom properties included in the response. This object includes any arbitrary properties defined in the dialog JSON editor as part of the dialog node output.
Properties describing any spelling corrections in the user input that was received.
- spelling
The user input text that was used to generate the response. If spelling autocorrection is enabled, this text reflects any spelling corrections that were applied.
The original user input text. This property is returned only if autocorrection is enabled and the user input was corrected.
Any suggested corrections of the input text. This property is returned only if spelling correction is enabled and autocorrection is disabled.
An input object that includes the input text. All private data is masked or removed.
- maskedInput
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Possible values: [
text
,search
]The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Whether to return more than one intent. Set to
true
to return all matching intents.Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property. If you also specify return_context=true
, the returned skill context includes thesystem.state
property.Whether to return session context with the response. If you specify
true
, the response includes thecontext
property. If you also specify debug=true
, the returned skill context includes thesystem.state
property.Whether to return session context, including full conversation state. If you specify
true
, the response includes thecontext
property, and the skill context includes thesystem.state
property.Note: If export=
true
, the context is returned regardless of the value of return_context.
A response from the watsonx Assistant service.
Assistant output to be rendered or processed by the client.
- output
Output intended for any channel. It is the responsibility of the client application to implement the supported response types.
- generic
- RuntimeResponseGeneric
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text of the response.
An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
- channels
A channel for which the response is intended.
An array of intents recognized in the user input, sorted in descending order of confidence.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of entities identified in the user input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of objects describing any actions requested by the dialog node.
- actions
The name of the action.
The type of action to invoke.
Possible values: [
client
,server
,web-action
,cloud-function
]A map of key/value pairs to be provided to the action.
The location in the dialog context where the result of the action is stored.
The name of the context variable that the client application will use to pass in credentials for the action.
Additional detailed information about a message response and how it was generated.
- debug
An array of objects containing detailed diagnostic information about dialog nodes that were visited during processing of the input message.
- nodes_visited
A dialog node that was visited during processing of the input message.
The title of the dialog node.
The conditions that trigger the dialog node.
An array of up to 50 messages logged with the request.
- log_messages
The severity of the log message.
Possible values: [
info
,error
,warn
]The text of the log message.
A code that indicates the category to which the error message belongs.
An object that identifies the dialog element that generated the error message.
- source
A string that indicates the type of dialog element that generated the error message.
The unique identifier of the dialog node that generated the error message.
Assistant sets this to true when this message response concludes or interrupts a dialog.
When
branch_exited
is set totrue
by the assistant, thebranch_exited_reason
specifies whether the dialog completed by itself or got interrupted.Possible values: [
completed
,fallback
]An array of objects containing detailed diagnostic information about dialog nodes and actions that were visited during processing of the input message.
This property is present only if the assistant has an action skill.
- turn_events
- MessageOutputDebugTurnEvent
The type of turn event.
- source
The type of turn event.
Possible values: [
action
]An action that was visited during processing of the message.
The title of the action.
The condition that triggered the dialog node.
The time when the action started processing the message.
The type of condition (if any) that is defined for the action.
Possible values: [
user_defined
,welcome
,anything_else
]The reason the action was visited.
Possible values: [
intent
,invoke_subaction
,subaction_return
,invoke_external
,topic_switch
,topic_return
,agent_requested
,step_validation_failed
,no_action_matches
]The variable where the result of the call to the action is stored. Included only if reason=
subaction_return
.
An object containing any custom properties included in the response. This object includes any arbitrary properties defined in the dialog JSON editor as part of the dialog node output.
Properties describing any spelling corrections in the user input that was received.
- spelling
The user input text that was used to generate the response. If spelling autocorrection is enabled, this text reflects any spelling corrections that were applied.
The original user input text. This property is returned only if autocorrection is enabled and the user input was corrected.
Any suggested corrections of the input text. This property is returned only if spelling correction is enabled and autocorrection is disabled.
Context data for the conversation. You can use this property to access context variables. The context is stored by the assistant on a per-session basis.
Note: The context is included in message responses only if return_context=
true
in the message request. Full context is always included in logs.- context
Session context data that is shared by all skills used by the assistant.
- global
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Possible values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
The session ID.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- 'main skill'
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill. Private variables are persisted, but not shown.
- 'actions skill'
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context.
Assistant output to be rendered or processed by the client. All private data is masked or removed.
- masked_output
Output intended for any channel. It is the responsibility of the client application to implement the supported response types.
- generic
- RuntimeResponseGeneric
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text of the response.
An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
- channels
A channel for which the response is intended.
An array of intents recognized in the user input, sorted in descending order of confidence.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of entities identified in the user input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of objects describing any actions requested by the dialog node.
- actions
The name of the action.
The type of action to invoke.
Possible values: [
client
,server
,web-action
,cloud-function
]A map of key/value pairs to be provided to the action.
The location in the dialog context where the result of the action is stored.
The name of the context variable that the client application will use to pass in credentials for the action.
Additional detailed information about a message response and how it was generated.
- debug
An array of objects containing detailed diagnostic information about dialog nodes that were visited during processing of the input message.
- nodes_visited
A dialog node that was visited during processing of the input message.
The title of the dialog node.
The conditions that trigger the dialog node.
An array of up to 50 messages logged with the request.
- log_messages
The severity of the log message.
Possible values: [
info
,error
,warn
]The text of the log message.
A code that indicates the category to which the error message belongs.
An object that identifies the dialog element that generated the error message.
- source
A string that indicates the type of dialog element that generated the error message.
The unique identifier of the dialog node that generated the error message.
Assistant sets this to true when this message response concludes or interrupts a dialog.
When
branch_exited
is set totrue
by the assistant, thebranch_exited_reason
specifies whether the dialog completed by itself or got interrupted.Possible values: [
completed
,fallback
]An array of objects containing detailed diagnostic information about dialog nodes and actions that were visited during processing of the input message.
This property is present only if the assistant has an action skill.
- turn_events
- MessageOutputDebugTurnEvent
The type of turn event.
- source
The type of turn event.
Possible values: [
action
]An action that was visited during processing of the message.
The title of the action.
The condition that triggered the dialog node.
The time when the action started processing the message.
The type of condition (if any) that is defined for the action.
Possible values: [
user_defined
,welcome
,anything_else
]The reason the action was visited.
Possible values: [
intent
,invoke_subaction
,subaction_return
,invoke_external
,topic_switch
,topic_return
,agent_requested
,step_validation_failed
,no_action_matches
]The variable where the result of the call to the action is stored. Included only if reason=
subaction_return
.
An object containing any custom properties included in the response. This object includes any arbitrary properties defined in the dialog JSON editor as part of the dialog node output.
Properties describing any spelling corrections in the user input that was received.
- spelling
The user input text that was used to generate the response. If spelling autocorrection is enabled, this text reflects any spelling corrections that were applied.
The original user input text. This property is returned only if autocorrection is enabled and the user input was corrected.
Any suggested corrections of the input text. This property is returned only if spelling correction is enabled and autocorrection is disabled.
An input object that includes the input text. All private data is masked or removed.
- masked_input
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Possible values: [
text
,search
]The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Whether to return more than one intent. Set to
true
to return all matching intents.Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property. If you also specify return_context=true
, the returned skill context includes thesystem.state
property.Whether to return session context with the response. If you specify
true
, the response includes thecontext
property. If you also specify debug=true
, the returned skill context includes thesystem.state
property.Whether to return session context, including full conversation state. If you specify
true
, the response includes thecontext
property, and the skill context includes thesystem.state
property.Note: If export=
true
, the context is returned regardless of the value of return_context.
A response from the watsonx Assistant service.
Assistant output to be rendered or processed by the client.
- output
Output intended for any channel. It is the responsibility of the client application to implement the supported response types.
- generic
- RuntimeResponseGeneric
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text of the response.
An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
- channels
A channel for which the response is intended.
An array of intents recognized in the user input, sorted in descending order of confidence.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of entities identified in the user input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of objects describing any actions requested by the dialog node.
- actions
The name of the action.
The type of action to invoke.
Possible values: [
client
,server
,web-action
,cloud-function
]A map of key/value pairs to be provided to the action.
The location in the dialog context where the result of the action is stored.
The name of the context variable that the client application will use to pass in credentials for the action.
Additional detailed information about a message response and how it was generated.
- debug
An array of objects containing detailed diagnostic information about dialog nodes that were visited during processing of the input message.
- nodes_visited
A dialog node that was visited during processing of the input message.
The title of the dialog node.
The conditions that trigger the dialog node.
An array of up to 50 messages logged with the request.
- log_messages
The severity of the log message.
Possible values: [
info
,error
,warn
]The text of the log message.
A code that indicates the category to which the error message belongs.
An object that identifies the dialog element that generated the error message.
- source
A string that indicates the type of dialog element that generated the error message.
The unique identifier of the dialog node that generated the error message.
Assistant sets this to true when this message response concludes or interrupts a dialog.
When
branch_exited
is set totrue
by the assistant, thebranch_exited_reason
specifies whether the dialog completed by itself or got interrupted.Possible values: [
completed
,fallback
]An array of objects containing detailed diagnostic information about dialog nodes and actions that were visited during processing of the input message.
This property is present only if the assistant has an action skill.
- turn_events
- MessageOutputDebugTurnEvent
The type of turn event.
- source
The type of turn event.
Possible values: [
action
]An action that was visited during processing of the message.
The title of the action.
The condition that triggered the dialog node.
The time when the action started processing the message.
The type of condition (if any) that is defined for the action.
Possible values: [
user_defined
,welcome
,anything_else
]The reason the action was visited.
Possible values: [
intent
,invoke_subaction
,subaction_return
,invoke_external
,topic_switch
,topic_return
,agent_requested
,step_validation_failed
,no_action_matches
]The variable where the result of the call to the action is stored. Included only if reason=
subaction_return
.
An object containing any custom properties included in the response. This object includes any arbitrary properties defined in the dialog JSON editor as part of the dialog node output.
Properties describing any spelling corrections in the user input that was received.
- spelling
The user input text that was used to generate the response. If spelling autocorrection is enabled, this text reflects any spelling corrections that were applied.
The original user input text. This property is returned only if autocorrection is enabled and the user input was corrected.
Any suggested corrections of the input text. This property is returned only if spelling correction is enabled and autocorrection is disabled.
Context data for the conversation. You can use this property to access context variables. The context is stored by the assistant on a per-session basis.
Note: The context is included in message responses only if return_context=
true
in the message request. Full context is always included in logs.- context
Session context data that is shared by all skills used by the assistant.
- global_
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Possible values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
The session ID.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- main_skill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill. Private variables are persisted, but not shown.
- actions_skill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context.
Assistant output to be rendered or processed by the client. All private data is masked or removed.
- masked_output
Output intended for any channel. It is the responsibility of the client application to implement the supported response types.
- generic
- RuntimeResponseGeneric
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text of the response.
An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
- channels
A channel for which the response is intended.
An array of intents recognized in the user input, sorted in descending order of confidence.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of entities identified in the user input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of objects describing any actions requested by the dialog node.
- actions
The name of the action.
The type of action to invoke.
Possible values: [
client
,server
,web-action
,cloud-function
]A map of key/value pairs to be provided to the action.
The location in the dialog context where the result of the action is stored.
The name of the context variable that the client application will use to pass in credentials for the action.
Additional detailed information about a message response and how it was generated.
- debug
An array of objects containing detailed diagnostic information about dialog nodes that were visited during processing of the input message.
- nodes_visited
A dialog node that was visited during processing of the input message.
The title of the dialog node.
The conditions that trigger the dialog node.
An array of up to 50 messages logged with the request.
- log_messages
The severity of the log message.
Possible values: [
info
,error
,warn
]The text of the log message.
A code that indicates the category to which the error message belongs.
An object that identifies the dialog element that generated the error message.
- source
A string that indicates the type of dialog element that generated the error message.
The unique identifier of the dialog node that generated the error message.
Assistant sets this to true when this message response concludes or interrupts a dialog.
When
branch_exited
is set totrue
by the assistant, thebranch_exited_reason
specifies whether the dialog completed by itself or got interrupted.Possible values: [
completed
,fallback
]An array of objects containing detailed diagnostic information about dialog nodes and actions that were visited during processing of the input message.
This property is present only if the assistant has an action skill.
- turn_events
- MessageOutputDebugTurnEvent
The type of turn event.
- source
The type of turn event.
Possible values: [
action
]An action that was visited during processing of the message.
The title of the action.
The condition that triggered the dialog node.
The time when the action started processing the message.
The type of condition (if any) that is defined for the action.
Possible values: [
user_defined
,welcome
,anything_else
]The reason the action was visited.
Possible values: [
intent
,invoke_subaction
,subaction_return
,invoke_external
,topic_switch
,topic_return
,agent_requested
,step_validation_failed
,no_action_matches
]The variable where the result of the call to the action is stored. Included only if reason=
subaction_return
.
An object containing any custom properties included in the response. This object includes any arbitrary properties defined in the dialog JSON editor as part of the dialog node output.
Properties describing any spelling corrections in the user input that was received.
- spelling
The user input text that was used to generate the response. If spelling autocorrection is enabled, this text reflects any spelling corrections that were applied.
The original user input text. This property is returned only if autocorrection is enabled and the user input was corrected.
Any suggested corrections of the input text. This property is returned only if spelling correction is enabled and autocorrection is disabled.
An input object that includes the input text. All private data is masked or removed.
- masked_input
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Possible values: [
text
,search
]The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Whether to return more than one intent. Set to
true
to return all matching intents.Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property. If you also specify return_context=true
, the returned skill context includes thesystem.state
property.Whether to return session context with the response. If you specify
true
, the response includes thecontext
property. If you also specify debug=true
, the returned skill context includes thesystem.state
property.Whether to return session context, including full conversation state. If you specify
true
, the response includes thecontext
property, and the skill context includes thesystem.state
property.Note: If export=
true
, the context is returned regardless of the value of return_context.
Status Code
Successful request.
Invalid request.
{ "output": { "generic": [ { "response_type": "text", "text": "Hello! What can I do for you?" } ], "intents": [ { "intent": "hello", "confidence": 0.9281370162963867 } ], "entities": [] }, "context": { "global": { "system": { "turn_count": 1, "user_id": "55cd47b1-3847-430b-ba28-1739e0654576" }, "session_id": "55cd47b1-3847-430b-ba28-1739e0654576" }, "skills": { "main skill": { "system": { "state": "eyJzZXNzaW9uX2lkIjoiNTVjZDQ3YjEtMzg0Ny00MzBiLWJhMjgtMTczOWUwNjU0NTc2Iiwic2tpbGxfcmVmZXJlbmNlIjoibWFpbiBza2lsbCIsImFzc2lzdGFudF9pZCI6ImViM2RmZGRlLTJkNDUtNDBmYS05NDZlLTk2ODVmNTU2NzhhOSIsImluaXRpYWxpemVkIjp0cnVlLCJkaWFsb2dfc3RhY2siOlt7ImRpYWxvZ19ub2RlIjoicm9vdCJ9XSwibGFzdF9icmFuY2hfbm9kZSI6ImdyZWV0aW5nX29wdGlvbl8zIn0=" } } } }, "user_id": "55cd47b1-3847-430b-ba28-1739e0654576" }
{ "output": { "generic": [ { "response_type": "text", "text": "Hello! What can I do for you?" } ], "intents": [ { "intent": "hello", "confidence": 0.9281370162963867 } ], "entities": [] }, "context": { "global": { "system": { "turn_count": 1, "user_id": "55cd47b1-3847-430b-ba28-1739e0654576" }, "session_id": "55cd47b1-3847-430b-ba28-1739e0654576" }, "skills": { "main skill": { "system": { "state": "eyJzZXNzaW9uX2lkIjoiNTVjZDQ3YjEtMzg0Ny00MzBiLWJhMjgtMTczOWUwNjU0NTc2Iiwic2tpbGxfcmVmZXJlbmNlIjoibWFpbiBza2lsbCIsImFzc2lzdGFudF9pZCI6ImViM2RmZGRlLTJkNDUtNDBmYS05NDZlLTk2ODVmNTU2NzhhOSIsImluaXRpYWxpemVkIjp0cnVlLCJkaWFsb2dfc3RhY2siOlt7ImRpYWxvZ19ub2RlIjoicm9vdCJ9XSwibGFzdF9icmFuY2hfbm9kZSI6ImdyZWV0aW5nX29wdGlvbl8zIn0=" } } } }, "user_id": "55cd47b1-3847-430b-ba28-1739e0654576" }
Send user input to assistant (stateless)
Send user input to an assistant and receive a response, with conversation state (including context data) managed by your application.
Send user input to an assistant and receive a response, with conversation state (including context data) managed by your application.
Send user input to an assistant and receive a response, with conversation state (including context data) managed by your application.
Send user input to an assistant and receive a response, with conversation state (including context data) managed by your application.
POST /v2/assistants/{assistant_id}/message
ServiceCall<StatelessMessageResponse> messageStateless(MessageStatelessOptions messageStatelessOptions)
messageStateless(params)
message_stateless(
self,
assistant_id: str,
*,
input: Optional['StatelessMessageInput'] = None,
context: Optional['StatelessMessageContext'] = None,
user_id: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Use the MessageStatelessOptions.Builder
to create a MessageStatelessOptions
object that contains the parameter values for the messageStateless
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click API Details. Note: Currently, the API does not support creating environments.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.
The message to be sent. This includes the user's input, context data, and optional content such as intents and entities.
{
"input": {
"message_type": "text",
"text": "I want to cancel my order"
},
"context": {
"global": {
"system": {
"turn_count": 1
},
"session_id": "89fe006f-7068-40b7-a898-ba9240904000"
},
"skills": {
"main skill": {
"system": {
"state": "eyJzZXNzaW9uX2lkIjoiODlmZTAwNmYtNzA2OC00MGI3LWE4OTgtYmE5MjQwOTA0MDAwIiwic2tpbGxfcmVmZXJlbmNlIjoibWFpbiBza2lsbCIsImFzc2lzdGFudF9pZCI6ImViM2RmZGRlLTJkNDUtNDBmYS05NDZlLTk2ODVmNTU2NzhhOSIsImluaXRpYWxpemVkIjp0cnVlLCJkaWFsb2dfc3RhY2siOlt7ImRpYWxvZ19ub2RlIjoicm9vdCJ9XSwiX25vZGVfb3V0cHV0X21hcCI6eyJub2RlXzJfMTU3MTA3NDUxMzc0NSI6WzBdfSwibGFzdF9icmFuY2hfbm9kZSI6Im5vZGVfMl8xNTcxMDc0NTEzNzQ1In0="
}
}
}
},
"user_id": "my_user_id"
}
An input object that includes the input text.
Context data for the conversation. You can use this property to set or modify context variables, which can also be accessed by dialog nodes. The context is not stored by the assistant. To maintain session state, include the context from the previous response.
Note: The total size of the context data for a stateless session cannot exceed 250KB.
- context
Session context data that is shared by all skills used by the assistant.
Context data specific to particular skills used by the assistant.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context. If user_id is specified in both locations in a message request, the value specified at the root is used.
The messageStateless options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
An input object that includes the input text.
- input
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Allowable values: [
text
,search
]Default:
text
The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Allowable values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Allowable values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Default:
false
Whether to return more than one intent. Set to
true
to return all matching intents.Default:
false
Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Default:
false
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property.Default:
false
Context data for the conversation. You can use this property to set or modify context variables, which can also be accessed by dialog nodes. The context is not stored by the assistant. To maintain session state, include the context from the previous response.
Note: The total size of the context data for a stateless session cannot exceed 250KB.
- context
Session context data that is shared by all skills used by the assistant.
- global
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Allowable values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
The unique identifier of the session.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- mainSkill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill.
- actionsSkill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing private action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends. Private variables are encrypted.
An object containing private skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session. Private variables are encrypted.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context. If user_id is specified in both locations in a message request, the value specified at the root is used.
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
An input object that includes the input text.
- input
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Allowable values: [
text
,search
]Default:
text
The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Allowable values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Allowable values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Default:
false
Whether to return more than one intent. Set to
true
to return all matching intents.Default:
false
Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Default:
false
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property.Default:
false
- context
Session context data that is shared by all skills used by the assistant.
- global
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Allowable values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
The unique identifier of the session.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- 'main skill'
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill.
- 'actions skill'
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing private action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends. Private variables are encrypted.
An object containing private skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session. Private variables are encrypted.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context. If user_id is specified in both locations in a message request, the value specified at the root is used.
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
An input object that includes the input text.
- input
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Allowable values: [
text
,search
]Default:
text
The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Allowable values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Allowable values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Default:
false
Whether to return more than one intent. Set to
true
to return all matching intents.Default:
false
Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Default:
false
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property.Default:
false
- context
Session context data that is shared by all skills used by the assistant.
- global_
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Allowable values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
The unique identifier of the session.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- main_skill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill.
- actions_skill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing private action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends. Private variables are encrypted.
An object containing private skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session. Private variables are encrypted.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context. If user_id is specified in both locations in a message request, the value specified at the root is used.
curl -X POST -u "apikey:{apikey}" --header "Content-Type:application/json" --data "{\"input\": {\"text\": \"Hello\"}}" "{url}/v2/assistants/{environment_id}/message?version=2024-08-25"
curl -H "Authorization: Bearer {token}" -X POST -H "Content-Type:application/json" -d "{\"input\": {\"text\": \"Hello\"}}" "{url}/v2/assistants/{environment_id}/message?version=2024-08-25"
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Assistant assistant = new Assistant("2021-06-14", authenticator); assistant.setServiceUrl("{url}"); MessageInputStateless input = new MessageInputStateless.Builder() .messageType("text") .text("Hello") .build(); MessageStatelessOptions options = new MessageStatelessOptions.Builder() .assistantId("{environment_id}") .input(input) .build(); MessageResponseStateless response = assistant.messageStateless(options) .execute() .getResult(); System.out.println(response);
CloudPakForDataAuthenticator authenticator = new CloudPakForDataAuthenticator("https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize", "{username}", "{password}"); Assistant assistant = new Assistant("2020-04-01", authenticator); assistant.setServiceUrl("{url}"); MessageInputStateless input = new MessageInputStateless.Builder() .messageType("text") .text("Hello") .build(); MessageStatelessOptions options = new MessageStatelessOptions.Builder() .assistantId("{assistant_id}") .input(input) .build(); MessageResponseStateless response = assistant.messageStateless(options) .execute() .getResult(); System.out.println(response);
const AssistantV2 = require('ibm-watson/assistant/v2'); const { IamAuthenticator } = require('ibm-watson/auth'); const assistant = new AssistantV2({ version: '2021-06-14', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); assistant .messageStateless({ assistantId: '{environment_id}', input: { 'message_type': 'text', 'text': 'Hello', } }) .then(res => { console.log(JSON.stringify(res.result, null, 2)); }) .catch(err => { console.log(err); });
const AssistantV2 = require('ibm-watson/assistant/v2'); const { CloudPakForDataAuthenticator } = require('ibm-watson/auth'); const assistant = new AssistantV2({ version: '2020-04-01', authenticator: new CloudPakForDataAuthenticator({ username: '{username}', password: '{password}', url: 'https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize', }), serviceUrl: '{url}', }); assistant .messageStateless({ assistantId: '{assistant_id}', input: { 'message_type': 'text', 'text': 'Hello', } }) .then(res => { console.log(JSON.stringify(res.result, null, 2)); }) .catch(err => { console.log(err); });
import json from ibm_watson import AssistantV2 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') assistant = AssistantV2( version='2021-06-14', authenticator = authenticator ) assistant.set_service_url('{url}') response = assistant.message_stateless( assistant_id='{environment_id}', input={ 'message_type': 'text', 'text': 'Hello' } ).get_result() print(json.dumps(response, indent=2))
import json from ibm_watson import AssistantV2 from ibm_cloud_sdk_core.authenticators import CloudPakForDataAuthenticator authenticator = CloudPakForDataAuthenticator( '{username}', '{password}', 'https://{cpd_cluster_host}{:port}/icp4d-api/v1/authorize' ) assistant = AssistantV2( version='2020-04-01', authenticator = authenticator ) assistant.set_service_url('{url}') response = assistant.message_stateless( assistant_id='{assistant_id}', input={ 'message_type': 'text', 'text': 'Hello' } ).get_result() print(json.dumps(response, indent=2))
Response
A stateless response from the watsonx Assistant service.
Assistant output to be rendered or processed by the client.
Context data for the conversation. You can use this property to access context variables. The context is not stored by the assistant; to maintain session state, include the context from the response in the next message.
- context
Session context data that is shared by all skills used by the assistant.
Context data specific to particular skills used by the assistant.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
Assistant output to be rendered or processed by the client. All private data is masked or removed.
An input object that includes the input text. All private data is masked or removed.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context.
A stateless response from the watsonx Assistant service.
Assistant output to be rendered or processed by the client.
- output
Output intended for any channel. It is the responsibility of the client application to implement the supported response types.
- generic
- RuntimeResponseGeneric
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text of the response.
An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
- channels
A channel for which the response is intended.
An array of intents recognized in the user input, sorted in descending order of confidence.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of entities identified in the user input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of objects describing any actions requested by the dialog node.
- actions
The name of the action.
The type of action to invoke.
Possible values: [
client
,server
,web-action
,cloud-function
]A map of key/value pairs to be provided to the action.
The location in the dialog context where the result of the action is stored.
The name of the context variable that the client application will use to pass in credentials for the action.
Additional detailed information about a message response and how it was generated.
- debug
An array of objects containing detailed diagnostic information about dialog nodes that were visited during processing of the input message.
- nodesVisited
A dialog node that was visited during processing of the input message.
The title of the dialog node.
The conditions that trigger the dialog node.
An array of up to 50 messages logged with the request.
- logMessages
The severity of the log message.
Possible values: [
info
,error
,warn
]The text of the log message.
A code that indicates the category to which the error message belongs.
An object that identifies the dialog element that generated the error message.
- source
A string that indicates the type of dialog element that generated the error message.
The unique identifier of the dialog node that generated the error message.
Assistant sets this to true when this message response concludes or interrupts a dialog.
When
branch_exited
is set totrue
by the assistant, thebranch_exited_reason
specifies whether the dialog completed by itself or got interrupted.Possible values: [
completed
,fallback
]An array of objects containing detailed diagnostic information about dialog nodes and actions that were visited during processing of the input message.
This property is present only if the assistant has an action skill.
- turnEvents
- MessageOutputDebugTurnEvent
The type of turn event.
- source
The type of turn event.
Possible values: [
action
]An action that was visited during processing of the message.
The title of the action.
The condition that triggered the dialog node.
The time when the action started processing the message.
The type of condition (if any) that is defined for the action.
Possible values: [
user_defined
,welcome
,anything_else
]The reason the action was visited.
Possible values: [
intent
,invoke_subaction
,subaction_return
,invoke_external
,topic_switch
,topic_return
,agent_requested
,step_validation_failed
,no_action_matches
]The variable where the result of the call to the action is stored. Included only if reason=
subaction_return
.
An object containing any custom properties included in the response. This object includes any arbitrary properties defined in the dialog JSON editor as part of the dialog node output.
Properties describing any spelling corrections in the user input that was received.
- spelling
The user input text that was used to generate the response. If spelling autocorrection is enabled, this text reflects any spelling corrections that were applied.
The original user input text. This property is returned only if autocorrection is enabled and the user input was corrected.
Any suggested corrections of the input text. This property is returned only if spelling correction is enabled and autocorrection is disabled.
Context data for the conversation. You can use this property to access context variables. The context is not stored by the assistant; to maintain session state, include the context from the response in the next message.
- context
Session context data that is shared by all skills used by the assistant.
- global
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Possible values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
The unique identifier of the session.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- mainSkill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill.
- actionsSkill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing private action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends. Private variables are encrypted.
An object containing private skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session. Private variables are encrypted.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
Assistant output to be rendered or processed by the client. All private data is masked or removed.
- maskedOutput
Output intended for any channel. It is the responsibility of the client application to implement the supported response types.
- generic
- RuntimeResponseGeneric
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text of the response.
An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
- channels
A channel for which the response is intended.
An array of intents recognized in the user input, sorted in descending order of confidence.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of entities identified in the user input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of objects describing any actions requested by the dialog node.
- actions
The name of the action.
The type of action to invoke.
Possible values: [
client
,server
,web-action
,cloud-function
]A map of key/value pairs to be provided to the action.
The location in the dialog context where the result of the action is stored.
The name of the context variable that the client application will use to pass in credentials for the action.
Additional detailed information about a message response and how it was generated.
- debug
An array of objects containing detailed diagnostic information about dialog nodes that were visited during processing of the input message.
- nodesVisited
A dialog node that was visited during processing of the input message.
The title of the dialog node.
The conditions that trigger the dialog node.
An array of up to 50 messages logged with the request.
- logMessages
The severity of the log message.
Possible values: [
info
,error
,warn
]The text of the log message.
A code that indicates the category to which the error message belongs.
An object that identifies the dialog element that generated the error message.
- source
A string that indicates the type of dialog element that generated the error message.
The unique identifier of the dialog node that generated the error message.
Assistant sets this to true when this message response concludes or interrupts a dialog.
When
branch_exited
is set totrue
by the assistant, thebranch_exited_reason
specifies whether the dialog completed by itself or got interrupted.Possible values: [
completed
,fallback
]An array of objects containing detailed diagnostic information about dialog nodes and actions that were visited during processing of the input message.
This property is present only if the assistant has an action skill.
- turnEvents
- MessageOutputDebugTurnEvent
The type of turn event.
- source
The type of turn event.
Possible values: [
action
]An action that was visited during processing of the message.
The title of the action.
The condition that triggered the dialog node.
The time when the action started processing the message.
The type of condition (if any) that is defined for the action.
Possible values: [
user_defined
,welcome
,anything_else
]The reason the action was visited.
Possible values: [
intent
,invoke_subaction
,subaction_return
,invoke_external
,topic_switch
,topic_return
,agent_requested
,step_validation_failed
,no_action_matches
]The variable where the result of the call to the action is stored. Included only if reason=
subaction_return
.
An object containing any custom properties included in the response. This object includes any arbitrary properties defined in the dialog JSON editor as part of the dialog node output.
Properties describing any spelling corrections in the user input that was received.
- spelling
The user input text that was used to generate the response. If spelling autocorrection is enabled, this text reflects any spelling corrections that were applied.
The original user input text. This property is returned only if autocorrection is enabled and the user input was corrected.
Any suggested corrections of the input text. This property is returned only if spelling correction is enabled and autocorrection is disabled.
An input object that includes the input text. All private data is masked or removed.
- maskedInput
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Possible values: [
text
,search
]The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Whether to return more than one intent. Set to
true
to return all matching intents.Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property. If you also specify return_context=true
, the returned skill context includes thesystem.state
property.Whether to return session context with the response. If you specify
true
, the response includes thecontext
property. If you also specify debug=true
, the returned skill context includes thesystem.state
property.Whether to return session context, including full conversation state. If you specify
true
, the response includes thecontext
property, and the skill context includes thesystem.state
property.Note: If export=
true
, the context is returned regardless of the value of return_context.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context.
A stateless response from the watsonx Assistant service.
Assistant output to be rendered or processed by the client.
- output
Output intended for any channel. It is the responsibility of the client application to implement the supported response types.
- generic
- RuntimeResponseGeneric
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text of the response.
An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
- channels
A channel for which the response is intended.
An array of intents recognized in the user input, sorted in descending order of confidence.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of entities identified in the user input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of objects describing any actions requested by the dialog node.
- actions
The name of the action.
The type of action to invoke.
Possible values: [
client
,server
,web-action
,cloud-function
]A map of key/value pairs to be provided to the action.
The location in the dialog context where the result of the action is stored.
The name of the context variable that the client application will use to pass in credentials for the action.
Additional detailed information about a message response and how it was generated.
- debug
An array of objects containing detailed diagnostic information about dialog nodes that were visited during processing of the input message.
- nodes_visited
A dialog node that was visited during processing of the input message.
The title of the dialog node.
The conditions that trigger the dialog node.
An array of up to 50 messages logged with the request.
- log_messages
The severity of the log message.
Possible values: [
info
,error
,warn
]The text of the log message.
A code that indicates the category to which the error message belongs.
An object that identifies the dialog element that generated the error message.
- source
A string that indicates the type of dialog element that generated the error message.
The unique identifier of the dialog node that generated the error message.
Assistant sets this to true when this message response concludes or interrupts a dialog.
When
branch_exited
is set totrue
by the assistant, thebranch_exited_reason
specifies whether the dialog completed by itself or got interrupted.Possible values: [
completed
,fallback
]An array of objects containing detailed diagnostic information about dialog nodes and actions that were visited during processing of the input message.
This property is present only if the assistant has an action skill.
- turn_events
- MessageOutputDebugTurnEvent
The type of turn event.
- source
The type of turn event.
Possible values: [
action
]An action that was visited during processing of the message.
The title of the action.
The condition that triggered the dialog node.
The time when the action started processing the message.
The type of condition (if any) that is defined for the action.
Possible values: [
user_defined
,welcome
,anything_else
]The reason the action was visited.
Possible values: [
intent
,invoke_subaction
,subaction_return
,invoke_external
,topic_switch
,topic_return
,agent_requested
,step_validation_failed
,no_action_matches
]The variable where the result of the call to the action is stored. Included only if reason=
subaction_return
.
An object containing any custom properties included in the response. This object includes any arbitrary properties defined in the dialog JSON editor as part of the dialog node output.
Properties describing any spelling corrections in the user input that was received.
- spelling
The user input text that was used to generate the response. If spelling autocorrection is enabled, this text reflects any spelling corrections that were applied.
The original user input text. This property is returned only if autocorrection is enabled and the user input was corrected.
Any suggested corrections of the input text. This property is returned only if spelling correction is enabled and autocorrection is disabled.
Context data for the conversation. You can use this property to access context variables. The context is not stored by the assistant; to maintain session state, include the context from the response in the next message.
- context
Session context data that is shared by all skills used by the assistant.
- global
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Possible values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
The unique identifier of the session.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- 'main skill'
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill.
- 'actions skill'
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing private action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends. Private variables are encrypted.
An object containing private skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session. Private variables are encrypted.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
Assistant output to be rendered or processed by the client. All private data is masked or removed.
- masked_output
Output intended for any channel. It is the responsibility of the client application to implement the supported response types.
- generic
- RuntimeResponseGeneric
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text of the response.
An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
- channels
A channel for which the response is intended.
An array of intents recognized in the user input, sorted in descending order of confidence.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of entities identified in the user input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of objects describing any actions requested by the dialog node.
- actions
The name of the action.
The type of action to invoke.
Possible values: [
client
,server
,web-action
,cloud-function
]A map of key/value pairs to be provided to the action.
The location in the dialog context where the result of the action is stored.
The name of the context variable that the client application will use to pass in credentials for the action.
Additional detailed information about a message response and how it was generated.
- debug
An array of objects containing detailed diagnostic information about dialog nodes that were visited during processing of the input message.
- nodes_visited
A dialog node that was visited during processing of the input message.
The title of the dialog node.
The conditions that trigger the dialog node.
An array of up to 50 messages logged with the request.
- log_messages
The severity of the log message.
Possible values: [
info
,error
,warn
]The text of the log message.
A code that indicates the category to which the error message belongs.
An object that identifies the dialog element that generated the error message.
- source
A string that indicates the type of dialog element that generated the error message.
The unique identifier of the dialog node that generated the error message.
Assistant sets this to true when this message response concludes or interrupts a dialog.
When
branch_exited
is set totrue
by the assistant, thebranch_exited_reason
specifies whether the dialog completed by itself or got interrupted.Possible values: [
completed
,fallback
]An array of objects containing detailed diagnostic information about dialog nodes and actions that were visited during processing of the input message.
This property is present only if the assistant has an action skill.
- turn_events
- MessageOutputDebugTurnEvent
The type of turn event.
- source
The type of turn event.
Possible values: [
action
]An action that was visited during processing of the message.
The title of the action.
The condition that triggered the dialog node.
The time when the action started processing the message.
The type of condition (if any) that is defined for the action.
Possible values: [
user_defined
,welcome
,anything_else
]The reason the action was visited.
Possible values: [
intent
,invoke_subaction
,subaction_return
,invoke_external
,topic_switch
,topic_return
,agent_requested
,step_validation_failed
,no_action_matches
]The variable where the result of the call to the action is stored. Included only if reason=
subaction_return
.
An object containing any custom properties included in the response. This object includes any arbitrary properties defined in the dialog JSON editor as part of the dialog node output.
Properties describing any spelling corrections in the user input that was received.
- spelling
The user input text that was used to generate the response. If spelling autocorrection is enabled, this text reflects any spelling corrections that were applied.
The original user input text. This property is returned only if autocorrection is enabled and the user input was corrected.
Any suggested corrections of the input text. This property is returned only if spelling correction is enabled and autocorrection is disabled.
An input object that includes the input text. All private data is masked or removed.
- masked_input
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Possible values: [
text
,search
]The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Whether to return more than one intent. Set to
true
to return all matching intents.Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property. If you also specify return_context=true
, the returned skill context includes thesystem.state
property.Whether to return session context with the response. If you specify
true
, the response includes thecontext
property. If you also specify debug=true
, the returned skill context includes thesystem.state
property.Whether to return session context, including full conversation state. If you specify
true
, the response includes thecontext
property, and the skill context includes thesystem.state
property.Note: If export=
true
, the context is returned regardless of the value of return_context.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context.
A stateless response from the watsonx Assistant service.
Assistant output to be rendered or processed by the client.
- output
Output intended for any channel. It is the responsibility of the client application to implement the supported response types.
- generic
- RuntimeResponseGeneric
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text of the response.
An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
- channels
A channel for which the response is intended.
An array of intents recognized in the user input, sorted in descending order of confidence.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of entities identified in the user input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of objects describing any actions requested by the dialog node.
- actions
The name of the action.
The type of action to invoke.
Possible values: [
client
,server
,web-action
,cloud-function
]A map of key/value pairs to be provided to the action.
The location in the dialog context where the result of the action is stored.
The name of the context variable that the client application will use to pass in credentials for the action.
Additional detailed information about a message response and how it was generated.
- debug
An array of objects containing detailed diagnostic information about dialog nodes that were visited during processing of the input message.
- nodes_visited
A dialog node that was visited during processing of the input message.
The title of the dialog node.
The conditions that trigger the dialog node.
An array of up to 50 messages logged with the request.
- log_messages
The severity of the log message.
Possible values: [
info
,error
,warn
]The text of the log message.
A code that indicates the category to which the error message belongs.
An object that identifies the dialog element that generated the error message.
- source
A string that indicates the type of dialog element that generated the error message.
The unique identifier of the dialog node that generated the error message.
Assistant sets this to true when this message response concludes or interrupts a dialog.
When
branch_exited
is set totrue
by the assistant, thebranch_exited_reason
specifies whether the dialog completed by itself or got interrupted.Possible values: [
completed
,fallback
]An array of objects containing detailed diagnostic information about dialog nodes and actions that were visited during processing of the input message.
This property is present only if the assistant has an action skill.
- turn_events
- MessageOutputDebugTurnEvent
The type of turn event.
- source
The type of turn event.
Possible values: [
action
]An action that was visited during processing of the message.
The title of the action.
The condition that triggered the dialog node.
The time when the action started processing the message.
The type of condition (if any) that is defined for the action.
Possible values: [
user_defined
,welcome
,anything_else
]The reason the action was visited.
Possible values: [
intent
,invoke_subaction
,subaction_return
,invoke_external
,topic_switch
,topic_return
,agent_requested
,step_validation_failed
,no_action_matches
]The variable where the result of the call to the action is stored. Included only if reason=
subaction_return
.
An object containing any custom properties included in the response. This object includes any arbitrary properties defined in the dialog JSON editor as part of the dialog node output.
Properties describing any spelling corrections in the user input that was received.
- spelling
The user input text that was used to generate the response. If spelling autocorrection is enabled, this text reflects any spelling corrections that were applied.
The original user input text. This property is returned only if autocorrection is enabled and the user input was corrected.
Any suggested corrections of the input text. This property is returned only if spelling correction is enabled and autocorrection is disabled.
Context data for the conversation. You can use this property to access context variables. The context is not stored by the assistant; to maintain session state, include the context from the response in the next message.
- context
Session context data that is shared by all skills used by the assistant.
- global_
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Possible values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
The unique identifier of the session.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- main_skill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill.
- actions_skill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing private action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends. Private variables are encrypted.
An object containing private skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session. Private variables are encrypted.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
Assistant output to be rendered or processed by the client. All private data is masked or removed.
- masked_output
Output intended for any channel. It is the responsibility of the client application to implement the supported response types.
- generic
- RuntimeResponseGeneric
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text of the response.
An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
- channels
A channel for which the response is intended.
An array of intents recognized in the user input, sorted in descending order of confidence.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of entities identified in the user input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of objects describing any actions requested by the dialog node.
- actions
The name of the action.
The type of action to invoke.
Possible values: [
client
,server
,web-action
,cloud-function
]A map of key/value pairs to be provided to the action.
The location in the dialog context where the result of the action is stored.
The name of the context variable that the client application will use to pass in credentials for the action.
Additional detailed information about a message response and how it was generated.
- debug
An array of objects containing detailed diagnostic information about dialog nodes that were visited during processing of the input message.
- nodes_visited
A dialog node that was visited during processing of the input message.
The title of the dialog node.
The conditions that trigger the dialog node.
An array of up to 50 messages logged with the request.
- log_messages
The severity of the log message.
Possible values: [
info
,error
,warn
]The text of the log message.
A code that indicates the category to which the error message belongs.
An object that identifies the dialog element that generated the error message.
- source
A string that indicates the type of dialog element that generated the error message.
The unique identifier of the dialog node that generated the error message.
Assistant sets this to true when this message response concludes or interrupts a dialog.
When
branch_exited
is set totrue
by the assistant, thebranch_exited_reason
specifies whether the dialog completed by itself or got interrupted.Possible values: [
completed
,fallback
]An array of objects containing detailed diagnostic information about dialog nodes and actions that were visited during processing of the input message.
This property is present only if the assistant has an action skill.
- turn_events
- MessageOutputDebugTurnEvent
The type of turn event.
- source
The type of turn event.
Possible values: [
action
]An action that was visited during processing of the message.
The title of the action.
The condition that triggered the dialog node.
The time when the action started processing the message.
The type of condition (if any) that is defined for the action.
Possible values: [
user_defined
,welcome
,anything_else
]The reason the action was visited.
Possible values: [
intent
,invoke_subaction
,subaction_return
,invoke_external
,topic_switch
,topic_return
,agent_requested
,step_validation_failed
,no_action_matches
]The variable where the result of the call to the action is stored. Included only if reason=
subaction_return
.
An object containing any custom properties included in the response. This object includes any arbitrary properties defined in the dialog JSON editor as part of the dialog node output.
Properties describing any spelling corrections in the user input that was received.
- spelling
The user input text that was used to generate the response. If spelling autocorrection is enabled, this text reflects any spelling corrections that were applied.
The original user input text. This property is returned only if autocorrection is enabled and the user input was corrected.
Any suggested corrections of the input text. This property is returned only if spelling correction is enabled and autocorrection is disabled.
An input object that includes the input text. All private data is masked or removed.
- masked_input
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Possible values: [
text
,search
]The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Whether to return more than one intent. Set to
true
to return all matching intents.Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property. If you also specify return_context=true
, the returned skill context includes thesystem.state
property.Whether to return session context with the response. If you specify
true
, the response includes thecontext
property. If you also specify debug=true
, the returned skill context includes thesystem.state
property.Whether to return session context, including full conversation state. If you specify
true
, the response includes thecontext
property, and the skill context includes thesystem.state
property.Note: If export=
true
, the context is returned regardless of the value of return_context.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context.
Status Code
Successful request.
Invalid request.
{ "output": { "intents": [ { "intent": "hello", "confidence": 0.9281370162963867 } ], "entities": [], "generic": [ { "response_type": "text", "text": "Hello! What can I do for you?" } ] }, "context": { "global": { "system": { "turn_count": 1, "user_id": "f7b515ef-9802-431a-8639-cf61fcd0b963" }, "session_id": "f7b515ef-9802-431a-8639-cf61fcd0b963" }, "skills": { "main skill": { "system": { "state": "eyJzZXNzaW9uX2lkIjoiZjdiNTE1ZWYtOTgwMi00MzFhLTg2MzktY2Y2MWZjZDBiOTYzIiwic2tpbGxfcmVmZXJlbmNlIjoibWFpbiBza2lsbCIsImFzc2lzdGFudF9pZCI6ImViM2RmZGRlLTJkNDUtNDBmYS05NDZlLTk2ODVmNTU2NzhhOSIsImluaXRpYWxpemVkIjp0cnVlLCJkaWFsb2dfc3RhY2siOlt7ImRpYWxvZ19ub2RlIjoicm9vdCJ9XSwiX25vZGVfb3V0cHV0X21hcCI6eyJub2RlXzJfMTU4OTMwNDc4NDQ5MSI6eyIwIjpbMF19fSwibGFzdF9icmFuY2hfbm9kZSI6Im5vZGVfMl8xNTg5MzA0Nzg0NDkxIn0=" } } } }, "user_id": "f7b515ef-9802-431a-8639-cf61fcd0b963" }
{ "output": { "intents": [ { "intent": "hello", "confidence": 0.9281370162963867 } ], "entities": [], "generic": [ { "response_type": "text", "text": "Hello! What can I do for you?" } ] }, "context": { "global": { "system": { "turn_count": 1, "user_id": "f7b515ef-9802-431a-8639-cf61fcd0b963" }, "session_id": "f7b515ef-9802-431a-8639-cf61fcd0b963" }, "skills": { "main skill": { "system": { "state": "eyJzZXNzaW9uX2lkIjoiZjdiNTE1ZWYtOTgwMi00MzFhLTg2MzktY2Y2MWZjZDBiOTYzIiwic2tpbGxfcmVmZXJlbmNlIjoibWFpbiBza2lsbCIsImFzc2lzdGFudF9pZCI6ImViM2RmZGRlLTJkNDUtNDBmYS05NDZlLTk2ODVmNTU2NzhhOSIsImluaXRpYWxpemVkIjp0cnVlLCJkaWFsb2dfc3RhY2siOlt7ImRpYWxvZ19ub2RlIjoicm9vdCJ9XSwiX25vZGVfb3V0cHV0X21hcCI6eyJub2RlXzJfMTU4OTMwNDc4NDQ5MSI6eyIwIjpbMF19fSwibGFzdF9icmFuY2hfbm9kZSI6Im5vZGVfMl8xNTg5MzA0Nzg0NDkxIn0=" } } } }, "user_id": "f7b515ef-9802-431a-8639-cf61fcd0b963" }
Send user input to assistant (stateful)
Send user input to an assistant and receive a streamed response, with conversation state (including context data) stored by watsonx Assistant for the duration of the session.
Send user input to an assistant and receive a streamed response, with conversation state (including context data) stored by watsonx Assistant for the duration of the session.
Send user input to an assistant and receive a streamed response, with conversation state (including context data) stored by watsonx Assistant for the duration of the session.
Send user input to an assistant and receive a streamed response, with conversation state (including context data) stored by watsonx Assistant for the duration of the session.
POST /v2/assistants/{assistant_id}/environments/{environment_id}/sessions/{session_id}/message_stream
ServiceCall<MessageStreamResponse> messageStream(MessageStreamOptions messageStreamOptions)
messageStream(params)
message_stream(
self,
assistant_id: str,
environment_id: str,
session_id: str,
*,
input: Optional['MessageInput'] = None,
context: Optional['MessageContext'] = None,
user_id: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Use the MessageStreamOptions.Builder
to create a MessageStreamOptions
object that contains the parameter values for the messageStream
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click API Details. Note: Currently, the API does not support creating environments.
Unique identifier of the session.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.
The message to be sent. This includes the user's input, along with optional content such as intents and entities.
{
"input": {
"message_type": "text",
"text": "Hello",
"options": {
"return_context": true,
"export": true
}
},
"context": {
"global": {
"system": {
"user_id": "my_user_id"
}
}
}
}
An input object that includes the input text.
Context data for the conversation. You can use this property to set or modify context variables, which can also be accessed by dialog nodes. The context is stored by the assistant on a per-session basis.
Note: The total size of the context data stored for a stateful session cannot exceed 100KB.
- context
Session context data that is shared by all skills used by the assistant.
Context data specific to particular skills used by the assistant.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context. If user_id is specified in both locations, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
The messageStream options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click API Details. Note: Currently, the API does not support creating environments.
Unique identifier of the session.
An input object that includes the input text.
- input
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Allowable values: [
text
,search
]Default:
text
The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Allowable values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Allowable values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Default:
false
Whether to return more than one intent. Set to
true
to return all matching intents.Default:
false
Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Default:
false
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property. If you also specify return_context=true
, the returned skill context includes thesystem.state
property.Default:
false
Whether to return session context with the response. If you specify
true
, the response includes thecontext
property. If you also specify debug=true
, the returned skill context includes thesystem.state
property.Default:
false
Whether to return session context, including full conversation state. If you specify
true
, the response includes thecontext
property, and the skill context includes thesystem.state
property.Note: If export=
true
, the context is returned regardless of the value of return_context.Default:
false
Context data for the conversation. You can use this property to set or modify context variables, which can also be accessed by dialog nodes. The context is stored by the assistant on a per-session basis.
Note: The total size of the context data stored for a stateful session cannot exceed 100KB.
- context
Session context data that is shared by all skills used by the assistant.
- global
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Allowable values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- mainSkill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill. Private variables are persisted, but not shown.
- actionsSkill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context. If user_id is specified in both locations, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click API Details. Note: Currently, the API does not support creating environments.
Unique identifier of the session.
An input object that includes the input text.
- input
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Allowable values: [
text
,search
]Default:
text
The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Allowable values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Allowable values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Default:
false
Whether to return more than one intent. Set to
true
to return all matching intents.Default:
false
Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Default:
false
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property. If you also specify return_context=true
, the returned skill context includes thesystem.state
property.Default:
false
Whether to return session context with the response. If you specify
true
, the response includes thecontext
property. If you also specify debug=true
, the returned skill context includes thesystem.state
property.Default:
false
Whether to return session context, including full conversation state. If you specify
true
, the response includes thecontext
property, and the skill context includes thesystem.state
property.Note: If export=
true
, the context is returned regardless of the value of return_context.Default:
false
- context
Session context data that is shared by all skills used by the assistant.
- global
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Allowable values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- 'main skill'
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill. Private variables are persisted, but not shown.
- 'actions skill'
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context. If user_id is specified in both locations, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click API Details. Note: Currently, the API does not support creating environments.
Unique identifier of the session.
An input object that includes the input text.
- input
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Allowable values: [
text
,search
]Default:
text
The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Allowable values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Allowable values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Default:
false
Whether to return more than one intent. Set to
true
to return all matching intents.Default:
false
Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Default:
false
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property. If you also specify return_context=true
, the returned skill context includes thesystem.state
property.Default:
false
Whether to return session context with the response. If you specify
true
, the response includes thecontext
property. If you also specify debug=true
, the returned skill context includes thesystem.state
property.Default:
false
Whether to return session context, including full conversation state. If you specify
true
, the response includes thecontext
property, and the skill context includes thesystem.state
property.Note: If export=
true
, the context is returned regardless of the value of return_context.Default:
false
- context
Session context data that is shared by all skills used by the assistant.
- global_
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Allowable values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- main_skill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill. Private variables are persisted, but not shown.
- actions_skill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context. If user_id is specified in both locations, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
Response
A streamed response from the watsonx Assistant service.
Message response partial item content.
- partial_item
The text within the partial chunk of the message stream response.
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
A chunk of the streamed message response.
Message response partial item content.
- partialItem
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text within the partial chunk of the message stream response.
Contains meta-information about the item(s) being streamed.
- streamingMetadata
Identifies the index and sequence of the current streamed response item.
A chunk of the streamed message response.
Message response partial item content.
- partial_item
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text within the partial chunk of the message stream response.
Contains meta-information about the item(s) being streamed.
- streaming_metadata
Identifies the index and sequence of the current streamed response item.
A chunk of the streamed message response.
Message response partial item content.
- partial_item
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text within the partial chunk of the message stream response.
Contains meta-information about the item(s) being streamed.
- streaming_metadata
Identifies the index and sequence of the current streamed response item.
Status Code
Successful request.
Send user input to assistant (stateless)
Send user input to an assistant and receive a response, with conversation state (including context data) managed by your application.
Send user input to an assistant and receive a response, with conversation state (including context data) managed by your application.
Send user input to an assistant and receive a response, with conversation state (including context data) managed by your application.
Send user input to an assistant and receive a response, with conversation state (including context data) managed by your application.
POST /v2/assistants/{assistant_id}/environments/{environment_id}/message_stream
ServiceCall<StatelessMessageStreamResponse> messageStreamStateless(MessageStreamStatelessOptions messageStreamStatelessOptions)
messageStreamStateless(params)
message_stream_stateless(
self,
assistant_id: str,
environment_id: str,
*,
input: Optional['MessageInput'] = None,
context: Optional['MessageContext'] = None,
user_id: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Use the MessageStreamStatelessOptions.Builder
to create a MessageStreamStatelessOptions
object that contains the parameter values for the messageStreamStateless
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click API Details. Note: Currently, the API does not support creating environments.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.
The message to be sent. This includes the user's input, along with optional content such as intents and entities.
{
"input": {
"message_type": "text",
"text": "Hello",
"options": {
"return_context": true,
"export": true
}
},
"context": {
"global": {
"system": {
"user_id": "my_user_id"
}
}
}
}
An input object that includes the input text.
Context data for the conversation. You can use this property to set or modify context variables, which can also be accessed by dialog nodes. The context is stored by the assistant on a per-session basis.
Note: The total size of the context data stored for a stateful session cannot exceed 100KB.
- context
Session context data that is shared by all skills used by the assistant.
Context data specific to particular skills used by the assistant.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context. If user_id is specified in both locations, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
The messageStreamStateless options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click API Details. Note: Currently, the API does not support creating environments.
An input object that includes the input text.
- input
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Allowable values: [
text
,search
]Default:
text
The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Allowable values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Allowable values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Default:
false
Whether to return more than one intent. Set to
true
to return all matching intents.Default:
false
Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Default:
false
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property. If you also specify return_context=true
, the returned skill context includes thesystem.state
property.Default:
false
Whether to return session context with the response. If you specify
true
, the response includes thecontext
property. If you also specify debug=true
, the returned skill context includes thesystem.state
property.Default:
false
Whether to return session context, including full conversation state. If you specify
true
, the response includes thecontext
property, and the skill context includes thesystem.state
property.Note: If export=
true
, the context is returned regardless of the value of return_context.Default:
false
Context data for the conversation. You can use this property to set or modify context variables, which can also be accessed by dialog nodes. The context is stored by the assistant on a per-session basis.
Note: The total size of the context data stored for a stateful session cannot exceed 100KB.
- context
Session context data that is shared by all skills used by the assistant.
- global
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Allowable values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- mainSkill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill. Private variables are persisted, but not shown.
- actionsSkill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context. If user_id is specified in both locations, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click API Details. Note: Currently, the API does not support creating environments.
An input object that includes the input text.
- input
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Allowable values: [
text
,search
]Default:
text
The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Allowable values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Allowable values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Default:
false
Whether to return more than one intent. Set to
true
to return all matching intents.Default:
false
Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Default:
false
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property. If you also specify return_context=true
, the returned skill context includes thesystem.state
property.Default:
false
Whether to return session context with the response. If you specify
true
, the response includes thecontext
property. If you also specify debug=true
, the returned skill context includes thesystem.state
property.Default:
false
Whether to return session context, including full conversation state. If you specify
true
, the response includes thecontext
property, and the skill context includes thesystem.state
property.Note: If export=
true
, the context is returned regardless of the value of return_context.Default:
false
- context
Session context data that is shared by all skills used by the assistant.
- global
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Allowable values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- 'main skill'
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill. Private variables are persisted, but not shown.
- 'actions skill'
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context. If user_id is specified in both locations, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click API Details. Note: Currently, the API does not support creating environments.
An input object that includes the input text.
- input
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Allowable values: [
text
,search
]Default:
text
The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Allowable values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Allowable values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Default:
false
Whether to return more than one intent. Set to
true
to return all matching intents.Default:
false
Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Default:
false
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property. If you also specify return_context=true
, the returned skill context includes thesystem.state
property.Default:
false
Whether to return session context with the response. If you specify
true
, the response includes thecontext
property. If you also specify debug=true
, the returned skill context includes thesystem.state
property.Default:
false
Whether to return session context, including full conversation state. If you specify
true
, the response includes thecontext
property, and the skill context includes thesystem.state
property.Note: If export=
true
, the context is returned regardless of the value of return_context.Default:
false
- context
Session context data that is shared by all skills used by the assistant.
- global_
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Allowable values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- main_skill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill. Private variables are persisted, but not shown.
- actions_skill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context. If user_id is specified in both locations, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
Response
A stateless streamed response form the watsonx Assistant service.
Message response partial item content.
- partial_item
The text within the partial chunk of the message stream response.
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
A chunk of the streamed message response.
Message response partial item content.
- partialItem
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text within the partial chunk of the message stream response.
Contains meta-information about the item(s) being streamed.
- streamingMetadata
Identifies the index and sequence of the current streamed response item.
A chunk of the streamed message response.
Message response partial item content.
- partial_item
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text within the partial chunk of the message stream response.
Contains meta-information about the item(s) being streamed.
- streaming_metadata
Identifies the index and sequence of the current streamed response item.
A chunk of the streamed message response.
Message response partial item content.
- partial_item
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text within the partial chunk of the message stream response.
Contains meta-information about the item(s) being streamed.
- streaming_metadata
Identifies the index and sequence of the current streamed response item.
Status Code
Successful request.
Identify intents and entities in multiple user utterances
Send multiple user inputs to a dialog skill in a single request and receive information about the intents and entities recognized in each input. This method is useful for testing and comparing the performance of different skills or skill versions.
This method is available only with Enterprise with Data Isolation plans.
Send multiple user inputs to a dialog skill in a single request and receive information about the intents and entities recognized in each input. This method is useful for testing and comparing the performance of different skills or skill versions.
This method is available only with Enterprise with Data Isolation plans.
Send multiple user inputs to a dialog skill in a single request and receive information about the intents and entities recognized in each input. This method is useful for testing and comparing the performance of different skills or skill versions.
This method is available only with Enterprise with Data Isolation plans.
Send multiple user inputs to a dialog skill in a single request and receive information about the intents and entities recognized in each input. This method is useful for testing and comparing the performance of different skills or skill versions.
This method is available only with Enterprise with Data Isolation plans.
POST /v2/skills/{skill_id}/workspace/bulk_classify
ServiceCall<BulkClassifyResponse> bulkClassify(BulkClassifyOptions bulkClassifyOptions)
bulkClassify(params)
bulk_classify(
self,
skill_id: str,
input: List['BulkClassifyUtterance'],
**kwargs,
) -> DetailedResponse
Request
Use the BulkClassifyOptions.Builder
to create a BulkClassifyOptions
object that contains the parameter values for the bulkClassify
method.
Path Parameters
Unique identifier of the skill. To find the action or dialog skill ID in the watsonx Assistant user interface, open the skill settings and click API Details. To find the search skill ID, use the Get environment API to retrieve the skill references for an environment and it will include the search skill info, if available.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.
An input object that includes the text to classify.
An array of input utterances to classify.
Possible values: 1 ≤ number of items ≤ 50
The bulkClassify options.
Unique identifier of the skill. To find the skill ID in the watsonx Assistant user interface, open the skill settings and click API Details.
An array of input utterances to classify.
Possible values: 1 ≤ number of items ≤ 50
- input
The text of the input utterance.
Possible values: 1 ≤ length ≤ 2048
parameters
Unique identifier of the skill. To find the skill ID in the watsonx Assistant user interface, open the skill settings and click API Details.
An array of input utterances to classify.
Possible values: 1 ≤ number of items ≤ 50
- input
The text of the input utterance.
Possible values: 1 ≤ length ≤ 2048
parameters
Unique identifier of the skill. To find the skill ID in the watsonx Assistant user interface, open the skill settings and click API Details.
An array of input utterances to classify.
Possible values: 1 ≤ number of items ≤ 50
- input
The text of the input utterance.
Possible values: 1 ≤ length ≤ 2048
curl -X POST -u "apikey:{apikey}" --header "Content-Type:application/json" --data "{\"input\": [{\"text\": \"I want to order some coffee\"}]}" "{url}/v2/skills/{skill_id}/workspace/bulk_classify?version=2021-11-27"
curl -X POST --header "Authorization: Bearer {token}" --header "Content-Type:application/json" --data "{\"input\": [{\"text\": \"I want to order some coffee\"}]}" "{url}/v2/skills/{skill_id}/workspace/bulk_classify?version=2021-11-27"
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Assistant assistant = new Assistant("2021-06-14", authenticator); assistant.setServiceUrl("{url}"); BulkClassifyUtterance bulkClassifyUtterance = new BulkClassifyUtterance.Builder() .text("I want to order some coffee") .build(); BulkClassifyOptions options = new BulkClassifyOptions.Builder() .skillId("{skill_id}") .addInput(bulkClassifyUtterance) .build(); BulkClassifyResponse response = assistant.bulkClassify(options).execute().getResult(); System.out.println(response);
const AssistantV2 = require('ibm-watson/assistant/v2'); const { IamAuthenticator } = require('ibm-watson/auth'); const assistant = new AssistantV2({ version: '2021-06-14', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const params = { skillId: '{id}' input: [{'text': 'I want to order some coffee'}] }; assistant.bulkClassify(params) .then(res => { console.log(JSON.stringify(res.result, null, 2)); }) .catch(err => { console.log(err) });
import json from ibm_watson import AssistantV2 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') assistant = AssistantV2( version='2021-06-14', authenticator = authenticator ) assistant.set_service_url('{url}') response=assistant.bulk_classify( skill_id='{skill_id}' input=[{'text': 'I want to order some coffee'}] ).get_result() print(json.dumps(response, indent=2))
Response
An array of objects that contain classification information for the submitted input utterances.
An array of objects that contain classification information for the submitted input utterances.
- output
The user input utterance to classify.
- input
The text of the input utterance.
Possible values: 1 ≤ length ≤ 2048
An array of entities identified in the utterance.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of intents recognized in the utterance.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of objects that contain classification information for the submitted input utterances.
- output
The user input utterance to classify.
- input
The text of the input utterance.
Possible values: 1 ≤ length ≤ 2048
An array of entities identified in the utterance.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of intents recognized in the utterance.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of objects that contain classification information for the submitted input utterances.
- output
The user input utterance to classify.
- input
The text of the input utterance.
Possible values: 1 ≤ length ≤ 2048
An array of entities identified in the utterance.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of intents recognized in the utterance.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Status Code
Successful request.
Invalid request.
{ "output": [ { "input": { "text": "I want to order some coffee" }, "entities": [ { "entity": "beverage", "value": "coffee", "confidence": 1, "location": [ 14, 20 ], "groups": null, "role": null } ], "intents": [ { "intent": "order", "confidence": 0.1588214785085711 }, { "intent": "goodbye", "confidence": 0.041231044110733354 } ] } ] }
{ "output": [ { "input": { "text": "I want to order some coffee" }, "entities": [ { "entity": "beverage", "value": "coffee", "confidence": 1, "location": [ 14, 20 ], "groups": null, "role": null } ], "intents": [ { "intent": "order", "confidence": 0.1588214785085711 }, { "intent": "goodbye", "confidence": 0.041231044110733354 } ] } ] }
List log events for an assistant
List the events from the log of an assistant.
This method requires Manager access.
Note: If you use the cursor parameter to retrieve results one page at a time, subsequent requests must be no more than 5 minutes apart. Any returned value for the cursor parameter becomes invalid after 5 minutes. For more information about using pagination, see Pagination.
List the events from the log of an assistant.
This method requires Manager access.
Note: If you use the cursor parameter to retrieve results one page at a time, subsequent requests must be no more than 5 minutes apart. Any returned value for the cursor parameter becomes invalid after 5 minutes. For more information about using pagination, see Pagination.
List the events from the log of an assistant.
This method requires Manager access.
Note: If you use the cursor parameter to retrieve results one page at a time, subsequent requests must be no more than 5 minutes apart. Any returned value for the cursor parameter becomes invalid after 5 minutes. For more information about using pagination, see Pagination.
List the events from the log of an assistant.
This method requires Manager access.
Note: If you use the cursor parameter to retrieve results one page at a time, subsequent requests must be no more than 5 minutes apart. Any returned value for the cursor parameter becomes invalid after 5 minutes. For more information about using pagination, see Pagination.
GET /v2/assistants/{assistant_id}/logs
ServiceCall<LogCollection> listLogs(ListLogsOptions listLogsOptions)
listLogs(params)
list_logs(
self,
assistant_id: str,
*,
sort: Optional[str] = None,
filter: Optional[str] = None,
page_limit: Optional[int] = None,
cursor: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Use the ListLogsOptions.Builder
to create a ListLogsOptions
object that contains the parameter values for the listLogs
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.How to sort the returned log events. You can sort by request_timestamp. To reverse the sort order, prefix the parameter value with a minus sign (
-
).A cacheable parameter that limits the results to those matching the specified filter. For more information, see the documentation.
The number of records to return in each page of results.
Note: If the API is not returning your data, try lowering the page_limit value.
Default:
100
A token identifying the page of results to retrieve.
The listLogs options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
How to sort the returned log events. You can sort by request_timestamp. To reverse the sort order, prefix the parameter value with a minus sign (
-
).A cacheable parameter that limits the results to those matching the specified filter. For more information, see the documentation.
The number of records to return in each page of results.
Note: If the API is not returning your data, try lowering the page_limit value.
Default:
100
A token identifying the page of results to retrieve.
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
How to sort the returned log events. You can sort by request_timestamp. To reverse the sort order, prefix the parameter value with a minus sign (
-
).A cacheable parameter that limits the results to those matching the specified filter. For more information, see the documentation.
The number of records to return in each page of results.
Note: If the API is not returning your data, try lowering the page_limit value.
Default:
100
A token identifying the page of results to retrieve.
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
How to sort the returned log events. You can sort by request_timestamp. To reverse the sort order, prefix the parameter value with a minus sign (
-
).A cacheable parameter that limits the results to those matching the specified filter. For more information, see the documentation.
The number of records to return in each page of results.
Note: If the API is not returning your data, try lowering the page_limit value.
Default:
100
A token identifying the page of results to retrieve.
curl -u "apikey:{apikey}" "{url}/v2/assistants/{environment_id}/logs?version=2021-11-27"
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Assistant assistant = new Assistant("2021-06-14", authenticator); assistant.setServiceUrl("{url}"); String assistantId = "{environment_id}"; ListLogsOptions options = new ListLogsOptions.Builder(assistantId).build(); LogCollection response = assistant.listLogs(options).execute().getResult(); System.out.println(response);
const AssistantV2 = require('ibm-watson/assistant/v2'); const { IamAuthenticator } = require('ibm-watson/auth'); const assistant = new AssistantV2({ version: '2021-06-14', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const params = { assistantId: '{environment_id}' }; assistant.listLogs(params) .then(res => { console.log(JSON.stringify(res.result, null, 2)); }) .catch(err => { console.log(err) });
import json from ibm_watson import AssistantV2 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') assistant = AssistantV2( version='2021-06-14', authenticator = authenticator ) assistant.set_service_url('{url}') response=assistant.list_logs( assistant_id='{environment_id}' ).get_result() print(json.dumps(response, indent=2))
Response
An array of objects describing log events.
The pagination data for the returned objects. For more information about using pagination, see Pagination.
An array of objects describing log events.
- logs
A unique identifier for the logged event.
A message request formatted for the watsonx Assistant service.
Examples:{ "input": { "message_type": "text", "text": "Hello", "options": { "return_context": true, "export": true } }, "context": { "global": { "system": { "user_id": "my_user_id" } } } }
- request
An input object that includes the input text. All private data is masked or removed.
- input
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Possible values: [
text
,search
]The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Whether to return more than one intent. Set to
true
to return all matching intents.Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property. If you also specify return_context=true
, the returned skill context includes thesystem.state
property.Whether to return session context with the response. If you specify
true
, the response includes thecontext
property. If you also specify debug=true
, the returned skill context includes thesystem.state
property.Whether to return session context, including full conversation state. If you specify
true
, the response includes thecontext
property, and the skill context includes thesystem.state
property.Note: If export=
true
, the context is returned regardless of the value of return_context.
Context data for the conversation. You can use this property to set or modify context variables, which can also be accessed by dialog nodes. The context is stored by the assistant on a per-session basis.
Note: The total size of the context data stored for a stateful session cannot exceed 100KB.
- context
Session context data that is shared by all skills used by the assistant.
- global
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Possible values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
The session ID.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- mainSkill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill. Private variables are persisted, but not shown.
- actionsSkill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context. If user_id is specified in both locations, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A response from the watsonx Assistant service.
- response
Assistant output to be rendered or processed by the client. All private data is masked or removed.
- output
Output intended for any channel. It is the responsibility of the client application to implement the supported response types.
- generic
- RuntimeResponseGeneric
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text of the response.
An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
- channels
A channel for which the response is intended.
An array of intents recognized in the user input, sorted in descending order of confidence.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of entities identified in the user input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of objects describing any actions requested by the dialog node.
- actions
The name of the action.
The type of action to invoke.
Possible values: [
client
,server
,web-action
,cloud-function
]A map of key/value pairs to be provided to the action.
The location in the dialog context where the result of the action is stored.
The name of the context variable that the client application will use to pass in credentials for the action.
Additional detailed information about a message response and how it was generated.
- debug
An array of objects containing detailed diagnostic information about dialog nodes that were visited during processing of the input message.
- nodesVisited
A dialog node that was visited during processing of the input message.
The title of the dialog node.
The conditions that trigger the dialog node.
An array of up to 50 messages logged with the request.
- logMessages
The severity of the log message.
Possible values: [
info
,error
,warn
]The text of the log message.
A code that indicates the category to which the error message belongs.
An object that identifies the dialog element that generated the error message.
- source
A string that indicates the type of dialog element that generated the error message.
The unique identifier of the dialog node that generated the error message.
Assistant sets this to true when this message response concludes or interrupts a dialog.
When
branch_exited
is set totrue
by the assistant, thebranch_exited_reason
specifies whether the dialog completed by itself or got interrupted.Possible values: [
completed
,fallback
]An array of objects containing detailed diagnostic information about dialog nodes and actions that were visited during processing of the input message.
This property is present only if the assistant has an action skill.
- turnEvents
- MessageOutputDebugTurnEvent
The type of turn event.
- source
The type of turn event.
Possible values: [
action
]An action that was visited during processing of the message.
The title of the action.
The condition that triggered the dialog node.
The time when the action started processing the message.
The type of condition (if any) that is defined for the action.
Possible values: [
user_defined
,welcome
,anything_else
]The reason the action was visited.
Possible values: [
intent
,invoke_subaction
,subaction_return
,invoke_external
,topic_switch
,topic_return
,agent_requested
,step_validation_failed
,no_action_matches
]The variable where the result of the call to the action is stored. Included only if reason=
subaction_return
.
An object containing any custom properties included in the response. This object includes any arbitrary properties defined in the dialog JSON editor as part of the dialog node output.
Properties describing any spelling corrections in the user input that was received.
- spelling
The user input text that was used to generate the response. If spelling autocorrection is enabled, this text reflects any spelling corrections that were applied.
The original user input text. This property is returned only if autocorrection is enabled and the user input was corrected.
Any suggested corrections of the input text. This property is returned only if spelling correction is enabled and autocorrection is disabled.
Context data for the conversation. You can use this property to access context variables. The context is stored by the assistant on a per-session basis.
Note: The context is included in message responses only if return_context=
true
in the message request. Full context is always included in logs.- context
Session context data that is shared by all skills used by the assistant.
- global
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Possible values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
The session ID.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- mainSkill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill. Private variables are persisted, but not shown.
- actionsSkill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context.
Unique identifier of the assistant.
The ID of the session the message was part of.
The unique identifier of the skill that responded to the message.
The name of the snapshot (dialog skill version) that responded to the message (for example,
draft
).The timestamp for receipt of the message.
The timestamp for the system response to the message.
The language of the assistant to which the message request was made.
The customer ID specified for the message, if any.
The pagination data for the returned objects. For more information about using pagination, see Pagination.
- pagination
The URL that will return the next page of results, if any.
Reserved for future use.
A token identifying the next page of results.
An array of objects describing log events.
- logs
A unique identifier for the logged event.
A message request formatted for the watsonx Assistant service.
Examples:{ "input": { "message_type": "text", "text": "Hello", "options": { "return_context": true, "export": true } }, "context": { "global": { "system": { "user_id": "my_user_id" } } } }
- request
An input object that includes the input text. All private data is masked or removed.
- input
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Possible values: [
text
,search
]The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Whether to return more than one intent. Set to
true
to return all matching intents.Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property. If you also specify return_context=true
, the returned skill context includes thesystem.state
property.Whether to return session context with the response. If you specify
true
, the response includes thecontext
property. If you also specify debug=true
, the returned skill context includes thesystem.state
property.Whether to return session context, including full conversation state. If you specify
true
, the response includes thecontext
property, and the skill context includes thesystem.state
property.Note: If export=
true
, the context is returned regardless of the value of return_context.
Context data for the conversation. You can use this property to set or modify context variables, which can also be accessed by dialog nodes. The context is stored by the assistant on a per-session basis.
Note: The total size of the context data stored for a stateful session cannot exceed 100KB.
- context
Session context data that is shared by all skills used by the assistant.
- global
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Possible values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
The session ID.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- 'main skill'
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill. Private variables are persisted, but not shown.
- 'actions skill'
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context. If user_id is specified in both locations, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A response from the watsonx Assistant service.
- response
Assistant output to be rendered or processed by the client. All private data is masked or removed.
- output
Output intended for any channel. It is the responsibility of the client application to implement the supported response types.
- generic
- RuntimeResponseGeneric
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text of the response.
An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
- channels
A channel for which the response is intended.
An array of intents recognized in the user input, sorted in descending order of confidence.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of entities identified in the user input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of objects describing any actions requested by the dialog node.
- actions
The name of the action.
The type of action to invoke.
Possible values: [
client
,server
,web-action
,cloud-function
]A map of key/value pairs to be provided to the action.
The location in the dialog context where the result of the action is stored.
The name of the context variable that the client application will use to pass in credentials for the action.
Additional detailed information about a message response and how it was generated.
- debug
An array of objects containing detailed diagnostic information about dialog nodes that were visited during processing of the input message.
- nodes_visited
A dialog node that was visited during processing of the input message.
The title of the dialog node.
The conditions that trigger the dialog node.
An array of up to 50 messages logged with the request.
- log_messages
The severity of the log message.
Possible values: [
info
,error
,warn
]The text of the log message.
A code that indicates the category to which the error message belongs.
An object that identifies the dialog element that generated the error message.
- source
A string that indicates the type of dialog element that generated the error message.
The unique identifier of the dialog node that generated the error message.
Assistant sets this to true when this message response concludes or interrupts a dialog.
When
branch_exited
is set totrue
by the assistant, thebranch_exited_reason
specifies whether the dialog completed by itself or got interrupted.Possible values: [
completed
,fallback
]An array of objects containing detailed diagnostic information about dialog nodes and actions that were visited during processing of the input message.
This property is present only if the assistant has an action skill.
- turn_events
- MessageOutputDebugTurnEvent
The type of turn event.
- source
The type of turn event.
Possible values: [
action
]An action that was visited during processing of the message.
The title of the action.
The condition that triggered the dialog node.
The time when the action started processing the message.
The type of condition (if any) that is defined for the action.
Possible values: [
user_defined
,welcome
,anything_else
]The reason the action was visited.
Possible values: [
intent
,invoke_subaction
,subaction_return
,invoke_external
,topic_switch
,topic_return
,agent_requested
,step_validation_failed
,no_action_matches
]The variable where the result of the call to the action is stored. Included only if reason=
subaction_return
.
An object containing any custom properties included in the response. This object includes any arbitrary properties defined in the dialog JSON editor as part of the dialog node output.
Properties describing any spelling corrections in the user input that was received.
- spelling
The user input text that was used to generate the response. If spelling autocorrection is enabled, this text reflects any spelling corrections that were applied.
The original user input text. This property is returned only if autocorrection is enabled and the user input was corrected.
Any suggested corrections of the input text. This property is returned only if spelling correction is enabled and autocorrection is disabled.
Context data for the conversation. You can use this property to access context variables. The context is stored by the assistant on a per-session basis.
Note: The context is included in message responses only if return_context=
true
in the message request. Full context is always included in logs.- context
Session context data that is shared by all skills used by the assistant.
- global
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Possible values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
The session ID.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- 'main skill'
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill. Private variables are persisted, but not shown.
- 'actions skill'
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context.
Unique identifier of the assistant.
The ID of the session the message was part of.
The unique identifier of the skill that responded to the message.
The name of the snapshot (dialog skill version) that responded to the message (for example,
draft
).The timestamp for receipt of the message.
The timestamp for the system response to the message.
The language of the assistant to which the message request was made.
The customer ID specified for the message, if any.
The pagination data for the returned objects. For more information about using pagination, see Pagination.
- pagination
The URL that will return the next page of results, if any.
Reserved for future use.
A token identifying the next page of results.
An array of objects describing log events.
- logs
A unique identifier for the logged event.
A message request formatted for the watsonx Assistant service.
Examples:{ "input": { "message_type": "text", "text": "Hello", "options": { "return_context": true, "export": true } }, "context": { "global": { "system": { "user_id": "my_user_id" } } } }
- request
An input object that includes the input text. All private data is masked or removed.
- input
The type of the message:
text
: The user input is processed normally by the assistant.search
: Only search results are returned. (Any dialog or action skill is bypassed.)
Note: A
search
message results in an error if no search skill is configured for the assistant.Possible values: [
text
,search
]The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 2048
Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
For internal use only.
An array of multimedia attachments to be sent with the message. Attachments are not processed by the assistant itself, but can be sent to external services by webhooks.
Note: Attachments are not supported on IBM Cloud Pak for Data.
Possible values: number of items ≤ 5
- attachments
The URL of the media file.
The media content type (such as a MIME type) of the attachment.
An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension.
- analytics
The browser that was used to send the message that triggered the event.
The type of device that was used to send the message that triggered the event.
The URL of the web page that was used to send the message that triggered the event.
Optional properties that control how the assistant responds.
- options
Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes. Note: This does not affect
turn_count
or any other context variables.Whether to return more than one intent. Set to
true
to return all matching intents.Whether custom extension callouts are executed asynchronously. Asynchronous execution means the response to the extension callout will be processed on the subsequent message call, the initial message response signals to the client that the operation may be long running. With synchronous execution the custom extension is executed and returns the response in a single message turn. Note: async_callout defaults to true for API versions earlier than 2023-06-15.
Spelling correction options for the message. Any options specified on an individual message override the settings configured for the skill.
- spelling
Whether to use spelling correction when processing the input. If spelling correction is used and auto_correct is
true
, any spelling corrections are automatically applied to the user input. If auto_correct isfalse
, any suggested corrections are returned in the output.spelling property.This property overrides the value of the spelling_suggestions property in the workspace settings for the skill.
Whether to use autocorrection when processing the input. If this property is
true
, any corrections are automatically applied to the user input, and the original text is returned in the output.spelling property of the message response. This property overrides the value of the spelling_auto_correct property in the workspace settings for the skill.
Whether to return additional diagnostic information. Set to
true
to return additional information in theoutput.debug
property. If you also specify return_context=true
, the returned skill context includes thesystem.state
property.Whether to return session context with the response. If you specify
true
, the response includes thecontext
property. If you also specify debug=true
, the returned skill context includes thesystem.state
property.Whether to return session context, including full conversation state. If you specify
true
, the response includes thecontext
property, and the skill context includes thesystem.state
property.Note: If export=
true
, the context is returned regardless of the value of return_context.
Context data for the conversation. You can use this property to set or modify context variables, which can also be accessed by dialog nodes. The context is stored by the assistant on a per-session basis.
Note: The total size of the context data stored for a stateful session cannot exceed 100KB.
- context
Session context data that is shared by all skills used by the assistant.
- global_
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Possible values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
The session ID.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- main_skill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill. Private variables are persisted, but not shown.
- actions_skill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context. If user_id is specified in both locations, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A response from the watsonx Assistant service.
- response
Assistant output to be rendered or processed by the client. All private data is masked or removed.
- output
Output intended for any channel. It is the responsibility of the client application to implement the supported response types.
- generic
- RuntimeResponseGeneric
The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
The text of the response.
An array of objects specifying channels for which the response is intended. If channels is present, the response is intended for a built-in integration and should not be handled by an API client.
- channels
A channel for which the response is intended.
An array of intents recognized in the user input, sorted in descending order of confidence.
- intents
The name of the recognized intent.
A decimal percentage that represents confidence in the intent. If you are specifying an intent as part of a request, but you do not have a calculated confidence value, specify
1
.The skill that identified the intent. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of entities identified in the user input.
- entities
An entity detected in the input.
An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.
Possible values: number of items = 2
The term in the input text that was recognized as an entity value.
A decimal percentage that represents confidence in the recognized entity.
The recognized capture groups for the entity, as defined by the entity pattern.
- groups
A recognized capture group for the entity.
Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Possible values: number of items = 2
An object containing detailed information about the entity recognized in the user input. This property is included only if the new system entities are enabled for the skill.
For more information about how the new system entities are interpreted, see the documentation.
- interpretation
The calendar used to represent a recognized date (for example,
Gregorian
).A unique identifier used to associate a recognized time and date. If the user input contains a date and time that are mentioned together (for example,
Today at 5
, the same datetime_link value is returned for both the@sys-date
and@sys-time
entities).A locale-specific holiday name (such as
thanksgiving
orchristmas
). This property is included when a@sys-date
entity is recognized based on a holiday name in the user input.The precision or duration of a time range specified by a recognized
@sys-time
or@sys-date
entity.Possible values: [
day
,fortnight
,hour
,instant
,minute
,month
,quarter
,second
,week
,weekend
,year
]A unique identifier used to associate multiple recognized
@sys-date
,@sys-time
, or@sys-number
entities that are recognized as a range of values in the user's input (for example,from July 4 until July 14
orfrom 20 to 25
).The word in the user input that indicates that a
sys-date
orsys-time
entity is part of an implied range where only one date or time is specified (for example,since
oruntil
).A recognized mention of a relative day, represented numerically as an offset from the current date (for example,
-1
foryesterday
or10
forin ten days
).A recognized mention of a relative month, represented numerically as an offset from the current month (for example,
1
fornext month
or-3
forthree months ago
).A recognized mention of a relative week, represented numerically as an offset from the current week (for example,
2
forin two weeks
or-1
for `last week).A recognized mention of a relative date range for a weekend, represented numerically as an offset from the current weekend (for example,
0
forthis weekend
or-1
forlast weekend
).A recognized mention of a relative year, represented numerically as an offset from the current year (for example,
1
fornext year
or-5
forfive years ago
).A recognized mention of a specific date, represented numerically as the date within the month (for example,
30
forJune 30
.).A recognized mention of a specific day of the week as a lowercase string (for example,
monday
).A recognized mention of a specific month, represented numerically (for example,
7
forJuly
).A recognized mention of a specific quarter, represented numerically (for example,
3
forthe third quarter
).A recognized mention of a specific year (for example,
2016
).A recognized numeric value, represented as an integer or double.
The type of numeric value recognized in the user input (
integer
orrational
).A recognized term for a time that was mentioned as a part of the day in the user's input (for example,
morning
orafternoon
).A recognized mention of a relative hour, represented numerically as an offset from the current hour (for example,
3
forin three hours
or-1
foran hour ago
).A recognized mention of a relative time, represented numerically as an offset in minutes from the current time (for example,
5
forin five minutes
or-15
forfifteen minutes ago
).A recognized mention of a relative time, represented numerically as an offset in seconds from the current time (for example,
10
forin ten seconds
or-30
forthirty seconds ago
).A recognized specific hour mentioned as part of a time value (for example,
10
for10:15 AM
.).A recognized specific minute mentioned as part of a time value (for example,
15
for10:15 AM
.).A recognized specific second mentioned as part of a time value (for example,
30
for10:15:30 AM
.).A recognized time zone mentioned as part of a time value (for example,
EST
).
An array of possible alternative values that the user might have intended instead of the value returned in the value property. This property is returned only for
@sys-time
and@sys-date
entities when the user's input is ambiguous.This property is included only if the new system entities are enabled for the skill.
- alternatives
The entity value that was recognized in the user input.
A decimal percentage that represents confidence in the recognized entity.
An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill.
- role
The relationship of the entity to the range.
Possible values: [
date_from
,date_to
,number_from
,number_to
,time_from
,time_to
]
The skill that recognized the entity value. Currently, the only possible values are
main skill
for the dialog skill (if enabled) andactions skill
for the action skill.This property is present only if the assistant has both a dialog skill and an action skill.
An array of objects describing any actions requested by the dialog node.
- actions
The name of the action.
The type of action to invoke.
Possible values: [
client
,server
,web-action
,cloud-function
]A map of key/value pairs to be provided to the action.
The location in the dialog context where the result of the action is stored.
The name of the context variable that the client application will use to pass in credentials for the action.
Additional detailed information about a message response and how it was generated.
- debug
An array of objects containing detailed diagnostic information about dialog nodes that were visited during processing of the input message.
- nodes_visited
A dialog node that was visited during processing of the input message.
The title of the dialog node.
The conditions that trigger the dialog node.
An array of up to 50 messages logged with the request.
- log_messages
The severity of the log message.
Possible values: [
info
,error
,warn
]The text of the log message.
A code that indicates the category to which the error message belongs.
An object that identifies the dialog element that generated the error message.
- source
A string that indicates the type of dialog element that generated the error message.
The unique identifier of the dialog node that generated the error message.
Assistant sets this to true when this message response concludes or interrupts a dialog.
When
branch_exited
is set totrue
by the assistant, thebranch_exited_reason
specifies whether the dialog completed by itself or got interrupted.Possible values: [
completed
,fallback
]An array of objects containing detailed diagnostic information about dialog nodes and actions that were visited during processing of the input message.
This property is present only if the assistant has an action skill.
- turn_events
- MessageOutputDebugTurnEvent
The type of turn event.
- source
The type of turn event.
Possible values: [
action
]An action that was visited during processing of the message.
The title of the action.
The condition that triggered the dialog node.
The time when the action started processing the message.
The type of condition (if any) that is defined for the action.
Possible values: [
user_defined
,welcome
,anything_else
]The reason the action was visited.
Possible values: [
intent
,invoke_subaction
,subaction_return
,invoke_external
,topic_switch
,topic_return
,agent_requested
,step_validation_failed
,no_action_matches
]The variable where the result of the call to the action is stored. Included only if reason=
subaction_return
.
An object containing any custom properties included in the response. This object includes any arbitrary properties defined in the dialog JSON editor as part of the dialog node output.
Properties describing any spelling corrections in the user input that was received.
- spelling
The user input text that was used to generate the response. If spelling autocorrection is enabled, this text reflects any spelling corrections that were applied.
The original user input text. This property is returned only if autocorrection is enabled and the user input was corrected.
Any suggested corrections of the input text. This property is returned only if spelling correction is enabled and autocorrection is disabled.
Context data for the conversation. You can use this property to access context variables. The context is stored by the assistant on a per-session basis.
Note: The context is included in message responses only if return_context=
true
in the message request. Full context is always included in logs.- context
Session context data that is shared by all skills used by the assistant.
- global_
Built-in system properties that apply to all skills used by the assistant.
- system
The user time zone. The assistant uses the time zone to correctly resolve relative time references.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property at the root of the message body. If user_id is specified in both locations in a message request, the value specified at the root is used.
Possible values: 1 ≤ length ≤ 256
A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the start node of a dialog).
The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example,
04/03/2018
might be interpreted either as April 3 or March 4, depending on the locale.This property is included only if the new system entities are enabled for the skill.
Possible values: [
en-us
,en-ca
,en-gb
,ar-ar
,cs-cz
,de-de
,es-es
,fr-fr
,it-it
,ja-jp
,ko-kr
,nl-nl
,pt-br
,zh-cn
,zh-tw
]The base time for interpreting any relative time mentions in the user input. The specified time overrides the current server time, and is used to calculate times mentioned in relative terms such as
now
ortomorrow
. This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as news articles.This value must be a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).This property is included only if the new system entities are enabled for the skill.
The time at which the session started. With the stateful
message
method, the start time is always present, and is set by the service based on the time the session was created. With the statelessmessage
method, the start time is set by the service in the response to the first message, and should be returned as part of the context with each subsequent message in the session.This value is a UTC time value formatted according to ISO 8601 (for example,
2021-06-26T12:00:00Z
for noon UTC on 26 June 2021).An encoded string that represents the configuration state of the assistant at the beginning of the conversation. If you are using the stateless
message
method, save this value and then send it in the context of the subsequent message request to avoid disruptions if there are configuration changes during the conversation (such as a change to a skill the assistant uses).For internal use only.
The session ID.
Context data specific to particular skills used by the assistant.
- skills
Context variables that are used by the dialog skill.
- main_skill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
Context variables that are used by the action skill. Private variables are persisted, but not shown.
- actions_skill
An object containing any arbitrary variables that can be read and written by a particular skill.
System context data used by the skill.
- system
An encoded string that represents the current conversation state. By saving this value and then sending it in the context of a subsequent message request, you can return to an earlier point in the conversation. If you are using stateful sessions, you can also use a stored state value to restore a paused conversation whose session is expired.
An object containing action variables. Action variables can be accessed only by steps in the same action, and do not persist after the action ends.
An object containing skill variables. (In the watsonx Assistant user interface, skill variables are called session variables.) Skill variables can be accessed by any action and persist for the duration of the session.
An object containing context data that is specific to particular integrations. For more information, see the documentation.
A string value that identifies the user who is interacting with the assistant. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.global.session_id.
Note: This property is the same as the user_id property in the global system context.
Unique identifier of the assistant.
The ID of the session the message was part of.
The unique identifier of the skill that responded to the message.
The name of the snapshot (dialog skill version) that responded to the message (for example,
draft
).The timestamp for receipt of the message.
The timestamp for the system response to the message.
The language of the assistant to which the message request was made.
The customer ID specified for the message, if any.
The pagination data for the returned objects. For more information about using pagination, see Pagination.
- pagination
The URL that will return the next page of results, if any.
Reserved for future use.
A token identifying the next page of results.
Status Code
Successful request.
Invalid request.
No Sample Response
Delete labeled data
Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID.
You associate a customer ID with data by passing the X-Watson-Metadata
header with a request that passes data. For more information about personal data and customer IDs, see Information security.
Note: This operation is intended only for deleting data associated with a single specific customer, not for deleting data associated with multiple customers or for any other purpose. For more information, see Labeling and deleting data in watsonx Assistant.
Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID.
You associate a customer ID with data by passing the X-Watson-Metadata
header with a request that passes data. For more information about personal data and customer IDs, see Information security.
Note: This operation is intended only for deleting data associated with a single specific customer, not for deleting data associated with multiple customers or for any other purpose. For more information, see Labeling and deleting data in watsonx Assistant.
Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID.
You associate a customer ID with data by passing the X-Watson-Metadata
header with a request that passes data. For more information about personal data and customer IDs, see Information security.
Note: This operation is intended only for deleting data associated with a single specific customer, not for deleting data associated with multiple customers or for any other purpose. For more information, see Labeling and deleting data in watsonx Assistant.
Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID.
You associate a customer ID with data by passing the X-Watson-Metadata
header with a request that passes data. For more information about personal data and customer IDs, see Information security.
Note: This operation is intended only for deleting data associated with a single specific customer, not for deleting data associated with multiple customers or for any other purpose. For more information, see Labeling and deleting data in watsonx Assistant.
DELETE /v2/user_data
ServiceCall<Void> deleteUserData(DeleteUserDataOptions deleteUserDataOptions)
deleteUserData(params)
delete_user_data(
self,
customer_id: str,
**kwargs,
) -> DetailedResponse
Request
Use the DeleteUserDataOptions.Builder
to create a DeleteUserDataOptions
object that contains the parameter values for the deleteUserData
method.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.The customer ID for which all data is to be deleted.
The deleteUserData options.
The customer ID for which all data is to be deleted.
parameters
The customer ID for which all data is to be deleted.
parameters
The customer ID for which all data is to be deleted.
curl -X DELETE -u "apikey:{apikey}" "{url}/v2/user_data?customer_id={id}&version=2021-11-27"
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Assistant assistant = new Assistant("2021-06-14", authenticator); assistant.setServiceUrl("{url}"); String customerId = "{id}"; DeleteUserDataOptions options = new DeleteUserDataOptions.Builder(customerId).build(); assistant.deleteUserData(options).execute();
const AssistantV2 = require('ibm-watson/assistant/v2'); const { IamAuthenticator } = require('ibm-watson/auth'); const assistant = new AssistantV2({ version: '2021-06-14', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const params = { customerId: '{id}' }; assistant.deleteUserData(params) .then(res => { console.log(JSON.stringify(res.result, null, 2)); }) .catch(err => { console.log(err) });
import json from ibm_watson import AssistantV2 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') assistant = AssistantV2( version='2021-06-14', authenticator = authenticator ) assistant.set_service_url('{url}') response = assistant.delete_user_data( customer_id = '{id}' ).get_result() print(json.dumps(response, indent=2))
List environments
List the environments associated with an assistant.
List the environments associated with an assistant.
List the environments associated with an assistant.
List the environments associated with an assistant.
GET /v2/assistants/{assistant_id}/environments
ServiceCall<EnvironmentCollection> listEnvironments(ListEnvironmentsOptions listEnvironmentsOptions)
listEnvironments(params)
list_environments(
self,
assistant_id: str,
*,
page_limit: Optional[int] = None,
include_count: Optional[bool] = None,
sort: Optional[str] = None,
cursor: Optional[str] = None,
include_audit: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
Request
Use the ListEnvironmentsOptions.Builder
to create a ListEnvironmentsOptions
object that contains the parameter values for the listEnvironments
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.The number of records to return in each page of results.
Default:
100
Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true
, thepagination
object in the response includes thetotal
property.Default:
false
The attribute by which returned environments will be sorted. To reverse the sort order, prefix the value with a minus sign (
-
).Allowable values: [
name
,updated
]A token identifying the page of results to retrieve.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
The listEnvironments options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
The number of records to return in each page of results.
Default:
100
Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true
, thepagination
object in the response includes thetotal
property.Default:
false
The attribute by which returned environments will be sorted. To reverse the sort order, prefix the value with a minus sign (
-
).Allowable values: [
name
,updated
]A token identifying the page of results to retrieve.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
The number of records to return in each page of results.
Default:
100
Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true
, thepagination
object in the response includes thetotal
property.Default:
false
The attribute by which returned environments will be sorted. To reverse the sort order, prefix the value with a minus sign (
-
).Allowable values: [
name
,updated
]A token identifying the page of results to retrieve.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
The number of records to return in each page of results.
Default:
100
Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true
, thepagination
object in the response includes thetotal
property.Default:
false
The attribute by which returned environments will be sorted. To reverse the sort order, prefix the value with a minus sign (
-
).Allowable values: [
name
,updated
]A token identifying the page of results to retrieve.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
curl -X GET -u "apikey:{apikey}" "{url}/v2/assistants/{assistant_id}/environments?version=2021-11-27"
curl -X GET --header "Authorization: Bearer {token}" "{url}/v2/assistants/{assistant_id}/environments?version=2021-11-27"
Response
An array of objects describing the environments associated with an assistant.
The pagination data for the returned objects. For more information about using pagination, see Pagination.
An array of objects describing the environments associated with an assistant.
- environments
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The description of the environment.
Possible values: 1 ≤ length ≤ 128
The assistant ID of the assistant the environment is associated with.
The environment ID of the environment.
The type of the environment. All environments other than the
draft
andlive
environments have the typestaging
.An object describing the release that is currently deployed in the environment.
- releaseReference
The name of the deployed release.
The search skill orchestration settings for the environment.
- orchestration
Whether to fall back to a search skill when responding to messages that do not match any intent or action defined in dialog or action skills. (If no search skill is configured for the environment, this property is ignored.).
The session inactivity timeout setting for the environment (in seconds).
Possible values: 10 ≤ value ≤ 604800
An array of objects describing the integrations that exist in the environment.
- integrationReferences
The integration ID of the integration.
The type of the integration.
An array of objects identifying the skills (such as action and dialog) that exist in the environment.
- skillReferences
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]Whether the skill is disabled. A disabled skill in the draft environment does not handle any messages at run time, and it is not included in saved releases.
The name of the skill snapshot that is deployed to the environment (for example,
draft
or1
).The type of skill identified by the skill reference. The possible values are
main skill
(for a dialog skill),actions skill
, andsearch skill
.
The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The pagination data for the returned objects. For more information about using pagination, see Pagination.
- pagination
The URL that will return the same page of results.
The URL that will return the next page of results.
The total number of objects that satisfy the request. This total includes all results, not just those included in the current page.
Reserved for future use.
A token identifying the current page of results.
A token identifying the next page of results.
An array of objects describing the environments associated with an assistant.
- environments
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The description of the environment.
Possible values: 1 ≤ length ≤ 128
The assistant ID of the assistant the environment is associated with.
The environment ID of the environment.
The type of the environment. All environments other than the
draft
andlive
environments have the typestaging
.An object describing the release that is currently deployed in the environment.
- release_reference
The name of the deployed release.
The search skill orchestration settings for the environment.
- orchestration
Whether to fall back to a search skill when responding to messages that do not match any intent or action defined in dialog or action skills. (If no search skill is configured for the environment, this property is ignored.).
The session inactivity timeout setting for the environment (in seconds).
Possible values: 10 ≤ value ≤ 604800
An array of objects describing the integrations that exist in the environment.
- integration_references
The integration ID of the integration.
The type of the integration.
An array of objects identifying the skills (such as action and dialog) that exist in the environment.
- skill_references
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]Whether the skill is disabled. A disabled skill in the draft environment does not handle any messages at run time, and it is not included in saved releases.
The name of the skill snapshot that is deployed to the environment (for example,
draft
or1
).The type of skill identified by the skill reference. The possible values are
main skill
(for a dialog skill),actions skill
, andsearch skill
.
The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The pagination data for the returned objects. For more information about using pagination, see Pagination.
- pagination
The URL that will return the same page of results.
The URL that will return the next page of results.
The total number of objects that satisfy the request. This total includes all results, not just those included in the current page.
Reserved for future use.
A token identifying the current page of results.
A token identifying the next page of results.
An array of objects describing the environments associated with an assistant.
- environments
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The description of the environment.
Possible values: 1 ≤ length ≤ 128
The assistant ID of the assistant the environment is associated with.
The environment ID of the environment.
The type of the environment. All environments other than the
draft
andlive
environments have the typestaging
.An object describing the release that is currently deployed in the environment.
- release_reference
The name of the deployed release.
The search skill orchestration settings for the environment.
- orchestration
Whether to fall back to a search skill when responding to messages that do not match any intent or action defined in dialog or action skills. (If no search skill is configured for the environment, this property is ignored.).
The session inactivity timeout setting for the environment (in seconds).
Possible values: 10 ≤ value ≤ 604800
An array of objects describing the integrations that exist in the environment.
- integration_references
The integration ID of the integration.
The type of the integration.
An array of objects identifying the skills (such as action and dialog) that exist in the environment.
- skill_references
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]Whether the skill is disabled. A disabled skill in the draft environment does not handle any messages at run time, and it is not included in saved releases.
The name of the skill snapshot that is deployed to the environment (for example,
draft
or1
).The type of skill identified by the skill reference. The possible values are
main skill
(for a dialog skill),actions skill
, andsearch skill
.
The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The pagination data for the returned objects. For more information about using pagination, see Pagination.
- pagination
The URL that will return the same page of results.
The URL that will return the next page of results.
The total number of objects that satisfy the request. This total includes all results, not just those included in the current page.
Reserved for future use.
A token identifying the current page of results.
A token identifying the next page of results.
Status Code
Successful request.
Invalid request.
{ "environments": [ { "name": "draft", "description": "Draft Environment For BlueBonnet Ice Cream Co.", "environment": "draft", "assistant_id": "294c910d-6055-436d-8c68-c339fbf82efa", "orchestration": { "search_skill_fallback": false }, "environment_id": "294c910d-6055-436d-8c68-c339fbf82efa", "session_timeout": 200, "skill_references": [ { "type": "search", "disabled": true, "skill_id": "6bc9b96a-9f5c-4b98-992b-376d598023d7", "skill_reference": "search skill" }, { "type": "action", "disabled": false, "skill_id": "1ca10f29-8e27-46db-a664-06c0c218d182", "snapshot": "draft", "skill_reference": "actions skill" }, { "type": "dialog", "disabled": false, "skill_id": "19b7dd58-dd5a-457d-b056-99aadda5a7ff", "snapshot": "draft", "skill_reference": "main skill" } ], "integration_references": [ { "type": "preview_link", "integration_id": "53e97692-dd73-490a-aaf5-91e3e892a915" }, { "type": "web_chat", "integration_id": "c8a9fab3-dae5-4787-91d9-d864d6c76542" }, { "type": "catalog", "integration_id": "6c366356-1509-428b-8bb1-d886a781fdde" } ], "role": "Manager", "custom_roles": [] }, { "name": "live", "description": "Production Environment for BlueBonnet Ice Cream Co.", "environment": "live", "assistant_id": "294c910d-6055-436d-8c68-c339fbf82efa", "orchestration": { "search_skill_fallback": false }, "environment_id": "ba7fdffa-6d2d-4a39-895d-295b34b953e4", "session_timeout": 200, "skill_references": [ { "type": "search", "disabled": true, "skill_id": "bbc3b420-1b13-4d1d-b1b5-56d74e487c9f", "skill_reference": "search skill" } ], "integration_references": [ { "type": "preview_link", "integration_id": "dfc7bd62-13a4-4e2c-9cf2-23658c03b9a5" }, { "type": "web_chat", "integration_id": "c01535f7-0788-4541-a321-49c4a2eaabd2" }, { "type": "catalog", "integration_id": "6857a74f-b853-4efb-8fb6-cf28aaa7ab86" } ], "role": "Manager", "custom_roles": [] }, { "name": "QA Test Environment", "description": "Testing / Pre-prod Environment for BlueBonnet Ice Cream Co.", "environment": "staging", "assistant_id": "294c910d-6055-436d-8c68-c339fbf82efa", "orchestration": { "search_skill_fallback": false }, "environment_id": "d3c1a9f6-ab10-4967-9c8c-1a570236f19f", "session_timeout": 200, "skill_references": [ { "type": "search", "disabled": true, "skill_id": "562ea49e-7b76-414a-8350-6d2d971723a7", "skill_reference": "search skill" } ], "integration_references": [ { "type": "preview_link", "integration_id": "a470927d-fa90-4c03-9de1-ccb57bf862d1" }, { "type": "web_chat", "integration_id": "e07c9409-158f-4d04-9a23-7058d52832a8" } ], "role": "Manager", "custom_roles": [] } ], "pagination": { "refresh_url": "/v2/assistants/294c910d-6055-436d-8c68-c339fbf82efa/environments?verbose=true&include_count=true&version=2020-02-05", "total": 3, "matched": 3 } }
{ "environments": [ { "name": "draft", "description": "Draft Environment For BlueBonnet Ice Cream Co.", "environment": "draft", "assistant_id": "294c910d-6055-436d-8c68-c339fbf82efa", "orchestration": { "search_skill_fallback": false }, "environment_id": "294c910d-6055-436d-8c68-c339fbf82efa", "session_timeout": 200, "skill_references": [ { "type": "search", "disabled": true, "skill_id": "6bc9b96a-9f5c-4b98-992b-376d598023d7", "skill_reference": "search skill" }, { "type": "action", "disabled": false, "skill_id": "1ca10f29-8e27-46db-a664-06c0c218d182", "snapshot": "draft", "skill_reference": "actions skill" }, { "type": "dialog", "disabled": false, "skill_id": "19b7dd58-dd5a-457d-b056-99aadda5a7ff", "snapshot": "draft", "skill_reference": "main skill" } ], "integration_references": [ { "type": "preview_link", "integration_id": "53e97692-dd73-490a-aaf5-91e3e892a915" }, { "type": "web_chat", "integration_id": "c8a9fab3-dae5-4787-91d9-d864d6c76542" }, { "type": "catalog", "integration_id": "6c366356-1509-428b-8bb1-d886a781fdde" } ], "role": "Manager", "custom_roles": [] }, { "name": "live", "description": "Production Environment for BlueBonnet Ice Cream Co.", "environment": "live", "assistant_id": "294c910d-6055-436d-8c68-c339fbf82efa", "orchestration": { "search_skill_fallback": false }, "environment_id": "ba7fdffa-6d2d-4a39-895d-295b34b953e4", "session_timeout": 200, "skill_references": [ { "type": "search", "disabled": true, "skill_id": "bbc3b420-1b13-4d1d-b1b5-56d74e487c9f", "skill_reference": "search skill" } ], "integration_references": [ { "type": "preview_link", "integration_id": "dfc7bd62-13a4-4e2c-9cf2-23658c03b9a5" }, { "type": "web_chat", "integration_id": "c01535f7-0788-4541-a321-49c4a2eaabd2" }, { "type": "catalog", "integration_id": "6857a74f-b853-4efb-8fb6-cf28aaa7ab86" } ], "role": "Manager", "custom_roles": [] }, { "name": "QA Test Environment", "description": "Testing / Pre-prod Environment for BlueBonnet Ice Cream Co.", "environment": "staging", "assistant_id": "294c910d-6055-436d-8c68-c339fbf82efa", "orchestration": { "search_skill_fallback": false }, "environment_id": "d3c1a9f6-ab10-4967-9c8c-1a570236f19f", "session_timeout": 200, "skill_references": [ { "type": "search", "disabled": true, "skill_id": "562ea49e-7b76-414a-8350-6d2d971723a7", "skill_reference": "search skill" } ], "integration_references": [ { "type": "preview_link", "integration_id": "a470927d-fa90-4c03-9de1-ccb57bf862d1" }, { "type": "web_chat", "integration_id": "e07c9409-158f-4d04-9a23-7058d52832a8" } ], "role": "Manager", "custom_roles": [] } ], "pagination": { "refresh_url": "/v2/assistants/294c910d-6055-436d-8c68-c339fbf82efa/environments?verbose=true&include_count=true&version=2020-02-05", "total": 3, "matched": 3 } }
Get environment
Get information about an environment. For more information about environments, see Environments.
Get information about an environment. For more information about environments, see Environments.
Get information about an environment. For more information about environments, see Environments.
Get information about an environment. For more information about environments, see Environments.
GET /v2/assistants/{assistant_id}/environments/{environment_id}
ServiceCall<Environment> getEnvironment(GetEnvironmentOptions getEnvironmentOptions)
getEnvironment(params)
get_environment(
self,
assistant_id: str,
environment_id: str,
*,
include_audit: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
Request
Use the GetEnvironmentOptions.Builder
to create a GetEnvironmentOptions
object that contains the parameter values for the getEnvironment
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click API Details. Note: Currently, the API does not support creating environments.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
The getEnvironment options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click API Details. Note: Currently, the API does not support creating environments.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click API Details. Note: Currently, the API does not support creating environments.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click API Details. Note: Currently, the API does not support creating environments.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
curl -X GET -u "apikey:{apikey}" "{url}/v2/assistants/{assistant_id}/environments/{environment_id}?version=2021-11-27"
curl -X GET --header "Authorization: Bearer {token}" "{url}/v2/assistants/{assistant_id}/environments/{environment_id}?version=2021-11-27"
Response
The assistant ID of the assistant the environment is associated with.
The environment ID of the environment.
The type of the environment. All environments other than the
draft
andlive
environments have the typestaging
.The search skill orchestration settings for the environment.
- orchestration
Whether to fall back to a search skill when responding to messages that do not match any intent or action defined in dialog or action skills. (If no search skill is configured for the environment, this property is ignored.)
The session inactivity timeout setting for the environment (in seconds).
Possible values: 10 ≤ value ≤ 604800
An array of objects describing the integrations that exist in the environment.
An array of objects identifying the skills (such as action and dialog) that exist in the environment.
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The description of the environment.
Possible values: 1 ≤ length ≤ 128
An object describing the release that is currently deployed in the environment.
- release_reference
The name of the deployed release.
The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The description of the environment.
Possible values: 1 ≤ length ≤ 128
The assistant ID of the assistant the environment is associated with.
The environment ID of the environment.
The type of the environment. All environments other than the
draft
andlive
environments have the typestaging
.An object describing the release that is currently deployed in the environment.
- releaseReference
The name of the deployed release.
The search skill orchestration settings for the environment.
- orchestration
Whether to fall back to a search skill when responding to messages that do not match any intent or action defined in dialog or action skills. (If no search skill is configured for the environment, this property is ignored.).
The session inactivity timeout setting for the environment (in seconds).
Possible values: 10 ≤ value ≤ 604800
An array of objects describing the integrations that exist in the environment.
- integrationReferences
The integration ID of the integration.
The type of the integration.
An array of objects identifying the skills (such as action and dialog) that exist in the environment.
- skillReferences
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]Whether the skill is disabled. A disabled skill in the draft environment does not handle any messages at run time, and it is not included in saved releases.
The name of the skill snapshot that is deployed to the environment (for example,
draft
or1
).The type of skill identified by the skill reference. The possible values are
main skill
(for a dialog skill),actions skill
, andsearch skill
.
The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The description of the environment.
Possible values: 1 ≤ length ≤ 128
The assistant ID of the assistant the environment is associated with.
The environment ID of the environment.
The type of the environment. All environments other than the
draft
andlive
environments have the typestaging
.An object describing the release that is currently deployed in the environment.
- release_reference
The name of the deployed release.
The search skill orchestration settings for the environment.
- orchestration
Whether to fall back to a search skill when responding to messages that do not match any intent or action defined in dialog or action skills. (If no search skill is configured for the environment, this property is ignored.).
The session inactivity timeout setting for the environment (in seconds).
Possible values: 10 ≤ value ≤ 604800
An array of objects describing the integrations that exist in the environment.
- integration_references
The integration ID of the integration.
The type of the integration.
An array of objects identifying the skills (such as action and dialog) that exist in the environment.
- skill_references
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]Whether the skill is disabled. A disabled skill in the draft environment does not handle any messages at run time, and it is not included in saved releases.
The name of the skill snapshot that is deployed to the environment (for example,
draft
or1
).The type of skill identified by the skill reference. The possible values are
main skill
(for a dialog skill),actions skill
, andsearch skill
.
The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The description of the environment.
Possible values: 1 ≤ length ≤ 128
The assistant ID of the assistant the environment is associated with.
The environment ID of the environment.
The type of the environment. All environments other than the
draft
andlive
environments have the typestaging
.An object describing the release that is currently deployed in the environment.
- release_reference
The name of the deployed release.
The search skill orchestration settings for the environment.
- orchestration
Whether to fall back to a search skill when responding to messages that do not match any intent or action defined in dialog or action skills. (If no search skill is configured for the environment, this property is ignored.).
The session inactivity timeout setting for the environment (in seconds).
Possible values: 10 ≤ value ≤ 604800
An array of objects describing the integrations that exist in the environment.
- integration_references
The integration ID of the integration.
The type of the integration.
An array of objects identifying the skills (such as action and dialog) that exist in the environment.
- skill_references
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]Whether the skill is disabled. A disabled skill in the draft environment does not handle any messages at run time, and it is not included in saved releases.
The name of the skill snapshot that is deployed to the environment (for example,
draft
or1
).The type of skill identified by the skill reference. The possible values are
main skill
(for a dialog skill),actions skill
, andsearch skill
.
The timestamp for creation of the object.
The timestamp for the most recent update to the object.
Status Code
Successful request.
Invalid request.
{ "name": "QA Staging Bot", "assistant_id": "1004f183-6ae1-406c-a239-ce376f46c362", "environment_id": "0925df9d-deac-43e7-1101-fbaf304095da", "description": "Staging bot to test changes", "environment": "staging", "language": "en", "session_timeout": "200", "skill_references": [ { "type": "action", "disabled": false, "skill_id": "bbc4bb3f-a12c-4cec-b040-8f1b15f915a1", "snapshot": "2", "skill_reference": "actions skill" } ], "integration_references": [ { "type": "web_chat", "integration_id": "ebf6754e-aa79-40dc-a367-33f3a51aa570" } ] }
{ "name": "QA Staging Bot", "assistant_id": "1004f183-6ae1-406c-a239-ce376f46c362", "environment_id": "0925df9d-deac-43e7-1101-fbaf304095da", "description": "Staging bot to test changes", "environment": "staging", "language": "en", "session_timeout": "200", "skill_references": [ { "type": "action", "disabled": false, "skill_id": "bbc4bb3f-a12c-4cec-b040-8f1b15f915a1", "snapshot": "2", "skill_reference": "actions skill" } ], "integration_references": [ { "type": "web_chat", "integration_id": "ebf6754e-aa79-40dc-a367-33f3a51aa570" } ] }
Update environment
Update an environment with new or modified data. For more information about environments, see Environments.
Update an environment with new or modified data. For more information about environments, see Environments.
Update an environment with new or modified data. For more information about environments, see Environments.
Update an environment with new or modified data. For more information about environments, see Environments.
POST /v2/assistants/{assistant_id}/environments/{environment_id}
ServiceCall<Environment> updateEnvironment(UpdateEnvironmentOptions updateEnvironmentOptions)
updateEnvironment(params)
update_environment(
self,
assistant_id: str,
environment_id: str,
*,
name: Optional[str] = None,
description: Optional[str] = None,
orchestration: Optional['BaseEnvironmentOrchestration'] = None,
session_timeout: Optional[int] = None,
skill_references: Optional[List['EnvironmentSkill']] = None,
**kwargs,
) -> DetailedResponse
Request
Use the UpdateEnvironmentOptions.Builder
to create a UpdateEnvironmentOptions
object that contains the parameter values for the updateEnvironment
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click API Details. Note: Currently, the API does not support creating environments.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.
The updated properties of the environment.
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The description of the environment.
Possible values: 1 ≤ length ≤ 128
The search skill orchestration settings for the environment.
- orchestration
Whether to fall back to a search skill when responding to messages that do not match any intent or action defined in dialog or action skills. (If no search skill is configured for the environment, this property is ignored.)
The session inactivity timeout setting for the environment (in seconds).
Possible values: 10 ≤ value ≤ 604800
An array of objects identifying the skills (such as action and dialog) that exist in the environment.
The updateEnvironment options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click API Details. Note: Currently, the API does not support creating environments.
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The description of the environment.
Possible values: 1 ≤ length ≤ 128
The search skill orchestration settings for the environment.
- orchestration
Whether to fall back to a search skill when responding to messages that do not match any intent or action defined in dialog or action skills. (If no search skill is configured for the environment, this property is ignored.).
The session inactivity timeout setting for the environment (in seconds).
Possible values: 10 ≤ value ≤ 604800
An array of objects identifying the skills (such as action and dialog) that exist in the environment.
- skillReferences
The skill ID of the skill.
The type of the skill.
Allowable values: [
dialog
,action
,search
]Whether the skill is disabled. A disabled skill in the draft environment does not handle any messages at run time, and it is not included in saved releases.
The name of the skill snapshot that is deployed to the environment (for example,
draft
or1
).The type of skill identified by the skill reference. The possible values are
main skill
(for a dialog skill),actions skill
, andsearch skill
.
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click API Details. Note: Currently, the API does not support creating environments.
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The description of the environment.
Possible values: 1 ≤ length ≤ 128
The search skill orchestration settings for the environment.
- orchestration
Whether to fall back to a search skill when responding to messages that do not match any intent or action defined in dialog or action skills. (If no search skill is configured for the environment, this property is ignored.).
The session inactivity timeout setting for the environment (in seconds).
Possible values: 10 ≤ value ≤ 604800
An array of objects identifying the skills (such as action and dialog) that exist in the environment.
- skillReferences
The skill ID of the skill.
The type of the skill.
Allowable values: [
dialog
,action
,search
]Whether the skill is disabled. A disabled skill in the draft environment does not handle any messages at run time, and it is not included in saved releases.
The name of the skill snapshot that is deployed to the environment (for example,
draft
or1
).The type of skill identified by the skill reference. The possible values are
main skill
(for a dialog skill),actions skill
, andsearch skill
.
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, open the environment settings and click API Details. Note: Currently, the API does not support creating environments.
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The description of the environment.
Possible values: 1 ≤ length ≤ 128
The search skill orchestration settings for the environment.
- orchestration
Whether to fall back to a search skill when responding to messages that do not match any intent or action defined in dialog or action skills. (If no search skill is configured for the environment, this property is ignored.).
The session inactivity timeout setting for the environment (in seconds).
Possible values: 10 ≤ value ≤ 604800
An array of objects identifying the skills (such as action and dialog) that exist in the environment.
- skill_references
The skill ID of the skill.
The type of the skill.
Allowable values: [
dialog
,action
,search
]Whether the skill is disabled. A disabled skill in the draft environment does not handle any messages at run time, and it is not included in saved releases.
The name of the skill snapshot that is deployed to the environment (for example,
draft
or1
).The type of skill identified by the skill reference. The possible values are
main skill
(for a dialog skill),actions skill
, andsearch skill
.
curl -X POST -u "apikey:{apikey}" --header "Content-Type: application/json" --data "{\"name\":\"API test assistant\",\"language\":\"en\",\"description\":\"Environment updated using API.\"}" "{url}/v2/assistants/{assistant_id}/environments/{environment_id}?version=2021-11-27"
curl -X POST --header "Authorization: Bearer {token}" --header "Content-Type: application/json" --data "{\"name\":\"API test assistant\",\"language\":\"en\",\"description\":\"Environment updated using API.\"}" "{url}/v2/assistants/{assistant_id}/environments/{environment_id}?version=2021-11-27"
Response
The assistant ID of the assistant the environment is associated with.
The environment ID of the environment.
The type of the environment. All environments other than the
draft
andlive
environments have the typestaging
.The search skill orchestration settings for the environment.
- orchestration
Whether to fall back to a search skill when responding to messages that do not match any intent or action defined in dialog or action skills. (If no search skill is configured for the environment, this property is ignored.)
The session inactivity timeout setting for the environment (in seconds).
Possible values: 10 ≤ value ≤ 604800
An array of objects describing the integrations that exist in the environment.
An array of objects identifying the skills (such as action and dialog) that exist in the environment.
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The description of the environment.
Possible values: 1 ≤ length ≤ 128
An object describing the release that is currently deployed in the environment.
- release_reference
The name of the deployed release.
The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The description of the environment.
Possible values: 1 ≤ length ≤ 128
The assistant ID of the assistant the environment is associated with.
The environment ID of the environment.
The type of the environment. All environments other than the
draft
andlive
environments have the typestaging
.An object describing the release that is currently deployed in the environment.
- releaseReference
The name of the deployed release.
The search skill orchestration settings for the environment.
- orchestration
Whether to fall back to a search skill when responding to messages that do not match any intent or action defined in dialog or action skills. (If no search skill is configured for the environment, this property is ignored.).
The session inactivity timeout setting for the environment (in seconds).
Possible values: 10 ≤ value ≤ 604800
An array of objects describing the integrations that exist in the environment.
- integrationReferences
The integration ID of the integration.
The type of the integration.
An array of objects identifying the skills (such as action and dialog) that exist in the environment.
- skillReferences
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]Whether the skill is disabled. A disabled skill in the draft environment does not handle any messages at run time, and it is not included in saved releases.
The name of the skill snapshot that is deployed to the environment (for example,
draft
or1
).The type of skill identified by the skill reference. The possible values are
main skill
(for a dialog skill),actions skill
, andsearch skill
.
The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The description of the environment.
Possible values: 1 ≤ length ≤ 128
The assistant ID of the assistant the environment is associated with.
The environment ID of the environment.
The type of the environment. All environments other than the
draft
andlive
environments have the typestaging
.An object describing the release that is currently deployed in the environment.
- release_reference
The name of the deployed release.
The search skill orchestration settings for the environment.
- orchestration
Whether to fall back to a search skill when responding to messages that do not match any intent or action defined in dialog or action skills. (If no search skill is configured for the environment, this property is ignored.).
The session inactivity timeout setting for the environment (in seconds).
Possible values: 10 ≤ value ≤ 604800
An array of objects describing the integrations that exist in the environment.
- integration_references
The integration ID of the integration.
The type of the integration.
An array of objects identifying the skills (such as action and dialog) that exist in the environment.
- skill_references
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]Whether the skill is disabled. A disabled skill in the draft environment does not handle any messages at run time, and it is not included in saved releases.
The name of the skill snapshot that is deployed to the environment (for example,
draft
or1
).The type of skill identified by the skill reference. The possible values are
main skill
(for a dialog skill),actions skill
, andsearch skill
.
The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The description of the environment.
Possible values: 1 ≤ length ≤ 128
The assistant ID of the assistant the environment is associated with.
The environment ID of the environment.
The type of the environment. All environments other than the
draft
andlive
environments have the typestaging
.An object describing the release that is currently deployed in the environment.
- release_reference
The name of the deployed release.
The search skill orchestration settings for the environment.
- orchestration
Whether to fall back to a search skill when responding to messages that do not match any intent or action defined in dialog or action skills. (If no search skill is configured for the environment, this property is ignored.).
The session inactivity timeout setting for the environment (in seconds).
Possible values: 10 ≤ value ≤ 604800
An array of objects describing the integrations that exist in the environment.
- integration_references
The integration ID of the integration.
The type of the integration.
An array of objects identifying the skills (such as action and dialog) that exist in the environment.
- skill_references
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]Whether the skill is disabled. A disabled skill in the draft environment does not handle any messages at run time, and it is not included in saved releases.
The name of the skill snapshot that is deployed to the environment (for example,
draft
or1
).The type of skill identified by the skill reference. The possible values are
main skill
(for a dialog skill),actions skill
, andsearch skill
.
The timestamp for creation of the object.
The timestamp for the most recent update to the object.
Status Code
Successful request.
Invalid request.
{ "name": "QA Staging Bot", "assistant_id": "1004f183-6ae1-406c-a239-ce376f46c362", "environment_id": "0925df9d-deac-43e7-1101-fbaf304095da", "description": "Staging bot to test changes", "environment": "staging", "language": "en", "session_timeout": "200", "skill_references": [ { "type": "action", "disabled": false, "skill_id": "bbc4bb3f-a12c-4cec-b040-8f1b15f915a1", "snapshot": "2", "skill_reference": "actions skill" } ], "integration_references": [ { "type": "web_chat", "integration_id": "ebf6754e-aa79-40dc-a367-33f3a51aa570" } ] }
{ "name": "QA Staging Bot", "assistant_id": "1004f183-6ae1-406c-a239-ce376f46c362", "environment_id": "0925df9d-deac-43e7-1101-fbaf304095da", "description": "Staging bot to test changes", "environment": "staging", "language": "en", "session_timeout": "200", "skill_references": [ { "type": "action", "disabled": false, "skill_id": "bbc4bb3f-a12c-4cec-b040-8f1b15f915a1", "snapshot": "2", "skill_reference": "actions skill" } ], "integration_references": [ { "type": "web_chat", "integration_id": "ebf6754e-aa79-40dc-a367-33f3a51aa570" } ] }
Create release
Create a new release using the current content of the dialog and action skills in the draft environment. (In the watsonx Assistant user interface, a release is called a version.)
Create a new release using the current content of the dialog and action skills in the draft environment. (In the watsonx Assistant user interface, a release is called a version.).
Create a new release using the current content of the dialog and action skills in the draft environment. (In the watsonx Assistant user interface, a release is called a version.).
Create a new release using the current content of the dialog and action skills in the draft environment. (In the watsonx Assistant user interface, a release is called a version.).
POST /v2/assistants/{assistant_id}/releases
ServiceCall<Release> createRelease(CreateReleaseOptions createReleaseOptions)
createRelease(params)
create_release(
self,
assistant_id: str,
*,
description: Optional[str] = None,
**kwargs,
) -> DetailedResponse
Request
Use the CreateReleaseOptions.Builder
to create a CreateReleaseOptions
object that contains the parameter values for the createRelease
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.
An object describing the release.
The description of the release.
Possible values: 1 ≤ length ≤ 500
The createRelease options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
The description of the release.
Possible values: 1 ≤ length ≤ 500
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
The description of the release.
Possible values: 1 ≤ length ≤ 500
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
The description of the release.
Possible values: 1 ≤ length ≤ 500
curl -X POST -u "apikey:{apikey}" "{url}/v2/assistants/{assistant_id}/releases?version=2021-11-27"
curl -X POST --header "Authorization: Bearer {token}" "{url}/v2/assistants/{assistant_id}/releases?version=2021-11-27"
Response
The name of the release. The name is the version number (an integer), returned as a string.
The description of the release.
Possible values: 1 ≤ length ≤ 500
An array of objects describing the environments where this release has been deployed.
An object identifying the versionable content objects (such as skill snapshots) that are included in the release.
- content
The skill snapshots that are included in the release.
The current status of the release:
- Available: The release is available for deployment.
- Failed: An asynchronous publish operation has failed.
- Processing: An asynchronous publish operation has not yet completed.
Possible values: [
Available
,Failed
,Processing
]The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The name of the release. The name is the version number (an integer), returned as a string.
The description of the release.
Possible values: 1 ≤ length ≤ 500
An array of objects describing the environments where this release has been deployed.
- environmentReferences
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The unique identifier of the environment.
The type of the environment. All environments other than the draft and live environments have the type
staging
.Possible values: [
draft
,live
,staging
]
An object identifying the versionable content objects (such as skill snapshots) that are included in the release.
- content
The skill snapshots that are included in the release.
- skills
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]The name of the skill snapshot that is saved as part of the release (for example,
draft
or1
).
The current status of the release:
- Available: The release is available for deployment.
- Failed: An asynchronous publish operation has failed.
- Processing: An asynchronous publish operation has not yet completed.
Possible values: [
Available
,Failed
,Processing
]The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The name of the release. The name is the version number (an integer), returned as a string.
The description of the release.
Possible values: 1 ≤ length ≤ 500
An array of objects describing the environments where this release has been deployed.
- environment_references
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The unique identifier of the environment.
The type of the environment. All environments other than the draft and live environments have the type
staging
.Possible values: [
draft
,live
,staging
]
An object identifying the versionable content objects (such as skill snapshots) that are included in the release.
- content
The skill snapshots that are included in the release.
- skills
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]The name of the skill snapshot that is saved as part of the release (for example,
draft
or1
).
The current status of the release:
- Available: The release is available for deployment.
- Failed: An asynchronous publish operation has failed.
- Processing: An asynchronous publish operation has not yet completed.
Possible values: [
Available
,Failed
,Processing
]The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The name of the release. The name is the version number (an integer), returned as a string.
The description of the release.
Possible values: 1 ≤ length ≤ 500
An array of objects describing the environments where this release has been deployed.
- environment_references
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The unique identifier of the environment.
The type of the environment. All environments other than the draft and live environments have the type
staging
.Possible values: [
draft
,live
,staging
]
An object identifying the versionable content objects (such as skill snapshots) that are included in the release.
- content
The skill snapshots that are included in the release.
- skills
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]The name of the skill snapshot that is saved as part of the release (for example,
draft
or1
).
The current status of the release:
- Available: The release is available for deployment.
- Failed: An asynchronous publish operation has failed.
- Processing: An asynchronous publish operation has not yet completed.
Possible values: [
Available
,Failed
,Processing
]The timestamp for creation of the object.
The timestamp for the most recent update to the object.
Status Code
Request to create release has been accepted successfully.
Invalid request.
Async request accepted
{ "status": "Processing", "release": "1" }
Async request accepted
{ "status": "Processing", "release": "1" }
List releases
List the releases associated with an assistant. (In the watsonx Assistant user interface, a release is called a version.)
List the releases associated with an assistant. (In the watsonx Assistant user interface, a release is called a version.).
List the releases associated with an assistant. (In the watsonx Assistant user interface, a release is called a version.).
List the releases associated with an assistant. (In the watsonx Assistant user interface, a release is called a version.).
GET /v2/assistants/{assistant_id}/releases
ServiceCall<ReleaseCollection> listReleases(ListReleasesOptions listReleasesOptions)
listReleases(params)
list_releases(
self,
assistant_id: str,
*,
page_limit: Optional[int] = None,
include_count: Optional[bool] = None,
sort: Optional[str] = None,
cursor: Optional[str] = None,
include_audit: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
Request
Use the ListReleasesOptions.Builder
to create a ListReleasesOptions
object that contains the parameter values for the listReleases
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.The number of records to return in each page of results.
Default:
100
Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true
, thepagination
object in the response includes thetotal
property.Default:
false
The attribute by which returned workspaces will be sorted. To reverse the sort order, prefix the value with a minus sign (
-
).Allowable values: [
name
,updated
]A token identifying the page of results to retrieve.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
The listReleases options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
The number of records to return in each page of results.
Default:
100
Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true
, thepagination
object in the response includes thetotal
property.Default:
false
The attribute by which returned workspaces will be sorted. To reverse the sort order, prefix the value with a minus sign (
-
).Allowable values: [
name
,updated
]A token identifying the page of results to retrieve.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
The number of records to return in each page of results.
Default:
100
Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true
, thepagination
object in the response includes thetotal
property.Default:
false
The attribute by which returned workspaces will be sorted. To reverse the sort order, prefix the value with a minus sign (
-
).Allowable values: [
name
,updated
]A token identifying the page of results to retrieve.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
The number of records to return in each page of results.
Default:
100
Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true
, thepagination
object in the response includes thetotal
property.Default:
false
The attribute by which returned workspaces will be sorted. To reverse the sort order, prefix the value with a minus sign (
-
).Allowable values: [
name
,updated
]A token identifying the page of results to retrieve.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
curl -X GET -u "apikey:{apikey}" "{url}/v2/assistants/{assistant_id}/releases?version=2021-11-27"
curl -X GET --header "Authorization: Bearer {token}" "{url}/v2/assistants/{assistant_id}/releases?version=2021-11-27"
Response
An array of objects describing the releases associated with an assistant.
The pagination data for the returned objects. For more information about using pagination, see Pagination.
An array of objects describing the releases associated with an assistant.
- releases
The name of the release. The name is the version number (an integer), returned as a string.
The description of the release.
Possible values: 1 ≤ length ≤ 500
An array of objects describing the environments where this release has been deployed.
- environmentReferences
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The unique identifier of the environment.
The type of the environment. All environments other than the draft and live environments have the type
staging
.Possible values: [
draft
,live
,staging
]
An object identifying the versionable content objects (such as skill snapshots) that are included in the release.
- content
The skill snapshots that are included in the release.
- skills
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]The name of the skill snapshot that is saved as part of the release (for example,
draft
or1
).
The current status of the release:
- Available: The release is available for deployment.
- Failed: An asynchronous publish operation has failed.
- Processing: An asynchronous publish operation has not yet completed.
Possible values: [
Available
,Failed
,Processing
]The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The pagination data for the returned objects. For more information about using pagination, see Pagination.
- pagination
The URL that will return the same page of results.
The URL that will return the next page of results.
The total number of objects that satisfy the request. This total includes all results, not just those included in the current page.
Reserved for future use.
A token identifying the current page of results.
A token identifying the next page of results.
An array of objects describing the releases associated with an assistant.
- releases
The name of the release. The name is the version number (an integer), returned as a string.
The description of the release.
Possible values: 1 ≤ length ≤ 500
An array of objects describing the environments where this release has been deployed.
- environment_references
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The unique identifier of the environment.
The type of the environment. All environments other than the draft and live environments have the type
staging
.Possible values: [
draft
,live
,staging
]
An object identifying the versionable content objects (such as skill snapshots) that are included in the release.
- content
The skill snapshots that are included in the release.
- skills
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]The name of the skill snapshot that is saved as part of the release (for example,
draft
or1
).
The current status of the release:
- Available: The release is available for deployment.
- Failed: An asynchronous publish operation has failed.
- Processing: An asynchronous publish operation has not yet completed.
Possible values: [
Available
,Failed
,Processing
]The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The pagination data for the returned objects. For more information about using pagination, see Pagination.
- pagination
The URL that will return the same page of results.
The URL that will return the next page of results.
The total number of objects that satisfy the request. This total includes all results, not just those included in the current page.
Reserved for future use.
A token identifying the current page of results.
A token identifying the next page of results.
An array of objects describing the releases associated with an assistant.
- releases
The name of the release. The name is the version number (an integer), returned as a string.
The description of the release.
Possible values: 1 ≤ length ≤ 500
An array of objects describing the environments where this release has been deployed.
- environment_references
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The unique identifier of the environment.
The type of the environment. All environments other than the draft and live environments have the type
staging
.Possible values: [
draft
,live
,staging
]
An object identifying the versionable content objects (such as skill snapshots) that are included in the release.
- content
The skill snapshots that are included in the release.
- skills
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]The name of the skill snapshot that is saved as part of the release (for example,
draft
or1
).
The current status of the release:
- Available: The release is available for deployment.
- Failed: An asynchronous publish operation has failed.
- Processing: An asynchronous publish operation has not yet completed.
Possible values: [
Available
,Failed
,Processing
]The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The pagination data for the returned objects. For more information about using pagination, see Pagination.
- pagination
The URL that will return the same page of results.
The URL that will return the next page of results.
The total number of objects that satisfy the request. This total includes all results, not just those included in the current page.
Reserved for future use.
A token identifying the current page of results.
A token identifying the next page of results.
Status Code
Successful request.
Invalid request.
Successful request.
{ "releases": [ { "status": "Available", "content": { "skills": [ { "type": "action", "skill_id": "460924de-d3ce-468b-abf2-9f1f70f599ac", "snapshot": "1" }, { "type": "dialog", "skill_id": "be339152-826c-46d1-afcd-b6a1e5b6fe62", "snapshot": "1" } ] }, "created": "2022-07-17T02:17:33.647Z", "release": "1", "updated": "2022-07-17T02:17:33.647Z", "description": "release created with both actions and dialog enabled", "environment_references": [] }, { "status": "Available", "content": { "skills": [ { "type": "action", "skill_id": "460924de-d3ce-468b-abf2-9f1f70f599ac", "snapshot": "2" } ] }, "created": "2022-07-17T02:21:55.612Z", "release": "2", "updated": "2022-07-17T02:21:55.612Z", "description": "Changes to the action skill, with dialog disabled.", "environment_references": [ { "name": "QA TESTING ENVIRONMENT", "environment": "staging", "environment_id": "cd4c3893-48d9-4f84-b7d6-addfe9615b06" } ] }, { "status": "Processing", "release": "3" } ], "pagination": { "refresh_url": "/v2/assistants/294c910d-6055-436d-8c68-c339fbf82efa/releases?include_count=true&include_audit=true&version=2020-02-05", "total": 3, "matched": 3 } }
Successful request.
{ "releases": [ { "status": "Available", "content": { "skills": [ { "type": "action", "skill_id": "460924de-d3ce-468b-abf2-9f1f70f599ac", "snapshot": "1" }, { "type": "dialog", "skill_id": "be339152-826c-46d1-afcd-b6a1e5b6fe62", "snapshot": "1" } ] }, "created": "2022-07-17T02:17:33.647Z", "release": "1", "updated": "2022-07-17T02:17:33.647Z", "description": "release created with both actions and dialog enabled", "environment_references": [] }, { "status": "Available", "content": { "skills": [ { "type": "action", "skill_id": "460924de-d3ce-468b-abf2-9f1f70f599ac", "snapshot": "2" } ] }, "created": "2022-07-17T02:21:55.612Z", "release": "2", "updated": "2022-07-17T02:21:55.612Z", "description": "Changes to the action skill, with dialog disabled.", "environment_references": [ { "name": "QA TESTING ENVIRONMENT", "environment": "staging", "environment_id": "cd4c3893-48d9-4f84-b7d6-addfe9615b06" } ] }, { "status": "Processing", "release": "3" } ], "pagination": { "refresh_url": "/v2/assistants/294c910d-6055-436d-8c68-c339fbf82efa/releases?include_count=true&include_audit=true&version=2020-02-05", "total": 3, "matched": 3 } }
Get release
Get information about a release.
Release data is not available until publishing of the release completes. If publishing is still in progress, you can continue to poll by calling the same request again and checking the value of the status property. When processing has completed, the request returns the release data.
Get information about a release.
Release data is not available until publishing of the release completes. If publishing is still in progress, you can continue to poll by calling the same request again and checking the value of the status property. When processing has completed, the request returns the release data.
Get information about a release.
Release data is not available until publishing of the release completes. If publishing is still in progress, you can continue to poll by calling the same request again and checking the value of the status property. When processing has completed, the request returns the release data.
Get information about a release.
Release data is not available until publishing of the release completes. If publishing is still in progress, you can continue to poll by calling the same request again and checking the value of the status property. When processing has completed, the request returns the release data.
GET /v2/assistants/{assistant_id}/releases/{release}
ServiceCall<Release> getRelease(GetReleaseOptions getReleaseOptions)
getRelease(params)
get_release(
self,
assistant_id: str,
release: str,
*,
include_audit: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
Request
Use the GetReleaseOptions.Builder
to create a GetReleaseOptions
object that contains the parameter values for the getRelease
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Unique identifier of the release.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
The getRelease options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the release.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the release.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the release.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
curl -X GET -u "apikey:{apikey}" "{url}/v2/assistants/{assistant_id}/releases/{release}?version=2021-11-27"
curl -X GET --header "Authorization: Bearer {token}" "{url}/v2/assistants/{assistant_id}/releases/{release}?version=2021-11-27"
Response
The name of the release. The name is the version number (an integer), returned as a string.
The description of the release.
Possible values: 1 ≤ length ≤ 500
An array of objects describing the environments where this release has been deployed.
An object identifying the versionable content objects (such as skill snapshots) that are included in the release.
- content
The skill snapshots that are included in the release.
The current status of the release:
- Available: The release is available for deployment.
- Failed: An asynchronous publish operation has failed.
- Processing: An asynchronous publish operation has not yet completed.
Possible values: [
Available
,Failed
,Processing
]The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The name of the release. The name is the version number (an integer), returned as a string.
The description of the release.
Possible values: 1 ≤ length ≤ 500
An array of objects describing the environments where this release has been deployed.
- environmentReferences
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The unique identifier of the environment.
The type of the environment. All environments other than the draft and live environments have the type
staging
.Possible values: [
draft
,live
,staging
]
An object identifying the versionable content objects (such as skill snapshots) that are included in the release.
- content
The skill snapshots that are included in the release.
- skills
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]The name of the skill snapshot that is saved as part of the release (for example,
draft
or1
).
The current status of the release:
- Available: The release is available for deployment.
- Failed: An asynchronous publish operation has failed.
- Processing: An asynchronous publish operation has not yet completed.
Possible values: [
Available
,Failed
,Processing
]The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The name of the release. The name is the version number (an integer), returned as a string.
The description of the release.
Possible values: 1 ≤ length ≤ 500
An array of objects describing the environments where this release has been deployed.
- environment_references
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The unique identifier of the environment.
The type of the environment. All environments other than the draft and live environments have the type
staging
.Possible values: [
draft
,live
,staging
]
An object identifying the versionable content objects (such as skill snapshots) that are included in the release.
- content
The skill snapshots that are included in the release.
- skills
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]The name of the skill snapshot that is saved as part of the release (for example,
draft
or1
).
The current status of the release:
- Available: The release is available for deployment.
- Failed: An asynchronous publish operation has failed.
- Processing: An asynchronous publish operation has not yet completed.
Possible values: [
Available
,Failed
,Processing
]The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The name of the release. The name is the version number (an integer), returned as a string.
The description of the release.
Possible values: 1 ≤ length ≤ 500
An array of objects describing the environments where this release has been deployed.
- environment_references
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The unique identifier of the environment.
The type of the environment. All environments other than the draft and live environments have the type
staging
.Possible values: [
draft
,live
,staging
]
An object identifying the versionable content objects (such as skill snapshots) that are included in the release.
- content
The skill snapshots that are included in the release.
- skills
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]The name of the skill snapshot that is saved as part of the release (for example,
draft
or1
).
The current status of the release:
- Available: The release is available for deployment.
- Failed: An asynchronous publish operation has failed.
- Processing: An asynchronous publish operation has not yet completed.
Possible values: [
Available
,Failed
,Processing
]The timestamp for creation of the object.
The timestamp for the most recent update to the object.
Status Code
Successful request. Note that this does not mean that the asynchronous create operation has completed or was successful. Check the value of the status property to determine the status of the operation.
Invalid request.
Successful request. Release that has been retrieved has a status of 'Available'.
{ "status": "Available", "content": { "skills": [ { "type": "action", "skill_id": "1ca10f29-8e27-46db-a664-06c0c218d182", "snapshot": "1" }, { "type": "dialog", "skill_id": "19b7dd58-dd5a-457d-b056-99aadda5a7ff", "snapshot": "1" } ] }, "release": "1", "description": "Initial changes with both action and dialog enabled.", "environment_references": [] }
Successful request. Release that has been retrieved has a status of 'Available'.
{ "status": "Available", "content": { "skills": [ { "type": "action", "skill_id": "1ca10f29-8e27-46db-a664-06c0c218d182", "snapshot": "1" }, { "type": "dialog", "skill_id": "19b7dd58-dd5a-457d-b056-99aadda5a7ff", "snapshot": "1" } ] }, "release": "1", "description": "Initial changes with both action and dialog enabled.", "environment_references": [] }
Successful request.
{ "status": "Processing", "release": "2" }
Successful request.
{ "status": "Processing", "release": "2" }
Successful request. However, the creation of the release has failed.
{ "status": "Failed", "release": "3", "status_errors": [ { "message": "NLUError: Classification Error: A runtime error occurred" } ], "status_description": "NLUError", "description": "New version with action-only changes." }
Successful request. However, the creation of the release has failed.
{ "status": "Failed", "release": "3", "status_errors": [ { "message": "NLUError: Classification Error: A runtime error occurred" } ], "status_description": "NLUError", "description": "New version with action-only changes." }
Delete release
Delete a release. (In the watsonx Assistant user interface, a release is called a version.)
Delete a release. (In the watsonx Assistant user interface, a release is called a version.).
Delete a release. (In the watsonx Assistant user interface, a release is called a version.).
Delete a release. (In the watsonx Assistant user interface, a release is called a version.).
DELETE /v2/assistants/{assistant_id}/releases/{release}
ServiceCall<Void> deleteRelease(DeleteReleaseOptions deleteReleaseOptions)
deleteRelease(params)
delete_release(
self,
assistant_id: str,
release: str,
**kwargs,
) -> DetailedResponse
Request
Use the DeleteReleaseOptions.Builder
to create a DeleteReleaseOptions
object that contains the parameter values for the deleteRelease
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Unique identifier of the release.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.
The deleteRelease options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the release.
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the release.
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the release.
curl -X DELETE -u "apikey:{apikey}" "{url}/v2/assistants/{assistant_id}/releases/{release}?version=2021-11-27"
curl -X DELETE --header "Authorization: Bearer {token}" "{url}/v2/assistants/{assistant_id}/releases/{release}?version=2021-11-27"
Deploy release
Update the environment with the content of the release. All snapshots saved as part of the release become active in the environment.
Update the environment with the content of the release. All snapshots saved as part of the release become active in the environment.
Update the environment with the content of the release. All snapshots saved as part of the release become active in the environment.
Update the environment with the content of the release. All snapshots saved as part of the release become active in the environment.
POST /v2/assistants/{assistant_id}/releases/{release}/deploy
ServiceCall<Environment> deployRelease(DeployReleaseOptions deployReleaseOptions)
deployRelease(params)
deploy_release(
self,
assistant_id: str,
release: str,
environment_id: str,
*,
include_audit: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
Request
Use the DeployReleaseOptions.Builder
to create a DeployReleaseOptions
object that contains the parameter values for the deployRelease
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Unique identifier of the release.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
An input object that identifies the environment where the release is to be deployed.
{
"environment_id": "ee3cc31e-ee90-4f7d-80e1-318a37c11f62"
}
The environment ID of the environment where the release is to be deployed.
The deployRelease options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the release.
The environment ID of the environment where the release is to be deployed.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the release.
The environment ID of the environment where the release is to be deployed.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the release.
The environment ID of the environment where the release is to be deployed.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
curl -X POST -u "apikey:{apikey}" --header "Content-Type: application/json" --data "{\"environment_id\":\"{environment_id}\"}" "{url}/v2/assistants/{assistant_id}/releases/{release}/deploy?version=2021-11-27"
curl -X POST --header "Authorization: Bearer {token}" --header "Content-Type: application/json" --data "{\"environment_id\":\"{environment_id}\"}" "{url}/v2/assistants/{assistant_id}/releases/{release}/deploy?version=2021-11-27"
Response
The assistant ID of the assistant the environment is associated with.
The environment ID of the environment.
The type of the environment. All environments other than the
draft
andlive
environments have the typestaging
.The search skill orchestration settings for the environment.
- orchestration
Whether to fall back to a search skill when responding to messages that do not match any intent or action defined in dialog or action skills. (If no search skill is configured for the environment, this property is ignored.)
The session inactivity timeout setting for the environment (in seconds).
Possible values: 10 ≤ value ≤ 604800
An array of objects describing the integrations that exist in the environment.
An array of objects identifying the skills (such as action and dialog) that exist in the environment.
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The description of the environment.
Possible values: 1 ≤ length ≤ 128
An object describing the release that is currently deployed in the environment.
- release_reference
The name of the deployed release.
The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The description of the environment.
Possible values: 1 ≤ length ≤ 128
The assistant ID of the assistant the environment is associated with.
The environment ID of the environment.
The type of the environment. All environments other than the
draft
andlive
environments have the typestaging
.An object describing the release that is currently deployed in the environment.
- releaseReference
The name of the deployed release.
The search skill orchestration settings for the environment.
- orchestration
Whether to fall back to a search skill when responding to messages that do not match any intent or action defined in dialog or action skills. (If no search skill is configured for the environment, this property is ignored.).
The session inactivity timeout setting for the environment (in seconds).
Possible values: 10 ≤ value ≤ 604800
An array of objects describing the integrations that exist in the environment.
- integrationReferences
The integration ID of the integration.
The type of the integration.
An array of objects identifying the skills (such as action and dialog) that exist in the environment.
- skillReferences
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]Whether the skill is disabled. A disabled skill in the draft environment does not handle any messages at run time, and it is not included in saved releases.
The name of the skill snapshot that is deployed to the environment (for example,
draft
or1
).The type of skill identified by the skill reference. The possible values are
main skill
(for a dialog skill),actions skill
, andsearch skill
.
The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The description of the environment.
Possible values: 1 ≤ length ≤ 128
The assistant ID of the assistant the environment is associated with.
The environment ID of the environment.
The type of the environment. All environments other than the
draft
andlive
environments have the typestaging
.An object describing the release that is currently deployed in the environment.
- release_reference
The name of the deployed release.
The search skill orchestration settings for the environment.
- orchestration
Whether to fall back to a search skill when responding to messages that do not match any intent or action defined in dialog or action skills. (If no search skill is configured for the environment, this property is ignored.).
The session inactivity timeout setting for the environment (in seconds).
Possible values: 10 ≤ value ≤ 604800
An array of objects describing the integrations that exist in the environment.
- integration_references
The integration ID of the integration.
The type of the integration.
An array of objects identifying the skills (such as action and dialog) that exist in the environment.
- skill_references
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]Whether the skill is disabled. A disabled skill in the draft environment does not handle any messages at run time, and it is not included in saved releases.
The name of the skill snapshot that is deployed to the environment (for example,
draft
or1
).The type of skill identified by the skill reference. The possible values are
main skill
(for a dialog skill),actions skill
, andsearch skill
.
The timestamp for creation of the object.
The timestamp for the most recent update to the object.
The name of the environment.
Possible values: 1 ≤ length ≤ 64
The description of the environment.
Possible values: 1 ≤ length ≤ 128
The assistant ID of the assistant the environment is associated with.
The environment ID of the environment.
The type of the environment. All environments other than the
draft
andlive
environments have the typestaging
.An object describing the release that is currently deployed in the environment.
- release_reference
The name of the deployed release.
The search skill orchestration settings for the environment.
- orchestration
Whether to fall back to a search skill when responding to messages that do not match any intent or action defined in dialog or action skills. (If no search skill is configured for the environment, this property is ignored.).
The session inactivity timeout setting for the environment (in seconds).
Possible values: 10 ≤ value ≤ 604800
An array of objects describing the integrations that exist in the environment.
- integration_references
The integration ID of the integration.
The type of the integration.
An array of objects identifying the skills (such as action and dialog) that exist in the environment.
- skill_references
The skill ID of the skill.
The type of the skill.
Possible values: [
dialog
,action
,search
]Whether the skill is disabled. A disabled skill in the draft environment does not handle any messages at run time, and it is not included in saved releases.
The name of the skill snapshot that is deployed to the environment (for example,
draft
or1
).The type of skill identified by the skill reference. The possible values are
main skill
(for a dialog skill),actions skill
, andsearch skill
.
The timestamp for creation of the object.
The timestamp for the most recent update to the object.
Status Code
Successful request.
Invalid request.
Successful request.
{ "name": "Q/A Testing Bot", "description": "Test Environment for Pre-Production Releases.", "environment": "staging", "assistant_id": "294c910d-6055-436d-8c68-c339fbf82efa", "orchestration": { "search_skill_fallback": false }, "environment_id": "cd4c3893-48d9-4f84-b7d6-addfe9615b06", "session_timeout": 200, "skill_references": [ { "type": "search", "disabled": true, "skill_id": "e545cd08-b256-4b13-882f-d8cc1ab86c6d", "skill_reference": "search skill" }, { "type": "action", "skill_id": "1ca10f29-8e27-46db-a664-06c0c218d182", "snapshot": "2", "skill_reference": "actions skill" }, { "type": "dialog", "skill_id": "19b7dd58-dd5a-457d-b056-99aadda5a7ff", "snapshot": "2", "skill_reference": "main skill" } ], "release_reference": { "release": "2" }, "integration_references": [ { "type": "preview_link", "integration_id": "9eabc50c-fa8d-4100-8c73-ed5b43af08bb" }, { "type": "web_chat", "integration_id": "72d4b283-1d38-49d2-a71e-ae72e596bea5" } ] }
Successful request.
{ "name": "Q/A Testing Bot", "description": "Test Environment for Pre-Production Releases.", "environment": "staging", "assistant_id": "294c910d-6055-436d-8c68-c339fbf82efa", "orchestration": { "search_skill_fallback": false }, "environment_id": "cd4c3893-48d9-4f84-b7d6-addfe9615b06", "session_timeout": 200, "skill_references": [ { "type": "search", "disabled": true, "skill_id": "e545cd08-b256-4b13-882f-d8cc1ab86c6d", "skill_reference": "search skill" }, { "type": "action", "skill_id": "1ca10f29-8e27-46db-a664-06c0c218d182", "snapshot": "2", "skill_reference": "actions skill" }, { "type": "dialog", "skill_id": "19b7dd58-dd5a-457d-b056-99aadda5a7ff", "snapshot": "2", "skill_reference": "main skill" } ], "release_reference": { "release": "2" }, "integration_references": [ { "type": "preview_link", "integration_id": "9eabc50c-fa8d-4100-8c73-ed5b43af08bb" }, { "type": "web_chat", "integration_id": "72d4b283-1d38-49d2-a71e-ae72e596bea5" } ] }
Environment cannot be draft.
{ "error": "Deploy to the draft environment is not permitted.", "code": 400 }
Environment cannot be draft.
{ "error": "Deploy to the draft environment is not permitted.", "code": 400 }
Create release export
Initiate an asynchronous process which will create a downloadable Zip file artifact (/package) for an assistant release. This artifact will contain Action and/or Dialog skills that are part of the release. The Dialog skill will only be included in the event that coexistence is enabled on the assistant. The expected workflow with the use of Release Export endpoint is to first initiate the creation of the artifact with the POST endpoint and then poll the GET endpoint to retrieve the artifact. Once the artifact has been created, it will last for the duration (/scope) of the release.
POST /v2/assistants/{assistant_id}/releases/{release}/export
Request
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Unique identifier of the release.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
curl -X POST -u "apikey:{apikey}" "Content-Type: application/json" "{url}/v2/assistants/{assistant_id}/releases/{release}/export?version=2021-11-27"
Response
The current status of the release export creation process:
- Available: The release export package is available for download.
- Failed: The asynchronous release export package creation process has failed.
- Processing: An asynchronous operation to create the release export package is underway and not yet completed.
Possible values: [
Available
,Failed
,Processing
]A unique identifier for a background asynchronous task that is executing or has executed the operation.
The ID of the assistant to which the release belongs.
The name of the release. The name is the version number (an integer), returned as a string.
The timestamp for creation of the object.
The timestamp for the most recent update to the object.
An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.The description of the failed asynchronous operation. Included only if status=
Failed
.
Status Code
Successful request. The artifact creation might have succeeded or failed.
Successful request that initiates the asynchronous process to create the release export package.
Unsuccessful request. Might indicate that one or more route parameters provided are wrong.
The release is not yet ready. Please try to create an export once the release is ready.
{ "status": "Completed", "release": "1", "task_id": "70510681-a96b-4feb-85f3-ff562fe23943", "assistant_id": "ff2a4cad-280e-4bb5-bae5-34d2760f2d1f" }
{ "status": "Failed", "release": "1", "task_id": "70510681-a96b-4feb-85f3-ff562fe23943", "assistant_id": "ff2a4cad-280e-4bb5-bae5-34d2760f2d1f", "status_errors": [ { "message": "An error message detail." } ], "status_description": "A generic asynchronous task failure message." }
{ "status": "Processing", "release": "1", "task_id": "70510681-a96b-4feb-85f3-ff562fe23943", "assistant_id": "ff2a4cad-280e-4bb5-bae5-34d2760f2d1f" }
{ "code": 404, "error": "Resource not found" }
Get release export
A dual function endpoint to either retrieve the Zip file artifact that is associated with an assistant release or, retrieve the status of the artifact's creation. It is assumed that the artifact creation was already initiated prior to calling this endpoint. In the event that the artifact is not yet created and ready for download, this endpoint can be used to poll the system until the creation is completed or has failed. On the other hand, if the artifact is created, this endpoint will return the Zip file artifact as an octet stream. Once the artifact has been created, it will last for the duration (/scope) of the release.
When you will have downloaded the Zip file artifact, you have one of three ways to import it into an assistant's draft environment. These are as follows.
- Import the zip package in Tooling via "Assistant Settings" -> "Download/Upload files" -> "Upload" -> "Assistant only".
- Import the zip package via "Create release import" endpoint using the APIs.
- Extract the contents of the Zip file artifact and individually import the skill JSONs via skill update endpoints.
GET /v2/assistants/{assistant_id}/releases/{release}/export
Request
Custom Headers
Allowable values: [
application/json
,application/octet-stream
]
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Unique identifier of the release.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
curl -X GET -u "apikey:{apikey}" "Content-Type: application/json" "{url}/v2/assistants/{assistant_id}/releases/{release}/export?version=2021-11-27"
Response
The current status of the release export creation process:
- Available: The release export package is available for download.
- Failed: The asynchronous release export package creation process has failed.
- Processing: An asynchronous operation to create the release export package is underway and not yet completed.
Possible values: [
Available
,Failed
,Processing
]A unique identifier for a background asynchronous task that is executing or has executed the operation.
The ID of the assistant to which the release belongs.
The name of the release. The name is the version number (an integer), returned as a string.
The timestamp for creation of the object.
The timestamp for the most recent update to the object.
An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.The description of the failed asynchronous operation. Included only if status=
Failed
.
Status Code
Successful request. Either retrieves the status of an on-going asynchronous process which is creating the Zip file artifact or, provides the artifact as in an octet stream response.
Unsuccessful request. Might indicate that one or more route parameters provided are wrong or, that the creation of the artifact has never been initiated for the assistant release.
{ "status": "Processing", "release": "1", "task_id": "70510681-a96b-4feb-85f3-ff562fe23943", "assistant_id": "ff2a4cad-280e-4bb5-bae5-34d2760f2d1f" }
{ "status": "Failed", "release": "1", "task_id": "70510681-a96b-4feb-85f3-ff562fe23943", "assistant_id": "ff2a4cad-280e-4bb5-bae5-34d2760f2d1f", "status_errors": [ { "message": "An error message detail." } ], "status_description": "A generic asynchronous task failure message." }
{ "code": 404, "error": "Resource not found" }
Create release import
Import a previously exported assistant release Zip file artifact (/package) into an assistant. This endpoint creates (/initiates) an asynchronous task (/job) in the background which will import the artifact contents into the draft environment of the assistant on which this endpoint is called. Specifically, the asynchronous operation will override the action and/or dialog skills in the assistant. It will be worth noting that when the artifact that is provided to this endpoint is from an assistant release which has coexistence enabled (i.e., it has both action and dialog skills), the import process will automatically enable coexistence, if not already enabled, on the assistant into which said artifact is being uploaded to. On the other hand, if the artifact package being imported only has action skill in it, the import asynchronous process will only override the draft environment's action skill, regardless of whether coexistence is enabled on the assistant into which the package is being imported. Lastly, the system will only run one asynchronous import at a time on an assistant. As such, consecutive imports will override previous import's updates to the skills in the draft environment. Once created, you may poll the completion of the import via the "Get release import Status" endpoint.
POST /v2/assistants/{assistant_id}/import
Request
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
Request body is an Octet-stream of the artifact Zip file that is being imported.
curl -X POST -u "apikey:{apikey}" "Content-Type: application/octet-stream" "{url}/v2/assistants/{assistant_id}/import?version=2021-11-27" --data-binary '@/home/johnyboo/Desktop/IBM-WA-365bf032-b765-4843-9e4d-daf2710da704-V123.zip'
Response
The current status of the artifact import process:
- Failed: The asynchronous artifact import process has failed.
- Processing: An asynchronous operation to import artifact is underway and not yet completed.
Possible values: [
Failed
,Processing
]A unique identifier for a background asynchronous task that is executing or has executed the operation.
The ID of the assistant to which the release belongs.
An array of skill types in the draft environment which will be overridden with skills from the artifact being imported.
Possible values: [
action
,dialog
]The timestamp for creation of the object.
The timestamp for the most recent update to the object.
Status Code
Successful request that initiates the asynchronous process to import the release export artifact (/package).
Unsuccessful request and indicates that something is wrong with the Zip file artifact that was provided.
Unsuccessful request. Might indicate that one or more route parameters provided are wrong.
Unsuccessful request indicating that another artifact import is already underway. Try again after some time.
The artifact that was provided is too large.
An invalid request indicating that the "content-type" header in the request is set to a value other than "application/octet-stream".
{ "status": "Processing", "task_id": "80510681-b96b-4feg-86f4-gg562fe23944", "assistant_id": "ff2a4cad-280e-4bb5-bae5-34d2760f2d1f", "skill_impact_in_draft": [ "action", "dialog" ] }
{ "status": "Processing", "task_id": "80510681-b96b-4feg-86f4-gg562fe23944", "assistant_id": "ff2a4cad-280e-4bb5-bae5-34d2760f2d1f", "skill_impact_in_draft": [ "action" ] }
{ "code": 400, "error": "No data" }
{ "code": 400, "error": "Invalid Assistant Release Import Artifact", "errors": [ { "type": "artifact_validation", "message": "Provided assistant release artifact does not have any recognized skill files (\"action-skill.json\", \"dialog-skill.json\") in the folders that were scanned. Folders scanned: <root>, ..." } ] }
{ "code": 400, "error": "Invalid Assistant Release Import Artifact", "errors": [ { "type": "schema_validation", "message": "allowed values for resolver are: end_action, continue, fallback, jump_to, connect_to_agent, search, search_and_end_action, invoke_another_action, invoke_another_action_and_end, replay, callout, client_actions", "file": "action-skill.json", "path": "/workspace/actions/0/steps/0/resolver/type" }, { "type": "schema_validation", "message": "intent examples contain mentions for non-supported open entity language", "file": "dialog-skill.json", "path": "/workspace/intents" } ] }
{ "code": 404, "error": "Resource not found" }
{ "code": 409, "error": "An assistant release import is already underway" }
{ "code": 415, "error": "Unsupported Media Type" }
Get release import Status
Monitor the status of an assistant release import. You may poll this endpoint until the status of the import has either succeeded or failed.
GET /v2/assistants/{assistant_id}/import
Request
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
curl -X GET -u "apikey:{apikey}" "Content-Type: application/json" "{url}/v2/assistants/{assistant_id}/import?version=2021-11-27"
Response
The current status of the release import process:
- Completed: The artifact import has completed.
- Failed: The asynchronous artifact import process has failed.
- Processing: An asynchronous operation to import the artifact is underway and not yet completed.
Possible values: [
Completed
,Failed
,Processing
]A unique identifier for a background asynchronous task that is executing or has executed the operation.
The ID of the assistant to which the release belongs.
An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.The description of the failed asynchronous operation. Included only if status=
Failed
.An array of skill types in the draft environment which will be overridden with skills from the artifact being imported.
Possible values: [
action
,dialog
]The timestamp for creation of the object.
The timestamp for the most recent update to the object.
Status Code
Successful request that either returns the status of the last import that was executed or, a presently executing import.
Unsuccessful request. Might indicate that one or more route parameters provided are wrong or, a release import may never have been initiated on this assistant.
{ "status": "Completed", "task_id": "80510681-b96b-4feg-86f4-gg562fe23944", "assistant_id": "ff2a4cad-280e-4bb5-bae5-34d2760f2d1f", "skill_impact_in_draft": [ "action", "dialog" ] }
{ "status": "Processing", "task_id": "80510681-b96b-4feg-86f4-gg562fe23944", "assistant_id": "ff2a4cad-280e-4bb5-bae5-34d2760f2d1f", "skill_impact_in_draft": [ "action", "dialog" ] }
{ "status": "Failed", "task_id": "80510681-b96b-4feg-86f4-gg562fe23944", "assistant_id": "ff2a4cad-280e-4bb5-bae5-34d2760f2d1f", "skill_impact_in_draft": [ "action", "dialog" ], "status_description": "Failed to import assistant release export artifact", "status_errors": [ { "message": "An error has occurred. These are some details." } ] }
{ "code": 404, "error": "Resource not found" }
Get skill
Get information about a skill.
Get information about a skill.
Get information about a skill.
Get information about a skill.
GET /v2/assistants/{assistant_id}/skills/{skill_id}
ServiceCall<Skill> getSkill(GetSkillOptions getSkillOptions)
getSkill(params)
get_skill(
self,
assistant_id: str,
skill_id: str,
**kwargs,
) -> DetailedResponse
Request
Use the GetSkillOptions.Builder
to create a GetSkillOptions
object that contains the parameter values for the getSkill
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Unique identifier of the skill. To find the action or dialog skill ID in the watsonx Assistant user interface, open the skill settings and click API Details. To find the search skill ID, use the Get environment API to retrieve the skill references for an environment and it will include the search skill info, if available.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.
The getSkill options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the skill. To find the skill ID in the watsonx Assistant user interface, open the skill settings and click API Details.
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the skill. To find the skill ID in the watsonx Assistant user interface, open the skill settings and click API Details.
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the skill. To find the skill ID in the watsonx Assistant user interface, open the skill settings and click API Details.
curl -X GET -u "apikey:{apikey}" "{url}/v2/assistants/{assistant_id}/skills/{skill_id}?version=2021-11-27"
curl -X GET --header "Authorization: Bearer {token}" "{url}/v2/assistants/{assistant_id}/skills/{skill_id}?version=2021-11-27"
Response
The skill ID of the skill.
The current status of the skill:
- Available: The skill is available and ready to process messages.
- Failed: An asynchronous operation has failed. See the status_errors property for more information about the cause of the failure.
- Non Existent: The skill does not exist.
- Processing: An asynchronous operation has not yet completed.
- Training: The skill is training based on new data.
Possible values: [
Available
,Failed
,Non Existent
,Processing
,Training
,Unavailable
]The unique identifier of the assistant the skill is associated with.
The language of the skill.
The type of skill.
Possible values: [
action
,dialog
,search
]The name of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
An object containing the conversational content of an action or dialog skill.
An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.The description of the failed asynchronous operation. Included only if status=
Failed
.For internal use only.
The unique identifier of the workspace that contains the skill content. Included only for action and dialog skills.
The unique identifier of the environment where the skill is defined. For action and dialog skills, this is always the draft environment.
Whether the skill is structurally valid.
The name that will be given to the next snapshot that is created for the skill. A snapshot of each versionable skill is saved for each new release of an assistant.
An object describing the search skill configuration.
Note: Search settings are not supported in Import skills requests, and are not included in Export skills responses.
An array of warnings describing errors with the search skill configuration. Included only for search skills.
The name of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
An object containing the conversational content of an action or dialog skill.
The skill ID of the skill.
The current status of the skill:
- Available: The skill is available and ready to process messages.
- Failed: An asynchronous operation has failed. See the status_errors property for more information about the cause of the failure.
- Non Existent: The skill does not exist.
- Processing: An asynchronous operation has not yet completed.
- Training: The skill is training based on new data.
Possible values: [
Available
,Failed
,Non Existent
,Processing
,Training
,Unavailable
]An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.- statusErrors
The text of the error message.
The description of the failed asynchronous operation. Included only if status=
Failed
.For internal use only.
The unique identifier of the assistant the skill is associated with.
The unique identifier of the workspace that contains the skill content. Included only for action and dialog skills.
The unique identifier of the environment where the skill is defined. For action and dialog skills, this is always the draft environment.
Whether the skill is structurally valid.
The name that will be given to the next snapshot that is created for the skill. A snapshot of each versionable skill is saved for each new release of an assistant.
An object describing the search skill configuration.
Note: Search settings are not supported in Import skills requests, and are not included in Export skills responses.
- searchSettings
Configuration settings for the Watson Discovery service instance used by the search integration.
- discovery
The ID for the Watson Discovery service instance.
Possible values: length ≤ 255
The ID for the Watson Discovery project.
Possible values: length ≤ 255
The URL for the Watson Discovery service instance.
Possible values: length ≤ 2048
The maximum number of primary results to include in the response.
Possible values: value ≤ 10000
The maximum total number of primary and additional results to include in the response.
Possible values: value ≤ 10000
The minimum confidence threshold for included results. Any results with a confidence below this threshold will be discarded.
Possible values: 0.0 ≤ value ≤ 1.0
Whether to include the most relevant passages of text in the highlight property of each result.
Whether to use the answer finding feature to emphasize answers within highlighted passages. This property is ignored if highlight=
false
.Notes:
- Answer finding is available only if the search skill is connected to a Discovery v2 service instance.
- Answer finding is not supported on IBM Cloud Pak for Data.
Authentication information for the Watson Discovery service. For more information, see the Watson Discovery documentation.
Note: You must specify either basic or bearer, but not both.
- authentication
The HTTP basic authentication credentials for Watson Discovery. Specify your Watson Discovery API key in the format
apikey:{apikey}
.Possible values: length ≤ 1024
The authentication bearer token for Watson Discovery.
Possible values: length ≤ 4096
The messages included with responses from the search integration.
- messages
The message to include in the response to a successful query.
Possible values: length ≤ 1024
The message to include in the response when the query encounters an error.
Possible values: length ≤ 1024
The message to include in the response when there is no result from the query.
Possible values: length ≤ 1024
The mapping between fields in the Watson Discovery collection and properties in the search response.
- schemaMapping
The field in the collection to map to the url property of the response.
Possible values: length ≤ 512
The field in the collection to map to the body property in the response.
Possible values: length ≤ 512
The field in the collection to map to the title property for the schema.
Possible values: length ≤ 512
An array of warnings describing errors with the search skill configuration. Included only for search skills.
- warnings
The error code.
The location of the error in the search skill configuration object.
The error message.
The language of the skill.
The type of skill.
Possible values: [
action
,dialog
,search
]
The name of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
An object containing the conversational content of an action or dialog skill.
The skill ID of the skill.
The current status of the skill:
- Available: The skill is available and ready to process messages.
- Failed: An asynchronous operation has failed. See the status_errors property for more information about the cause of the failure.
- Non Existent: The skill does not exist.
- Processing: An asynchronous operation has not yet completed.
- Training: The skill is training based on new data.
Possible values: [
Available
,Failed
,Non Existent
,Processing
,Training
,Unavailable
]An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.- status_errors
The text of the error message.
The description of the failed asynchronous operation. Included only if status=
Failed
.For internal use only.
The unique identifier of the assistant the skill is associated with.
The unique identifier of the workspace that contains the skill content. Included only for action and dialog skills.
The unique identifier of the environment where the skill is defined. For action and dialog skills, this is always the draft environment.
Whether the skill is structurally valid.
The name that will be given to the next snapshot that is created for the skill. A snapshot of each versionable skill is saved for each new release of an assistant.
An object describing the search skill configuration.
Note: Search settings are not supported in Import skills requests, and are not included in Export skills responses.
- search_settings
Configuration settings for the Watson Discovery service instance used by the search integration.
- discovery
The ID for the Watson Discovery service instance.
Possible values: length ≤ 255
The ID for the Watson Discovery project.
Possible values: length ≤ 255
The URL for the Watson Discovery service instance.
Possible values: length ≤ 2048
The maximum number of primary results to include in the response.
Possible values: value ≤ 10000
The maximum total number of primary and additional results to include in the response.
Possible values: value ≤ 10000
The minimum confidence threshold for included results. Any results with a confidence below this threshold will be discarded.
Possible values: 0.0 ≤ value ≤ 1.0
Whether to include the most relevant passages of text in the highlight property of each result.
Whether to use the answer finding feature to emphasize answers within highlighted passages. This property is ignored if highlight=
false
.Notes:
- Answer finding is available only if the search skill is connected to a Discovery v2 service instance.
- Answer finding is not supported on IBM Cloud Pak for Data.
Authentication information for the Watson Discovery service. For more information, see the Watson Discovery documentation.
Note: You must specify either basic or bearer, but not both.
- authentication
The HTTP basic authentication credentials for Watson Discovery. Specify your Watson Discovery API key in the format
apikey:{apikey}
.Possible values: length ≤ 1024
The authentication bearer token for Watson Discovery.
Possible values: length ≤ 4096
The messages included with responses from the search integration.
- messages
The message to include in the response to a successful query.
Possible values: length ≤ 1024
The message to include in the response when the query encounters an error.
Possible values: length ≤ 1024
The message to include in the response when there is no result from the query.
Possible values: length ≤ 1024
The mapping between fields in the Watson Discovery collection and properties in the search response.
- schema_mapping
The field in the collection to map to the url property of the response.
Possible values: length ≤ 512
The field in the collection to map to the body property in the response.
Possible values: length ≤ 512
The field in the collection to map to the title property for the schema.
Possible values: length ≤ 512
An array of warnings describing errors with the search skill configuration. Included only for search skills.
- warnings
The error code.
The location of the error in the search skill configuration object.
The error message.
The language of the skill.
The type of skill.
Possible values: [
action
,dialog
,search
]
The name of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
An object containing the conversational content of an action or dialog skill.
The skill ID of the skill.
The current status of the skill:
- Available: The skill is available and ready to process messages.
- Failed: An asynchronous operation has failed. See the status_errors property for more information about the cause of the failure.
- Non Existent: The skill does not exist.
- Processing: An asynchronous operation has not yet completed.
- Training: The skill is training based on new data.
Possible values: [
Available
,Failed
,Non Existent
,Processing
,Training
,Unavailable
]An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.- status_errors
The text of the error message.
The description of the failed asynchronous operation. Included only if status=
Failed
.For internal use only.
The unique identifier of the assistant the skill is associated with.
The unique identifier of the workspace that contains the skill content. Included only for action and dialog skills.
The unique identifier of the environment where the skill is defined. For action and dialog skills, this is always the draft environment.
Whether the skill is structurally valid.
The name that will be given to the next snapshot that is created for the skill. A snapshot of each versionable skill is saved for each new release of an assistant.
An object describing the search skill configuration.
Note: Search settings are not supported in Import skills requests, and are not included in Export skills responses.
- search_settings
Configuration settings for the Watson Discovery service instance used by the search integration.
- discovery
The ID for the Watson Discovery service instance.
Possible values: length ≤ 255
The ID for the Watson Discovery project.
Possible values: length ≤ 255
The URL for the Watson Discovery service instance.
Possible values: length ≤ 2048
The maximum number of primary results to include in the response.
Possible values: value ≤ 10000
The maximum total number of primary and additional results to include in the response.
Possible values: value ≤ 10000
The minimum confidence threshold for included results. Any results with a confidence below this threshold will be discarded.
Possible values: 0.0 ≤ value ≤ 1.0
Whether to include the most relevant passages of text in the highlight property of each result.
Whether to use the answer finding feature to emphasize answers within highlighted passages. This property is ignored if highlight=
false
.Notes:
- Answer finding is available only if the search skill is connected to a Discovery v2 service instance.
- Answer finding is not supported on IBM Cloud Pak for Data.
Authentication information for the Watson Discovery service. For more information, see the Watson Discovery documentation.
Note: You must specify either basic or bearer, but not both.
- authentication
The HTTP basic authentication credentials for Watson Discovery. Specify your Watson Discovery API key in the format
apikey:{apikey}
.Possible values: length ≤ 1024
The authentication bearer token for Watson Discovery.
Possible values: length ≤ 4096
The messages included with responses from the search integration.
- messages
The message to include in the response to a successful query.
Possible values: length ≤ 1024
The message to include in the response when the query encounters an error.
Possible values: length ≤ 1024
The message to include in the response when there is no result from the query.
Possible values: length ≤ 1024
The mapping between fields in the Watson Discovery collection and properties in the search response.
- schema_mapping
The field in the collection to map to the url property of the response.
Possible values: length ≤ 512
The field in the collection to map to the body property in the response.
Possible values: length ≤ 512
The field in the collection to map to the title property for the schema.
Possible values: length ≤ 512
An array of warnings describing errors with the search skill configuration. Included only for search skills.
- warnings
The error code.
The location of the error in the search skill configuration object.
The error message.
The language of the skill.
The type of skill.
Possible values: [
action
,dialog
,search
]
Status Code
Successful request.
Invalid request.
{ "name": "Test assistant", "type": "action", "valid": true, "status": "Available", "language": "en", "skill_id": "e5580233-c0c2-4a81-809d-7647ca02dbce", "description": "Test action skill", "assistant_id": "b352173e-51af-4fab-9948-d9d9054755bf", "workspace_id": "e5580233-c0c2-4a81-809d-7647ca02dbce", "dialog_settings": {}, "next_snapshot_version": "1", "environment_id": "2c682617-fa67-4d1f-a339-4bed5992dc87" }
{ "name": "Test assistant", "type": "action", "valid": true, "status": "Available", "language": "en", "skill_id": "e5580233-c0c2-4a81-809d-7647ca02dbce", "description": "Test action skill", "assistant_id": "b352173e-51af-4fab-9948-d9d9054755bf", "workspace_id": "e5580233-c0c2-4a81-809d-7647ca02dbce", "dialog_settings": {}, "next_snapshot_version": "1", "environment_id": "2c682617-fa67-4d1f-a339-4bed5992dc87" }
Update skill
Update a skill with new or modified data.
Note: The update is performed asynchronously; you can see the status of the update by calling the Get skill method and checking the value of the status property.
Update a skill with new or modified data.
Note: The update is performed asynchronously; you can see the status of the update by calling the Get skill method and checking the value of the status property.
Update a skill with new or modified data.
Note: The update is performed asynchronously; you can see the status of the update by calling the Get skill method and checking the value of the status property.
Update a skill with new or modified data.
Note: The update is performed asynchronously; you can see the status of the update by calling the Get skill method and checking the value of the status property.
POST /v2/assistants/{assistant_id}/skills/{skill_id}
ServiceCall<Skill> updateSkill(UpdateSkillOptions updateSkillOptions)
updateSkill(params)
update_skill(
self,
assistant_id: str,
skill_id: str,
*,
name: Optional[str] = None,
description: Optional[str] = None,
workspace: Optional[dict] = None,
dialog_settings: Optional[dict] = None,
search_settings: Optional['SearchSettings'] = None,
**kwargs,
) -> DetailedResponse
Request
Use the UpdateSkillOptions.Builder
to create a UpdateSkillOptions
object that contains the parameter values for the updateSkill
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Unique identifier of the skill. To find the action or dialog skill ID in the watsonx Assistant user interface, open the skill settings and click API Details. To find the search skill ID, use the Get environment API to retrieve the skill references for an environment and it will include the search skill info, if available.
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.
The updated properties of the skill.
The name of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
An object containing the conversational content of an action or dialog skill.
For internal use only.
An object describing the search skill configuration.
Note: Search settings are not supported in Import skills requests, and are not included in Export skills responses.
The updateSkill options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the skill. To find the skill ID in the watsonx Assistant user interface, open the skill settings and click API Details.
The name of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
An object containing the conversational content of an action or dialog skill.
For internal use only.
An object describing the search skill configuration.
Note: Search settings are not supported in Import skills requests, and are not included in Export skills responses.
- searchSettings
Configuration settings for the Watson Discovery service instance used by the search integration.
- discovery
The ID for the Watson Discovery service instance.
Possible values: length ≤ 255
The ID for the Watson Discovery project.
Possible values: length ≤ 255
The URL for the Watson Discovery service instance.
Possible values: length ≤ 2048
The maximum number of primary results to include in the response.
Possible values: value ≤ 10000
The maximum total number of primary and additional results to include in the response.
Possible values: value ≤ 10000
The minimum confidence threshold for included results. Any results with a confidence below this threshold will be discarded.
Possible values: 0.0 ≤ value ≤ 1.0
Whether to include the most relevant passages of text in the highlight property of each result.
Whether to use the answer finding feature to emphasize answers within highlighted passages. This property is ignored if highlight=
false
.Notes:
- Answer finding is available only if the search skill is connected to a Discovery v2 service instance.
- Answer finding is not supported on IBM Cloud Pak for Data.
Authentication information for the Watson Discovery service. For more information, see the Watson Discovery documentation.
Note: You must specify either basic or bearer, but not both.
- authentication
The HTTP basic authentication credentials for Watson Discovery. Specify your Watson Discovery API key in the format
apikey:{apikey}
.Possible values: length ≤ 1024
The authentication bearer token for Watson Discovery.
Possible values: length ≤ 4096
The messages included with responses from the search integration.
- messages
The message to include in the response to a successful query.
Possible values: length ≤ 1024
The message to include in the response when the query encounters an error.
Possible values: length ≤ 1024
The message to include in the response when there is no result from the query.
Possible values: length ≤ 1024
The mapping between fields in the Watson Discovery collection and properties in the search response.
- schemaMapping
The field in the collection to map to the url property of the response.
Possible values: length ≤ 512
The field in the collection to map to the body property in the response.
Possible values: length ≤ 512
The field in the collection to map to the title property for the schema.
Possible values: length ≤ 512
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the skill. To find the skill ID in the watsonx Assistant user interface, open the skill settings and click API Details.
The name of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
An object containing the conversational content of an action or dialog skill.
For internal use only.
An object describing the search skill configuration.
Note: Search settings are not supported in Import skills requests, and are not included in Export skills responses.
- searchSettings
Configuration settings for the Watson Discovery service instance used by the search integration.
- discovery
The ID for the Watson Discovery service instance.
Possible values: length ≤ 255
The ID for the Watson Discovery project.
Possible values: length ≤ 255
The URL for the Watson Discovery service instance.
Possible values: length ≤ 2048
The maximum number of primary results to include in the response.
Possible values: value ≤ 10000
The maximum total number of primary and additional results to include in the response.
Possible values: value ≤ 10000
The minimum confidence threshold for included results. Any results with a confidence below this threshold will be discarded.
Possible values: 0.0 ≤ value ≤ 1.0
Whether to include the most relevant passages of text in the highlight property of each result.
Whether to use the answer finding feature to emphasize answers within highlighted passages. This property is ignored if highlight=
false
.Notes:
- Answer finding is available only if the search skill is connected to a Discovery v2 service instance.
- Answer finding is not supported on IBM Cloud Pak for Data.
Authentication information for the Watson Discovery service. For more information, see the Watson Discovery documentation.
Note: You must specify either basic or bearer, but not both.
- authentication
The HTTP basic authentication credentials for Watson Discovery. Specify your Watson Discovery API key in the format
apikey:{apikey}
.Possible values: length ≤ 1024
The authentication bearer token for Watson Discovery.
Possible values: length ≤ 4096
The messages included with responses from the search integration.
- messages
The message to include in the response to a successful query.
Possible values: length ≤ 1024
The message to include in the response when the query encounters an error.
Possible values: length ≤ 1024
The message to include in the response when there is no result from the query.
Possible values: length ≤ 1024
The mapping between fields in the Watson Discovery collection and properties in the search response.
- schema_mapping
The field in the collection to map to the url property of the response.
Possible values: length ≤ 512
The field in the collection to map to the body property in the response.
Possible values: length ≤ 512
The field in the collection to map to the title property for the schema.
Possible values: length ≤ 512
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Unique identifier of the skill. To find the skill ID in the watsonx Assistant user interface, open the skill settings and click API Details.
The name of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
An object containing the conversational content of an action or dialog skill.
For internal use only.
An object describing the search skill configuration.
Note: Search settings are not supported in Import skills requests, and are not included in Export skills responses.
- search_settings
Configuration settings for the Watson Discovery service instance used by the search integration.
- discovery
The ID for the Watson Discovery service instance.
Possible values: length ≤ 255
The ID for the Watson Discovery project.
Possible values: length ≤ 255
The URL for the Watson Discovery service instance.
Possible values: length ≤ 2048
The maximum number of primary results to include in the response.
Possible values: value ≤ 10000
The maximum total number of primary and additional results to include in the response.
Possible values: value ≤ 10000
The minimum confidence threshold for included results. Any results with a confidence below this threshold will be discarded.
Possible values: 0.0 ≤ value ≤ 1.0
Whether to include the most relevant passages of text in the highlight property of each result.
Whether to use the answer finding feature to emphasize answers within highlighted passages. This property is ignored if highlight=
false
.Notes:
- Answer finding is available only if the search skill is connected to a Discovery v2 service instance.
- Answer finding is not supported on IBM Cloud Pak for Data.
Authentication information for the Watson Discovery service. For more information, see the Watson Discovery documentation.
Note: You must specify either basic or bearer, but not both.
- authentication
The HTTP basic authentication credentials for Watson Discovery. Specify your Watson Discovery API key in the format
apikey:{apikey}
.Possible values: length ≤ 1024
The authentication bearer token for Watson Discovery.
Possible values: length ≤ 4096
The messages included with responses from the search integration.
- messages
The message to include in the response to a successful query.
Possible values: length ≤ 1024
The message to include in the response when the query encounters an error.
Possible values: length ≤ 1024
The message to include in the response when there is no result from the query.
Possible values: length ≤ 1024
The mapping between fields in the Watson Discovery collection and properties in the search response.
- schema_mapping
The field in the collection to map to the url property of the response.
Possible values: length ≤ 512
The field in the collection to map to the body property in the response.
Possible values: length ≤ 512
The field in the collection to map to the title property for the schema.
Possible values: length ≤ 512
curl -X POST -u "apikey:{apikey}" --header "Content-Type: application/json" --data "{\"description\":\"Skill updated using API.\"}" "{url}/v2/assistants/{assistant_id}/skills/{skill_id}?version=2021-11-27"
curl -X POST --header "Authorization: Bearer {token}" --header "Content-Type: application/json" --data "{\"description\":\"Skill updated using API.\"}" "{url}/v2/assistants/{assistant_id}/skills/{skill_id}?version=2021-11-27"
Response
The skill ID of the skill.
The current status of the skill:
- Available: The skill is available and ready to process messages.
- Failed: An asynchronous operation has failed. See the status_errors property for more information about the cause of the failure.
- Non Existent: The skill does not exist.
- Processing: An asynchronous operation has not yet completed.
- Training: The skill is training based on new data.
Possible values: [
Available
,Failed
,Non Existent
,Processing
,Training
,Unavailable
]The unique identifier of the assistant the skill is associated with.
The language of the skill.
The type of skill.
Possible values: [
action
,dialog
,search
]The name of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
An object containing the conversational content of an action or dialog skill.
An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.The description of the failed asynchronous operation. Included only if status=
Failed
.For internal use only.
The unique identifier of the workspace that contains the skill content. Included only for action and dialog skills.
The unique identifier of the environment where the skill is defined. For action and dialog skills, this is always the draft environment.
Whether the skill is structurally valid.
The name that will be given to the next snapshot that is created for the skill. A snapshot of each versionable skill is saved for each new release of an assistant.
An object describing the search skill configuration.
Note: Search settings are not supported in Import skills requests, and are not included in Export skills responses.
An array of warnings describing errors with the search skill configuration. Included only for search skills.
The name of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
An object containing the conversational content of an action or dialog skill.
The skill ID of the skill.
The current status of the skill:
- Available: The skill is available and ready to process messages.
- Failed: An asynchronous operation has failed. See the status_errors property for more information about the cause of the failure.
- Non Existent: The skill does not exist.
- Processing: An asynchronous operation has not yet completed.
- Training: The skill is training based on new data.
Possible values: [
Available
,Failed
,Non Existent
,Processing
,Training
,Unavailable
]An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.- statusErrors
The text of the error message.
The description of the failed asynchronous operation. Included only if status=
Failed
.For internal use only.
The unique identifier of the assistant the skill is associated with.
The unique identifier of the workspace that contains the skill content. Included only for action and dialog skills.
The unique identifier of the environment where the skill is defined. For action and dialog skills, this is always the draft environment.
Whether the skill is structurally valid.
The name that will be given to the next snapshot that is created for the skill. A snapshot of each versionable skill is saved for each new release of an assistant.
An object describing the search skill configuration.
Note: Search settings are not supported in Import skills requests, and are not included in Export skills responses.
- searchSettings
Configuration settings for the Watson Discovery service instance used by the search integration.
- discovery
The ID for the Watson Discovery service instance.
Possible values: length ≤ 255
The ID for the Watson Discovery project.
Possible values: length ≤ 255
The URL for the Watson Discovery service instance.
Possible values: length ≤ 2048
The maximum number of primary results to include in the response.
Possible values: value ≤ 10000
The maximum total number of primary and additional results to include in the response.
Possible values: value ≤ 10000
The minimum confidence threshold for included results. Any results with a confidence below this threshold will be discarded.
Possible values: 0.0 ≤ value ≤ 1.0
Whether to include the most relevant passages of text in the highlight property of each result.
Whether to use the answer finding feature to emphasize answers within highlighted passages. This property is ignored if highlight=
false
.Notes:
- Answer finding is available only if the search skill is connected to a Discovery v2 service instance.
- Answer finding is not supported on IBM Cloud Pak for Data.
Authentication information for the Watson Discovery service. For more information, see the Watson Discovery documentation.
Note: You must specify either basic or bearer, but not both.
- authentication
The HTTP basic authentication credentials for Watson Discovery. Specify your Watson Discovery API key in the format
apikey:{apikey}
.Possible values: length ≤ 1024
The authentication bearer token for Watson Discovery.
Possible values: length ≤ 4096
The messages included with responses from the search integration.
- messages
The message to include in the response to a successful query.
Possible values: length ≤ 1024
The message to include in the response when the query encounters an error.
Possible values: length ≤ 1024
The message to include in the response when there is no result from the query.
Possible values: length ≤ 1024
The mapping between fields in the Watson Discovery collection and properties in the search response.
- schemaMapping
The field in the collection to map to the url property of the response.
Possible values: length ≤ 512
The field in the collection to map to the body property in the response.
Possible values: length ≤ 512
The field in the collection to map to the title property for the schema.
Possible values: length ≤ 512
An array of warnings describing errors with the search skill configuration. Included only for search skills.
- warnings
The error code.
The location of the error in the search skill configuration object.
The error message.
The language of the skill.
The type of skill.
Possible values: [
action
,dialog
,search
]
The name of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
An object containing the conversational content of an action or dialog skill.
The skill ID of the skill.
The current status of the skill:
- Available: The skill is available and ready to process messages.
- Failed: An asynchronous operation has failed. See the status_errors property for more information about the cause of the failure.
- Non Existent: The skill does not exist.
- Processing: An asynchronous operation has not yet completed.
- Training: The skill is training based on new data.
Possible values: [
Available
,Failed
,Non Existent
,Processing
,Training
,Unavailable
]An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.- status_errors
The text of the error message.
The description of the failed asynchronous operation. Included only if status=
Failed
.For internal use only.
The unique identifier of the assistant the skill is associated with.
The unique identifier of the workspace that contains the skill content. Included only for action and dialog skills.
The unique identifier of the environment where the skill is defined. For action and dialog skills, this is always the draft environment.
Whether the skill is structurally valid.
The name that will be given to the next snapshot that is created for the skill. A snapshot of each versionable skill is saved for each new release of an assistant.
An object describing the search skill configuration.
Note: Search settings are not supported in Import skills requests, and are not included in Export skills responses.
- search_settings
Configuration settings for the Watson Discovery service instance used by the search integration.
- discovery
The ID for the Watson Discovery service instance.
Possible values: length ≤ 255
The ID for the Watson Discovery project.
Possible values: length ≤ 255
The URL for the Watson Discovery service instance.
Possible values: length ≤ 2048
The maximum number of primary results to include in the response.
Possible values: value ≤ 10000
The maximum total number of primary and additional results to include in the response.
Possible values: value ≤ 10000
The minimum confidence threshold for included results. Any results with a confidence below this threshold will be discarded.
Possible values: 0.0 ≤ value ≤ 1.0
Whether to include the most relevant passages of text in the highlight property of each result.
Whether to use the answer finding feature to emphasize answers within highlighted passages. This property is ignored if highlight=
false
.Notes:
- Answer finding is available only if the search skill is connected to a Discovery v2 service instance.
- Answer finding is not supported on IBM Cloud Pak for Data.
Authentication information for the Watson Discovery service. For more information, see the Watson Discovery documentation.
Note: You must specify either basic or bearer, but not both.
- authentication
The HTTP basic authentication credentials for Watson Discovery. Specify your Watson Discovery API key in the format
apikey:{apikey}
.Possible values: length ≤ 1024
The authentication bearer token for Watson Discovery.
Possible values: length ≤ 4096
The messages included with responses from the search integration.
- messages
The message to include in the response to a successful query.
Possible values: length ≤ 1024
The message to include in the response when the query encounters an error.
Possible values: length ≤ 1024
The message to include in the response when there is no result from the query.
Possible values: length ≤ 1024
The mapping between fields in the Watson Discovery collection and properties in the search response.
- schema_mapping
The field in the collection to map to the url property of the response.
Possible values: length ≤ 512
The field in the collection to map to the body property in the response.
Possible values: length ≤ 512
The field in the collection to map to the title property for the schema.
Possible values: length ≤ 512
An array of warnings describing errors with the search skill configuration. Included only for search skills.
- warnings
The error code.
The location of the error in the search skill configuration object.
The error message.
The language of the skill.
The type of skill.
Possible values: [
action
,dialog
,search
]
The name of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
An object containing the conversational content of an action or dialog skill.
The skill ID of the skill.
The current status of the skill:
- Available: The skill is available and ready to process messages.
- Failed: An asynchronous operation has failed. See the status_errors property for more information about the cause of the failure.
- Non Existent: The skill does not exist.
- Processing: An asynchronous operation has not yet completed.
- Training: The skill is training based on new data.
Possible values: [
Available
,Failed
,Non Existent
,Processing
,Training
,Unavailable
]An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.- status_errors
The text of the error message.
The description of the failed asynchronous operation. Included only if status=
Failed
.For internal use only.
The unique identifier of the assistant the skill is associated with.
The unique identifier of the workspace that contains the skill content. Included only for action and dialog skills.
The unique identifier of the environment where the skill is defined. For action and dialog skills, this is always the draft environment.
Whether the skill is structurally valid.
The name that will be given to the next snapshot that is created for the skill. A snapshot of each versionable skill is saved for each new release of an assistant.
An object describing the search skill configuration.
Note: Search settings are not supported in Import skills requests, and are not included in Export skills responses.
- search_settings
Configuration settings for the Watson Discovery service instance used by the search integration.
- discovery
The ID for the Watson Discovery service instance.
Possible values: length ≤ 255
The ID for the Watson Discovery project.
Possible values: length ≤ 255
The URL for the Watson Discovery service instance.
Possible values: length ≤ 2048
The maximum number of primary results to include in the response.
Possible values: value ≤ 10000
The maximum total number of primary and additional results to include in the response.
Possible values: value ≤ 10000
The minimum confidence threshold for included results. Any results with a confidence below this threshold will be discarded.
Possible values: 0.0 ≤ value ≤ 1.0
Whether to include the most relevant passages of text in the highlight property of each result.
Whether to use the answer finding feature to emphasize answers within highlighted passages. This property is ignored if highlight=
false
.Notes:
- Answer finding is available only if the search skill is connected to a Discovery v2 service instance.
- Answer finding is not supported on IBM Cloud Pak for Data.
Authentication information for the Watson Discovery service. For more information, see the Watson Discovery documentation.
Note: You must specify either basic or bearer, but not both.
- authentication
The HTTP basic authentication credentials for Watson Discovery. Specify your Watson Discovery API key in the format
apikey:{apikey}
.Possible values: length ≤ 1024
The authentication bearer token for Watson Discovery.
Possible values: length ≤ 4096
The messages included with responses from the search integration.
- messages
The message to include in the response to a successful query.
Possible values: length ≤ 1024
The message to include in the response when the query encounters an error.
Possible values: length ≤ 1024
The message to include in the response when there is no result from the query.
Possible values: length ≤ 1024
The mapping between fields in the Watson Discovery collection and properties in the search response.
- schema_mapping
The field in the collection to map to the url property of the response.
Possible values: length ≤ 512
The field in the collection to map to the body property in the response.
Possible values: length ≤ 512
The field in the collection to map to the title property for the schema.
Possible values: length ≤ 512
An array of warnings describing errors with the search skill configuration. Included only for search skills.
- warnings
The error code.
The location of the error in the search skill configuration object.
The error message.
The language of the skill.
The type of skill.
Possible values: [
action
,dialog
,search
]
Status Code
Request to update skill has been accepted successfully.
Invalid request.
Async request accepted.
{ "status": "Processing", "skill_id": "202e1800-799f-49f9-8c29-14b595b30958", "assistant_id": "9ecf136d-0874-4939-8196-fd79df3b6936", "type": "dialog", "language": "en", "name": "Updated skill 2", "description": "created for assistant 9ecf136d-0874-4939-8196-fd79df3b6936" }
Async request accepted.
{ "status": "Processing", "skill_id": "202e1800-799f-49f9-8c29-14b595b30958", "assistant_id": "9ecf136d-0874-4939-8196-fd79df3b6936", "type": "dialog", "language": "en", "name": "Updated skill 2", "description": "created for assistant 9ecf136d-0874-4939-8196-fd79df3b6936" }
Export skills
Asynchronously export the action skill and dialog skill (if enabled) for the assistant. Use this method to save all skill data from the draft environment so that you can import it to a different assistant using the Import skills method. Use assistant_id
instead of environment_id
to call this endpoint.
A successful call to this method only initiates an asynchronous export. The exported JSON data is not available until processing completes.
After the initial request is submitted, you can poll the status of the operation by calling the same request again and checking the value of the status property. If an error occurs (indicated by a status value of Failed
), the status_description
property provides more information about the error, and the status_errors
property contains an array of error messages that caused the failure.
When processing has completed, the request returns the exported JSON data. Remember that the usual rate limits apply.
Asynchronously export the action skill and dialog skill (if enabled) for the assistant. Use this method to save all skill data so that you can import it to a different assistant using the Import skills method.
A successful call to this method only initiates an asynchronous export. The exported JSON data is not available until processing completes.
After the initial request is submitted, you can poll the status of the operation by calling the same request again and checking the value of the status property. If an error occurs (indicated by a status value of Failed
), the status_description
property provides more information about the error, and the status_errors
property contains an array of error messages that caused the failure.
When processing has completed, the request returns the exported JSON data. Remember that the usual rate limits apply.
Asynchronously export the action skill and dialog skill (if enabled) for the assistant. Use this method to save all skill data so that you can import it to a different assistant using the Import skills method.
A successful call to this method only initiates an asynchronous export. The exported JSON data is not available until processing completes.
After the initial request is submitted, you can poll the status of the operation by calling the same request again and checking the value of the status property. If an error occurs (indicated by a status value of Failed
), the status_description
property provides more information about the error, and the status_errors
property contains an array of error messages that caused the failure.
When processing has completed, the request returns the exported JSON data. Remember that the usual rate limits apply.
Asynchronously export the action skill and dialog skill (if enabled) for the assistant. Use this method to save all skill data so that you can import it to a different assistant using the Import skills method.
A successful call to this method only initiates an asynchronous export. The exported JSON data is not available until processing completes.
After the initial request is submitted, you can poll the status of the operation by calling the same request again and checking the value of the status property. If an error occurs (indicated by a status value of Failed
), the status_description
property provides more information about the error, and the status_errors
property contains an array of error messages that caused the failure.
When processing has completed, the request returns the exported JSON data. Remember that the usual rate limits apply.
GET /v2/assistants/{assistant_id}/skills_export
ServiceCall<SkillsExport> exportSkills(ExportSkillsOptions exportSkillsOptions)
exportSkills(params)
export_skills(
self,
assistant_id: str,
*,
include_audit: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
Request
Use the ExportSkillsOptions.Builder
to create a ExportSkillsOptions
object that contains the parameter values for the exportSkills
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
The exportSkills options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
curl -X GET -u "apikey:{apikey}" "{url}/v2/assistants/{assistant_id}/skills_export?version=2021-11-27"
curl -X GET --header "Authorization: Bearer {token}" "{url}/v2/assistants/{assistant_id}/skills_export?version=2021-11-27"
Response
An array of objects describing the skills for the assistant. Included in responses only if status=
Available
.Status information about the skills for the assistant. Included in responses only if status=
Available
.
An array of objects describing the skills for the assistant. Included in responses only if status=
Available
.- assistantSkills
The name of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
An object containing the conversational content of an action or dialog skill.
The skill ID of the skill.
The current status of the skill:
- Available: The skill is available and ready to process messages.
- Failed: An asynchronous operation has failed. See the status_errors property for more information about the cause of the failure.
- Non Existent: The skill does not exist.
- Processing: An asynchronous operation has not yet completed.
- Training: The skill is training based on new data.
Possible values: [
Available
,Failed
,Non Existent
,Processing
,Training
,Unavailable
]An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.- statusErrors
The text of the error message.
The description of the failed asynchronous operation. Included only if status=
Failed
.For internal use only.
The unique identifier of the assistant the skill is associated with.
The unique identifier of the workspace that contains the skill content. Included only for action and dialog skills.
The unique identifier of the environment where the skill is defined. For action and dialog skills, this is always the draft environment.
Whether the skill is structurally valid.
The name that will be given to the next snapshot that is created for the skill. A snapshot of each versionable skill is saved for each new release of an assistant.
An object describing the search skill configuration.
Note: Search settings are not supported in Import skills requests, and are not included in Export skills responses.
- searchSettings
Configuration settings for the Watson Discovery service instance used by the search integration.
- discovery
The ID for the Watson Discovery service instance.
Possible values: length ≤ 255
The ID for the Watson Discovery project.
Possible values: length ≤ 255
The URL for the Watson Discovery service instance.
Possible values: length ≤ 2048
The maximum number of primary results to include in the response.
Possible values: value ≤ 10000
The maximum total number of primary and additional results to include in the response.
Possible values: value ≤ 10000
The minimum confidence threshold for included results. Any results with a confidence below this threshold will be discarded.
Possible values: 0.0 ≤ value ≤ 1.0
Whether to include the most relevant passages of text in the highlight property of each result.
Whether to use the answer finding feature to emphasize answers within highlighted passages. This property is ignored if highlight=
false
.Notes:
- Answer finding is available only if the search skill is connected to a Discovery v2 service instance.
- Answer finding is not supported on IBM Cloud Pak for Data.
Authentication information for the Watson Discovery service. For more information, see the Watson Discovery documentation.
Note: You must specify either basic or bearer, but not both.
- authentication
The HTTP basic authentication credentials for Watson Discovery. Specify your Watson Discovery API key in the format
apikey:{apikey}
.Possible values: length ≤ 1024
The authentication bearer token for Watson Discovery.
Possible values: length ≤ 4096
The messages included with responses from the search integration.
- messages
The message to include in the response to a successful query.
Possible values: length ≤ 1024
The message to include in the response when the query encounters an error.
Possible values: length ≤ 1024
The message to include in the response when there is no result from the query.
Possible values: length ≤ 1024
The mapping between fields in the Watson Discovery collection and properties in the search response.
- schemaMapping
The field in the collection to map to the url property of the response.
Possible values: length ≤ 512
The field in the collection to map to the body property in the response.
Possible values: length ≤ 512
The field in the collection to map to the title property for the schema.
Possible values: length ≤ 512
An array of warnings describing errors with the search skill configuration. Included only for search skills.
- warnings
The error code.
The location of the error in the search skill configuration object.
The error message.
The language of the skill.
The type of skill.
Possible values: [
action
,dialog
,search
]
Status information about the skills for the assistant. Included in responses only if status=
Available
.- assistantState
Whether the action skill is disabled in the draft environment.
Whether the dialog skill is disabled in the draft environment.
An array of objects describing the skills for the assistant. Included in responses only if status=
Available
.- assistant_skills
The name of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
An object containing the conversational content of an action or dialog skill.
The skill ID of the skill.
The current status of the skill:
- Available: The skill is available and ready to process messages.
- Failed: An asynchronous operation has failed. See the status_errors property for more information about the cause of the failure.
- Non Existent: The skill does not exist.
- Processing: An asynchronous operation has not yet completed.
- Training: The skill is training based on new data.
Possible values: [
Available
,Failed
,Non Existent
,Processing
,Training
,Unavailable
]An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.- status_errors
The text of the error message.
The description of the failed asynchronous operation. Included only if status=
Failed
.For internal use only.
The unique identifier of the assistant the skill is associated with.
The unique identifier of the workspace that contains the skill content. Included only for action and dialog skills.
The unique identifier of the environment where the skill is defined. For action and dialog skills, this is always the draft environment.
Whether the skill is structurally valid.
The name that will be given to the next snapshot that is created for the skill. A snapshot of each versionable skill is saved for each new release of an assistant.
An object describing the search skill configuration.
Note: Search settings are not supported in Import skills requests, and are not included in Export skills responses.
- search_settings
Configuration settings for the Watson Discovery service instance used by the search integration.
- discovery
The ID for the Watson Discovery service instance.
Possible values: length ≤ 255
The ID for the Watson Discovery project.
Possible values: length ≤ 255
The URL for the Watson Discovery service instance.
Possible values: length ≤ 2048
The maximum number of primary results to include in the response.
Possible values: value ≤ 10000
The maximum total number of primary and additional results to include in the response.
Possible values: value ≤ 10000
The minimum confidence threshold for included results. Any results with a confidence below this threshold will be discarded.
Possible values: 0.0 ≤ value ≤ 1.0
Whether to include the most relevant passages of text in the highlight property of each result.
Whether to use the answer finding feature to emphasize answers within highlighted passages. This property is ignored if highlight=
false
.Notes:
- Answer finding is available only if the search skill is connected to a Discovery v2 service instance.
- Answer finding is not supported on IBM Cloud Pak for Data.
Authentication information for the Watson Discovery service. For more information, see the Watson Discovery documentation.
Note: You must specify either basic or bearer, but not both.
- authentication
The HTTP basic authentication credentials for Watson Discovery. Specify your Watson Discovery API key in the format
apikey:{apikey}
.Possible values: length ≤ 1024
The authentication bearer token for Watson Discovery.
Possible values: length ≤ 4096
The messages included with responses from the search integration.
- messages
The message to include in the response to a successful query.
Possible values: length ≤ 1024
The message to include in the response when the query encounters an error.
Possible values: length ≤ 1024
The message to include in the response when there is no result from the query.
Possible values: length ≤ 1024
The mapping between fields in the Watson Discovery collection and properties in the search response.
- schema_mapping
The field in the collection to map to the url property of the response.
Possible values: length ≤ 512
The field in the collection to map to the body property in the response.
Possible values: length ≤ 512
The field in the collection to map to the title property for the schema.
Possible values: length ≤ 512
An array of warnings describing errors with the search skill configuration. Included only for search skills.
- warnings
The error code.
The location of the error in the search skill configuration object.
The error message.
The language of the skill.
The type of skill.
Possible values: [
action
,dialog
,search
]
Status information about the skills for the assistant. Included in responses only if status=
Available
.- assistant_state
Whether the action skill is disabled in the draft environment.
Whether the dialog skill is disabled in the draft environment.
An array of objects describing the skills for the assistant. Included in responses only if status=
Available
.- assistant_skills
The name of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
An object containing the conversational content of an action or dialog skill.
The skill ID of the skill.
The current status of the skill:
- Available: The skill is available and ready to process messages.
- Failed: An asynchronous operation has failed. See the status_errors property for more information about the cause of the failure.
- Non Existent: The skill does not exist.
- Processing: An asynchronous operation has not yet completed.
- Training: The skill is training based on new data.
Possible values: [
Available
,Failed
,Non Existent
,Processing
,Training
,Unavailable
]An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.- status_errors
The text of the error message.
The description of the failed asynchronous operation. Included only if status=
Failed
.For internal use only.
The unique identifier of the assistant the skill is associated with.
The unique identifier of the workspace that contains the skill content. Included only for action and dialog skills.
The unique identifier of the environment where the skill is defined. For action and dialog skills, this is always the draft environment.
Whether the skill is structurally valid.
The name that will be given to the next snapshot that is created for the skill. A snapshot of each versionable skill is saved for each new release of an assistant.
An object describing the search skill configuration.
Note: Search settings are not supported in Import skills requests, and are not included in Export skills responses.
- search_settings
Configuration settings for the Watson Discovery service instance used by the search integration.
- discovery
The ID for the Watson Discovery service instance.
Possible values: length ≤ 255
The ID for the Watson Discovery project.
Possible values: length ≤ 255
The URL for the Watson Discovery service instance.
Possible values: length ≤ 2048
The maximum number of primary results to include in the response.
Possible values: value ≤ 10000
The maximum total number of primary and additional results to include in the response.
Possible values: value ≤ 10000
The minimum confidence threshold for included results. Any results with a confidence below this threshold will be discarded.
Possible values: 0.0 ≤ value ≤ 1.0
Whether to include the most relevant passages of text in the highlight property of each result.
Whether to use the answer finding feature to emphasize answers within highlighted passages. This property is ignored if highlight=
false
.Notes:
- Answer finding is available only if the search skill is connected to a Discovery v2 service instance.
- Answer finding is not supported on IBM Cloud Pak for Data.
Authentication information for the Watson Discovery service. For more information, see the Watson Discovery documentation.
Note: You must specify either basic or bearer, but not both.
- authentication
The HTTP basic authentication credentials for Watson Discovery. Specify your Watson Discovery API key in the format
apikey:{apikey}
.Possible values: length ≤ 1024
The authentication bearer token for Watson Discovery.
Possible values: length ≤ 4096
The messages included with responses from the search integration.
- messages
The message to include in the response to a successful query.
Possible values: length ≤ 1024
The message to include in the response when the query encounters an error.
Possible values: length ≤ 1024
The message to include in the response when there is no result from the query.
Possible values: length ≤ 1024
The mapping between fields in the Watson Discovery collection and properties in the search response.
- schema_mapping
The field in the collection to map to the url property of the response.
Possible values: length ≤ 512
The field in the collection to map to the body property in the response.
Possible values: length ≤ 512
The field in the collection to map to the title property for the schema.
Possible values: length ≤ 512
An array of warnings describing errors with the search skill configuration. Included only for search skills.
- warnings
The error code.
The location of the error in the search skill configuration object.
The error message.
The language of the skill.
The type of skill.
Possible values: [
action
,dialog
,search
]
Status information about the skills for the assistant. Included in responses only if status=
Available
.- assistant_state
Whether the action skill is disabled in the draft environment.
Whether the dialog skill is disabled in the draft environment.
Status Code
Request to export skills has completed successfully.
Request to export skills asynchronously has been accepted.
Invalid request.
Request to export skills has completed successfully. Skill content is included in the
workspace
property.{ "assistant_skills": [ { "name": "new assistant", "type": "action", "status": "Available", "language": "en", "skill_id": "e5580233-c0c2-4a81-809d-7647ca02dbce", "workspace": {}, "description": "Updated description", "dialog_settings": {} } ], "assistant_state": { "action_disabled": false } }
Request to export skills has completed successfully. Skill content is included in the
workspace
property.{ "assistant_skills": [ { "name": "new assistant", "type": "action", "status": "Available", "language": "en", "skill_id": "e5580233-c0c2-4a81-809d-7647ca02dbce", "workspace": {}, "description": "Updated description", "dialog_settings": {} } ], "assistant_state": { "action_disabled": false } }
Request to export skills asynchronously has been accepted.
{ "assistant_id": "092524de-d3ce-468b-abf2-9f1f70f599ac", "status": "Processing" }
Request to export skills asynchronously has been accepted.
{ "assistant_id": "092524de-d3ce-468b-abf2-9f1f70f599ac", "status": "Processing" }
Import skills
Asynchronously import skills into an existing assistant from a previously exported file. This method only imports assistants into a draft environment. Use assistant_id
instead of environment_id
to call this endpoint.
The request body for this method should contain the response data that was received from a previous call to the Export skills method, without modification.
A successful call to this method initiates an asynchronous import. The updated skills belonging to the assistant are not available until processing completes. To check the status of the asynchronous import operation, use the Get status of skills import method.
Asynchronously import skills into an existing assistant from a previously exported file.
The request body for this method should contain the response data that was received from a previous call to the Export skills method, without modification.
A successful call to this method initiates an asynchronous import. The updated skills belonging to the assistant are not available until processing completes. To check the status of the asynchronous import operation, use the Get status of skills import method.
Asynchronously import skills into an existing assistant from a previously exported file.
The request body for this method should contain the response data that was received from a previous call to the Export skills method, without modification.
A successful call to this method initiates an asynchronous import. The updated skills belonging to the assistant are not available until processing completes. To check the status of the asynchronous import operation, use the Get status of skills import method.
Asynchronously import skills into an existing assistant from a previously exported file.
The request body for this method should contain the response data that was received from a previous call to the Export skills method, without modification.
A successful call to this method initiates an asynchronous import. The updated skills belonging to the assistant are not available until processing completes. To check the status of the asynchronous import operation, use the Get status of skills import method.
POST /v2/assistants/{assistant_id}/skills_import
ServiceCall<SkillsAsyncRequestStatus> importSkills(ImportSkillsOptions importSkillsOptions)
importSkills(params)
import_skills(
self,
assistant_id: str,
assistant_skills: List['SkillImport'],
assistant_state: 'AssistantState',
*,
include_audit: Optional[bool] = None,
**kwargs,
) -> DetailedResponse
Request
Use the ImportSkillsOptions.Builder
to create a ImportSkillsOptions
object that contains the parameter values for the importSkills
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
An input object that contains the skills to import.
An array of objects describing the skills for the assistant. Included in responses only if status=
Available
.Status information about the skills for the assistant. Included in responses only if status=
Available
.
The importSkills options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
An array of objects describing the skills for the assistant. Included in responses only if status=
Available
.- assistantSkills
The name of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
An object containing the conversational content of an action or dialog skill.
For internal use only.
An object describing the search skill configuration.
Note: Search settings are not supported in Import skills requests, and are not included in Export skills responses.
- searchSettings
Configuration settings for the Watson Discovery service instance used by the search integration.
- discovery
The ID for the Watson Discovery service instance.
Possible values: length ≤ 255
The ID for the Watson Discovery project.
Possible values: length ≤ 255
The URL for the Watson Discovery service instance.
Possible values: length ≤ 2048
The maximum number of primary results to include in the response.
Possible values: value ≤ 10000
The maximum total number of primary and additional results to include in the response.
Possible values: value ≤ 10000
The minimum confidence threshold for included results. Any results with a confidence below this threshold will be discarded.
Possible values: 0.0 ≤ value ≤ 1.0
Whether to include the most relevant passages of text in the highlight property of each result.
Whether to use the answer finding feature to emphasize answers within highlighted passages. This property is ignored if highlight=
false
.Notes:
- Answer finding is available only if the search skill is connected to a Discovery v2 service instance.
- Answer finding is not supported on IBM Cloud Pak for Data.
Authentication information for the Watson Discovery service. For more information, see the Watson Discovery documentation.
Note: You must specify either basic or bearer, but not both.
- authentication
The HTTP basic authentication credentials for Watson Discovery. Specify your Watson Discovery API key in the format
apikey:{apikey}
.Possible values: length ≤ 1024
The authentication bearer token for Watson Discovery.
Possible values: length ≤ 4096
The messages included with responses from the search integration.
- messages
The message to include in the response to a successful query.
Possible values: length ≤ 1024
The message to include in the response when the query encounters an error.
Possible values: length ≤ 1024
The message to include in the response when there is no result from the query.
Possible values: length ≤ 1024
The mapping between fields in the Watson Discovery collection and properties in the search response.
- schemaMapping
The field in the collection to map to the url property of the response.
Possible values: length ≤ 512
The field in the collection to map to the body property in the response.
Possible values: length ≤ 512
The field in the collection to map to the title property for the schema.
Possible values: length ≤ 512
The language of the skill.
The type of skill.
Allowable values: [
action
,dialog
]
Status information about the skills for the assistant. Included in responses only if status=
Available
.- assistantState
Whether the action skill is disabled in the draft environment.
Whether the dialog skill is disabled in the draft environment.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
An array of objects describing the skills for the assistant. Included in responses only if status=
Available
.- assistantSkills
The name of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
An object containing the conversational content of an action or dialog skill.
For internal use only.
An object describing the search skill configuration.
Note: Search settings are not supported in Import skills requests, and are not included in Export skills responses.
- search_settings
Configuration settings for the Watson Discovery service instance used by the search integration.
- discovery
The ID for the Watson Discovery service instance.
Possible values: length ≤ 255
The ID for the Watson Discovery project.
Possible values: length ≤ 255
The URL for the Watson Discovery service instance.
Possible values: length ≤ 2048
The maximum number of primary results to include in the response.
Possible values: value ≤ 10000
The maximum total number of primary and additional results to include in the response.
Possible values: value ≤ 10000
The minimum confidence threshold for included results. Any results with a confidence below this threshold will be discarded.
Possible values: 0.0 ≤ value ≤ 1.0
Whether to include the most relevant passages of text in the highlight property of each result.
Whether to use the answer finding feature to emphasize answers within highlighted passages. This property is ignored if highlight=
false
.Notes:
- Answer finding is available only if the search skill is connected to a Discovery v2 service instance.
- Answer finding is not supported on IBM Cloud Pak for Data.
Authentication information for the Watson Discovery service. For more information, see the Watson Discovery documentation.
Note: You must specify either basic or bearer, but not both.
- authentication
The HTTP basic authentication credentials for Watson Discovery. Specify your Watson Discovery API key in the format
apikey:{apikey}
.Possible values: length ≤ 1024
The authentication bearer token for Watson Discovery.
Possible values: length ≤ 4096
The messages included with responses from the search integration.
- messages
The message to include in the response to a successful query.
Possible values: length ≤ 1024
The message to include in the response when the query encounters an error.
Possible values: length ≤ 1024
The message to include in the response when there is no result from the query.
Possible values: length ≤ 1024
The mapping between fields in the Watson Discovery collection and properties in the search response.
- schema_mapping
The field in the collection to map to the url property of the response.
Possible values: length ≤ 512
The field in the collection to map to the body property in the response.
Possible values: length ≤ 512
The field in the collection to map to the title property for the schema.
Possible values: length ≤ 512
The language of the skill.
The type of skill.
Allowable values: [
action
,dialog
]
Status information about the skills for the assistant. Included in responses only if status=
Available
.- assistantState
Whether the action skill is disabled in the draft environment.
Whether the dialog skill is disabled in the draft environment.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
An array of objects describing the skills for the assistant. Included in responses only if status=
Available
.- assistant_skills
The name of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 64
The description of the skill. This string cannot contain carriage return, newline, or tab characters.
Possible values: 1 ≤ length ≤ 128
An object containing the conversational content of an action or dialog skill.
For internal use only.
An object describing the search skill configuration.
Note: Search settings are not supported in Import skills requests, and are not included in Export skills responses.
- search_settings
Configuration settings for the Watson Discovery service instance used by the search integration.
- discovery
The ID for the Watson Discovery service instance.
Possible values: length ≤ 255
The ID for the Watson Discovery project.
Possible values: length ≤ 255
The URL for the Watson Discovery service instance.
Possible values: length ≤ 2048
The maximum number of primary results to include in the response.
Possible values: value ≤ 10000
The maximum total number of primary and additional results to include in the response.
Possible values: value ≤ 10000
The minimum confidence threshold for included results. Any results with a confidence below this threshold will be discarded.
Possible values: 0.0 ≤ value ≤ 1.0
Whether to include the most relevant passages of text in the highlight property of each result.
Whether to use the answer finding feature to emphasize answers within highlighted passages. This property is ignored if highlight=
false
.Notes:
- Answer finding is available only if the search skill is connected to a Discovery v2 service instance.
- Answer finding is not supported on IBM Cloud Pak for Data.
Authentication information for the Watson Discovery service. For more information, see the Watson Discovery documentation.
Note: You must specify either basic or bearer, but not both.
- authentication
The HTTP basic authentication credentials for Watson Discovery. Specify your Watson Discovery API key in the format
apikey:{apikey}
.Possible values: length ≤ 1024
The authentication bearer token for Watson Discovery.
Possible values: length ≤ 4096
The messages included with responses from the search integration.
- messages
The message to include in the response to a successful query.
Possible values: length ≤ 1024
The message to include in the response when the query encounters an error.
Possible values: length ≤ 1024
The message to include in the response when there is no result from the query.
Possible values: length ≤ 1024
The mapping between fields in the Watson Discovery collection and properties in the search response.
- schema_mapping
The field in the collection to map to the url property of the response.
Possible values: length ≤ 512
The field in the collection to map to the body property in the response.
Possible values: length ≤ 512
The field in the collection to map to the title property for the schema.
Possible values: length ≤ 512
The language of the skill.
The type of skill.
Allowable values: [
action
,dialog
]
Status information about the skills for the assistant. Included in responses only if status=
Available
.- assistant_state
Whether the action skill is disabled in the draft environment.
Whether the dialog skill is disabled in the draft environment.
Whether to include the audit properties (
created
andupdated
timestamps) in the response.Default:
false
curl -X POST -u "apikey:{apikey}" --header "Content-Type: application/json" --data "@./skills.json" "{url}/v2/assistants/{assistant_id}/skills_import?version=2021-11-27"
curl -X POST --header "Authorization: Bearer {token}" --header "Content-Type: application/json" --data "@./skills.json" "{url}/v2/assistants/{assistant_id}/skills_import?version=2021-11-27"
Response
The assistant ID of the assistant.
The current status of the asynchronous operation:
Available
: An asynchronous export is available.Completed
: An asynchronous import operation has completed successfully.Failed
: An asynchronous operation has failed. See the status_errors property for more information about the cause of the failure.Processing
: An asynchronous operation has not yet completed.
Possible values: [
Available
,Completed
,Failed
,Processing
]The description of the failed asynchronous operation. Included only if status=
Failed
.An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.
The assistant ID of the assistant.
The current status of the asynchronous operation:
Available
: An asynchronous export is available.Completed
: An asynchronous import operation has completed successfully.Failed
: An asynchronous operation has failed. See the status_errors property for more information about the cause of the failure.Processing
: An asynchronous operation has not yet completed.
Possible values: [
Available
,Completed
,Failed
,Processing
]The description of the failed asynchronous operation. Included only if status=
Failed
.An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.- statusErrors
The text of the error message.
The assistant ID of the assistant.
The current status of the asynchronous operation:
Available
: An asynchronous export is available.Completed
: An asynchronous import operation has completed successfully.Failed
: An asynchronous operation has failed. See the status_errors property for more information about the cause of the failure.Processing
: An asynchronous operation has not yet completed.
Possible values: [
Available
,Completed
,Failed
,Processing
]The description of the failed asynchronous operation. Included only if status=
Failed
.An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.- status_errors
The text of the error message.
The assistant ID of the assistant.
The current status of the asynchronous operation:
Available
: An asynchronous export is available.Completed
: An asynchronous import operation has completed successfully.Failed
: An asynchronous operation has failed. See the status_errors property for more information about the cause of the failure.Processing
: An asynchronous operation has not yet completed.
Possible values: [
Available
,Completed
,Failed
,Processing
]The description of the failed asynchronous operation. Included only if status=
Failed
.An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.- status_errors
The text of the error message.
Status Code
Request to import skills has been accepted successfully.
Invalid request.
Successful request.
{ "assistant_id": "092524de-d3ce-468b-abf2-9f1f70f599ac", "status": "Processing" }
Successful request.
{ "assistant_id": "092524de-d3ce-468b-abf2-9f1f70f599ac", "status": "Processing" }
Get status of skills import
Retrieve the status of an asynchronous import operation previously initiated by using the Import skills method.
Retrieve the status of an asynchronous import operation previously initiated by using the Import skills method.
Retrieve the status of an asynchronous import operation previously initiated by using the Import skills method.
Retrieve the status of an asynchronous import operation previously initiated by using the Import skills method.
GET /v2/assistants/{assistant_id}/skills_import/status
ServiceCall<SkillsAsyncRequestStatus> importSkillsStatus(ImportSkillsStatusOptions importSkillsStatusOptions)
importSkillsStatus(params)
import_skills_status(
self,
assistant_id: str,
**kwargs,
) -> DetailedResponse
Request
Use the ImportSkillsStatusOptions.Builder
to create a ImportSkillsStatusOptions
object that contains the parameter values for the importSkillsStatus
method.
Path Parameters
The assistant ID or the environment ID of the environment where the assistant is deployed. Set the value for this ID depending on the type of request:
-
For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
-
For all other requests, specify the assistant ID of the assistant.
To get the assistant ID and environment ID in the watsonx Assistant interface, open the Assistant settings page, and scroll to the Assistant IDs and API details section and click View Details.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID.
To find the assistant ID in the user interface, open the Assistant settings and click API Details.
-
Query Parameters
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2024-08-25
.
The importSkillsStatus options.
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
parameters
The assistant ID or the environment ID of the environment where the assistant is deployed, depending on the type of request:
- For message, session, and log requests, specify the environment ID of the environment where the assistant is deployed.
- For all other requests, specify the assistant ID of the assistant.
To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings and scroll to the Environments section.
Note: If you are using the classic Watson Assistant experience, always use the assistant ID. To find the assistant ID in the user interface, open the assistant settings and click API Details.
curl -X GET -u "apikey:{apikey}" "{url}/v2/assistants/{assistant_id}/skills_import/status?version=2021-11-27"
curl -X GET --header "Authorization: Bearer {token}" "{url}/v2/assistants/{assistant_id}/skills_import/status?version=2021-11-27"
Response
The assistant ID of the assistant.
The current status of the asynchronous operation:
Available
: An asynchronous export is available.Completed
: An asynchronous import operation has completed successfully.Failed
: An asynchronous operation has failed. See the status_errors property for more information about the cause of the failure.Processing
: An asynchronous operation has not yet completed.
Possible values: [
Available
,Completed
,Failed
,Processing
]The description of the failed asynchronous operation. Included only if status=
Failed
.An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.
The assistant ID of the assistant.
The current status of the asynchronous operation:
Available
: An asynchronous export is available.Completed
: An asynchronous import operation has completed successfully.Failed
: An asynchronous operation has failed. See the status_errors property for more information about the cause of the failure.Processing
: An asynchronous operation has not yet completed.
Possible values: [
Available
,Completed
,Failed
,Processing
]The description of the failed asynchronous operation. Included only if status=
Failed
.An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.- statusErrors
The text of the error message.
The assistant ID of the assistant.
The current status of the asynchronous operation:
Available
: An asynchronous export is available.Completed
: An asynchronous import operation has completed successfully.Failed
: An asynchronous operation has failed. See the status_errors property for more information about the cause of the failure.Processing
: An asynchronous operation has not yet completed.
Possible values: [
Available
,Completed
,Failed
,Processing
]The description of the failed asynchronous operation. Included only if status=
Failed
.An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.- status_errors
The text of the error message.
The assistant ID of the assistant.
The current status of the asynchronous operation:
Available
: An asynchronous export is available.Completed
: An asynchronous import operation has completed successfully.Failed
: An asynchronous operation has failed. See the status_errors property for more information about the cause of the failure.Processing
: An asynchronous operation has not yet completed.
Possible values: [
Available
,Completed
,Failed
,Processing
]The description of the failed asynchronous operation. Included only if status=
Failed
.An array of messages about errors that caused an asynchronous operation to fail. Included only if status=
Failed
.- status_errors
The text of the error message.
Status Code
Successful request.
Invalid request.
Successful request.
{ "status": "Processing", "assistant_id": "294c910d-6055-436d-8c68-c339fbf82efa" }
Successful request.
{ "status": "Processing", "assistant_id": "294c910d-6055-436d-8c68-c339fbf82efa" }