我正在使用Alexa技能套件来开发Alexa技能,当用户说出无效的语音时,它会回答“所请求的技能的响应存在问题”。
我已经尝试过使用AMAZON.Fallback意图,但是在测试窗口中查看json输出表明它尚未被触发。
我的后端是Lambda中的python 2.7,我正在使用语言环境en-gb(我尝试将交互模型复制到en-us中,但结果相同)。
回退意图是用于处理无效话语的正确方法,还是有另一种方式来获得类似的结果?
这是Json输入:
{
"version": "1.0",
"session": {
"new": false,
"sessionId": "amzn1.echo-api.session.bb6cd858-2128-44d2-8c43-ed6c501e0be4",
"application": {
"applicationId": "amzn1.ask.skill.0fbcbd10-17ee-49ea-9f7a-30401dc26a56"
},
"user": {
"userId": "amzn1.ask.account.AHL5Q4YLTSH3CHSILRWTE6FBK3XLKFE3XR6D6KY45IW6QVKJOW6ZWUAWMVS23YRY6EVWM45DKXPJSOXFP5AJ47TJTFD3JRHGEMUVAMKVZ4GGFJZ35JGAJV22RRDKP534OKVE46QPI32H5T6IJFHDVPP4TC3W6QXDJ2XPTYUL3U2MLQ2NYSG63UE2Q3MJZGJ7GEA5MIKSJCWUPEQ"
}
},
"context": {
"System": {
"application": {
"applicationId": "amzn1.ask.skill.0fbcbd10-17ee-49ea-9f7a-30401dc26a56"
},
"user": {
"userId": "amzn1.ask.account.AHL5Q4YLTSH3CHSILRWTE6FBK3XLKFE3XR6D6KY45IW6QVKJOW6ZWUAWMVS23YRY6EVWM45DKXPJSOXFP5AJ47TJTFD3JRHGEMUVAMKVZ4GGFJZ35JGAJV22RRDKP534OKVE46QPI32H5T6IJFHDVPP4TC3W6QXDJ2XPTYUL3U2MLQ2NYSG63UE2Q3MJZGJ7GEA5MIKSJCWUPEQ"
},
"device": {
"deviceId": "amzn1.ask.device.AGBUICDG5CR3PRTAM43NOEG3QDWUIIPF723CFMXHZILFXJY4CNAUNFVQGH33BL6VRU4DXG667KBEIE66XIO4ZW44DL2O67ALKIJDVV2YF7JPPAZAUZRGI2EHH34KVEHSPZRM3TMLPIAREL4LSTWFSI3MU2JA",
"sup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DWMDiuQs9pm-Y5kOU4x2HJbVqmkVj_xJHQQivM8_juK-hX_9FqDgYrnNmUz3erehtd7P_Euf9uiMXQgN5uF1NCwh0GscxnD_XPQ6b98I3hJnze-OHIFfEkla1THH180Op6O4Q47vlMHZWgl4cDQJneATUSOcHXOq8NnN9vfP_z2Q33g7n3BJmPvz-6vWsgbSrEajX-3xHs8rjIcdxvnc-w"
},
"Viewport": {
"experiences": [
{
"arcMinuteWidth": 246,
"arcMinuteHeight": 144,
"canRotate": false,
"canResize": false
}
],
"shape": "RECTANGLE",
"pixelWidth": 1024,
"pixelHeight": 600,
"dpi": 160,
"currentPixelWidth": 1024,
"currentPixelHeight": 600,
"touch": [
"SINGLE"
]
}
},
"request": {
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.33d7948c-e4de-4ec9-9490-8e66c460d8f7",
"timestamp": "2019-02-19T17:33:18Z",
"locale": "en-GB",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "Invalid SSML Output Speech for requestId amzn1.echo-api.request.14165ddf-86dc-4cd2-b636-94df1ddfd835. Error: Fatal error occurred when processing SSML content. This usually happens when the SSML is not well formed. Error: Unexpected character 'T' (code 84) in prolog; expected '<'\n at [row,col {unknown-source}]: [1,1]"
}
}
}
答案 0 :(得分:0)
如果您所使用的英语或德语技能是肯定的,则应使用后备意图。其他语言环境尚不支持。
对于en-GB或en-US,您需要确保在语音交互模型(前端)中定义了AMAZON.FallbackIntent
,并且在后端(例如lambda)中有一个处理程序来捕获意图请求名为AMAZON.FallbackIntent
在回退过程中,这肯定听起来像是一个问题(您可能无法正确捕捉)