#Podcast – NTN 78 – Hey Alexa 馃憢 , c贸mo funciona el mundo de desarrollo de tus Alexa Skills ? 馃ィ

Buy Me A Coffee

Buenas!

Que pasa cuando hablas con alguien que es un Alexa Champion? Pues que pasas un buen rato y aprendes mucho. Vicente ha publicado un libro en espa帽ol sobre este tema: “La Revoluci贸n de Alexa: Desarrollo de Alexa Skills” y claro, fue la excusa perfecta para hablar un rato sobre el desarrollo de skills para Alexa.

En la charla hablamos de muchos escenarios. Por ejemplo, como desarrollar apps, perd贸n skills, sin la necesidad de programar ni una l铆nea de c贸digo: y tambi茅n hablamos de escenarios m谩s complejos como h铆bridos entre Azure y Amazon. O inclusive sobre como monetizar los skills !

Happy Coding !

Speakers

  • Vicente Guzm谩n es Lead Project Manager en Deintec (LinkedIn)
  • Juan Carlos Quijano Abad es Microsoft Certified Trainer, Arquitecto de Soluciones en Azure, Consultor independiente en implantaci贸n de DevOps (LinkedIn)
  • Bruno Capuano es Canada Innovation Lead at Avanade and Microsoft AI MVP (LinkedIn)

Ir a descargar

Happy coding!

Greetings

El Bruno



驴Con ganas de ponerte al d铆a?

En Lemoncode te ofrecemos formaci贸n online impartida por profesionales que se baten el cobre en consultor铆a:

#Tutorial 鈥 How to build an #Amazon #AlexaSkill using Visual Studio 2017, C# and #Azure (5 on N)

Hi!

Now that I have written about how to use C # with Visual Studio 2017 to connect an Alexa Skill with an EndPoint in Azure, I think it’s time to share some contents which should be at the beginning of the series:

How to design and plan user interactions with Alexa

Of course, I will not write about it because the account of Alexa Developers has a great series of short videos about it. Here is the list of videos

How to Choose Projects for Voice – Amazon Alexa Voice Design Guide

Design for Voice in 3 Steps – Amazon Alexa Voice Design Guide

How to Understand Intents? – Amazon Alexa Voice Design Guide

How To Interact with Alexa – Amazon Alexa Voice Design Guide

And if we want something more for developers the next series of 6 episodes is what we should add to our list of videos

Developing Alexa Skills – Hello, Alexa! (Part 1 of 6)

 

Happy Coding!

Greetings @ Toronto

El Bruno

#Tutorial 鈥 Como crear un #Amazon #AlexaSkill con Visual Studio 2017, C# y #Azure (5 de N)

Buenas!

Ahora que ya he escritor sobre c贸mo utilizar C# con Visual Studio 2017 para conectar un Alexa Skill con un EndPoint en Azure, creo que es momento de escribir lo que deber铆a ser el 1er post:

Como se debe dise帽ar y planificar las interacciones de usuario con Alexa

Eso s铆, no voy a escribir al respecto ya que la cuenta de Alexa Developers tiene una serie grandiosa de videos cortos al respecto. He aqu铆 la lista

How to Choose Projects for Voice – Amazon Alexa Voice Design Guide

Design for Voice in 3 Steps – Amazon Alexa Voice Design Guide

How to Understand Intents? – Amazon Alexa Voice Design Guide

How To Interact with Alexa – Amazon Alexa Voice Design Guide

Y si queremos algo m谩s para developers la siguiente serie de 6 episodios es lo que debemos agregar a nuestra lista de

Developing Alexa Skills – Hello, Alexa! (Part 1 of 6)

 

Happy Coding!

Saludos @ Toronto

El Bruno

#Tutorial 鈥 How to build an #Amazon #AlexaSkill using Visual Studio 2017, C# and #Azure (4 de N)

Hi!

In the last post comment how to try a Skill using the traditional interface that is provided in the edition of an Alexa Skill. Well, another option that we have in Beta mode is [Test Simulator]

I1

This new interface allows us to make a couple of interesting actions. On the one hand, it allows us to enter the text with which we want to test our Skill in the same way that we would with an Amazon Echo device.

For example, if we would like [Help] to [Bruno Events] it will return the following results

I2

In this simulator we can listen to the same output that we will have in an Amazon Echo Device. The result for the Hololens Event question is similar

