SlideShare a Scribd company logo
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Google Home/Mobile device
The Google Assistant —
Actions on Google —
Assistant App
Esplorando Google Assistant e Dialogflow
Well, it’s kind of cold outside, so I'd like
something to warm me up, like a hot
soup, and I want it fast.
I have some chicken, and also canned
tomatoes.
Esplorando Google Assistant e Dialogflow
Assistant app
{ conversation
api request }
{ conversation
api response }
user input
app
response
Esplorando Google Assistant e Dialogflow
Well, it’s kind of cold outside, so I'd like
something to warm me up, like a hot
soup, and I want it fast.
I have some chicken, and also canned
tomatoes.
“
Intent Matching —
Entity Extraction —
@
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
const App = require('actions-on-google').ApiAiApp;
exports.yourApp = (request, response) => {
const app = new App({request, response});
console.log('Request headers: ' + JSON.stringify(request.headers));
console.log('Request body: ' + JSON.stringify(request.body));
// Fulfill action business logic
function responseHandler (app) {
// Complete your fulfillment logic and send a response
app.ask('Hello, World!');
}
const actionMap = new Map();
actionMap.set('<API.AI_action_name>', responseHandler);
app.handleRequest(actionMap);
};
const app = new ApiAiApp({request: request, response: response});
const WELCOME_INTENT = 'input.welcome'; // the action name from the API.AI intent
const NUMBER_INTENT = 'input.number'; // the action name from the API.AI intent
const NUMBER_ARGUMENT = 'input.mynum'; // the action name from the API.AI intent
function welcomeIntent (app) {
app.ask('Welcome to action snippets! Say a number.');
}
function numberIntent (app) {
let number = app.getArgument(NUMBER_ARGUMENT);
app.tell('You said ' + number);
}
let actionMap = new Map();
actionMap.set(WELCOME_INTENT, welcomeIntent);
actionMap.set(NUMBER_INTENT, numberIntent);
app.handleRequest(actionMap);
Esplorando Google Assistant e Dialogflow
if (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {
app.ask(app.buildRichResponse()
.addSimpleResponse(`Here's a fact for you. ${fact} Which one ` +
`do you want to hear about next, Google's history or headquarters?`)
.addBasicCard(
app.buildBasicCard('Google is an amazing company.')
.setImage(GOOGLE_LOGO_SRC))
.addSuggestions(['History', 'Headquarters']));
} else {
app.ask(`Here's a fact for you. ${fact} Which one ` +
`do you want to hear about next, Google's history or headquarters?`);
}
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
g.co/actionswebsim
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Hey! This is ___
Welcome to ___
Ready to play ____
Hi! ___ here.
Hello. I’m ___
Greetings, human.
Welcome back to ___
Hey again. ___
Let’s play ___
Here’s your ___
Brought to you by ___
Hi there, ___
Let’s get started.
Ready for your ___
___, here to…
Live from ___
This is ___
What’s up, ___
and more...
<speak> <!-- Must be at the start of the string -->
<say-as interpret-as="characters">SSML</say-as>
<break time="3s"/>.
<audio src="https://example.com/file.mp3"></audio>
<say-as interpret-as="cardinal">10</say-as>.
<say-as interpret-as="ordinal">10</say-as>
<say-as interpret-as="characters">10</say-as>.
<sub alias="World Wide Web">WWW</sub>.
<p><s>This is one.</s><s>This is two.</s></p>
</speak> <!-- Must be at the end of the string -->
“S S M L”
[3 second pause]
[audio file plays]
“Ten”
“Tenth”
“One Oh”
World Wide Web
[two sentences]
function welcome (app) {
return isPreviousUser(app.getUser().userId).then((userHasVisited) => {
if (userHasVisited) {
app.ask(`Welcome to Number Genie!...`, NO_INPUT_PROMPTS);
} else {
app.ask(`Hey you're back...`, NO_INPUT_PROMPTS);
}
});
}
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
function simpleResponse (app) {
app.ask({
speech: 'Howdy! I can tell you fun facts about ' +
'almost any number, like 42. What do you have in mind?',
displayText: 'Howdy! I can tell you fun facts about ' +
'almost any number. What do you have in mind?'
});
}
function suggestionChips (app) {
app.ask(app.buildRichResponse()
.addSimpleResponse({
speech: 'Howdy! I can tell you fun facts about ' +
'almost any number like 0, 42, or 100. What number do you have ' +
'in mind?',
displayText: 'Howdy! I can tell you fun facts about almost any ' +
'number. What number do you have in mind?'
})
.addSuggestions(['0', '42', '100', 'Never mind'])
);
}
function basicCard (app) {
app.ask(app.buildRichResponse()
.addSimpleResponse('Math and prime numbers it is!')
.addBasicCard(
app.buildBasicCard(`42 is an even composite number. It ` +
`is composed of three distinct prime numbers multiplied together. It ` +
`has a total of eight divisors. 42 is an abundant number, because the ` +
`sum of its proper divisors 54 is greater than itself. To count from ` +
`1 to 42 would take you about twenty-one…`)
.setTitle('Math & prime numbers')
.addButton('Read more')
.setImage('https://example.google.com/42.png', 'Image alternate text')
)
);
}
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
let permission = app.SupportedPermissions.DEVICE_COARSE_LOCATION;
app.askForPermission('To find bookstores near you', permission);
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
EXEC
QUERY
SYNC
REQ_SYNC
REP_STATE
Assistant
Surface
Speech
Recognition
Natural
Language
Understanding
Smart Home
Agent
Device Cloud
Service
IoT Devices
Home Graph
Service +
Storage
Home Graph
Partner API
Command StatusTTS (speech) response
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Ok Google, ask Personal Chef for a hot soup recipe
Trigger Phrase App Name
Developer Specified
Action
Preposition
Action Phrase
Developer Specified
Ok Google, let’s talk to Personal Chef
Trigger Phrase App Name
Developer Specified
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Conversation Design
Esplorando Google Assistant e Dialogflow
GUI :: VUI What’s the difference?
Top 3 Design Tips
Create a persona.1
Persona is conveyed through:
Tone
Word and phrase choices
Functional design
Style
Technique
Voice
...and based on:
Your user population and their needs
The imagery & qualities associated with your brand
Think outside the box. Literally.2
Confidential and proprietary
code code code code code
code code code code
code code “ dialog string” code
code code code
code code code code code
code “dialog string” code code
code code code code code code code
code code code
code code
code
code code
code
code
code code code
code “dialog string” code code code
code code
code code code
code code code code code code code code
code code code code code code code code
code
STRUCTURE + CODE
Confidential and proprietary
code code code code code
code code code code
code code “ dialog string” code
code code code
code code code code code
code “dialog string” code code
code code code code code code code
code code code
code code
code
code code
code
code
code code code
code “dialog string” code code code
code code
code code code
code code code code code code code code
code code code code code code code code
code
STRUCTURE + CODE
Confidential and proprietary
DIALOG + STRUCTURE
In conversations, there are no “errors”.3
real life
user
conditions {
“I don’t understand you”
When a so-called “error” occurs in a
conversation, it should be treated simply as
a new turn in the dialog, only with different
conditions.
Users have intent
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow
Esplorando Google Assistant e Dialogflow

More Related Content

PDF
Your First Assistant App with DialogFlow + Firebase
PPTX
Developing Chatbots with Google DialogFlow
PDF
Hello Flutter
PDF
Google Cloud Enpoints
PPTX
Build a Great Conversationalist
PDF
[API World 2021 ] - Understanding Cloud Native Deployment
PPTX
Telerik Kendo UI Overview
PPTX
virtual-2021-data.sql_.saturday.la-Building database interactions with users ...
Your First Assistant App with DialogFlow + Firebase
Developing Chatbots with Google DialogFlow
Hello Flutter
Google Cloud Enpoints
Build a Great Conversationalist
[API World 2021 ] - Understanding Cloud Native Deployment
Telerik Kendo UI Overview
virtual-2021-data.sql_.saturday.la-Building database interactions with users ...

Similar to Esplorando Google Assistant e Dialogflow (20)

PDF
Building Conversational Experiences with Actions on Google
PDF
Building conversational experiences with Actions on Google
PDF
Building Conversational Experiences with Actions on Google
PDF
Building Conversational Experiences for Google Assistant
PDF
Create An Amazing Apps For The Google Assistant!
PDF
Actions On Google - How? Why?
PDF
Actions On Google - GDD Europe 2017
PDF
Building Conversational Experiences for Google Assistant '18
PDF
Google Assistant - Why? How?
PDF
EIA2017Portugal - Martin Omander - Build your own app for Google Home
PDF
EIA2017Italy - Martin Omander - Build Your Own App for Google Home
PDF
Aiy project, el día que le hablé a una caja
PDF
Building your actions for Google Assistant
PDF
Building High-Quality Apps for Google Assistant
PDF
Google Assistant Actions – Codelab and Hackathon - 2018.06.06
PDF
Engage user with actions
PDF
Build a homemade AI device. Antimo Musone - Ernst & Young
PDF
Google Assistant Revolution
PDF
Antimo Musone - Vocal Assistant - build natural and rich conversational exper...
PDF
#MTC2019: Dialog z klientem w Erze Asystentów - Michal Dlugosz (Google)
Building Conversational Experiences with Actions on Google
Building conversational experiences with Actions on Google
Building Conversational Experiences with Actions on Google
Building Conversational Experiences for Google Assistant
Create An Amazing Apps For The Google Assistant!
Actions On Google - How? Why?
Actions On Google - GDD Europe 2017
Building Conversational Experiences for Google Assistant '18
Google Assistant - Why? How?
EIA2017Portugal - Martin Omander - Build your own app for Google Home
EIA2017Italy - Martin Omander - Build Your Own App for Google Home
Aiy project, el día que le hablé a una caja
Building your actions for Google Assistant
Building High-Quality Apps for Google Assistant
Google Assistant Actions – Codelab and Hackathon - 2018.06.06
Engage user with actions
Build a homemade AI device. Antimo Musone - Ernst & Young
Google Assistant Revolution
Antimo Musone - Vocal Assistant - build natural and rich conversational exper...
#MTC2019: Dialog z klientem w Erze Asystentów - Michal Dlugosz (Google)
Ad

More from Paolo Montrasio (20)

PPTX
Sviluppare agenti conversazionali con Rasa
PDF
Il Chatbot come guida di viaggio: Travelchat
PDF
Costruire chatbot conversazionali ed intelligenti con Xenioo
PDF
Diving deep into NLP
PPTX
Voicebot: i Chatbot crescono e imparano a parlare
PPT
IBM Watson, un caso reale
PPTX
Gardy, un chatbot multilingua
PPTX
Il più intelligente Chatbot Bancario in Italia!
PDF
Chatbot, a chi proporli e come ... scegli il giusto target
PDF
Cicerus - una piattaforma per lo sviluppo di chatbot
PDF
Hubot + wit.ai, un chatbot aziendale per Slack
PDF
Making Chatbots
PPTX
L'AI per Sales & Marketing B2B
PDF
Chatbot per i musei
PDF
Innovazione digitale e i chatbot 2017
PDF
Trovare clienti con un chatbot
PDF
Innovare la relazione con i clienti nel retail
PDF
Moose.ai: migliorare la customer experience delle banche con un chatbot B2C &...
PDF
Serverless chatbot: from idea to production at blazing speed
PDF
I chatbot come sostituti delle app
Sviluppare agenti conversazionali con Rasa
Il Chatbot come guida di viaggio: Travelchat
Costruire chatbot conversazionali ed intelligenti con Xenioo
Diving deep into NLP
Voicebot: i Chatbot crescono e imparano a parlare
IBM Watson, un caso reale
Gardy, un chatbot multilingua
Il più intelligente Chatbot Bancario in Italia!
Chatbot, a chi proporli e come ... scegli il giusto target
Cicerus - una piattaforma per lo sviluppo di chatbot
Hubot + wit.ai, un chatbot aziendale per Slack
Making Chatbots
L'AI per Sales & Marketing B2B
Chatbot per i musei
Innovazione digitale e i chatbot 2017
Trovare clienti con un chatbot
Innovare la relazione con i clienti nel retail
Moose.ai: migliorare la customer experience delle banche con un chatbot B2C &...
Serverless chatbot: from idea to production at blazing speed
I chatbot come sostituti delle app
Ad

Recently uploaded (20)

PDF
medical staffing services at VALiNTRY
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Nekopoi APK 2025 free lastest update
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
System and Network Administration Chapter 2
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Online Work Permit System for Fast Permit Processing
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
ai tools demonstartion for schools and inter college
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
medical staffing services at VALiNTRY
Which alternative to Crystal Reports is best for small or large businesses.pdf
Odoo Companies in India – Driving Business Transformation.pdf
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Nekopoi APK 2025 free lastest update
Operating system designcfffgfgggggggvggggggggg
System and Network Administration Chapter 2
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
How to Migrate SBCGlobal Email to Yahoo Easily
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
2025 Textile ERP Trends: SAP, Odoo & Oracle
CHAPTER 2 - PM Management and IT Context
Online Work Permit System for Fast Permit Processing
Design an Analysis of Algorithms II-SECS-1021-03
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Odoo POS Development Services by CandidRoot Solutions
ai tools demonstartion for schools and inter college
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
VVF-Customer-Presentation2025-Ver1.9.pptx

Esplorando Google Assistant e Dialogflow

  • 3. Google Home/Mobile device The Google Assistant — Actions on Google —
  • 6. Well, it’s kind of cold outside, so I'd like something to warm me up, like a hot soup, and I want it fast. I have some chicken, and also canned tomatoes.
  • 8. Assistant app { conversation api request } { conversation api response } user input app response
  • 10. Well, it’s kind of cold outside, so I'd like something to warm me up, like a hot soup, and I want it fast. I have some chicken, and also canned tomatoes.
  • 11. “ Intent Matching — Entity Extraction — @
  • 29. const App = require('actions-on-google').ApiAiApp; exports.yourApp = (request, response) => { const app = new App({request, response}); console.log('Request headers: ' + JSON.stringify(request.headers)); console.log('Request body: ' + JSON.stringify(request.body)); // Fulfill action business logic function responseHandler (app) { // Complete your fulfillment logic and send a response app.ask('Hello, World!'); } const actionMap = new Map(); actionMap.set('<API.AI_action_name>', responseHandler); app.handleRequest(actionMap); };
  • 30. const app = new ApiAiApp({request: request, response: response}); const WELCOME_INTENT = 'input.welcome'; // the action name from the API.AI intent const NUMBER_INTENT = 'input.number'; // the action name from the API.AI intent const NUMBER_ARGUMENT = 'input.mynum'; // the action name from the API.AI intent function welcomeIntent (app) { app.ask('Welcome to action snippets! Say a number.'); } function numberIntent (app) { let number = app.getArgument(NUMBER_ARGUMENT); app.tell('You said ' + number); } let actionMap = new Map(); actionMap.set(WELCOME_INTENT, welcomeIntent); actionMap.set(NUMBER_INTENT, numberIntent); app.handleRequest(actionMap);
  • 32. if (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) { app.ask(app.buildRichResponse() .addSimpleResponse(`Here's a fact for you. ${fact} Which one ` + `do you want to hear about next, Google's history or headquarters?`) .addBasicCard( app.buildBasicCard('Google is an amazing company.') .setImage(GOOGLE_LOGO_SRC)) .addSuggestions(['History', 'Headquarters'])); } else { app.ask(`Here's a fact for you. ${fact} Which one ` + `do you want to hear about next, Google's history or headquarters?`); }
  • 39. Hey! This is ___ Welcome to ___ Ready to play ____ Hi! ___ here. Hello. I’m ___ Greetings, human. Welcome back to ___ Hey again. ___ Let’s play ___ Here’s your ___ Brought to you by ___ Hi there, ___ Let’s get started. Ready for your ___ ___, here to… Live from ___ This is ___ What’s up, ___ and more...
  • 40. <speak> <!-- Must be at the start of the string --> <say-as interpret-as="characters">SSML</say-as> <break time="3s"/>. <audio src="https://example.com/file.mp3"></audio> <say-as interpret-as="cardinal">10</say-as>. <say-as interpret-as="ordinal">10</say-as> <say-as interpret-as="characters">10</say-as>. <sub alias="World Wide Web">WWW</sub>. <p><s>This is one.</s><s>This is two.</s></p> </speak> <!-- Must be at the end of the string --> “S S M L” [3 second pause] [audio file plays] “Ten” “Tenth” “One Oh” World Wide Web [two sentences]
  • 41. function welcome (app) { return isPreviousUser(app.getUser().userId).then((userHasVisited) => { if (userHasVisited) { app.ask(`Welcome to Number Genie!...`, NO_INPUT_PROMPTS); } else { app.ask(`Hey you're back...`, NO_INPUT_PROMPTS); } }); }
  • 44. function simpleResponse (app) { app.ask({ speech: 'Howdy! I can tell you fun facts about ' + 'almost any number, like 42. What do you have in mind?', displayText: 'Howdy! I can tell you fun facts about ' + 'almost any number. What do you have in mind?' }); }
  • 45. function suggestionChips (app) { app.ask(app.buildRichResponse() .addSimpleResponse({ speech: 'Howdy! I can tell you fun facts about ' + 'almost any number like 0, 42, or 100. What number do you have ' + 'in mind?', displayText: 'Howdy! I can tell you fun facts about almost any ' + 'number. What number do you have in mind?' }) .addSuggestions(['0', '42', '100', 'Never mind']) ); }
  • 46. function basicCard (app) { app.ask(app.buildRichResponse() .addSimpleResponse('Math and prime numbers it is!') .addBasicCard( app.buildBasicCard(`42 is an even composite number. It ` + `is composed of three distinct prime numbers multiplied together. It ` + `has a total of eight divisors. 42 is an abundant number, because the ` + `sum of its proper divisors 54 is greater than itself. To count from ` + `1 to 42 would take you about twenty-one…`) .setTitle('Math & prime numbers') .addButton('Read more') .setImage('https://example.google.com/42.png', 'Image alternate text') ) ); }
  • 49. let permission = app.SupportedPermissions.DEVICE_COARSE_LOCATION; app.askForPermission('To find bookstores near you', permission);
  • 54. EXEC QUERY SYNC REQ_SYNC REP_STATE Assistant Surface Speech Recognition Natural Language Understanding Smart Home Agent Device Cloud Service IoT Devices Home Graph Service + Storage Home Graph Partner API Command StatusTTS (speech) response
  • 58. Ok Google, ask Personal Chef for a hot soup recipe Trigger Phrase App Name Developer Specified Action Preposition Action Phrase Developer Specified Ok Google, let’s talk to Personal Chef Trigger Phrase App Name Developer Specified
  • 64. GUI :: VUI What’s the difference?
  • 65. Top 3 Design Tips
  • 67. Persona is conveyed through: Tone Word and phrase choices Functional design Style Technique Voice ...and based on: Your user population and their needs The imagery & qualities associated with your brand
  • 68. Think outside the box. Literally.2
  • 69. Confidential and proprietary code code code code code code code code code code code “ dialog string” code code code code code code code code code code “dialog string” code code code code code code code code code code code code code code code code code code code code code code code “dialog string” code code code code code code code code code code code code code code code code code code code code code code code code code STRUCTURE + CODE
  • 70. Confidential and proprietary code code code code code code code code code code code “ dialog string” code code code code code code code code code code “dialog string” code code code code code code code code code code code code code code code code code code code code code code code “dialog string” code code code code code code code code code code code code code code code code code code code code code code code code code STRUCTURE + CODE
  • 72. In conversations, there are no “errors”.3
  • 75. When a so-called “error” occurs in a conversation, it should be treated simply as a new turn in the dialog, only with different conditions.