多时隙场景的话语模式

Utterance schema for multi slot scenario

我有以下场景,根据城市名称或邮政编码获取美国位置详细信息

"Get me the stores around Seattle" 或
"Get me the stores around 07014"

我试过以下方法,但显然行不通。使用内置插槽和 而不定义多个意图来处理这种情况的最佳方法是什么

{
  "intents": [
    {
      "slots": [
        {
          "name": "location",
          "type": "AMAZON.US_CITY"
        },
        {
          "name": "zip",
          "type": "AMAZON.NUMBER"
        }
      ],
      "intent": "LocationInquiryIntent"
    }
  ]
}

话语:
LocationInquiryIntent Get me the stores around {location|zip}

虽然您必须至少使用一次在话语中定义的每个槽位,但您不必在 every[=] 中使用 every 个槽位25=] 话语。事实上,您可以提供一个不使用 any 槽的话语,并让 Alexa 专门询问他们的邮政编码,以响应既没有提供位置也没有提供邮政编码。

考虑到这一点,只需定义多个样本话语:

LocationInquiryIntent Get me the stores around {location}
LocationInquiryIntent Get me the stores around {zip}

定义同一意图的多个排列绝对没有害处,事实上,鼓励这样做有助于增加对您的请求的潜在措辞的覆盖范围。

进一步阅读