Skip to content

Commit a6668e6

Browse files
authored
Merge pull request #451 from chughts/sttiamfix
STT IAM Fix
2 parents 4d20c7c + 308bcfb commit a6668e6

File tree

7 files changed

+38
-19
lines changed

7 files changed

+38
-19
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ Node-RED Watson Nodes for IBM Cloud
77

88
<a href="https://cla-assistant.io/watson-developer-cloud/node-red-node-watson"><img src="https://cla-assistant.io/readme/badge/watson-developer-cloud/node-red-node-watson" alt="CLA assistant" /></a>
99

10+
### New in version 0.7.6
11+
- Bump SDK Dependency to 3.18.2
12+
- STT Node To use iam-utils in place of removed iam-token-manager
13+
- STT Node removed codec setting as service can now automatically detect the codec of the input audio and supports more than codec=opus for ogg formats.
14+
- TSS Node fix to add visibility check on tts.voices and not stt.models
15+
- Assistant V1 Workspace Manager Node updated to reflect that in update mode, updated fields
16+
need a new_ prefix in their keys as part of the input json.
17+
- NLC Node - migrate off deprecated methods
18+
- NLC Node - Allow create of a classier to be based on a csv template node.
19+
1020
### New in version 0.7.5
1121
- Bump SDK Dependency to 3.15.0
1222
- Added Portuguese (Brazilian) and Chinese (Simplified and Traditional) as output languages

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-node-watson",
3-
"version": "0.7.5",
3+
"version": "0.7.6",
44
"description": "A collection of Node-RED nodes for IBM Watson services",
55
"dependencies": {
66
"async": "^1.5.2",
@@ -10,7 +10,8 @@
1010
"temp": "^0.9.0",
1111
"qs": "6.x",
1212
"image-type": "^2.0.2",
13-
"watson-developer-cloud": "^3.15.0",
13+
"watson-developer-cloud": "^3.18.2",
14+
"ibm-cloud-sdk-core": "^0.0.1",
1415
"word-count": "^0.2.2",
1516
"is-docx": "^0.0.3",
1617
"stream-to-array": "^2.3.0",

services/assistant/v1-workspace-manager.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,8 @@
340340
<p>In this mode, the specified dialog node is updated. The input json structure
341341
defining the content of the updates
342342
should be passed in
343-
as <code>msg.payload</code>.
343+
as <code>msg.payload</code>. Fields to be updated need a
344+
<code>new_</code> prefix as part of their key.
344345
</p>
345346
</li>
346347
<li>Delete Dialog Node

services/natural_language_classifier/v1.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
<select type="text" id="node-input-mode" style="display: inline-block; width: 70%;" >
5454
<option value="classify">Classify</option>
5555
<option value="create">Train</option>
56-
<option value="remove">Remove</option>
57-
<option value="list">List</option>
56+
<option value="deleteClassifier">Remove</option>
57+
<option value="listClassifiers">List</option>
5858
</select>
5959
</div>
6060
<div class="form-row mode classify">

services/natural_language_classifier/v1.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,13 @@ module.exports = function(RED) {
140140
node.checkForCreate = function(msg, config) {
141141
if ('create' !== config.mode) {
142142
return Promise.resolve(null);
143-
} else {
144-
var p = node.openTemp()
145-
.then(function(info) {
146-
return node.streamFile(msg, config, info);
147-
});
148-
return p;
143+
} else if ('string' === typeof msg.payload) {
144+
return Promise.resolve(null);
149145
}
146+
return node.openTemp()
147+
.then(function(info) {
148+
return node.streamFile(msg, config, info);
149+
});
150150
};
151151

152152
node.buildParams = function(msg, config, info, payloadData) {
@@ -167,11 +167,16 @@ module.exports = function(RED) {
167167
}
168168
break;
169169
case 'create':
170-
params.training_data = fs.createReadStream(info.path);
170+
if ('string' === typeof msg.payload) {
171+
params.training_data = msg.payload;
172+
} else {
173+
params.training_data = fs.createReadStream(info.path);
174+
}
175+
171176
params.language = config.language;
172177
break;
173-
case 'remove':
174-
case 'list':
178+
case 'deleteClassifier':
179+
case 'listClassifiers':
175180
params.classifier_id = msg.payload;
176181
if (msg.nlcparams && msg.nlcparams.classifier_id) {
177182
params.classifier_id = msg.nlcparams.classifier_id;

services/speech_to_text/v1.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = function (RED) {
2828
iamutils = require('../../utilities/iam-utils'),
2929
sttutils = require('./stt-utils'),
3030
AuthV1 = require('watson-developer-cloud/authorization/v1'),
31-
AuthIAMV1 = require('watson-developer-cloud/iam-token-manager/v1'),
31+
AuthIAMV1 = require('ibm-cloud-sdk-core/iam-token-manager/v1'),
3232
muteMode = true, discardMode = false, autoConnect = true,
3333
username = '', password = '', sUsername = '', sPassword = '',
3434
apikey = '', sApikey = '',
@@ -365,9 +365,11 @@ module.exports = function (RED) {
365365
params = {};
366366

367367
// If we get to here then the audio is in one of the supported formats.
368-
if (audioData.format === 'ogg') {
369-
audioData.format += ';codecs=opus';
370-
}
368+
// STT service can now automatically detect the codec of the input audio
369+
// and supports more than codec=opus for ogg formats.
370+
//if (audioData.format === 'ogg') {
371+
// audioData.format += ';codecs=opus';
372+
//}
371373

372374
params = {
373375
audio: audioData.audio,

services/text_to_speech/v1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@
447447
// Function to be used at the start, as don't want to expose any fields, unless the models are
448448
// available. The models can only be fetched if the credentials are available.
449449
tts.hideEverything = function () {
450-
if (!stt.models) {
450+
if (!tts.voices) {
451451
$('label#node-label-message').parent().hide();
452452
$('select#node-input-lang').parent().hide();
453453
$('select#node-input-voice').parent().hide();

0 commit comments

Comments
 (0)