UNPKG

ibm-watson

Version:
788 lines 230 kB
/** * (C) Copyright IBM Corp. 2018, 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /// <reference types="node" /> import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'; import { BaseService, UserOptions } from 'ibm-cloud-sdk-core'; /** * The IBM Watson&trade; 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 */ declare class AssistantV1 extends BaseService { static DEFAULT_SERVICE_URL: string; static DEFAULT_SERVICE_NAME: string; /** Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is * `2021-11-27`. */ version: string; /** * Construct a AssistantV1 object. * * @param {Object} options - Options for the service. * @param {string} options.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`. * @param {string} [options.serviceUrl] - The base URL for the service * @param {OutgoingHttpHeaders} [options.headers] - Default headers that shall be included with every request to the service. * @param {string} [options.serviceName] - The name of the service to configure * @param {Authenticator} [options.authenticator] - The Authenticator object used to authenticate requests to the service. Defaults to environment if not set * @constructor * @returns {AssistantV1} */ constructor(options: UserOptions); /************************* * 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](https://cloud.ibm.com/docs/assistant?topic=assistant-api-overview). * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {MessageInput} [params.input] - An input object that includes the input text. * @param {RuntimeIntent[]} [params.intents] - 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. * @param {RuntimeEntity[]} [params.entities] - 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. * @param {boolean} [params.alternateIntents] - Whether to return more than one intent. A value of `true` indicates * that all matching intents are returned. * @param {Context} [params.context] - State information for the conversation. To maintain state, include the context * from the previous response. * @param {OutputData} [params.output] - An output object that includes the response to the user, the dialog nodes * that were triggered, and messages from the log. * @param {string} [params.userId] - 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**. * * **Note:** This property is the same as the **user_id** property in the context metadata. If **user_id** is * specified in both locations in a message request, the value specified at the root is used. * @param {boolean} [params.nodesVisitedDetails] - Whether to include additional diagnostic information about the * dialog nodes that were visited during processing of the message. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.MessageResponse>>} */ message(params: AssistantV1.MessageParams): Promise<AssistantV1.Response<AssistantV1.MessageResponse>>; /************************* * 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. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {BulkClassifyUtterance[]} [params.input] - An array of input utterances to classify. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.BulkClassifyResponse>>} */ bulkClassify(params: AssistantV1.BulkClassifyParams): Promise<AssistantV1.Response<AssistantV1.BulkClassifyResponse>>; /************************* * workspaces ************************/ /** * List workspaces. * * List the workspaces associated with a Watson Assistant service instance. * * @param {Object} [params] - The parameters to send to the service. * @param {number} [params.pageLimit] - The number of records to return in each page of results. * @param {boolean} [params.includeCount] - 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. * @param {string} [params.sort] - The attribute by which returned workspaces will be sorted. To reverse the sort * order, prefix the value with a minus sign (`-`). * @param {string} [params.cursor] - A token identifying the page of results to retrieve. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.WorkspaceCollection>>} */ listWorkspaces(params?: AssistantV1.ListWorkspacesParams): Promise<AssistantV1.Response<AssistantV1.WorkspaceCollection>>; /** * Create workspace. * * Create a workspace based on component objects. You must provide workspace components defining the content of the * new workspace. * * **Note:** The new workspace data cannot be larger than 1.5 MB. For larger requests, use the **Create workspace * asynchronously** method. * * @param {Object} [params] - The parameters to send to the service. * @param {string} [params.name] - The name of the workspace. This string cannot contain carriage return, newline, or * tab characters. * @param {string} [params.description] - The description of the workspace. This string cannot contain carriage * return, newline, or tab characters. * @param {string} [params.language] - The language of the workspace. * @param {DialogNode[]} [params.dialogNodes] - An array of objects describing the dialog nodes in the workspace. * @param {Counterexample[]} [params.counterexamples] - An array of objects defining input examples that have been * marked as irrelevant input. * @param {JsonObject} [params.metadata] - Any metadata related to the workspace. * @param {boolean} [params.learningOptOut] - 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. * @param {WorkspaceSystemSettings} [params.systemSettings] - Global settings for the workspace. * @param {Webhook[]} [params.webhooks] - * @param {CreateIntent[]} [params.intents] - An array of objects defining the intents for the workspace. * @param {CreateEntity[]} [params.entities] - An array of objects describing the entities for the workspace. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.Workspace>>} */ createWorkspace(params?: AssistantV1.CreateWorkspaceParams): Promise<AssistantV1.Response<AssistantV1.Workspace>>; /** * Get information about a workspace. * * Get information about a workspace, optionally including all workspace content. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {boolean} [params._export] - 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. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {string} [params.sort] - 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. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.Workspace>>} */ getWorkspace(params: AssistantV1.GetWorkspaceParams): Promise<AssistantV1.Response<AssistantV1.Workspace>>; /** * Update workspace. * * Update an existing workspace with new or modified data. You must provide component objects defining the content of * the updated workspace. * * **Note:** The new workspace data cannot be larger than 1.5 MB. For larger requests, use the **Update workspace * asynchronously** method. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} [params.name] - The name of the workspace. This string cannot contain carriage return, newline, or * tab characters. * @param {string} [params.description] - The description of the workspace. This string cannot contain carriage * return, newline, or tab characters. * @param {string} [params.language] - The language of the workspace. * @param {DialogNode[]} [params.dialogNodes] - An array of objects describing the dialog nodes in the workspace. * @param {Counterexample[]} [params.counterexamples] - An array of objects defining input examples that have been * marked as irrelevant input. * @param {JsonObject} [params.metadata] - Any metadata related to the workspace. * @param {boolean} [params.learningOptOut] - 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. * @param {WorkspaceSystemSettings} [params.systemSettings] - Global settings for the workspace. * @param {Webhook[]} [params.webhooks] - * @param {CreateIntent[]} [params.intents] - An array of objects defining the intents for the workspace. * @param {CreateEntity[]} [params.entities] - An array of objects describing the entities for the workspace. * @param {boolean} [params.append] - 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. * * If **append**=`true`, existing elements are preserved, and the new elements are added. If any elements in the new * data collide with existing elements, the update request fails. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.Workspace>>} */ updateWorkspace(params: AssistantV1.UpdateWorkspaceParams): Promise<AssistantV1.Response<AssistantV1.Workspace>>; /** * Delete workspace. * * Delete a workspace from the service instance. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.EmptyObject>>} */ deleteWorkspace(params: AssistantV1.DeleteWorkspaceParams): Promise<AssistantV1.Response<AssistantV1.EmptyObject>>; /** * Create workspace asynchronously. * * Create a workspace asynchronously based on component objects. You must provide workspace components defining the * content of the new workspace. * * A successful call to this method only initiates asynchronous creation of the workspace. The new workspace is not * available until processing completes. To check the status of the asynchronous operation, use the **Get information * about a workspace** method. * * @param {Object} [params] - The parameters to send to the service. * @param {string} [params.name] - The name of the workspace. This string cannot contain carriage return, newline, or * tab characters. * @param {string} [params.description] - The description of the workspace. This string cannot contain carriage * return, newline, or tab characters. * @param {string} [params.language] - The language of the workspace. * @param {DialogNode[]} [params.dialogNodes] - An array of objects describing the dialog nodes in the workspace. * @param {Counterexample[]} [params.counterexamples] - An array of objects defining input examples that have been * marked as irrelevant input. * @param {JsonObject} [params.metadata] - Any metadata related to the workspace. * @param {boolean} [params.learningOptOut] - 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. * @param {WorkspaceSystemSettings} [params.systemSettings] - Global settings for the workspace. * @param {Webhook[]} [params.webhooks] - * @param {CreateIntent[]} [params.intents] - An array of objects defining the intents for the workspace. * @param {CreateEntity[]} [params.entities] - An array of objects describing the entities for the workspace. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.Workspace>>} */ createWorkspaceAsync(params?: AssistantV1.CreateWorkspaceAsyncParams): Promise<AssistantV1.Response<AssistantV1.Workspace>>; /** * Update workspace asynchronously. * * Update an existing workspace asynchronously with new or modified data. You must provide component objects defining * the content of the updated workspace. * * A successful call to this method only initiates an asynchronous update of the workspace. The updated workspace is * not available until processing completes. To check the status of the asynchronous operation, use the **Get * information about a workspace** method. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} [params.name] - The name of the workspace. This string cannot contain carriage return, newline, or * tab characters. * @param {string} [params.description] - The description of the workspace. This string cannot contain carriage * return, newline, or tab characters. * @param {string} [params.language] - The language of the workspace. * @param {DialogNode[]} [params.dialogNodes] - An array of objects describing the dialog nodes in the workspace. * @param {Counterexample[]} [params.counterexamples] - An array of objects defining input examples that have been * marked as irrelevant input. * @param {JsonObject} [params.metadata] - Any metadata related to the workspace. * @param {boolean} [params.learningOptOut] - 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. * @param {WorkspaceSystemSettings} [params.systemSettings] - Global settings for the workspace. * @param {Webhook[]} [params.webhooks] - * @param {CreateIntent[]} [params.intents] - An array of objects defining the intents for the workspace. * @param {CreateEntity[]} [params.entities] - An array of objects describing the entities for the workspace. * @param {boolean} [params.append] - 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. * * If **append**=`true`, existing elements are preserved, and the new elements are added. If any elements in the new * data collide with existing elements, the update request fails. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.Workspace>>} */ updateWorkspaceAsync(params: AssistantV1.UpdateWorkspaceAsyncParams): Promise<AssistantV1.Response<AssistantV1.Workspace>>; /** * Export workspace asynchronously. * * Export the entire workspace asynchronously, including all workspace content. * * 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 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 exported JSON data. Remember that the usual rate limits apply. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {string} [params.sort] - Indicates how the returned workspace data will be sorted. Specify `sort=stable` to * sort all workspace objects by unique identifier, in ascending alphabetical order. * @param {boolean} [params.verbose] - Whether the response should include the `counts` property, which indicates how * many of each component (such as intents and entities) the workspace contains. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.Workspace>>} */ exportWorkspaceAsync(params: AssistantV1.ExportWorkspaceAsyncParams): Promise<AssistantV1.Response<AssistantV1.Workspace>>; /************************* * intents ************************/ /** * List intents. * * List the intents for a workspace. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {boolean} [params._export] - 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. * @param {number} [params.pageLimit] - The number of records to return in each page of results. * @param {boolean} [params.includeCount] - 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. * @param {string} [params.sort] - The attribute by which returned intents will be sorted. To reverse the sort order, * prefix the value with a minus sign (`-`). * @param {string} [params.cursor] - A token identifying the page of results to retrieve. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.IntentCollection>>} */ listIntents(params: AssistantV1.ListIntentsParams): Promise<AssistantV1.Response<AssistantV1.IntentCollection>>; /** * 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. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} params.intent - 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-`. * @param {string} [params.description] - The description of the intent. This string cannot contain carriage return, * newline, or tab characters. * @param {Example[]} [params.examples] - An array of user input examples for the intent. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.Intent>>} */ createIntent(params: AssistantV1.CreateIntentParams): Promise<AssistantV1.Response<AssistantV1.Intent>>; /** * Get intent. * * Get information about an intent, optionally including all intent content. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} params.intent - The intent name. * @param {boolean} [params._export] - 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. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.Intent>>} */ getIntent(params: AssistantV1.GetIntentParams): Promise<AssistantV1.Response<AssistantV1.Intent>>; /** * 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. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} params.intent - The intent name. * @param {string} [params.newIntent] - 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-`. * @param {string} [params.newDescription] - The description of the intent. This string cannot contain carriage * return, newline, or tab characters. * @param {Example[]} [params.newExamples] - An array of user input examples for the intent. * @param {boolean} [params.append] - 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. * * If **append**=`true`, existing elements are preserved, and the new elements are added. If any elements in the new * data collide with existing elements, the update request fails. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.Intent>>} */ updateIntent(params: AssistantV1.UpdateIntentParams): Promise<AssistantV1.Response<AssistantV1.Intent>>; /** * Delete intent. * * Delete an intent from a workspace. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} params.intent - The intent name. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.EmptyObject>>} */ deleteIntent(params: AssistantV1.DeleteIntentParams): Promise<AssistantV1.Response<AssistantV1.EmptyObject>>; /************************* * examples ************************/ /** * List user input examples. * * List the user input examples for an intent, optionally including contextual entity mentions. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} params.intent - The intent name. * @param {number} [params.pageLimit] - The number of records to return in each page of results. * @param {boolean} [params.includeCount] - 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. * @param {string} [params.sort] - The attribute by which returned examples will be sorted. To reverse the sort order, * prefix the value with a minus sign (`-`). * @param {string} [params.cursor] - A token identifying the page of results to retrieve. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.ExampleCollection>>} */ listExamples(params: AssistantV1.ListExamplesParams): Promise<AssistantV1.Response<AssistantV1.ExampleCollection>>; /** * 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. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} params.intent - The intent name. * @param {string} params.text - 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. * @param {Mention[]} [params.mentions] - An array of contextual entity mentions. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.Example>>} */ createExample(params: AssistantV1.CreateExampleParams): Promise<AssistantV1.Response<AssistantV1.Example>>; /** * Get user input example. * * Get information about a user input example. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} params.intent - The intent name. * @param {string} params.text - The text of the user input example. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.Example>>} */ getExample(params: AssistantV1.GetExampleParams): Promise<AssistantV1.Response<AssistantV1.Example>>; /** * 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. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} params.intent - The intent name. * @param {string} params.text - The text of the user input example. * @param {string} [params.newText] - 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. * @param {Mention[]} [params.newMentions] - An array of contextual entity mentions. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.Example>>} */ updateExample(params: AssistantV1.UpdateExampleParams): Promise<AssistantV1.Response<AssistantV1.Example>>; /** * Delete user input example. * * Delete a user input example from an intent. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} params.intent - The intent name. * @param {string} params.text - The text of the user input example. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.EmptyObject>>} */ deleteExample(params: AssistantV1.DeleteExampleParams): Promise<AssistantV1.Response<AssistantV1.EmptyObject>>; /************************* * counterexamples ************************/ /** * List counterexamples. * * List the counterexamples for a workspace. Counterexamples are examples that have been marked as irrelevant input. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {number} [params.pageLimit] - The number of records to return in each page of results. * @param {boolean} [params.includeCount] - 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. * @param {string} [params.sort] - The attribute by which returned counterexamples will be sorted. To reverse the sort * order, prefix the value with a minus sign (`-`). * @param {string} [params.cursor] - A token identifying the page of results to retrieve. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.CounterexampleCollection>>} */ listCounterexamples(params: AssistantV1.ListCounterexamplesParams): Promise<AssistantV1.Response<AssistantV1.CounterexampleCollection>>; /** * 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. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} params.text - 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. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.Counterexample>>} */ createCounterexample(params: AssistantV1.CreateCounterexampleParams): Promise<AssistantV1.Response<AssistantV1.Counterexample>>; /** * Get counterexample. * * Get information about a counterexample. Counterexamples are examples that have been marked as irrelevant input. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} params.text - The text of a user input counterexample (for example, `What are you wearing?`). * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.Counterexample>>} */ getCounterexample(params: AssistantV1.GetCounterexampleParams): Promise<AssistantV1.Response<AssistantV1.Counterexample>>; /** * Update counterexample. * * Update the text of a counterexample. Counterexamples are examples that have been marked as irrelevant input. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} params.text - The text of a user input counterexample (for example, `What are you wearing?`). * @param {string} [params.newText] - 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. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.Counterexample>>} */ updateCounterexample(params: AssistantV1.UpdateCounterexampleParams): Promise<AssistantV1.Response<AssistantV1.Counterexample>>; /** * Delete counterexample. * * Delete a counterexample from a workspace. Counterexamples are examples that have been marked as irrelevant input. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} params.text - The text of a user input counterexample (for example, `What are you wearing?`). * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.EmptyObject>>} */ deleteCounterexample(params: AssistantV1.DeleteCounterexampleParams): Promise<AssistantV1.Response<AssistantV1.EmptyObject>>; /************************* * entities ************************/ /** * List entities. * * List the entities for a workspace. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {boolean} [params._export] - 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. * @param {number} [params.pageLimit] - The number of records to return in each page of results. * @param {boolean} [params.includeCount] - 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. * @param {string} [params.sort] - The attribute by which returned entities will be sorted. To reverse the sort order, * prefix the value with a minus sign (`-`). * @param {string} [params.cursor] - A token identifying the page of results to retrieve. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.EntityCollection>>} */ listEntities(params: AssistantV1.ListEntitiesParams): Promise<AssistantV1.Response<AssistantV1.EntityCollection>>; /** * 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. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} params.entity - 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.). * @param {string} [params.description] - The description of the entity. This string cannot contain carriage return, * newline, or tab characters. * @param {JsonObject} [params.metadata] - Any metadata related to the entity. * @param {boolean} [params.fuzzyMatch] - Whether to use fuzzy matching for the entity. * @param {CreateValue[]} [params.values] - An array of objects describing the entity values. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.Entity>>} */ createEntity(params: AssistantV1.CreateEntityParams): Promise<AssistantV1.Response<AssistantV1.Entity>>; /** * Get entity. * * Get information about an entity, optionally including all entity content. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} params.entity - The name of the entity. * @param {boolean} [params._export] - 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. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.Entity>>} */ getEntity(params: AssistantV1.GetEntityParams): Promise<AssistantV1.Response<AssistantV1.Entity>>; /** * 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. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} params.entity - The name of the entity. * @param {string} [params.newEntity] - 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-`. * @param {string} [params.newDescription] - The description of the entity. This string cannot contain carriage * return, newline, or tab characters. * @param {JsonObject} [params.newMetadata] - Any metadata related to the entity. * @param {boolean} [params.newFuzzyMatch] - Whether to use fuzzy matching for the entity. * @param {CreateValue[]} [params.newValues] - An array of objects describing the entity values. * @param {boolean} [params.append] - 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. * * If **append**=`true`, existing elements are preserved, and the new elements are added. If any elements in the new * data collide with existing elements, the update request fails. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.Entity>>} */ updateEntity(params: AssistantV1.UpdateEntityParams): Promise<AssistantV1.Response<AssistantV1.Entity>>; /** * Delete entity. * * Delete an entity from a workspace, or disable a system entity. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} params.entity - The name of the entity. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.EmptyObject>>} */ deleteEntity(params: AssistantV1.DeleteEntityParams): Promise<AssistantV1.Response<AssistantV1.EmptyObject>>; /************************* * mentions ************************/ /** * 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. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} params.entity - The name of the entity. * @param {boolean} [params._export] - 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. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.EntityMentionCollection>>} */ listMentions(params: AssistantV1.ListMentionsParams): Promise<AssistantV1.Response<AssistantV1.EntityMentionCollection>>; /************************* * values ************************/ /** * List entity values. * * List the values for an entity. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} params.entity - The name of the entity. * @param {boolean} [params._export] - 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. * @param {number} [params.pageLimit] - The number of records to return in each page of results. * @param {boolean} [params.includeCount] - 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. * @param {string} [params.sort] - The attribute by which returned entity values will be sorted. To reverse the sort * order, prefix the value with a minus sign (`-`). * @param {string} [params.cursor] - A token identifying the page of results to retrieve. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV1.Response<AssistantV1.ValueCollection>>} */ listValues(params: AssistantV1.ListValuesParams): Promise<AssistantV1.Response<AssistantV1.ValueCollection>>; /** * 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. * * @param {Object} params - The parameters to send to the service. * @param {string} params.workspaceId - Unique identifier of the workspace. * @param {string} params.entity - The name of the entity. * @param {string} param