Class Assistant

java.lang.Object
com.ibm.cloud.sdk.core.service.BaseService
com.ibm.watson.assistant.v2.Assistant

public class Assistant
extends com.ibm.cloud.sdk.core.service.BaseService
The IBM Watson™ 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.

Version:
v2
See Also:
Assistant
  • Field Details

  • Constructor Details

    • Assistant

      public Assistant​(String version)
      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 `2020-09-24`.
    • Assistant

      public Assistant​(String version, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
      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 `2020-09-24`.
      authenticator - the Authenticator instance to be configured for this client
    • Assistant

      public Assistant​(String version, String serviceName)
      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 `2020-09-24`.
      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 `2020-09-24`.
      serviceName - the service name to be used when configuring the client instance
      authenticator - the Authenticator instance to be configured for this client
  • Method Details

    • getVersion

      public String 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 `2020-09-24`.

      Returns:
      the version
    • setVersion

      public void setVersion​(String version)
      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 - the CreateSessionOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type SessionResponse
    • 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 - the DeleteSessionOptions 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 - the MessageOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type MessageResponse
    • 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 - the MessageStatelessOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type MessageResponseStateless
    • 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 - the BulkClassifyOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type BulkClassifyResponse
    • 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 - the ListLogsOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type LogCollection
    • 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 - the DeleteUserDataOptions containing the options for the call
      Returns:
      a ServiceCall with a void result