|
112 | 112 | </script> |
113 | 113 |
|
114 | 114 | <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 | + |
116 | 117 | <p>Use the drop-down menu in the node configuration window to select the required mode.</p> |
117 | 118 | <p></p> |
118 | | - <p><b>Create Mode</b>.</p> |
| 119 | + <p><b>Create Mode :</b></p> |
119 | 120 | <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> |
124 | 132 | <p></p> |
125 | | - <p><b>List Mode</b>.</p> |
| 133 | + <p><b>List Mode :</b></p> |
126 | 134 | <p>A list of the available dialogs is returned. For each a dialog id is given, this id is needed to |
127 | 135 | 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> |
129 | 137 | <p></p> |
130 | | - <p><b>Start Conversation Mode</b>.</p> |
| 138 | + <p><b>Start Conversation Mode :</b></p> |
131 | 139 | <p>The conversation is started and the introduction salutation from the dialog is returned.</p> |
132 | 140 | <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 !"; |
134 | 142 | msg.dialog_params = {}; |
135 | 143 | msg.dialog_params["dialog_id"] = "dialog id"; |
136 | | -return msg; |
137 | | - </code></pre> |
| 144 | +return msg;</code></pre> |
138 | 145 | <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> |
140 | 147 | <p></p> |
141 | | - <p><b>Conversation Mode</b>.</p> |
| 148 | + <p><b>Conversation Mode :</b></p> |
142 | 149 | <p>The conversation is continued.</p> |
143 | 150 | <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 ?"; |
145 | 152 | msg.dialog_params = {}; |
146 | 153 | msg.dialog_params["client_id"] = "client id"; |
147 | 154 | 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> |
151 | 157 | <p></p> |
152 | | - <p><b>List Profile Variables</b>.</p> |
| 158 | + <p><b>List Profile Variables :</b></p> |
153 | 159 | <p>Retrieves the profile variables that the dialog has set during the conversation. These can be |
154 | 160 | used to determine the state of the conversation, and by an applicaiton to perform any further actions.</p> |
155 | 161 | <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 = {}; |
158 | 163 | msg.dialog_params["dialog_id"] = "dialog id"; |
159 | 164 | msg.dialog_params["client_id"] = "client id"; |
160 | 165 | 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> |
164 | 168 | <p></p> |
165 | | - <p><b>Delete a Dialog</b>.</p> |
| 169 | + <p><b>Delete a Dialog :</b></p> |
166 | 170 | <p>Delete all Dialogs and associated data (conversations, profiles variables). To be used with caution</p> |
167 | 171 | <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 = {}; |
170 | 173 | msg.dialog_params["dialog_id"] = "dialog id"; |
171 | | - return msg; |
172 | | - </code></pre> |
| 174 | +return msg;</code></pre> |
173 | 175 | <p></p> |
174 | | - <p><b>Delete a Dialog</b>.</p> |
| 176 | + <p><b>Delete a Dialog :</b></p> |
175 | 177 | <p>Delete a Dialog and all associated data (conversations, profiles variables). </p> |
176 | 178 | <p></p> |
177 | 179 | <p><b>Delete All Dialogs</b>.</p> |
178 | 180 | <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> |
180 | 182 | <p></p> |
181 | 183 |
|
182 | 184 | <p>For more information about the Watson Dialog service, |
|
0 commit comments