Skip to content

Latest commit

 

History

History
133 lines (73 loc) · 4.82 KB

File metadata and controls

133 lines (73 loc) · 4.82 KB

Dialog service

Overview

The dialog service enables automation of a conversation between your application and a user. The node is available as a Watson Developer Cloud contribution to Node-RED and needs to be installed.

Installation of the Dialog Node

Follow the instructions at watson contribution nodes to install the dialog node into your Bluemix instance of Node-RED. Notice : in the Watson Node-RED Boilerplate this installation have been already done.

On Bluemix

If you are using Node-RED on Bluemix, go to your Node-RED app and click 'add a service or API' This will open a new window where you can select the Watson Dialog service. Then you click on 'Use' a screen will show which asks for a restage, click on 'yes' and wait a minute. When the application is started click on the Url to go to your Node-RED application.

List available dialogs

The first part of the flow is to generate a list of the available dialogs.

Copy an inject node.

Input to dialog list

Feed the output from the inject node to a dialog node.

dialog node for list of dialogs

Configure the mode for the dialog node to list the available dialogs.

configure the list dialog node

Send the output to a debug node.

dialog list output node

The list is available at msg.dialog.

dialog list output node

If you haven't registered any dialogs then the output list will be empty.

dialog empty list output node

Either follow Dialog Template Creation or use the dialog tool dialog tool to register your dialogs.

dialog tool

Once you have registered dialogs, then they will show up.

dialog list output node

Make a node of the dialog IDs you will need these for the next step.

Start a Dialog Conversation

When the dialog ID is known, a conversation can be started.

Add a new inject node.

dialog input start conversation

Configure the input to send a string as the conversation starter.

dialog input start text

Add a new dialog node.

dialog start dialog

Configure the node to start the conversation, setting the dialog id.

dialog start dialog properties

Send the output to a debug node.

dialog start output

The salutation response from the dialog is available at msg.dialog.

dialog start output properties

The salutation response from the dialog is available at msg.dialog.

dialog start salutation

Make a note of the client ID and the converstaion ID. You will need these to continue the conversation.

Continue a Conversation

With the client ID and conversation ID dialog ID you can continue a conversation, the state and properties will be remembered by the service.

Add a new inject node.

dialog input converse

Add a new dialog node, setting the mode, dialog ID, client ID, and conversation ID.

dialog input converse

Send the output to a debug node.

dialog input converse

Where you will be able to see the response from the dialog service.

dialog input converse

Delete a Dialog

This mode enables you to delete a Dialog given its Dialog ID. To do so, just add the Dialog ID in the node configuration.

delete a dialog : input

Send the output to a debug node

delete a dialog : output

Delete all Dialogs

This mode enables you to delete all Dialogs associated to the underlying Watson Dialog service instance. Use it with caution as the deletion is permanent

delete all dialogs : input

Send the output to a debug node

delete all dialogs : output

Available Flows :

  • Dialog Flow : illustrates all availables Dialog Node Modes, and proposes an automated Simulation of a Dialog Creation, Starting and following a Conversation.

Dialog Flow : complete

Notice : you can also use Dropbox instead of using the HTTP Request node : How to setup your Node-RED with Dropbox nodes