Skip to content

Commit

Permalink
Merge pull request #338 from chughts/langcode
Browse files Browse the repository at this point in the history
CRUD for Conversation Entities
  • Loading branch information
chughts authored Oct 5, 2017
2 parents d75431a + bd4760f commit 0adb821
Show file tree
Hide file tree
Showing 6 changed files with 258 additions and 28 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ Node-RED Watson Nodes for IBM Bluemix

<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>

### New in version 0.5.16
- Implement methods to manage Entities in Conversation workspace Manager node.
- Create Collection Language fix in Discovery Node.
- Similarity Search Nodes moved into deprecated category.

### New in version 0.5.15
- Allow language code to be specified on create collection in Discovery Node.
- Implement delete collection, delete environment in Discovery Node.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-node-watson",
"version": "0.5.15",
"version": "0.5.16",
"description": "A collection of Node-RED nodes for IBM Watson services",
"dependencies": {
"alchemy-api": "^1.3.0",
Expand Down
61 changes: 61 additions & 0 deletions services/conversation/v1-workspace-manager.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@
<option value="listCounterExamples">List Counter Examples</option>
<option value="createCounterExample">Create Counter Example</option>
<option value="deleteCounterExample">Delete Counter Example</option>
<option disabled>______________</option>
<option value="listEntities">List Entities</option>
<option value="getEntity">Get Entity Details</option>
<option value="createEntity">Create Entity</option>
<option value="updateEntity">Update Entity</option>
<option value="deleteEntity">Delete Entity</option>
</select>
</div>

Expand All @@ -88,6 +94,11 @@
<input type="text" id="node-input-cwm-example" placeholder="">
</div>

<div class="form-row">
<label for="node-input-cwm-entity"><i class="fa fa-book"></i> Entity</label>
<input type="text" id="node-input-cwm-entity" placeholder="">
</div>

<div class="form-row">
<label for="node-input-cwm-export-content"><i class="fa fa-book"></i> Export All Content</label>
<input type="checkbox" id="node-input-cwm-export-content" placeholder="">
Expand Down Expand Up @@ -206,6 +217,42 @@
specified conversation workspace.
</p>
</li>
<li>list Entities
<p>In this mode a list of all entities for the specified conversation
workspace are returned on
<code>msg.entities</code>
</p>
</li>
<li>Get Entity
<p>In this mode all information about the specified entity
is retrieved. The information is returned on
<code>msg.entity</code>
</p>
</li>
<li>Create Entity
<p>In this mode, a new entity is created in the specified workspace.
The input json structure
defining the content of the new entity
should be passed in
as <code>msg.payload</code>
</p>
</li>
<li>Update Entity
<p>In this mode, the specified entity is updated. The input json structure
defining the content of the updates
should be passed in
as <code>msg.payload</code>. Only the elements need to be included
in the json. Any included element will override the existing setting
for the element. ie. Any existing elements will
be overridden. ie. If any element is not mentioned in the json, then it
will be deleted.
You can use this mode to rename an entity.
</p>
</li>
<li>Delete Entity
<p>In this mode the selected entity is removed from the worskpace.
</p>
</li>

</ul>

Expand Down Expand Up @@ -246,6 +293,7 @@
fields.push('#node-input-cwm-workspace-id'
+ ', #node-input-cwm-intent'
+ ', #node-input-cwm-example'
+ ', #node-input-cwm-entity'
+ ', #node-input-cwm-export-content'
+ ', #node-input-cwm-service-endpoint');

Expand All @@ -260,6 +308,7 @@
switch (method) {
case 'getWorkspace':
case 'listIntents':
case 'listEntities':
fields.push('#node-input-cwm-workspace-id'
+ ', #node-input-cwm-export-content');
break;
Expand All @@ -285,9 +334,20 @@
fields.push('#node-input-cwm-workspace-id'
+ ', #node-input-cwm-example');
break;
case 'getEntity':
fields.push('#node-input-cwm-workspace-id'
+ ', #node-input-cwm-entity'
+ ', #node-input-cwm-export-content');
break;
case 'updateEntity':
case 'deleteEntity':
fields.push('#node-input-cwm-workspace-id'
+ ', #node-input-cwm-entity');
break;
case 'deleteWorkspace':
case 'updateWorkspace':
case 'createIntent':
case 'createEntity':
case 'listCounterExamples':
fields.push('#node-input-cwm-workspace-id');
break;
Expand Down Expand Up @@ -345,6 +405,7 @@
'cwm-workspace-id': {value:""},
'cwm-intent': {value:""},
'cwm-example': {value:""},
'cwm-entity': {value:""},
'cwm-export-content': {value:false},
'cwm-default-endpoint' :{value: true},
'cwm-service-endpoint' :{value: 'https://gateway.watsonplatform.net/conversation/api'}
Expand Down
Loading

0 comments on commit 0adb821

Please sign in to comment.