Skip to content

Commit 3d8e7ef

Browse files
Aaron BaughmanAaron Baughman
authored andcommitted
ENH: Added the ability to specify a customization_id. This option supports custom language models.
1 parent 0c04636 commit 3d8e7ef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

speech-to-text/recognize-stream.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ RecognizeStream.prototype.initialize = function() {
174174
options['X-Watson-Learning-Opt-Out'] = options['X-WDC-PL-OPT-OUT'];
175175
}
176176

177-
var queryParams = util._extend({model: 'en-US_BroadbandModel'}, pick(options, QUERY_PARAMS_ALLOWED));
177+
var queryParams=util._extend('customization_id' in options ? pick(options, QUERY_PARAMS_ALLOWED):{model: 'en-US_BroadbandModel'}, pick(options, QUERY_PARAMS_ALLOWED));
178+
178179
var queryString = qs.stringify(queryParams);
179180
var url = (options.url || 'wss://stream.watsonplatform.net/speech-to-text/api').replace(/^http/, 'ws') + '/v1/recognize?' + queryString;
180181

0 commit comments

Comments
 (0)