Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Chatbots and Conversational UI Development

You're reading from   Hands-On Chatbots and Conversational UI Development Build chatbots and voice user interfaces with Chatfuel, Dialogflow, Microsoft Bot Framework, Twilio, and Alexa Skills

Arrow left icon
Product type Paperback
Published in Dec 2017
Publisher Packt
ISBN-13 9781788294669
Length 392 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Srini Janarthanam Srini Janarthanam
Author Profile Icon Srini Janarthanam
Srini Janarthanam
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Introduction FREE CHAPTER 2. Tour Guide for Your City 3. Let's Talk Weather 4. Building a Persona Bot 5. Let's Catch a Train 6. Restaurant Search 7. The News Bot 8. My TV Guide 9. My Man Friday 10. More Resources

Restaurant search bot

Let us build a chatbot that can search for restaurants based on user goals and preferences. Let us begin by building Node.js modules to get data from Zomato based on user preferences. Create a file called zomato.js. Add a request module to the Node.js libraries using the following command in the console:

> npm install request --save

In zomato.js, add the following code to begin with:

var request = require('request');

var baseURL = 'https://developers.zomato.com/api/v2.1/';
var apiKey = 'YOUR_API_KEY';

var catergories = null;
var cuisines = null;

getCategories();
getCuisines(76);

Replace YOUR_API_KEY with your Zomato key. Let's build functions to get the list of categories and cuisines at startup. These queries need not be run when the user asks for a restaurant search because this information is pretty much static:

function...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime