question

xcobbler avatar image
xcobbler asked

Upsell not working when interactionModel/dialog/intent exists

Hello and thank you for taking the time to read through my issue.


I've been trying to get an upsell of a consumable working for several hours now. I've followed the instructions listed here. I am able to upsell an entitlement without a problem. I can also buy the consumable and entitlement manually. When I upsell the consumable (in development testing in the dev console), I get only get back the JSON as expected, but there is no audio or text appearing on the left. Is there some sort limitation on the upsell request that I am not aware of? What would cause the JSON response to look correct, but result in no audio or text?


==update===

After further review, it appears this has something to do with the dialog model for this intent. For this intent I want to perform a confirmation if the user has enough in-game currency to perform the action. if the user doesn't have enough in-game currency, they will receive an upsell to buy some. In order to make the conditional confirmation to work I added:

{
    "name": "SomeIntent",
    "confirmationRequired": false,
    "prompts": {},
    "slots": []
},

to the en-US.json (interactionModel/dialog section). This allowed me to do conditional/programmatic confirmations of the intent.

I am doing the programmatic confirmation like this:

const request = handlerInput.requestEnvelope.request;
const currentIntent = request.intent;
let confirm = "are you sure?";
return handlerInput.responseBuilder
  .speak(confirm)
  .reprompt(confirm)
  .addConfirmIntentDirective(currentIntent)
  .getResponse();


This appears to have broken the ability to do Upsells in this Intent though...

return handlerInput.responseBuilder
.addDirective({
    type: "Connections.SendRequest",
    name: "Upsell",
    payload: {
        InSkillProduct: {
            productId: "some id"
        },
        upsellMessage: "some message. would you like to learn more?"
    },
    token: "foo bar",
})
.getResponse();


==another update==

this appears to be an issue with "virtual-alexa" (or how i'm using it). if I remove the model change everything works as expected when deployed and tested through the webapp. the remaining problem is that the automated test i've written to verify the path of going through the confirm process and verify in-game currency state now fails at this point:

let result = await alexa.launch();
...
result = await alexa.request()
.intent("SomeIntent")
.intentStatus("CONFIRMED")
.send();


with this error: Error: No match for dialog name: SomeIntent



alexatestinginteraction modelisp
10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Mihai avatar image
Mihai answered

Hi,


Same here, Upsell not working when the intent has an interaction model set. I posted a question about this as well (https://forums.developer.amazon.com/questions/208737/alexa-does-not-respond-to-request-for-upsell.html), yet no answers thus far.

What was your solution to this? It is literally driving me crazy.


Thank you!

1 comment
10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.


I'm sorry that you have encountered the same issue, but I am a little glad to know that I'm not going crazy and doing something completely wrong :)


Thanks for your detailed description in your issue - I'm glad Amazon is taking a look at it.


My issue is that the virtual-alexa testing library requires all intents used when testing to be listed in the interactionModel/dialog section of the model. As you know this causes the upsells to not exactly work. The ugly workaround i did was to commit to amazon the model without the interactionModel/dialog changes, but commit to git the model changes needed for the library. It's annoying but as long as you are not making many model changes then it's just a one time hack.

I am looking forward to when the git and amazon model match :)

0 Likes 0 ·