Alexa未能回应

时间:2018-08-17 05:34:03

标签: aws-lambda alexa alexa-skills-kit alexa-skill alexa-voice-service

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

alexa skill

其响应类似于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文件在这里。

1 个答案:

答案 0 :(得分:1)

使用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,它将处理这些事情,您可以进一步减少开发工作。