4. Build a dialog

dialog defines the flow of your conversation in the form of a logic tree. Each node of the tree has a condition that triggers it, based on user input.

We’ll create a simple dialog that handles our #hello and #goodbye intents, each with a single node.

If you’re not already there, go to the Conversation service and log in using your IBM Cloud (IBM Bluemix) email and password.

Adding a start node

Step 1
In your conversation tutorial workspace, click the Dialog tab.

Step 2
Click Create. You’ll see two nodes:

    • Welcome: Contains a greeting that is displayed to your users when they first engage with the bot.
    • Anything else: Contains phrases that are used to reply to users when their input is not recognized.

Step 3
Click the Welcome node to open it in the edit view.

Step 4
Replace the default response with the text, Welcome to the Conversation tutorial!.

Step 5
Click  to close the edit view.

You created a dialog node that is triggered by the welcome condition, which is a special condition that indicates that the user has started a new conversation. Your node specifies that when a new conversation starts, the system should respond with the welcome message.

Testing the start node

You can test your dialog at any time to verify the dialog. Let’s test it now.

  • Click the  Ask Watson icon in the upper right corner to open the “Try it out” pane. You should see your welcome message.