use of com.amazon.speech.ui.PlainTextOutputSpeech in project amos-ss17-alexa by c-i-ber.
the class TestListDialog method exitIntent.
private SpeechletResponse exitIntent(SessionStorage.Storage storage) {
String speechText = "Okay, tschüss.";
// Create the plain text output
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
speech.setText(speechText);
return SpeechletResponse.newTellResponse(speech);
}
use of com.amazon.speech.ui.PlainTextOutputSpeech in project amos-ss17-alexa by c-i-ber.
the class TestListDialog method nextListItem.
private SpeechletResponse nextListItem(SessionStorage.Storage storage) {
int nextEntry = (int) storage.get("TestList.NextEntry");
String speechText;
if (nextEntry < exampleList.length) {
speechText = exampleList[nextEntry] + ". Möchtest du noch mehr hören?";
// Save current list offset in this session
storage.put("TestList.NextEntry", nextEntry + 1);
// Create the plain text output
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
speech.setText(speechText);
// Create reprompt
Reprompt reprompt = new Reprompt();
reprompt.setOutputSpeech(speech);
return SpeechletResponse.newAskResponse(speech, reprompt);
} else {
speechText = "Das waren alle Einträge.";
// Create the plain text output
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
speech.setText(speechText);
return SpeechletResponse.newTellResponse(speech);
}
}
use of com.amazon.speech.ui.PlainTextOutputSpeech in project amos-ss17-alexa by c-i-ber.
the class BlockCardService method getSpeechletResponse.
private SpeechletResponse getSpeechletResponse(String speechText, String repromptText, boolean isAskResponse) {
// Create the Simple card content.
SimpleCard card = new SimpleCard();
card.setTitle("Block Bank Card");
card.setContent(speechText);
// Create the plain text output.
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
speech.setText(speechText);
if (isAskResponse) {
// Create reprompt
PlainTextOutputSpeech repromptSpeech = new PlainTextOutputSpeech();
repromptSpeech.setText(repromptText);
Reprompt reprompt = new Reprompt();
reprompt.setOutputSpeech(repromptSpeech);
return SpeechletResponse.newAskResponse(speech, reprompt, card);
} else {
return SpeechletResponse.newTellResponse(speech, card);
}
}
use of com.amazon.speech.ui.PlainTextOutputSpeech in project amos-ss17-alexa by c-i-ber.
the class AmosAlexaSpeechlet method bankTransfer.
/**
* Transfers money and returns response with
*
* @return SpeechletResponse spoken and visual response for the given intent
*/
private SpeechletResponse bankTransfer(Map<String, Slot> slots) {
Slot amountSlot = slots.get("amount");
Slot nameSlot = slots.get("name");
String amount = amountSlot.getValue();
String name = nameSlot.getValue();
//getting response regarding account balance
this.getAccountBalanceResponse();
//transfering money
String url = "http://amos-bank-lb-723794096.eu-central-1.elb.amazonaws.com/api/v1_0/transactions";
String urlParams = "{\n" + " \"amount\" : " + amount + ",\n" + " \"sourceAccount\" : \"DE23100000001234567890\",\n" + " \"destinationAccount\" : \"DE60643995205405578292\",\n" + " \"valueDate\" : \"2017-05-16\",\n" + " \"description\" : \"Beschreibung\"\n" + "}";
ApiHelper.sendPost(url, urlParams);
//reply message
String speechText = "Die " + amount + " wurden zu " + name + " überwiesen";
// Create the Simple card content.
SimpleCard card = new SimpleCard();
card.setTitle("CreditLimit");
card.setContent(speechText);
// Create the plain text output.
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
speech.setText(speechText);
// Create reprompt
Reprompt reprompt = new Reprompt();
reprompt.setOutputSpeech(speech);
return SpeechletResponse.newAskResponse(speech, reprompt, card);
}
use of com.amazon.speech.ui.PlainTextOutputSpeech in project amos-ss17-alexa by c-i-ber.
the class AmosAlexaSpeechlet method getHelpResponse.
/**
* Creates a {@code SpeechletResponse} for the help intent.
*
* @return SpeechletResponse spoken and visual response for the given intent
*/
private SpeechletResponse getHelpResponse() {
String speechText = "You can say hello to me!";
// Create the Simple card content.
SimpleCard card = new SimpleCard();
card.setTitle("HelloWorld");
card.setContent(speechText);
// Create the plain text output.
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
speech.setText(speechText);
// Create reprompt
Reprompt reprompt = new Reprompt();
reprompt.setOutputSpeech(speech);
return SpeechletResponse.newAskResponse(speech, reprompt, card);
}
Aggregations