Skip to content

Commit be2c20c

Browse files
committed
Merge pull request #53 from ylecleach/master
Dialog node update :
2 parents 71c32b7 + 01e5e18 commit be2c20c

2 files changed

Lines changed: 126 additions & 123 deletions

File tree

services/dialog/v1.html

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -112,71 +112,73 @@
112112
</script>
113113

114114
<script type="text/x-red" data-help-name="service-dialog">
115-
<p>Watson Dialog Service, Lists available dialogs and runs a conversation against the dialog</p>
115+
<p>The IBM Watson Dialog service enables a developer to automate branching conversations between a user and your application. The Dialog service enables your applications to use natural language to automatically respond to user questions, cross-sell and up-sell, walk users through processes or applications, or even hand-hold users through difficult tasks. (<a href="https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/dialog.html">service documentation</a>)</p>
116+
116117
<p>Use the drop-down menu in the node configuration window to select the required mode.</p>
117118
<p></p>
118-
<p><b>Create Mode</b>.</p>
119+
<p><b>Create Mode :</b></p>
119120
<p>Creates a dialog template. A XML dialog file is required as input. If the dialog is created successfully the dialog id is returned.</p>
120-
<p>The file should be provided as msg.dialog_params["file"]</p>
121-
<p>The name for the dialog template should be provided as msg.dialog_params["dialog_name"]</p>
122-
<p>The dialog id from the service will be returned on <b>msg.dialog</b>.</p>
123-
<p><b>Note</b> : the Watson Dialog API support 3 files types : encrypted .mct, .json or .xml</p>
121+
<p>The file should be passed in on <code>msg.payload</code> and must be a valid Node.js Buffer.</p>
122+
<p>Example of input nodes for the create mode of the Dialog node:</b>.</p>
123+
<ul>
124+
<li>HTTP Request in binary mode</li>
125+
<li>Dropbox node</li>
126+
<li>Box node</li>
127+
</ul>
128+
<p>In addition, a unique name for the dialog template should be provided in input as</p>
129+
<pre><code>msg.dialog_params["dialog_name"]</code></pre>
130+
<p>The dialog id from the service will be returned on <code>msg.dialog</code>.</p>
131+
<p><b>Note</b> : the Watson Dialog API support 3 files types : encrypted .mct, .json or .xml. This node currently supports only .xml</p>
124132
<p></p>
125-
<p><b>List Mode</b>.</p>
133+
<p><b>List Mode :</b></p>
126134
<p>A list of the available dialogs is returned. For each a dialog id is given, this id is needed to
127135
start a conversation.</p>
128-
<p>The list from the service will be returned on <b>msg.dialog</b>.</p>
136+
<p>The list from the service will be returned on <code>msg.dialog</code>.</p>
129137
<p></p>
130-
<p><b>Start Conversation Mode</b>.</p>
138+
<p><b>Start Conversation Mode :</b></p>
131139
<p>The conversation is started and the introduction salutation from the dialog is returned.</p>
132140
<p>The Dialog Id can be passed either as a property or through a function</p>
133-
<pre><code>
141+
<pre><code>msg.payload="Hello !";
134142
msg.dialog_params = {};
135143
msg.dialog_params["dialog_id"] = "dialog id";
136-
return msg;
137-
</code></pre>
144+
return msg;</code></pre>
138145
<p>In addition a client id and a converstion id are returned. These ids are needed to continue a conversation.</p>
139-
<p>The salutation from the service will be returned on <b>msg.dialog</b>.</p>
146+
<p>The salutation from the service will be returned on <code>msg.dialog</code>.</p>
140147
<p></p>
141-
<p><b>Conversation Mode</b>.</p>
148+
<p><b>Conversation Mode :</b></p>
142149
<p>The conversation is continued.</p>
143150
<p>The Client and Conversation IDs can be passed either as properties or through a function</p>
144-
<pre><code>
151+
<pre><code>msg.payload="what type of pizza do you have ?";
145152
msg.dialog_params = {};
146153
msg.dialog_params["client_id"] = "client id";
147154
msg.dialog_params["converse_id"] = "conversation id";
148-
return msg;
149-
</code></pre>
150-
<p>The response from the service will be returned on <b>msg.dialog</b>.</p>
155+
return msg;</code></pre>
156+
<p>The response from the service will be returned on <code>msg.dialog</code>.</p>
151157
<p></p>
152-
<p><b>List Profile Variables</b>.</p>
158+
<p><b>List Profile Variables :</b></p>
153159
<p>Retrieves the profile variables that the dialog has set during the conversation. These can be
154160
used to determine the state of the conversation, and by an applicaiton to perform any further actions.</p>
155161
<p>The Dialog, Client and Conversation IDs can be passed either as properties or through a function</p>
156-
<pre><code>
157-
msg.dialog_params = {};
162+
<pre><code>msg.dialog_params = {};
158163
msg.dialog_params["dialog_id"] = "dialog id";
159164
msg.dialog_params["client_id"] = "client id";
160165
msg.dialog_params["converse_id"] = "conversation id";
161-
return msg;
162-
</code></pre>
163-
<p>The response from the service will be returned on <b>msg.dialog</b>.</p>
166+
return msg;</code></pre>
167+
<p>The response from the service will be returned on <code>msg.dialog</code>.</p>
164168
<p></p>
165-
<p><b>Delete a Dialog</b>.</p>
169+
<p><b>Delete a Dialog :</b></p>
166170
<p>Delete all Dialogs and associated data (conversations, profiles variables). To be used with caution</p>
167171
<p>The Dialog ID can be passed either as properties or through a function</p>
168-
<pre><code>
169-
msg.dialog_params = {};
172+
<pre><code>msg.dialog_params = {};
170173
msg.dialog_params["dialog_id"] = "dialog id";
171-
return msg;
172-
</code></pre>
174+
return msg;</code></pre>
173175
<p></p>
174-
<p><b>Delete a Dialog</b>.</p>
176+
<p><b>Delete a Dialog :</b></p>
175177
<p>Delete a Dialog and all associated data (conversations, profiles variables). </p>
176178
<p></p>
177179
<p><b>Delete All Dialogs</b>.</p>
178180
<p>Delete All Dialogs and all associated data (conversations, profiles variables). </p>
179-
<p><b>Notice</b>: to be used with caution</p>
181+
<p><b>Notice</b>: the Delete All mode is to be used with caution</p>
180182
<p></p>
181183

182184
<p>For more information about the Watson Dialog service,

0 commit comments

Comments
 (0)