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.
            RequestArguments {response = RequestSpecialtyPizzaNameResponsePrompt, arguments = [getSpecialtyPizzaDetailsApi.arguments.specialtyPizzaName]}

        // Get deatils of specialty pizza.
        pizza = getSpecialtyPizzaDetailsApi(getSpecialtyPizzaDetailsRequest.specialtyPizzaName)
        // Provide details and offer to order it.
            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


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

While the affirm event looks something like this


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


image-3.png (47.0 KiB)
image-2.png (49.1 KiB)
1 comment
10 |5000

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

I'm having a very similar issue - did you ever determine the root cause or workaround?



0 Likes 0 ·

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

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