【问题标题】:Google Actions SDK ignoring possibleIntents?Google Actions SDK 忽略了可能的意图?
【发布时间】:2018-01-18 20:54:46
【问题描述】:

我在actions.json 中有这样定义的操作:

{
  "description": "foo description",
  "name": "FooAction",
  "fulfillment": {
    "conversationName": "my-app"
  },
  "intent": {
    "name": "FooIntent",
    "trigger": {
      "queryPatterns": [
        "foo",
      ]
    }
  }
}

当触发adding actions.intent.MAIN 时,我的服务器响应如下所示:

{
  "expectUserResponse": true,
  "expectedInputs": [
    {
      "inputPrompt": {
        "richInitialPrompt": {
          "items": [
            {
              "simpleResponse": {
                "textToSpeech": "Welcome to My App! What would you like to do?",
                "displayText": "Welcome to My App! What would you like to do?"
              }
            }
          ],
          "suggestions": []
        }
      },
      "possibleIntents": [
        {
          "intent": "FooIntent"
        }
      ]
    }
  ],
  "conversationToken": "123"
}

问题

当用户说“与我的应用对话”然后响应“foo”时,为什么我只返回 actions.intent.TEXT 意图?

但是,当用户说“向 foo 询问我的应用程序”(没有触发 actions.intent.MAIN)时,我会收到 FooIntent

我做错了什么?谢谢!

【问题讨论】:

    标签: actions-on-google google-home


    【解决方案1】:

    您没有做错任何事情 - 这正是您使用 actions.json 和 Actions SDK 时的工作方式。自定义意图用于initial triggering,并在较小程度上用于speech biasing

    当用作初始触发的一部分时,您将获得匹配回来的意图。但您只会获得一个自定义 Intent 名称作为初始 Intent 的一部分。

    对于以后的意图,您通常会得到actions.intent.TEXT 意图(如果您使用选项或其他一些内部响应类型,则例外)。请求自定义意图之一将有助于确定 STT 解释器将如何处理语音,但仍将返回为 actions.intent.TEXT

    通常 - 这是所需的行为。当您已经拥有自然语言处理器并且您最想要的只是发送到该 NLP 的文本时,主要使用 Actions SDK。然后,您的 NLP 将根据文本确定要采取的行动。

    如果您没有 NLP,我建议您使用 NLP。 Actions 控制台直接支持 Dialogflow,但如今大多数 NLP 都描述了如何将它们与 Actions on Google 一起使用,如果您希望使用其他 NLP。

    【讨论】:

    • 感谢您的回答!我还收到了一封来自我提交的支持票的电子邮件,说此功能“尚”不可用——我希望这意味着它很快就会出现!
    • 我无法评论 Google 会做什么(因为我不知道),但似乎不太可能。您是否有理由希望通过 actions.json 来处理它,而不是通过其他更适合这样做的工具?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多