I3

And, finally we can try the Speech Recognition Features, since using the microphone of our computer, we can test our Skill directly with our voice.

I4

This allows us to try our Skill in the most natural way possible, even without having an Amazon Echo device.

Happy Coding!

Greetings @ Toronto

El Bruno

#Tutorial 鈥 Como crear un #Amazon #AlexaSkill con Visual Studio 2017, C# y #Azure (4 de N)

Buenas!

En el 煤ltimo post comente como probar un Skill utilizando la interfaz tradicional que se provee en la edici贸n de un Alexa Skill. Pues bien, otra opci贸n que tenemos en modo Beta es [Test Simulator]

I1

Esta nueva interfaz nos permite hacer un par de acciones interesantes. Por un lado, nos permite ingresar el texto con el que deseamos probar nuestra Skill de la misma manera que lo har铆amos con un dispositivo Amazon Echo.

Por ejemplo, si soliciatmos [Help] a [Bruno Events] el mismo nos retornara lo siguiente

I2

Lo interesante de este simulador es que podremos escuchar el mismo output que tendremos en el Amazon Echo Device. El resultado para la pregunta de eventos de Hololens es similar

I3

Y, finalmente podremos probar las Features de Speech Recognition, ya que utilizando el micr贸fono de nuestro ordenador, podremos probar nuestra Skill directamente con nuestra voz.

I4

Esto nos permite probar nuestro Skill de la forma m谩s natural posible, aun sin tener un Amazon Echo device.

Happy Coding!

Saludos @ Toronto

El Bruno

#Tutorial 鈥 How to build an #Amazon #AlexaSkill using Visual Studio 2017, C# and #Azure (3 on N)

Hi !

In the previous post describe the steps necessary to create a WebSite that interacts with an Alexa Skill. The next step is to publish the website in Azure. There are many tutorials on how to do this, so I will not write the necessary steps (see references)

In my case I published my Alexa Skill Website in the following url

http://alexaskillbrunoevents.azurewebsites.net/

I1

It is important to remember the URL since it is the one that we will use in the configuration of our Skill.

Now it’s time to go back to the Amazon Developer Portal and edit the Skill we created in the 1st post. In the section [Configuration] we must define the location of the interaction endpoint, which in this case is our Azure WebApp

I2

Important: By default the url we got from Azure is a HTTP site, we should change this to HTTPS to be used in Amazon Alexa Skill.

The other values 鈥嬧媔n this section are left with their default values 鈥嬧媋nd we go to the [SSL Certificate] section. In the case of Azure sites, they already have a certificate for safe navigation. We must select the 2nd option.

I3

And finally we get to the testing section [Test]. In it we can see, in JSON mode, the different messages that are sent from Alexa to our EndPoint. For example, if we invoke something simple like “help” we will have the following result

I4

{
"version": "1.0",
"response": {
"outputSpeech": {
"text": "Intent called AMAZON.HelpIntent.",
"type": "PlainText"
},
"speechletResponse": {
"outputSpeech": {
"text": "Intent called AMAZON.HelpIntent."
},
"shouldEndSession": true
}
},
"sessionAttributes": {
"intentSequence": "GetEventInformationIntent;GetEventInformationIntent;AMAZON.HelpIntent",
"EventTopic": "hololens"
}
}

If for example we invoke something more complicated than using Slots, we will see a different result. In this example, I ask Alexa for events about Hololens

I5

{
"version": "1.0",
"response": {
"outputSpeech": {
"text": "Intent called GetEventInformationIntent. Slots used: \r\nEventTopic – hololens , ",
"type": "PlainText"
},
"speechletResponse": {
"outputSpeech": {
"text": "Intent called GetEventInformationIntent. Slots used: \r\nEventTopic – hololens , "
},
"shouldEndSession": true
}
},
"sessionAttributes": {
"intentSequence": "GetEventInformationIntent;GetEventInformationIntent;AMAZON.HelpIntent;GetEventInformationIntent;GetEventInformationIntent;GetEventInformationIntent;AMAZON.HelpIntent;GetEventInformationIntent;GetEventInformationIntent",
"EventTopic": "hololens"
}
}

Well, this gives an idea about how to connect an Azure Api App to be the EndPoint of an Alexa Skill. In the following posts we will see more details on how to add extra functionality to the backend and how to use the new Alexa test environment.

