Skip to content

Commit 95f784e

Browse files
chore: mostly comment changes and an added resource test file
1 parent 81001cb commit 95f784e

9 files changed

Lines changed: 72 additions & 55 deletions

File tree

assistant/v2.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,7 @@ class AssistantV2 extends BaseService {
395395
*
396396
* List the events from the log of an assistant.
397397
*
398-
* If **cursor** is not specified, this operation is limited to 40 requests per 30 minutes. If **cursor** is
399-
* specified, the limit is 120 requests per minute. For more information, see **Rate limiting**.
398+
* This method is available only with Premium plans.
400399
*
401400
* @param {Object} params - The parameters to send to the service.
402401
* @param {string} params.assistantId - Unique identifier of the assistant. To find the assistant ID in the Watson

language-translator/v3.ts

Lines changed: 41 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import { Authenticator, BaseService, getAuthenticatorFromEnvironment, getMissing
2020
import { getSdkHeaders } from '../lib/common';
2121

2222
/**
23-
* IBM Watson™ Language Translator translates text from one language to another. The service offers multiple IBM
24-
* provided translation models that you can customize based on your unique terminology and language. Use Language
23+
* IBM Watson™ Language Translator translates text from one language to another. The service offers multiple
24+
* IBM-provided translation models that you can customize based on your unique terminology and language. Use Language
2525
* Translator to take news from across the globe and present it in your language, communicate with your customers in
2626
* their own language, and more.
2727
*/
@@ -128,16 +128,20 @@ class LanguageTranslatorV3 extends BaseService {
128128
/**
129129
* Translate.
130130
*
131-
* Translates the input text from the source language to the target language. A target language or translation model
132-
* ID is required. The service attempts to detect the language of the source text if it is not specified.
131+
* Translates the input text from the source language to the target language. Specify a model ID that indicates the
132+
* source and target languages, or specify the source and target languages individually. You can omit the source
133+
* language to have the service attempt to detect the language from the input text. If you omit the source language,
134+
* the request must contain sufficient input text for the service to identify the source language.
133135
*
134136
* @param {Object} params - The parameters to send to the service.
135-
* @param {string[]} params.text - Input text in UTF-8 encoding. Multiple entries will result in multiple translations
136-
* in the response.
137-
* @param {string} [params.modelId] - The model to use for translation. For example, `en-de` selects the IBM provided
138-
* base model for English to German translation. A model ID overrides the source and target parameters and is required
139-
* if you use a custom model. If no model ID is specified, you must specify a target language.
140-
* @param {string} [params.source] - Language code that specifies the language of the source document.
137+
* @param {string[]} params.text - Input text in UTF-8 encoding. Multiple entries result in multiple translations in
138+
* the response.
139+
* @param {string} [params.modelId] - The model to use for translation. For example, `en-de` selects the IBM-provided
140+
* base model for English-to-German translation. A model ID overrides the `source` and `target` parameters and is
141+
* required if you use a custom model. If no model ID is specified, you must specify at least a target language.
142+
* @param {string} [params.source] - Language code that specifies the language of the input text. If omitted, the
143+
* service derives the source language from the input text. The input must contain sufficient text for the service to
144+
* identify the language reliably.
141145
* @param {string} [params.target] - Language code that specifies the target language for translation. Required if
142146
* model ID is not specified.
143147
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
@@ -325,10 +329,10 @@ class LanguageTranslatorV3 extends BaseService {
325329
* @param {Object} [params] - The parameters to send to the service.
326330
* @param {string} [params.source] - Specify a language code to filter results by source language.
327331
* @param {string} [params.target] - Specify a language code to filter results by target language.
328-
* @param {boolean} [params._default] - If the default parameter isn't specified, the service will return all models
329-
* (default and non-default) for each language pair. To return only default models, set this to `true`. To return only
330-
* non-default models, set this to `false`. There is exactly one default model per language pair, the IBM provided
331-
* base model.
332+
* @param {boolean} [params._default] - If the `default` parameter isn't specified, the service returns all models
333+
* (default and non-default) for each language pair. To return only default models, set this parameter to `true`. To
334+
* return only non-default models, set this parameter to `false`. There is exactly one default model, the IBM-provided
335+
* base model, per language pair.
332336
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
333337
* @param {Function} [callback] - The callback that handles the response
334338
* @returns {Promise<LanguageTranslatorV3.Response<LanguageTranslatorV3.TranslationModels>>}
@@ -600,7 +604,7 @@ class LanguageTranslatorV3 extends BaseService {
600604
* Get model details.
601605
*
602606
* Gets information about a translation model, including training status for custom models. Use this API call to poll
603-
* the status of your customization request. A successfully completed training will have a status of `available`.
607+
* the status of your customization request. A successfully completed training has a status of `available`.
604608
*
605609
* @param {Object} params - The parameters to send to the service.
606610
* @param {string} params.modelId - Model ID of the model to get.
@@ -726,11 +730,12 @@ class LanguageTranslatorV3 extends BaseService {
726730
* Maximum file size: **20 MB**.
727731
* @param {string} params.filename - The filename for file.
728732
* @param {string} [params.fileContentType] - The content type of file.
729-
* @param {string} [params.modelId] - The model to use for translation. For example, `en-de` selects the IBM provided
730-
* base model for English to German translation. A model ID overrides the source and target parameters and is required
731-
* if you use a custom model. If no model ID is specified, you must specify a target language.
733+
* @param {string} [params.modelId] - The model to use for translation. For example, `en-de` selects the IBM-provided
734+
* base model for English-to-German translation. A model ID overrides the `source` and `target` parameters and is
735+
* required if you use a custom model. If no model ID is specified, you must specify at least a target language.
732736
* @param {string} [params.source] - Language code that specifies the language of the source document. If omitted, the
733-
* service derives the source language from the input text.
737+
* service derives the source language from the input text. The input must contain sufficient text for the service to
738+
* identify the language reliably.
734739
* @param {string} [params.target] - Language code that specifies the target language for translation. Required if
735740
* model ID is not specified.
736741
* @param {string} [params.documentId] - To use a previously submitted document as the source for a new translation,
@@ -1036,14 +1041,17 @@ namespace LanguageTranslatorV3 {
10361041

10371042
/** Parameters for the `translate` operation. */
10381043
export interface TranslateParams {
1039-
/** Input text in UTF-8 encoding. Multiple entries will result in multiple translations in the response. */
1044+
/** Input text in UTF-8 encoding. Multiple entries result in multiple translations in the response. */
10401045
text: string[];
1041-
/** The model to use for translation. For example, `en-de` selects the IBM provided base model for English to
1042-
* German translation. A model ID overrides the source and target parameters and is required if you use a custom
1043-
* model. If no model ID is specified, you must specify a target language.
1046+
/** The model to use for translation. For example, `en-de` selects the IBM-provided base model for
1047+
* English-to-German translation. A model ID overrides the `source` and `target` parameters and is required if you
1048+
* use a custom model. If no model ID is specified, you must specify at least a target language.
10441049
*/
10451050
modelId?: string;
1046-
/** Language code that specifies the language of the source document. */
1051+
/** Language code that specifies the language of the input text. If omitted, the service derives the source
1052+
* language from the input text. The input must contain sufficient text for the service to identify the language
1053+
* reliably.
1054+
*/
10471055
source?: string;
10481056
/** Language code that specifies the target language for translation. Required if model ID is not specified. */
10491057
target?: string;
@@ -1068,9 +1076,10 @@ namespace LanguageTranslatorV3 {
10681076
source?: string;
10691077
/** Specify a language code to filter results by target language. */
10701078
target?: string;
1071-
/** If the default parameter isn't specified, the service will return all models (default and non-default) for
1072-
* each language pair. To return only default models, set this to `true`. To return only non-default models, set
1073-
* this to `false`. There is exactly one default model per language pair, the IBM provided base model.
1079+
/** If the `default` parameter isn't specified, the service returns all models (default and non-default) for
1080+
* each language pair. To return only default models, set this parameter to `true`. To return only non-default
1081+
* models, set this parameter to `false`. There is exactly one default model, the IBM-provided base model, per
1082+
* language pair.
10741083
*/
10751084
_default?: boolean;
10761085
headers?: OutgoingHttpHeaders;
@@ -1146,13 +1155,14 @@ namespace LanguageTranslatorV3 {
11461155
filename: string;
11471156
/** The content type of file. */
11481157
fileContentType?: TranslateDocumentConstants.FileContentType | string;
1149-
/** The model to use for translation. For example, `en-de` selects the IBM provided base model for English to
1150-
* German translation. A model ID overrides the source and target parameters and is required if you use a custom
1151-
* model. If no model ID is specified, you must specify a target language.
1158+
/** The model to use for translation. For example, `en-de` selects the IBM-provided base model for
1159+
* English-to-German translation. A model ID overrides the `source` and `target` parameters and is required if you
1160+
* use a custom model. If no model ID is specified, you must specify at least a target language.
11521161
*/
11531162
modelId?: string;
11541163
/** Language code that specifies the language of the source document. If omitted, the service derives the source
1155-
* language from the input text.
1164+
* language from the input text. The input must contain sufficient text for the service to identify the language
1165+
* reliably.
11561166
*/
11571167
source?: string;
11581168
/** Language code that specifies the target language for translation. Required if model ID is not specified. */

natural-language-understanding/v1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService {
8989
* - Relations
9090
* - Semantic roles
9191
* - Sentiment
92-
* - Syntax (Experimental).
92+
* - Syntax.
9393
*
9494
* If a language for the input text is not specified with the `language` parameter, the service [automatically detects
9595
* the

speech-to-text/v1-generated.ts

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,8 @@ class SpeechToTextV1 extends BaseService {
360360
* `speaker_labels` to `true` forces the `timestamps` parameter to be `true`, regardless of whether you specify
361361
* `false` for the parameter.
362362
*
363-
* **Note:** Applies to US English, German, Japanese, Korean, and Spanish (both broadband and narrowband models) and
364-
* UK English (narrowband model) transcription only. To determine whether a language model supports speaker labels,
365-
* you can also use the **Get a model** method and check that the attribute `speaker_labels` is set to `true`.
363+
* **Note:** Applies to US English, Australian English, German, Japanese, Korean, and Spanish (both broadband and
364+
* narrowband models) and UK English (narrowband model) transcription only.
366365
*
367366
* See [Speaker labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#speaker_labels).
368367
* @param {string} [params.customizationId] - **Deprecated.** Use the `language_customization_id` parameter to specify
@@ -881,9 +880,8 @@ class SpeechToTextV1 extends BaseService {
881880
* `speaker_labels` to `true` forces the `timestamps` parameter to be `true`, regardless of whether you specify
882881
* `false` for the parameter.
883882
*
884-
* **Note:** Applies to US English, German, Japanese, Korean, and Spanish (both broadband and narrowband models) and
885-
* UK English (narrowband model) transcription only. To determine whether a language model supports speaker labels,
886-
* you can also use the **Get a model** method and check that the attribute `speaker_labels` is set to `true`.
883+
* **Note:** Applies to US English, Australian English, German, Japanese, Korean, and Spanish (both broadband and
884+
* narrowband models) and UK English (narrowband model) transcription only.
887885
*
888886
* See [Speaker labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#speaker_labels).
889887
* @param {string} [params.customizationId] - **Deprecated.** Use the `language_customization_id` parameter to specify
@@ -4168,6 +4166,8 @@ namespace SpeechToTextV1 {
41684166
AR_AR_BROADBANDMODEL = 'ar-AR_BroadbandModel',
41694167
DE_DE_BROADBANDMODEL = 'de-DE_BroadbandModel',
41704168
DE_DE_NARROWBANDMODEL = 'de-DE_NarrowbandModel',
4169+
EN_AU_BROADBANDMODEL = 'en-AU_BroadbandModel',
4170+
EN_AU_NARROWBANDMODEL = 'en-AU_NarrowbandModel',
41714171
EN_GB_BROADBANDMODEL = 'en-GB_BroadbandModel',
41724172
EN_GB_NARROWBANDMODEL = 'en-GB_NarrowbandModel',
41734173
EN_US_BROADBANDMODEL = 'en-US_BroadbandModel',
@@ -4318,10 +4318,8 @@ namespace SpeechToTextV1 {
43184318
* multi-person exchange. By default, the service returns no speaker labels. Setting `speaker_labels` to `true`
43194319
* forces the `timestamps` parameter to be `true`, regardless of whether you specify `false` for the parameter.
43204320
*
4321-
* **Note:** Applies to US English, German, Japanese, Korean, and Spanish (both broadband and narrowband models)
4322-
* and UK English (narrowband model) transcription only. To determine whether a language model supports speaker
4323-
* labels, you can also use the **Get a model** method and check that the attribute `speaker_labels` is set to
4324-
* `true`.
4321+
* **Note:** Applies to US English, Australian English, German, Japanese, Korean, and Spanish (both broadband and
4322+
* narrowband models) and UK English (narrowband model) transcription only.
43254323
*
43264324
* See [Speaker labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#speaker_labels).
43274325
*/
@@ -4438,6 +4436,8 @@ namespace SpeechToTextV1 {
44384436
AR_AR_BROADBANDMODEL = 'ar-AR_BroadbandModel',
44394437
DE_DE_BROADBANDMODEL = 'de-DE_BroadbandModel',
44404438
DE_DE_NARROWBANDMODEL = 'de-DE_NarrowbandModel',
4439+
EN_AU_BROADBANDMODEL = 'en-AU_BroadbandModel',
4440+
EN_AU_NARROWBANDMODEL = 'en-AU_NarrowbandModel',
44414441
EN_GB_BROADBANDMODEL = 'en-GB_BroadbandModel',
44424442
EN_GB_NARROWBANDMODEL = 'en-GB_NarrowbandModel',
44434443
EN_US_BROADBANDMODEL = 'en-US_BroadbandModel',
@@ -4647,10 +4647,8 @@ namespace SpeechToTextV1 {
46474647
* multi-person exchange. By default, the service returns no speaker labels. Setting `speaker_labels` to `true`
46484648
* forces the `timestamps` parameter to be `true`, regardless of whether you specify `false` for the parameter.
46494649
*
4650-
* **Note:** Applies to US English, German, Japanese, Korean, and Spanish (both broadband and narrowband models)
4651-
* and UK English (narrowband model) transcription only. To determine whether a language model supports speaker
4652-
* labels, you can also use the **Get a model** method and check that the attribute `speaker_labels` is set to
4653-
* `true`.
4650+
* **Note:** Applies to US English, Australian English, German, Japanese, Korean, and Spanish (both broadband and
4651+
* narrowband models) and UK English (narrowband model) transcription only.
46544652
*
46554653
* See [Speaker labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#speaker_labels).
46564654
*/
@@ -4790,6 +4788,8 @@ namespace SpeechToTextV1 {
47904788
AR_AR_BROADBANDMODEL = 'ar-AR_BroadbandModel',
47914789
DE_DE_BROADBANDMODEL = 'de-DE_BroadbandModel',
47924790
DE_DE_NARROWBANDMODEL = 'de-DE_NarrowbandModel',
4791+
EN_AU_BROADBANDMODEL = 'en-AU_BroadbandModel',
4792+
EN_AU_NARROWBANDMODEL = 'en-AU_NarrowbandModel',
47934793
EN_GB_BROADBANDMODEL = 'en-GB_BroadbandModel',
47944794
EN_GB_NARROWBANDMODEL = 'en-GB_NarrowbandModel',
47954795
EN_US_BROADBANDMODEL = 'en-US_BroadbandModel',
@@ -6274,7 +6274,12 @@ namespace SpeechToTextV1 {
62746274
* language model.
62756275
*/
62766276
custom_language_model: boolean;
6277-
/** Indicates whether the `speaker_labels` parameter can be used with the language model. */
6277+
/** Indicates whether the `speaker_labels` parameter can be used with the language model.
6278+
*
6279+
* **Note:** The field returns `true` for all models. However, speaker labels are supported only for US English,
6280+
* Australian English, German, Japanese, Korean, and Spanish (both broadband and narrowband models) and UK English
6281+
* (narrowband model only). Speaker labels are not supported for any other models.
6282+
*/
62786283
speaker_labels: boolean;
62796284
}
62806285

test/resources/TestEnrichments.csv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
engine,gasket,carburetor,piston,valves
2+
racing,stock,open,indy,drag
3+
flag,checkered,green,caution,yellow,red

test/unit/visual-recognition.v3.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const {
2929

3030
const service = {
3131
authenticator: new NoAuthAuthenticator(),
32-
url: 'https://gateway.watsonplatform.net/visual-recognition/api/visual-recognition/api',
32+
url: 'https://api.us-south.visual-recognition.watson.cloud.ibm.com',
3333
version: '2018-10-18',
3434
};
3535

test/unit/visual-recognition.v4.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const {
2828

2929
const service = {
3030
authenticator: new NoAuthAuthenticator(),
31-
url: 'https://gateway.watsonplatform.net/visual-recognition/api/visual-recognition/api',
31+
url: 'https://api.us-south.visual-recognition.watson.cloud.ibm.com',
3232
version: '2018-10-18',
3333
};
3434

visual-recognition/v3.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { getSdkHeaders } from '../lib/common';
2727

2828
class VisualRecognitionV3 extends BaseService {
2929

30-
static DEFAULT_SERVICE_URL: string = 'https://gateway.watsonplatform.net/visual-recognition/api';
30+
static DEFAULT_SERVICE_URL: string = 'https://api.us-south.visual-recognition.watson.cloud.ibm.com';
3131
static DEFAULT_SERVICE_NAME: string = 'watson_vision_combined';
3232

3333
/**
@@ -40,7 +40,7 @@ class VisualRecognitionV3 extends BaseService {
4040
* programmatically specify the current date at runtime, in case the API has been updated since your application's
4141
* release. Instead, specify a version date that is compatible with your application, and don't change it until your
4242
* application is ready for a later version.
43-
* @param {string} [options.serviceUrl] - The base url to use when contacting the service (e.g. 'https://gateway.watsonplatform.net/visual-recognition/api'). The base url may differ between IBM Cloud regions.
43+
* @param {string} [options.serviceUrl] - The base url to use when contacting the service (e.g. 'https://gateway.watsonplatform.net'). The base url may differ between IBM Cloud regions.
4444
* @param {OutgoingHttpHeaders} [options.headers] - Default headers that shall be included with every request to the service.
4545
* @param {string} [options.serviceName] - The name of the service to configure
4646
* @param {Authenticator} [options.authenticator] - The Authenticator object used to authenticate requests to the service. Defaults to environment if not set

0 commit comments

Comments
 (0)