Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AssistantV1

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

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

Hierarchy

  • BaseService
    • AssistantV1

Index

Constructors

constructor

  • Construct a AssistantV1 object.

    Parameters

    Name Type Attribute Description
    options UserOptions

    Options for the service.

    Returns AssistantV1

Properties

version

version: string

Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is 2021-06-14.

Static DEFAULT_SERVICE_NAME

DEFAULT_SERVICE_NAME: string = "conversation"

Static DEFAULT_SERVICE_URL

DEFAULT_SERVICE_URL: string = "https://api.us-south.assistant.watson.cloud.ibm.com"

Methods

bulkClassify

  • 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

    Name Type Attribute Description
    params BulkClassifyParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional
    input BulkClassifyUtterance[] Optional An array of input utterances to classify.

    Returns Promise<Response<BulkClassifyResponse>>

createCounterexample

  • 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 method instead.

    Parameters

    Name Type Attribute Description
    params CreateCounterexampleParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    text string The text of a user input marked as irrelevant input. This string must conform to the following restrictions: - It cannot contain carriage return, newline, or tab characters. - It cannot consist of only whitespace characters.
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.

    Returns Promise<Response<Counterexample>>

createDialogNode

  • 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 method instead.

    Parameters

    Name Type Attribute Description
    params CreateDialogNodeParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    dialogNode string The unique ID of the dialog node. This is an internal identifier used to refer to the dialog node from other dialog nodes and in the diagnostic information included with message responses.
    workspaceId string Unique identifier of the workspace.
    actions DialogNodeAction[] Optional An array of objects describing any actions to be invoked by the dialog node.
    conditions string Optional The condition that will trigger the dialog node. This string cannot contain carriage return, newline, or tab characters.
    context DialogNodeContext Optional The context for the dialog node.
    description string Optional The description of the dialog node. This string cannot contain carriage return, newline, or tab characters.
    digressIn DigressIn | string Optional Whether this top-level dialog node can be digressed into.
    digressOut DigressOut | string Optional Whether this dialog node can be returned to after a digression.
    digressOutSlots DigressOutSlots | string Optional Whether the user can digress to top-level nodes while filling out slots.
    disambiguationOptOut boolean Optional Whether the dialog node should be excluded from disambiguation suggestions. Valid only when **type**=`standard` or `frame`.
    eventName EventName | string Optional How an `event_handler` node is processed.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    metadata JsonObject Optional The metadata for the dialog node.
    nextStep DialogNodeNextStep Optional The next step to execute following this dialog node.
    output DialogNodeOutput Optional The output of the dialog node. For more information about how to specify dialog node output, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overview#dialog-overview-responses).
    parent string Optional The unique ID of the parent dialog node. This property is omitted if the dialog node has no parent.
    previousSibling string Optional The unique ID of the previous sibling dialog node. This property is omitted if the dialog node has no previous sibling.
    title string Optional A human-readable name for the dialog node. If the node is included in disambiguation, this title is used to populate the **label** property of the corresponding suggestion in the `suggestion` response type (unless it is overridden by the **user_label** property). The title is also used to populate the **topic** property in the `connect_to_agent` response type.
    type Type | string Optional How the dialog node is processed.
    userLabel string Optional A label that can be displayed externally to describe the purpose of the node to users. If set, this label is used to identify the node in disambiguation responses (overriding the value of the **title** property).
    variable string Optional The location in the dialog context where output is stored.

    Returns Promise<Response<DialogNode>>

createEntity

  • 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 method instead.

    Parameters

    Name Type Attribute Description
    params CreateEntityParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    entity string The name of the entity. This string must conform to the following restrictions: - It can contain only Unicode alphanumeric, underscore, and hyphen characters. - If you specify an entity name beginning with the reserved prefix `sys-`, it must be the name of a system entity that you want to enable. (Any entity content specified with the request is ignored.).
    workspaceId string Unique identifier of the workspace.
    description string Optional The description of the entity. This string cannot contain carriage return, newline, or tab characters.
    fuzzyMatch boolean Optional Whether to use fuzzy matching for the entity.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    metadata JsonObject Optional Any metadata related to the entity.
    values CreateValue[] Optional An array of objects describing the entity values.

    Returns Promise<Response<Entity>>

