Alexa 未能回应

Alexa failed to response

创建了一个新的 aws-lambda 函数并且测试也可以正常执行。然后我创建了一个新的 Alexa 技能并配置了所有内容,甚至在 Interface 部分下添加了 Display Interface。但是当我尝试在 Alexa 模拟器中执行我的命令时

其响应类似于There was a problem with the requested skill's response。 技能 I/O json 文件看起来像

输入Json:

{  
   "version":"1.0",
   "session":{  
      "new":true,
      "sessionId":"amzn1.echo-api.session.2739cca3-6804-4872-b137-a4d33bca1d76",
      "application":{  
         "applicationId":"amzn1.ask.skill.c5444c1d-574f-44fe-981e-351b08cab8b6"
      },
      "user":{  
         "userId":"amzn1.ask.account.AGMVQCXC6XYWORU62MNGISCR6ECHRTHHSBKNIDWFBQDKL66AQDHERNVOA2K5VI32G6HZMYN7GYVGSRWSVFPQWDBCJ2WVUBXJ2AY6F5T374UYHH7ZFOOWJKPJV6KYSNOMXXIDY5C2KUJ4ID7GHXELOH23CKN6WHVLQREOCQXANHDOLDKL722UBIZZFPE4MJAU5S5TCHL5HGOZO6Y"
      }
   },
   "context":{  
      "AudioPlayer":{  
         "playerActivity":"IDLE"
      },
      "Display":{  

      },
      "System":{  
         "application":{  
            "applicationId":"amzn1.ask.skill.c5444c1d-574f-44fe-981e-351b08cab8b6"
         },
         "user":{  
            "userId":"amzn1.ask.account.AGMVQCXC6XYWORU62MNGISCR6ECHRTHHSBKNIDWFBQDKL66AQDHERNVOA2K5VI32G6HZMYN7GYVGSRWSVFPQWDBCJ2WVUBXJ2AY6F5T374UYHH7ZFOOWJKPJV6KYSNOMXXIDY5C2KUJ4ID7GHXELOH23CKN6WHVLQREOCQXANHDOLDKL722UBIZZFPE4MJAU5S5TCHL5HGOZO6Y"
         },
         "device":{  
            "deviceId":"amzn1.ask.device.AG6K3BI3PXMWLBUTDHHUIYBJCEEYRCTYIW7YCRT7U53VFQHRAGF6HVTOIHBR2KDVWPZHMRUJKQOYZRYA6V3CY7AJE6UYBA6NYAFYKCYPNX4HHHEOKXTX7BAQUG3BZQIPIO3FWSVXX4V4VIAPWPHPRSYJSSYOJYXBR6R6LBIEO4MODOO5QD4TM",
            "supportedInterfaces":{  
               "AudioPlayer":{  

               },
               "Display":{  
                  "templateVersion":"1.0",
                  "markupVersion":"1.0"
               }
            }
         },
         "apiEndpoint":"https://api.eu.amazonalexa.com",
         "apiAccessToken":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjEifQ.eyJhdWQiOiJodHRwczovL2FwaS5hbWF6b25hbGV4YS5jb20iLCJpc3MiOiJBbGV4YVNraWxsS2l0Iiwic3ViIjoiYW16bjEuYXNrLnNraWxsLmM1NDQ0YzFkLTU3NGYtNDRmZS05ODFlLTM1MWIwOGNhYjhiNiIsImV4cCI6MTUzNDQ4NzI4OSwiaWF0IjoxNTM0NDgzNjg5LCJuYmYiOjE1MzQ0ODM2ODksInByaXZhdGVDbGFpbXMiOnsiY29uc2VudFRva2VuIjpudWxsLCJkZXZpY2VJZCI6ImFtem4xLmFzay5kZXZpY2UuQUc2SzNCSTNQWE1XTEJVVERISFVJWUJKQ0VFWVJDVFlJVzdZQ1JUN1U1M1ZGUUhSQUdGNkhWVE9JSEJSMktEVldQWkhNUlVKS1FPWVpSWUE2VjNDWTdBSkU2VVlCQTZOWUFGWUtDWVBOWDRISEhFT0tYVFg3QkFRVUczQlpRSVBJTzNGV1NWWFg0VjRWSUFQV1BIUFJTWUpTU1lPSllYQlI2UjZMQklFTzRNT0RPTzVRRDRUTSIsInVzZXJJZCI6ImFtem4xLmFzay5hY2NvdW50LkFHTVZRQ1hDNlhZV09SVTYyTU5HSVNDUjZFQ0hSVEhIU0JLTklEV0ZCUURLTDY2QVFESEVSTlZPQTJLNVZJMzJHNkhaTVlON0dZVkdTUldTVkZQUVdEQkNKMldWVUJYSjJBWTZGNVQzNzRVWUhIN1pGT09XSktQSlY2S1lTTk9NWFhJRFk1QzJLVUo0SUQ3R0hYRUxPSDIzQ0tONldIVkxRUkVPQ1FYQU5IRE9MREtMNzIyVUJJWlpGUEU0TUpBVTVTNVRDSEw1SEdPWk82WSJ9fQ.QAuP9lSUeLOUs6NPf7Y90CRR1eXnz-2_hnL3Lut6Dq9pPOrgKlCr_fUklwJlrA04XU7RdxTxxw7plpQ6HxzqLowxxn2ERH3ex1zMC24erXLym2XYalEOcWkBJNlJlL-S4a06Jk8hYRJaATK-VhKxRuiKyfvwE0Pkb2p91EnXayueEuSMCZ7ChpARabujzKJ-I_dw8UsTDaYbR1wrBbDwZbxRxFX7ieiN3rG9TiJM8EjydUJIWXBmzP-FMzhW4hk9b0CPQxLLyFspl5XqKGzI6xMMMHl-3yFliqawZFcoiWbHjkSeBuu7jHeHtAYbH5Zu5tyaL1fcuFWT1pMZJInfQQ"
      }
   },
   "request":{  
      "type":"LaunchRequest",
      "requestId":"amzn1.echo-api.request.90ad6d97-86bc-473b-ac50-31fd2d100c89",
      "timestamp":"2018-08-17T05:28:09Z",
      "locale":"en-US",
      "shouldLinkResultBeReturned":false
   }
}

输出Json:

{
   "body":{
      "version":"1.0",
      "response":{
         "outputSpeech":{
            "type":"SSML",
            "ssml":"Welcome to your personal Tableau assitent. How may i help you today?"
         },
         "card":{
            "type":"Simple",
            "title":"Tableau Insights!",
            "content":"Welcome to your personal Tableau assitent. How may i help you today?"
         },
         "reprompt":{
            "outputSpeech":{
               "type":"PlainText",
               "text":"How may i help you today?"
            }
         },
         "shouldEndSession":false
      },
      "sessionAttributes":{
         "speechOutput":"Welcome to your personal Tableau assitent. How may i help you today?",
         "repromptText":"How may i help you today?"
      }
   }
}

index.js 文件在这里。

当您使用 SSML 响应类型时,始终包含 <speak> 标记。

在您的 LaunchRequest 响应中,outputSpeech 类型设置为 SSML 并且您传递了纯文本。您应该将 SSML 响应包含在最低限度 <speak> ... </speak>

"outputSpeech":{
            "type":"SSML",
            "ssml":"<speak> Welcome to your personal Tableau assitent. How may i help you today? </speak>"
         },

有关 SSML 的更多信息 here

此外,请查看 ask-nodejs-sdk,它将处理这些事情,您可以进一步减少开发工作量。