response.setCard(card); return response;
/** * Selects a joke randomly and starts it off by saying "Knock knock". * * @param session * the session object * @return SpeechletResponse the speechlet response */ private SpeechletResponse handleTellMeAJokeIntent(final Session session) { String speechOutput = ""; // Reprompt speech will be triggered if the user doesn't respond. String repromptText = "You can ask, who's there"; // / Select a random joke and store it in the session variables int jokeID = (int) Math.floor(Math.random() * JOKE_LIST.size()); // The stage variable tracks the phase of the dialogue. // When this function completes, it will be on stage 1. session.setAttribute(SESSION_STAGE, KNOCK_KNOCK_STAGE); session.setAttribute(SESSION_JOKE_ID, jokeID); speechOutput = "Knock knock!"; // Create the Simple card content. SimpleCard card = new SimpleCard(); card.setTitle("Wise Guy"); card.setContent(speechOutput); SpeechletResponse response = newAskResponse(speechOutput, false, repromptText, false); response.setCard(card); return response; }
SpeechletResponse build() { SpeechletResponse response = new SpeechletResponse(); response.setOutputSpeech(speech); response.setCard(card); response.setReprompt(reprompt); response.setDirectives(directiveList); response.setNullableShouldEndSession(shouldEndSession); return response; }
/** * Selects a joke randomly and starts it off by saying "Knock knock". * * @param session * the session object * @return SpeechletResponse the speechlet response */ private SpeechletResponse handleTellMeAJokeIntent(final Session session) { String speechOutput = ""; // Reprompt speech will be triggered if the user doesn't respond. String repromptText = "You can ask, who's there"; // / Select a random joke and store it in the session variables int jokeID = (int) Math.floor(Math.random() * JOKE_LIST.size()); // The stage variable tracks the phase of the dialogue. // When this function completes, it will be on stage 1. session.setAttribute(SESSION_STAGE, KNOCK_KNOCK_STAGE); session.setAttribute(SESSION_JOKE_ID, jokeID); speechOutput = "Knock knock!"; // Create the Simple card content. SimpleCard card = new SimpleCard(); card.setTitle("Wise Guy"); card.setContent(speechOutput); SpeechletResponse response = newAskResponse(speechOutput, false, repromptText, false); response.setCard(card); return response; }
SpeechletResponse build() { SpeechletResponse response = new SpeechletResponse(); response.setOutputSpeech(speech); response.setCard(card); response.setReprompt(reprompt); response.setDirectives(directiveList); response.setNullableShouldEndSession(shouldEndSession); return response; }
response.setCard(card); return response;
response.setCard(card);
response.setCard(card);
SpeechletResponse response = newAskResponse(speechOutput, false, repromptText, false); response.setCard(card); return response;
SpeechletResponse response = newAskResponse(speechOutput, false, repromptText, false); response.setCard(card); return response;