createExample

  • 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 method instead.

    Parameters

    Name Type Attribute Description
    params CreateExampleParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    intent string The intent name.
    text string The text of a user input example. This string must conform to the following restrictions: - It cannot contain carriage return, newline, or tab characters. - It cannot consist of only whitespace characters.
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    mentions Mention[] Optional An array of contextual entity mentions.

    Returns Promise<Response<Example>>

createIntent

  • Create intent.

    Create a new intent.

    If you want to create multiple intents with a single API call, consider using the Update workspace method instead.

    Parameters

    Name Type Attribute Description
    params CreateIntentParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    intent string The name of the intent. This string must conform to the following restrictions: - It can contain only Unicode alphanumeric, underscore, hyphen, and dot characters. - It cannot begin with the reserved prefix `sys-`.
    workspaceId string Unique identifier of the workspace.
    description string Optional The description of the intent. This string cannot contain carriage return, newline, or tab characters.
    examples Example[] Optional An array of user input examples for the intent.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.

    Returns Promise<Response<Intent>>

createSynonym

  • 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 or Update entity value method instead.

    Parameters

    Name Type Attribute Description
    params CreateSynonymParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    entity string The name of the entity.
    synonym string The text of the synonym. This string must conform to the following restrictions: - It cannot contain carriage return, newline, or tab characters. - It cannot consist of only whitespace characters.
    value string The text of the entity value.
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.

    Returns Promise<Response<Synonym>>

createValue

  • 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 method instead.

    Parameters

    Name Type Attribute Description
    params CreateValueParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    entity string The name of the entity.
    value string The text of the entity value. This string must conform to the following restrictions: - It cannot contain carriage return, newline, or tab characters. - It cannot consist of only whitespace characters.
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    metadata JsonObject Optional Any metadata related to the entity value.
    patterns string[] Optional An array of patterns for the entity value. A value can specify either synonyms or patterns (depending on the value type), but not both. A pattern is a regular expression; for more information about how to specify a pattern, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-entities#entities-create-dictionary-based).
    synonyms string[] Optional An array of synonyms for the entity value. A value can specify either synonyms or patterns (depending on the value type), but not both. A synonym must conform to the following resrictions: - It cannot contain carriage return, newline, or tab characters. - It cannot consist of only whitespace characters.
    type Type | string Optional Specifies the type of entity value.

    Returns Promise<Response<Value>>

createWorkspace

  • Create workspace.

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

    Parameters

    Name Type Attribute Description
    params CreateWorkspaceParams Optional

    Properties

    Name Type Attributes Description
    counterexamples Counterexample[] Optional An array of objects defining input examples that have been marked as irrelevant input.
    description string Optional The description of the workspace. This string cannot contain carriage return, newline, or tab characters.
    dialogNodes DialogNode[] Optional An array of objects describing the dialog nodes in the workspace.
    entities CreateEntity[] Optional An array of objects describing the entities for the workspace.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    intents CreateIntent[] Optional An array of objects defining the intents for the workspace.
    language string Optional The language of the workspace.
    learningOptOut boolean Optional Whether training data from the workspace (including artifacts such as intents and entities) can be used by IBM for general service improvements. `true` indicates that workspace training data is not to be used.
    metadata JsonObject Optional Any metadata related to the workspace.
    name string Optional The name of the workspace. This string cannot contain carriage return, newline, or tab characters.
    systemSettings WorkspaceSystemSettings Optional Global settings for the workspace.
    webhooks Webhook[] Optional

    Returns Promise<Response<Workspace>>

deleteCounterexample

  • Delete counterexample.

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

    Parameters

    Name Type Attribute Description
    params DeleteCounterexampleParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    text string The text of a user input counterexample (for example, `What are you wearing?`).
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional

    Returns Promise<Response<Empty>>

deleteDialogNode

  • Delete dialog node.

    Delete a dialog node from a workspace.

    Parameters

    Name Type Attribute Description
    params DeleteDialogNodeParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    dialogNode string The dialog node ID (for example, `node_1_1479323581900`).
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional

    Returns Promise<Response<Empty>>

deleteEntity

  • Delete entity.

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

    Parameters

    Name Type Attribute Description
    params DeleteEntityParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    entity string The name of the entity.
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional

    Returns Promise<Response<Empty>>

deleteExample

  • Delete user input example.

    Delete a user input example from an intent.

    Parameters

    Name Type Attribute Description
    params DeleteExampleParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    intent string The intent name.
    text string The text of the user input example.
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional

    Returns Promise<Response<Empty>>

