Class Assistant
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
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_SERVICE_NAME
static String
DEFAULT_SERVICE_URL
Fields inherited from class com.ibm.cloud.sdk.core.service.BaseService
PROPNAME_DISABLE_SSL, PROPNAME_ENABLE_GZIP, PROPNAME_URL
-
Constructor Summary
Constructors Constructor 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. -
Method Summary
Modifier and Type Method 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.Methods inherited from class com.ibm.cloud.sdk.core.service.BaseService
configureClient, configureService, constructServiceUrl, constructServiceURL, enableGzipCompression, getAuthenticator, getClient, getEndPoint, getName, getServiceUrl, isJsonMimeType, isJsonPatchMimeType, setClient, setDefaultHeaders, setEndPoint, setServiceUrl, toString
-
Field Details
-
DEFAULT_SERVICE_NAME
- See Also:
- Constant Field Values
-
DEFAULT_SERVICE_URL
- See Also:
- Constant Field Values
-
-
Constructor Details
-
Assistant
Constructs an instance of the `Assistant` client. The default service name is used to configure the client instance.- Parameters:
version
- Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is `2021-06-14`.
-
Assistant
Constructs an instance of the `Assistant` client. The default service name and specified authenticator are used to configure the client instance.- Parameters:
version
- Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is `2021-06-14`.authenticator
- theAuthenticator
instance to be configured for this client
-
Assistant
Constructs an instance of the `Assistant` client. The specified service name is used to configure the client instance.- Parameters:
version
- Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is `2021-06-14`.serviceName
- the service name to be used when configuring the client instance
-
Assistant
public Assistant(String version, String serviceName, com.ibm.cloud.sdk.core.security.Authenticator authenticator)Constructs an instance of the `Assistant` client. The specified service name and authenticator are used to configure the client instance.- Parameters:
version
- Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is `2021-06-14`.serviceName
- the service name to be used when configuring the client instanceauthenticator
- theAuthenticator
instance to be configured for this client
-
-
Method Details
-
getVersion
Gets the version.Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is `2021-06-14`.
- Returns:
- the version
-
setVersion
Sets the version.- Parameters:
version
- the new version
-
createSession
public com.ibm.cloud.sdk.core.http.ServiceCall<SessionResponse> createSession(CreateSessionOptions createSessionOptions)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](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-settings).
- Parameters:
createSessionOptions
- theCreateSessionOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeSessionResponse
-
deleteSession
public com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteSession(DeleteSessionOptions deleteSessionOptions)Delete session.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)).
- Parameters:
deleteSessionOptions
- theDeleteSessionOptions
containing the options for the call- Returns:
- a
ServiceCall
with a void result
-
message
public com.ibm.cloud.sdk.core.http.ServiceCall<MessageResponse> message(MessageOptions messageOptions)Send user input to assistant (stateful).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.
- Parameters:
messageOptions
- theMessageOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeMessageResponse
-
messageStateless
public com.ibm.cloud.sdk.core.http.ServiceCall<MessageResponseStateless> messageStateless(MessageStatelessOptions messageStatelessOptions)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.
- Parameters:
messageStatelessOptions
- theMessageStatelessOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeMessageResponseStateless
-
bulkClassify
public com.ibm.cloud.sdk.core.http.ServiceCall<BulkClassifyResponse> bulkClassify(BulkClassifyOptions bulkClassifyOptions)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.
- Parameters:
bulkClassifyOptions
- theBulkClassifyOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeBulkClassifyResponse
-
listLogs
public com.ibm.cloud.sdk.core.http.ServiceCall<LogCollection> listLogs(ListLogsOptions listLogsOptions)List log events for an assistant.List the events from the log of an assistant.
This method requires Manager access, and is available only with Enterprise plans.
- Parameters:
listLogsOptions
- theListLogsOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeLogCollection
-
deleteUserData
public com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteUserData(DeleteUserDataOptions deleteUserDataOptions)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](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).
- Parameters:
deleteUserDataOptions
- theDeleteUserDataOptions
containing the options for the call- Returns:
- a
ServiceCall
with a void result
-