public class Assistant
extends com.ibm.cloud.sdk.core.service.BaseService
The Assistant v2 API provides runtime methods your client application can use to send user input to an assistant and receive a response.
API Version: 2.0 See: https://cloud.ibm.com/docs/assistant
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_SERVICE_NAME |
static String |
DEFAULT_SERVICE_URL |
| Constructor and Description |
|---|
Assistant(String version)
Constructs an instance of the `Assistant` client.
|
Assistant(String version,
com.ibm.cloud.sdk.core.security.Authenticator authenticator)
Constructs an instance of the `Assistant` client.
|
Assistant(String version,
String serviceName)
Constructs an instance of the `Assistant` client.
|
Assistant(String version,
String serviceName,
com.ibm.cloud.sdk.core.security.Authenticator authenticator)
Constructs an instance of the `Assistant` client.
|
| Modifier and Type | Method and Description |
|---|---|
com.ibm.cloud.sdk.core.http.ServiceCall<BulkClassifyResponse> |
bulkClassify(BulkClassifyOptions bulkClassifyOptions)
Identify intents and entities in multiple user utterances.
|
com.ibm.cloud.sdk.core.http.ServiceCall<SessionResponse> |
createSession(CreateSessionOptions createSessionOptions)
Create a session.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Void> |
deleteSession(DeleteSessionOptions deleteSessionOptions)
Delete session.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Void> |
deleteUserData(DeleteUserDataOptions deleteUserDataOptions)
Delete labeled data.
|
String |
getVersion()
Gets the version.
|
com.ibm.cloud.sdk.core.http.ServiceCall<LogCollection> |
listLogs(ListLogsOptions listLogsOptions)
List log events for an assistant.
|
com.ibm.cloud.sdk.core.http.ServiceCall<MessageResponse> |
message(MessageOptions messageOptions)
Send user input to assistant (stateful).
|
com.ibm.cloud.sdk.core.http.ServiceCall<MessageResponseStateless> |
messageStateless(MessageStatelessOptions messageStatelessOptions)
Send user input to assistant (stateless).
|
void |
setVersion(String version)
Sets the version.
|
configureClient, configureService, constructServiceUrl, constructServiceURL, disableRetries, enableGzipCompression, enableRetries, getAuthenticator, getClient, getEndPoint, getName, getServiceUrl, isJsonMimeType, isJsonPatchMimeType, setClient, setDefaultHeaders, setEndPoint, setServiceUrl, toStringpublic static final String DEFAULT_SERVICE_NAME
public static final String DEFAULT_SERVICE_URL
public Assistant(String version)
version - Release date of the API version you want to use. Specify dates in YYYY-MM-DD
format. The current version is `2021-11-27`.public Assistant(String version, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
version - Release date of the API version you want to use. Specify dates in YYYY-MM-DD
format. The current version is `2021-11-27`.authenticator - the Authenticator instance to be configured for this clientpublic Assistant(String version, String serviceName)
version - Release date of the API version you want to use. Specify dates in YYYY-MM-DD
format. The current version is `2021-11-27`.serviceName - the service name to be used when configuring the client instancepublic Assistant(String version, String serviceName, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
version - Release date of the API version you want to use. Specify dates in YYYY-MM-DD
format. The current version is `2021-11-27`.serviceName - the service name to be used when configuring the client instanceauthenticator - the Authenticator instance to be configured for this clientpublic String getVersion()
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is `2021-11-27`.
public void setVersion(String version)
version - the new versionpublic com.ibm.cloud.sdk.core.http.ServiceCall<SessionResponse> createSession(CreateSessionOptions createSessionOptions)
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](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-settings).
createSessionOptions - the CreateSessionOptions containing the options for the
callServiceCall with a result of type SessionResponsepublic com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteSession(DeleteSessionOptions deleteSessionOptions)
Deletes a session explicitly before it times out. (For more information about the session inactivity timeout, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-settings)).
deleteSessionOptions - the DeleteSessionOptions containing the options for the
callServiceCall with a void resultpublic com.ibm.cloud.sdk.core.http.ServiceCall<MessageResponse> message(MessageOptions messageOptions)
Send user input to an assistant and receive a response, with conversation state (including context data) stored by Watson Assistant for the duration of the session.
messageOptions - the MessageOptions containing the options for the callServiceCall with a result of type MessageResponsepublic com.ibm.cloud.sdk.core.http.ServiceCall<MessageResponseStateless> messageStateless(MessageStatelessOptions messageStatelessOptions)
Send user input to an assistant and receive a response, with conversation state (including context data) managed by your application.
messageStatelessOptions - the MessageStatelessOptions containing the options for
the callServiceCall with a result of type MessageResponseStatelesspublic com.ibm.cloud.sdk.core.http.ServiceCall<BulkClassifyResponse> bulkClassify(BulkClassifyOptions bulkClassifyOptions)
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.
bulkClassifyOptions - the BulkClassifyOptions containing the options for the callServiceCall with a result of type BulkClassifyResponsepublic com.ibm.cloud.sdk.core.http.ServiceCall<LogCollection> listLogs(ListLogsOptions listLogsOptions)
List the events from the log of an assistant.
This method requires Manager access, and is available only with Enterprise plans.
listLogsOptions - the ListLogsOptions containing the options for the callServiceCall with a result of type LogCollectionpublic com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteUserData(DeleteUserDataOptions deleteUserDataOptions)
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](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#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 Watson Assistant](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security-gdpr-wa).
deleteUserDataOptions - the DeleteUserDataOptions containing the options for the
callServiceCall with a void resultCopyright © 2022 IBM Cloud. All rights reserved.