How to get the actual utterance text of an Alexa skill intent using JOVO framework

681 Views Asked by At

Is there a way to get the actual Alexa utterance (the actual question or phrase user has asked) using JOVO? I need to alter the speech output based on that. Here is a use case scenario:

Variations:

Utterance: How many active coupons
Alexa: At present, you have 2 active coupons. Do you want more details?
Utterance: Yes
Alexa: Currently you have 2 active coupons running. WINTER20 with a 10 per cent discount, which expires on February 20, 2020. SPRING20 with a flat INR 250 discount on all products above INR 1000. Expires on April 30, 2020.

Utterance: Get my coupon details
Alexa: Currently you have 2 active coupons running. WINTER20 with a 10 per cent discount, which expires on February 20, 2020. SPRING20 with a flat INR 250 discount on all products above INR 1000. Expires on April 30, 2020.

1

There are 1 best solutions below

1
Ben Freiberg On

You can't get the exact text or question that a user asked from Alexa. Your skill will only receive the intent name and any associated slot values (if filled).

However, you could adapt your interaction model to fit your use-cases. For example, you could create an GetActiveCouponIntent and GetCouponDetailsIntent with different sample utterances. Then, if the user triggers the GetActiveCouponIntent intent, you can set a session attribute indicating the state. If the user then triggers the AMAZON.YesIntent you can evaluate the state attribute and change the output accordingly.