diff --git a/README.md b/README.md index 96673947..85fb5493 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,10 @@ Node-RED Watson Nodes for IBM Bluemix CLA assistant + ### New in version 0.4.9 - Added in German and Japanese support to Natural Language Classifier node +- Visual Recognition V3 : added support of Accept-Language for Classify feature, new icon with pink background, icon label renamed (removing v3 from node name) ### New in version 0.4.8 - Fixed document conversion node when filetype is not recognized diff --git a/services/visual_recognition/icons/VR-v3-25x25.png b/services/visual_recognition/icons/VR-v3-25x25-old.png similarity index 100% rename from services/visual_recognition/icons/VR-v3-25x25.png rename to services/visual_recognition/icons/VR-v3-25x25-old.png diff --git a/services/visual_recognition/icons/VR-v3-full.png b/services/visual_recognition/icons/VR-v3-full.png deleted file mode 100644 index 890dbd22..00000000 Binary files a/services/visual_recognition/icons/VR-v3-full.png and /dev/null differ diff --git a/services/visual_recognition/icons/VR-v3-pink.png b/services/visual_recognition/icons/VR-v3-pink.png new file mode 100644 index 00000000..a9f654d4 Binary files /dev/null and b/services/visual_recognition/icons/VR-v3-pink.png differ diff --git a/services/visual_recognition/v3.html b/services/visual_recognition/v3.html index aee9523a..d8187907 100644 --- a/services/visual_recognition/v3.html +++ b/services/visual_recognition/v3.html @@ -36,6 +36,15 @@ +
+ + +
diff --git a/services/visual_recognition/v3.js b/services/visual_recognition/v3.js index 33d5bf5e..917e4256 100644 --- a/services/visual_recognition/v3.js +++ b/services/visual_recognition/v3.js @@ -85,9 +85,7 @@ module.exports = function (RED) { node.apikey = sAPIKey || node.credentials.apikey; if (!node.apikey) { node.status({fill:'red', shape:'ring', text:'missing credentials'}); - var message ='Missing Watson Visual Recognition API service credentials'; - - node.error(message, msg); + node.error('Missing Watson Visual Recognition API service credentials', msg); return false; } node.service = watson.visual_recognition({ @@ -154,6 +152,12 @@ module.exports = function (RED) { if (msg.params != null && msg.params.threshold != null) { params['threshold'] = msg.params['threshold']; } + if (node.config != null && node.config.lang != null) { + params['Accept-Language'] = node.config.lang; + } + if (msg.params != null && msg.params.accept_language != null) { + params['Accept-Language'] = msg.params['accept_language']; + } cb(); }); }); @@ -168,6 +172,12 @@ module.exports = function (RED) { if (msg.params != null && msg.params.threshold != null) { params['threshold'] = msg.params['threshold']; } + if (node.config != null && node.config.lang != null) { + params['Accept-Language'] = node.config.lang; + } + if (msg.params != null && msg.params.accept_language != null) { + params['Accept-Language'] = msg.params['accept_language']; + } return cb(); } else { node.status({fill:'red', shape:'ring', text:'payload is invalid'}); @@ -331,6 +341,7 @@ module.exports = function (RED) { function WatsonVisualRecognitionV3Node (config) { var node = this, b = false, feature = config['image-feature']; RED.nodes.createNode(this, config); + node.config = config; node.on('input', function (msg) { var params = {};