Happy Coding!

Greetings @ Toronto

El Bruno

References

#Tutorial 鈥 Como crear un #Amazon #AlexaSkill con Visual Studio 2017, C# y #Azure (3 de N)

Buenas!

En el post anterior describir los pasos necesarios para crear un WebSite que interact煤e con un Alexa Skill. El siguiente paso es publicar el mismo en Azure. 聽Hay muchos tutoriales sobre como hacer esto, as铆 que no escribir茅 los pasos necesarios (ver referencias)

En mi caso he publicado el site en la siguiente url

http://alexaskillbrunoevents.azurewebsites.net/

I1

Es importante recordar la URL ya que es la que utilizaremos en la configuraci贸n de nuestro Skill.

Ahora es momento de abrir nuevamente el Amazon Developer Portal y editar el Skill que creamos en el 1er post. En la secci贸n [Configuration] debemos definir la ubicaci贸n del endpoint de interaccion, que en este caso es nuestro site de Azure

I2

Importante: Por defecto la publicaci贸n se realiza con http, debemos cambiar el mismo por https.

Los dem谩s valores de esta secci贸n los dejamos con sus valores por defecto y pasamos a la secci贸n [SSL Certificate]. En el caso de los sites en Azure, los mismos poseen ya un certificado para la navegaci贸n segura. Debemos seleccionar la 2da opci贸n.

I3

Y finalmente llegamos a la secci贸n de pruebas [Test]. En la misma podremos ver, en modo JSON, los diferentes mensajes que se env铆an desde Alexa a nuestro EndPoint. Por ejemplo, si invocamos algo simple como 鈥渉elp鈥 tendremos el siguiente resultado

I4

{
"version": "1.0",
"response": {
"outputSpeech": {
"text": "Intent called AMAZON.HelpIntent.",
"type": "PlainText"
},
"speechletResponse": {
"outputSpeech": {
"text": "Intent called AMAZON.HelpIntent."
},
"shouldEndSession": true
}
},
"sessionAttributes": {
"intentSequence": "GetEventInformationIntent;GetEventInformationIntent;AMAZON.HelpIntent",
"EventTopic": "hololens"
}
}

Si por ejemplo invocamos algo mas complicado que utilice Slots, veremos un resultado diferente. En este ejemplo, le pregunto a Alexa por eventos sobre Hololens

I5

{
"version": "1.0",
"response": {
"outputSpeech": {
"text": "Intent called GetEventInformationIntent. Slots used: \r\nEventTopic – hololens , ",
"type": "PlainText"
},
"speechletResponse": {
"outputSpeech": {
"text": "Intent called GetEventInformationIntent. Slots used: \r\nEventTopic – hololens , "
},
"shouldEndSession": true
}
},
"sessionAttributes": {
"intentSequence": "GetEventInformationIntent;GetEventInformationIntent;AMAZON.HelpIntent;GetEventInformationIntent;GetEventInformationIntent;GetEventInformationIntent;AMAZON.HelpIntent;GetEventInformationIntent;GetEventInformationIntent",
"EventTopic": "hololens"
}
}

Pues bien, esto da una idea sobre como conectar un Azure Api App para que sea el EndPoint de un Alexa Skill. En los siguientes posts veremos mas detalles sobre como agregar funcionalidad extra al backend y sobre c贸mo utilizar el nuevo entorno de pruebas de Alexa.

Happy Coding!

Saludos @ Toronto

El Bruno

References

#Tutorial 鈥 How to build an #Amazon #AlexaSkill using Visual Studio 2017, C# and #Azure (2 on N)

Hi!

Well, in today’s post we will see how to create an Azure API App, which we will then use as an Alexa Skill backend that we created in the previous post.

Tommy describes in an excellent way how to create a website and prepare him to work with Alexa Skill in this post (link). This project uses the NuGet Package Alexa Skills Kit.
Net for the processing of messages with Amazon Alexa.

I have created a template for Visual Studio 2017 that can be downloaded from here (link) and that allows us to create a project already configured to work with Alexa Skills.

