UNPKG

ibm-watson

Version:
763 lines 252 kB
/** * (C) Copyright IBM Corp. 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" /> /// <reference types="node" /> import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'; import { BaseService, UserOptions } from 'ibm-cloud-sdk-core'; /** * The IBM&reg; watsonx&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 v2 API provides runtime methods your client application can use to send user input to an assistant and * receive a response. * * You need a paid Plus plan or higher to use the watsonx Assistant v2 API. * * API Version: 2.0 * See: https://cloud.ibm.com/docs/assistant */ declare class AssistantV2 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 * `2023-06-15`. */ version: string; /** * Construct a AssistantV2 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 `2023-06-15`. * @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 {AssistantV2} */ constructor(options: UserOptions); /************************* * conversationalSkillProviders ************************/ /** * Create a conversational skill provider. * * Create a new conversational skill provider. * * @param {Object} params - The parameters to send to the service. * @param {string} params.providerId - The unique identifier of the provider. * @param {ProviderSpecification} params.specification - The specification of the provider. * @param {ProviderPrivate} params._private - Private information of the provider. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV2.Response<AssistantV2.ProviderResponse>>} */ createProvider(params: AssistantV2.CreateProviderParams): Promise<AssistantV2.Response<AssistantV2.ProviderResponse>>; /** * List conversational skill providers. * * List the conversational skill providers 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 conversational skill providers 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<AssistantV2.Response<AssistantV2.ProviderCollection>>} */ listProviders(params?: AssistantV2.ListProvidersParams): Promise<AssistantV2.Response<AssistantV2.ProviderCollection>>; /** * Update a conversational skill provider. * * Update a new conversational skill provider. * * @param {Object} params - The parameters to send to the service. * @param {string} params.providerId - Unique identifier of the conversational skill provider. * @param {ProviderSpecification} params.specification - The specification of the provider. * @param {ProviderPrivate} params._private - Private information of the provider. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV2.Response<AssistantV2.ProviderResponse>>} */ updateProvider(params: AssistantV2.UpdateProviderParams): Promise<AssistantV2.Response<AssistantV2.ProviderResponse>>; /************************* * assistants ************************/ /** * Create an assistant. * * Create a new assistant. * * @param {Object} [params] - The parameters to send to the service. * @param {string} [params.language] - The language of the assistant. * @param {string} [params.name] - The name of the assistant. This string cannot contain carriage return, newline, or * tab characters. * @param {string} [params.description] - The description of the assistant. This string cannot contain carriage * return, newline, or tab characters. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV2.Response<AssistantV2.AssistantData>>} */ createAssistant(params?: AssistantV2.CreateAssistantParams): Promise<AssistantV2.Response<AssistantV2.AssistantData>>; /** * List assistants. * * List the assistants associated with a watsonx 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 assistants 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<AssistantV2.Response<AssistantV2.AssistantCollection>>} */ listAssistants(params?: AssistantV2.ListAssistantsParams): Promise<AssistantV2.Response<AssistantV2.AssistantCollection>>; /** * Delete assistant. * * Delete an assistant. * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant * is deployed, depending on the type of request: * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. * - For all other requests, specify the assistant ID of the assistant. * * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings * and scroll to the **Environments** section. * * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the * assistant ID in the user interface, open the assistant settings and click API Details. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV2.Response<AssistantV2.EmptyObject>>} */ deleteAssistant(params: AssistantV2.DeleteAssistantParams): Promise<AssistantV2.Response<AssistantV2.EmptyObject>>; /************************* * sessions ************************/ /** * Create a session. * * Create a new session. A session is used to send user input to a skill and receive responses. It also maintains the * state of the conversation. A session persists until it is deleted, or until it times out because of inactivity. * (For more information, see the * [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-settings).). * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant * is deployed, depending on the type of request: * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. * - For all other requests, specify the assistant ID of the assistant. * * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings * and scroll to the **Environments** section. * * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the * assistant ID in the user interface, open the assistant settings and click API Details. * @param {RequestAnalytics} [params.analytics] - An optional object containing analytics data. Currently, this data * is used only for events sent to the Segment extension. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV2.Response<AssistantV2.SessionResponse>>} */ createSession(params: AssistantV2.CreateSessionParams): Promise<AssistantV2.Response<AssistantV2.SessionResponse>>; /** * Delete session. * * Deletes a session explicitly before it times out. (For more information about the session inactivity timeout, see * the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant-settings)). * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant * is deployed, depending on the type of request: * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. * - For all other requests, specify the assistant ID of the assistant. * * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings * and scroll to the **Environments** section. * * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the * assistant ID in the user interface, open the assistant settings and click API Details. * @param {string} params.sessionId - Unique identifier of the session. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV2.Response<AssistantV2.EmptyObject>>} */ deleteSession(params: AssistantV2.DeleteSessionParams): Promise<AssistantV2.Response<AssistantV2.EmptyObject>>; /************************* * message ************************/ /** * Send user input to assistant (stateful). * * Send user input to an assistant and receive a response, with conversation state (including context data) stored by * watsonx Assistant for the duration of the session. * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant * is deployed, depending on the type of request: * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. * - For all other requests, specify the assistant ID of the assistant. * * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings * and scroll to the **Environments** section. * * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the * assistant ID in the user interface, open the assistant settings and click API Details. * @param {string} params.environmentId - Unique identifier of the environment. To find the environment ID in the * watsonx Assistant user interface, open the environment settings and click **API Details**. **Note:** Currently, the * API does not support creating environments. * @param {string} params.sessionId - Unique identifier of the session. * @param {MessageInput} [params.input] - An input object that includes the input text. * @param {MessageContext} [params.context] - Context data for the conversation. You can use this property to set or * modify context variables, which can also be accessed by dialog nodes. The context is stored by the assistant on a * per-session basis. * * **Note:** The total size of the context data stored for a stateful session cannot exceed 100KB. * @param {string} [params.userId] - A string value that identifies the user who is interacting with the assistant. * 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.global.session_id**. * * **Note:** This property is the same as the **user_id** property in the global system context. If **user_id** is * specified in both locations, the value specified at the root is used. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV2.Response<AssistantV2.StatefulMessageResponse>>} */ message(params: AssistantV2.MessageParams): Promise<AssistantV2.Response<AssistantV2.StatefulMessageResponse>>; /** * Send user input to assistant (stateless). * * Send user input to an assistant and receive a response, with conversation state (including context data) managed by * your application. * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant * is deployed, depending on the type of request: * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. * - For all other requests, specify the assistant ID of the assistant. * * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings * and scroll to the **Environments** section. * * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the * assistant ID in the user interface, open the assistant settings and click API Details. * @param {string} params.environmentId - Unique identifier of the environment. To find the environment ID in the * watsonx Assistant user interface, open the environment settings and click **API Details**. **Note:** Currently, the * API does not support creating environments. * @param {StatelessMessageInput} [params.input] - An input object that includes the input text. * @param {StatelessMessageContext} [params.context] - Context data for the conversation. You can use this property to * set or modify context variables, which can also be accessed by dialog nodes. The context is not stored by the * assistant. To maintain session state, include the context from the previous response. * * **Note:** The total size of the context data for a stateless session cannot exceed 250KB. * @param {string} [params.userId] - A string value that identifies the user who is interacting with the assistant. * 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.global.session_id**. * * **Note:** This property is the same as the **user_id** property in the global system context. If **user_id** is * specified in both locations in a message request, the value specified at the root is used. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV2.Response<AssistantV2.StatelessMessageResponse>>} */ messageStateless(params: AssistantV2.MessageStatelessParams): Promise<AssistantV2.Response<AssistantV2.StatelessMessageResponse>>; /************************* * messageStream ************************/ /** * Send user input to assistant (stateful). * * Send user input to an assistant and receive a streamed response, with conversation state (including context data) * stored by watsonx Assistant for the duration of the session. * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant * is deployed, depending on the type of request: * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. * - For all other requests, specify the assistant ID of the assistant. * * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings * and scroll to the **Environments** section. * * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the * assistant ID in the user interface, open the assistant settings and click API Details. * @param {string} params.environmentId - Unique identifier of the environment. To find the environment ID in the * watsonx Assistant user interface, open the environment settings and click **API Details**. **Note:** Currently, the * API does not support creating environments. * @param {string} params.sessionId - Unique identifier of the session. * @param {MessageInput} [params.input] - An input object that includes the input text. * @param {MessageContext} [params.context] - Context data for the conversation. You can use this property to set or * modify context variables, which can also be accessed by dialog nodes. The context is stored by the assistant on a * per-session basis. * * **Note:** The total size of the context data stored for a stateful session cannot exceed 100KB. * @param {string} [params.userId] - A string value that identifies the user who is interacting with the assistant. * 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.global.session_id**. * * **Note:** This property is the same as the **user_id** property in the global system context. If **user_id** is * specified in both locations, the value specified at the root is used. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV2.Response<NodeJS.ReadableStream>>} */ messageStream(params: AssistantV2.MessageStreamParams): Promise<AssistantV2.Response<NodeJS.ReadableStream>>; /** * Send user input to assistant (stateless). * * Send user input to an assistant and receive a response, with conversation state (including context data) managed by * your application. * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant * is deployed, depending on the type of request: * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. * - For all other requests, specify the assistant ID of the assistant. * * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings * and scroll to the **Environments** section. * * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the * assistant ID in the user interface, open the assistant settings and click API Details. * @param {string} params.environmentId - Unique identifier of the environment. To find the environment ID in the * watsonx Assistant user interface, open the environment settings and click **API Details**. **Note:** Currently, the * API does not support creating environments. * @param {MessageInput} [params.input] - An input object that includes the input text. * @param {MessageContext} [params.context] - Context data for the conversation. You can use this property to set or * modify context variables, which can also be accessed by dialog nodes. The context is stored by the assistant on a * per-session basis. * * **Note:** The total size of the context data stored for a stateful session cannot exceed 100KB. * @param {string} [params.userId] - A string value that identifies the user who is interacting with the assistant. * 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.global.session_id**. * * **Note:** This property is the same as the **user_id** property in the global system context. If **user_id** is * specified in both locations, the value specified at the root is used. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV2.Response<NodeJS.ReadableStream>>} */ messageStreamStateless(params: AssistantV2.MessageStreamStatelessParams): Promise<AssistantV2.Response<NodeJS.ReadableStream>>; /************************* * bulkClassify ************************/ /** * Identify intents and entities in multiple user utterances. * * Send multiple user inputs to a dialog skill in a single request and receive information about the intents and * entities recognized in each input. This method is useful for testing and comparing the performance of different * skills or skill versions. * * This method is available only with Enterprise with Data Isolation plans. * * @param {Object} params - The parameters to send to the service. * @param {string} params.skillId - Unique identifier of the skill. To find the skill ID in the watsonx Assistant user * interface, open the skill settings and click **API Details**. * @param {BulkClassifyUtterance[]} params.input - An array of input utterances to classify. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV2.Response<AssistantV2.BulkClassifyResponse>>} */ bulkClassify(params: AssistantV2.BulkClassifyParams): Promise<AssistantV2.Response<AssistantV2.BulkClassifyResponse>>; /************************* * logs ************************/ /** * List log events for an assistant. * * List the events from the log of an assistant. * * This method requires Manager access. * * **Note:** If you use the **cursor** parameter to retrieve results one page at a time, subsequent requests must be * no more than 5 minutes apart. Any returned value for the **cursor** parameter becomes invalid after 5 minutes. For * more information about using pagination, see [Pagination](#pagination). * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant * is deployed, depending on the type of request: * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. * - For all other requests, specify the assistant ID of the assistant. * * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings * and scroll to the **Environments** section. * * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the * assistant ID in the user interface, open the assistant settings and click API Details. * @param {string} [params.sort] - How to sort the returned log events. You can sort by **request_timestamp**. To * reverse the sort order, prefix the parameter value with a minus sign (`-`). * @param {string} [params.filter] - A cacheable parameter that limits the results to those matching the specified * filter. For more information, see the * [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-filter-reference#filter-reference). * @param {number} [params.pageLimit] - The number of records to return in each page of results. * * **Note:** If the API is not returning your data, try lowering the page_limit value. * @param {string} [params.cursor] - A token identifying the page of results to retrieve. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV2.Response<AssistantV2.LogCollection>>} */ listLogs(params: AssistantV2.ListLogsParams): Promise<AssistantV2.Response<AssistantV2.LogCollection>>; /************************* * userData ************************/ /** * Delete labeled data. * * Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with * the customer ID. * * You associate a customer ID with data by passing the `X-Watson-Metadata` header with a request that passes data. * For more information about personal data and customer IDs, see [Information * security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security). * * **Note:** This operation is intended only for deleting data associated with a single specific customer, not for * deleting data associated with multiple customers or for any other purpose. For more information, see [Labeling and * deleting data in watsonx * Assistant](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security-gdpr-wa). * * @param {Object} params - The parameters to send to the service. * @param {string} params.customerId - The customer ID for which all data is to be deleted. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV2.Response<AssistantV2.EmptyObject>>} */ deleteUserData(params: AssistantV2.DeleteUserDataParams): Promise<AssistantV2.Response<AssistantV2.EmptyObject>>; /************************* * environments ************************/ /** * List environments. * * List the environments associated with an assistant. * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant * is deployed, depending on the type of request: * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. * - For all other requests, specify the assistant ID of the assistant. * * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings * and scroll to the **Environments** section. * * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the * assistant ID in the user interface, open the assistant settings and click API Details. * @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 environments 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<AssistantV2.Response<AssistantV2.EnvironmentCollection>>} */ listEnvironments(params: AssistantV2.ListEnvironmentsParams): Promise<AssistantV2.Response<AssistantV2.EnvironmentCollection>>; /** * Get environment. * * Get information about an environment. For more information about environments, see * [Environments](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-publish-overview#environments). * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant * is deployed, depending on the type of request: * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. * - For all other requests, specify the assistant ID of the assistant. * * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings * and scroll to the **Environments** section. * * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the * assistant ID in the user interface, open the assistant settings and click API Details. * @param {string} params.environmentId - Unique identifier of the environment. To find the environment ID in the * watsonx Assistant user interface, open the environment settings and click **API Details**. **Note:** Currently, the * API does not support creating environments. * @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<AssistantV2.Response<AssistantV2.Environment>>} */ getEnvironment(params: AssistantV2.GetEnvironmentParams): Promise<AssistantV2.Response<AssistantV2.Environment>>; /** * Update environment. * * Update an environment with new or modified data. For more information about environments, see * [Environments](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-publish-overview#environments). * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant * is deployed, depending on the type of request: * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. * - For all other requests, specify the assistant ID of the assistant. * * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings * and scroll to the **Environments** section. * * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the * assistant ID in the user interface, open the assistant settings and click API Details. * @param {string} params.environmentId - Unique identifier of the environment. To find the environment ID in the * watsonx Assistant user interface, open the environment settings and click **API Details**. **Note:** Currently, the * API does not support creating environments. * @param {string} [params.name] - The name of the environment. * @param {string} [params.description] - The description of the environment. * @param {UpdateEnvironmentOrchestration} [params.orchestration] - The search skill orchestration settings for the * environment. * @param {number} [params.sessionTimeout] - The session inactivity timeout setting for the environment (in seconds). * @param {EnvironmentSkill[]} [params.skillReferences] - An array of objects identifying the skills (such as action * and dialog) that exist in the environment. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV2.Response<AssistantV2.Environment>>} */ updateEnvironment(params: AssistantV2.UpdateEnvironmentParams): Promise<AssistantV2.Response<AssistantV2.Environment>>; /************************* * releases ************************/ /** * Create release. * * Create a new release using the current content of the dialog and action skills in the draft environment. (In the * watsonx Assistant user interface, a release is called a *version*.). * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant * is deployed, depending on the type of request: * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. * - For all other requests, specify the assistant ID of the assistant. * * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings * and scroll to the **Environments** section. * * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the * assistant ID in the user interface, open the assistant settings and click API Details. * @param {string} [params.description] - The description of the release. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV2.Response<AssistantV2.Release>>} */ createRelease(params: AssistantV2.CreateReleaseParams): Promise<AssistantV2.Response<AssistantV2.Release>>; /** * List releases. * * List the releases associated with an assistant. (In the watsonx Assistant user interface, a release is called a * *version*.). * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant * is deployed, depending on the type of request: * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. * - For all other requests, specify the assistant ID of the assistant. * * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings * and scroll to the **Environments** section. * * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the * assistant ID in the user interface, open the assistant settings and click API Details. * @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<AssistantV2.Response<AssistantV2.ReleaseCollection>>} */ listReleases(params: AssistantV2.ListReleasesParams): Promise<AssistantV2.Response<AssistantV2.ReleaseCollection>>; /** * Get release. * * Get information about a release. * * Release data is not available until publishing of the release completes. If publishing is still in progress, you * can continue to poll by calling the same request again and checking the value of the **status** property. When * processing has completed, the request returns the release data. * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant * is deployed, depending on the type of request: * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. * - For all other requests, specify the assistant ID of the assistant. * * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings * and scroll to the **Environments** section. * * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the * assistant ID in the user interface, open the assistant settings and click API Details. * @param {string} params.release - Unique identifier of the release. * @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<AssistantV2.Response<AssistantV2.Release>>} */ getRelease(params: AssistantV2.GetReleaseParams): Promise<AssistantV2.Response<AssistantV2.Release>>; /** * Delete release. * * Delete a release. (In the watsonx Assistant user interface, a release is called a *version*.). * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant * is deployed, depending on the type of request: * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. * - For all other requests, specify the assistant ID of the assistant. * * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings * and scroll to the **Environments** section. * * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the * assistant ID in the user interface, open the assistant settings and click API Details. * @param {string} params.release - Unique identifier of the release. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<AssistantV2.Response<AssistantV2.EmptyObject>>} */ deleteRelease(params: AssistantV2.DeleteReleaseParams): Promise<AssistantV2.Response<AssistantV2.EmptyObject>>; /** * Deploy release. * * Update the environment with the content of the release. All snapshots saved as part of the release become active in * the environment. * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant * is deployed, depending on the type of request: * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. * - For all other requests, specify the assistant ID of the assistant. * * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings * and scroll to the **Environments** section. * * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the * assistant ID in the user interface, open the assistant settings and click API Details. * @param {string} params.release - Unique identifier of the release. * @param {string} params.environmentId - The environment ID of the environment where the release is to be deployed. * @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<AssistantV2.Response<AssistantV2.Environment>>} */ deployRelease(params: AssistantV2.DeployReleaseParams): Promise<AssistantV2.Response<AssistantV2.Environment>>; /** * Create release export. * * Initiate an asynchronous process which will create a downloadable Zip file artifact (/package) for an assistant * release. This artifact will contain Action and/or Dialog skills that are part of the release. The Dialog skill will * only be included in the event that coexistence is enabled on the assistant. The expected workflow with the use of * Release Export endpoint is to first initiate the creation of the artifact with the POST endpoint and then poll the * GET endpoint to retrieve the artifact. Once the artifact has been created, it will last for the duration (/scope) * of the release. * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant * is deployed, depending on the type of request: * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. * - For all other requests, specify the assistant ID of the assistant. * * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings * and scroll to the **Environments** section. * * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the * assistant ID in the user interface, open the assistant settings and click API Details. * @param {string} params.release - Unique identifier of the release. * @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<AssistantV2.Response<AssistantV2.CreateReleaseExportWithStatusErrors>>} */ createReleaseExport(params: AssistantV2.CreateReleaseExportParams): Promise<AssistantV2.Response<AssistantV2.CreateReleaseExportWithStatusErrors>>; /** * Get release export. * * A dual function endpoint to either retrieve the Zip file artifact that is associated with an assistant release or, * retrieve the status of the artifact's creation. It is assumed that the artifact creation was already initiated * prior to calling this endpoint. In the event that the artifact is not yet created and ready for download, this * endpoint can be used to poll the system until the creation is completed or has failed. On the other hand, if the * artifact is created, this endpoint will return the Zip file artifact as an octet stream. Once the artifact has been * created, it will last for the duration (/scope) of the release. <br /><br /> When you will have downloaded the Zip * file artifact, you have one of three ways to import it into an assistant's draft environment. These are as follows. * <br /><ol><li>Import the zip package in Tooling via <var>"Assistant Settings" -> "Download/Upload files" -> * "Upload" -> "Assistant only"</var>.</li><li>Import the zip package via "Create release import" endpoint using the * APIs.</li><li>Extract the contents of the Zip file artifact and individually import the skill JSONs via skill * update endpoints.</li></ol>. * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant * is deployed, depending on the type of request: * - For message, session, and log requests, specify the environment ID of the environment where the assistant is * deployed. * - For all other requests, specify the assistant ID of the assistant. * * To find the environment ID or assistant ID in the watsonx Assistant user interface, open the assistant settings * and scroll to the **Environments** section. * * **Note:** If you are using the classic Watson Assistant experience, always use the assistant ID. To find the * assistant ID in the user interface, open the assistant settings and click API Details. * @param {string} params.release - Unique identifier of the release. * @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<AssistantV2.Response<AssistantV2.CreateReleaseExportWithStatusErrors>>} */ downloadReleaseExport(params: AssistantV2.DownloadReleaseExportParams): Promise<AssistantV2.Response<AssistantV2.CreateReleaseExportWithStatusErrors>>; /** * Get release export as stream. * * A dual function endpoint to either retrieve the Zip file artifact that is associated with an assistant release or, * retrieve the status of the artifact's creation. It is assumed that the artifact creation was already initiated * prior to calling this endpoint. In the event that the artifact is not yet created and ready for download, this * endpoint can be used to poll the system until the creation is completed or has failed. On the other hand, if the * artifact is created, this endpoint will return the Zip file artifact as an octet stream. Once the artifact has been * created, it will last for the duration (/scope) of the release. <br /><br /> When you will have downloaded the Zip * file artifact, you have one of three ways to import it into an assistant's draft environment. These are as follows. * <br /><ol><li>Import the zip package in Tooling via <var>"Assistant Settings" -> "Download/Upload files" -> * "Upload" -> "Assistant only"</var>.</li><li>Import the zip package via "Create release import" endpoint using the * APIs.</li><li>Extract the contents of the Zip file artifact and individually import the skill JSONs via skill * update endpoints.</li></ol>. * * @param {Object} params - The parameters to send to the service. * @param {string} params.assistantId - The assistant ID or the environment ID of the environment where the assistant * is deploye