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.

    API Version: 2.0 See: https://cloud.ibm.com/docs/assistant

    • Field Detail

      • DEFAULT_SERVICE_NAME

        public static final String DEFAULT_SERVICE_NAME
        Default service name used when configuring the `Assistant` client.
        See Also:
        Constant Field Values
    • Constructor Detail

      • 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 `2021年11月27日`.
      • 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 `2021年11月27日`.
        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 `2021年11月27日`.
        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年11月27日`.
        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 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 `2021年11月27日`.

        Returns:
        the version
      • setVersion

        public void setVersion(String version)
        Sets the version.
        Parameters:
        version - the new version
      • createAssistant

        public com.ibm.cloud.sdk.core.http.ServiceCall<AssistantData> createAssistant(CreateAssistantOptions createAssistantOptions)
        Create an assistant.

        Create a new assistant.

        This method is available only with Enterprise plans.

        Parameters:
        createAssistantOptions - the CreateAssistantOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type AssistantData
      • createAssistant

        public com.ibm.cloud.sdk.core.http.ServiceCall<AssistantData> createAssistant()
        Create an assistant.

        Create a new assistant.

        This method is available only with Enterprise plans.

        Returns:
        a ServiceCall with a result of type AssistantData
      • listAssistants

        public com.ibm.cloud.sdk.core.http.ServiceCall<AssistantCollection> listAssistants(ListAssistantsOptions listAssistantsOptions)
        List assistants.

        List the assistants associated with a Watson Assistant service instance.

        This method is available only with Enterprise plans.

        Parameters:
        listAssistantsOptions - the ListAssistantsOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type AssistantCollection
      • listAssistants

        public com.ibm.cloud.sdk.core.http.ServiceCall<AssistantCollection> listAssistants()
        List assistants.

        List the assistants associated with a Watson Assistant service instance.

        This method is available only with Enterprise plans.

        Returns:
        a ServiceCall with a result of type AssistantCollection
      • deleteAssistant

        public com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteAssistant(DeleteAssistantOptions deleteAssistantOptions)
        Delete assistant.

        Delete an assistant.

        This method is available only with Enterprise plans.

        Parameters:
        deleteAssistantOptions - the DeleteAssistantOptions containing the options for the call
        Returns:
        a ServiceCall with a void result
      • 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 Plus and Enterprise plans.

        **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](#pagination).

        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
      • listEnvironments

        public com.ibm.cloud.sdk.core.http.ServiceCall<EnvironmentCollection> listEnvironments(ListEnvironmentsOptions listEnvironmentsOptions)
        List environments.

        List the environments associated with an assistant.

        This method is available only with Enterprise plans.

        Parameters:
        listEnvironmentsOptions - the ListEnvironmentsOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type EnvironmentCollection
      • getEnvironment

        public com.ibm.cloud.sdk.core.http.ServiceCall<Environment> getEnvironment(GetEnvironmentOptions getEnvironmentOptions)
        Get environment.

        Get information about an environment. For more information about environments, see [Environments](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-publish-overview#environments).

        This method is available only with Enterprise plans.

        Parameters:
        getEnvironmentOptions - the GetEnvironmentOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type Environment
      • updateEnvironment

        public com.ibm.cloud.sdk.core.http.ServiceCall<Environment> updateEnvironment(UpdateEnvironmentOptions updateEnvironmentOptions)
        Update environment.

        Update an environment with new or modified data. For more information about environments, see [Environments](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-publish-overview#environments).

        This method is available only with Enterprise plans.

        Parameters:
        updateEnvironmentOptions - the UpdateEnvironmentOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type Environment
      • createRelease

        public com.ibm.cloud.sdk.core.http.ServiceCall<Release> createRelease(CreateReleaseOptions createReleaseOptions)
        Create release.

        Create a new release using the current content of the dialog and action skills in the draft environment. (In the Watson Assistant user interface, a release is called a *version*.)

        This method is available only with Enterprise plans.

        Parameters:
        createReleaseOptions - the CreateReleaseOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type Release
      • listReleases

        public com.ibm.cloud.sdk.core.http.ServiceCall<ReleaseCollection> listReleases(ListReleasesOptions listReleasesOptions)
        List releases.

        List the releases associated with an assistant. (In the Watson Assistant user interface, a release is called a *version*.)

        This method is available only with Enterprise plans.

        Parameters:
        listReleasesOptions - the ListReleasesOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type ReleaseCollection
      • getRelease

        public com.ibm.cloud.sdk.core.http.ServiceCall<Release> getRelease(GetReleaseOptions getReleaseOptions)
        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.

        This method is available only with Enterprise plans.

        Parameters:
        getReleaseOptions - the GetReleaseOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type Release
      • deleteRelease

        public com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteRelease(DeleteReleaseOptions deleteReleaseOptions)
        Delete release.

        Delete a release. (In the Watson Assistant user interface, a release is called a *version*.)

        This method is available only with Enterprise plans.

        Parameters:
        deleteReleaseOptions - the DeleteReleaseOptions containing the options for the call
        Returns:
        a ServiceCall with a void result
      • deployRelease

        public com.ibm.cloud.sdk.core.http.ServiceCall<Environment> deployRelease(DeployReleaseOptions deployReleaseOptions)
        Deploy release.

        Update the environment with the content of the release. All snapshots saved as part of the release become active in the environment.

        This method is available only with Enterprise plans.

        Parameters:
        deployReleaseOptions - the DeployReleaseOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type Environment
      • getSkill

        public com.ibm.cloud.sdk.core.http.ServiceCall<Skill> getSkill(GetSkillOptions getSkillOptions)
        Get skill.

        Get information about a skill.

        This method is available only with Enterprise plans.

        Parameters:
        getSkillOptions - the GetSkillOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type Skill
      • updateSkill

        public com.ibm.cloud.sdk.core.http.ServiceCall<Skill> updateSkill(UpdateSkillOptions updateSkillOptions)
        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.

        This method is available only with Enterprise plans.

        Parameters:
        updateSkillOptions - the UpdateSkillOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type Skill
      • exportSkills

        public com.ibm.cloud.sdk.core.http.ServiceCall<SkillsExport> exportSkills(ExportSkillsOptions exportSkillsOptions)
        Export skills.

        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.

        This method is available only with Enterprise plans.

        Parameters:
        exportSkillsOptions - the ExportSkillsOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type SkillsExport
      • importSkills

        public com.ibm.cloud.sdk.core.http.ServiceCall<SkillsAsyncRequestStatus> importSkills(ImportSkillsOptions importSkillsOptions)
        Import skills.

        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.

        This method is available only with Enterprise plans.

        Parameters:
        importSkillsOptions - the ImportSkillsOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type SkillsAsyncRequestStatus
      • importSkillsStatus

        public com.ibm.cloud.sdk.core.http.ServiceCall<SkillsAsyncRequestStatus> importSkillsStatus(ImportSkillsStatusOptions importSkillsStatusOptions)
        Get status of skills import.

        Retrieve the status of an asynchronous import operation previously initiated by using the **Import skills** method.

        This method is available only with Enterprise plans.

        Parameters:
        importSkillsStatusOptions - the ImportSkillsStatusOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type SkillsAsyncRequestStatus
Skip navigation links
IBM Corporation

Copyright © 2023 IBM Cloud. All rights reserved.

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