【问题标题】:ALEXA - How to send slot ID in service requestALEXA - 如何在服务请求中发送插槽 ID
【发布时间】:2018-02-22 14:26:31
【问题描述】:

我正在使用自定义插槽创建自定义 Alexa 技能。我为插槽创建了预定义的值,并为每个插槽分配了一个 ID。在我的测试过程中,我可以看到在服务请求中没有 ID 键值对:

"request": {
"type": "IntentRequest",
"requestId": "EdwRequestId.xXxxxxXXXx-xxXX-xXXx-xXXX-xxxXXXXXXxxx",
"intent": {
  "name": "HowToIntent",
  "slots": {
    "action": {
      "name": "action",
      "value": "clear cache"
    }
  }
},

是否有可能在请求中传递槽 ID?

【问题讨论】:

  • 您能分享一下您创建的意图架构和插槽吗?
  • @VijayanathViswanathan 我已在答案中发布。

标签: node.js amazon-web-services aws-lambda amazon alexa


【解决方案1】:
"languageModel": {
"types": [
  {
    "name": "action",
    "values": [
      {
        "id": "1",
        "name": {
          "value": "clear cache",
          "synonyms": [
            "flush cache",
            "clean cache"
          ]
        }
      },
      {
        "id": "2",
        "name": {
          "value": "perform reindex",
          "synonyms": [
            "reindex",
            "do reindex"
          ]
        }
      },
      {
        "id": "3",
        "name": {
          "value": "create a product",
          "synonyms": [
            "add product",
            "make product"
          ]
        }
      },
      {
        "id": "4",
        "name": {
          "value": "create a category",
          "synonyms": [
            "add category",
            "make category"
          ]
        }
      }
    ]
  },
  {
    "name": "element",
    "values": [
      {
        "id": "1",
        "name": {
          "value": "category tree",
          "synonyms": [
            "category structure",
            "categories"
          ]
        }
      },
      {
        "id": "2",
        "name": {
          "value": "simple product",
          "synonyms": []
        }
      },
      {
        "id": "3",
        "name": {
          "value": "gift card",
          "synonyms": []
        }
      }
    ]
  }
],
"intents": [
  {
    "name": "AMAZON.CancelIntent",
    "samples": []
  },
  {
    "name": "AMAZON.HelpIntent",
    "samples": []
  },
  {
    "name": "AMAZON.StopIntent",
    "samples": []
  },
  {
    "name": "HowToIntent",
    "samples": [
      "how to {action}"
    ],
    "slots": [
      {
        "name": "action",
        "type": "action"
      }
    ]
  },
  {
    "name": "WelcomeIntent",
    "samples": [],
    "slots": []
  },
  {
    "name": "WhatIsIntent",
    "samples": [
      "what is {element}"
    ],
    "slots": [
      {
        "name": "element",
        "type": "element"
      }
    ]
  }
],
"invocationName": "my assistant"

} }

【讨论】:

    猜你喜欢
    • 2019-05-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-04
    相关资源
    最近更新 更多