diff --git a/discovery/v2.ts b/discovery/v2.ts index 61acbe18fb..80ae21ce02 100644 --- a/discovery/v2.ts +++ b/discovery/v2.ts @@ -150,6 +150,8 @@ class DiscoveryV2 extends BaseService { * * The `content_mining` and `content_intelligence` types are available with Premium plan managed deployments and * installed deployments only. + * + * The Intelligent Document Processing (IDP) project type is available from IBM Cloud-managed instances only. * @param {DefaultQueryParams} [params.defaultQueryParameters] - Default query parameters for this project. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} @@ -206,8 +208,8 @@ class DiscoveryV2 extends BaseService { * Get details on the specified project. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -260,8 +262,8 @@ class DiscoveryV2 extends BaseService { * Update the specified project's name. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. * @param {string} [params.name] - The new name to give this project. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} @@ -324,8 +326,8 @@ class DiscoveryV2 extends BaseService { * collections. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -377,8 +379,8 @@ class DiscoveryV2 extends BaseService { * Gets a list of the unique fields (and their types) stored in the specified collections. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. * @param {string[]} [params.collectionIds] - Comma separated list of the collection IDs. If this parameter is not * specified, all collections in the project are used. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers @@ -437,8 +439,8 @@ class DiscoveryV2 extends BaseService { * Lists existing collections for the specified project. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -491,12 +493,14 @@ class DiscoveryV2 extends BaseService { * Create a new collection in the specified project. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. * @param {string} params.name - The name of the collection. * @param {string} [params.description] - A description of the collection. * @param {string} [params.language] - The language of the collection. For a list of supported languages, see the * [product documentation](/docs/discovery-data?topic=discovery-data-language-support). + * @param {boolean} [params.ocrEnabled] - If set to `true`, optical character recognition (OCR) is enabled. For more + * information, see [Optical character recognition](/docs/discovery-data?topic=discovery-data-collections#ocr). * @param {CollectionEnrichment[]} [params.enrichments] - An array of enrichments that are applied to this collection. * To get a list of enrichments that are available for a project, use the [List enrichments](#listenrichments) method. * @@ -511,7 +515,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'name']; - const _validParams = ['projectId', 'name', 'description', 'language', 'enrichments', 'headers']; + const _validParams = ['projectId', 'name', 'description', 'language', 'ocrEnabled', 'enrichments', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -521,6 +525,7 @@ class DiscoveryV2 extends BaseService { 'name': _params.name, 'description': _params.description, 'language': _params.language, + 'ocr_enabled': _params.ocrEnabled, 'enrichments': _params.enrichments, }; @@ -564,9 +569,9 @@ class DiscoveryV2 extends BaseService { * Get details about the specified collection. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.collectionId - The ID of the collection. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.collectionId - The Universally Unique Identifier (UUID) of the collection. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -631,11 +636,13 @@ class DiscoveryV2 extends BaseService { * empty `normalizations` object (`[]`) in the request. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.collectionId - The ID of the collection. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.collectionId - The Universally Unique Identifier (UUID) of the collection. * @param {string} [params.name] - The new name of the collection. * @param {string} [params.description] - The new description of the collection. + * @param {boolean} [params.ocrEnabled] - If set to `true`, optical character recognition (OCR) is enabled. For more + * information, see [Optical character recognition](/docs/discovery-data?topic=discovery-data-collections#ocr). * @param {CollectionEnrichment[]} [params.enrichments] - An array of enrichments that are applied to this collection. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} @@ -645,7 +652,7 @@ class DiscoveryV2 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['projectId', 'collectionId']; - const _validParams = ['projectId', 'collectionId', 'name', 'description', 'enrichments', 'headers']; + const _validParams = ['projectId', 'collectionId', 'name', 'description', 'ocrEnabled', 'enrichments', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -654,6 +661,7 @@ class DiscoveryV2 extends BaseService { const body = { 'name': _params.name, 'description': _params.description, + 'ocr_enabled': _params.ocrEnabled, 'enrichments': _params.enrichments, }; @@ -699,9 +707,9 @@ class DiscoveryV2 extends BaseService { * is also deleted. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.collectionId - The ID of the collection. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.collectionId - The Universally Unique Identifier (UUID) of the collection. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -761,9 +769,9 @@ class DiscoveryV2 extends BaseService { * from IBM Cloud-managed instances. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.collectionId - The ID of the collection. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.collectionId - The Universally Unique Identifier (UUID) of the collection. * @param {number} [params.count] - The maximum number of documents to return. Up to 1,000 documents are returned by * default. The maximum number allowed is 10,000. * @param {string} [params.status] - Filters the documents to include only documents with the specified ingestion @@ -879,9 +887,9 @@ class DiscoveryV2 extends BaseService { * see the [product documentation](/docs/discovery-data?topic=discovery-data-index-overview#field-name-limits). * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.collectionId - The ID of the collection. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.collectionId - The Universally Unique Identifier (UUID) of the collection. * @param {NodeJS.ReadableStream | Buffer} [params.file] - **Add a document**: The content of the document to ingest. * For the supported file types and maximum supported file size limits when adding a document, see [the * documentation](/docs/discovery-data?topic=discovery-data-collections#supportedfiletypes). @@ -973,9 +981,9 @@ class DiscoveryV2 extends BaseService { * from IBM Cloud-managed instances. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.collectionId - The ID of the collection. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.collectionId - The Universally Unique Identifier (UUID) of the collection. * @param {string} params.documentId - The ID of the document. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} @@ -1045,9 +1053,9 @@ class DiscoveryV2 extends BaseService { * overwritten, even if the updated version of the document has fewer child documents. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.collectionId - The ID of the collection. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.collectionId - The Universally Unique Identifier (UUID) of the collection. * @param {string} params.documentId - The ID of the document. * @param {NodeJS.ReadableStream | Buffer} [params.file] - **Add a document**: The content of the document to ingest. * For the supported file types and maximum supported file size limits when adding a document, see [the @@ -1145,9 +1153,9 @@ class DiscoveryV2 extends BaseService { * You can get the document ID of the original document from the `parent_document_id` of the subdocument result. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.collectionId - The ID of the collection. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.collectionId - The Universally Unique Identifier (UUID) of the collection. * @param {string} params.documentId - The ID of the document. * @param {boolean} [params.xWatsonDiscoveryForce] - When `true`, the uploaded document is added to the collection * even if the data for that collection is shared with other collections. @@ -1217,8 +1225,8 @@ class DiscoveryV2 extends BaseService { * characters in English. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. * @param {string[]} [params.collectionIds] - A comma-separated list of collection IDs to be queried against. * @param {string} [params.filter] - Searches for documents that match the Discovery Query Language criteria that is * specified as input. Filter calls are cached and are faster than query calls because the results are not ordered by @@ -1335,8 +1343,8 @@ class DiscoveryV2 extends BaseService { * project's search history, and the project does not learn from previous user choices. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. * @param {string} params.prefix - The prefix to use for autocompletion. For example, the prefix `Ho` could * autocomplete to `hot`, `housing`, or `how`. * @param {string[]} [params.collectionIds] - Comma separated list of the collection IDs. If this parameter is not @@ -1400,9 +1408,9 @@ class DiscoveryV2 extends BaseService { * Finds collection-level notices (errors and warnings) that are generated when documents are ingested. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.collectionId - The ID of the collection. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.collectionId - The Universally Unique Identifier (UUID) of the collection. * @param {string} [params.filter] - Searches for documents that match the Discovery Query Language criteria that is * specified as input. Filter calls are cached and are faster than query calls because the results are not ordered by * relevance. When used with the `aggregation`, `query`, or `natural_language_query` parameters, the `filter` @@ -1478,8 +1486,8 @@ class DiscoveryV2 extends BaseService { * training. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. * @param {string} [params.filter] - Searches for documents that match the Discovery Query Language criteria that is * specified as input. Filter calls are cached and are faster than query calls because the results are not ordered by * relevance. When used with the `aggregation`, `query`, or `natural_language_query` parameters, the `filter` @@ -1558,9 +1566,9 @@ class DiscoveryV2 extends BaseService { * documentation](/docs/discovery-data?topic=discovery-data-stopwords). * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.collectionId - The ID of the collection. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.collectionId - The Universally Unique Identifier (UUID) of the collection. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -1623,9 +1631,9 @@ class DiscoveryV2 extends BaseService { * documentation](/docs/discovery-data?topic=discovery-data-stopwords). * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.collectionId - The ID of the collection. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.collectionId - The Universally Unique Identifier (UUID) of the collection. * @param {string[]} [params.stopwords] - List of stop words. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} @@ -1687,9 +1695,9 @@ class DiscoveryV2 extends BaseService { * is deleted, the default stop words list is used. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.collectionId - The ID of the collection. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.collectionId - The Universally Unique Identifier (UUID) of the collection. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -1743,9 +1751,9 @@ class DiscoveryV2 extends BaseService { * expansions array is returned. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.collectionId - The ID of the collection. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.collectionId - The Universally Unique Identifier (UUID) of the collection. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -1801,9 +1809,9 @@ class DiscoveryV2 extends BaseService { * scope of a query beyond exact matches. The maximum number of expanded terms allowed per collection is 5,000. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.collectionId - The ID of the collection. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.collectionId - The Universally Unique Identifier (UUID) of the collection. * @param {Expansion[]} params.expansions - An array of query expansion definitions. * * Each object in the **expansions** array represents a term or set of terms that will be expanded into other terms. @@ -1876,9 +1884,9 @@ class DiscoveryV2 extends BaseService { * expansion list. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.collectionId - The ID of the collection. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.collectionId - The Universally Unique Identifier (UUID) of the collection. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -1934,8 +1942,8 @@ class DiscoveryV2 extends BaseService { * Returns default configuration settings for components. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -1991,8 +1999,8 @@ class DiscoveryV2 extends BaseService { * List the training queries for the specified project. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -2045,8 +2053,8 @@ class DiscoveryV2 extends BaseService { * Removes all training queries for the specified project. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -2100,8 +2108,8 @@ class DiscoveryV2 extends BaseService { * **Note**: You cannot apply relevancy training to a `content_mining` project type. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. * @param {string} params.naturalLanguageQuery - The natural text query that is used as the training query. * @param {TrainingExample[]} params.examples - Array of training examples. * @param {string} [params.filter] - The filter used on the collection before the **natural_language_query** is @@ -2168,8 +2176,8 @@ class DiscoveryV2 extends BaseService { * Get details for a specific training data query, including the query string and all examples. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. * @param {string} params.queryId - The ID of the query used for training. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} @@ -2224,8 +2232,8 @@ class DiscoveryV2 extends BaseService { * Updates an existing training query and its examples. You must resubmit all of the examples with the update request. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. * @param {string} params.queryId - The ID of the query used for training. * @param {string} params.naturalLanguageQuery - The natural text query that is used as the training query. * @param {TrainingExample[]} params.examples - Array of training examples. @@ -2297,8 +2305,8 @@ class DiscoveryV2 extends BaseService { * the example set. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. * @param {string} params.queryId - The ID of the query used for training. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} @@ -2356,8 +2364,8 @@ class DiscoveryV2 extends BaseService { * be listed, but are reserved for internal use only. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -2411,8 +2419,8 @@ class DiscoveryV2 extends BaseService { * use the [Collections API](/apidocs/discovery-data#createcollection). * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. * @param {CreateEnrichment} params.enrichment - Information about a specific enrichment. * @param {NodeJS.ReadableStream | Buffer} [params.file] - The enrichment file to upload. Expected file types per * enrichment are as follows: @@ -2484,9 +2492,9 @@ class DiscoveryV2 extends BaseService { * Get details about a specific enrichment. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.enrichmentId - The ID of the enrichment. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.enrichmentId - The Universally Unique Identifier (UUID) of the enrichment. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -2540,9 +2548,9 @@ class DiscoveryV2 extends BaseService { * Updates an existing enrichment's name and description. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.enrichmentId - The ID of the enrichment. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.enrichmentId - The Universally Unique Identifier (UUID) of the enrichment. * @param {string} params.name - A new name for the enrichment. * @param {string} [params.description] - A new description for the enrichment. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers @@ -2607,9 +2615,9 @@ class DiscoveryV2 extends BaseService { * **Note:** Only enrichments that have been manually created can be deleted. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.enrichmentId - The ID of the enrichment. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.enrichmentId - The Universally Unique Identifier (UUID) of the enrichment. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -2666,8 +2674,8 @@ class DiscoveryV2 extends BaseService { * classifier. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -2725,8 +2733,8 @@ class DiscoveryV2 extends BaseService { * Enterprise plan instances. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. * @param {NodeJS.ReadableStream | Buffer} params.trainingData - The training data CSV file to upload. The CSV file * must have headers. The file must include a field that contains the text you want to classify and a field that * contains the classification labels that you want to use to classify your data. If you want to specify multiple @@ -2803,9 +2811,9 @@ class DiscoveryV2 extends BaseService { * Get details about a specific document classifier. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.classifierId - The ID of the classifier. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.classifierId - The Universally Unique Identifier (UUID) of the classifier. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -2859,9 +2867,9 @@ class DiscoveryV2 extends BaseService { * Update the document classifier name or description, update the training data, or add or update the test data. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.classifierId - The ID of the classifier. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.classifierId - The Universally Unique Identifier (UUID) of the classifier. * @param {UpdateDocumentClassifier} params.classifier - An object that contains a new name or description for a * document classifier, updated training data, or new or updated test data. * @param {NodeJS.ReadableStream | Buffer} [params.trainingData] - The training data CSV file to upload. The CSV file @@ -2939,9 +2947,9 @@ class DiscoveryV2 extends BaseService { * Deletes an existing document classifier from the specified project. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.classifierId - The ID of the classifier. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.classifierId - The Universally Unique Identifier (UUID) of the classifier. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -2998,9 +3006,9 @@ class DiscoveryV2 extends BaseService { * classifier model. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.classifierId - The ID of the classifier. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.classifierId - The Universally Unique Identifier (UUID) of the classifier. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -3058,9 +3066,9 @@ class DiscoveryV2 extends BaseService { * Enterprise plan instances. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.classifierId - The ID of the classifier. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.classifierId - The Universally Unique Identifier (UUID) of the classifier. * @param {string} params.name - The name of the document classifier model. * @param {string} [params.description] - A description of the document classifier model. * @param {number} [params.learningRate] - A tuning parameter in an optimization algorithm that determines the step @@ -3142,10 +3150,10 @@ class DiscoveryV2 extends BaseService { * Get details about a specific document classifier model. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.classifierId - The ID of the classifier. - * @param {string} params.modelId - The ID of the classifier model. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.classifierId - The Universally Unique Identifier (UUID) of the classifier. + * @param {string} params.modelId - The Universally Unique Identifier (UUID) of the classifier model. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -3200,10 +3208,10 @@ class DiscoveryV2 extends BaseService { * Update the document classifier model name or description. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.classifierId - The ID of the classifier. - * @param {string} params.modelId - The ID of the classifier model. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.classifierId - The Universally Unique Identifier (UUID) of the classifier. + * @param {string} params.modelId - The Universally Unique Identifier (UUID) of the classifier model. * @param {string} [params.name] - A new name for the enrichment. * @param {string} [params.description] - A new description for the enrichment. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers @@ -3267,10 +3275,10 @@ class DiscoveryV2 extends BaseService { * Deletes an existing document classifier model from the specified project. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.classifierId - The ID of the classifier. - * @param {string} params.modelId - The ID of the classifier model. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.classifierId - The Universally Unique Identifier (UUID) of the classifier. + * @param {string} params.modelId - The Universally Unique Identifier (UUID) of the classifier model. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise>} */ @@ -3339,9 +3347,9 @@ class DiscoveryV2 extends BaseService { * **Note:** This method is supported with Enterprise plan deployments and installed deployments only. * * @param {Object} params - The parameters to send to the service. - * @param {string} params.projectId - The ID of the project. This information can be found from the *Integrate and - * Deploy* page in Discovery. - * @param {string} params.collectionId - The ID of the collection. + * @param {string} params.projectId - The Universally Unique Identifier (UUID) of the project. This information can be + * found from the *Integrate and Deploy* page in Discovery. + * @param {string} params.collectionId - The Universally Unique Identifier (UUID) of the collection. * @param {NodeJS.ReadableStream | Buffer} [params.file] - **Add a document**: The content of the document to ingest. * For the supported file types and maximum supported file size limits when adding a document, see [the * documentation](/docs/discovery-data?topic=discovery-data-collections#supportedfiletypes). @@ -3531,6 +3539,8 @@ namespace DiscoveryV2 { * * The `content_mining` and `content_intelligence` types are available with Premium plan managed deployments and * installed deployments only. + * + * The Intelligent Document Processing (IDP) project type is available from IBM Cloud-managed instances only. */ type: CreateProjectConstants.Type | string; /** Default query parameters for this project. */ @@ -3540,8 +3550,9 @@ namespace DiscoveryV2 { /** Constants for the `createProject` operation. */ export namespace CreateProjectConstants { - /** The type of project. The `content_intelligence` type is a *Document Retrieval for Contracts* project and the `other` type is a *Custom* project. The `content_mining` and `content_intelligence` types are available with Premium plan managed deployments and installed deployments only. */ + /** The type of project. The `content_intelligence` type is a *Document Retrieval for Contracts* project and the `other` type is a *Custom* project. The `content_mining` and `content_intelligence` types are available with Premium plan managed deployments and installed deployments only. The Intelligent Document Processing (IDP) project type is available from IBM Cloud-managed instances only. */ export enum Type { + INTELLIGENT_DOCUMENT_PROCESSING = 'intelligent_document_processing', DOCUMENT_RETRIEVAL = 'document_retrieval', CONVERSATIONAL_SEARCH = 'conversational_search', CONTENT_INTELLIGENCE = 'content_intelligence', @@ -3552,14 +3563,18 @@ namespace DiscoveryV2 { /** Parameters for the `getProject` operation. */ export interface GetProjectParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `updateProject` operation. */ export interface UpdateProjectParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; /** The new name to give this project. */ name?: string; @@ -3568,14 +3583,18 @@ namespace DiscoveryV2 { /** Parameters for the `deleteProject` operation. */ export interface DeleteProjectParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `listFields` operation. */ export interface ListFieldsParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; /** Comma separated list of the collection IDs. If this parameter is not specified, all collections in the * project are used. @@ -3586,14 +3605,18 @@ namespace DiscoveryV2 { /** Parameters for the `listCollections` operation. */ export interface ListCollectionsParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `createCollection` operation. */ export interface CreateCollectionParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; /** The name of the collection. */ name: string; @@ -3603,6 +3626,10 @@ namespace DiscoveryV2 { * documentation](/docs/discovery-data?topic=discovery-data-language-support). */ language?: string; + /** If set to `true`, optical character recognition (OCR) is enabled. For more information, see [Optical + * character recognition](/docs/discovery-data?topic=discovery-data-collections#ocr). + */ + ocrEnabled?: boolean; /** An array of enrichments that are applied to this collection. To get a list of enrichments that are available * for a project, use the [List enrichments](#listenrichments) method. * @@ -3616,23 +3643,31 @@ namespace DiscoveryV2 { /** Parameters for the `getCollection` operation. */ export interface GetCollectionParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the collection. */ + /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `updateCollection` operation. */ export interface UpdateCollectionParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the collection. */ + /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; /** The new name of the collection. */ name?: string; /** The new description of the collection. */ description?: string; + /** If set to `true`, optical character recognition (OCR) is enabled. For more information, see [Optical + * character recognition](/docs/discovery-data?topic=discovery-data-collections#ocr). + */ + ocrEnabled?: boolean; /** An array of enrichments that are applied to this collection. */ enrichments?: CollectionEnrichment[]; headers?: OutgoingHttpHeaders; @@ -3640,18 +3675,22 @@ namespace DiscoveryV2 { /** Parameters for the `deleteCollection` operation. */ export interface DeleteCollectionParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the collection. */ + /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `listDocuments` operation. */ export interface ListDocumentsParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the collection. */ + /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; /** The maximum number of documents to return. Up to 1,000 documents are returned by default. The maximum number * allowed is 10,000. @@ -3701,9 +3740,11 @@ namespace DiscoveryV2 { /** Parameters for the `addDocument` operation. */ export interface AddDocumentParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the collection. */ + /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; /** **Add a document**: The content of the document to ingest. For the supported file types and maximum * supported file size limits when adding a document, see [the @@ -3753,9 +3794,11 @@ namespace DiscoveryV2 { /** Parameters for the `getDocument` operation. */ export interface GetDocumentParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the collection. */ + /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; /** The ID of the document. */ documentId: string; @@ -3764,9 +3807,11 @@ namespace DiscoveryV2 { /** Parameters for the `updateDocument` operation. */ export interface UpdateDocumentParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the collection. */ + /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; /** The ID of the document. */ documentId: string; @@ -3818,9 +3863,11 @@ namespace DiscoveryV2 { /** Parameters for the `deleteDocument` operation. */ export interface DeleteDocumentParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the collection. */ + /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; /** The ID of the document. */ documentId: string; @@ -3833,7 +3880,9 @@ namespace DiscoveryV2 { /** Parameters for the `query` operation. */ export interface QueryParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; /** A comma-separated list of collection IDs to be queried against. */ collectionIds?: string[]; @@ -3904,7 +3953,9 @@ namespace DiscoveryV2 { /** Parameters for the `getAutocompletion` operation. */ export interface GetAutocompletionParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; /** The prefix to use for autocompletion. For example, the prefix `Ho` could autocomplete to `hot`, `housing`, * or `how`. @@ -3923,9 +3974,11 @@ namespace DiscoveryV2 { /** Parameters for the `queryCollectionNotices` operation. */ export interface QueryCollectionNoticesParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the collection. */ + /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; /** Searches for documents that match the Discovery Query Language criteria that is specified as input. Filter * calls are cached and are faster than query calls because the results are not ordered by relevance. When used @@ -3957,7 +4010,9 @@ namespace DiscoveryV2 { /** Parameters for the `queryNotices` operation. */ export interface QueryNoticesParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; /** Searches for documents that match the Discovery Query Language criteria that is specified as input. Filter * calls are cached and are faster than query calls because the results are not ordered by relevance. When used @@ -3989,18 +4044,22 @@ namespace DiscoveryV2 { /** Parameters for the `getStopwordList` operation. */ export interface GetStopwordListParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the collection. */ + /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `createStopwordList` operation. */ export interface CreateStopwordListParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the collection. */ + /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; /** List of stop words. */ stopwords?: string[]; @@ -4009,27 +4068,33 @@ namespace DiscoveryV2 { /** Parameters for the `deleteStopwordList` operation. */ export interface DeleteStopwordListParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the collection. */ + /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `listExpansions` operation. */ export interface ListExpansionsParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the collection. */ + /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `createExpansions` operation. */ export interface CreateExpansionsParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the collection. */ + /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; /** An array of query expansion definitions. * @@ -4050,37 +4115,47 @@ namespace DiscoveryV2 { /** Parameters for the `deleteExpansions` operation. */ export interface DeleteExpansionsParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the collection. */ + /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `getComponentSettings` operation. */ export interface GetComponentSettingsParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `listTrainingQueries` operation. */ export interface ListTrainingQueriesParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `deleteTrainingQueries` operation. */ export interface DeleteTrainingQueriesParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `createTrainingQuery` operation. */ export interface CreateTrainingQueryParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; /** The natural text query that is used as the training query. */ naturalLanguageQuery: string; @@ -4097,7 +4172,9 @@ namespace DiscoveryV2 { /** Parameters for the `getTrainingQuery` operation. */ export interface GetTrainingQueryParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; /** The ID of the query used for training. */ queryId: string; @@ -4106,7 +4183,9 @@ namespace DiscoveryV2 { /** Parameters for the `updateTrainingQuery` operation. */ export interface UpdateTrainingQueryParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; /** The ID of the query used for training. */ queryId: string; @@ -4125,7 +4204,9 @@ namespace DiscoveryV2 { /** Parameters for the `deleteTrainingQuery` operation. */ export interface DeleteTrainingQueryParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; /** The ID of the query used for training. */ queryId: string; @@ -4134,14 +4215,18 @@ namespace DiscoveryV2 { /** Parameters for the `listEnrichments` operation. */ export interface ListEnrichmentsParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `createEnrichment` operation. */ export interface CreateEnrichmentParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; /** Information about a specific enrichment. */ enrichment: CreateEnrichment; @@ -4159,18 +4244,22 @@ namespace DiscoveryV2 { /** Parameters for the `getEnrichment` operation. */ export interface GetEnrichmentParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the enrichment. */ + /** The Universally Unique Identifier (UUID) of the enrichment. */ enrichmentId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `updateEnrichment` operation. */ export interface UpdateEnrichmentParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the enrichment. */ + /** The Universally Unique Identifier (UUID) of the enrichment. */ enrichmentId: string; /** A new name for the enrichment. */ name: string; @@ -4181,23 +4270,29 @@ namespace DiscoveryV2 { /** Parameters for the `deleteEnrichment` operation. */ export interface DeleteEnrichmentParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the enrichment. */ + /** The Universally Unique Identifier (UUID) of the enrichment. */ enrichmentId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `listDocumentClassifiers` operation. */ export interface ListDocumentClassifiersParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `createDocumentClassifier` operation. */ export interface CreateDocumentClassifierParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; /** The training data CSV file to upload. The CSV file must have headers. The file must include a field that * contains the text you want to classify and a field that contains the classification labels that you want to use @@ -4218,18 +4313,22 @@ namespace DiscoveryV2 { /** Parameters for the `getDocumentClassifier` operation. */ export interface GetDocumentClassifierParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the classifier. */ + /** The Universally Unique Identifier (UUID) of the classifier. */ classifierId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `updateDocumentClassifier` operation. */ export interface UpdateDocumentClassifierParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the classifier. */ + /** The Universally Unique Identifier (UUID) of the classifier. */ classifierId: string; /** An object that contains a new name or description for a document classifier, updated training data, or new * or updated test data. @@ -4252,27 +4351,33 @@ namespace DiscoveryV2 { /** Parameters for the `deleteDocumentClassifier` operation. */ export interface DeleteDocumentClassifierParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the classifier. */ + /** The Universally Unique Identifier (UUID) of the classifier. */ classifierId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `listDocumentClassifierModels` operation. */ export interface ListDocumentClassifierModelsParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the classifier. */ + /** The Universally Unique Identifier (UUID) of the classifier. */ classifierId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `createDocumentClassifierModel` operation. */ export interface CreateDocumentClassifierModelParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the classifier. */ + /** The Universally Unique Identifier (UUID) of the classifier. */ classifierId: string; /** The name of the document classifier model. */ name: string; @@ -4306,22 +4411,26 @@ namespace DiscoveryV2 { /** Parameters for the `getDocumentClassifierModel` operation. */ export interface GetDocumentClassifierModelParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the classifier. */ + /** The Universally Unique Identifier (UUID) of the classifier. */ classifierId: string; - /** The ID of the classifier model. */ + /** The Universally Unique Identifier (UUID) of the classifier model. */ modelId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `updateDocumentClassifierModel` operation. */ export interface UpdateDocumentClassifierModelParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the classifier. */ + /** The Universally Unique Identifier (UUID) of the classifier. */ classifierId: string; - /** The ID of the classifier model. */ + /** The Universally Unique Identifier (UUID) of the classifier model. */ modelId: string; /** A new name for the enrichment. */ name?: string; @@ -4332,20 +4441,24 @@ namespace DiscoveryV2 { /** Parameters for the `deleteDocumentClassifierModel` operation. */ export interface DeleteDocumentClassifierModelParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the classifier. */ + /** The Universally Unique Identifier (UUID) of the classifier. */ classifierId: string; - /** The ID of the classifier model. */ + /** The Universally Unique Identifier (UUID) of the classifier model. */ modelId: string; headers?: OutgoingHttpHeaders; } /** Parameters for the `analyzeDocument` operation. */ export interface AnalyzeDocumentParams { - /** The ID of the project. This information can be found from the *Integrate and Deploy* page in Discovery. */ + /** The Universally Unique Identifier (UUID) of the project. This information can be found from the *Integrate + * and Deploy* page in Discovery. + */ projectId: string; - /** The ID of the collection. */ + /** The Universally Unique Identifier (UUID) of the collection. */ collectionId: string; /** **Add a document**: The content of the document to ingest. For the supported file types and maximum * supported file size limits when adding a document, see [the @@ -4442,7 +4555,7 @@ namespace DiscoveryV2 { /** A collection for storing documents. */ export interface Collection { - /** The unique identifier of the collection. */ + /** The Universally Unique Identifier (UUID) of the collection. */ collection_id?: string; /** The name of the collection. */ name?: string; @@ -4450,7 +4563,7 @@ namespace DiscoveryV2 { /** A collection for storing documents. */ export interface CollectionDetails { - /** The unique identifier of the collection. */ + /** The Universally Unique Identifier (UUID) of the collection. */ collection_id?: string; /** The name of the collection. */ name: string; @@ -4462,6 +4575,10 @@ namespace DiscoveryV2 { * documentation](/docs/discovery-data?topic=discovery-data-language-support). */ language?: string; + /** If set to `true`, optical character recognition (OCR) is enabled. For more information, see [Optical + * character recognition](/docs/discovery-data?topic=discovery-data-collections#ocr). + */ + ocr_enabled?: boolean; /** An array of enrichments that are applied to this collection. To get a list of enrichments that are available * for a project, use the [List enrichments](#listenrichments) method. * @@ -4782,7 +4899,7 @@ namespace DiscoveryV2 { /** Information about a document classifier. */ export interface DocumentClassifier { - /** A unique identifier of the document classifier. */ + /** The Universally Unique Identifier (UUID) of the document classifier. */ classifier_id?: string; /** A human-readable name of the document classifier. */ name: string; @@ -4818,7 +4935,7 @@ namespace DiscoveryV2 { /** An object that describes enrichments that are applied to the training and test data that is used by the document classifier. */ export interface DocumentClassifierEnrichment { - /** A unique identifier of the enrichment. */ + /** The Universally Unique Identifier (UUID) of the enrichment. */ enrichment_id: string; /** An array of field names where the enrichment is applied. */ fields: string[]; @@ -4826,7 +4943,7 @@ namespace DiscoveryV2 { /** Information about a document classifier model. */ export interface DocumentClassifierModel { - /** A unique identifier of the document classifier model. */ + /** The Universally Unique Identifier (UUID) of the document classifier model. */ model_id?: string; /** A human-readable name of the document classifier model. */ name: string; @@ -4846,7 +4963,9 @@ namespace DiscoveryV2 { status?: DocumentClassifierModel.Constants.Status | string; /** An object that contains information about a trained document classifier model. */ evaluation?: ClassifierModelEvaluation; - /** A unique identifier of the enrichment that is generated by this document classifier model. */ + /** The Universally Unique Identifier (UUID) of the enrichment that is generated by this document classifier + * model. + */ enrichment_id?: string; /** The date that the document classifier model was deployed. */ deployed_at?: string; @@ -4942,7 +5061,7 @@ namespace DiscoveryV2 { /** Information about a specific enrichment. */ export interface Enrichment { - /** The unique identifier of this enrichment. */ + /** The Universally Unique Identifier (UUID) of this enrichment. */ enrichment_id?: string; /** The human readable name for this enrichment. */ name?: string; @@ -4993,12 +5112,12 @@ namespace DiscoveryV2 { * or `classifier`. Not valid when creating any other type of enrichment. */ result_field?: string; - /** A unique identifier of the document classifier. Required when **type** is `classifier`. Not valid when - * creating any other type of enrichment. + /** The Universally Unique Identifier (UUID) of the document classifier. Required when **type** is `classifier`. + * Not valid when creating any other type of enrichment. */ classifier_id?: string; - /** A unique identifier of the document classifier model. Required when **type** is `classifier`. Not valid when - * creating any other type of enrichment. + /** The Universally Unique Identifier (UUID) of the document classifier model. Required when **type** is + * `classifier`. Not valid when creating any other type of enrichment. */ model_id?: string; /** Specifies a threshold. Only classes with evaluation confidence scores that are higher than the specified @@ -5217,7 +5336,7 @@ namespace DiscoveryV2 { /** Detailed information about the specified project. */ export interface ProjectDetails { - /** The unique identifier of this project. */ + /** The Universally Unique Identifier (UUID) of this project. */ project_id?: string; /** The human readable name of this project. */ name?: string; @@ -5228,6 +5347,8 @@ namespace DiscoveryV2 { * * The `content_mining` and `content_intelligence` types are available with Premium plan managed deployments and * installed deployments only. + * + * The Intelligent Document Processing (IDP) project type is available from IBM Cloud-managed instances only. */ type?: ProjectDetails.Constants.Type | string; /** Relevancy training status information for this project. */ @@ -5239,8 +5360,9 @@ namespace DiscoveryV2 { } export namespace ProjectDetails { export namespace Constants { - /** The type of project. The `content_intelligence` type is a *Document Retrieval for Contracts* project and the `other` type is a *Custom* project. The `content_mining` and `content_intelligence` types are available with Premium plan managed deployments and installed deployments only. */ + /** The type of project. The `content_intelligence` type is a *Document Retrieval for Contracts* project and the `other` type is a *Custom* project. The `content_mining` and `content_intelligence` types are available with Premium plan managed deployments and installed deployments only. The Intelligent Document Processing (IDP) project type is available from IBM Cloud-managed instances only. */ export enum Type { + INTELLIGENT_DOCUMENT_PROCESSING = 'intelligent_document_processing', DOCUMENT_RETRIEVAL = 'document_retrieval', CONVERSATIONAL_SEARCH = 'conversational_search', CONTENT_MINING = 'content_mining', @@ -5252,7 +5374,7 @@ namespace DiscoveryV2 { /** Details about a specific project. */ export interface ProjectListDetails { - /** The unique identifier of this project. */ + /** The Universally Unique Identifier (UUID) of this project. */ project_id?: string; /** The human readable name of this project. */ name?: string; @@ -5263,6 +5385,8 @@ namespace DiscoveryV2 { * * The `content_mining` and `content_intelligence` types are available with Premium plan managed deployments and * installed deployments only. + * + * The Intelligent Document Processing (IDP) project type is available from IBM Cloud-managed instances only. */ type?: ProjectListDetails.Constants.Type | string; /** Relevancy training status information for this project. */ @@ -5272,8 +5396,9 @@ namespace DiscoveryV2 { } export namespace ProjectListDetails { export namespace Constants { - /** The type of project. The `content_intelligence` type is a *Document Retrieval for Contracts* project and the `other` type is a *Custom* project. The `content_mining` and `content_intelligence` types are available with Premium plan managed deployments and installed deployments only. */ + /** The type of project. The `content_intelligence` type is a *Document Retrieval for Contracts* project and the `other` type is a *Custom* project. The `content_mining` and `content_intelligence` types are available with Premium plan managed deployments and installed deployments only. The Intelligent Document Processing (IDP) project type is available from IBM Cloud-managed instances only. */ export enum Type { + INTELLIGENT_DOCUMENT_PROCESSING = 'intelligent_document_processing', DOCUMENT_RETRIEVAL = 'document_retrieval', CONVERSATIONAL_SEARCH = 'conversational_search', CONTENT_MINING = 'content_mining', diff --git a/lib/recognize-stream.ts b/lib/recognize-stream.ts index 11eee76d96..e8a71e5517 100644 --- a/lib/recognize-stream.ts +++ b/lib/recognize-stream.ts @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2014, 2020. + * (C) Copyright IBM Corp. 2014, 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,7 +62,7 @@ class RecognizeStream extends Duplex { * * Uses WebSockets under the hood. For audio with no recognizable speech, no `data` events are emitted. * - * By default, only finalized text is emitted in the data events, however when `objectMode`/`readableObjectMode` and `interim_results` are enabled, both interim and final results objects are emitted. + * By default, only finalized text is emitted in the data events, however when `objectMode`/`readableObjectMode` is enabled, both interim and final results objects are emitted. * WriteableElementStream uses this, for example, to live-update the DOM with word-by-word transcriptions. * * Note that the WebSocket connection is not established until the first chunk of data is recieved. This allows for auto-detection of content type (for wav/flac/opus audio). @@ -86,7 +86,6 @@ class RecognizeStream extends Duplex { * @param {string} [options.contentType] - The format (MIME type) of the audio * @param {number} [options.customizationWeight] - Tell the service how much weight to give to words from the custom language model compared to those from the base model for the current request * @param {number} [options.inactivityTimeout] - The time in seconds after which, if only silence (no speech) is detected in the audio, the connection is closed (default=30) - * @param {boolean} [options.interimResults] - If true, the service returns interim results as a stream of JSON SpeechRecognitionResults objects (default=false) * @param {string[]} [options.keywords] - An array of keyword strings to spot in the audio * @param {number} [options.keywordsThreshold] - A confidence value that is the lower bound for spotting a keyword * @param {number} [options.maxAlternatives] - The maximum number of alternative transcripts that the service is to return (default=1) @@ -105,7 +104,6 @@ class RecognizeStream extends Duplex { * @param {boolean} [options.splitTranscriptAtPhraseEnd] - If `true`, directs the service to split the transcript into multiple final results based on semantic features of the input * @param {number} [options.speechDetectorSensitivity] - The sensitivity of speech activity detection that the service is to perform * @param {number} [options.backgroundAudioSuppression] - The level to which the service is to suppress background audio based on its volume to prevent it from being transcribed as speech - * @param {boolean} [params.lowLatency] - If `true` for next-generation `Multimedia` and `Telephony` models that support low latency, directs the service to produce results even more quickly than it usually does * @constructor */ constructor(options: RecognizeStream.Options) { @@ -168,7 +166,6 @@ class RecognizeStream extends Duplex { 'timestamps', 'word_confidence', 'content-type', - 'interim_results', 'keywords', 'keywords_threshold', 'max_alternatives', @@ -182,7 +179,6 @@ class RecognizeStream extends Duplex { 'split_transcript_at_phrase_end', 'speech_detector_sensitivity', 'background_audio_suppression', - 'low_latency', ]; const openingMessage = processUserParameters(options, openingMessageParamsAllowed); openingMessage.action = 'start'; diff --git a/package-lock.json b/package-lock.json index ddb735f930..fa027eb529 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7952,6 +7952,18 @@ "node": ">=8" } }, + "node_modules/jsdoc/node_modules/marked": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", + "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", + "dev": true, + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 12" + } + }, "node_modules/jsdoc/node_modules/mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", @@ -8615,15 +8627,15 @@ "dev": true }, "node_modules/marked": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", - "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/marked/-/marked-2.1.3.tgz", + "integrity": "sha512-/Q+7MGzaETqifOMWYEA7HVMaZb4XbcRfaOzcSsHZEith83KGlvaSG33u0SKu89Mj5h+T8V2hM+8O45Qc5XTgwA==", "dev": true, "bin": { - "marked": "bin/marked.js" + "marked": "bin/marked" }, "engines": { - "node": ">= 12" + "node": ">= 10" } }, "node_modules/marked-terminal": { @@ -13069,18 +13081,6 @@ "node": ">=10" } }, - "node_modules/semantic-release/node_modules/marked": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/marked/-/marked-2.1.3.tgz", - "integrity": "sha512-/Q+7MGzaETqifOMWYEA7HVMaZb4XbcRfaOzcSsHZEith83KGlvaSG33u0SKu89Mj5h+T8V2hM+8O45Qc5XTgwA==", - "dev": true, - "bin": { - "marked": "bin/marked" - }, - "engines": { - "node": ">= 10" - } - }, "node_modules/semantic-release/node_modules/yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", diff --git a/speech-to-text/v1-generated.ts b/speech-to-text/v1-generated.ts index 8b5868a3ef..b8d6cf9474 100644 --- a/speech-to-text/v1-generated.ts +++ b/speech-to-text/v1-generated.ts @@ -42,8 +42,8 @@ import { getSdkHeaders } from '../lib/common'; * * * Effective **31 July 2023**, all previous-generation models will be removed from the service and the documentation. - * Most previous-generation models were deprecated on 15 March 2022. You must migrate to the equivalent next-generation - * model by 31 July 2023. For more information, see [Migrating to next-generation + * Most previous-generation models were deprecated on 15 March 2022. You must migrate to the equivalent large speech + * model or next-generation model by 31 July 2023. For more information, see [Migrating to large speech * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-migrate).{: deprecated} * * For speech recognition, the service supports synchronous and asynchronous HTTP Representational State Transfer (REST) @@ -262,19 +262,21 @@ class SpeechToTextV1 extends BaseService { * **See also:** [Supported audio * formats](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-audio-formats). * - * ### Next-generation models + * ### Large speech models and Next-generation models * - * The service supports next-generation `Multimedia` (16 kHz) and `Telephony` (8 kHz) models for many languages. - * Next-generation models have higher throughput than the service's previous generation of `Broadband` and - * `Narrowband` models. When you use next-generation models, the service can return transcriptions more quickly and - * also provide noticeably better transcription accuracy. + * The service supports large speech models and next-generation `Multimedia` (16 kHz) and `Telephony` (8 kHz) models + * for many languages. Large speech models and next-generation models have higher throughput than the service's + * previous generation of `Broadband` and `Narrowband` models. When you use large speech models and next-generation + * models, the service can return transcriptions more quickly and also provide noticeably better transcription + * accuracy. * - * You specify a next-generation model by using the `model` query parameter, as you do a previous-generation model. - * Most next-generation models support the `low_latency` parameter, and all next-generation models support the - * `character_insertion_bias` parameter. These parameters are not available with previous-generation models. + * You specify a large speech model or next-generation model by using the `model` query parameter, as you do a + * previous-generation model. Only the next-generation models support the `low_latency` parameter, and all large + * speech models and next-generation models support the `character_insertion_bias` parameter. These parameters are not + * available with previous-generation models. * - * Next-generation models do not support all of the speech recognition parameters that are available for use with - * previous-generation models. Next-generation models do not support the following parameters: + * Large speech models and next-generation models do not support all of the speech recognition parameters that are + * available for use with previous-generation models. Next-generation models do not support the following parameters: * * `acoustic_customization_id` * * `keywords` and `keywords_threshold` * * `processing_metrics` and `processing_metrics_interval` @@ -282,10 +284,14 @@ class SpeechToTextV1 extends BaseService { * * **Important:** Effective **31 July 2023**, all previous-generation models will be removed from the service and the * documentation. Most previous-generation models were deprecated on 15 March 2022. You must migrate to the equivalent - * next-generation model by 31 July 2023. For more information, see [Migrating to next-generation + * large speech model or next-generation model by 31 July 2023. For more information, see [Migrating to large speech * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-migrate). * * **See also:** + * * [Large speech languages and + * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-large-speech-languages) + * * [Supported features for large speech + * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-large-speech-languages#models-lsm-supported-features) * * [Next-generation languages and models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-ng) * * [Supported features for next-generation * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-ng#models-ng-features) @@ -321,6 +327,12 @@ class SpeechToTextV1 extends BaseService { * * [Using a model for speech recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-use) * * [Using the default * model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-use#models-use-default). + * @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. See [Using + * speech recognition + * parameters](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-service-features#features-parameters). * @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 @@ -345,6 +357,7 @@ class SpeechToTextV1 extends BaseService { * * Specify a value between 0.0 and 1.0. Unless a different customization weight was specified for the custom model * when the model was trained, the default value is: + * * 0.5 for large speech models * * 0.3 for previous-generation models * * 0.2 for most next-generation models * * 0.1 for next-generation English and Japanese models @@ -404,8 +417,9 @@ class SpeechToTextV1 extends BaseService { * **Note:** The parameter can be used with US English, Japanese, and Spanish (all dialects) transcription only. * * See [Smart formatting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-formatting#smart-formatting). - * @param {number} [params.smartFormattingVersion] - Smart formatting version is for next-generation models and that - * is supported in US English, Brazilian Portuguese, French and German languages. + * @param {number} [params.smartFormattingVersion] - Smart formatting version for large speech models and + * next-generation models is supported in US English, Brazilian Portuguese, French, German, Spanish and French + * Canadian languages. * @param {boolean} [params.speakerLabels] - If `true`, the response includes labels that identify which words were * spoken by which participants in a multi-person exchange. By default, the service returns no speaker labels. Setting * `speaker_labels` to `true` forces the `timestamps` parameter to be `true`, regardless of whether you specify @@ -413,8 +427,7 @@ class SpeechToTextV1 extends BaseService { * * _For previous-generation models,_ the parameter can be used with Australian English, US English, German, * Japanese, Korean, and Spanish (both broadband and narrowband models) and UK English (narrowband model) * transcription only. - * * _For next-generation models,_ the parameter can be used with Czech, English (Australian, Indian, UK, and US), - * German, Japanese, Korean, and Spanish transcription only. + * * _For large speech models and next-generation models,_ the parameter can be used with all available languages. * * See [Speaker labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-speaker-labels). * @param {string} [params.grammarName] - The name of a grammar that is to be used with the recognition request. If @@ -481,8 +494,8 @@ class SpeechToTextV1 extends BaseService { * The values increase on a monotonic curve. Specifying one or two decimal places of precision (for example, `0.55`) * is typically more than sufficient. * - * The parameter is supported with all next-generation models and with most previous-generation models. See [Speech - * detector + * The parameter is supported with all large speech models, next-generation models and with most previous-generation + * models. See [Speech detector * sensitivity](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detection#detection-parameters-sensitivity) * and [Language model * support](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detection#detection-support). @@ -498,8 +511,8 @@ class SpeechToTextV1 extends BaseService { * The values increase on a monotonic curve. Specifying one or two decimal places of precision (for example, `0.55`) * is typically more than sufficient. * - * The parameter is supported with all next-generation models and with most previous-generation models. See - * [Background audio + * The parameter is supported with all large speech models, next-generation models and with most previous-generation + * models. See [Background audio * suppression](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detection#detection-parameters-suppression) * and [Language model * support](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detection#detection-support). @@ -508,15 +521,15 @@ class SpeechToTextV1 extends BaseService { * models produce transcription results faster than previous-generation models. The `low_latency` parameter causes the * models to produce results even more quickly, though the results might be less accurate when the parameter is used. * - * The parameter is not available for previous-generation `Broadband` and `Narrowband` models. It is available for - * most next-generation models. + * The parameter is not available for large speech models and previous-generation `Broadband` and `Narrowband` models. + * It is available for most next-generation models. * * For a list of next-generation models that support low latency, see [Supported next-generation language * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-ng#models-ng-supported). * * For more information about the `low_latency` parameter, see [Low * latency](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-interim#low-latency). - * @param {number} [params.characterInsertionBias] - For next-generation models, an indication of whether the service - * is biased to recognize shorter or longer strings of characters when developing transcription hypotheses. By - * default, the service is optimized to produce the best balance of strings of different lengths. + * @param {number} [params.characterInsertionBias] - For large speech models and next-generation models, an indication + * of whether the service is biased to recognize shorter or longer strings of characters when developing transcription + * hypotheses. By default, the service is optimized to produce the best balance of strings of different lengths. * * The default bias is 0.0. The allowable range of values is -1.0 to 1.0. * * Negative values bias the service to favor hypotheses with shorter strings of characters. @@ -539,7 +552,7 @@ class SpeechToTextV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['audio']; - const _validParams = ['audio', 'contentType', 'model', 'languageCustomizationId', 'acousticCustomizationId', 'baseModelVersion', 'customizationWeight', 'inactivityTimeout', 'keywords', 'keywordsThreshold', 'maxAlternatives', 'wordAlternativesThreshold', 'wordConfidence', 'timestamps', 'profanityFilter', 'smartFormatting', 'smartFormattingVersion', 'speakerLabels', 'grammarName', 'redaction', 'audioMetrics', 'endOfPhraseSilenceTime', 'splitTranscriptAtPhraseEnd', 'speechDetectorSensitivity', 'backgroundAudioSuppression', 'lowLatency', 'characterInsertionBias', 'headers']; + 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', 'backgroundAudioSuppression', 'lowLatency', 'characterInsertionBias', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -548,6 +561,7 @@ class SpeechToTextV1 extends BaseService { const body = _params.audio; const query = { 'model': _params.model, + 'speech_begin_event': _params.speechBeginEvent, 'language_customization_id': _params.languageCustomizationId, 'acoustic_customization_id': _params.acousticCustomizationId, 'base_model_version': _params.baseModelVersion, @@ -818,19 +832,21 @@ class SpeechToTextV1 extends BaseService { * **See also:** [Supported audio * formats](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-audio-formats). * - * ### Next-generation models + * ### Large speech models and Next-generation models * - * The service supports next-generation `Multimedia` (16 kHz) and `Telephony` (8 kHz) models for many languages. - * Next-generation models have higher throughput than the service's previous generation of `Broadband` and - * `Narrowband` models. When you use next-generation models, the service can return transcriptions more quickly and - * also provide noticeably better transcription accuracy. + * The service supports large speech models and next-generation `Multimedia` (16 kHz) and `Telephony` (8 kHz) models + * for many languages. Large speech models and next-generation models have higher throughput than the service's + * previous generation of `Broadband` and `Narrowband` models. When you use large speech models and next-generation + * models, the service can return transcriptions more quickly and also provide noticeably better transcription + * accuracy. * - * You specify a next-generation model by using the `model` query parameter, as you do a previous-generation model. - * Most next-generation models support the `low_latency` parameter, and all next-generation models support the - * `character_insertion_bias` parameter. These parameters are not available with previous-generation models. + * You specify a large speech model or next-generation model by using the `model` query parameter, as you do a + * previous-generation model. Only the next-generation models support the `low_latency` parameter, and all large + * speech models and next-generation models support the `character_insertion_bias` parameter. These parameters are not + * available with previous-generation models. * - * Next-generation models do not support all of the speech recognition parameters that are available for use with - * previous-generation models. Next-generation models do not support the following parameters: + * Large speech models and next-generation models do not support all of the speech recognition parameters that are + * available for use with previous-generation models. Next-generation models do not support the following parameters: * * `acoustic_customization_id` * * `keywords` and `keywords_threshold` * * `processing_metrics` and `processing_metrics_interval` @@ -838,10 +854,14 @@ class SpeechToTextV1 extends BaseService { * * **Important:** Effective **31 July 2023**, all previous-generation models will be removed from the service and the * documentation. Most previous-generation models were deprecated on 15 March 2022. You must migrate to the equivalent - * next-generation model by 31 July 2023. For more information, see [Migrating to next-generation + * large speech model or next-generation model by 31 July 2023. For more information, see [Migrating to large speech * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-migrate). * * **See also:** + * * [Large speech languages and + * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-large-speech-languages) + * * [Supported features for large speech + * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-large-speech-languages#models-lsm-supported-features) * * [Next-generation languages and models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-ng) * * [Supported features for next-generation * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-ng#models-ng-features). @@ -913,6 +933,7 @@ class SpeechToTextV1 extends BaseService { * * Specify a value between 0.0 and 1.0. Unless a different customization weight was specified for the custom model * when the model was trained, the default value is: + * * 0.5 for large speech models * * 0.3 for previous-generation models * * 0.2 for most next-generation models * * 0.1 for next-generation English and Japanese models @@ -972,8 +993,9 @@ class SpeechToTextV1 extends BaseService { * **Note:** The parameter can be used with US English, Japanese, and Spanish (all dialects) transcription only. * * See [Smart formatting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-formatting#smart-formatting). - * @param {number} [params.smartFormattingVersion] - Smart formatting version is for next-generation models and that - * is supported in US English, Brazilian Portuguese, French and German languages. + * @param {number} [params.smartFormattingVersion] - Smart formatting version for large speech models and + * next-generation models is supported in US English, Brazilian Portuguese, French, German, Spanish and French + * Canadian languages. * @param {boolean} [params.speakerLabels] - If `true`, the response includes labels that identify which words were * spoken by which participants in a multi-person exchange. By default, the service returns no speaker labels. Setting * `speaker_labels` to `true` forces the `timestamps` parameter to be `true`, regardless of whether you specify @@ -981,8 +1003,7 @@ class SpeechToTextV1 extends BaseService { * * _For previous-generation models,_ the parameter can be used with Australian English, US English, German, * Japanese, Korean, and Spanish (both broadband and narrowband models) and UK English (narrowband model) * transcription only. - * * _For next-generation models,_ the parameter can be used with Czech, English (Australian, Indian, UK, and US), - * German, Japanese, Korean, and Spanish transcription only. + * * _For large speech models and next-generation models,_ the parameter can be used with all available languages. * * See [Speaker labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-speaker-labels). * @param {string} [params.grammarName] - The name of a grammar that is to be used with the recognition request. If @@ -1069,8 +1090,8 @@ class SpeechToTextV1 extends BaseService { * The values increase on a monotonic curve. Specifying one or two decimal places of precision (for example, `0.55`) * is typically more than sufficient. * - * The parameter is supported with all next-generation models and with most previous-generation models. See [Speech - * detector + * The parameter is supported with all large speech models, next-generation models and with most previous-generation + * models. See [Speech detector * sensitivity](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detection#detection-parameters-sensitivity) * and [Language model * support](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detection#detection-support). @@ -1086,8 +1107,8 @@ class SpeechToTextV1 extends BaseService { * The values increase on a monotonic curve. Specifying one or two decimal places of precision (for example, `0.55`) * is typically more than sufficient. * - * The parameter is supported with all next-generation models and with most previous-generation models. See - * [Background audio + * The parameter is supported with all large speech models, next-generation models and with most previous-generation + * models. See [Background audio * suppression](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detection#detection-parameters-suppression) * and [Language model * support](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detection#detection-support). @@ -1096,15 +1117,15 @@ class SpeechToTextV1 extends BaseService { * models produce transcription results faster than previous-generation models. The `low_latency` parameter causes the * models to produce results even more quickly, though the results might be less accurate when the parameter is used. * - * The parameter is not available for previous-generation `Broadband` and `Narrowband` models. It is available for - * most next-generation models. + * The parameter is not available for large speech models and previous-generation `Broadband` and `Narrowband` models. + * It is available for most next-generation models. * * For a list of next-generation models that support low latency, see [Supported next-generation language * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-ng#models-ng-supported). * * For more information about the `low_latency` parameter, see [Low * latency](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-interim#low-latency). - * @param {number} [params.characterInsertionBias] - For next-generation models, an indication of whether the service - * is biased to recognize shorter or longer strings of characters when developing transcription hypotheses. By - * default, the service is optimized to produce the best balance of strings of different lengths. + * @param {number} [params.characterInsertionBias] - For large speech models and next-generation models, an indication + * of whether the service is biased to recognize shorter or longer strings of characters when developing transcription + * hypotheses. By default, the service is optimized to produce the best balance of strings of different lengths. * * The default bias is 0.0. The allowable range of values is -1.0 to 1.0. * * Negative values bias the service to favor hypotheses with shorter strings of characters. @@ -1370,14 +1391,48 @@ class SpeechToTextV1 extends BaseService { * * **Important:** Effective **31 July 2023**, all previous-generation models will be removed from the service and the * documentation. Most previous-generation models were deprecated on 15 March 2022. You must migrate to the equivalent - * next-generation model by 31 July 2023. For more information, see [Migrating to next-generation + * large speech model or next-generation model by 31 July 2023. For more information, see [Migrating to large speech * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-migrate). * * **See also:** * * [Create a custom language * model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageCreate#createModel-language) * * [Language support for - * customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-support). + * customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-support) + * + * ### Large speech models and Next-generation models + * + * The service supports large speech models and next-generation `Multimedia` (16 kHz) and `Telephony` (8 kHz) models + * for many languages. Large speech models and next-generation models have higher throughput than the service's + * previous generation of `Broadband` and `Narrowband` models. When you use large speech models and next-generation + * models, the service can return transcriptions more quickly and also provide noticeably better transcription + * accuracy. + * + * You specify a large speech model or next-generation model by using the `model` query parameter, as you do a + * previous-generation model. Only the next-generation models support the `low_latency` parameter, and all large + * speech models and next-generation models support the `character_insertion_bias` parameter. These parameters are not + * available with previous-generation models. + * + * Large speech models and next-generation models do not support all of the speech recognition parameters that are + * available for use with previous-generation models. Next-generation models do not support the following parameters: + * * `acoustic_customization_id` + * * `keywords` and `keywords_threshold` + * * `processing_metrics` and `processing_metrics_interval` + * * `word_alternatives_threshold` + * + * **Important:** Effective **31 July 2023**, all previous-generation models will be removed from the service and the + * documentation. Most previous-generation models were deprecated on 15 March 2022. You must migrate to the equivalent + * large speech model or next-generation model by 31 July 2023. For more information, see [Migrating to large speech + * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-migrate). + * + * **See also:** + * * [Large speech languages and + * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-large-speech-languages) + * * [Supported features for large speech + * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-large-speech-languages#models-lsm-supported-features) + * * [Next-generation languages and models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-ng) + * * [Supported features for next-generation + * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-ng#models-ng-features). * * @param {Object} params - The parameters to send to the service. * @param {string} params.name - A user-defined name for the new custom language model. Use a localized name that @@ -1688,11 +1743,13 @@ class SpeechToTextV1 extends BaseService { * * `user` trains the model only on custom words that were added or modified by the user directly. The model is not * trained on new words extracted from corpora or grammars. * - * _For custom models that are based on next-generation models_, the service ignores the parameter. The words resource - * contains only custom words that the user adds or modifies directly, so the parameter is unnecessary. + * _For custom models that are based on large speech models and next-generation models_, the service ignores the + * `word_type_to_add` parameter. The words resource contains only custom words that the user adds or modifies + * directly, so the parameter is unnecessary. * @param {number} [params.customizationWeight] - Specifies a customization weight for the custom language model. The * customization weight tells the service how much weight to give to words from the custom language model compared to * those from the base model for speech recognition. Specify a value between 0.0 and 1.0. The default value is: + * * 0.5 for large speech models * * 0.3 for previous-generation models * * 0.2 for most next-generation models * * 0.1 for next-generation English and Japanese models @@ -1978,6 +2035,9 @@ class SpeechToTextV1 extends BaseService { * service's analysis of the corpus for the current request completes. Use the [Get a corpus](#getcorpus) method to * check the status of the analysis. * + * _For custom models that are based on large speech models_, the service parses and extracts word sequences from one + * or multiple corpora files. The characters help the service learn and predict character sequences from audio. + * * _For custom models that are based on previous-generation models_, the service auto-populates the model's words * resource with words from the corpus that are not found in its base vocabulary. These words are referred to as * out-of-vocabulary (OOV) words. After adding a corpus, you must validate the words resource to ensure that each OOV @@ -2002,11 +2062,11 @@ class SpeechToTextV1 extends BaseService { * model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageCreate#addCorpus) * * [Working with corpora for previous-generation * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaWords#workingCorpora) - * * [Working with corpora for next-generation + * * [Working with corpora for large speech models and next-generation * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaWords-ng#workingCorpora-ng) * * [Validating a words resource for previous-generation * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaWords#validateModel) - * * [Validating a words resource for next-generation + * * [Validating a words resource for large speech models and next-generation * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaWords-ng#validateModel-ng). * * @param {Object} params - The parameters to send to the service. @@ -2357,11 +2417,11 @@ class SpeechToTextV1 extends BaseService { * model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageCreate#addWords) * * [Working with custom words for previous-generation * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaWords#workingWords) - * * [Working with custom words for next-generation + * * [Working with custom words for large speech models and next-generation * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaWords-ng#workingWords-ng) * * [Validating a words resource for previous-generation * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaWords#validateModel) - * * [Validating a words resource for next-generation + * * [Validating a words resource for large speech models and next-generation * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaWords-ng#validateModel-ng). * * @param {Object} params - The parameters to send to the service. @@ -2455,11 +2515,11 @@ class SpeechToTextV1 extends BaseService { * model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageCreate#addWords) * * [Working with custom words for previous-generation * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaWords#workingWords) - * * [Working with custom words for next-generation + * * [Working with custom words for large speech models and next-generation * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaWords-ng#workingWords-ng) * * [Validating a words resource for previous-generation * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaWords#validateModel) - * * [Validating a words resource for next-generation + * * [Validating a words resource for large speech models and next-generation * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaWords-ng#validateModel-ng). * * @param {Object} params - The parameters to send to the service. @@ -2987,11 +3047,11 @@ class SpeechToTextV1 extends BaseService { * model count is below the limit. * * **Note:** Acoustic model customization is supported only for use with previous-generation models. It is not - * supported for next-generation models. + * supported for large speech models and next-generation models. * * **Important:** Effective **31 July 2023**, all previous-generation models will be removed from the service and the * documentation. Most previous-generation models were deprecated on 15 March 2022. You must migrate to the equivalent - * next-generation model by 31 July 2023. For more information, see [Migrating to next-generation + * large speech model or next-generation model by 31 July 2023. For more information, see [Migrating to large speech * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-migrate). * * **See also:** [Create a custom acoustic @@ -3065,7 +3125,7 @@ class SpeechToTextV1 extends BaseService { * list information about it. * * **Note:** Acoustic model customization is supported only for use with previous-generation models. It is not - * supported for next-generation models. + * supported for large speech models and next-generation models. * * **See also:** [Listing custom acoustic * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageAcousticModels#listModels-acoustic). @@ -3126,7 +3186,7 @@ class SpeechToTextV1 extends BaseService { * that owns a model to list information about it. * * **Note:** Acoustic model customization is supported only for use with previous-generation models. It is not - * supported for next-generation models. + * supported for large speech models and next-generation models. * * **See also:** [Listing custom acoustic * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageAcousticModels#listModels-acoustic). @@ -3184,7 +3244,7 @@ class SpeechToTextV1 extends BaseService { * that owns a model to delete it. * * **Note:** Acoustic model customization is supported only for use with previous-generation models. It is not - * supported for next-generation models. + * supported for large speech models and next-generation models. * * **See also:** [Deleting a custom acoustic * model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageAcousticModels#deleteModel-acoustic). @@ -3264,7 +3324,7 @@ class SpeechToTextV1 extends BaseService { * trained and available. * * **Note:** Acoustic model customization is supported only for use with previous-generation models. It is not - * supported for next-generation models. + * supported for large speech models and next-generation models. * * **See also:** * * [Train the custom acoustic @@ -3363,7 +3423,7 @@ class SpeechToTextV1 extends BaseService { * model to reset it. * * **Note:** Acoustic model customization is supported only for use with previous-generation models. It is not - * supported for next-generation models. + * supported for large speech models and next-generation models. * * **See also:** [Resetting a custom acoustic * model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageAcousticModels#resetModel-acoustic). @@ -3438,7 +3498,7 @@ class SpeechToTextV1 extends BaseService { * was not trained with a custom language model. * * **Note:** Acoustic model customization is supported only for use with previous-generation models. It is not - * supported for next-generation models. + * supported for large speech models and next-generation models. * * **See also:** [Upgrading a custom acoustic * model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-upgrade#custom-upgrade-acoustic). @@ -3516,7 +3576,7 @@ class SpeechToTextV1 extends BaseService { * its audio resources. * * **Note:** Acoustic model customization is supported only for use with previous-generation models. It is not - * supported for next-generation models. + * supported for large speech models and next-generation models. * * **See also:** [Listing audio resources for a custom acoustic * model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageAudio#listAudio). @@ -3601,7 +3661,7 @@ class SpeechToTextV1 extends BaseService { * seconds until it becomes `ok`. * * **Note:** Acoustic model customization is supported only for use with previous-generation models. It is not - * supported for next-generation models. + * supported for large speech models and next-generation models. * * **See also:** [Add audio to the custom acoustic * model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-acoustic#addAudio). @@ -3768,7 +3828,7 @@ class SpeechToTextV1 extends BaseService { * You must use credentials for the instance of the service that owns a model to list its audio resources. * * **Note:** Acoustic model customization is supported only for use with previous-generation models. It is not - * supported for next-generation models. + * supported for large speech models and next-generation models. * * **See also:** [Listing audio resources for a custom acoustic * model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageAudio#listAudio). @@ -3832,7 +3892,7 @@ class SpeechToTextV1 extends BaseService { * service that owns a model to delete its audio resources. * * **Note:** Acoustic model customization is supported only for use with previous-generation models. It is not - * supported for next-generation models. + * supported for large speech models and next-generation models. * * **See also:** [Deleting an audio resource from a custom acoustic * model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageAudio#deleteAudio). @@ -4000,15 +4060,19 @@ namespace SpeechToTextV1 { DE_DE_MULTIMEDIA = 'de-DE_Multimedia', DE_DE_NARROWBANDMODEL = 'de-DE_NarrowbandModel', DE_DE_TELEPHONY = 'de-DE_Telephony', + EN_AU = 'en-AU', EN_AU_BROADBANDMODEL = 'en-AU_BroadbandModel', EN_AU_MULTIMEDIA = 'en-AU_Multimedia', EN_AU_NARROWBANDMODEL = 'en-AU_NarrowbandModel', EN_AU_TELEPHONY = 'en-AU_Telephony', + EN_GB = 'en-GB', EN_GB_BROADBANDMODEL = 'en-GB_BroadbandModel', EN_GB_MULTIMEDIA = 'en-GB_Multimedia', EN_GB_NARROWBANDMODEL = 'en-GB_NarrowbandModel', EN_GB_TELEPHONY = 'en-GB_Telephony', + EN_IN = 'en-IN', EN_IN_TELEPHONY = 'en-IN_Telephony', + EN_US = 'en-US', EN_US_BROADBANDMODEL = 'en-US_BroadbandModel', EN_US_MULTIMEDIA = 'en-US_Multimedia', EN_US_NARROWBANDMODEL = 'en-US_NarrowbandModel', @@ -4030,10 +4094,12 @@ namespace SpeechToTextV1 { ES_MX_NARROWBANDMODEL = 'es-MX_NarrowbandModel', ES_PE_BROADBANDMODEL = 'es-PE_BroadbandModel', ES_PE_NARROWBANDMODEL = 'es-PE_NarrowbandModel', + FR_CA = 'fr-CA', FR_CA_BROADBANDMODEL = 'fr-CA_BroadbandModel', FR_CA_MULTIMEDIA = 'fr-CA_Multimedia', FR_CA_NARROWBANDMODEL = 'fr-CA_NarrowbandModel', FR_CA_TELEPHONY = 'fr-CA_Telephony', + FR_FR = 'fr-FR', FR_FR_BROADBANDMODEL = 'fr-FR_BroadbandModel', FR_FR_MULTIMEDIA = 'fr-FR_Multimedia', FR_FR_NARROWBANDMODEL = 'fr-FR_NarrowbandModel', @@ -4043,6 +4109,7 @@ namespace SpeechToTextV1 { IT_IT_NARROWBANDMODEL = 'it-IT_NarrowbandModel', IT_IT_MULTIMEDIA = 'it-IT_Multimedia', IT_IT_TELEPHONY = 'it-IT_Telephony', + JA_JP = 'ja-JP', JA_JP_BROADBANDMODEL = 'ja-JP_BroadbandModel', JA_JP_MULTIMEDIA = 'ja-JP_Multimedia', JA_JP_NARROWBANDMODEL = 'ja-JP_NarrowbandModel', @@ -4088,6 +4155,13 @@ namespace SpeechToTextV1 { * model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-use#models-use-default). */ model?: RecognizeConstants.Model | string; + /** 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. See [Using speech recognition + * parameters](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-service-features#features-parameters). + */ + speechBeginEvent?: boolean; /** 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, @@ -4118,6 +4192,7 @@ namespace SpeechToTextV1 { * * Specify a value between 0.0 and 1.0. Unless a different customization weight was specified for the custom model * when the model was trained, the default value is: + * * 0.5 for large speech models * * 0.3 for previous-generation models * * 0.2 for most next-generation models * * 0.1 for next-generation English and Japanese models @@ -4197,8 +4272,8 @@ namespace SpeechToTextV1 { * formatting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-formatting#smart-formatting). */ smartFormatting?: boolean; - /** Smart formatting version is for next-generation models and that is supported in US English, Brazilian - * Portuguese, French and German languages. + /** Smart formatting version for large speech models and next-generation models is supported in US English, + * Brazilian Portuguese, French, German, Spanish and French Canadian languages. */ smartFormattingVersion?: number; /** If `true`, the response includes labels that identify which words were spoken by which participants in a @@ -4207,8 +4282,7 @@ namespace SpeechToTextV1 { * * _For previous-generation models,_ the parameter can be used with Australian English, US English, German, * Japanese, Korean, and Spanish (both broadband and narrowband models) and UK English (narrowband model) * transcription only. - * * _For next-generation models,_ the parameter can be used with Czech, English (Australian, Indian, UK, and US), - * German, Japanese, Korean, and Spanish transcription only. + * * _For large speech models and next-generation models,_ the parameter can be used with all available languages. * * See [Speaker labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-speaker-labels). */ @@ -4284,8 +4358,8 @@ namespace SpeechToTextV1 { * The values increase on a monotonic curve. Specifying one or two decimal places of precision (for example, * `0.55`) is typically more than sufficient. * - * The parameter is supported with all next-generation models and with most previous-generation models. See [Speech - * detector + * The parameter is supported with all large speech models, next-generation models and with most + * previous-generation models. See [Speech detector * sensitivity](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detection#detection-parameters-sensitivity) * and [Language model * support](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detection#detection-support). @@ -4302,8 +4376,8 @@ namespace SpeechToTextV1 { * The values increase on a monotonic curve. Specifying one or two decimal places of precision (for example, * `0.55`) is typically more than sufficient. * - * The parameter is supported with all next-generation models and with most previous-generation models. See - * [Background audio + * The parameter is supported with all large speech models, next-generation models and with most + * previous-generation models. See [Background audio * suppression](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detection#detection-parameters-suppression) * and [Language model * support](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detection#detection-support). @@ -4314,17 +4388,17 @@ namespace SpeechToTextV1 { * results faster than previous-generation models. The `low_latency` parameter causes the models to produce results * even more quickly, though the results might be less accurate when the parameter is used. * - * The parameter is not available for previous-generation `Broadband` and `Narrowband` models. It is available for - * most next-generation models. + * The parameter is not available for large speech models and previous-generation `Broadband` and `Narrowband` + * models. It is available for most next-generation models. * * For a list of next-generation models that support low latency, see [Supported next-generation language * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-ng#models-ng-supported). * * For more information about the `low_latency` parameter, see [Low * latency](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-interim#low-latency). */ lowLatency?: boolean; - /** For next-generation models, an indication of whether the service is biased to recognize shorter or longer - * strings of characters when developing transcription hypotheses. By default, the service is optimized to produce - * the best balance of strings of different lengths. + /** For large speech models and next-generation models, an indication of whether the service is biased to + * recognize shorter or longer strings of characters when developing transcription hypotheses. By default, the + * service is optimized to produce the best balance of strings of different lengths. * * The default bias is 0.0. The allowable range of values is -1.0 to 1.0. * * Negative values bias the service to favor hypotheses with shorter strings of characters. @@ -4374,15 +4448,19 @@ namespace SpeechToTextV1 { DE_DE_MULTIMEDIA = 'de-DE_Multimedia', DE_DE_NARROWBANDMODEL = 'de-DE_NarrowbandModel', DE_DE_TELEPHONY = 'de-DE_Telephony', + EN_AU = 'en-AU', EN_AU_BROADBANDMODEL = 'en-AU_BroadbandModel', EN_AU_MULTIMEDIA = 'en-AU_Multimedia', EN_AU_NARROWBANDMODEL = 'en-AU_NarrowbandModel', EN_AU_TELEPHONY = 'en-AU_Telephony', + EN_IN = 'en-IN', EN_IN_TELEPHONY = 'en-IN_Telephony', + EN_GB = 'en-GB', EN_GB_BROADBANDMODEL = 'en-GB_BroadbandModel', EN_GB_MULTIMEDIA = 'en-GB_Multimedia', EN_GB_NARROWBANDMODEL = 'en-GB_NarrowbandModel', EN_GB_TELEPHONY = 'en-GB_Telephony', + EN_US = 'en-US', EN_US_BROADBANDMODEL = 'en-US_BroadbandModel', EN_US_MULTIMEDIA = 'en-US_Multimedia', EN_US_NARROWBANDMODEL = 'en-US_NarrowbandModel', @@ -4404,10 +4482,12 @@ namespace SpeechToTextV1 { ES_MX_NARROWBANDMODEL = 'es-MX_NarrowbandModel', ES_PE_BROADBANDMODEL = 'es-PE_BroadbandModel', ES_PE_NARROWBANDMODEL = 'es-PE_NarrowbandModel', + FR_CA = 'fr-CA', FR_CA_BROADBANDMODEL = 'fr-CA_BroadbandModel', FR_CA_MULTIMEDIA = 'fr-CA_Multimedia', FR_CA_NARROWBANDMODEL = 'fr-CA_NarrowbandModel', FR_CA_TELEPHONY = 'fr-CA_Telephony', + FR_FR = 'fr-FR', FR_FR_BROADBANDMODEL = 'fr-FR_BroadbandModel', FR_FR_MULTIMEDIA = 'fr-FR_Multimedia', FR_FR_NARROWBANDMODEL = 'fr-FR_NarrowbandModel', @@ -4417,6 +4497,7 @@ namespace SpeechToTextV1 { IT_IT_NARROWBANDMODEL = 'it-IT_NarrowbandModel', IT_IT_MULTIMEDIA = 'it-IT_Multimedia', IT_IT_TELEPHONY = 'it-IT_Telephony', + JA_JP = 'ja-JP', JA_JP_BROADBANDMODEL = 'ja-JP_BroadbandModel', JA_JP_MULTIMEDIA = 'ja-JP_Multimedia', JA_JP_NARROWBANDMODEL = 'ja-JP_NarrowbandModel', @@ -4551,6 +4632,7 @@ namespace SpeechToTextV1 { * * Specify a value between 0.0 and 1.0. Unless a different customization weight was specified for the custom model * when the model was trained, the default value is: + * * 0.5 for large speech models * * 0.3 for previous-generation models * * 0.2 for most next-generation models * * 0.1 for next-generation English and Japanese models @@ -4630,8 +4712,8 @@ namespace SpeechToTextV1 { * formatting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-formatting#smart-formatting). */ smartFormatting?: boolean; - /** Smart formatting version is for next-generation models and that is supported in US English, Brazilian - * Portuguese, French and German languages. + /** Smart formatting version for large speech models and next-generation models is supported in US English, + * Brazilian Portuguese, French, German, Spanish and French Canadian languages. */ smartFormattingVersion?: number; /** If `true`, the response includes labels that identify which words were spoken by which participants in a @@ -4640,8 +4722,7 @@ namespace SpeechToTextV1 { * * _For previous-generation models,_ the parameter can be used with Australian English, US English, German, * Japanese, Korean, and Spanish (both broadband and narrowband models) and UK English (narrowband model) * transcription only. - * * _For next-generation models,_ the parameter can be used with Czech, English (Australian, Indian, UK, and US), - * German, Japanese, Korean, and Spanish transcription only. + * * _For large speech models and next-generation models,_ the parameter can be used with all available languages. * * See [Speaker labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-speaker-labels). */ @@ -4740,8 +4821,8 @@ namespace SpeechToTextV1 { * The values increase on a monotonic curve. Specifying one or two decimal places of precision (for example, * `0.55`) is typically more than sufficient. * - * The parameter is supported with all next-generation models and with most previous-generation models. See [Speech - * detector + * The parameter is supported with all large speech models, next-generation models and with most + * previous-generation models. See [Speech detector * sensitivity](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detection#detection-parameters-sensitivity) * and [Language model * support](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detection#detection-support). @@ -4758,8 +4839,8 @@ namespace SpeechToTextV1 { * The values increase on a monotonic curve. Specifying one or two decimal places of precision (for example, * `0.55`) is typically more than sufficient. * - * The parameter is supported with all next-generation models and with most previous-generation models. See - * [Background audio + * The parameter is supported with all large speech models, next-generation models and with most + * previous-generation models. See [Background audio * suppression](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detection#detection-parameters-suppression) * and [Language model * support](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detection#detection-support). @@ -4770,17 +4851,17 @@ namespace SpeechToTextV1 { * results faster than previous-generation models. The `low_latency` parameter causes the models to produce results * even more quickly, though the results might be less accurate when the parameter is used. * - * The parameter is not available for previous-generation `Broadband` and `Narrowband` models. It is available for - * most next-generation models. + * The parameter is not available for large speech models and previous-generation `Broadband` and `Narrowband` + * models. It is available for most next-generation models. * * For a list of next-generation models that support low latency, see [Supported next-generation language * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-ng#models-ng-supported). * * For more information about the `low_latency` parameter, see [Low * latency](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-interim#low-latency). */ lowLatency?: boolean; - /** For next-generation models, an indication of whether the service is biased to recognize shorter or longer - * strings of characters when developing transcription hypotheses. By default, the service is optimized to produce - * the best balance of strings of different lengths. + /** For large speech models and next-generation models, an indication of whether the service is biased to + * recognize shorter or longer strings of characters when developing transcription hypotheses. By default, the + * service is optimized to produce the best balance of strings of different lengths. * * The default bias is 0.0. The allowable range of values is -1.0 to 1.0. * * Negative values bias the service to favor hypotheses with shorter strings of characters. @@ -4830,15 +4911,19 @@ namespace SpeechToTextV1 { DE_DE_MULTIMEDIA = 'de-DE_Multimedia', DE_DE_NARROWBANDMODEL = 'de-DE_NarrowbandModel', DE_DE_TELEPHONY = 'de-DE_Telephony', + EN_AU = 'en-AU', EN_AU_BROADBANDMODEL = 'en-AU_BroadbandModel', EN_AU_MULTIMEDIA = 'en-AU_Multimedia', EN_AU_NARROWBANDMODEL = 'en-AU_NarrowbandModel', EN_AU_TELEPHONY = 'en-AU_Telephony', + EN_IN = 'en-IN', EN_IN_TELEPHONY = 'en-IN_Telephony', + EN_GB = 'en-GB', EN_GB_BROADBANDMODEL = 'en-GB_BroadbandModel', EN_GB_MULTIMEDIA = 'en-GB_Multimedia', EN_GB_NARROWBANDMODEL = 'en-GB_NarrowbandModel', EN_GB_TELEPHONY = 'en-GB_Telephony', + EN_US = 'en-US', EN_US_BROADBANDMODEL = 'en-US_BroadbandModel', EN_US_MULTIMEDIA = 'en-US_Multimedia', EN_US_NARROWBANDMODEL = 'en-US_NarrowbandModel', @@ -4860,10 +4945,12 @@ namespace SpeechToTextV1 { ES_MX_NARROWBANDMODEL = 'es-MX_NarrowbandModel', ES_PE_BROADBANDMODEL = 'es-PE_BroadbandModel', ES_PE_NARROWBANDMODEL = 'es-PE_NarrowbandModel', + FR_CA = 'fr-CA', FR_CA_BROADBANDMODEL = 'fr-CA_BroadbandModel', FR_CA_MULTIMEDIA = 'fr-CA_Multimedia', FR_CA_NARROWBANDMODEL = 'fr-CA_NarrowbandModel', FR_CA_TELEPHONY = 'fr-CA_Telephony', + FR_FR = 'fr-FR', FR_FR_BROADBANDMODEL = 'fr-FR_BroadbandModel', FR_FR_MULTIMEDIA = 'fr-FR_Multimedia', FR_FR_NARROWBANDMODEL = 'fr-FR_NarrowbandModel', @@ -4873,6 +4960,7 @@ namespace SpeechToTextV1 { IT_IT_NARROWBANDMODEL = 'it-IT_NarrowbandModel', IT_IT_MULTIMEDIA = 'it-IT_Multimedia', IT_IT_TELEPHONY = 'it-IT_Telephony', + JA_JP = 'ja-JP', JA_JP_BROADBANDMODEL = 'ja-JP_BroadbandModel', JA_JP_MULTIMEDIA = 'ja-JP_Multimedia', JA_JP_NARROWBANDMODEL = 'ja-JP_NarrowbandModel', @@ -4977,15 +5065,19 @@ namespace SpeechToTextV1 { DE_DE_MULTIMEDIA = 'de-DE_Multimedia', DE_DE_NARROWBANDMODEL = 'de-DE_NarrowbandModel', DE_DE_TELEPHONY = 'de-DE_Telephony', + EN_AU = 'en-AU', EN_AU_BROADBANDMODEL = 'en-AU_BroadbandModel', EN_AU_MULTIMEDIA = 'en-AU_Multimedia', EN_AU_NARROWBANDMODEL = 'en-AU_NarrowbandModel', EN_AU_TELEPHONY = 'en-AU_Telephony', + EN_GB = 'en-GB', EN_GB_BROADBANDMODEL = 'en-GB_BroadbandModel', EN_GB_MULTIMEDIA = 'en-GB_Multimedia', EN_GB_NARROWBANDMODEL = 'en-GB_NarrowbandModel', EN_GB_TELEPHONY = 'en-GB_Telephony', + EN_IN = 'en-IN', EN_IN_TELEPHONY = 'en-IN_Telephony', + EN_US = 'en-US', EN_US_BROADBANDMODEL = 'en-US_BroadbandModel', EN_US_MULTIMEDIA = 'en-US_Multimedia', EN_US_NARROWBANDMODEL = 'en-US_NarrowbandModel', @@ -5007,10 +5099,12 @@ namespace SpeechToTextV1 { ES_MX_NARROWBANDMODEL = 'es-MX_NarrowbandModel', ES_PE_BROADBANDMODEL = 'es-PE_BroadbandModel', ES_PE_NARROWBANDMODEL = 'es-PE_NarrowbandModel', + FR_CA = 'fr-CA', FR_CA_BROADBANDMODEL = 'fr-CA_BroadbandModel', FR_CA_MULTIMEDIA = 'fr-CA_Multimedia', FR_CA_NARROWBANDMODEL = 'fr-CA_NarrowbandModel', FR_CA_TELEPHONY = 'fr-CA_Telephony', + FR_FR = 'fr-FR', FR_FR_BROADBANDMODEL = 'fr-FR_BroadbandModel', FR_FR_MULTIMEDIA = 'fr-FR_Multimedia', FR_FR_NARROWBANDMODEL = 'fr-FR_NarrowbandModel', @@ -5020,6 +5114,7 @@ namespace SpeechToTextV1 { IT_IT_NARROWBANDMODEL = 'it-IT_NarrowbandModel', IT_IT_MULTIMEDIA = 'it-IT_Multimedia', IT_IT_TELEPHONY = 'it-IT_Telephony', + JA_JP = 'ja-JP', JA_JP_BROADBANDMODEL = 'ja-JP_BroadbandModel', JA_JP_MULTIMEDIA = 'ja-JP_Multimedia', JA_JP_NARROWBANDMODEL = 'ja-JP_NarrowbandModel', @@ -5120,13 +5215,15 @@ namespace SpeechToTextV1 { * * `user` trains the model only on custom words that were added or modified by the user directly. The model is * not trained on new words extracted from corpora or grammars. * - * _For custom models that are based on next-generation models_, the service ignores the parameter. The words - * resource contains only custom words that the user adds or modifies directly, so the parameter is unnecessary. + * _For custom models that are based on large speech models and next-generation models_, the service ignores the + * `word_type_to_add` parameter. The words resource contains only custom words that the user adds or modifies + * directly, so the parameter is unnecessary. */ wordTypeToAdd?: TrainLanguageModelConstants.WordTypeToAdd | string; /** Specifies a customization weight for the custom language model. The customization weight tells the service * how much weight to give to words from the custom language model compared to those from the base model for speech * recognition. Specify a value between 0.0 and 1.0. The default value is: + * * 0.5 for large speech models * * 0.3 for previous-generation models * * 0.2 for most next-generation models * * 0.1 for next-generation English and Japanese models @@ -5162,7 +5259,7 @@ namespace SpeechToTextV1 { /** Constants for the `trainLanguageModel` operation. */ export namespace TrainLanguageModelConstants { - /** _For custom models that are based on previous-generation models_, the type of words from the custom language model's words resource on which to train the model: * `all` (the default) trains the model on all new words, regardless of whether they were extracted from corpora or grammars or were added or modified by the user. * `user` trains the model only on custom words that were added or modified by the user directly. The model is not trained on new words extracted from corpora or grammars. _For custom models that are based on next-generation models_, the service ignores the parameter. The words resource contains only custom words that the user adds or modifies directly, so the parameter is unnecessary. */ + /** _For custom models that are based on previous-generation models_, the type of words from the custom language model's words resource on which to train the model: * `all` (the default) trains the model on all new words, regardless of whether they were extracted from corpora or grammars or were added or modified by the user. * `user` trains the model only on custom words that were added or modified by the user directly. The model is not trained on new words extracted from corpora or grammars. _For custom models that are based on large speech models and next-generation models_, the service ignores the `word_type_to_add` parameter. The words resource contains only custom words that the user adds or modifies directly, so the parameter is unnecessary. */ export enum WordTypeToAdd { ALL = 'all', USER = 'user', @@ -6083,8 +6180,8 @@ namespace SpeechToTextV1 { name: string; /** The total number of words in the corpus. The value is `0` while the corpus is being processed. */ total_words: number; - /** _For custom models that are based on previous-generation models_, the number of OOV words extracted from the - * corpus. The value is `0` while the corpus is being processed. + /** _For custom models that are based on large speech models and previous-generation models_, the number of OOV + * words extracted from the corpus. The value is `0` while the corpus is being processed. * * _For custom models that are based on next-generation models_, no OOV words are extracted from corpora, so the * value is always `0`. diff --git a/speech-to-text/v1.ts b/speech-to-text/v1.ts index 380726a585..6fbc167a38 100644 --- a/speech-to-text/v1.ts +++ b/speech-to-text/v1.ts @@ -266,7 +266,6 @@ namespace SpeechToTextV1 { contentType?: string; customizationWeight?: number; inactivityTimeout?: number; - interimResults?: boolean; keywords?: string[]; keywordsThreshold?: number; maxAlternatives?: number; @@ -286,7 +285,6 @@ namespace SpeechToTextV1 { splitTranscriptAtPhraseEnd?: boolean; speechDetectorSensitivity?: number; backgroundAudioSuppression?: number; - lowLatency?: boolean; characterInsertionBias?: number; } } diff --git a/test/unit/discovery.v2.test.js b/test/unit/discovery.v2.test.js index fb2f654eb1..fce0aa4f45 100644 --- a/test/unit/discovery.v2.test.js +++ b/test/unit/discovery.v2.test.js @@ -255,7 +255,7 @@ describe('DiscoveryV2', () => { function __createProjectTest() { // Construct the params object for operation createProject const name = 'testString'; - const type = 'document_retrieval'; + const type = 'intelligent_document_processing'; const defaultQueryParameters = defaultQueryParamsModel; const createProjectParams = { name, @@ -301,7 +301,7 @@ describe('DiscoveryV2', () => { test('should prioritize user-given headers', () => { // parameters const name = 'testString'; - const type = 'document_retrieval'; + const type = 'intelligent_document_processing'; const userAccept = 'fake/accept'; const userContentType = 'fake/contentType'; const createProjectParams = { @@ -790,12 +790,14 @@ describe('DiscoveryV2', () => { const name = 'testString'; const description = 'testString'; const language = 'en'; + const ocrEnabled = false; const enrichments = [collectionEnrichmentModel]; const createCollectionParams = { projectId, name, description, language, + ocrEnabled, enrichments, }; @@ -816,6 +818,7 @@ describe('DiscoveryV2', () => { expect(mockRequestOptions.body.name).toEqual(name); expect(mockRequestOptions.body.description).toEqual(description); expect(mockRequestOptions.body.language).toEqual(language); + expect(mockRequestOptions.body.ocr_enabled).toEqual(ocrEnabled); expect(mockRequestOptions.body.enrichments).toEqual(enrichments); expect(mockRequestOptions.qs.version).toEqual(discoveryServiceOptions.version); expect(mockRequestOptions.path.project_id).toEqual(projectId); @@ -987,12 +990,14 @@ describe('DiscoveryV2', () => { const collectionId = 'testString'; const name = 'testString'; const description = 'testString'; + const ocrEnabled = false; const enrichments = [collectionEnrichmentModel]; const updateCollectionParams = { projectId, collectionId, name, description, + ocrEnabled, enrichments, }; @@ -1012,6 +1017,7 @@ describe('DiscoveryV2', () => { checkMediaHeaders(createRequestMock, expectedAccept, expectedContentType); expect(mockRequestOptions.body.name).toEqual(name); expect(mockRequestOptions.body.description).toEqual(description); + expect(mockRequestOptions.body.ocr_enabled).toEqual(ocrEnabled); expect(mockRequestOptions.body.enrichments).toEqual(enrichments); expect(mockRequestOptions.qs.version).toEqual(discoveryServiceOptions.version); expect(mockRequestOptions.path.project_id).toEqual(projectId); diff --git a/test/unit/speech-to-text.v1.test.js b/test/unit/speech-to-text.v1.test.js index f33d4e0e1f..bacfa2cbd3 100644 --- a/test/unit/speech-to-text.v1.test.js +++ b/test/unit/speech-to-text.v1.test.js @@ -273,6 +273,7 @@ describe('SpeechToTextV1', () => { const audio = Buffer.from('This is a mock file.'); const contentType = 'application/octet-stream'; const model = 'en-US_BroadbandModel'; + const speechBeginEvent = false; const languageCustomizationId = 'testString'; const acousticCustomizationId = 'testString'; const baseModelVersion = 'testString'; @@ -301,6 +302,7 @@ describe('SpeechToTextV1', () => { audio, contentType, model, + speechBeginEvent, languageCustomizationId, acousticCustomizationId, baseModelVersion, @@ -344,6 +346,7 @@ describe('SpeechToTextV1', () => { checkUserHeader(createRequestMock, 'Content-Type', contentType); expect(mockRequestOptions.body).toEqual(audio); expect(mockRequestOptions.qs.model).toEqual(model); + expect(mockRequestOptions.qs.speech_begin_event).toEqual(speechBeginEvent); expect(mockRequestOptions.qs.language_customization_id).toEqual(languageCustomizationId); expect(mockRequestOptions.qs.acoustic_customization_id).toEqual(acousticCustomizationId); expect(mockRequestOptions.qs.base_model_version).toEqual(baseModelVersion);