Last active
November 18, 2017 19:30
-
-
Save cawfree/c7f914ab98ea4749b46f405f3f7ebb86 to your computer and use it in GitHub Desktop.
An example permissions request for Jovo.
This file contains hidden or 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
import { SpeechBuilder } from 'jovo-framework/lib/platforms/speechBuilder'; | |
import { jovo } from 'jovo-framework/lib/jovo'; | |
/** | |
* agent: /intGetNamePermission | |
* inputContext: <none> | |
* userStateIn: <none> | |
* action: ask for the user's name. | |
* userStateOut: <none> | |
* outputContext: <none> | |
*/ | |
export function intGetNamePermission() { | |
this.googleAction().jovo.platform.response.responseObj = { | |
"speech": "<speak>Can I have permission for your name?<\/speak>", | |
"data": { | |
"google": { | |
"expectUserResponse": true, | |
"is_ssml": false, | |
"noInputPrompts": [], | |
"richResponse": { | |
"items": [ | |
{ | |
"simpleResponse": { | |
"ssml": "<speak>Can I have permission for your name?<\/speak>" | |
} | |
} | |
] | |
}, | |
"system_intent" : { | |
"intent" : "assistant.intent.action.PERMISSION", | |
"data": { | |
"@type": "type.googleapis.com/google.actions.v2.PermissionValueSpec", | |
"optContext": "To get to know each other", | |
"permissions": [ | |
"NAME" | |
], | |
} | |
} | |
} | |
} | |
}; | |
this.googleAction().jovo.emit('respond', this.googleAction().jovo); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment