通过实施Web服务将自定义技能托管到Alexa [英] Hosting a custom skill to Alexa by implementing a web service

查看:111
本文介绍了通过实施Web服务将自定义技能托管到Alexa的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Web服务,该Web服务用于处理Alexa发送的请求,并在.net框架中进行特定的响应. Alexa发送的请求正文以JSON格式发送到您的服务,如下所示:

I am working on developing a web service which is used to Handling Requests Sent by Alexa and respond back with specific response in .net framework. The request body sent by Alexa to your service in JSON format like below :

{
  "version": "string",
  "session": {
    "new": true,
    "sessionId": "string",
    "application": {
      "applicationId": "string"
    },
    "attributes": {
      "string": {}
    },
    "user": {
      "userId": "string",
      "accessToken": "string"
    }
  },
  "context": {
    "System": {
      "application": {
        "applicationId": "string"
      },
      "user": {
        "userId": "string",
        "accessToken": "string"
      },
      "device": {
        "supportedInterfaces": {
          "AudioPlayer": {}
        }
      }
    },
    "AudioPlayer": {
      "token": "string",
      "offsetInMilliseconds": 0,
      "playerActivity": "string"
    }
  },
  "request": {}
}

下面的Json格式的

响应正文语法:

and Response Body Syntax in Json format below:

{
  "version": "string",
  "sessionAttributes": {
    "string": object
  },
  "response": {
    "outputSpeech": {
      "type": "string",
      "text": "string",
      "ssml": "string"
    },
    "card": {
      "type": "string",
      "title": "string",
      "content": "string",
      "text": "string",
      "image": {
        "smallImageUrl": "string",
        "largeImageUrl": "string"
      }
    },
    "reprompt": {
      "outputSpeech": {
        "type": "string",
        "text": "string",
        "ssml": "string"
      }
    },
    "directives": [
      {
        "type": "string",
        "playBehavior": "string",
        "audioItem": {
          "stream": {
            "token": "string",
            "url": "string",
            "offsetInMilliseconds": 0
          }
        }
      }
    ],
    "shouldEndSession": boolean
  }
}

我在Amazon开发者论坛

I researched on Amazon Developer Forum Hosting a Custom Skill as a Web Service , Handling Requests Sent by Alexabut i am not able to achieve this thing and one thing i am not using Lambda function i want to make a custom skill and my location is not in North US.

我得到了自由者.来自github 此处,并用于我的Web服务,但无法与该库同步,此处有人先给我一个方向,我该怎么做,或者我如何开始感谢.

I got the Lib. from github here and used in my web service but not able to sync with this library, anyone here to give me a direction how can i do this or how can i started thanks in advance.

推荐答案

我刚刚发布了一个项目,该项目使用您提到的相同AlexaSkillsKit.NET程序包.目标是帮助每个人都可以使用.NET + Visual Studio创建Alexa自定义技能,您可以轻松地将其部署到Azure.

I've just published a project that uses the same AlexaSkillsKit.NET package that you mention. The goal is to help everyone create Alexa Custom Skills using .NET + Visual Studio that you can easily deploy to Azure.

https://github.com/tamhinsf/Azure4Alexa

有一个示例技能实现,您可以将其用作自己的自定义技能的模式.它利用了httpClient和通常的异步模式.

There's a sample skill implementation that you can use as a pattern for your own Custom Skill. It makes use of httpClient and the usual async patterns.

只需下载并启动Visual Studio即可开始使用!

Just download and fire up Visual Studio to get started!

这篇关于通过实施Web服务将自定义技能托管到Alexa的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