public final class LexServiceContinuation extends Object
"Continuation"s provide a simple technique to continue with a transaction after a user responds to a prompt from the Amazon Lex service. This encapsulates and provides access to responses from the Amazon Lex service.
Constructor and Description |
---|
LexServiceContinuation(InteractionClient interactionClient,
ResponseType responseMode,
ResponseType requestMode)
Constructs a continuation for speech request.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Use this method to cancel the current transaction.
|
void |
continueWithAudioInForAudioOut()
Use this method if the users response is speech.
|
void |
continueWithAudioInForTextOut()
Use this method if the users response is speech.
|
void |
continueWithCurrentMode()
Use this method to continue with the current input and output mode.
|
void |
continueWithTextInForAudioOut(String text)
Use this method to respond with text and expect service response with audio.
|
void |
continueWithTextInForTextOut(String text)
Use this method to respond with text and expect service response with text.
|
String |
getSessionAttribute(String attribute)
Returns a specific session attribute.
|
Map<String,String> |
getSessionAttributes()
Returns all session attributes.
|
void |
setSessionAttribute(String attribute,
String value)
Set value for a specific session attribute, will over-write current value.
|
void |
setSessionAttributes(Map<String,String> sessionAttributes)
Replace all session attributes with a new set.
|
public LexServiceContinuation(InteractionClient interactionClient, ResponseType responseMode, ResponseType requestMode)
interactionClient
- InteractionClient
.public String getSessionAttribute(String attribute)
attribute
- the request attribute as a String
.public Map<String,String> getSessionAttributes()
Map
.public void setSessionAttributes(Map<String,String> sessionAttributes)
sessionAttributes
- Map
.public void setSessionAttribute(String attribute, String value)
public void continueWithAudioInForTextOut()
public void continueWithAudioInForAudioOut()
public void continueWithTextInForAudioOut(String text)
text
- the response to the prompt as a String
.public void continueWithTextInForTextOut(String text)
text
- the response to the prompt as a String
.public void continueWithCurrentMode()
public void cancel()
Copyright © 2018. All rights reserved.