Note: the quick way to import this template is to copy the file [WebApi Alexa Skill.
zip] to the Visual Studio 2017 project directory. Usually in [% \ Documents \ Visual Studio 2017 \ Templates \ ProjectTemplates \ Visual C #]

We create a new project using the imported type.

I1.jpg

We compiled the project to refresh the NuGet references, update the NuGet packages and we can start working.

i2.jpg

The 2 main elements in the project are

  • Controllers / AlexaController.cs. This is an standard ApiController wchi will handle the Alexa requests. It uses 2 HTTP requests
    • HTTP GET mostly for testing
    • HTTP POST process Alexa requests with the class [AlexaResponseAsync]
  • Alexa / AlexaResponseAsync.cs. All the business logic is here.

So, in the Alexa Response class we will add some basic changes

  • L铆nea 7, change the message used on the skill activation event
  • L铆neas 10 a 22, creates a message including the Intent name and the used slots.

Something similar to this

namespace AlexaSkillBrunoEvents.Alexa
{
public class AlexaSkillBrunoEvents : SpeechletAsync
{
public override Task<SpeechletResponse> OnLaunchAsync(LaunchRequest launchRequest, Session session)
{
return Task.FromResult(CompileResponse("Launch Event for Bruno Events"));
}
public async override Task<SpeechletResponse> OnIntentAsync(IntentRequest intentRequest, Session session)
{
var message = new StringBuilder();
message.Append($"Intent called {intentRequest.Intent}.");
if (intentRequest.Intent.Slots.Count > 0)
{
message.Append($" Slots used. ");
foreach (var intentSlot in intentRequest.Intent.Slots)
message.Append($"{intentSlot.Key} ");
}
var response = CompileResponse(message.ToString());
return await Task.FromResult(response);
}
public override Task OnSessionStartedAsync(SessionStartedRequest sessionStartedRequest, Session session)
{
return Task.FromResult(0);
}
public override Task OnSessionEndedAsync(SessionEndedRequest sessionEndedRequest, Session session)
{
return Task.FromResult(0);
}
public static SpeechletResponse CompileResponse(string output)
{
var response = new SpeechletResponse
{
OutputSpeech = new PlainTextOutputSpeech { Text = output },
ShouldEndSession = true
};
return response;
}
}
}

So far the creation of the web project. In the next post, we will see how to publish this website and connect it with the Alexa Skill.

Happy Coding!

Greetings @ Toronto

El Bruno

References

#Tutorial 鈥 Como crear un #Amazon #AlexaSkill con Visual Studio 2017, C# y #Azure (2 de N)

Buenas!

Pues bien, en el post de hoy veremos c贸mo crear un Azure API App, que luego utilizaremos como backend del Alexa Skill que hemos creado en el post anterior.

Tommy describe de una forma excelente como crear un website y prepararlo para trabajar con Alexa Skill en este post (link). Este proyecto utiliza el NuGet Package Alexa Skills Kit.Net para el procesado de los mensajes con Amazon Alexa.

Yo he creado una plantilla para Visual Studio 2017 que se puede descargar desde aqu铆 (link) y que nos permite crear un proyecto ya configurado para trabajar con Alexa Skills.

Nota: la forma r谩pida de importar esta plantilla es copiar el archivo [WebApi Alexa Skill.zip] al directorio de proyectos de Visual Studio 2017. Usualmente en [%\Documents\Visual Studio 2017\Templates\ProjectTemplates\Visual C#]

Creamos un nuevo proyecto del tipo importado.

I1.jpg

Compilamos el proyecto para refrescar las referencias de NuGet, actualizamos los NuGet packages y ya podemos comenzar a trabajar.

i2.jpg

Los 2 elementos principales a trabajar son

  • Controllers / AlexaController.cs. Un ApiController standard que es el encargado de procesar las peticiones desde Alexa. Tiene 2 puntos de entrada
    • HTTP GET utilizado para pruebas
    • HTTP POST procesa las peticiones de Alexa utilizando [AlexaResponseAsync]
  • Alexa / AlexaResponseAsync.cs. Esta clase es la encargada de procesar los eventos de Alexa.

Es en esta ultima clase donde aplicaremos la mayor铆a de los cambios. Por ejemplo

  • L铆nea 7, cambiamos el mensaje que se retorna cuando se activa el Skill
  • L铆neas 10 a 22, el mensaje que se retorna en cada Intent, retorna el nombre del Intent y si hay Slots, los slots utilizados en el mismo.

El c贸digo resultante es similar al siguiente

namespace AlexaSkillBrunoEvents.Alexa
{
public class AlexaSkillBrunoEvents : SpeechletAsync
{
public override Task<SpeechletResponse> OnLaunchAsync(LaunchRequest launchRequest, Session session)
{
return Task.FromResult(CompileResponse("Launch Event for Bruno Events"));
}
public async override Task<SpeechletResponse> OnIntentAsync(IntentRequest intentRequest, Session session)
{
var message = new StringBuilder();
message.Append($"Intent called {intentRequest.Intent}.");
if (intentRequest.Intent.Slots.Count > 0)
{
message.Append($" Slots used. ");
foreach (var intentSlot in intentRequest.Intent.Slots)
message.Append($"{intentSlot.Key} ");
}
var response = CompileResponse(message.ToString());
return await Task.FromResult(response);
}
public override Task OnSessionStartedAsync(SessionStartedRequest sessionStartedRequest, Session session)
{
return Task.FromResult(0);
}
public override Task OnSessionEndedAsync(SessionEndedRequest sessionEndedRequest, Session session)
{
return Task.FromResult(0);
}
public static SpeechletResponse CompileResponse(string output)
{
var response = new SpeechletResponse
{
OutputSpeech = new PlainTextOutputSpeech { Text = output },
ShouldEndSession = true
};
return response;
}
}
}

Hasta aqu铆 la creaci贸n del proyecto web. En el pr贸ximo post, veremos como publicar este website y conectarlo con la Alexa Skill.

Happy Coding!

Saludos @ Toronto

El Bruno

References

#Tutorial 鈥 How to build an #Amazon #AlexaSkill using Visual Studio 2017, C# and #Azure (1 de N)

Hi!

After a couple of weeks of events where Artificial Intelligence was one of the topics I talk and share the most, it’s time to write step by step on:

How to create an Alexa Skill for Amazon Echo and connect it with a WebSite in Azure

The people at Amazon are nicer than hot bread and give us all the tools to create these elements within the Amazon ecosystem. I’m rather a simple mind person, so I’ll do it with a mix between Amazon and Azure.

The first thing we must do is register in the Amazon Developer Portal.

I1

And enter the Amazon Alexa section to create our 1st Skill. Once we have our Developer account we can see the options of Alexa

  • Alexa Skills Kit
  • Alexa Voice Service

Select the 1st choice and then [Add a new Skill]

I2

The idea of 鈥嬧媡his tutorial is to learn how to create and connect a Skill with a service in Azure. If you want to understand more about how the Skills work, I recommend you check the references.

Well, the definition of a Skill consists of 7 sections. We begin with the information section of the Skill. In it we must define the type of Skill, which will be [Custom Interaction Model], the language, name and [Invocation name] of the Skill.

For this sample, the Skill that I will create will be one that allows to know a little information about the events that I have participated. So, [bruno events] looks like a good Invocation Name to use.

I3

We do not need our Skill to interact with the Audio Player or the Video viewer, so let’s leave the Global Fields unmodified.

The next step is to define our interaction language with the Skill. If you’re more of Microsoft’s world, this section is what we at Cognitive Services know as LUIS: Language Understanding Intelligent Service.

The definition of the Schema is defined in JSON format based on a definition that is hard to read and write (sorry I’m a visual dude!). Until recently, this was to edit text by hand. Fortunately,聽we can use a Skill Builder that presents a much friendlier interface for this task.

I4

Important: Here my advice is to see the 3 videos that are in the Skill Builder to understand how to use it.

In addition to the 3 Intents that are added in a Skill by default, we will create a new Intent called [GetEventInformationIntent]

I5

Before completing Intent information, I have decided to create a new Slot Type with the different themes that I deal with in my events. It will be called [EventTopic]

I6

These are the values 鈥嬧媡hat I will add to [EventTopic]. I will focus on the last 5 or 10 events and these topics will be enough to have a coherent search

I7

Now it’s time to go back to the Intent [GetEventInformationIntent] and add a couple of utterances. In this case, each of my sample utterances will use the Slot Type that we have created to make sense of the question we will ask Alexa

I8

Classic dev steps > Save Model & Build Model.

I9

And here comes this post, in the following posts we will see how to create a website in Azure and how to connect to it with this Skill.

Happy Coding!

Greetings @ Burlington

El Bruno