deleteIntent

  • Delete intent.

    Delete an intent from a workspace.

    Parameters

    Name Type Attribute Description
    params DeleteIntentParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    intent string The intent name.
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional

    Returns Promise<Response<Empty>>

deleteSynonym

  • Delete entity value synonym.

    Delete a synonym from an entity value.

    Parameters

    Name Type Attribute Description
    params DeleteSynonymParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    entity string The name of the entity.
    synonym string The text of the synonym.
    value string The text of the entity value.
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional

    Returns Promise<Response<Empty>>

deleteUserData

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

    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.

    Parameters

    Name Type Attribute Description
    params DeleteUserDataParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    customerId string The customer ID for which all data is to be deleted.
    headers OutgoingHttpHeaders Optional

    Returns Promise<Response<Empty>>

deleteValue

  • Delete entity value.

    Delete a value from an entity.

    Parameters

    Name Type Attribute Description
    params DeleteValueParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    entity string The name of the entity.
    value string The text of the entity value.
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional

    Returns Promise<Response<Empty>>

deleteWorkspace

  • Delete workspace.

    Delete a workspace from the service instance.

    Parameters

    Name Type Attribute Description
    params DeleteWorkspaceParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional

    Returns Promise<Response<Empty>>

disableRetries

  • disableRetries(): void
  • Disables retries.

    Returns void

enableRetries

  • enableRetries(retryOptions?: RetryOptions): void
  • Enable retries for unfulfilled requests.

    Parameters

    Name Type Attribute Description
    retryOptions RetryOptions Optional

    configuration for retries

    Returns void

getAuthenticator

  • getAuthenticator(): any
  • Get the instance of the authenticator set on the service.

    Returns any

getCounterexample

  • Get counterexample.

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

    Parameters

    Name Type Attribute Description
    params GetCounterexampleParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    text string The text of a user input counterexample (for example, `What are you wearing?`).
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.

    Returns Promise<Response<Counterexample>>

getDialogNode

  • Get dialog node.

    Get information about a dialog node.

    Parameters

    Name Type Attribute Description
    params GetDialogNodeParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    dialogNode string The dialog node ID (for example, `node_1_1479323581900`).
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.

    Returns Promise<Response<DialogNode>>

getEntity

  • Get entity.

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

    Parameters

    Name Type Attribute Description
    params GetEntityParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    entity string The name of the entity.
    workspaceId string Unique identifier of the workspace.
    _export boolean Optional Whether to include all element content in the returned data. If **export**=`false`, the returned data includes only information about the element itself. If **export**=`true`, all content, including subelements, is included.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.

    Returns Promise<Response<Entity>>

getExample

  • Get user input example.

    Get information about a user input example.

    Parameters

    Name Type Attribute Description
    params GetExampleParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    intent string The intent name.
    text string The text of the user input example.
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.

    Returns Promise<Response<Example>>

getHttpClient

  • getHttpClient(): AxiosInstance
  • Get the Axios instance set on the service. All requests will be made using this instance.

    Returns AxiosInstance

getIntent

  • Get intent.

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

    Parameters

    Name Type Attribute Description
    params GetIntentParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    intent string The intent name.
    workspaceId string Unique identifier of the workspace.
    _export boolean Optional Whether to include all element content in the returned data. If **export**=`false`, the returned data includes only information about the element itself. If **export**=`true`, all content, including subelements, is included.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.

    Returns Promise<Response<Intent>>

getSynonym

  • Get entity value synonym.

    Get information about a synonym of an entity value.

    Parameters

    Name Type Attribute Description
    params GetSynonymParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    entity string The name of the entity.
    synonym string The text of the synonym.
    value string The text of the entity value.
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.

    Returns Promise<Response<Synonym>>

getValue

  • Get entity value.

    Get information about an entity value.

    Parameters

    Name Type Attribute Description
    params GetValueParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    entity string The name of the entity.
    value string The text of the entity value.
    workspaceId string Unique identifier of the workspace.
    _export boolean Optional Whether to include all element content in the returned data. If **export**=`false`, the returned data includes only information about the element itself. If **export**=`true`, all content, including subelements, is included.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.

    Returns Promise<Response<Value>>

