class Conversation { | |
//... | |
_greetNewUser() { | |
if (this._isScreenAvailable()) { | |
this._askWithSuggestionChips(Str.GREETING_NEW_USER, Str.GREETING_USER_SUGGESTION_CHIPS) | |
} else { | |
this.dialogflowApp.ask(Str.GREETING_NEW_USER, Str.GREETING_NEW_USER_NO_INPUT_PROMPT); | |
} | |
} | |
_isScreenAvailable() { | |
return this.dialogflowApp.hasSurfaceCapability(this.dialogflowApp.SurfaceCapabilities.SCREEN_OUTPUT); | |
} | |
_askWithSuggestionChips(speech, suggestions) { | |
this.dialogflowApp.ask(this.dialogflowApp | |
.buildRichResponse() | |
.addSimpleResponse(speech) | |
.addSuggestions(suggestions) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment