Skip to content

Commit 1731b42

Browse files
committed
Debugging model retreival problem on bluemix
1 parent e5626af commit 1731b42

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

services/speech_to_text/v1.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
<input type="hidden" id="node-input-bandhidden"/>
5858
</div>
5959

60-
6160
<div class="form-row">
6261
<label for="node-input-continuous"><i class="fa fa-audio-o"></i> Continuous</label>
6362
<input type="checkbox" id="node-input-continuous"></input>
@@ -212,10 +211,12 @@
212211
// Retrieve the available models from the server, if data is returned, then
213212
// can enable the dynamic selection fields.
214213
function getModels(haveCredentials) {
214+
console.log('Fetching models');
215215
var u = $('#node-input-username').val();
216216
var p = $('#node-input-password').val();
217217

218218
$.getJSON('/watson-speech-to-text/models/', {un: u, pwd: p}).done(function (data) {
219+
console.log('Models have been retrieved');
219220
if (data.error) {
220221
$('label#node-label-message').parent().show();
221222
$('label#node-label-message').text(data.error);
@@ -283,6 +284,7 @@
283284
// This is the on edit prepare function, which will be invoked everytime the dialog
284285
// is shown.
285286
function oneditprepare() {
287+
console.log('In oneditprepare');
286288
hideEverything();
287289
restoreFromHidden();
288290
handlersUI();

services/speech_to_text/v1.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ module.exports = function (RED) {
5959

6060
// API used by widget to fetch available models
6161
RED.httpAdmin.get('/watson-speech-to-text/models', function (req, res) {
62+
console.log('Insde request to fetch models');
63+
console.log('Checking bound credentials username / password', username, password);
6264
var stt = watson.speech_to_text({
6365
username: username ? username : req.query.un,
6466
password: password ? password : req.query.pwd,
@@ -68,8 +70,10 @@ module.exports = function (RED) {
6870

6971
stt.getModels({}, function(err, models){
7072
if (err) {
73+
console.log('Error fetching models ', err);
7174
res.json(err);
7275
} else {
76+
console.log('Models returned');
7377
res.json(models);
7478
}
7579
});

0 commit comments

Comments
 (0)