JavaScript is disabled on your browser.
Skip navigation links
com.ibm.watson.assistant.v2

Class 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.

    See Also:
    Assistant
    • Field Summary

      Fields
      Modifier and Type Field and Description
      static java.lang.String DEFAULT_SERVICE_NAME
      static java.lang.String DEFAULT_SERVICE_URL
      • Fields inherited from class com.ibm.cloud.sdk.core.service.BaseService

        JSON_MIME_PATTERN, JSON_PATCH_MIME_PATTERN, PROPNAME_DISABLE_SSL, PROPNAME_ENABLE_GZIP, PROPNAME_URL
    • Constructor Summary

      Constructors
      Constructor and Description
      Assistant (java.lang.String version)
      Constructs an instance of the `Assistant` client.
      Assistant (java.lang.String version, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
      Constructs an instance of the `Assistant` client.
      Assistant (java.lang.String version, java.lang.String serviceName)
      Constructs an instance of the `Assistant` client.
      Assistant (java.lang.String version, java.lang.String serviceName, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
      Constructs an instance of the `Assistant` client.
    • Method Summary

      All Methods
      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<java.lang.Void> deleteSession (DeleteSessionOptions deleteSessionOptions)
      Delete session.
      com.ibm.cloud.sdk.core.http.ServiceCall<java.lang.Void> deleteUserData (DeleteUserDataOptions deleteUserDataOptions)
      Delete labeled data.
      java.lang.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 (java.lang.String version)
      Sets the version.
      • Methods inherited from class com.ibm.cloud.sdk.core.service.BaseService

        configureClient, configureHttpClient, configureService, createServiceCall, enableGzipCompression, getAuthenticator, getClient, getEndPoint, getName, getServiceUrl, isJsonMimeType, isJsonPatchMimeType, processServiceCall, setAuthentication, setClient, setDefaultHeaders, setDefaultHeaders, setEndPoint, setServiceUrl, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • DEFAULT_SERVICE_NAME

        public static final java.lang.String DEFAULT_SERVICE_NAME
        See Also:
        Constant Field Values
      • DEFAULT_SERVICE_URL

        public static final java.lang.String DEFAULT_SERVICE_URL
        See Also:
        Constant Field Values
    • Constructor Detail

      • Assistant

        public Assistant(java.lang.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年04月01日`.
      • Assistant

        public Assistant(java.lang.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年04月01日`.
        authenticator - the Authenticator instance to be configured for this client
      • Assistant

        public Assistant(java.lang.String version,
         java.lang.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年04月01日`.
        serviceName - the service name to be used when configuring the client instance
      • Assistant

        public Assistant(java.lang.String version,
         java.lang.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年04月01日`.
        serviceName - the service name to be used when configuring the client instance
        authenticator - the Authenticator instance to be configured for this client
    • Method Detail

      • getVersion

        public java.lang.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年04月01日`.

        Returns:
        the version
      • setVersion

        public void setVersion(java.lang.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<java.lang.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
      • 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 is available only with Premium 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<java.lang.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).

        This operation is limited to 4 requests per minute. For more information, see **Rate limiting**.

        Parameters:
        deleteUserDataOptions - the DeleteUserDataOptions containing the options for the call
        Returns:
        a ServiceCall with a void result
      • 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 Premium plans.

        Parameters:
        bulkClassifyOptions - the BulkClassifyOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type BulkClassifyResponse
Skip navigation links

AltStyle によって変換されたページ (->オリジナル) /