public class SpeechletResponse extends Object
SpeechletV2 invocation. Defines text to speak to the user, content to
display in the companion application, and whether or not the current SpeechletV2 session
should end.| Constructor and Description |
|---|
SpeechletResponse() |
| Modifier and Type | Method and Description |
|---|---|
Card |
getCard()
Returns the UI card associated with this response.
|
List<Directive> |
getDirectives()
Returns the directives associated with this response.
|
OutputSpeech |
getOutputSpeech()
Returns the speech associated with this response.
|
Reprompt |
getReprompt()
Returns the reprompt associated with this response.
|
boolean |
getShouldEndSession()
Returns whether or not the session should end with this response.
|
static SpeechletResponse |
newAskResponse(OutputSpeech outputSpeech,
Reprompt reprompt)
Creates and returns a response intended to ask the user a question.
|
static SpeechletResponse |
newAskResponse(OutputSpeech outputSpeech,
Reprompt reprompt,
Card card)
Creates and returns a response intended to ask the user a question, both in speech and with a
graphical card displayed in the companion app.
|
static SpeechletResponse |
newTellResponse(OutputSpeech outputSpeech)
Creates and returns a response intended to tell the user something.
|
static SpeechletResponse |
newTellResponse(OutputSpeech outputSpeech,
Card card)
Creates and returns a response intended to tell the user something, both in speech and with a
graphical card in the companion app.
|
void |
setCard(Card card)
Sets the UI card associated with this response.
|
void |
setDirectives(List<Directive> directives)
Sets the directives for this response.
|
void |
setOutputSpeech(OutputSpeech outputSpeech)
Sets the speech associated with this response.
|
void |
setReprompt(Reprompt reprompt)
Sets the reprompt associated with this response.
|
void |
setShouldEndSession(boolean shouldEndSession)
Sets whether or not the session should end with this response.
|
public OutputSpeech getOutputSpeech()
public void setOutputSpeech(OutputSpeech outputSpeech)
outputSpeech - the speech to setpublic boolean getShouldEndSession()
public void setShouldEndSession(boolean shouldEndSession)
shouldEndSession - true if the session should end with this responsepublic Card getCard()
public void setCard(Card card)
card - the UI card to setpublic List<Directive> getDirectives()
public void setDirectives(List<Directive> directives)
directives - the directivespublic Reprompt getReprompt()
public void setReprompt(Reprompt reprompt)
reprompt - the repromptpublic static SpeechletResponse newTellResponse(OutputSpeech outputSpeech)
All arguments in this method are required and cannot be null.
outputSpeech - output speech content for the tell voice responsepublic static SpeechletResponse newTellResponse(OutputSpeech outputSpeech, Card card)
All arguments in this method are required and cannot be null.
outputSpeech - output speech content for the tell voice responsecard - card to display in the companion applicationpublic static SpeechletResponse newAskResponse(OutputSpeech outputSpeech, Reprompt reprompt)
All arguments in this method are required and cannot be null.
outputSpeech - output speech content for the ask voice responsereprompt - reprompt speech for the ask voice response. This speech is played if the user does
not reply to the question or replies with something that is not understood.public static SpeechletResponse newAskResponse(OutputSpeech outputSpeech, Reprompt reprompt, Card card)
All arguments in this method are required and cannot be null.
outputSpeech - output speech content for the ask voice responsereprompt - reprompt speech for the ask voice response. This speech is played if the user does
not reply to the question or replies with something that is not understood.card - card to display in the companion applicationCopyright © 2016. All rights reserved.