Skip to content

alicedotnet/yandex.alice.sdk

Repository files navigation

Yandex.Alice.SDK

.Net SDK for development of Yandex Alice skills using C# language.

test NuGet

It supports the following skill types:

Installation

Install NuGet package with SDK:

Install-Package Yandex.Alice.Sdk

General skills

This repository has a demo project written on ASP.NET Core Web Api, which demonstrates the usage of SDK.

Demo project skill was published in the Alice catalog:

alice

In general, you would need to create a controller with the POST action method which receives an object of AliceRequest class as a parameter.

The method can return one of three response types according to Alice's protocol:

  • AliceResponse - without images
  • AliceImageResponse - with one image
  • AliceGalleryResponse - with a gallery of several images

A simple example of the implementation of functionality is described above:

using Microsoft.AspNetCore.Mvc;
using Yandex.Alice.Sdk.Models;

[ApiController]
[Route("[controller]")]
public class AliceController : ControllerBase
{
    [HttpPost]
    [Route("/alice")]
    public IActionResult Get(AliceRequest aliceRequest)
    {
        return Ok(new AliceResponse(aliceRequest, "Hello"));
    }
}

More info you can find in the wiki

Smart home skills

For Smart home skills in addition to the server that receives requests from Alice, you would need an additional OAuth server. In this smart home demo project, both servers were combined in one for simplicity. This wiki page has a guide that you can use to quickly create a skill and test library.

Contributing

Please check out the Contributing guide for guidelines about how to start.