question

barak avatar image
barak asked

Offer API example dosen't work

We are trying to make the basic combination of Offer API response to work,

While trying it, it seems that the session is being ended and not allowing the user to response to the offer request.

Also taking the generated Pizza example and running it seems to have the same issue, for example the
SpecialtyPizza.acdl Scenario:
dialog Nothing SpecialtyPizza {

    // Describe get details for speciality pizza and offer to add it to the order.
    sample {
        // Declare the expectation that the user will ask to for the details of a speciality pizza.
        getSpecialtyPizzaDetailsRequest = expect(Invoke, getSpecialtyPizzaDetailsEvent)
        
        // The "ensure()" action will simulate the interactions in which user asked to provide the name of speciality pizza.
        ensure(
            RequestArguments {response = RequestSpecialtyPizzaNameResponsePrompt, arguments = [getSpecialtyPizzaDetailsApi.arguments.specialtyPizzaName]}
        )

        // Get deatils of specialty pizza.
        pizza = getSpecialtyPizzaDetailsApi(getSpecialtyPizzaDetailsRequest.specialtyPizzaName)
        
        // Provide details and offer to order it.
        response(GetSpecialtyPizzaDetailsSuccessResponsePrompt, 
            Notify {success = true, actionName = getSpecialtyPizzaDetailsApi}, 
            Offer {actionName = addSpecialtyPizzaApi}, 
            PizzaDetailPayload {pizza = pizza})
        expect(Affirm, affirmEvent)

        // Add speciality pizza to the order and render the response.
        oridnal = addSpecialtyPizzaApi(pizza.nullableSpecialtyPizzaName)
        response(AddSpecialtyPizzaSuccessResponsePrompt, Notify {actionName = addSpecialtyPizzaApi, success = true}, payload = SpecialtyPizzaPayload {ordinal = oridnal})
    }


The actual conversation is

image-3.png

Notice that after the user affirms the request, the session is being ended for unknown reason.


While the affirm event looks something like this

image-2.png

Anyone encountered it, or can point to what is wrong with the given example?

Thanks

alexaresponsealexa-conversations
image-3.png (47.0 KiB)
image-2.png (49.1 KiB)
10 |5000 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

Andy Whitworth avatar image
Andy Whitworth answered

In your voice interaction model, do you have an AMAZON.YesIntent specified ? And a handler in your backend code to hadle it ?

Also, what is that code ? A test frame work ? What is your skill backend code written in ?

10 |5000 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.