This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<speak> | |
<par> | |
<media xml:id='question'> | |
<speak> | |
When was Wikipedia launched? <break time='5s'/> | |
Was it 2000?<break time='2s'/> | |
Or 2001 <break time='2s'/> | |
Or 2002? <break time='2s'/> | |
What is your answer?<break time='5s'/> | |
<emphasis level="moderate">It was 2001!</emphasis> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express') | |
const bodyParser = require('body-parser') | |
const { dialogflow } = require('actions-on-google') | |
const app = dialogflow() | |
express().use(bodyParser.json(), app).listen(3000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// The unique ID of the user's Google Account | |
"sub": 1234567890, | |
// The token's issuer | |
"iss": "https://accounts.google.com", | |
// Client ID assigned to your Actions project | |
"aud": "123-abc.apps.googleusercontent.com", | |
// Unix timestamp of the token's creation time | |
"iat": 233366400, | |
// Unix timestamp of the token's expiration time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { dialogflow } = require('actions-on-google') | |
const app = dialogflow() | |
exports.factsAboutGoogle = app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cloud Functions for Firebase | |
const functions = require('firebase-functions') | |
const { dialogflow } = require('actions-on-google') | |
const app = dialogflow() | |
exports.factsAboutGoogle = functions.https.onRequest(app) | |
// AWS Lambda |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const functions = require('firebase-functions') | |
const { dialogflow } = require('actions-on-google') | |
const app = dialogflow() | |
exports.factsAboutGoogle = functions.https.onRequest(app) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.intent('Default Welcome Intent', conv => { | |
conv.close('Thanks for talking to me!') | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.intent('tell.greeting', (conv, { color, num }) => { | |
conv.ask(`Dialogflow likes ${color}`, new Suggestions('Ok', 'Cool')) | |
conv.ask(new BasicCard({ | |
title: 'Card Title', | |
image: { // Mostly, provide anonymous Objects | |
url: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png', | |
accessibilityText: 'Google Logo', | |
}, | |
buttons: new Button({ // Wrapper for complex sub Objects, but can also use Objects when needed | |
title: 'Button Title', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { dialogflow } = require('actions-on-google') | |
const { randomize, Randomization } = require('randomize') | |
const app = dialogflow() | |
.use(randomize) | |
app.intent('tell.greeting', conv => { | |
conv.ask(`The last thing I told you was ${conv.randomize.last}`) | |
conv.ask(new Randomization( | |
'How are you?', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// v1 | |
app.buildRichResponse( | |
app.buildBasicCard('some string') | |
.setImage('https://site.com/img.png', 'some other string')) | |
// v2 | |
conv.ask(new BasicCard({ | |
title: 'some string', | |
image: { | |
url: 'https://site.com/img.png', |
NewerOlder