Slide 1

Slide 1 text

Extending the Google Assistant with Actions on Google Guillaume Laforge, Developer Advocate, GCP Brad Abrams, Product Manager, Google Assistant

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

A conversation between you and Google that helps you get more done in your world

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

Actions on Google How YOU can extend the Google Assistant Connect with users wherever the Google Assistant is available Help users get things done with your service Innovate with Conversational Interface

Slide 8

Slide 8 text

Proprietary & Confidential 8

Slide 9

Slide 9 text

Ok Google, let me talk to Cloud NEXT 2017 Hi, I’ll be your guide to Google Cloud Next, I can help you explore topics or pick a session to attend. What would you like to know? When is the next App Engine talk? Sure! Here’s Cloud NEXT 2017. Enter Earcon The next session about App Engine is “Building Data Driven applications with App Engine” in room 4004 on Tuesday at 4. Is there another topic you’re interested in? Exit Earcon . . .

Slide 10

Slide 10 text

Agenda Design What to build Develop How to build it Deploy How to deliver it

Slide 11

Slide 11 text

Design What to build

Slide 12

Slide 12 text

Why conversation?

Slide 13

Slide 13 text

Confidential and proprietary How do we deliver on Sci-Fi’s promise?

Slide 14

Slide 14 text

Confidential and proprietary How do we get there?

Slide 15

Slide 15 text

Confidential and proprietary A conversation is a contract between two participants with a mutual investment in the outcome

Slide 16

Slide 16 text

Confidential and proprietary Conversations are hard to codify

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

Spoken Language 100,000 yrs Writing 5,000 yrs Print 575 yrs Typing 150 yrs TTS 80 yrs Computers 70 yrs Speech recogn. 50 yrs Word processor 40 yrs IVRs, virtual assistants & smartphones 25 yrs Dictation software 20 yrs Chat bots & A.I. assistants <7yrs Internet 30 yrs

Slide 19

Slide 19 text

1. List out your core brand attributes (what words define the experience you’re shooting for?) 2. Correlate to attributes that will define your functional design principles (how will those manifest in the design?) 3. Define some attributes that you’d want to infuse into the voice, style of writing, and personality of the dialog (what personality traits match your strategy?) 4. Style guide & “bio sketch” (practical application and maintain consistency for longevity of your experience) knowledgeable helpful encouraging data rich recommending proactive geeky eager motivating Create your persona

Slide 20

Slide 20 text

Example style guide INSTEAD OF... IS MORE LIKELY TO SAY... I found Up for that? Does that sound good? Maybe later While you’re at it... what’s going on I did not receive a response if you feel you have reached this message in error please select from one of the following X options to help us serve you better for questions related to... you have entered that was an invalid… we require that you... please try again for faster answers we’re sorry, we are unable to… I did not understand MIGHT SAY THINGS LIKE... so you can keep up to date on, I’ll look it up right now Sure, that’s coming up Right around the corner from… That session’s full, but… You might like lets need can’t because more about help right now one sec stay allows require unable to due to additional regarding assist currently please hold remain WOULD NEVER SAY...

Slide 21

Slide 21 text

Write your sample dialogs

Slide 22

Slide 22 text

Sample dialogs 1. Canonical “Happy path” 2. First time experience 3. Tapered experience (Return user) 4. Repair 5. Personality questions g.co/dev/ActionsChecklist

Slide 23

Slide 23 text

Develop How to build it

Slide 24

Slide 24 text

Life of a conversation “Ok Google, talk to Cloud NEXT 2017” Invoke “Cloud NEXT” action “Hi! Welcome to Cloud Next...” Speech to Text “The next Machine Learning Session is…” “I want to hear more about Machine Learning” Text to Speech “Sure, here’s Cloud NEXT 2017” Speech to Text, NLP, Knowledge Graph, ML Ranking, User Profile Text to Speech

Slide 25

Slide 25 text

Cross-platform tool for building advanced conversational interfaces ListSessions (topics.ComputeEngine); “What GCE breakout sessions are there?”

Slide 26

Slide 26 text

Demo — API.AI

Slide 27

Slide 27 text

A “serverless platform for building event-based microservices”. Function-as-a-service approach Great fit for event-oriented architectures, supporting 3 kind of triggers: ● Cloud Storage updates ● Cloud Pub/Sub messages ● Direct HTTP calls Cloud Functions

Slide 28

Slide 28 text

Cloud Functions Completely serverless & fully managed service ⇒ don’t worry about the ops! Automatic scaling and super-fast ⇒ grows with the success of your project ⇒ cost-effective Open and familiar ⇒ JavaScript / Node.js

Slide 29

Slide 29 text

Architecture in development

Slide 30

Slide 30 text

Architecture in development ngrok

Slide 31

Slide 31 text

Fast feedback loop: Ngrok + Functions emulator Google Cloud Functions emulator Ngrok secure internet tunnels to localhost LIVE RELOADING DEBUG IN CHROME

Slide 32

Slide 32 text

Demo — Cloud Functions & local development

Slide 33

Slide 33 text

server.js NPM dependencies ● actions-on-google ● node-fetch Export a function with the ApiAiAssistant handling the requests const Assistant = require('actions-on-google').ApiAiAssistant; const fetch = require('node-fetch'); function listTopicsIntent(assistant) { fetch('https://cloudnext.withgoogle.com/api/v1/categories') .then(response => response.text()) .then(text => { let data = JSON.parse(text.split('\n')[1]); let topics = data.categories .find(cat => cat.name === "Topics") .children.map(topic => topic.name).join(', ')); assistant.ask(`The topics covered are: ${topics}. What do you want to learn?'`); }); } exports.agent = function(request, response) { var assistant = new Assistant({ request, response }); assistant.handleRequest(listTopicsIntent); };

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

Deploy How to deliver it

Slide 36

Slide 36 text

Deploying Cloud Functions In production gcloud beta functions deploy agent \ --trigger-http \ --stage-bucket gs://gcp-next-2017-agent/ Locally functions deploy agent --trigger-http

Slide 37

Slide 37 text

Demo — deploying a Cloud Function

Slide 38

Slide 38 text

Review & approval Web-based portal ● Triggering Information ● Merchandising and information Approvals ● Automatic and manual policy checks ● Turn around in about 1 week

Slide 39

Slide 39 text

Discovery Discovery patterns ● Guaranteed invocation ○ “Talk to Cloud Next 2017” ● Discovery Patterns ○ “What’s happening at Next?” Google Home app

Slide 40

Slide 40 text

Demo — deploying action on Google

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

Key takeaways 1. You can (and should!) extend the Google Assistant with your custom action 2. Talking with humans is challenging, but API.AI makes it approachable 3. GCP offers a powerful platform for hosting business logic

Slide 43

Slide 43 text

Other Sessions Covering Conversational Application Development at NEXT BD223: Your next app might be a bot! Building conversational user experiences with API.AI BD225: Extending the Google Assistant with Actions on Google IO225: Best practices for building AI assistant in the enterprise What: How to build a conversational application with API.AI including tips and tricks from other developers Who: ● Dan Aharon, Google ● Cornelius Munz, Bosch ● Petr Netusil, ING Belgium What: How to create an Action that extends Google Assistant and is hosted on GCP Who: ● Brad Abrams, Google ● Guillaume Laforge, Google What: How to use serverless architecture and Cloud Functions to build conversational applications Who: ● Alan Ho, Google ● Amir Shevat, Slack

Slide 44

Slide 44 text

g.co/dev/ActionsDesign

Slide 45

Slide 45 text

Questions & answers

Slide 46

Slide 46 text

Thank you