- submitted to Amazon, currently under acceptance.
We are two great fans of the TV show Game of Thrones and often we speak about it, discussing on episodes and characters behavior. So the idea to develop an Alexa Skill, able to search and return information about houses, characters and episodes, has seemed immediately awesome for us.
To realize this idea we've developed and released an Alexa Skill called G.O.T. Fan.
In agreement with the mashup requirement of the contest we developed G.O.T. Fan using different kind of open APIs with the aim to expose a set of heterogeneous intents.
Skill behaviors- G.O.T. Fan is able to respond to different kind of questions, invoking different remote services exposed as RESTful API. All the used APIs does not require authentication and are free to use.
- G.O.T. Fan can provide deep information on the required character or house. In addition user can ask to know which is the last known position of a character and to achieve a random quote of the specified character. With respect to the episodes the skill is able to return title and synopsis of each past episode and to return the title and the date of the new episode.
- G.O.T. Fan has several intents to help users to invoke the skill correctly. For each remote call to the APIs exists a fallback to manage communication problems or unexpected data format with a funny message.
In addition to the voice output - for some of the exposed intents - G.O.T. Fan returns also a card with formatted data and multimedia contents (text+image).
Service LogicAll the business logic of the skill is in an AWS Lambda Function developed in JAVA™. The architecture of the JAVA artifact is pretty simple, thanks to the interfaces provided by Amazon. Introducing some design patterns, each intent has been arranged to contain all the code necessary to accomplish its aim in respect to the principle of separation of concerns. The structure of the whole resulting Lambda Function is shown in the following schema.
To create an AWS Lambda Function the first step is select the AWS Lambda service from the service list and then create a new Lambda function clicking on the button. Skipped the blueprint selection, to configure the new Lambda Function, we need to set the trigger type, selecting Alexa Skill Kit
Configured the trigger function, details have to be provided. In case of a JAVA based function code has to be uploaded whilst in the other cases the code can be pasted into the text-area. In advanced configuration, into the field handler put the fully qualified name of the class extending the SpeechletRequestStreamHandler.
Once function is created note down the ARN shown in the top right corner of the window because it will be associated to the Alexa Skill.
Alexa SkillOnce deployed the code, it's time to configure the custom skill. From the Amazon Developer Portal, click on the Alexa tab and then on the Alexa Skills kit. This will lead us to a list of your current configured skills. Click on Add a New Skill button.
The field Name can be anything but the Invocation Name has to follow the guidelines provided in the Alexa documentation. In our case, for example, the GoT acronym must contain single letters, each followed by a period and a space.
Finally, to associate this skill with its AWS Lambda function we have to specify the ARN of our deployed AWS function.
Following the specification provided into the Custom Skills section, on the Amazon Developer Portal, we designed the Voice Interface of G.O.T. Fan. The interaction model of the skill is made by different items: 1. Intent schema. 2. Custom slot types. 3. Sample utterances.
These three items enable Alexa to detect the intent required by the users and provide them the right response. The interaction model has been designed, developed and then configured into the developer portal as shown in the figure below.
To test out the skill, we use the Service Simulator in the Test section. Providing one of the configured utterances, this tool allows to test the request and response data sent and retrieved by Alexa.
Another way to make an end-to-end test is use echosim.io. EchoSim is a nice web application, where you can login with your account and start testing out the skills, but it doesn't work with all browsers.
Example phrasesThese are some kind of phrases useful to invoke the intents exposed by G.O.T. Fan.
- "Alexa, ask G.O.T. Fan what characters are available"
- "Alexa, ask G.O.T. Fan what houses are available"
- "Alexa, ask G.O.T. Fan to get information about Jon Snow"
- "Alexa, ask G.O.T. Fan to get a quote of Tyrion Lannister"
- "Alexa, ask G.O.T. Fan where is Daenerys Targaryen"
- "Alexa, ask G.O.T. Fan to get information about House Martell"
- "Alexa, ask G.O.T. Fan to get information on the episode one in the season one"
- "Alexa, ask G.O.T. Fan what's happened in the last episode"
- "Alexa, ask G.O.T. Fan when will the next episode be released"
Comments