Advantages of Hiring UIUX Design Service Providers for Your Business
Your First Assistant App with DialogFlow + Firebase
1. Easily Bot-Development with Assistant,
DialogFlow and Firebase
Carlos Azaustre
Community Specialist & Software Engineer
@carlosazaustre
2. What are Apps for
Assistant?
Apps for Assistant are an exciting new way to
interact with your users through the Google
Assistant.
They provide a conversational interface between
you and your user, and they are super simple to
build with DialogFlow.
You can build all sorts of Assistant apps, from
home automation to games and services
3. What is
Dialogflow?
Dialogflow provides a server-side
infrastructure to create conversational
scenarios, then build advanced dialogues to
manage the conversation flow with the user.
4. What is Google
Assistant?
Google says that the future is Artificial
Intelligence First. AI is making computers
“smart” so they can think on their own.
Google Assistant allows you to have a
conversation with Google through:
● Machine Learning: Teaching computers
how to see patterns in data and act on it.
● Speech Recognition and Language
Understanding: Being able to understand
you when you are talking
5. What is Firebase?
Firebase is a unified mobile development
platform that provides tools to help you build,
grow and monetize your app.
It has features to provide Backend services:
Firebase Realtime Database: Cloud-hosted NoSQL
database that stores data as JSON
Cloud Functions for Firebase: Let you run backend
code on Google Cloud infraestructure that responds to
events in your firebase project.
8. How configure DialogFlow for your app
Entities:
The values we are trying to capture from the user phrases. E.g: “Bitcoin Currency”
9. How configure DialogFlow for your app
Entities:
The values we are trying to capture from the user phrases. E.g: “Bitcoin Currency”.
It is important ‘to help’ the machine learning algorithm in DialogFlow to train itself by
providing synonyms.
E.g: Euro, Dollars, USD, bitcoin,...
10. How configure DialogFlow for your app
Intents:
An intent is triggered
by a series of “user
says” phrases.
11. How configure DialogFlow for your app
Intents:
E.g: “Please, tell me what is the bitcoin value in euros” or “What is the blockchain
size today?”
You should create separate intents for different types of actions though:
● Price intent - this intent will handle the main actions: fetching the bitcoin price
● Total intent - this intent will tell user the number of existing bitocoins in the
world.
● Quit intent - this intent will handle the part when the user wishes to finish the
action
12. How configure DialogFlow for your app
Price Intent example:
Type few sentences that you
will want to use to get
information on bitcoin.
DialogFlow starts to train its
algorithm.
DialogFlow automatically
recognizes that the phrase
includes one of the entities
13. How configure DialogFlow for your app
Webhook:
With this tool we can fill with
the URL of a external or own
webservice.
In this example we use a Cloud
Function that it triggered by
HTTP event
14. How configure DialogFlow for your app
Cloud Function:
https://us-central1-bitcoin-info-io17.cloudfunctions.net/bitcoininfo
const Assistant = require('actions-on-google').ApiAiAssistant;
exports.bitcoinInfo = (req, res) => {
const assistant = new Assistant({request: req, response: res});
// Fulfill price action business logic
function priceHandler (assistant) { … }
// Fulfill total bitcoin action
function totalHandler (assistant) { … }
// The Entry point to all our actions
const actionMap = new Map();
actionMap.set(ACTION_PRICE, priceHandler);
actionMap.set(ACTION_TOTAL, totalHandler);
assistant.handleRequest(actionMap);
}
16. Integrate with
Actions on Google
We can integrate Actions on Google in
DialogFlow console.
We can integrate other platforms as
Slack, FB Messenger, etc...
17. Simulate in Actions
on Google
Like the Dialogflow simulator but it is
as complete Assistant App.
Try the example!
18. Resources
● Codelabs from Google
Developers
● Firebase website
● Firebase Documentation about
Cloud Functions
● Dialogflow website
● Actions on Google website