C# AWS上托管的Alexa.NET-Outputspeech返回空白
我正在尝试创造一种技能,可以从谷歌表格中读取数据,并从我的每月预算中获得一些价值。我以前做过技能,已经有一段时间了-我在AWS Lambda上创建了一个新函数,但我无法在OutputSpeech中显示任何内容。我已经将代码回滚到使用GitHub的示例代码时,仍然没有得到响应C# AWS上托管的Alexa.NET-Outputspeech返回空白,c#,.net,alexa,alexa-skills-kit,C#,.net,Alexa,Alexa Skills Kit,我正在尝试创造一种技能,可以从谷歌表格中读取数据,并从我的每月预算中获得一些价值。我以前做过技能,已经有一段时间了-我在AWS Lambda上创建了一个新函数,但我无法在OutputSpeech中显示任何内容。我已经将代码回滚到使用GitHub的示例代码时,仍然没有得到响应 public SkillResponse FunctionHandler(SkillResponse input, ILambdaContext context) {
public SkillResponse FunctionHandler(SkillResponse input, ILambdaContext context)
{
var speech = new SsmlOutputSpeech();
speech.Ssml = "<speak>Today is <say-as interpret-as=\"date\">????0922</say-as>.</speak>";
// create the reprompt speech
var repromptMessage = new PlainTextOutputSpeech();
repromptMessage.Text = "Would you like to know what tomorrow is?";
// create the reprompt object
var repromptBody = new Reprompt();
repromptBody.OutputSpeech = repromptMessage;
// create the response
var responseBody = new ResponseBody();
responseBody.OutputSpeech = speech;
responseBody.ShouldEndSession = false; // this triggers the reprompt
responseBody.Reprompt = repromptBody;
responseBody.Card = new SimpleCard { Title = "Test", Content = "Testing Alexa" };
var skillResponse = new SkillResponse();
skillResponse.Response = responseBody;
skillResponse.Version = "1.0";
return skillResponse;
Alexa开发者控制台上的响应:
"request": {
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.9a4f617b-5548-4e5c-a8f0-3c1853c5ad64",
"timestamp": "2020-11-15T23:44:57Z",
"locale": "en-US",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "SpeechletResponse was null"
}
}
我在Visual Studio 2019中使用以下软件包:
- Alexa.Net
- Amazon.Lambda.Core
- Amazon.Lambda.Serialization.SystemTextJson
"request": {
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.9a4f617b-5548-4e5c-a8f0-3c1853c5ad64",
"timestamp": "2020-11-15T23:44:57Z",
"locale": "en-US",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "SpeechletResponse was null"
}
}