watson-developer-cloud
Version:
Client library to use the IBM Watson Services
790 lines • 156 kB
TypeScript
/**
* Copyright 2018 IBM All Rights Reserved.
*
* 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.
*/
import { AxiosResponse } from 'axios';
import { BaseService } from 'ibm-cloud-sdk-core';
/**
* The IBM Watson™ Assistant service combines machine learning, natural language understanding, and integrated dialog tools to create conversation flows between your apps and your users.
*/
declare class AssistantV1 extends BaseService {
static URL: string;
name: string;
serviceVersion: string;
/**
* Construct a AssistantV1 object.
*
* @param {Object} options - Options for the service.
* @param {string} options.version - The API version date to use with the service, in "YYYY-MM-DD" format. Whenever the API is changed in a backwards incompatible way, a new minor version of the API is released. The service uses the API version for the date you specify, or the most recent version before that date. Note that you should not programmatically specify the current date at runtime, in case the API has been updated since your application's release. Instead, specify a version date that is compatible with your application, and don't change it until your application is ready for a later version.
* @param {string} [options.url] - The base url to use when contacting the service (e.g. 'https://gateway.watsonplatform.net/assistant/api'). The base url may differ between Bluemix regions.
* @param {string} [options.username] - The username used to authenticate with the service. Username and password credentials are only required to run your application locally or outside of Bluemix. When running on Bluemix, the credentials will be automatically loaded from the `VCAP_SERVICES` environment variable.
* @param {string} [options.password] - The password used to authenticate with the service. Username and password credentials are only required to run your application locally or outside of Bluemix. When running on Bluemix, the credentials will be automatically loaded from the `VCAP_SERVICES` environment variable.
* @param {string} [options.iam_access_token] - An IAM access token fully managed by the application. Responsibility falls on the application to refresh the token, either before it expires or reactively upon receiving a 401 from the service, as any requests made with an expired token will fail.
* @param {string} [options.iam_apikey] - An API key that can be used to request IAM tokens. If this API key is provided, the SDK will manage the token and handle the refreshing.
* @param {string} [options.iam_url] - An optional URL for the IAM service API. Defaults to 'https://iam.bluemix.net/identity/token'.
* @param {boolean} [options.use_unauthenticated] - Set to `true` to avoid including an authorization header. This option may be useful for requests that are proxied.
* @param {Object} [options.headers] - Default headers that shall be included with every request to the service.
* @param {boolean} [options.headers.X-Watson-Learning-Opt-Out] - Set to `true` to opt-out of data collection. By default, all IBM Watson services log requests and their results. Logging is done only to improve the services for future users. The logged data is not shared or made public. If you are concerned with protecting the privacy of users' personal information or otherwise do not want your requests to be logged, you can opt out of logging.
* @constructor
* @returns {AssistantV1}
* @throws {Error}
*/
constructor(options: AssistantV1.Options);
/*************************
* message
************************/
/**
* Get response to user input.
*
* Send user input to a workspace and receive a response.
*
* There is no rate limit for this operation.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - 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.alternate_intents] - 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 {boolean} [params.nodes_visited_details] - Whether to include additional diagnostic information about the
* dialog nodes that were visited during processing of the message.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
message(params: AssistantV1.MessageParams, callback?: AssistantV1.Callback<AssistantV1.MessageResponse>): Promise<any> | void;
/*************************
* workspaces
************************/
/**
* Create workspace.
*
* Create a workspace based on component objects. You must provide workspace components defining the content of the
* new workspace.
*
* This operation is limited to 30 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @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, and it must be no longer than 64 characters.
* @param {string} [params.description] - The description of the workspace. This string cannot contain carriage
* return, newline, or tab characters, and it must be no longer than 128 characters.
* @param {string} [params.language] - The language of the workspace.
* @param {Object} [params.metadata] - Any metadata related to the workspace.
* @param {boolean} [params.learning_opt_out] - 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.system_settings] - Global settings for the workspace.
* @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 {DialogNode[]} [params.dialog_nodes] - 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 {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
createWorkspace(params?: AssistantV1.CreateWorkspaceParams, callback?: AssistantV1.Callback<AssistantV1.Workspace>): Promise<any> | void;
/**
* Delete workspace.
*
* Delete a workspace from the service instance.
*
* This operation is limited to 30 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - Unique identifier of the workspace.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
deleteWorkspace(params: AssistantV1.DeleteWorkspaceParams, callback?: AssistantV1.Callback<AssistantV1.Empty>): Promise<any> | void;
/**
* Get information about a workspace.
*
* Get information about a workspace, optionally including all workspace content.
*
* With **export**=`false`, this operation is limited to 6000 requests per 5 minutes. With **export**=`true`, the
* limit is 20 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - 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.include_audit] - 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 {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
getWorkspace(params: AssistantV1.GetWorkspaceParams, callback?: AssistantV1.Callback<AssistantV1.Workspace>): Promise<any> | void;
/**
* List workspaces.
*
* List the workspaces associated with a Watson Assistant service instance.
*
* This operation is limited to 500 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} [params] - The parameters to send to the service.
* @param {number} [params.page_limit] - The number of records to return in each page of results.
* @param {boolean} [params.include_count] - Whether to include information about the number of records returned.
* @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.include_audit] - Whether to include the audit properties (`created` and `updated`
* timestamps) in the response.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
listWorkspaces(params?: AssistantV1.ListWorkspacesParams, callback?: AssistantV1.Callback<AssistantV1.WorkspaceCollection>): Promise<any> | void;
/**
* Update workspace.
*
* Update an existing workspace with new or modified data. You must provide component objects defining the content of
* the updated workspace.
*
* This operation is limited to 30 request per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - Unique identifier of the workspace.
* @param {string} [params.name] - The name of the workspace. This string cannot contain carriage return, newline, or
* tab characters, and it must be no longer than 64 characters.
* @param {string} [params.description] - The description of the workspace. This string cannot contain carriage
* return, newline, or tab characters, and it must be no longer than 128 characters.
* @param {string} [params.language] - The language of the workspace.
* @param {Object} [params.metadata] - Any metadata related to the workspace.
* @param {boolean} [params.learning_opt_out] - 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.system_settings] - Global settings for the workspace.
* @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 {DialogNode[]} [params.dialog_nodes] - 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 {boolean} [params.append] - Whether the new data is to be appended to the existing data in the workspace. If
* **append**=`false`, elements included in the new data completely replace the corresponding existing elements,
* including all subelements. For example, if the new data 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 {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
updateWorkspace(params: AssistantV1.UpdateWorkspaceParams, callback?: AssistantV1.Callback<AssistantV1.Workspace>): Promise<any> | void;
/*************************
* intents
************************/
/**
* Create intent.
*
* Create a new intent.
*
* This operation is limited to 2000 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - 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-`.
* - It must be no longer than 128 characters.
* @param {string} [params.description] - The description of the intent. This string cannot contain carriage return,
* newline, or tab characters, and it must be no longer than 128 characters.
* @param {Example[]} [params.examples] - An array of user input examples for the intent.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
createIntent(params: AssistantV1.CreateIntentParams, callback?: AssistantV1.Callback<AssistantV1.Intent>): Promise<any> | void;
/**
* Delete intent.
*
* Delete an intent from a workspace.
*
* This operation is limited to 2000 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - Unique identifier of the workspace.
* @param {string} params.intent - The intent name.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
deleteIntent(params: AssistantV1.DeleteIntentParams, callback?: AssistantV1.Callback<AssistantV1.Empty>): Promise<any> | void;
/**
* Get intent.
*
* Get information about an intent, optionally including all intent content.
*
* With **export**=`false`, this operation is limited to 6000 requests per 5 minutes. With **export**=`true`, the
* limit is 400 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - 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.include_audit] - Whether to include the audit properties (`created` and `updated`
* timestamps) in the response.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
getIntent(params: AssistantV1.GetIntentParams, callback?: AssistantV1.Callback<AssistantV1.Intent>): Promise<any> | void;
/**
* List intents.
*
* List the intents for a workspace.
*
* With **export**=`false`, this operation is limited to 2000 requests per 30 minutes. With **export**=`true`, the
* limit is 400 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - 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.page_limit] - The number of records to return in each page of results.
* @param {boolean} [params.include_count] - Whether to include information about the number of records returned.
* @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.include_audit] - Whether to include the audit properties (`created` and `updated`
* timestamps) in the response.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
listIntents(params: AssistantV1.ListIntentsParams, callback?: AssistantV1.Callback<AssistantV1.IntentCollection>): Promise<any> | void;
/**
* Update intent.
*
* Update an existing intent with new or modified data. You must provide component objects defining the content of the
* updated intent.
*
* This operation is limited to 2000 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - Unique identifier of the workspace.
* @param {string} params.intent - The intent name.
* @param {string} [params.new_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-`.
* - It must be no longer than 128 characters.
* @param {string} [params.new_description] - The description of the intent. This string cannot contain carriage
* return, newline, or tab characters, and it must be no longer than 128 characters.
* @param {Example[]} [params.new_examples] - An array of user input examples for the intent.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
updateIntent(params: AssistantV1.UpdateIntentParams, callback?: AssistantV1.Callback<AssistantV1.Intent>): Promise<any> | void;
/*************************
* examples
************************/
/**
* Create user input example.
*
* Add a new user input example to an intent.
*
* This operation is limited to 1000 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - 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.
* - It must be no longer than 1024 characters.
* @param {Mention[]} [params.mentions] - An array of contextual entity mentions.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
createExample(params: AssistantV1.CreateExampleParams, callback?: AssistantV1.Callback<AssistantV1.Example>): Promise<any> | void;
/**
* Delete user input example.
*
* Delete a user input example from an intent.
*
* This operation is limited to 1000 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - Unique identifier of the workspace.
* @param {string} params.intent - The intent name.
* @param {string} params.text - The text of the user input example.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
deleteExample(params: AssistantV1.DeleteExampleParams, callback?: AssistantV1.Callback<AssistantV1.Empty>): Promise<any> | void;
/**
* Get user input example.
*
* Get information about a user input example.
*
* This operation is limited to 6000 requests per 5 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - 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.include_audit] - Whether to include the audit properties (`created` and `updated`
* timestamps) in the response.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
getExample(params: AssistantV1.GetExampleParams, callback?: AssistantV1.Callback<AssistantV1.Example>): Promise<any> | void;
/**
* List user input examples.
*
* List the user input examples for an intent, optionally including contextual entity mentions.
*
* This operation is limited to 2500 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - Unique identifier of the workspace.
* @param {string} params.intent - The intent name.
* @param {number} [params.page_limit] - The number of records to return in each page of results.
* @param {boolean} [params.include_count] - Whether to include information about the number of records returned.
* @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.include_audit] - Whether to include the audit properties (`created` and `updated`
* timestamps) in the response.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
listExamples(params: AssistantV1.ListExamplesParams, callback?: AssistantV1.Callback<AssistantV1.ExampleCollection>): Promise<any> | void;
/**
* Update user input example.
*
* Update the text of a user input example.
*
* This operation is limited to 1000 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - 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.new_text] - 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.
* - It must be no longer than 1024 characters.
* @param {Mention[]} [params.new_mentions] - An array of contextual entity mentions.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
updateExample(params: AssistantV1.UpdateExampleParams, callback?: AssistantV1.Callback<AssistantV1.Example>): Promise<any> | void;
/*************************
* counterexamples
************************/
/**
* Create counterexample.
*
* Add a new counterexample to a workspace. Counterexamples are examples that have been marked as irrelevant input.
*
* This operation is limited to 1000 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - 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
* - It must be no longer than 1024 characters.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
createCounterexample(params: AssistantV1.CreateCounterexampleParams, callback?: AssistantV1.Callback<AssistantV1.Counterexample>): Promise<any> | void;
/**
* Delete counterexample.
*
* Delete a counterexample from a workspace. Counterexamples are examples that have been marked as irrelevant input.
*
* This operation is limited to 1000 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - Unique identifier of the workspace.
* @param {string} params.text - The text of a user input counterexample (for example, `What are you wearing?`).
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
deleteCounterexample(params: AssistantV1.DeleteCounterexampleParams, callback?: AssistantV1.Callback<AssistantV1.Empty>): Promise<any> | void;
/**
* Get counterexample.
*
* Get information about a counterexample. Counterexamples are examples that have been marked as irrelevant input.
*
* This operation is limited to 6000 requests per 5 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - 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.include_audit] - Whether to include the audit properties (`created` and `updated`
* timestamps) in the response.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
getCounterexample(params: AssistantV1.GetCounterexampleParams, callback?: AssistantV1.Callback<AssistantV1.Counterexample>): Promise<any> | void;
/**
* List counterexamples.
*
* List the counterexamples for a workspace. Counterexamples are examples that have been marked as irrelevant input.
*
* This operation is limited to 2500 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - Unique identifier of the workspace.
* @param {number} [params.page_limit] - The number of records to return in each page of results.
* @param {boolean} [params.include_count] - Whether to include information about the number of records returned.
* @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.include_audit] - Whether to include the audit properties (`created` and `updated`
* timestamps) in the response.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
listCounterexamples(params: AssistantV1.ListCounterexamplesParams, callback?: AssistantV1.Callback<AssistantV1.CounterexampleCollection>): Promise<any> | void;
/**
* Update counterexample.
*
* Update the text of a counterexample. Counterexamples are examples that have been marked as irrelevant input.
*
* This operation is limited to 1000 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - 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.new_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
* - It must be no longer than 1024 characters.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
updateCounterexample(params: AssistantV1.UpdateCounterexampleParams, callback?: AssistantV1.Callback<AssistantV1.Counterexample>): Promise<any> | void;
/*************************
* entities
************************/
/**
* Create entity.
*
* Create a new entity, or enable a system entity.
*
* This operation is limited to 1000 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - 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.
* - It must be no longer than 64 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, and it must be no longer than 128 characters.
* @param {Object} [params.metadata] - Any metadata related to the entity.
* @param {boolean} [params.fuzzy_match] - Whether to use fuzzy matching for the entity.
* @param {CreateValue[]} [params.values] - An array of objects describing the entity values.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
createEntity(params: AssistantV1.CreateEntityParams, callback?: AssistantV1.Callback<AssistantV1.Entity>): Promise<any> | void;
/**
* Delete entity.
*
* Delete an entity from a workspace, or disable a system entity.
*
* This operation is limited to 1000 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - Unique identifier of the workspace.
* @param {string} params.entity - The name of the entity.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
deleteEntity(params: AssistantV1.DeleteEntityParams, callback?: AssistantV1.Callback<AssistantV1.Empty>): Promise<any> | void;
/**
* Get entity.
*
* Get information about an entity, optionally including all entity content.
*
* With **export**=`false`, this operation is limited to 6000 requests per 5 minutes. With **export**=`true`, the
* limit is 200 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - 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.include_audit] - Whether to include the audit properties (`created` and `updated`
* timestamps) in the response.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
getEntity(params: AssistantV1.GetEntityParams, callback?: AssistantV1.Callback<AssistantV1.Entity>): Promise<any> | void;
/**
* List entities.
*
* List the entities for a workspace.
*
* With **export**=`false`, this operation is limited to 1000 requests per 30 minutes. With **export**=`true`, the
* limit is 200 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - 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.page_limit] - The number of records to return in each page of results.
* @param {boolean} [params.include_count] - Whether to include information about the number of records returned.
* @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.include_audit] - Whether to include the audit properties (`created` and `updated`
* timestamps) in the response.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
listEntities(params: AssistantV1.ListEntitiesParams, callback?: AssistantV1.Callback<AssistantV1.EntityCollection>): Promise<any> | void;
/**
* Update entity.
*
* Update an existing entity with new or modified data. You must provide component objects defining the content of the
* updated entity.
*
* This operation is limited to 1000 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - Unique identifier of the workspace.
* @param {string} params.entity - The name of the entity.
* @param {string} [params.new_entity] - 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-`.
* - It must be no longer than 64 characters.
* @param {string} [params.new_description] - The description of the entity. This string cannot contain carriage
* return, newline, or tab characters, and it must be no longer than 128 characters.
* @param {Object} [params.new_metadata] - Any metadata related to the entity.
* @param {boolean} [params.new_fuzzy_match] - Whether to use fuzzy matching for the entity.
* @param {CreateValue[]} [params.new_values] - An array of objects describing the entity values.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
updateEntity(params: AssistantV1.UpdateEntityParams, callback?: AssistantV1.Callback<AssistantV1.Entity>): Promise<any> | void;
/*************************
* 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.
*
* This operation is limited to 200 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - 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.include_audit] - Whether to include the audit properties (`created` and `updated`
* timestamps) in the response.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
listMentions(params: AssistantV1.ListMentionsParams, callback?: AssistantV1.Callback<AssistantV1.EntityMentionCollection>): Promise<any> | void;
/*************************
* values
************************/
/**
* Create entity value.
*
* Create a new value for an entity.
*
* This operation is limited to 1000 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - Unique identifier of the workspace.
* @param {string} params.entity - The name of the entity.
* @param {string} params.value - 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.
* - It must be no longer than 64 characters.
* @param {Object} [params.metadata] - Any metadata related to the entity value.
* @param {string} [params.value_type] - Specifies the type of entity value.
* @param {string[]} [params.synonyms] - 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.
* - It must be no longer than 64 characters.
* @param {string[]} [params.patterns] - 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 no longer than
* 512 characters. For more information about how to specify a pattern, see the
* [documentation](https://cloud.ibm.com/docs/services/assistant/entities.html#entities-create-dictionary-based).
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
createValue(params: AssistantV1.CreateValueParams, callback?: AssistantV1.Callback<AssistantV1.Value>): Promise<any> | void;
/**
* Delete entity value.
*
* Delete a value from an entity.
*
* This operation is limited to 1000 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - Unique identifier of the workspace.
* @param {string} params.entity - The name of the entity.
* @param {string} params.value - The text of the entity value.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
deleteValue(params: AssistantV1.DeleteValueParams, callback?: AssistantV1.Callback<AssistantV1.Empty>): Promise<any> | void;
/**
* Get entity value.
*
* Get information about an entity value.
*
* This operation is limited to 6000 requests per 5 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - Unique identifier of the workspace.
* @param {string} params.entity - The name of the entity.
* @param {string} params.value - The text of the entity value.
* @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.include_audit] - Whether to include the audit properties (`created` and `updated`
* timestamps) in the response.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
getValue(params: AssistantV1.GetValueParams, callback?: AssistantV1.Callback<AssistantV1.Value>): Promise<any> | void;
/**
* List entity values.
*
* List the values for an entity.
*
* This operation is limited to 2500 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - 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.page_limit] - The number of records to return in each page of results.
* @param {boolean} [params.include_count] - Whether to include information about the number of records returned.
* @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.include_audit] - Whether to include the audit properties (`created` and `updated`
* timestamps) in the response.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
listValues(params: AssistantV1.ListValuesParams, callback?: AssistantV1.Callback<AssistantV1.ValueCollection>): Promise<any> | void;
/**
* 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.
*
* This operation is limited to 1000 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - Unique identifier of the workspace.
* @param {string} params.entity - The name of the entity.
* @param {string} params.value - The text of the entity value.
* @param {string} [params.new_value] - 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.
* - It must be no longer than 64 characters.
* @param {Object} [params.new_metadata] - Any metadata related to the entity value.
* @param {string} [params.new_value_type] - Specifies the type of entity value.
* @param {string[]} [params.new_synonyms] - 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.
* - It must be no longer than 64 characters.
* @param {string[]} [params.new_patterns] - 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 no longer than
* 512 characters. For more information about how to specify a pattern, see the
* [documentation](https://cloud.ibm.com/docs/services/assistant/entities.html#entities-create-dictionary-based).
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {Promise<any>|void}
*/
updateValue(params: AssistantV1.UpdateValueParams, callback?: AssistantV1.Callback<AssistantV1.Value>): Promise<any> | void;
/*************************
* synonyms
************************/
/**
* Create entity value synonym.
*
* Add a new synonym to an entity value.
*
* This operation is limited to 1000 requests per 30 minutes. For more information, see **Rate limiting**.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.workspace_id - Unique identifier of the workspace.
* @param {string} params.entity - The name of the entity.
* @param {string} params.value - The text of the entity value.
* @param {string} params.synony