2

I've got the following action in my action.json file,

{
    "description": "Recommend movies",
    "initialTrigger": {
        "intent": "GIVE_RECOMMENDATION",
        "queryPatterns": [
            {"queryPattern": "What should I watch?"},
            {"queryPattern": "Give me a recommendation"},
            {"queryPattern": "Tell me a good ($String:genre)? movie"}
        ]
    },
    "httpExecution": {
        "url":"my webhook URL here"
    }
}

On my API, I've got:

app.post('/', function(req, res){
    let assistant = new ActionsSdkAssistant({request: req, response: res});
    console.log('Current intent: ' + assistant.getIntent());
}

When I simulate my action, and say "What should I watch?", the current intent is ALWAYS 'assistant.intent.action.TEXT'. Why is it never 'GIVE_RECOMMENDATION', like its supposed to be?

Human Cyborg Relations
  • 1,202
  • 5
  • 27
  • 52

1 Answers1

5

I'm assuming you're testing your skill as such:

open ACTION NAME

What should I watch?

Chances are you're having the same issue I had, see the accepted answer and comments to ExpectedInputs / possible_intents only works with "assistant.intent.action.TEXT"?

In short: After the initial intent was triggered (i.e. after you opened your skill) the Actions SDK only supports the assistant.intent.action.TEXT intent and no longer does any intent matching.

Intent matching only works for the very first invocation of the action:

ask ACTION_NAME What should I watch?

The above should give you the correct intent name.

Google recommends using http://api.ai if you do not have your own system in place for natural language processing and need to have intent-based dialog with your user

Community
  • 1
  • 1
Wasda
  • 162
  • 7