【发布时间】:2018-01-17 09:06:53
【问题描述】:
我是开发 Alexa 技能的新手,但我创建了一个非常简单的技能,它是用 C# 编写并托管在 Azure 中的。目前它只是返回一条 JSON 消息。
public class AlexaController : ApiController
{
[HttpPost, Route("api/alexa/demo")]
public dynamic Pluralsight(dynamic request)
{
string version;
version = "5";
return new
{
version = "1.0",
sessionAttributes = new { },
response = new
{
outputSpeech = new
{
type = "PlainText",
text = $"Finance build is version, {version}"
},
card = new
{
type = "Simple",
title = "TeamCity",
content = "Version identifier"
},
shouldEndSession = true
}
};
}
我的话是:
HelloWorldIntent hello
HelloWorldIntent hi
AMAZON.HelpIntent assistance needed please
AMAZON.HelpIntent i need assistance
意图架构是:
{
"intents": [
{
"intent": "HelloWorldIntent"
},
{
"intent": "AMAZON.HelpIntent"
}
]
}
在网站上测试时效果很好:
{
"version": "1.0",
"response": {
"outputSpeech": {
"text": "Finance build is version, 5",
"type": "PlainText"
},
"card": {
"content": "Version identifier",
"title": "TeamCity"
},
"speechletResponse": {
"outputSpeech": {
"text": "Finance build is version, 5"
},
"card": {
"content": "Version identifier",
"title": "TeamCity"
},
"shouldEndSession": true
}
},
"sessionAttributes": {}
}
但是,当我在 Echo Dot 上对其进行测试时,它显示“出了点问题”。
我已检查并且该技能已启用并且它正在使用正确的帐户。
是否有更多关于正在发生的事情的详细信息?
【问题讨论】:
-
看看cloudwatch捕获异常
-
我对 cloudwatch 没有任何经验,但我会看看。几乎就像没有启用该技能(但它是)并且 Alexa 没有(或不能)调用 Azure Web api。
标签: c# alexa alexa-skills-kit