Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Actions with Google

Bryan Herbst
February 04, 2017

Actions with Google

Learn how to create custom actions for the Google Assistant

Bryan Herbst

February 04, 2017
Tweet

More Decks by Bryan Herbst

Other Decks in Programming

Transcript

  1. What should I have for dinner? What are you in

    the mood for? You can say Italian, American, Mexican, or Chinese. !
  2. What should I have for dinner? What are you in

    the mood for? You can say Italian, American, Mexican, or Chinese. ! Take turns.
  3. ”Buy me a KitKat bar.” ”Okay, ordering a king sized

    KitKat bar from Amazon. Is that correct?”
  4. ”Buy me a KitKat bar.” ”Okay, ordering a king sized

    KitKat bar from Amazon. Is that correct?” “Yes.”
  5. ”Buy me a KitKat bar.” ”Okay, ordering a king sized

    KitKat bar from Amazon. Is that correct?” “No, make it a regular sized KitKat bar.”
  6. Conversation Direct Trigger “Talk to SERVICE about TOPIC” “Do this

    action” Responsibilities You handle interaction and fulfillment Availability Now
  7. Conversation Direct Trigger “Talk to SERVICE about TOPIC” “Do this

    action” Responsibilities You handle interaction and fulfillment Google handles interaction, you handle fulfillment. Availability Now
  8. Conversation Direct Trigger “Talk to SERVICE about TOPIC” “Do this

    action” Responsibilities You handle interaction and fulfillment Google handles interaction, you handle fulfillment. Availability Now Soon
  9. Trigger Phrases • Let me talk to… • I want

    to talk to... • Can I talk to... • Talk to... • Ask... • At... • Tell... • Tell me...
  10. Intent examples • Set an alarm for 6:00am • Wake

    me up at 6:00am • I need an alarm at 6:00am • Set an alarm for March 1st at 6:00pm
  11. Intent examples • Set an alarm for 6:00am • Wake

    me up at 6:00am • I need an alarm at 6:00am • Set an alarm for March 1st at 6:00pm
  12. Intent examples • Set an alarm for 6:00am • Wake

    me up at 6:00am • I need an alarm at 6:00am • Set an alarm for March 1st at 6:00pm
  13. Intent examples • Set an alarm for 6:00am • Wake

    me up at 6:00am • I need an alarm at 6:00am • Set an alarm for March 1st at 6:00pm
  14. Fallback Intent Tell Clocky to order me a pizza I

    don’t know how to help with that.
  15. Simple webhook server let Assistant = require('actions-on-google').ApiAiAssistant; let app =

    express(); app.post('/', function (req, res) { const assistant = new Assistant({request: req, response: res}); } }
  16. SSML- Speech Synthesis Markup Language function withSsml() { assistant.tell("This response

    uses” + "<say-as interpret-as='characters'>SSML</say-as>.” + "Isn't it <break> awesome?"); }
  17. User Identity • ID (resettable!) • Display name • Given

    name • Family name • Coarse device location (zip code and city) • Precise device location (lat/lng, address)
  18. User Identity • ID (resettable!) • Display name • Given

    name • Family name • Coarse device location (zip code and city) • Precise device location (lat/lng, address) Requires permission
  19. What’s the weather like in Minneapolis? It is currently 10°

    in Minneapolis. ! Context Location: Minneapolis Temperature: 10°
  20. What’s the weather like in Minneapolis? It is currently 10°

    in Minneapolis. ! Context Location: Minneapolis Temperature: 10°