3 ms·
"Amazon Alexa skills JS API...There isn’t really any alternative right now..." I want to take this opportunity to plug an Alexa Skills Kit API (in Python) I ju
by johnwheeler 10y ago
"Amazon Alexa skills JS API...There isn’t really any alternative right now..."
I want to take this opportunity to plug an Alexa Skills Kit API (in Python) I just dropped:
https://github.com/johnwheeler/flask-ask https://github.com/johnwheeler/flask-ask
It does a lot of things the JS API doesn't: Jinja templates, decorator-based intent routing, slot defaults/conversions, and request signature verification to name a few.
- dozzie 10y agoOK, you have written an API. When can be expected that you publish a code for a service that implements this API?
- johnwheeler 10y agoHi dozzie! Please check out the samples directory for client code: https://github.com/johnwheeler/flask-ask/tree/master/samples https://github.com/johnwheeler/flask-ask/tree/master/samples These are direct ports from the Java samples: https://github.com/amzn/alexa-skills-kit-java/tree/master/samples/src/main/java https://github.com/amzn/alexa-skills-kit-java/tree/master/sa...
- jamornh 10y agoI was just looking for something like this, and as of yesterday I only found this project: https://github.com/anjishnu/ask-alexa-pykit https://github.com/anjishnu/ask-alexa-pykit Yours look much simpler to get started, would you care to comment on what the differences are between yours and the project I just posted?
- johnwheeler 10y agoYes! I just put mine up a month ago - not discoverable for "Python Alexa" or any keywords. Working on it :-) So for the differences - Alexa Skills are deployable as AWS Lambda functions or behind HTTPS. Currently, ask-alexa-pykit works on Lambda and Flask-Ask implements the signature verification required for HTTPS deployments. (i.e. Flask-Ask works on your own HTTPS server or Lambda). Another difference is in the intent mapping design. Flask-Ask is based on the same architectural patterns of Flask with context locals, parameter mapping / conversion, and of course, Jinja templates! For example, Mapping an intent with ask-alexa-pykit looks like this: http://pastebin.com/raw/hQJLKnHL http://pastebin.com/raw/hQJLKnHL Flask-Ask is like this: http://pastebin.com/raw/9fWrGNYY http://pastebin.com/raw/9fWrGNYY Flask-Ask also converts slots like firstname from the example above into arbitrary datatypes, and has stock conversions for AMAZON.DURATION (e.g. 'P2YT3H10M' into a Python datetime.timedelta). Full parameter mapping docs here: https://johnwheeler.org/flask-ask/requests.html#mapping-intent-slots-to-view-function-parameters https://johnwheeler.org/flask-ask/requests.html#mapping-inte... Flask-Ask templates are grouped together in the same files since utterances are typically small phrases--to make them easier to manage. Templates are of course an optional feature but are encouraged! It's still very early, but I'm working my butt off, full-time on it! I have a 5-min tutorial that shows how to get up and running with Flask-Ask and ngrok: https://www.youtube.com/watch?v=eC2zi4WIFX0 https://www.youtube.com/watch?v=eC2zi4WIFX0 - The API has changed a little, if you try it out and have any questions, you can do an issue or hit me up! john at ! johnwheeler.org Thank you!
- edraferi 10y agoThat video was great! Just started thinking about Alexa, this looks like an easy way to get moving with it.
- johnwheeler 10y agoThank you!
- jamornh 10y agoThanks for the detailed reply! I've been interested in the echo and wanted to get into it for a while so I'll definitely dig into flask-ask and try to get up and running with it.