Slide 1

Slide 1 text

Introduction to Google Assistant Daniele Bonaldo

Slide 2

Slide 2 text

Daniele Bonaldo @danybony_ danybony danielebonaldo.com

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Google Home/Mobile device — The surface to interact with the Assistant. The Google Assistant — A conversation between you and Google that helps you get things done in your world. Actions on Google — How developers can extend the assistant (via Assistant apps)

Slide 5

Slide 5 text

Assistant App

Slide 6

Slide 6 text

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.

Slide 7

Slide 7 text

How does it work?

Slide 8

Slide 8 text

Assistant app { conversation api request } { conversation api response } user input app response

Slide 9

Slide 9 text

Ok Google, talk to Personal Chef Well, it’s kind of cold outside, so I’d like... Sure, here’s Personal Chef What are you in the mood for? What protein would you like to use? Speech to Text NLP Knowledge Graph ML Ranking User Profile Text to Speech Speech to Text Text to Speech ... Invoke Personal Chef action Parse query and generate response

Slide 10

Slide 10 text

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.

Slide 11

Slide 11 text

“ Intent Matching — Match and categorize user utterances to an intent. Entity Extraction — Identify key words and phrases spoken by the user. @

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Ok Google, talk to Personal Chef Well, it’s kind of cold outside, so I’d like... Sure, here’s Personal Chef What are you in the mood for? What protein would you like to use? Speech to Text NLP Knowledge Graph ML Ranking User Profile Speech to Text Text to Speech ... ... ... Trigger WELCOME event ... NLP: Intent Matching Entity Extraction

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

Intent Triggered via a series of “user says” phrases or platform based events Can collects entity values Matched at every turn of conversation

Slide 17

Slide 17 text

Intent name Name to use in Dialogflow console Only used by the developer, not referenced in your code

Slide 18

Slide 18 text

Action name String passed to the webhook that indicates what action is being performed Can share the same action name across different Intents Dialogflow specific use of “Action” compared to Google Assistant “Conversation Action”

Slide 19

Slide 19 text

Input and Output Contexts You can require a context to be available before an Intent is enabled Intent can set context to enable other Intents Implement flow control between some Intents

Slide 20

Slide 20 text

Parameters Values that we are trying to capture from the user phrases Can specify a parameter name and a type of value Values can be optional Values can be a list of fixed values

Slide 21

Slide 21 text

Text response Spoken when the Intent is complete Embed entity values if desired - “I found a recipe for $protein and $vegetable!” Webhook can dynamically adjust this response

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

Developer entities

Slide 24

Slide 24 text

Specify follow up questions if a user doesn’t specify certain values Read out in random order to make it more natural Prompts

Slide 25

Slide 25 text

Fulfillment

Slide 26

Slide 26 text

Test Console Test your agent by entering text or voice requests. Voice testing is available in Chrome and Firefox browsers.

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

Actions Console console.actions.google.com

Slide 29

Slide 29 text

g.co/actionswebsim

Slide 30

Slide 30 text

Action naming and policies https://developers.google.com/actions/distribute/general-policies Policies about what Conversation Actions are allowed See the guidelines for more information Invocation names must be unique since it is a global name Direct Actions not widely available to build and deploy, register for interest

Slide 31

Slide 31 text

From ‘app’ to ‘experience’...

Slide 32

Slide 32 text

Preserve and reinforce your persona by engaging the user as a separate entity from the Google Assistant. Own it. 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...

Slide 33

Slide 33 text

SSML . 10. 10 10. WWW.

This is one.This is two.

Reinforce it with SSML: Speech Synthesis Markup Language https://developers.google.com/actions/reference/ssml “S S M L” [3 second pause] [audio file plays] “Ten” “Tenth” “One Oh” World Wide Web [two sentences]

Slide 34

Slide 34 text

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); } }); } Reinforce it with persistence https://developers.google.com/actions/assistant/best-practices

Slide 35

Slide 35 text

Support different surface capabilities https://developers.google.com/actions/assistant/surface-capabilities AUDIO_OUTPUT SCREEN_OUTPUT

Slide 36

Slide 36 text

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?' }); } Support speech and display text https://developers.google.com/actions/assistant/responses Chat text should be a subset of audio

Slide 37

Slide 37 text

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']) ); } Guide the user (suggestion chips) https://developers.google.com/actions/assistant/responses

Slide 38

Slide 38 text

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') ) ); } Display basic cards https://developers.google.com/actions/assistant/responses

Slide 39

Slide 39 text

Lists and carousels for selection https://developers.google.com/actions/assistant/responses Used for easy selection <10 items Used for comparison <30 items

Slide 40

Slide 40 text

Top 3 Design Tips

Slide 41

Slide 41 text

Create a persona. 1

Slide 42

Slide 42 text

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

Slide 43

Slide 43 text

Think outside the box. Literally. 2

Slide 44

Slide 44 text

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

Slide 45

Slide 45 text

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

Slide 46

Slide 46 text

DIALOG + STRUCTURE

Slide 47

Slide 47 text

In conversations, there are no “errors”. 3

Slide 48

Slide 48 text

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.

Slide 49

Slide 49 text

More info The Conversational UI and Why It Matters developers.google.com/actions/design/ Codelabs codelabs.developers.google.com

Slide 50

Slide 50 text

Daniele Bonaldo @danybony_ danybony danielebonaldo.com Thank you!