diff --git a/assistant/v2.ts b/assistant/v2.ts index 38dd9ba5fb..3b5855804f 100644 --- a/assistant/v2.ts +++ b/assistant/v2.ts @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2025. + * (C) Copyright IBM Corp. 2026. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -424,21 +424,9 @@ class AssistantV2 extends BaseService { * 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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View Details**. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -501,21 +489,9 @@ class AssistantV2 extends BaseService { * [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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View 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. @@ -585,21 +561,9 @@ class AssistantV2 extends BaseService { * 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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View 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. @@ -666,21 +630,9 @@ class AssistantV2 extends BaseService { * 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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View 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. @@ -766,21 +718,9 @@ class AssistantV2 extends BaseService { * 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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View 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. @@ -867,21 +807,9 @@ class AssistantV2 extends BaseService { * 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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View 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. @@ -968,21 +896,9 @@ class AssistantV2 extends BaseService { * 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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View 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. @@ -1302,21 +1218,9 @@ class AssistantV2 extends BaseService { * 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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View 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 @@ -1388,21 +1292,9 @@ class AssistantV2 extends BaseService { * [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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View 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. @@ -1467,21 +1359,9 @@ class AssistantV2 extends BaseService { * [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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View 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. @@ -1563,21 +1443,9 @@ class AssistantV2 extends BaseService { * 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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View Details**. * @param {string} [params.description] - The description of the release. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} @@ -1642,21 +1510,9 @@ class AssistantV2 extends BaseService { * *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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View 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 @@ -1731,21 +1587,9 @@ class AssistantV2 extends BaseService { * 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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View 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. @@ -1807,21 +1651,9 @@ class AssistantV2 extends BaseService { * 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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View Details**. * @param {string} params.release - Unique identifier of the release. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} @@ -1881,21 +1713,9 @@ class AssistantV2 extends BaseService { * 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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View 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` @@ -1969,21 +1789,9 @@ class AssistantV2 extends BaseService { * 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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View 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. @@ -2055,21 +1863,9 @@ class AssistantV2 extends BaseService { * update endpoints.. * * @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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View 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. @@ -2141,21 +1937,9 @@ class AssistantV2 extends BaseService { * update endpoints.. * * @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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View 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. @@ -2229,21 +2013,9 @@ class AssistantV2 extends BaseService { * import via the "Get release import Status" endpoint. * * @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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View Details**. * @param {NodeJS.ReadableStream | Buffer} params.body - Request body is an Octet-stream of the artifact Zip file that * is being imported. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` @@ -2309,21 +2081,9 @@ class AssistantV2 extends BaseService { * either succeeded or failed. * * @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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View Details**. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers @@ -2386,21 +2146,9 @@ class AssistantV2 extends BaseService { * Get information about a skill. * * @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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View Details**. * @param {string} params.skillId - Unique identifier of the skill. To find the action or dialog skill ID in the * watsonx Assistant user interface, open the skill settings and click **API Details**. To find the search skill ID, * use the Get environment API to retrieve the skill references for an environment and it will include the search @@ -2465,21 +2213,9 @@ class AssistantV2 extends BaseService { * skill** method and checking the value of the **status** property. * * @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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View Details**. * @param {string} params.skillId - Unique identifier of the skill. To find the action or dialog skill ID in the * watsonx Assistant user interface, open the skill settings and click **API Details**. To find the search skill ID, * use the Get environment API to retrieve the skill references for an environment and it will include the search @@ -2575,21 +2311,9 @@ class AssistantV2 extends BaseService { * apply. * * @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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View Details**. * @param {boolean} [params.includeAudit] - Whether to include the audit properties (`created` and `updated` * timestamps) in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers @@ -2657,21 +2381,9 @@ class AssistantV2 extends BaseService { * **Get status of skills import** method. * * @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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View Details**. * @param {SkillImport[]} params.assistantSkills - An array of objects describing the skills for the assistant. * Included in responses only if **status**=`Available`. * @param {AssistantState} params.assistantState - Status information about the skills for the assistant. Included in @@ -2742,21 +2454,9 @@ class AssistantV2 extends BaseService { * Retrieve the status of an asynchronous import operation previously initiated by using the **Import skills** method. * * @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. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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.assistantId - Unique identifier of the assistant. To get the **assistant ID** in the watsonx + * Assistant interface, open the **Assistant settings** page, and scroll to the **Assistant IDs and API details** + * section and click **View Details**. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -2935,40 +2635,18 @@ namespace AssistantV2 { /** Parameters for the `deleteAssistant` operation. */ export interface DeleteAssistantParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; } /** Parameters for the `createSession` operation. */ export interface CreateSessionParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, @@ -2984,20 +2662,9 @@ namespace AssistantV2 { /** Parameters for the `deleteSession` operation. */ export interface DeleteSessionParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, @@ -3011,20 +2678,9 @@ namespace AssistantV2 { /** Parameters for the `message` operation. */ export interface MessageParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, @@ -3056,20 +2712,9 @@ namespace AssistantV2 { /** Parameters for the `messageStateless` operation. */ export interface MessageStatelessParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, @@ -3100,20 +2745,9 @@ namespace AssistantV2 { /** Parameters for the `messageStream` operation. */ export interface MessageStreamParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, @@ -3145,20 +2779,9 @@ namespace AssistantV2 { /** Parameters for the `messageStreamStateless` operation. */ export interface MessageStreamStatelessParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, @@ -3241,20 +2864,9 @@ namespace AssistantV2 { /** Parameters for the `listEnvironments` operation. */ export interface ListEnvironmentsParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** The number of records to return in each page of results. */ @@ -3284,20 +2896,9 @@ namespace AssistantV2 { /** Parameters for the `getEnvironment` operation. */ export interface GetEnvironmentParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, @@ -3311,20 +2912,9 @@ namespace AssistantV2 { /** Parameters for the `updateEnvironment` operation. */ export interface UpdateEnvironmentParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** Unique identifier of the environment. To find the environment ID in the watsonx Assistant user interface, @@ -3346,20 +2936,9 @@ namespace AssistantV2 { /** Parameters for the `createRelease` operation. */ export interface CreateReleaseParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** The description of the release. */ @@ -3368,20 +2947,9 @@ namespace AssistantV2 { /** Parameters for the `listReleases` operation. */ export interface ListReleasesParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** The number of records to return in each page of results. */ @@ -3411,20 +2979,9 @@ namespace AssistantV2 { /** Parameters for the `getRelease` operation. */ export interface GetReleaseParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** Unique identifier of the release. */ @@ -3435,20 +2992,9 @@ namespace AssistantV2 { /** Parameters for the `deleteRelease` operation. */ export interface DeleteReleaseParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** Unique identifier of the release. */ @@ -3457,20 +3003,9 @@ namespace AssistantV2 { /** Parameters for the `deployRelease` operation. */ export interface DeployReleaseParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** Unique identifier of the release. */ @@ -3483,20 +3018,9 @@ namespace AssistantV2 { /** Parameters for the `createReleaseExport` operation. */ export interface CreateReleaseExportParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** Unique identifier of the release. */ @@ -3507,20 +3031,9 @@ namespace AssistantV2 { /** Parameters for the `downloadReleaseExport` operation. */ export interface DownloadReleaseExportParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** Unique identifier of the release. */ @@ -3531,20 +3044,9 @@ namespace AssistantV2 { /** Parameters for the `downloadReleaseExportAsStream` operation. */ export interface DownloadReleaseExportAsStreamParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** Unique identifier of the release. */ @@ -3555,20 +3057,9 @@ namespace AssistantV2 { /** Parameters for the `createReleaseImport` operation. */ export interface CreateReleaseImportParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** Request body is an Octet-stream of the artifact Zip file that is being imported. */ @@ -3579,20 +3070,9 @@ namespace AssistantV2 { /** Parameters for the `getReleaseImportStatus` operation. */ export interface GetReleaseImportStatusParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ @@ -3601,20 +3081,9 @@ namespace AssistantV2 { /** Parameters for the `getSkill` operation. */ export interface GetSkillParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** Unique identifier of the skill. To find the action or dialog skill ID in the watsonx Assistant user @@ -3627,20 +3096,9 @@ namespace AssistantV2 { /** Parameters for the `updateSkill` operation. */ export interface UpdateSkillParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** Unique identifier of the skill. To find the action or dialog skill ID in the watsonx Assistant user @@ -3667,20 +3125,9 @@ namespace AssistantV2 { /** Parameters for the `exportSkills` operation. */ export interface ExportSkillsParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** Whether to include the audit properties (`created` and `updated` timestamps) in the response. */ @@ -3689,20 +3136,9 @@ namespace AssistantV2 { /** Parameters for the `importSkills` operation. */ export interface ImportSkillsParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; /** An array of objects describing the skills for the assistant. Included in responses only if @@ -3717,20 +3153,9 @@ namespace AssistantV2 { /** Parameters for the `importSkillsStatus` operation. */ export interface ImportSkillsStatusParams extends DefaultParams { - /** The assistant ID or the environment ID of the environment where the assistant is deployed. - * Set the value for this ID 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 get the **assistant ID** and **environment ID** in the watsonx Assistant interface, open the **Assistant - * settings** page, and scroll to the **Assistant IDs and API details** section and click **View Details**. - * - * **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**. + /** Unique identifier of the assistant. To get the **assistant ID** in the watsonx Assistant interface, open the + * **Assistant settings** page, and scroll to the **Assistant IDs and API details** section and click **View + * Details**. */ assistantId: string; } @@ -4118,6 +3543,27 @@ namespace AssistantV2 { input?: MessageInput; } + /** + * DtmfCommandInfo. + */ + export interface DtmfCommandInfo { + /** Specifies the type of DTMF command for the phone integration. */ + type: DtmfCommandInfo.Constants.Type | string; + /** Parameters specified by the command type. */ + parameters?: JsonObject; + } + export namespace DtmfCommandInfo { + export namespace Constants { + /** Specifies the type of DTMF command for the phone integration. */ + export enum Type { + COLLECT = 'collect', + DISABLE_BARGE_IN = 'disable_barge_in', + ENABLE_BARGE_IN = 'enable_barge_in', + SEND = 'send', + } + } + } + /** * Environment. */ @@ -7396,6 +6842,33 @@ namespace AssistantV2 { response_type: string; } + /** + * RuntimeResponseGenericRuntimeResponseTypeDtmf. + */ + export interface RuntimeResponseGenericRuntimeResponseTypeDtmf extends RuntimeResponseGeneric { + /** The type of response returned by the dialog node. The specified response type must be supported by the + * client application or channel. + */ + response_type: string; + command_info?: DtmfCommandInfo; + /** An array of objects specifying channels for which the response is intended. If **channels** is present, the + * response is intended for a built-in integration and should not be handled by an API client. + */ + channels?: ResponseGenericChannel[]; + } + + /** + * RuntimeResponseGenericRuntimeResponseTypeEndSession. + */ + export interface RuntimeResponseGenericRuntimeResponseTypeEndSession extends RuntimeResponseGeneric { + /** The type of response returned by the dialog node. The specified response type must be supported by the + * client application or channel. + */ + response_type: string; + /** For internal use only. */ + channel_options?: JsonObject; + } + /** * RuntimeResponseGenericRuntimeResponseTypeIframe. */ diff --git a/speech-to-text/v1-generated.ts b/speech-to-text/v1-generated.ts index 0468864ceb..6a8c4799fc 100644 --- a/speech-to-text/v1-generated.ts +++ b/speech-to-text/v1-generated.ts @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2025. +s * (C) Copyright IBM Corp. 2026. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -343,6 +343,13 @@ class SpeechToTextV1 extends BaseService { * `sad_module: 2` to increase accuracy and performance in detecting speech boundaries within the audio stream. See * [Using speech recognition * parameters](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-service-features#features-parameters). + * @param {string} [params.enrichments] - Speech transcript enrichment improves readability of raw ASR transcripts by + * adding punctuation (periods, commas, question marks, exclamation points) and intelligent capitalization (sentence + * beginnings, proper nouns, acronyms, brand names). To enable enrichment, add the `enrichments=punctuation` parameter + * to your recognition request. Supported languages include English (US, UK, Australia, India), French (France, + * Canada), German, Italian, Portuguese (Brazil, Portugal), Spanish (Spain, Latin America, Argentina, Chile, Colombia, + * Mexico, Peru), and Japanese. See [Speech transcript + * enrichment](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-speech-transcript-enrichment). * @param {string} [params.languageCustomizationId] - The customization ID (GUID) of a custom language model that is * to be used with the recognition request. The base model of the specified custom language model must match the model * specified with the `model` parameter. You must make the request with credentials for the instance of the service @@ -569,7 +576,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['audio']; - const _validParams = ['audio', 'contentType', 'model', 'speechBeginEvent', 'languageCustomizationId', 'acousticCustomizationId', 'baseModelVersion', 'customizationWeight', 'inactivityTimeout', 'keywords', 'keywordsThreshold', 'maxAlternatives', 'wordAlternativesThreshold', 'wordConfidence', 'timestamps', 'profanityFilter', 'smartFormatting', 'smartFormattingVersion', 'speakerLabels', 'grammarName', 'redaction', 'audioMetrics', 'endOfPhraseSilenceTime', 'splitTranscriptAtPhraseEnd', 'speechDetectorSensitivity', 'sadModule', 'backgroundAudioSuppression', 'lowLatency', 'characterInsertionBias', 'signal', 'headers']; + const _validParams = ['audio', 'contentType', 'model', 'speechBeginEvent', 'enrichments', 'languageCustomizationId', 'acousticCustomizationId', 'baseModelVersion', 'customizationWeight', 'inactivityTimeout', 'keywords', 'keywordsThreshold', 'maxAlternatives', 'wordAlternativesThreshold', 'wordConfidence', 'timestamps', 'profanityFilter', 'smartFormatting', 'smartFormattingVersion', 'speakerLabels', 'grammarName', 'redaction', 'audioMetrics', 'endOfPhraseSilenceTime', 'splitTranscriptAtPhraseEnd', 'speechDetectorSensitivity', 'sadModule', 'backgroundAudioSuppression', 'lowLatency', 'characterInsertionBias', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -579,6 +586,7 @@ class SpeechToTextV1 extends BaseService { const query = { 'model': _params.model, 'speech_begin_event': _params.speechBeginEvent, + 'enrichments': _params.enrichments, 'language_customization_id': _params.languageCustomizationId, 'acoustic_customization_id': _params.acousticCustomizationId, 'base_model_version': _params.baseModelVersion, @@ -939,6 +947,20 @@ class SpeechToTextV1 extends BaseService { * @param {number} [params.resultsTtl] - The number of minutes for which the results are to be available after the job * has finished. If not delivered via a callback, the results must be retrieved within this time. Omit the parameter * to use a time to live of one week. The parameter is valid with or without a callback URL. + * @param {boolean} [params.speechBeginEvent] - If `true`, the service returns a response object `SpeechActivity` + * which contains the time when a speech activity is detected in the stream. This can be used both in standard and low + * latency mode. This feature enables client applications to know that some words/speech has been detected and the + * service is in the process of decoding. This can be used in lieu of interim results in standard mode. Use + * `sad_module: 2` to increase accuracy and performance in detecting speech boundaries within the audio stream. See + * [Using speech recognition + * parameters](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-service-features#features-parameters). + * @param {string} [params.enrichments] - Speech transcript enrichment improves readability of raw ASR transcripts by + * adding punctuation (periods, commas, question marks, exclamation points) and intelligent capitalization (sentence + * beginnings, proper nouns, acronyms, brand names). To enable enrichment, add the `enrichments=punctuation` parameter + * to your recognition request. Supported languages include English (US, UK, Australia, India), French (France, + * Canada), German, Italian, Portuguese (Brazil, Portugal), Spanish (Spain, Latin America, Argentina, Chile, Colombia, + * Mexico, Peru), and Japanese. See [Speech transcript + * enrichment](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-speech-transcript-enrichment). * @param {string} [params.languageCustomizationId] - The customization ID (GUID) of a custom language model that is * to be used with the recognition request. The base model of the specified custom language model must match the model * specified with the `model` parameter. You must make the request with credentials for the instance of the service @@ -1185,7 +1207,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['audio']; - const _validParams = ['audio', 'contentType', 'model', 'callbackUrl', 'events', 'userToken', 'resultsTtl', 'languageCustomizationId', 'acousticCustomizationId', 'baseModelVersion', 'customizationWeight', 'inactivityTimeout', 'keywords', 'keywordsThreshold', 'maxAlternatives', 'wordAlternativesThreshold', 'wordConfidence', 'timestamps', 'profanityFilter', 'smartFormatting', 'smartFormattingVersion', 'speakerLabels', 'grammarName', 'redaction', 'processingMetrics', 'processingMetricsInterval', 'audioMetrics', 'endOfPhraseSilenceTime', 'splitTranscriptAtPhraseEnd', 'speechDetectorSensitivity', 'sadModule', 'backgroundAudioSuppression', 'lowLatency', 'characterInsertionBias', 'signal', 'headers']; + const _validParams = ['audio', 'contentType', 'model', 'callbackUrl', 'events', 'userToken', 'resultsTtl', 'speechBeginEvent', 'enrichments', 'languageCustomizationId', 'acousticCustomizationId', 'baseModelVersion', 'customizationWeight', 'inactivityTimeout', 'keywords', 'keywordsThreshold', 'maxAlternatives', 'wordAlternativesThreshold', 'wordConfidence', 'timestamps', 'profanityFilter', 'smartFormatting', 'smartFormattingVersion', 'speakerLabels', 'grammarName', 'redaction', 'processingMetrics', 'processingMetricsInterval', 'audioMetrics', 'endOfPhraseSilenceTime', 'splitTranscriptAtPhraseEnd', 'speechDetectorSensitivity', 'sadModule', 'backgroundAudioSuppression', 'lowLatency', 'characterInsertionBias', 'signal', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -1198,6 +1220,8 @@ class SpeechToTextV1 extends BaseService { 'events': _params.events, 'user_token': _params.userToken, 'results_ttl': _params.resultsTtl, + 'speech_begin_event': _params.speechBeginEvent, + 'enrichments': _params.enrichments, 'language_customization_id': _params.languageCustomizationId, 'acoustic_customization_id': _params.acousticCustomizationId, 'base_model_version': _params.baseModelVersion, @@ -4185,6 +4209,70 @@ class SpeechToTextV1 extends BaseService { }), }; + return this.createRequest(parameters); + } + /************************* + * languageIdentification + ************************/ + + /** + * Spoken language identification. + * + * Detects the spoken language in audio streams. The endpoint is `/v1/detect_language` and user can optionally include + * `lid_confidence` parameter to set a custom confidence threshold for detection. The model continuously processes + * incoming audio and returns the identified language when it reaches a confidence level higher than the specified + * threshold (0.99 by default). See [Spoken language + * identification](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-speech-language-identification). + * + * @param {Object} params - The parameters to send to the service. + * @param {number} params.lidConfidence - Set a custom confidence threshold for detection. + * @param {NodeJS.ReadableStream | Buffer} params.audio - The audio to transcribe. + * @param {string} [params.contentType] - The type of the input. + * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers + * @returns {Promise>} + */ + public detectLanguage( + params: SpeechToTextV1.DetectLanguageParams + ): Promise> { + const _params = { ...params }; + const _requiredParams = ['lidConfidence', 'audio']; + const _validParams = ['lidConfidence', 'audio', 'contentType', 'signal', 'headers']; + const _validationErrors = validateParams(_params, _requiredParams, _validParams); + if (_validationErrors) { + return Promise.reject(_validationErrors); + } + + const body = _params.audio; + const query = { + 'lid_confidence': _params.lidConfidence, + }; + + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'detectLanguage'); + + const parameters = { + options: { + url: '/v1/detect_language', + method: 'POST', + body, + qs: query, + }, + defaultOptions: extend(true, {}, this.baseOptions, { + headers: extend( + true, + sdkHeaders, + this.baseOptions.headers, + { + 'Accept': 'application/json', + 'Content-Type': _params.contentType, + }, + _params.headers + ), + axiosOptions: { + signal: _params.signal, + }, + }), + }; + return this.createRequest(parameters); } } @@ -4356,6 +4444,15 @@ namespace SpeechToTextV1 { * parameters](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-service-features#features-parameters). */ speechBeginEvent?: boolean; + /** Speech transcript enrichment improves readability of raw ASR transcripts by adding punctuation (periods, + * commas, question marks, exclamation points) and intelligent capitalization (sentence beginnings, proper nouns, + * acronyms, brand names). To enable enrichment, add the `enrichments=punctuation` parameter to your recognition + * request. Supported languages include English (US, UK, Australia, India), French (France, Canada), German, + * Italian, Portuguese (Brazil, Portugal), Spanish (Spain, Latin America, Argentina, Chile, Colombia, Mexico, + * Peru), and Japanese. See [Speech transcript + * enrichment](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-speech-transcript-enrichment). + */ + enrichments?: string; /** The customization ID (GUID) of a custom language model that is to be used with the recognition request. The * base model of the specified custom language model must match the model specified with the `model` parameter. You * must make the request with credentials for the instance of the service that owns the custom model. By default, @@ -4810,6 +4907,23 @@ namespace SpeechToTextV1 { * week. The parameter is valid with or without a callback URL. */ resultsTtl?: number; + /** If `true`, the service returns a response object `SpeechActivity` which contains the time when a speech + * activity is detected in the stream. This can be used both in standard and low latency mode. This feature enables + * client applications to know that some words/speech has been detected and the service is in the process of + * decoding. This can be used in lieu of interim results in standard mode. Use `sad_module: 2` to increase accuracy + * and performance in detecting speech boundaries within the audio stream. See [Using speech recognition + * parameters](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-service-features#features-parameters). + */ + speechBeginEvent?: boolean; + /** Speech transcript enrichment improves readability of raw ASR transcripts by adding punctuation (periods, + * commas, question marks, exclamation points) and intelligent capitalization (sentence beginnings, proper nouns, + * acronyms, brand names). To enable enrichment, add the `enrichments=punctuation` parameter to your recognition + * request. Supported languages include English (US, UK, Australia, India), French (France, Canada), German, + * Italian, Portuguese (Brazil, Portugal), Spanish (Spain, Latin America, Argentina, Chile, Colombia, Mexico, + * Peru), and Japanese. See [Speech transcript + * enrichment](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-speech-transcript-enrichment). + */ + enrichments?: string; /** The customization ID (GUID) of a custom language model that is to be used with the recognition request. The * base model of the specified custom language model must match the model specified with the `model` parameter. You * must make the request with credentials for the instance of the service that owns the custom model. By default, @@ -6096,6 +6210,39 @@ namespace SpeechToTextV1 { customerId: string; } + /** Parameters for the `detectLanguage` operation. */ + export interface DetectLanguageParams extends DefaultParams { + /** Set a custom confidence threshold for detection. */ + lidConfidence: number; + /** The audio to transcribe. */ + audio: NodeJS.ReadableStream | Buffer; + /** The type of the input. */ + contentType?: DetectLanguageConstants.ContentType | string; + } + + /** Constants for the `detectLanguage` operation. */ + export namespace DetectLanguageConstants { + /** The type of the input. */ + export enum ContentType { + APPLICATION_OCTET_STREAM = 'application/octet-stream', + AUDIO_ALAW = 'audio/alaw', + AUDIO_BASIC = 'audio/basic', + AUDIO_FLAC = 'audio/flac', + AUDIO_G729 = 'audio/g729', + AUDIO_L16 = 'audio/l16', + AUDIO_MP3 = 'audio/mp3', + AUDIO_MPEG = 'audio/mpeg', + AUDIO_MULAW = 'audio/mulaw', + AUDIO_OGG = 'audio/ogg', + AUDIO_OGG_CODECS_OPUS = 'audio/ogg;codecs=opus', + AUDIO_OGG_CODECS_VORBIS = 'audio/ogg;codecs=vorbis', + AUDIO_WAV = 'audio/wav', + AUDIO_WEBM = 'audio/webm', + AUDIO_WEBM_CODECS_OPUS = 'audio/webm;codecs=opus', + AUDIO_WEBM_CODECS_VORBIS = 'audio/webm;codecs=vorbis', + } + } + /************************* * model interfaces ************************/ @@ -6485,6 +6632,44 @@ namespace SpeechToTextV1 { display_as?: string; } + /** + * If enriched results are requested, transcription with inserted punctuation marks such as periods, commas, question + * marks, and exclamation points. + */ + export interface EnrichedResults { + /** If enriched results are requested, transcription with inserted punctuation marks such as periods, commas, + * question marks, and exclamation points. + */ + transcript?: EnrichedResultsTranscript; + /** The status of the enriched transcription. */ + status?: string; + } + + /** + * If enriched results are requested, transcription with inserted punctuation marks such as periods, commas, question + * marks, and exclamation points. + */ + export interface EnrichedResultsTranscript { + /** The transcript text. */ + text?: string; + /** The speaking time from the beginning of the transcript to the end. */ + timestamp?: EnrichedResultsTranscriptTimestamp; + } + + /** + * The speaking time from the beginning of the transcript to the end. + */ + export interface EnrichedResultsTranscriptTimestamp { + /** The start time of a word from the transcript. The value matches the start time of a word from the + * `timestamps` array. + */ + from?: number; + /** The end time of a word from the transcript. The value matches the end time of a word from the `timestamps` + * array. + */ + to?: number; + } + /** * Information about a grammar from a custom language model. */ @@ -6548,6 +6733,42 @@ namespace SpeechToTextV1 { confidence: number; } + /** + * Language detection results. + */ + export interface LanguageDetectionResult { + /** An array of `LanguageInfo` objects. */ + language_info?: LanguageInfo[]; + } + + /** + * Language detection results. + */ + export interface LanguageDetectionResults { + /** An array of `LanguageDetectionResult` objects. */ + results?: LanguageDetectionResult[]; + /** An index that indicates a change point in the `results` array. The service increments the index for + * additional results that it sends for new audio for the same request. All results with the same index are + * delivered at the same time. The same index can include multiple final results that are delivered with the same + * response. + */ + result_index?: number; + } + + /** + * Language detection info such as confidence and language detected. + */ + export interface LanguageInfo { + /** A score that indicates the service's confidence in its identification of the language in the range of 0.0 to + * 1.0. + */ + confidence?: number; + /** The language detected in standard abbreviated ISO 639 format. */ + language?: string; + /** The timestamp of the detected language. */ + timestamp?: number; + } + /** * Information about an existing custom language model. */ @@ -6880,8 +7101,7 @@ namespace SpeechToTextV1 { * * If `false`, the results are interim. They can be updated with further interim results until final results are * eventually sent. * - * **Note:** Because `final` is a reserved word in Java and Swift, the field is renamed `xFinal` in Java and is - * escaped with back quotes in Swift. + * **Note:** Because `final` is a reserved word in Java, the field is renamed `xFinal` in Java. */ final: boolean; /** An array of alternative transcripts. The `alternatives` array can include additional requested output such @@ -6969,6 +7189,10 @@ namespace SpeechToTextV1 { * In both cases, the request succeeds despite the warnings. */ warnings?: string[]; + /** If enriched results are requested, transcription with inserted punctuation marks such as periods, commas, + * question marks, and exclamation points. + */ + enriched_results?: EnrichedResults; } /** diff --git a/test/unit/speech-to-text.v1.test.js b/test/unit/speech-to-text.v1.test.js index bfaee9ce02..4afe2de96e 100644 --- a/test/unit/speech-to-text.v1.test.js +++ b/test/unit/speech-to-text.v1.test.js @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2025. + * (C) Copyright IBM Corp. 2026. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -274,6 +274,7 @@ describe('SpeechToTextV1', () => { const contentType = 'application/octet-stream'; const model = 'en-US_BroadbandModel'; const speechBeginEvent = false; + const enrichments = 'testString'; const languageCustomizationId = 'testString'; const acousticCustomizationId = 'testString'; const baseModelVersion = 'testString'; @@ -304,6 +305,7 @@ describe('SpeechToTextV1', () => { contentType, model, speechBeginEvent, + enrichments, languageCustomizationId, acousticCustomizationId, baseModelVersion, @@ -349,6 +351,7 @@ describe('SpeechToTextV1', () => { expect(mockRequestOptions.body).toEqual(audio); expect(mockRequestOptions.qs.model).toEqual(model); expect(mockRequestOptions.qs.speech_begin_event).toEqual(speechBeginEvent); + expect(mockRequestOptions.qs.enrichments).toEqual(enrichments); expect(mockRequestOptions.qs.language_customization_id).toEqual(languageCustomizationId); expect(mockRequestOptions.qs.acoustic_customization_id).toEqual(acousticCustomizationId); expect(mockRequestOptions.qs.base_model_version).toEqual(baseModelVersion); @@ -616,6 +619,8 @@ describe('SpeechToTextV1', () => { const events = 'recognitions.started'; const userToken = 'testString'; const resultsTtl = 38; + const speechBeginEvent = false; + const enrichments = 'testString'; const languageCustomizationId = 'testString'; const acousticCustomizationId = 'testString'; const baseModelVersion = 'testString'; @@ -651,6 +656,8 @@ describe('SpeechToTextV1', () => { events, userToken, resultsTtl, + speechBeginEvent, + enrichments, languageCustomizationId, acousticCustomizationId, baseModelVersion, @@ -701,6 +708,8 @@ describe('SpeechToTextV1', () => { expect(mockRequestOptions.qs.events).toEqual(events); expect(mockRequestOptions.qs.user_token).toEqual(userToken); expect(mockRequestOptions.qs.results_ttl).toEqual(resultsTtl); + expect(mockRequestOptions.qs.speech_begin_event).toEqual(speechBeginEvent); + expect(mockRequestOptions.qs.enrichments).toEqual(enrichments); expect(mockRequestOptions.qs.language_customization_id).toEqual(languageCustomizationId); expect(mockRequestOptions.qs.acoustic_customization_id).toEqual(acousticCustomizationId); expect(mockRequestOptions.qs.base_model_version).toEqual(baseModelVersion); @@ -3835,4 +3844,96 @@ describe('SpeechToTextV1', () => { }); }); }); + + describe('detectLanguage', () => { + describe('positive tests', () => { + function __detectLanguageTest() { + // Construct the params object for operation detectLanguage + const lidConfidence = 36.0; + const audio = Buffer.from('This is a mock file.'); + const contentType = 'application/octet-stream'; + const detectLanguageParams = { + lidConfidence, + audio, + contentType, + }; + + const detectLanguageResult = speechToTextService.detectLanguage(detectLanguageParams); + + // all methods should return a Promise + expectToBePromise(detectLanguageResult); + + // assert that create request was called + expect(createRequestMock).toHaveBeenCalledTimes(1); + + const mockRequestOptions = getOptions(createRequestMock); + + checkUrlAndMethod(mockRequestOptions, '/v1/detect_language', 'POST'); + const expectedAccept = 'application/json'; + const expectedContentType = contentType; + checkMediaHeaders(createRequestMock, expectedAccept, expectedContentType); + checkUserHeader(createRequestMock, 'Content-Type', contentType); + expect(mockRequestOptions.body).toEqual(audio); + expect(mockRequestOptions.qs.lid_confidence).toEqual(lidConfidence); + } + + test('should pass the right params to createRequest with enable and disable retries', () => { + // baseline test + __detectLanguageTest(); + + // enable retries and test again + createRequestMock.mockClear(); + speechToTextService.enableRetries(); + __detectLanguageTest(); + + // disable retries and test again + createRequestMock.mockClear(); + speechToTextService.disableRetries(); + __detectLanguageTest(); + }); + + test('should prioritize user-given headers', () => { + // parameters + const lidConfidence = 36.0; + const audio = Buffer.from('This is a mock file.'); + const userAccept = 'fake/accept'; + const userContentType = 'fake/contentType'; + const detectLanguageParams = { + lidConfidence, + audio, + headers: { + Accept: userAccept, + 'Content-Type': userContentType, + }, + }; + + speechToTextService.detectLanguage(detectLanguageParams); + checkMediaHeaders(createRequestMock, userAccept, userContentType); + }); + }); + + describe('negative tests', () => { + test('should enforce required parameters', async () => { + let err; + try { + await speechToTextService.detectLanguage({}); + } catch (e) { + err = e; + } + + expect(err.message).toMatch(/Missing required parameters/); + }); + + test('should reject promise when required params are not given', async () => { + let err; + try { + await speechToTextService.detectLanguage(); + } catch (e) { + err = e; + } + + expect(err.message).toMatch(/Missing required parameters/); + }); + }); + }); });