{"id":1313,"date":"2021-12-05T06:41:50","date_gmt":"2021-12-05T06:41:50","guid":{"rendered":"https:\/\/salarydistribution.com\/machine-learning\/2021\/12\/05\/assemble-a-pizza-ordering-chatbot-dialog\/"},"modified":"2021-12-05T06:41:50","modified_gmt":"2021-12-05T06:41:50","slug":"assemble-a-pizza-ordering-chatbot-dialog","status":"publish","type":"post","link":"https:\/\/salarydistribution.com\/machine-learning\/2021\/12\/05\/assemble-a-pizza-ordering-chatbot-dialog\/","title":{"rendered":"Assemble a pizza-ordering chatbot dialog"},"content":{"rendered":"<div id=\"\">\n            <!-- begin main body content --><\/p>\n<p><strong>Note:<\/strong> This code pattern uses the classic Watson Assistant experience. After October 8, 2021, all instances (except the standard plan) can switch between the classic and new Watson Assistant experiences by going to the upper-right corner of the Watson Assistant screen and clicking the Manage icon.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/developer.ibm.com\/developer\/default\/patterns\/assemble-a-pizza-ordering-chatbot-dialog\/images\/manage-icon.png\" alt=\"manage-icon\"><\/p>\n<p>See the <a href=\"https:\/\/www.ibm.com\/cloud\/watson-assistant\/\" target=\"_blank\" rel=\"noopener noreferrer\">Watson Assistant<\/a> page for more information on features and getting started.<\/p>\n<h2 id=\"summary\">Summary<\/h2>\n<p>If you\u2019ve used Watson Assistant and needed to have the user input data, you\u2019ve 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!<\/p>\n<h2 id=\"description\">Description<\/h2>\n<p>In this code pattern, we\u2019ll 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.<\/p>\n<p>When you complete this code pattern, you will be able to:<\/p>\n<ul>\n<li>Create a simple chatbot using Node.js and Watson Assistant<\/li>\n<li>Use Watson Assistant Slots to fill out required data<\/li>\n<li>Use slots handlers to handle conversation flow that does not fit into slots<\/li>\n<\/ul>\n<p>The code pattern lets you also choose how to deploy the application, using Cloud Foundry on IBM Cloud, or the IBM Cloud Kubernetes Service. Watson Assistant is available on <a href=\"https:\/\/www.ibm.com\/cloud\" target=\"_blank\" rel=\"noopener noreferrer\">IBM Cloud<\/a> and <a href=\"https:\/\/www.ibm.com\/products\/cloud-pak-for-data\" target=\"_blank\" rel=\"noopener noreferrer\">IBM Cloud Pak for Data<\/a>.<\/p>\n<h2 id=\"flow\">Flow<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/developer.ibm.com\/developer\/default\/patterns\/assemble-a-pizza-ordering-chatbot-dialog\/images\/pizza-architecture.png\" alt=\"flow\"><\/p>\n<ol>\n<li>User sends dialog to cloud-based Node.js application.<\/li>\n<li>Application interacts with Watson Assistant and uses slots.<\/li>\n<li>Replies from Watson Assistant are returned to user via application.<\/li>\n<\/ol>\n<h2 id=\"instructions\">Instructions<\/h2>\n<p>Find the detailed steps for this pattern in the <a href=\"https:\/\/github.com\/IBM\/watson-conversation-slots-intro\/blob\/master\/README.md\" target=\"_blank\" rel=\"noopener noreferrer\">README<\/a>. Those steps will show you how to:<\/p>\n<ol>\n<li>Clone the repo.<\/li>\n<li>Create IBM Cloud services.<\/li>\n<li>Get IBM Cloud credentials and add to the .env file.<\/li>\n<li>Configure Watson Assistant.<\/li>\n<li>Run the application.<\/li>\n<\/ol><\/div>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/developer.ibm.com\/patterns\/assemble-a-pizza-ordering-chatbot-dialog\/<\/p>\n","protected":false},"author":0,"featured_media":1314,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts\/1313"}],"collection":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/comments?post=1313"}],"version-history":[{"count":0,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts\/1313\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/media\/1314"}],"wp:attachment":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/media?parent=1313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/categories?post=1313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/tags?post=1313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}