无法使用Actions SDK读取意图

Hum*_*ons 2 actions-on-google

我的action.json文件中有以下操作,

{
    "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"
    }
}
Run Code Online (Sandbox Code Playgroud)

在我的API上,我得到了:

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

当我模拟我的动作并说"我该怎么看?"时,目前的意图总是'assistant.intent.action.TEXT'.为什么它永远不会'GIVE_RECOMMENDATION',就像它应该是的那样?

Was*_*sda 5

我假设你正在测试你的技能:

打开ACTION NAME

我应该看什么?

你有可能遇到同样的问题,看到接受的答案和对ExpectedInputs/possible_intents的评论 只适用于"assistant.intent.action.TEXT"吗?

简而言之:在初始意图被触发后(即在您打开技能之后),动作SDK仅支持assistant.intent.action.TEXT意图,不再进行任何意图匹配.

意图匹配仅适用于第一次调用操作:

问ACTION_NAME我应该看什么?

以上应该给你正确的意图名称.

Google建议您使用http://api.ai,如果您没有自己的系统进行自然语言处理,并且需要与您的用户进行基于意图的对话