public class SpeechletToSpeechletV2Adapter extends Object implements SpeechletV2
Speechlet into a SpeechletV2.| Constructor and Description |
|---|
SpeechletToSpeechletV2Adapter(Speechlet speechlet) |
| Modifier and Type | Method and Description |
|---|---|
Speechlet |
getSpeechlet() |
SpeechletResponse |
onIntent(SpeechletRequestEnvelope<IntentRequest> requestEnvelope)
Entry point for handling speech initiated requests.
This is where the bulk of the SpeechletV2 logic lives. |
SpeechletResponse |
onLaunch(SpeechletRequestEnvelope<LaunchRequest> requestEnvelope)
Entry point for
SpeechletV2s for handling a speech initiated request to start the skill
without providing an Intent.This method is only invoked when Session.isNew() is true. |
void |
onSessionEnded(SpeechletRequestEnvelope<SessionEndedRequest> requestEnvelope)
Callback used to notify that the session ended as a result of the user interacting, or not
interacting with the device.
|
void |
onSessionStarted(SpeechletRequestEnvelope<SessionStartedRequest> requestEnvelope)
Used to notify that a new session started as a result of a user interacting with the device.
|
public SpeechletToSpeechletV2Adapter(Speechlet speechlet)
public void onSessionStarted(SpeechletRequestEnvelope<SessionStartedRequest> requestEnvelope)
SpeechletV2SpeechletV2s to perform initialization logic and allows for session
attributes to be stored for subsequent requests.onSessionStarted in interface SpeechletV2requestEnvelope - the session started request envelopepublic SpeechletResponse onLaunch(SpeechletRequestEnvelope<LaunchRequest> requestEnvelope)
SpeechletV2SpeechletV2s for handling a speech initiated request to start the skill
without providing an Intent.Session.isNew() is true.onLaunch in interface SpeechletV2requestEnvelope - the launch request envelopepublic SpeechletResponse onIntent(SpeechletRequestEnvelope<IntentRequest> requestEnvelope)
SpeechletV2SpeechletV2 logic lives. Intent requests are handled by
this method and return responses to render to the user.SpeechletV2 session, Session.isNew()
returns true. Otherwise, this is a subsequent request within an existing session.onIntent in interface SpeechletV2requestEnvelope - the intent request envelope to handlepublic void onSessionEnded(SpeechletRequestEnvelope<SessionEndedRequest> requestEnvelope)
SpeechletV2SpeechletV2 itself
ended the session using SpeechletResponse.setShouldEndSession(boolean).onSessionEnded in interface SpeechletV2requestEnvelope - the end of session request envelopepublic Speechlet getSpeechlet()
Copyright © 2016. All rights reserved.