Alexa Skill在网站上工作,在设备上返回“出问题”

问题描述 投票:0回答:1

我是开发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上测试它时,它说“出了问题”。

我已经检查并启用了该技能,并且正在使用正确的帐户。 反正有没有更详细的了解正在发生的事情?

c# alexa alexa-skills-kit
1个回答
1
投票

问题是由于我为该技能指定的语言。 我在英国工作并且已经将语言发送到英语(美国),这意味着技能将在美国的技能商店(但不在英国技能商店)。

添加一种新语言(设置为英国英语)允许在我的英国设备上测试该技能。

© www.soinside.com 2019 - 2024. All rights reserved.