Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Create An Amazing Apps For The Google Assistant!

2,444 views

Published on

The Google Assistant is available on many devices (eg. Google mini/home/max, Android, iPhones and more).
Actions on Google lets developers extend the Google Assistant to create your own conversational assistant apps.

In this talk, Ido Green will describe the key components of actions on Google. He will show you how to easily build your first assistant app using tools such as Dialogflow, and explore voice user interface (VUI) best practices in order to design compelling conversational experiences that delight users.

Published in: Technology
  • Be the first to comment

Create An Amazing Apps For The Google Assistant!

  1. 1. Google Home / Mobile device The Google Assistant — Actions on Google —
  2. 2. “Hey Google, talk to...”
  3. 3. Assistant app { conversation api request } { conversation api response } user input app response
  4. 4. “ Intent Matching — Entity Extraction — @
  5. 5. 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?' }); }
  6. 6. 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']) ); }
  7. 7. 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') ) ); }
  8. 8. let permission = app.SupportedPermissions.DEVICE_COARSE_LOCATION; app.askForPermission('To find bookstores near you', permission); I'll just need to get your zip code from Google. Is that okay?
  9. 9. ● ● ● ●
  10. 10. Test your agent by entering text or voice requests. Voice testing is available in Chrome and Firefox browsers.
  11. 11. const App = require('actions-on-google').DialogflowApp; 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('<Dialogflow_action_name>', responseHandler); app.handleRequest(actionMap); };
  12. 12. const app = new DialogflowApp({request: request, response: response}); const WELCOME_INTENT = 'input.welcome'; // the action name from the Dialogflow intent const NUMBER_INTENT = 'input.number'; // the action name from the Dialogflow intent const NUMBER_ARGUMENT = 'input.mynum'; // the action name from the Dialogflow 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);
  13. 13. 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?`); }
  14. 14. g.co/actionswebsim
  15. 15. 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

×