Search in sources :

Example 21 with Slot

use of com.amazon.speech.slu.Slot in project amos-ss17-alexa by c-i-ber.

the class SavingsPlanService method saveMonthlyPaymentAndContinue.

private SpeechletResponse saveMonthlyPaymentAndContinue(Intent intent, Session session) {
    // Amount may either be basic amount or monthly payment amount, so we
    // have to check first, if basic amount has already been set in the session.
    // (Whole process must be sequential)
    Map<String, Slot> slots = intent.getSlots();
    Slot amountSlot = slots.get(NUMBER_SLOT_KEY);
    // In this case amount slot contains monthly payment amount
    String monthlyPayment = amountSlot.getValue();
    LOGGER.info("MonthlyPayment: " + monthlyPayment);
    session.setAttribute(MONTHLY_PAYMENT_KEY, monthlyPayment);
    return getCalculatedSavingsPlanInfo(session);
}
Also used : Slot(com.amazon.speech.slu.Slot)

Example 22 with Slot

use of com.amazon.speech.slu.Slot in project amos-ss17-alexa by c-i-ber.

the class SavingsPlanService method saveBasicAmountAndContinue.

private SpeechletResponse saveBasicAmountAndContinue(Intent intent, Session session) {
    // Amount may either be basic amount or monthly payment amount, so we
    // have to check first, if basic amount has already been set in the session.
    // (Whole process must be sequential)
    Map<String, Slot> slots = intent.getSlots();
    Slot amountSlot = slots.get(NUMBER_SLOT_KEY);
    // In this case amount slot contains basic amount
    String basicAmount = amountSlot.getValue();
    LOGGER.info("BasicAmount: " + basicAmount);
    session.setAttribute(BASIC_AMOUNT_KEY, basicAmount);
    if (session.getAttribute(DURATION_KEY) != null) {
        return getCalculatedSavingsPlanInfo(session);
    } else {
        return askForDuration(session);
    }
}
Also used : Slot(com.amazon.speech.slu.Slot)

Aggregations

Slot (com.amazon.speech.slu.Slot)22 Reprompt (com.amazon.speech.ui.Reprompt)10 PlainTextOutputSpeech (com.amazon.speech.ui.PlainTextOutputSpeech)8 SimpleCard (com.amazon.speech.ui.SimpleCard)4 Category (model.db.Category)4 SsmlOutputSpeech (com.amazon.speech.ui.SsmlOutputSpeech)3 StandingOrder (model.banking.StandingOrder)3 ApiHelper (amosalexa.ApiHelper)1 SessionStorage (amosalexa.SessionStorage)1 Item (amosalexa.services.pricequery.aws.model.Item)1 Offer (amosalexa.services.pricequery.aws.model.Offer)1 Intent (com.amazon.speech.slu.Intent)1 Session (com.amazon.speech.speechlet.Session)1 SpeechletException (com.amazon.speech.speechlet.SpeechletException)1 JSONException (com.amazonaws.util.json.JSONException)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 IOException (java.io.IOException)1 DateFormat (java.text.DateFormat)1 SimpleDateFormat (java.text.SimpleDateFormat)1 LinkedList (java.util.LinkedList)1