getWorkspace

  • Get information about a workspace.

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

    Parameters

    Name Type Attribute Description
    params GetWorkspaceParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    workspaceId string Unique identifier of the workspace.
    _export boolean Optional Whether to include all element content in the returned data. If **export**=`false`, the returned data includes only information about the element itself. If **export**=`true`, all content, including subelements, is included.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    sort Sort | string Optional Indicates how the returned workspace data will be sorted. This parameter is valid only if **export**=`true`. Specify `sort=stable` to sort all workspace objects by unique identifier, in ascending alphabetical order.

    Returns Promise<Response<Workspace>>

listAllLogs

  • List log events in all workspaces.

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

    Parameters

    Name Type Attribute Description
    params ListAllLogsParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    filter string A cacheable parameter that limits the results to those matching the specified filter. You must specify a filter query that includes a value for `language`, as well as a value for `request.context.system.assistant_id`, `workspace_id`, or `request.context.metadata.deployment`. These required filters must be specified using the exact match (`::`) operator. For more information, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-filter-reference#filter-reference).
    cursor string Optional A token identifying the page of results to retrieve.
    headers OutgoingHttpHeaders Optional
    pageLimit number Optional The number of records to return in each page of results.
    sort string Optional How to sort the returned log events. You can sort by **request_timestamp**. To reverse the sort order, prefix the parameter value with a minus sign (`-`).

    Returns Promise<Response<LogCollection>>

listCounterexamples

  • List counterexamples.

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

    Parameters

    Name Type Attribute Description
    params ListCounterexamplesParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    workspaceId string Unique identifier of the workspace.
    cursor string Optional A token identifying the page of results to retrieve.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    includeCount boolean Optional Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is `true`, the `pagination` object in the response includes the `total` property.
    pageLimit number Optional The number of records to return in each page of results.
    sort Sort | string Optional The attribute by which returned counterexamples will be sorted. To reverse the sort order, prefix the value with a minus sign (`-`).

    Returns Promise<Response<CounterexampleCollection>>

listDialogNodes

  • List dialog nodes.

    List the dialog nodes for a workspace.

    Parameters

    Name Type Attribute Description
    params ListDialogNodesParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    workspaceId string Unique identifier of the workspace.
    cursor string Optional A token identifying the page of results to retrieve.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    includeCount boolean Optional Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is `true`, the `pagination` object in the response includes the `total` property.
    pageLimit number Optional The number of records to return in each page of results.
    sort Sort | string Optional The attribute by which returned dialog nodes will be sorted. To reverse the sort order, prefix the value with a minus sign (`-`).

    Returns Promise<Response<DialogNodeCollection>>

listEntities

  • List entities.

    List the entities for a workspace.

    Parameters

    Name Type Attribute Description
    params ListEntitiesParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    workspaceId string Unique identifier of the workspace.
    _export boolean Optional Whether to include all element content in the returned data. If **export**=`false`, the returned data includes only information about the element itself. If **export**=`true`, all content, including subelements, is included.
    cursor string Optional A token identifying the page of results to retrieve.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    includeCount boolean Optional Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is `true`, the `pagination` object in the response includes the `total` property.
    pageLimit number Optional The number of records to return in each page of results.
    sort Sort | string Optional The attribute by which returned entities will be sorted. To reverse the sort order, prefix the value with a minus sign (`-`).

    Returns Promise<Response<EntityCollection>>

listExamples

  • List user input examples.

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

    Parameters

    Name Type Attribute Description
    params ListExamplesParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    intent string The intent name.
    workspaceId string Unique identifier of the workspace.
    cursor string Optional A token identifying the page of results to retrieve.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    includeCount boolean Optional Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is `true`, the `pagination` object in the response includes the `total` property.
    pageLimit number Optional The number of records to return in each page of results.
    sort Sort | string Optional The attribute by which returned examples will be sorted. To reverse the sort order, prefix the value with a minus sign (`-`).

    Returns Promise<Response<ExampleCollection>>

listIntents

  • List intents.

    List the intents for a workspace.

    Parameters

    Name Type Attribute Description
    params ListIntentsParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    workspaceId string Unique identifier of the workspace.
    _export boolean Optional Whether to include all element content in the returned data. If **export**=`false`, the returned data includes only information about the element itself. If **export**=`true`, all content, including subelements, is included.
    cursor string Optional A token identifying the page of results to retrieve.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    includeCount boolean Optional Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is `true`, the `pagination` object in the response includes the `total` property.
    pageLimit number Optional The number of records to return in each page of results.
    sort Sort | string Optional The attribute by which returned intents will be sorted. To reverse the sort order, prefix the value with a minus sign (`-`).

    Returns Promise<Response<IntentCollection>>

