Assemble a pizza-ordering chatbot dialog  

Easily create a complex dialog with Watson Assistant Slots, Node.js, and IBM Cloud Kubernetes Service

Last updated | By Scott D’Angelo

Description

If you’ve used Watson Assistant and needed to have the user input data, you’ve noticed that the process can be cumbersome. Each time you added a field required a node, and validating the required logic was done on another node. Error handling, adding help, optional fields, and other logic would require even more nodes. Just creating a user profile or data form resulted in a large graph and extensive application logic. With the new Watson Assistant Slots feature, you can reduce that down to a single node. This code pattern shows how to create an online pizza order for a chatbot using a single node for input. After implementing this code, you will have the knowledge to create your own Watson Assistant Slots. This code pattern now includes instructions on how to use the IBM Cloud Kubernetes Service, too!

Overview

In this code pattern, we’ll create a simple chatbot with Node.js and Watson Assistant. There will be only a thin application layer, which provides the bare bones of a basic chatbot, with all the logic pushed into Watson Assistant via the new Watson Assistant Slots feature. The chatbot will take a pizza order, filling in slots for the various information required. A similar approach could be used for a user profile or other online form.

When you complete this code pattern, you will be able to:

  • Create a simple chatbot using Node.js and Watson Assistant
  • Use Watson Assistant Slots to fill out required data
  • Use slots handlers to handle conversation flow that does not fit into slots

The code pattern lets you also choose how to deploy the application, using Cloud Foundry on IBM Cloud, or the IBM Cloud Kubernetes Service.

Flow

  1. User sends dialog to cloud-based Node.js application.
  2. Application interacts with Watson Assistant and uses slots.
  3. Replies from Watson Assistant are returned to user via application.

Related Blogs

Jax 2018 – Just An Awesome Experience

What a week! From 23rd to 27th April our Berlin team attended the Jax conference in Mainz, Germany. We had such a great time sharing our fresh perspectives, in the form of a rousing keynote and two informative sessions. The concept of this annual event with over 2,000 participants, revolves around innovating with Java, architecture,...

Continue reading Jax 2018 – Just An Awesome Experience

CloudNativeCon and KubeCon are coming to Copenhagen!

With May just around the corner, mark your calendars for an exciting event, CloudNativeCon/KubeCon, in Denmark’s capital city of Copenhagen. Many of us in the Cloud Native community already visited this beautiful city for DockerCon EU last year and we’re excited to be able to take in all of the wonderful sites again this year....

Continue reading CloudNativeCon and KubeCon are coming to Copenhagen!

Live analytics with an event store fed from Java and analyzed in Jupyter Notebook

Event-driven analytics requires a data management system that can scale to allow a high rate of incoming events while optimizing to allow immediate analytics. IBM Db2 Event Store extends Apache Spark to provide accelerated queries and lightning fast inserts. This code pattern is a simple introduction to get you started with event-driven analytics. You can...

Continue reading Live analytics with an event store fed from Java and analyzed in Jupyter Notebook

Related Links

Building a dialog

Watson Assistant documentation details how to build a dialog, including the use of slots.