0

我在 Alexa 中创建了一个带有插槽的意图。这会触发一个用 Python 编写的 AWS lambda。我正在记录“事件”。我希望 event['request']['dialogState'] 存在,但事实并非如此。我错过了什么吗?

事件:

{u'session': {u'application': {u'applicationId': u'amzn1.ask.skill.b2a191bb-7ee2-4fa7-aa7b-456d4bd2ee35'}, u'sessionId': u'Sessi    onId.afb747ea-01ae-4094-ba10-ac49405a99df', u'user': {u'userId': u'amzn1.ask.account.BFHTSNCIVD2HA563BEPLRW5TSCESQEZXCIULPPB2ULOZBIJRCPM    5Z5NWOWH3HWNOZRTY4WT3FZFVGWWPKRSKC4ZNDSB2EYB45TYQ3RNY67CZPGF4GBMV6CL57C5MJVPIQPH25DQWGXGALDBCBRHMG5IA3Y26UHI7MHPIV3665ZU5OESS3UBADD7MDYQ    BWJZFB3XHJS6IM2Y5UTQ', u'accessToken': None}, u'new': False, u'attributes': {}}, u'request': {u'locale': u'en-US', u'type': u'IntentRequ    est', u'intent': {u'slots': {u'ncpu': {u'name': u'ncpu'}, u'nmem': {u'name': u'nmem'}}, u'name': u'CreateVM'}, u'requestId': u'EdwReques    tId.c9de162a-d606-43a1-9257-b7367c9da5de', u'timestamp': u'2017-10-24T09:43:17Z'}, u'version': u'1.0', u'context': {u'AudioPlayer': {u'p    layerActivity': u'IDLE'}, u'System': {u'device': {u'supportedInterfaces': {}}, u'application': {u'applicationId': u'amzn1.ask.skill.b2a1    91bb-7ee2-4fa7-aa7b-456d4bd2ee35'}, u'user': {u'userId': u'amzn1.ask.account.BFHTSNCIVD2HA563BEPLRW5TSCESQEZXCIULPPB2ULOZBIJRCPM5Z5NWOWH    3HWNOZRTY4WT3FZFVGWWPKRSKC4ZNDSB2EYB45TYQ3RNY67CZPGF4GBMV6CL57C5MJVPIQPH25DQWGXGALDBCBRHMG5IA3Y26UHI7MHPIV3665ZU5OESS3UBADD7MDYQBWJZFB3X    HJS6IM2Y5UTQ'}}}}
4

1 回答 1

2

您无法在 Amazon 开发人员门户中测试您的技能,因为这些不会为您的对话返回 Dialogstate。如果你想测试你的技能,我建议你去 echosim.io 或者找一个 echo dot 来试验一下。

如果您不想使用 echosim.io 或真正的 echo 设备进行测试,并且您在 AWS Lambda 中拥有您的技能代码,您始终可以使用 test 命令在那里测试您的代码。

例子:

{
  "session": {
    "new": true,
    "sessionId": "SessionId.******************0ed735901",
    "application": {
      "applicationId": "amzn1.ask.skill.e96d9***********3ee1b958e6ca"
    },
    "attributes": {},
    "user": {
      "userId": "amzn1.ask.account.AGMQGVEZFE355BBMXYBQGFN7TRN5E5CSGUU5Y3AUNEBT3DOZ7IOQ3K7G3RGIOI7BEJVLVR4CWSARSTMAF5RNA4QW************DURTSESLYMYDVIQLWA2LF6PHG3KB3UEOLZWYBBWLRKCFFMG7JFP7TNKCS2RQ4KOGPIMOT2PGQT3S2HAOBNJSAA
    }
  },
  "request": {
    "type": "IntentRequest",
    "dialogState": "IN_PROGRESS",
    "requestId": "EdwRequestId.5b2a45f7-e4bb-44cd-ba9f-1cfe138d577f",
    "intent": {
      "name": "SearchIntent",
      "slots": {
        "AnswerTime": {
          "name": "AnswerTime",
          "value": "Nope"
        },
        "FirstTime": {
          "name": "FirstTime",
          "value": "02:00"
        },
        "SecondTime": {
          "name": "SecondTime"
        },
        "Date": {
          "name": "Date",
          "value": "2017-10-20"
        },
        "Name": {
          "name": "Name",
          "value": "Liam De Lee"
        }
      }
    },
    "locale": "en-US",
    "timestamp": "2017-10-19T13:29:17Z"
  },
  "context": {
    "AudioPlayer": {
      "playerActivity": "IDLE"
    },
    "System": {
      "application": {
        "applicationId": "amzn1.ask.skill.e96d95e0-8cbd-41d2-a280-3ee1b958e6ca"
      },
      "user": {
        "userId": "amzn1.ask.account.AGMQGVEZFE355BBMXYBQGFN7TRN5E5CSGUU5Y3AUNEBT3DOZ7IOQ3K7G3RGIOI7BEJVLVR4CWSARSTMAF5RNA4QW************DURTSESLYMYDVIQLWA2LF6PHG3KB3UEOLZWYBBWLRKCFFMG7JFP7TNKCS2RQ4KOGPIMOT2PGQT3S2HAOBNJSAA"
      },
      "device": {
        "supportedInterfaces": {}
      }
    }
  },
  "version": "1.0"
}

注意:服务模拟器当前不支持测试音频播放器指令、对话模型、客户权限和客户帐户链接。

亚马逊开发者门户。

于 2017-10-27T12:22:14.503 回答