listLogs

  • List log events in a workspace.

    List the events from the log of a specific workspace.

    This method requires Manager access.

    Parameters

    Name Type Attribute Description
    params ListLogsParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    workspaceId string Unique identifier of the workspace.
    cursor string Optional A token identifying the page of results to retrieve.
    filter string Optional A cacheable parameter that limits the results to those matching the specified filter. For more information, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-filter-reference#filter-reference).
    headers OutgoingHttpHeaders Optional
    pageLimit number Optional The number of records to return in each page of results.
    sort string Optional How to sort the returned log events. You can sort by **request_timestamp**. To reverse the sort order, prefix the parameter value with a minus sign (`-`).

    Returns Promise<Response<LogCollection>>

listMentions

  • 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

    Name Type Attribute Description
    params ListMentionsParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    entity string The name of the entity.
    workspaceId string Unique identifier of the workspace.
    _export boolean Optional Whether to include all element content in the returned data. If **export**=`false`, the returned data includes only information about the element itself. If **export**=`true`, all content, including subelements, is included.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.

    Returns Promise<Response<EntityMentionCollection>>

listSynonyms

  • List entity value synonyms.

    List the synonyms for an entity value.

    Parameters

    Name Type Attribute Description
    params ListSynonymsParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    entity string The name of the entity.
    value string The text of the entity value.
    workspaceId string Unique identifier of the workspace.
    cursor string Optional A token identifying the page of results to retrieve.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    includeCount boolean Optional Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is `true`, the `pagination` object in the response includes the `total` property.
    pageLimit number Optional The number of records to return in each page of results.
    sort Sort | string Optional The attribute by which returned entity value synonyms will be sorted. To reverse the sort order, prefix the value with a minus sign (`-`).

    Returns Promise<Response<SynonymCollection>>

listValues

  • List entity values.

    List the values for an entity.

    Parameters

    Name Type Attribute Description
    params ListValuesParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    entity string The name of the entity.
    workspaceId string Unique identifier of the workspace.
    _export boolean Optional Whether to include all element content in the returned data. If **export**=`false`, the returned data includes only information about the element itself. If **export**=`true`, all content, including subelements, is included.
    cursor string Optional A token identifying the page of results to retrieve.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    includeCount boolean Optional Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is `true`, the `pagination` object in the response includes the `total` property.
    pageLimit number Optional The number of records to return in each page of results.
    sort Sort | string Optional The attribute by which returned entity values will be sorted. To reverse the sort order, prefix the value with a minus sign (`-`).

    Returns Promise<Response<ValueCollection>>

listWorkspaces

  • List workspaces.

    List the workspaces associated with a Watson Assistant service instance.

    Parameters

    Name Type Attribute Description
    params ListWorkspacesParams Optional

    Properties

    Name Type Attributes Description
    cursor string Optional A token identifying the page of results to retrieve.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    includeCount boolean Optional Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is `true`, the `pagination` object in the response includes the `total` property.
    pageLimit number Optional The number of records to return in each page of results.
    sort Sort | string Optional The attribute by which returned workspaces will be sorted. To reverse the sort order, prefix the value with a minus sign (`-`).

    Returns Promise<Response<WorkspaceCollection>>

message

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

    Parameters

    Name Type Attribute Description
    params MessageParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    workspaceId string Unique identifier of the workspace.
    alternateIntents boolean Optional Whether to return more than one intent. A value of `true` indicates that all matching intents are returned.
    context Context Optional State information for the conversation. To maintain state, include the context from the previous response.
    entities RuntimeEntity[] Optional Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.
    headers OutgoingHttpHeaders Optional
    input MessageInput Optional An input object that includes the input text.
    intents RuntimeIntent[] Optional Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.
    nodesVisitedDetails boolean Optional Whether to include additional diagnostic information about the dialog nodes that were visited during processing of the message.
    output OutputData Optional An output object that includes the response to the user, the dialog nodes that were triggered, and messages from the log.
    userId string Optional A string value that identifies the user who is interacting with the workspace. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, **user_id** is automatically set to the value of **context.conversation_id**.

    Returns Promise<Response<MessageResponse>>

setEnableGzipCompression

  • setEnableGzipCompression(setting: boolean): void
  • Turn request body compression on or off.

    Parameters

    Name Type Attribute Description
    setting boolean

    Will turn it on if 'true', off if 'false'.

    Returns void

