"You know, like nunchuck skills, bow hunting skills, computer hacking skills.
Girls only like guys who have great skills."
While the Amazon provided Alexa Skills Kit (ASK) for Java gets the job done, it isn't the easiest API with which to develop. As a throwback to Servlet-style programming, it makes developing and testing your skill more difficult than it needs to be.
Skillz builds on top of the ASK but gives you an annotation-based invocation model that will seem very familiar if you have worked with JAX-WS, JAX-RS, or other modern Java service frameworks. You get to annotate methods on your POJO classes, and Skillz will parse the input coming from Alexa and invoke your methods. Then you can format your results using a more abstracted "View" layer to create SpeechletResponses.
You use Skillz by annotating your POJO. Like this:
@Skill(path="/searchMyStuffSkill")
public class SearchForThings {
@Intent("Search")
@Utterances({
"search for {aurora coffee|query}",
"find {aurora coffee|query}",
"give me {aurora coffee|query}"
})
@ResponseFormatter(SearchFormatter.class)
public List<String> search(
@Slot(name="query", type=AmazonSlotTypes.LITERAL) String query) {
// Do your stuff!
return results;
}
}
Skillz is available from JCenter!
dependencies {
compile 'net.kebernet.skillz:api:+'
}
<dependency>
<groupId>net.kebernet.skillz</groupId>
<artifactId>api</artifactId>
<version>LATEST</version>
</dependency>
In addition to the API project, there is a Dropwizard Bundle available to help you get started even faster!
Copyright © 2016 Robert Cooper
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0