0
votes

I'm trying to find a way to make an alexa skill speak(response) when it receives an external non-vocal event. The application receives an event that occurs on amazon-sqs inside a queue. The lambda application is connected and triggers the event that happened through the function:

def lambda_handler(event, context)

At this point I would like the skill alexa to answer me by telling me that the event has occurred. To do this I should create a Json input to send to the skill, I can record the data of event ['session'] when i'll start the skill but how can I pass the data of event ['request'] to launch an intent?

For example this is the json input when i lunch a request by the alexa simulator:

{
    "version": "1.0",
    "session": {
        ...
    },
    "context": {
        "...
    },
    "request": {
        ...
    }
}

I can recreate the session dictionary by saving the data on a dynamodb table, but for the context and request?

Maybe my approch is completely mistaken. How can i do?

2

2 Answers

1
votes

Take a look at:https://developer.amazon.com/docs/smapi/proactive-events-api.html. This is the supported way to do proactive speech and may be sufficient for you

0
votes

this sounds interesting, I am wondering how are you going to keep the Skill opened or you are trying to get the Skill opened as soon as the event happens?

I understand that once the event happens you need to launch the Skill and then in the LaunchRequest you do the speak(response). The tricky part here is launching/initiating/opening the Skill.

Also you can try with Request and Response Interceptors to catch the whole request and responde.

I will dig a bit if this is possible to do.

Thanks :D