Skip to content

Instantly share code, notes, and snippets.

View kinisoftware's full-sized avatar

Joaquin Engelmo Moriche kinisoftware

View GitHub Profile
@kinisoftware
kinisoftware / pom.xml
Last active February 1, 2019 14:20
Post - dependencies for skill backend
<dependencies>
<dependency>
<groupId>com.amazon.alexa</groupId>
<artifactId>ask-sdk</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-log4j2</artifactId>
<version>1.0.0</version>
public class UpcomingMoviesStreamHandler extends SkillStreamHandler {
public static final String CARD_TITLE = "Estrenos de cine";
public UpcomingMoviesStreamHandler() {
super(getSkill());
}
private static Skill getSkill() {
return Skills.standard()
public class CancelAndStopIntentHandler implements RequestHandler {
@Override
public boolean canHandle(HandlerInput input) {
return input.matches(intentName("AMAZON.StopIntent").or(intentName("AMAZON.CancelIntent")));
}
@Override
public Optional<Response> handle(HandlerInput input) {
String text = "Gracias por usar Estrenos de cine";
{
"version": "1.0",
"session": {
"new": true,
"sessionId": "",
"application": {
"applicationId": ""
},
"user": {
"userId": ""
{
"body": {
"version": "1.0",
"response": {
"outputSpeech": {
"type": "SSML",
"ssml": "<speak>Bienvenido a Estrenos de Cine! Pregúntame por los estrenos de cine de esta semana</speak>"
},
"card": {
"type": "Simple",
"request": {
"type": "IntentRequest",
"requestId": "",
"timestamp": "2019-02-23T19:05:38Z",
"locale": "es-ES",
"intent": {
"name": "AMAZON.HelpIntent",
"confirmationStatus": "NONE"
}
}
public class NewReleasesIntentHandler implements RequestHandler {
...
@Override
public Optional<Response> handle(HandlerInput input) {
Request request = input.getRequestEnvelope().getRequest();
IntentRequest intentRequest = (IntentRequest) request;
Intent intent = intentRequest.getIntent();
Map<String, Slot> slots = intent.getSlots();
Slot releasesDate = slots.get("releasesDate");
public class NewReleasesIntentHandler implements RequestHandler {
...
@Override
public Optional<Response> handle(HandlerInput input) {
...
// Collect the slot from the request
...
String text = null;
String reprompText = null;
{
"interactionModel": {
"languageModel": {
"invocationName": "estrenos de cine",
"intents": [
...
{
"name": "NewReleasesIntent",
"slots": [
{
class LogRequestInterceptor : RequestInterceptor {
override fun process(input: HandlerInput) {
println("Request: ${JacksonSerializer().serialize(input.request)}")
}
}