setServiceUrl

  • setServiceUrl(url: string): void
  • Set the service URL to send requests to.

    Parameters

    Name Type Attribute Description
    url string

    The base URL for the service.

    Returns void

updateCounterexample

  • Update counterexample.

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

    Parameters

    Name Type Attribute Description
    params UpdateCounterexampleParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    text string The text of a user input counterexample (for example, `What are you wearing?`).
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    newText string Optional The text of a user input marked as irrelevant input. This string must conform to the following restrictions: - It cannot contain carriage return, newline, or tab characters. - It cannot consist of only whitespace characters.

    Returns Promise<Response<Counterexample>>

updateDialogNode

  • 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 method instead.

    Parameters

    Name Type Attribute Description
    params UpdateDialogNodeParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    dialogNode string The dialog node ID (for example, `node_1_1479323581900`).
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    newActions DialogNodeAction[] Optional An array of objects describing any actions to be invoked by the dialog node.
    newConditions string Optional The condition that will trigger the dialog node. This string cannot contain carriage return, newline, or tab characters.
    newContext DialogNodeContext Optional The context for the dialog node.
    newDescription string Optional The description of the dialog node. This string cannot contain carriage return, newline, or tab characters.
    newDialogNode string Optional The unique ID of the dialog node. This is an internal identifier used to refer to the dialog node from other dialog nodes and in the diagnostic information included with message responses.
    newDigressIn DigressIn | string Optional Whether this top-level dialog node can be digressed into.
    newDigressOut DigressOut | string Optional Whether this dialog node can be returned to after a digression.
    newDigressOutSlots DigressOutSlots | string Optional Whether the user can digress to top-level nodes while filling out slots.
    newDisambiguationOptOut boolean Optional Whether the dialog node should be excluded from disambiguation suggestions. Valid only when **type**=`standard` or `frame`.
    newEventName EventName | string Optional How an `event_handler` node is processed.
    newMetadata JsonObject Optional The metadata for the dialog node.
    newNextStep DialogNodeNextStep Optional The next step to execute following this dialog node.
    newOutput DialogNodeOutput Optional The output of the dialog node. For more information about how to specify dialog node output, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overview#dialog-overview-responses).
    newParent string Optional The unique ID of the parent dialog node. This property is omitted if the dialog node has no parent.
    newPreviousSibling string Optional The unique ID of the previous sibling dialog node. This property is omitted if the dialog node has no previous sibling.
    newTitle string Optional A human-readable name for the dialog node. If the node is included in disambiguation, this title is used to populate the **label** property of the corresponding suggestion in the `suggestion` response type (unless it is overridden by the **user_label** property). The title is also used to populate the **topic** property in the `connect_to_agent` response type.
    newType Type | string Optional How the dialog node is processed.
    newUserLabel string Optional A label that can be displayed externally to describe the purpose of the node to users. If set, this label is used to identify the node in disambiguation responses (overriding the value of the **title** property).
    newVariable string Optional The location in the dialog context where output is stored.

    Returns Promise<Response<DialogNode>>

updateEntity

  • 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 method instead.

    Parameters

    Name Type Attribute Description
    params UpdateEntityParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    entity string The name of the entity.
    workspaceId string Unique identifier of the workspace.
    append boolean Optional Whether the new data is to be appended to the existing data in the entity. If **append**=`false`, elements included in the new data completely replace the corresponding existing elements, including all subelements. For example, if the new data for the entity includes **values** and **append**=`false`, all existing values for the entity are discarded and replaced with the new values.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    newDescription string Optional The description of the entity. This string cannot contain carriage return, newline, or tab characters.
    newEntity string Optional The name of the entity. This string must conform to the following restrictions: - It can contain only Unicode alphanumeric, underscore, and hyphen characters. - It cannot begin with the reserved prefix `sys-`.
    newFuzzyMatch boolean Optional Whether to use fuzzy matching for the entity.
    newMetadata JsonObject Optional Any metadata related to the entity.
    newValues CreateValue[] Optional An array of objects describing the entity values.

    Returns Promise<Response<Entity>>

updateExample

  • 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 method instead.

    Parameters

    Name Type Attribute Description
    params UpdateExampleParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    intent string The intent name.
    text string The text of the user input example.
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    newMentions Mention[] Optional An array of contextual entity mentions.
    newText string Optional The text of the user input example. This string must conform to the following restrictions: - It cannot contain carriage return, newline, or tab characters. - It cannot consist of only whitespace characters.

    Returns Promise<Response<Example>>

