Class Assistant

java.lang.Object
com.ibm.cloud.sdk.core.service.BaseService
com.ibm.watson.assistant.v1.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 v1 API provides authoring methods your application can use to create or update a workspace.

API Version: 1.0 See: https://cloud.ibm.com/docs/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 `2021-06-14`.
    • 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-06-14`.
      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-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 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 `2021-06-14`.

      Returns:
      the version
    • setVersion

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

      public com.ibm.cloud.sdk.core.http.ServiceCall<MessageResponse> message​(MessageOptions messageOptions)
      Get response to user input.

      Send user input to a workspace and receive a response.

      **Important:** This method has been superseded by the new v2 runtime API. The v2 API offers significant advantages, including ease of deployment, automatic state management, versioning, and search capabilities. For more information, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-api-overview).

      Parameters:
      messageOptions - the MessageOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type MessageResponse
    • 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 workspace 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 workspaces.

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

      public com.ibm.cloud.sdk.core.http.ServiceCall<WorkspaceCollection> listWorkspaces​(ListWorkspacesOptions listWorkspacesOptions)
      List workspaces.

      List the workspaces associated with a Watson Assistant service instance.

      Parameters:
      listWorkspacesOptions - the ListWorkspacesOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type WorkspaceCollection
    • listWorkspaces

      public com.ibm.cloud.sdk.core.http.ServiceCall<WorkspaceCollection> listWorkspaces()
      List workspaces.

      List the workspaces associated with a Watson Assistant service instance.

      Returns:
      a ServiceCall with a result of type WorkspaceCollection
    • createWorkspace

      public com.ibm.cloud.sdk.core.http.ServiceCall<Workspace> createWorkspace​(CreateWorkspaceOptions createWorkspaceOptions)
      Create workspace.

      Create a workspace based on component objects. You must provide workspace components defining the content of the new workspace.

      Parameters:
      createWorkspaceOptions - the CreateWorkspaceOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Workspace
    • createWorkspace

      public com.ibm.cloud.sdk.core.http.ServiceCall<Workspace> createWorkspace()
      Create workspace.

      Create a workspace based on component objects. You must provide workspace components defining the content of the new workspace.

      Returns:
      a ServiceCall with a result of type Workspace
    • getWorkspace

      public com.ibm.cloud.sdk.core.http.ServiceCall<Workspace> getWorkspace​(GetWorkspaceOptions getWorkspaceOptions)
      Get information about a workspace.

      Get information about a workspace, optionally including all workspace content.

      Parameters:
      getWorkspaceOptions - the GetWorkspaceOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Workspace
    • updateWorkspace

      public com.ibm.cloud.sdk.core.http.ServiceCall<Workspace> updateWorkspace​(UpdateWorkspaceOptions updateWorkspaceOptions)
      Update workspace.

      Update an existing workspace with new or modified data. You must provide component objects defining the content of the updated workspace.

      Parameters:
      updateWorkspaceOptions - the UpdateWorkspaceOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Workspace
    • deleteWorkspace

      public com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteWorkspace​(DeleteWorkspaceOptions deleteWorkspaceOptions)
      Delete workspace.

      Delete a workspace from the service instance.

      Parameters:
      deleteWorkspaceOptions - the DeleteWorkspaceOptions containing the options for the call
      Returns:
      a ServiceCall with a void result
    • listIntents

      public com.ibm.cloud.sdk.core.http.ServiceCall<IntentCollection> listIntents​(ListIntentsOptions listIntentsOptions)
      List intents.

      List the intents for a workspace.

      Parameters:
      listIntentsOptions - the ListIntentsOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type IntentCollection
    • createIntent

      public com.ibm.cloud.sdk.core.http.ServiceCall<Intent> createIntent​(CreateIntentOptions createIntentOptions)
      Create intent.

      Create a new intent.

      If you want to create multiple intents with a single API call, consider using the **[Update workspace](#update-workspace)** method instead.

      Parameters:
      createIntentOptions - the CreateIntentOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Intent
    • getIntent

      public com.ibm.cloud.sdk.core.http.ServiceCall<Intent> getIntent​(GetIntentOptions getIntentOptions)
      Get intent.

      Get information about an intent, optionally including all intent content.

      Parameters:
      getIntentOptions - the GetIntentOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Intent
    • updateIntent

      public com.ibm.cloud.sdk.core.http.ServiceCall<Intent> updateIntent​(UpdateIntentOptions updateIntentOptions)
      Update intent.

      Update an existing intent with new or modified data. You must provide component objects defining the content of the updated intent.

      If you want to update multiple intents with a single API call, consider using the **[Update workspace](#update-workspace)** method instead.

      Parameters:
      updateIntentOptions - the UpdateIntentOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Intent
    • deleteIntent

      public com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteIntent​(DeleteIntentOptions deleteIntentOptions)
      Delete intent.

      Delete an intent from a workspace.

      Parameters:
      deleteIntentOptions - the DeleteIntentOptions containing the options for the call
      Returns:
      a ServiceCall with a void result
    • listExamples

      public com.ibm.cloud.sdk.core.http.ServiceCall<ExampleCollection> listExamples​(ListExamplesOptions listExamplesOptions)
      List user input examples.

      List the user input examples for an intent, optionally including contextual entity mentions.

      Parameters:
      listExamplesOptions - the ListExamplesOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type ExampleCollection
    • createExample

      public com.ibm.cloud.sdk.core.http.ServiceCall<Example> createExample​(CreateExampleOptions createExampleOptions)
      Create user input example.

      Add a new user input example to an intent.

      If you want to add multiple examples with a single API call, consider using the **[Update intent](#update-intent)** method instead.

      Parameters:
      createExampleOptions - the CreateExampleOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Example
    • getExample

      public com.ibm.cloud.sdk.core.http.ServiceCall<Example> getExample​(GetExampleOptions getExampleOptions)
      Get user input example.

      Get information about a user input example.

      Parameters:
      getExampleOptions - the GetExampleOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Example
    • updateExample

      public com.ibm.cloud.sdk.core.http.ServiceCall<Example> updateExample​(UpdateExampleOptions updateExampleOptions)
      Update user input example.

      Update the text of a user input example.

      If you want to update multiple examples with a single API call, consider using the **[Update intent](#update-intent)** method instead.

      Parameters:
      updateExampleOptions - the UpdateExampleOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Example
    • deleteExample

      public com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteExample​(DeleteExampleOptions deleteExampleOptions)
      Delete user input example.

      Delete a user input example from an intent.

      Parameters:
      deleteExampleOptions - the DeleteExampleOptions containing the options for the call
      Returns:
      a ServiceCall with a void result
    • listCounterexamples

      public com.ibm.cloud.sdk.core.http.ServiceCall<CounterexampleCollection> listCounterexamples​(ListCounterexamplesOptions listCounterexamplesOptions)
      List counterexamples.

      List the counterexamples for a workspace. Counterexamples are examples that have been marked as irrelevant input.

      Parameters:
      listCounterexamplesOptions - the ListCounterexamplesOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type CounterexampleCollection
    • createCounterexample

      public com.ibm.cloud.sdk.core.http.ServiceCall<Counterexample> createCounterexample​(CreateCounterexampleOptions createCounterexampleOptions)
      Create counterexample.

      Add a new counterexample to a workspace. Counterexamples are examples that have been marked as irrelevant input.

      If you want to add multiple counterexamples with a single API call, consider using the **[Update workspace](#update-workspace)** method instead.

      Parameters:
      createCounterexampleOptions - the CreateCounterexampleOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Counterexample
    • getCounterexample

      public com.ibm.cloud.sdk.core.http.ServiceCall<Counterexample> getCounterexample​(GetCounterexampleOptions getCounterexampleOptions)
      Get counterexample.

      Get information about a counterexample. Counterexamples are examples that have been marked as irrelevant input.

      Parameters:
      getCounterexampleOptions - the GetCounterexampleOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Counterexample
    • updateCounterexample

      public com.ibm.cloud.sdk.core.http.ServiceCall<Counterexample> updateCounterexample​(UpdateCounterexampleOptions updateCounterexampleOptions)
      Update counterexample.

      Update the text of a counterexample. Counterexamples are examples that have been marked as irrelevant input.

      Parameters:
      updateCounterexampleOptions - the UpdateCounterexampleOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Counterexample
    • deleteCounterexample

      public com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteCounterexample​(DeleteCounterexampleOptions deleteCounterexampleOptions)
      Delete counterexample.

      Delete a counterexample from a workspace. Counterexamples are examples that have been marked as irrelevant input.

      Parameters:
      deleteCounterexampleOptions - the DeleteCounterexampleOptions containing the options for the call
      Returns:
      a ServiceCall with a void result
    • listEntities

      public com.ibm.cloud.sdk.core.http.ServiceCall<EntityCollection> listEntities​(ListEntitiesOptions listEntitiesOptions)
      List entities.

      List the entities for a workspace.

      Parameters:
      listEntitiesOptions - the ListEntitiesOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type EntityCollection
    • createEntity

      public com.ibm.cloud.sdk.core.http.ServiceCall<Entity> createEntity​(CreateEntityOptions createEntityOptions)
      Create entity.

      Create a new entity, or enable a system entity.

      If you want to create multiple entities with a single API call, consider using the **[Update workspace](#update-workspace)** method instead.

      Parameters:
      createEntityOptions - the CreateEntityOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Entity
    • getEntity

      public com.ibm.cloud.sdk.core.http.ServiceCall<Entity> getEntity​(GetEntityOptions getEntityOptions)
      Get entity.

      Get information about an entity, optionally including all entity content.

      Parameters:
      getEntityOptions - the GetEntityOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Entity
    • updateEntity

      public com.ibm.cloud.sdk.core.http.ServiceCall<Entity> updateEntity​(UpdateEntityOptions updateEntityOptions)
      Update entity.

      Update an existing entity with new or modified data. You must provide component objects defining the content of the updated entity.

      If you want to update multiple entities with a single API call, consider using the **[Update workspace](#update-workspace)** method instead.

      Parameters:
      updateEntityOptions - the UpdateEntityOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Entity
    • deleteEntity

      public com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteEntity​(DeleteEntityOptions deleteEntityOptions)
      Delete entity.

      Delete an entity from a workspace, or disable a system entity.

      Parameters:
      deleteEntityOptions - the DeleteEntityOptions containing the options for the call
      Returns:
      a ServiceCall with a void result
    • listMentions

      public com.ibm.cloud.sdk.core.http.ServiceCall<EntityMentionCollection> listMentions​(ListMentionsOptions listMentionsOptions)
      List entity mentions.

      List mentions for a contextual entity. An entity mention is an occurrence of a contextual entity in the context of an intent user input example.

      Parameters:
      listMentionsOptions - the ListMentionsOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type EntityMentionCollection
    • listValues

      public com.ibm.cloud.sdk.core.http.ServiceCall<ValueCollection> listValues​(ListValuesOptions listValuesOptions)
      List entity values.

      List the values for an entity.

      Parameters:
      listValuesOptions - the ListValuesOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type ValueCollection
    • createValue

      public com.ibm.cloud.sdk.core.http.ServiceCall<Value> createValue​(CreateValueOptions createValueOptions)
      Create entity value.

      Create a new value for an entity.

      If you want to create multiple entity values with a single API call, consider using the **[Update entity](#update-entity)** method instead.

      Parameters:
      createValueOptions - the CreateValueOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Value
    • getValue

      public com.ibm.cloud.sdk.core.http.ServiceCall<Value> getValue​(GetValueOptions getValueOptions)
      Get entity value.

      Get information about an entity value.

      Parameters:
      getValueOptions - the GetValueOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Value
    • updateValue

      public com.ibm.cloud.sdk.core.http.ServiceCall<Value> updateValue​(UpdateValueOptions updateValueOptions)
      Update entity value.

      Update an existing entity value with new or modified data. You must provide component objects defining the content of the updated entity value.

      If you want to update multiple entity values with a single API call, consider using the **[Update entity](#update-entity)** method instead.

      Parameters:
      updateValueOptions - the UpdateValueOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Value
    • deleteValue

      public com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteValue​(DeleteValueOptions deleteValueOptions)
      Delete entity value.

      Delete a value from an entity.

      Parameters:
      deleteValueOptions - the DeleteValueOptions containing the options for the call
      Returns:
      a ServiceCall with a void result
    • listSynonyms

      public com.ibm.cloud.sdk.core.http.ServiceCall<SynonymCollection> listSynonyms​(ListSynonymsOptions listSynonymsOptions)
      List entity value synonyms.

      List the synonyms for an entity value.

      Parameters:
      listSynonymsOptions - the ListSynonymsOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type SynonymCollection
    • createSynonym

      public com.ibm.cloud.sdk.core.http.ServiceCall<Synonym> createSynonym​(CreateSynonymOptions createSynonymOptions)
      Create entity value synonym.

      Add a new synonym to an entity value.

      If you want to create multiple synonyms with a single API call, consider using the **[Update entity](#update-entity)** or **[Update entity value](#update-entity-value)** method instead.

      Parameters:
      createSynonymOptions - the CreateSynonymOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Synonym
    • getSynonym

      public com.ibm.cloud.sdk.core.http.ServiceCall<Synonym> getSynonym​(GetSynonymOptions getSynonymOptions)
      Get entity value synonym.

      Get information about a synonym of an entity value.

      Parameters:
      getSynonymOptions - the GetSynonymOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Synonym
    • updateSynonym

      public com.ibm.cloud.sdk.core.http.ServiceCall<Synonym> updateSynonym​(UpdateSynonymOptions updateSynonymOptions)
      Update entity value synonym.

      Update an existing entity value synonym with new text.

      If you want to update multiple synonyms with a single API call, consider using the **[Update entity](#update-entity)** or **[Update entity value](#update-entity-value)** method instead.

      Parameters:
      updateSynonymOptions - the UpdateSynonymOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type Synonym
    • deleteSynonym

      public com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteSynonym​(DeleteSynonymOptions deleteSynonymOptions)
      Delete entity value synonym.

      Delete a synonym from an entity value.

      Parameters:
      deleteSynonymOptions - the DeleteSynonymOptions containing the options for the call
      Returns:
      a ServiceCall with a void result
    • listDialogNodes

      public com.ibm.cloud.sdk.core.http.ServiceCall<DialogNodeCollection> listDialogNodes​(ListDialogNodesOptions listDialogNodesOptions)
      List dialog nodes.

      List the dialog nodes for a workspace.

      Parameters:
      listDialogNodesOptions - the ListDialogNodesOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type DialogNodeCollection
    • createDialogNode

      public com.ibm.cloud.sdk.core.http.ServiceCall<DialogNode> createDialogNode​(CreateDialogNodeOptions createDialogNodeOptions)
      Create dialog node.

      Create a new dialog node.

      If you want to create multiple dialog nodes with a single API call, consider using the **[Update workspace](#update-workspace)** method instead.

      Parameters:
      createDialogNodeOptions - the CreateDialogNodeOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type DialogNode
    • getDialogNode

      public com.ibm.cloud.sdk.core.http.ServiceCall<DialogNode> getDialogNode​(GetDialogNodeOptions getDialogNodeOptions)
      Get dialog node.

      Get information about a dialog node.

      Parameters:
      getDialogNodeOptions - the GetDialogNodeOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type DialogNode
    • updateDialogNode

      public com.ibm.cloud.sdk.core.http.ServiceCall<DialogNode> updateDialogNode​(UpdateDialogNodeOptions updateDialogNodeOptions)
      Update dialog node.

      Update an existing dialog node with new or modified data.

      If you want to update multiple dialog nodes with a single API call, consider using the **[Update workspace](#update-workspace)** method instead.

      Parameters:
      updateDialogNodeOptions - the UpdateDialogNodeOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type DialogNode
    • updateDialogNodeNullable

      public com.ibm.cloud.sdk.core.http.ServiceCall<DialogNode> updateDialogNodeNullable​(UpdateDialogNodeNullableOptions UpdateDialogNodeNullableOptions)
      Update dialog node.

      Update an existing dialog node with new or modified data.

      If you want to update multiple dialog nodes with a single API call, consider using the **[Update workspace](#update-workspace)** method instead.

      Parameters:
      UpdateDialogNodeNullableOptions - the UpdateDialogNodeNullableOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type DialogNode
    • deleteDialogNode

      public com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteDialogNode​(DeleteDialogNodeOptions deleteDialogNodeOptions)
      Delete dialog node.

      Delete a dialog node from a workspace.

      Parameters:
      deleteDialogNodeOptions - the DeleteDialogNodeOptions containing the options for the call
      Returns:
      a ServiceCall with a void result
    • listLogs

      public com.ibm.cloud.sdk.core.http.ServiceCall<LogCollection> listLogs​(ListLogsOptions listLogsOptions)
      List log events in a workspace.

      List the events from the log of a specific workspace.

      This method requires Manager access.

      Parameters:
      listLogsOptions - the ListLogsOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type LogCollection
    • listAllLogs

      public com.ibm.cloud.sdk.core.http.ServiceCall<LogCollection> listAllLogs​(ListAllLogsOptions listAllLogsOptions)
      List log events in all workspaces.

      List the events from the logs of all workspaces in the service instance.

      Parameters:
      listAllLogsOptions - the ListAllLogsOptions 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