AskWithList in action on Google

I am following the sample code for Action on Google responses at the following link:

https://developers.google.com/actions/assistant/responses

I want the list response to appear when the user has initiated a text intent, but all I get is "Your application is not responding right now. Please try again soon." Here's the code I'm using (it copies and pastes for the most part from the link):

function textIntent(app) {
    app.askWithList(app.buildRichResponse()
        .addSimpleResponse('Alright')
        .addSuggestions(
            ['Basic Card', 'List', 'Carousel', 'Suggestions']),
        // Build a list
        app.buildList('Things to learn about')
        // Add the first item to the list
        .addItems(app.buildOptionItem('MATH_AND_PRIME',
          ['math', 'math and prime', 'prime numbers', 'prime'])
          .setTitle('Math & prime numbers')
          .setDescription('42 is an abundant number because the sum of its ' +
            'proper divisors 54 is greater…')
        )
        // Add the second item to the list
        .addItems(app.buildOptionItem('EGYPT',
          ['religion', 'egypt', 'ancient egyptian'])
          .setTitle('Ancient Egyptian religion')
          .setDescription('42 gods who ruled on the fate of the dead in the ' +
            'afterworld. Throughout the under…')
        )
        // Add third item to the list
        .addItems(app.buildOptionItem('RECIPES',
          ['recipes', 'recipe', '42 recipes'])
          .setTitle('42 recipes with 42 ingredients')
          .setDescription('Here\ a beautifully simple recipe that\ full ' +
            'of flavor! All you need is some ginger and…')
        )
    );

}

let actionMap = new Map();
actionMap.set(app.StandardIntents.MAIN, mainIntent);
actionMap.set(app.StandardIntents.TEXT, textIntent);

app.handleRequest(actionMap);

      

Here is my action.json:

{
    "actions": [
     {
        "description": "Default Welcome Intent",
        "name": "MAIN",
        "fulfillment": {
            "conversationName": "welcome"
        },
        "intent": {
            "name": "actions.intent.MAIN"
        }
     },
    ],

    "conversations": {
        "welcome": {
            "name": "welcome",
            "url": "https://example.com"
        },
    }

}

      

Any help would be greatly appreciated! Thank you in advance.

+3


source to share


1 answer


You are using version 2 features, but the actions.json package does not specify a version, so it defaults to version 1.

The "conversations" section of action.json should look something like this:



"conversations": {
    "welcome": {
        "name": "welcome",
        "url": "https://example.com",
        "fulfillmentApiVersion": 2
    },
}

      

+4


source







All Articles