Skip to content

Commit 9103998

Browse files
committed
docs: README and JSDoc comments updated
1 parent 7c91ea2 commit 9103998

File tree

9 files changed

+74
-55
lines changed

9 files changed

+74
-55
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ Some services use token-based Identity and Access Management (IAM) authenticatio
165165

166166
To use IAM authentication, you must use an `IamAuthenticator` or a `BearerTokenAuthenticator`.
167167
- Use the `IamAuthenticator` to have the SDK manage the lifecycle of the access token. The SDK requests an access token, ensures that the access token is valid, and refreshes it if necessary.
168-
- Use the `BearerTokenAuthenticator` if you want to manage the lifecycle yourself. For details, see [Authenticating with IAM tokens](https://cloud.ibm.com/docs/services/watson/getting-started-iam.html). If you want to switch your authenticator, you must override the `authenticator` property directly.
168+
- Use the `BearerTokenAuthenticator` if you want to manage the lifecycle yourself. For details, see [Authenticating with IAM tokens](https://cloud.ibm.com/docs/watson/getting-started-iam.html). If you want to switch your authenticator, you must override the `authenticator` property directly.
169169

170170
##### ICP
171171

@@ -310,7 +310,7 @@ recognizeStream.getTransactionId().then(
310310

311311
## Data collection opt-out
312312

313-
By default, [all requests are logged](https://cloud.ibm.com/docs/services/watson/getting-started-logging.html). This can be disabled of by setting the `X-Watson-Learning-Opt-Out` header when creating the service instance:
313+
By default, [all requests are logged](https://cloud.ibm.com/docs/watson/getting-started-logging.html). This can be disabled of by setting the `X-Watson-Learning-Opt-Out` header when creating the service instance:
314314

315315
```js
316316
const myInstance = new watson.WhateverServiceV1({
@@ -411,7 +411,7 @@ The Authorization service can generate auth tokens for situations where providin
411411
Tokens are valid for 1 hour and may be sent using the `X-Watson-Authorization-Token` header or the `watson-token` query param.
412412
Note that the token is supplied URL-encoded, and will not be accepted if it is double-encoded in a querystring.
413413

414-
> _NOTE_: Authenticating with the `X-Watson-Authorization-Token` header or the `watson-token` query param is now deprecated. The token continues to work with Cloud Foundry services, but is not supported for services that use Identity and Access Management (IAM) authentication. For details see [Authenticating with IAM tokens](https://cloud.ibm.com/docs/services/watson?topic=watson-iam#iam) or the README in the IBM Watson SDK you use.
414+
> _NOTE_: Authenticating with the `X-Watson-Authorization-Token` header or the `watson-token` query param is now deprecated. The token continues to work with Cloud Foundry services, but is not supported for services that use Identity and Access Management (IAM) authentication. For details see [Authenticating with IAM tokens](https://cloud.ibm.com/docs/watson?topic=watson-iam#iam) or the README in the IBM Watson SDK you use.
415415
The Authorization SDK now supports returning IAM Access Tokens when instantiated with an IAM API key.
416416

417417
```js
@@ -454,7 +454,7 @@ function (err, token) {
454454

455455
Use the [Assistant][assistant] service to determine the intent of a message.
456456

457-
Note: You must first create a workspace via IBM Cloud. See [the documentation](https://cloud.ibm.com/docs/services/conversation/index.html#about) for details.
457+
Note: You must first create a workspace via IBM Cloud. See [the documentation](https://cloud.ibm.com/docs/conversation/index.html#about) for details.
458458

459459
```js
460460
const AssistantV2 = require('ibm-watson/assistant/v2');
@@ -484,7 +484,7 @@ assistant.message(
484484

485485
Use the [Assistant][assistant] service to determine the intent of a message.
486486

487-
Note: You must first create a workspace via IBM Cloud. See [the documentation](https://cloud.ibm.com/docs/services/conversation/index.html#about) for details.
487+
Note: You must first create a workspace via IBM Cloud. See [the documentation](https://cloud.ibm.com/docs/conversation/index.html#about) for details.
488488

489489
```js
490490
const AssistantV1 = require('ibm-watson/assistant/v1');
@@ -611,7 +611,7 @@ languageTranslator.identify(
611611

612612
### Natural Language Classifier
613613

614-
Use [Natural Language Classifier](https://cloud.ibm.com/docs/services/natural-language-classifier/getting-started.html) service to create a classifier instance by providing a set of representative strings and a set of one or more correct classes for each as training. Then use the trained classifier to classify your new question for best matching answers or to retrieve next actions for your application.
614+
Use [Natural Language Classifier](https://cloud.ibm.com/docs/natural-language-classifier/getting-started.html) service to create a classifier instance by providing a set of representative strings and a set of one or more correct classes for each as training. Then use the trained classifier to classify your new question for best matching answers or to retrieve next actions for your application.
615615

616616
```js
617617
const NaturalLanguageClassifierV1 = require('ibm-watson/natural-language-classifier/v1');

assistant/v2.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -520,19 +520,7 @@ namespace AssistantV2 {
520520
/** Arbitrary variables that can be read and written by a particular skill. */
521521
user_defined?: JsonObject;
522522
/** System context data used by the skill. */
523-
system?: MessageContextSkillSystem;
524-
}
525-
526-
/** System context data used by the skill. */
527-
export interface MessageContextSkillSystem {
528-
/** An encoded string representing the current conversation state. By saving this value and then sending it in
529-
* the context of a subsequent message request, you can restore the conversation to the same state. This can be
530-
* useful if you need to return to an earlier point in the conversation or resume a paused conversation after the
531-
* session has expired.
532-
*/
533-
state?: string;
534-
/** MessageContextSkillSystem accepts additional properties. */
535-
[propName: string]: any;
523+
system?: JsonObject;
536524
}
537525

538526
/** Information specific to particular skills used by the Assistant. **Note:** Currently, only a single property named `main skill` is supported. This object contains variables that apply to the dialog skill used by the assistant. */

compare-comply/v1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,9 +735,9 @@ class CompareComplyV1 extends BaseService {
735735
* Run Compare and Comply methods over a collection of input documents.
736736
*
737737
* **Important:** Batch processing requires the use of the [IBM Cloud Object Storage
738-
* service](https://cloud.ibm.com/docs/services/cloud-object-storage?topic=cloud-object-storage-about#about-ibm-cloud-object-storage).
738+
* service](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-about#about-ibm-cloud-object-storage).
739739
* The use of IBM Cloud Object Storage with Compare and Comply is discussed at [Using batch
740-
* processing](https://cloud.ibm.com/docs/services/compare-comply?topic=compare-comply-batching#before-you-batch).
740+
* processing](https://cloud.ibm.com/docs/compare-comply?topic=compare-comply-batching#before-you-batch).
741741
*
742742
* @param {Object} params - The parameters to send to the service.
743743
* @param {string} params._function - The Compare and Comply method to run across the submitted input documents.

discovery/v2.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class DiscoveryV2 extends BaseService {
144144
* Query a project.
145145
*
146146
* By using this method, you can construct queries. For details, see the [Discovery
147-
* documentation](https://cloud.ibm.com/docs/services/discovery-data?topic=discovery-data-query-concepts).
147+
* documentation](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-query-concepts).
148148
*
149149
* @param {Object} params - The parameters to send to the service.
150150
* @param {string} params.projectId - The ID of the project. This information can be found from the deploy page of the
@@ -2154,6 +2154,8 @@ namespace DiscoveryV2 {
21542154
field: string;
21552155
/** The size of the sections the results are split into. */
21562156
interval: number;
2157+
/** Identifier specified in the query request of this aggregation. */
2158+
name?: string;
21572159
/** Array of numeric intervals. */
21582160
results?: QueryHistogramAggregationResult[];
21592161
}
@@ -2174,6 +2176,8 @@ namespace DiscoveryV2 {
21742176
field: string;
21752177
/** The number of top values returned. */
21762178
count?: number;
2179+
/** Identifier specified in the query request of this aggregation. */
2180+
name?: string;
21772181
/** Array of top values for the field. */
21782182
results?: QueryTermAggregationResult[];
21792183
}
@@ -2184,6 +2188,8 @@ namespace DiscoveryV2 {
21842188
field: string;
21852189
/** The date interval value. Valid values are seconds, minutes, hours, days, weeks, and years. */
21862190
interval: string;
2191+
/** Identifier specified in the query request of this aggregation. */
2192+
name?: string;
21872193
/** Array of aggregation results. */
21882194
results?: QueryTimesliceAggregationResult[];
21892195
}
@@ -2192,6 +2198,8 @@ namespace DiscoveryV2 {
21922198
export interface QueryTopHitsAggregation extends QueryAggregation {
21932199
/** The number of documents to return. */
21942200
size: number;
2201+
/** Identifier specified in the query request of this aggregation. */
2202+
name?: string;
21952203
hits?: QueryTopHitsAggregationResult;
21962204
}
21972205

language-translator/v3.ts

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,18 @@ class LanguageTranslatorV3 extends BaseService {
7676
/**
7777
* Translate.
7878
*
79-
* Translates the input text from the source language to the target language.
79+
* Translates the input text from the source language to the target language. A target language or translation model
80+
* ID is required. The service attempts to detect the language of the source text if it is not specified.
8081
*
8182
* @param {Object} params - The parameters to send to the service.
8283
* @param {string[]} params.text - Input text in UTF-8 encoding. Multiple entries will result in multiple translations
8384
* in the response.
84-
* @param {string} [params.modelId] - A globally unique string that identifies the underlying model that is used for
85-
* translation.
86-
* @param {string} [params.source] - Translation source language code.
87-
* @param {string} [params.target] - Translation target language code.
85+
* @param {string} [params.modelId] - The model to use for translation. For example, `en-de` selects the IBM provided
86+
* base model for English to German translation. A model ID overrides the source and target parameters and is required
87+
* if you use a custom model. If no model ID is specified, you must specify a target language.
88+
* @param {string} [params.source] - Language code that specifies the language of the source document.
89+
* @param {string} [params.target] - Language code that specifies the target language for translation. Required if
90+
* model ID is not specified.
8891
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
8992
* @param {Function} [callback] - The callback that handles the response
9093
* @returns {Promise<LanguageTranslatorV3.Response<LanguageTranslatorV3.TranslationResult>>}
@@ -610,15 +613,17 @@ class LanguageTranslatorV3 extends BaseService {
610613
* @param {NodeJS.ReadableStream|Buffer} params.file - The contents of the source file to translate.
611614
*
612615
* [Supported file
613-
* types](https://cloud.ibm.com/docs/services/language-translator?topic=language-translator-document-translator-tutorial#supported-file-formats)
616+
* types](https://cloud.ibm.com/docs/language-translator?topic=language-translator-document-translator-tutorial#supported-file-formats)
614617
*
615618
* Maximum file size: **20 MB**.
616619
* @param {string} params.filename - The filename for file.
617620
* @param {string} [params.fileContentType] - The content type of file.
618-
* @param {string} [params.modelId] - The model to use for translation. `model_id` or both `source` and `target` are
619-
* required.
621+
* @param {string} [params.modelId] - The model to use for translation. For example, `en-de` selects the IBM provided
622+
* base model for English to German translation. A model ID overrides the source and target parameters and is required
623+
* if you use a custom model. If no model ID is specified, you must specify a target language.
620624
* @param {string} [params.source] - Language code that specifies the language of the source document.
621-
* @param {string} [params.target] - Language code that specifies the target language for translation.
625+
* @param {string} [params.target] - Language code that specifies the target language for translation. Required if
626+
* model ID is not specified.
622627
* @param {string} [params.documentId] - To use a previously submitted document as the source for a new translation,
623628
* enter the `document_id` of the document.
624629
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
@@ -919,11 +924,14 @@ namespace LanguageTranslatorV3 {
919924
export interface TranslateParams {
920925
/** Input text in UTF-8 encoding. Multiple entries will result in multiple translations in the response. */
921926
text: string[];
922-
/** A globally unique string that identifies the underlying model that is used for translation. */
927+
/** The model to use for translation. For example, `en-de` selects the IBM provided base model for English to
928+
* German translation. A model ID overrides the source and target parameters and is required if you use a custom
929+
* model. If no model ID is specified, you must specify a target language.
930+
*/
923931
modelId?: string;
924-
/** Translation source language code. */
932+
/** Language code that specifies the language of the source document. */
925933
source?: string;
926-
/** Translation target language code. */
934+
/** Language code that specifies the target language for translation. Required if model ID is not specified. */
927935
target?: string;
928936
headers?: OutgoingHttpHeaders;
929937
}
@@ -1003,7 +1011,7 @@ namespace LanguageTranslatorV3 {
10031011
/** The contents of the source file to translate.
10041012
*
10051013
* [Supported file
1006-
* types](https://cloud.ibm.com/docs/services/language-translator?topic=language-translator-document-translator-tutorial#supported-file-formats)
1014+
* types](https://cloud.ibm.com/docs/language-translator?topic=language-translator-document-translator-tutorial#supported-file-formats)
10071015
*
10081016
* Maximum file size: **20 MB**.
10091017
*/
@@ -1012,11 +1020,14 @@ namespace LanguageTranslatorV3 {
10121020
filename: string;
10131021
/** The content type of file. */
10141022
fileContentType?: TranslateDocumentConstants.FileContentType | string;
1015-
/** The model to use for translation. `model_id` or both `source` and `target` are required. */
1023+
/** The model to use for translation. For example, `en-de` selects the IBM provided base model for English to
1024+
* German translation. A model ID overrides the source and target parameters and is required if you use a custom
1025+
* model. If no model ID is specified, you must specify a target language.
1026+
*/
10161027
modelId?: string;
10171028
/** Language code that specifies the language of the source document. */
10181029
source?: string;
1019-
/** Language code that specifies the target language for translation. */
1030+
/** Language code that specifies the target language for translation. Required if model ID is not specified. */
10201031
target?: string;
10211032
/** To use a previously submitted document as the source for a new translation, enter the `document_id` of the
10221033
* document.
@@ -1149,6 +1160,10 @@ namespace LanguageTranslatorV3 {
11491160
base_model_id?: string;
11501161
/** Translation source language code. */
11511162
source: string;
1163+
/** A score between 0 and 1 indicating the confidence of source language detection. A higher value indicates
1164+
* greater confidence. This is returned only when the service automatically detects the source language.
1165+
*/
1166+
detected_language_confidence?: number;
11521167
/** Translation target language code. */
11531168
target: string;
11541169
/** The time when the document was submitted. */
@@ -1239,6 +1254,12 @@ namespace LanguageTranslatorV3 {
12391254
word_count: number;
12401255
/** Number of characters in the input text. */
12411256
character_count: number;
1257+
/** The language code of the source text if the source language was automatically detected. */
1258+
detected_language?: string;
1259+
/** A score between 0 and 1 indicating the confidence of source language detection. A higher value indicates
1260+
* greater confidence. This is returned only when the service automatically detects the source language.
1261+
*/
1262+
detected_language_confidence?: number;
12421263
/** List of translation output in UTF-8, corresponding to the input text entries. */
12431264
translations: Translation[];
12441265
}

lib/recognize-stream.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ class RecognizeStream extends Duplex {
103103
* @param {boolean} [options.audioMetrics] - If true, requests detailed information about the signal characteristics of the input audio (detailed=false)
104104
* @param {number} [options.endOfPhraseSilenceTime] - If `true`, specifies the duration of the pause interval at which the service splits a transcript into multiple final results
105105
* @param {boolean} [options.splitTranscriptAtPhraseEnd] - If `true`, directs the service to split the transcript into multiple final results based on semantic features of the input
106+
* @param {number} [options.speechDetectorSensitivity] - The sensitivity of speech activity detection that the service is to perform
107+
* @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
106108
* @constructor
107109
*/
108110
constructor(options: RecognizeStream.Options) {

0 commit comments

Comments
 (0)