In this mode a list of all user input examples for and intent in
+
In this mode a list of all user input examples for an intent in
the specified conversation
workspace are returned on
msg.examples
@@ -174,6 +176,15 @@
In this mode the selected example for an intent is removed.
+
List Counter Examples
+
In this mode a list of all counter examples in
+ the specified conversation
+ workspace are returned on
+ msg.counterexamples.
+ Counterexamples are examples that have been marked as
+ irrelevant input.
+
+
For more information about the conversation service,
@@ -248,6 +259,7 @@
case 'deleteWorkspace':
case 'updateWorkspace':
case 'createIntent':
+ case 'listCounterExamples':
fields.push('#node-input-cwm-workspace-id');
break;
case 'listWorkspaces':
diff --git a/services/conversation/v1-workspace-manager.js b/services/conversation/v1-workspace-manager.js
index 6d0931af..8660c861 100644
--- a/services/conversation/v1-workspace-manager.js
+++ b/services/conversation/v1-workspace-manager.js
@@ -231,6 +231,22 @@ module.exports = function (RED) {
return p;
}
+ function executeListCounterExamples(node, conv, params, msg) {
+ var p = new Promise(function resolver(resolve, reject){
+ conv.getCounterExamples(params, function (err, response) {
+ if (err) {
+ reject(err);
+ } else {
+ msg['counterexamples'] = response.counterexamples ?
+ response.counterexamples: response;
+ resolve();
+ }
+ });
+ });
+ return p;
+ }
+
+
function executeUnknownMethod(node, conv, params, msg) {
return Promise.reject('Unable to process as unknown mode has been specified');
}
@@ -286,6 +302,9 @@ module.exports = function (RED) {
case 'deleteExample':
p = executeDeleteExample(node, conv, params, msg);
break;
+ case 'listCounterExamples':
+ p = executeListCounterExamples(node, conv, params, msg);
+ break;
default:
p = executeUnknownMethod(node, conv, params, msg);
break;
@@ -308,6 +327,7 @@ module.exports = function (RED) {
case 'listExamples':
case 'createExample':
case 'deleteExample':
+ case 'listCounterExamples':
if (config['cwm-workspace-id']) {
params['workspace_id'] = config['cwm-workspace-id'];
} else {
From 7e03c5f3496a24e85c204945e672fb14e38f2860 Mon Sep 17 00:00:00 2001
From: chughts
Date: Sun, 26 Mar 2017 16:55:57 +0200
Subject: [PATCH 2/5] Implement Create Counter Example Method
---
.../conversation/v1-workspace-manager.html | 11 +++++++++++
services/conversation/v1-workspace-manager.js | 19 +++++++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/services/conversation/v1-workspace-manager.html b/services/conversation/v1-workspace-manager.html
index dcb7e322..65d78fa1 100644
--- a/services/conversation/v1-workspace-manager.html
+++ b/services/conversation/v1-workspace-manager.html
@@ -59,6 +59,7 @@
+
@@ -185,6 +186,12 @@
irrelevant input.
+
Create Counter Example
+
In this mode a new counter example is created in the
+ specified conversation workspace.
+
+
+
For more information about the conversation service,
@@ -256,6 +263,10 @@
+ ', #node-input-cwm-intent'
+ ', #node-input-cwm-example');
break;
+ case 'createCounterExample':
+ fields.push('#node-input-cwm-workspace-id'
+ + ', #node-input-cwm-example');
+ break;
case 'deleteWorkspace':
case 'updateWorkspace':
case 'createIntent':
diff --git a/services/conversation/v1-workspace-manager.js b/services/conversation/v1-workspace-manager.js
index 8660c861..95022c86 100644
--- a/services/conversation/v1-workspace-manager.js
+++ b/services/conversation/v1-workspace-manager.js
@@ -246,6 +246,20 @@ module.exports = function (RED) {
return p;
}
+ function executeCreateCounterExample(node, conv, params, msg) {
+ var p = new Promise(function resolver(resolve, reject){
+ conv.createCounterExample(params, function (err, response) {
+ if (err) {
+ reject(err);
+ } else {
+ msg['counterexample'] = response;
+ resolve();
+ }
+ });
+ });
+ return p;
+ }
+
function executeUnknownMethod(node, conv, params, msg) {
return Promise.reject('Unable to process as unknown mode has been specified');
@@ -305,6 +319,9 @@ module.exports = function (RED) {
case 'listCounterExamples':
p = executeListCounterExamples(node, conv, params, msg);
break;
+ case 'createCounterExample':
+ p = executeCreateCounterExample(node, conv, params, msg);
+ break;
default:
p = executeUnknownMethod(node, conv, params, msg);
break;
@@ -328,6 +345,7 @@ module.exports = function (RED) {
case 'createExample':
case 'deleteExample':
case 'listCounterExamples':
+ case 'createCounterExample':
if (config['cwm-workspace-id']) {
params['workspace_id'] = config['cwm-workspace-id'];
} else {
@@ -368,6 +386,7 @@ module.exports = function (RED) {
switch (method) {
case 'createExample':
case 'deleteExample':
+ case 'createCounterExample':
if (config['cwm-example']) {
params['text'] = config['cwm-example'];
} else {
From 2f9d9e89f81fb1893babfe595cd231d6e6ea6a48 Mon Sep 17 00:00:00 2001
From: chughts
Date: Sun, 26 Mar 2017 17:08:15 +0200
Subject: [PATCH 3/5] Implement Delete Counter Example Method
---
.../conversation/v1-workspace-manager.html | 7 +++++++
services/conversation/v1-workspace-manager.js | 21 ++++++++++++++++++-
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/services/conversation/v1-workspace-manager.html b/services/conversation/v1-workspace-manager.html
index 65d78fa1..eb7d2a2d 100644
--- a/services/conversation/v1-workspace-manager.html
+++ b/services/conversation/v1-workspace-manager.html
@@ -60,6 +60,7 @@
+
@@ -191,6 +192,11 @@
specified conversation workspace.
+
Delete Counter Example
+
In this mode an existing counter example is deleted from the
+ specified conversation workspace.
+
+
@@ -264,6 +270,7 @@
+ ', #node-input-cwm-example');
break;
case 'createCounterExample':
+ case 'deleteCounterExample':
fields.push('#node-input-cwm-workspace-id'
+ ', #node-input-cwm-example');
break;
diff --git a/services/conversation/v1-workspace-manager.js b/services/conversation/v1-workspace-manager.js
index 95022c86..8fb45a78 100644
--- a/services/conversation/v1-workspace-manager.js
+++ b/services/conversation/v1-workspace-manager.js
@@ -260,6 +260,20 @@ module.exports = function (RED) {
return p;
}
+ function executeDeleteCounterExample(node, conv, params, msg) {
+ var p = new Promise(function resolver(resolve, reject){
+ conv.deleteCounterExample(params, function (err, response) {
+ if (err) {
+ reject(err);
+ } else {
+ msg['counterexample'] = response;
+ resolve();
+ }
+ });
+ });
+ return p;
+ }
+
function executeUnknownMethod(node, conv, params, msg) {
return Promise.reject('Unable to process as unknown mode has been specified');
@@ -322,6 +336,9 @@ module.exports = function (RED) {
case 'createCounterExample':
p = executeCreateCounterExample(node, conv, params, msg);
break;
+ case 'deleteCounterExample':
+ p = executeDeleteCounterExample(node, conv, params, msg);
+ break;
default:
p = executeUnknownMethod(node, conv, params, msg);
break;
@@ -346,6 +363,7 @@ module.exports = function (RED) {
case 'deleteExample':
case 'listCounterExamples':
case 'createCounterExample':
+ case 'deleteCounterExample':
if (config['cwm-workspace-id']) {
params['workspace_id'] = config['cwm-workspace-id'];
} else {
@@ -387,6 +405,7 @@ module.exports = function (RED) {
case 'createExample':
case 'deleteExample':
case 'createCounterExample':
+ case 'deleteCounterExample':
if (config['cwm-example']) {
params['text'] = config['cwm-example'];
} else {
@@ -586,7 +605,7 @@ module.exports = function (RED) {
});
- // This is the Speech to Text V1 Query Builder Node
+ // This is the Conversation Workspace Manager Node
function Node (config) {
RED.nodes.createNode(this, config);
var node = this;
From 89bc1decd331d031bed04bbfa437e8d0acabb310 Mon Sep 17 00:00:00 2001
From: chughts
Date: Sun, 26 Mar 2017 17:12:33 +0200
Subject: [PATCH 4/5] Bump version number
---
ChangeHistory.md | 177 +++++++++++++++++
README.md | 180 +-----------------
package.json | 2 +-
services/language_translator_identify/v2.html | 2 +-
4 files changed, 183 insertions(+), 178 deletions(-)
create mode 100644 ChangeHistory.md
diff --git a/ChangeHistory.md b/ChangeHistory.md
new file mode 100644
index 00000000..9118595f
--- /dev/null
+++ b/ChangeHistory.md
@@ -0,0 +1,177 @@
+## 0.4.x
+
+### New in version 0.4.43
+- Bump version of Conversation interface to '2017-02-03'
+- New node for Conversation Workspace Management
+
+### New in version 0.4.42
+- Clean up fix in Speech to Text Node, which caused problems with long audio tracks.
+
+### New in version 0.4.41
+- Add get pronunciation to Text to Speech Customization Node.
+
+### New in version 0.4.40
+- Add delete customization to Speech to Text Customization Node.
+
+### New in version 0.4.39
+- Add description to Info panel for Text to Speech Customizations Node.
+- Tone node updated to use url based services utility to detect bound service.
+
+### New in version 0.4.38
+- New Node for Text to Speech Customizations.
+- Added option to select Customization in Text To Speech Node.
+
+### New in version 0.4.37
+- Added support for word training in Speech to Text Customizations Node.
+
+### New in version 0.4.36
+- New Node for Speech to Text Customizations - Initial support for corpus (sentences) training.
+- Added option to select Customization in Speech to Text Node.
+
+### New in version 0.4.35
+- Fixed bug in Conversation node, when no msg.params defined.
+
+### New in version 0.4.34
+- Added Keyword and Entity emotion and sentiment as options on Alchemy Feature Extract Node.
+- Allow Conversation credentials to be provided on msg.params
+- Similarity Search and Visual Recognition Nodes updated to use url based services to detect bound service.
+
+### New in version 0.4.33
+- Personality Insights node updated to latest December 15, 2016 GloVe profiles.
+- Conversation, Alchemy Feature Extract and Date Extraction nodes updated to use url based services utility to detect bound service.
+
+### New in version 0.4.32
+- Added diarization support to STT Node via the parameter speaker_labels
+- STT and TTS node use url based services utility to detect bound service.
+
+### New in version 0.4.31
+- New V1 Query Builder Node for the Discovery Node
+
+### New in version 0.4.30
+- New services utilities to handle node-red app name clash problems
+- New V1 Discovery Node
+- Implementation of Discovery Node query, list and get details methods
+- Fix to Translator Node which was ignoring any override values set in the msg object
+
+### New in version 0.4.29
+- Fix to Document Conversion Node to preserve full msg object
+- Fix to Language Translator Node train mode documentation
+
+### New in version 0.4.28
+- New V1 Experimental Discovery Node
+
+### New in version 0.4.27
+- Change color of V3 Personality Insights Node
+
+### New in version 0.4.26
+- New V3 Personality Insights Node
+- Deprecated V2 Personality Insights Node
+
+### New in version 0.4.25
+- Fix to Language Translation Node to allow it work with File Inject
+
+### New in version 0.4.24
+- Bugfixes to Language Translator Train Node
+
+### New in version 0.4.23
+- Fix to Language Translator Train Node to allow it work with File Inject
+
+### New in version 0.4.22
+- Added new Date Extraction Node
+- Visual Recognition Node, now defaults detection setting and language on initial initialisation.
+
+### New in version 0.4.21
+- Added Translation and Language Identify nodes for Language Translator Service (Blue Tiles)
+- Deprecated Translation and Language Indentification nodes for Language Translation (Green Tiles)
+
+### New in version 0.4.20
+- Translation Node supports German
+
+### New in version 0.4.19
+- New Similarity Search (Beta) Node
+- New Language Translation Util mode, to request available translation models
+- Translation Node now has option to look for global translation settings
+- Enhancements to Conversation Node
+ - Node has option to remember context
+ - Context support for single user and multi-user models
+ - Ability to reset context, including user specific reset
+ - Ability to splice in additional context variables.
+- Added Concept support to News Node
+
+### New in version 0.4.18
+- Name space fixes to Text to Speech Node
+
+### New in version 0.4.17
+- Fixed how Document Conversion node was handling docx files
+
+### New in version 0.4.16
+- Oops! fix to Speech to Text Node
+
+### New in version 0.4.15
+- Name space fixes to Speech to Text Node
+
+### New in version 0.4.14
+- The dialog for the Text to Speech service now loads available voices dynamically. This allows
+new voices and languages to be identified without requiring a further code change.
+
+### New in version 0.4.13
+- Emergency fix for Watson Language Translation node. Bluemix credentials read too late.
+
+### New in version 0.4.12
+- Emergency fix for node.js version compatibility problem, in payload-utils
+
+### New in version 0.4.11
+- Corrected word count for Japanese text in Personality Insights nodes.
+- Move Dialog to deprecated list.
+
+### New in version 0.4.10
+- Conversation : added support for optional alternate_intents, output, entities and intents.
+- Conversation : Bugfixes
+- Retrieve and Rank : allow parameters to be passed into the nodes on the msg object
+- Moved Relationship Extraction and Concept Insights nodes to the deprecated list.
+- Updated dependency to watson-developer-cloud node-SDK v2.1.0
+
+### 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
+- Moved functions to utility module
+
+### New in version 0.4.7
+- Oops! fix to Conversation V1 node
+
+### New in version 0.4.6
+- New Conversation V1 node
+- Bugfixes to Feature Extract node
+- Bugfixes to Visual Recognition node
+- Added in Japanese and Arabic support to Personality Insights node
+- Updated dependency to watson-developer-cloud node-SDK 1.12.2
+
+### New in version 0.4.5
+- New Conversation experimental node.
+- Visual Recognition v3 : added a Delete All Classifiers feature in the util node. Added corresponding Flow in Starter.
+
+### New in version 0.4.4
+- New palette category for deprecated Nodes, that are being retained for backward compatibity.
+- Bugfixes to Speech to Text.
+
+### New in version 0.4.3
+- New Visual Recognition V3 node to support the V3 GA API. This incorporates the features that were previously
+available as part of AlchemyAPI Vision.
+
+### New in version 0.4.2
+- The transcription returned for the Speech to Text node now returns full (untruncated) transcription. The
+alternatives are returned in msg.fullresult. The dialog now loads available models dynamically. This will
+allow new speech models to be identified without requiring a further code change.
+- The Retrieve and Rank node nows stores credentials in a configuration node, allowing the credentials to be
+shared acrosss a flow with multiple Retrieve and Rank nodes.
+- New Tone Analyzer V3 node to support the V3 GA API.
+
+### New in version 0.4.1
+- AlchemyAPI Image Analysis and Language nodes migrated from old Alchemy SDK to current
+Watson Developer Cloud SDK for Node.js
+- The dialog for the Language Translation service now loads available models dynamically. This allows
+new translation models to be identified without requiring a further code change. This version
+allows customised translations models to be selected.
diff --git a/README.md b/README.md
index 55ae981a..d07467a7 100644
--- a/README.md
+++ b/README.md
@@ -7,11 +7,14 @@ Node-RED Watson Nodes for IBM Bluemix
+### New in version 0.5.3
+- Implement methods to manage Counter Examples in
+Conversation workspace Manager node.
+
### New in version 0.5.2
- Visual Recognition was overwriting msg.payload with 'look at msg.results'. Fixed
so that msg.payload is left as is.
-
### New in version 0.5.1
- Implement methods to manage for Intent and Example Input for Intent, in
Conversation workspace Manager node.
@@ -27,181 +30,6 @@ Conversation workspace Manager node.
- watson-developer-cloud dependency forces node engine >= 4.5
- Nodes deprecated in 0.4.x will be removed in 0.5.x releases
-### New in version 0.4.43
-- Bump version of Conversation interface to '2017-02-03'
-- New node for Conversation Workspace Management
-
-### New in version 0.4.42
-- Clean up fix in Speech to Text Node, which caused problems with long audio tracks.
-
-### New in version 0.4.41
-- Add get pronunciation to Text to Speech Customization Node.
-
-### New in version 0.4.40
-- Add delete customization to Speech to Text Customization Node.
-
-### New in version 0.4.39
-- Add description to Info panel for Text to Speech Customizations Node.
-- Tone node updated to use url based services utility to detect bound service.
-
-### New in version 0.4.38
-- New Node for Text to Speech Customizations.
-- Added option to select Customization in Text To Speech Node.
-
-### New in version 0.4.37
-- Added support for word training in Speech to Text Customizations Node.
-
-### New in version 0.4.36
-- New Node for Speech to Text Customizations - Initial support for corpus (sentences) training.
-- Added option to select Customization in Speech to Text Node.
-
-### New in version 0.4.35
-- Fixed bug in Conversation node, when no msg.params defined.
-
-### New in version 0.4.34
-- Added Keyword and Entity emotion and sentiment as options on Alchemy Feature Extract Node.
-- Allow Conversation credentials to be provided on msg.params
-- Similarity Search and Visual Recognition Nodes updated to use url based services to detect bound service.
-
-### New in version 0.4.33
-- Personality Insights node updated to latest December 15, 2016 GloVe profiles.
-- Conversation, Alchemy Feature Extract and Date Extraction nodes updated to use url based services utility to detect bound service.
-
-### New in version 0.4.32
-- Added diarization support to STT Node via the parameter speaker_labels
-- STT and TTS node use url based services utility to detect bound service.
-
-### New in version 0.4.31
-- New V1 Query Builder Node for the Discovery Node
-
-### New in version 0.4.30
-- New services utilities to handle node-red app name clash problems
-- New V1 Discovery Node
-- Implementation of Discovery Node query, list and get details methods
-- Fix to Translator Node which was ignoring any override values set in the msg object
-
-### New in version 0.4.29
-- Fix to Document Conversion Node to preserve full msg object
-- Fix to Language Translator Node train mode documentation
-
-### New in version 0.4.28
-- New V1 Experimental Discovery Node
-
-### New in version 0.4.27
-- Change color of V3 Personality Insights Node
-
-### New in version 0.4.26
-- New V3 Personality Insights Node
-- Deprecated V2 Personality Insights Node
-
-### New in version 0.4.25
-- Fix to Language Translation Node to allow it work with File Inject
-
-### New in version 0.4.24
-- Bugfixes to Language Translator Train Node
-
-### New in version 0.4.23
-- Fix to Language Translator Train Node to allow it work with File Inject
-
-### New in version 0.4.22
-- Added new Date Extraction Node
-- Visual Recognition Node, now defaults detection setting and language on initial initialisation.
-
-### New in version 0.4.21
-- Added Translation and Language Identify nodes for Language Translator Service (Blue Tiles)
-- Deprecated Translation and Language Indentification nodes for Language Translation (Green Tiles)
-
-### New in version 0.4.20
-- Translation Node supports German
-
-### New in version 0.4.19
-- New Similarity Search (Beta) Node
-- New Language Translation Util mode, to request available translation models
-- Translation Node now has option to look for global translation settings
-- Enhancements to Conversation Node
- - Node has option to remember context
- - Context support for single user and multi-user models
- - Ability to reset context, including user specific reset
- - Ability to splice in additional context variables.
-- Added Concept support to News Node
-
-### New in version 0.4.18
-- Name space fixes to Text to Speech Node
-
-### New in version 0.4.17
-- Fixed how Document Conversion node was handling docx files
-
-### New in version 0.4.16
-- Oops! fix to Speech to Text Node
-
-### New in version 0.4.15
-- Name space fixes to Speech to Text Node
-
-### New in version 0.4.14
-- The dialog for the Text to Speech service now loads available voices dynamically. This allows
-new voices and languages to be identified without requiring a further code change.
-
-### New in version 0.4.13
-- Emergency fix for Watson Language Translation node. Bluemix credentials read too late.
-
-### New in version 0.4.12
-- Emergency fix for node.js version compatibility problem, in payload-utils
-
-### New in version 0.4.11
-- Corrected word count for Japanese text in Personality Insights nodes.
-- Move Dialog to deprecated list.
-
-### New in version 0.4.10
-- Conversation : added support for optional alternate_intents, output, entities and intents.
-- Conversation : Bugfixes
-- Retrieve and Rank : allow parameters to be passed into the nodes on the msg object
-- Moved Relationship Extraction and Concept Insights nodes to the deprecated list.
-- Updated dependency to watson-developer-cloud node-SDK v2.1.0
-
-### 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
-- Moved functions to utility module
-
-### New in version 0.4.7
-- Oops! fix to Conversation V1 node
-
-### New in version 0.4.6
-- New Conversation V1 node
-- Bugfixes to Feature Extract node
-- Bugfixes to Visual Recognition node
-- Added in Japanese and Arabic support to Personality Insights node
-- Updated dependency to watson-developer-cloud node-SDK 1.12.2
-
-### New in version 0.4.5
-- New Conversation experimental node.
-- Visual Recognition v3 : added a Delete All Classifiers feature in the util node. Added corresponding Flow in Starter.
-
-### New in version 0.4.4
-- New palette category for deprecated Nodes, that are being retained for backward compatibity.
-- Bugfixes to Speech to Text.
-
-### New in version 0.4.3
-- New Visual Recognition V3 node to support the V3 GA API. This incorporates the features that were previously
-available as part of AlchemyAPI Vision.
-
-### New in version 0.4.2
-- The transcription returned for the Speech to Text node now returns full (untruncated) transcription. The
-alternatives are returned in msg.fullresult. The dialog now loads available models dynamically. This will
-allow new speech models to be identified without requiring a further code change.
-- The Retrieve and Rank node nows stores credentials in a configuration node, allowing the credentials to be
-shared acrosss a flow with multiple Retrieve and Rank nodes.
-- New Tone Analyzer V3 node to support the V3 GA API.
-
-### New in version 0.4.1
-- AlchemyAPI Image Analysis and Language nodes migrated from old Alchemy SDK to current
-Watson Developer Cloud SDK for Node.js
-- The dialog for the Language Translation service now loads available models dynamically. This allows
-new translation models to be identified without requiring a further code change. This version
-allows customised translations models to be selected.
### Watson Nodes for Node-RED
A collection of nodes to interact with the IBM Watson services in [IBM Bluemix](http://bluemix.net).
diff --git a/package.json b/package.json
index 45e20027..d120eb4b 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "node-red-node-watson",
- "version": "0.5.2",
+ "version": "0.5.3",
"description": "A collection of Node-RED nodes for IBM Watson services",
"dependencies": {
"alchemy-api": "^1.3.0",
diff --git a/services/language_translator_identify/v2.html b/services/language_translator_identify/v2.html
index 5a29ed78..e2fa218b 100644
--- a/services/language_translator_identify/v2.html
+++ b/services/language_translator_identify/v2.html
@@ -35,7 +35,7 @@