updateIntent

  • 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 method instead.

    Parameters

    Name Type Attribute Description
    params UpdateIntentParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    intent string The intent name.
    workspaceId string Unique identifier of the workspace.
    append boolean Optional Whether the new data is to be appended to the existing data in the object. If **append**=`false`, elements included in the new data completely replace the corresponding existing elements, including all subelements. For example, if the new data for the intent includes **examples** and **append**=`false`, all existing examples for the intent are discarded and replaced with the new examples.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    newDescription string Optional The description of the intent. This string cannot contain carriage return, newline, or tab characters.
    newExamples Example[] Optional An array of user input examples for the intent.
    newIntent string Optional The name of the intent. This string must conform to the following restrictions: - It can contain only Unicode alphanumeric, underscore, hyphen, and dot characters. - It cannot begin with the reserved prefix `sys-`.

    Returns Promise<Response<Intent>>

updateSynonym

  • 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 or Update entity value method instead.

    Parameters

    Name Type Attribute Description
    params UpdateSynonymParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    entity string The name of the entity.
    synonym string The text of the synonym.
    value string The text of the entity value.
    workspaceId string Unique identifier of the workspace.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    newSynonym string Optional The text of the synonym. This string must conform to the following restrictions: - It cannot contain carriage return, newline, or tab characters. - It cannot consist of only whitespace characters.

    Returns Promise<Response<Synonym>>

updateValue

  • 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 method instead.

    Parameters

    Name Type Attribute Description
    params UpdateValueParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    entity string The name of the entity.
    value string The text of the entity value.
    workspaceId string Unique identifier of the workspace.
    append boolean Optional Whether the new data is to be appended to the existing data in the entity value. If **append**=`false`, elements included in the new data completely replace the corresponding existing elements, including all subelements. For example, if the new data for the entity value includes **synonyms** and **append**=`false`, all existing synonyms for the entity value are discarded and replaced with the new synonyms.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    newMetadata JsonObject Optional Any metadata related to the entity value.
    newPatterns string[] Optional An array of patterns for the entity value. A value can specify either synonyms or patterns (depending on the value type), but not both. A pattern is a regular expression; for more information about how to specify a pattern, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-entities#entities-create-dictionary-based).
    newSynonyms string[] Optional An array of synonyms for the entity value. A value can specify either synonyms or patterns (depending on the value type), but not both. A synonym must conform to the following resrictions: - It cannot contain carriage return, newline, or tab characters. - It cannot consist of only whitespace characters.
    newType Type | string Optional Specifies the type of entity value.
    newValue string Optional The text of the entity value. This string must conform to the following restrictions: - It cannot contain carriage return, newline, or tab characters. - It cannot consist of only whitespace characters.

    Returns Promise<Response<Value>>

updateWorkspace

  • Update workspace.

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

    Parameters

    Name Type Attribute Description
    params UpdateWorkspaceParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    workspaceId string Unique identifier of the workspace.
    append boolean Optional Whether the new data is to be appended to the existing data in the object. If **append**=`false`, elements included in the new data completely replace the corresponding existing elements, including all subelements. For example, if the new data for a workspace includes **entities** and **append**=`false`, all existing entities in the workspace are discarded and replaced with the new entities.
    counterexamples Counterexample[] Optional An array of objects defining input examples that have been marked as irrelevant input.
    description string Optional The description of the workspace. This string cannot contain carriage return, newline, or tab characters.
    dialogNodes DialogNode[] Optional An array of objects describing the dialog nodes in the workspace.
    entities CreateEntity[] Optional An array of objects describing the entities for the workspace.
    headers OutgoingHttpHeaders Optional
    includeAudit boolean Optional Whether to include the audit properties (`created` and `updated` timestamps) in the response.
    intents CreateIntent[] Optional An array of objects defining the intents for the workspace.
    language string Optional The language of the workspace.
    learningOptOut boolean Optional Whether training data from the workspace (including artifacts such as intents and entities) can be used by IBM for general service improvements. `true` indicates that workspace training data is not to be used.
    metadata JsonObject Optional Any metadata related to the workspace.
    name string Optional The name of the workspace. This string cannot contain carriage return, newline, or tab characters.
    systemSettings WorkspaceSystemSettings Optional Global settings for the workspace.
    webhooks Webhook[] Optional

    Returns Promise<Response<Workspace>>

Generated using TypeDoc