Flask-Rak is a Flask extension
that makes building Rogo applications for the Rogo Speaker easier and much more fun.
This project is heavily inspired and based on John Wheeler's Flask-ask for the Alexa Skills Kit.
A Flask-Rak application looks like:
from flask import Flask
from flask_rak import Rak, session, context, statement, audio
app = Flask(__name__)
rak = Rak(app, '/')
@ask.intent('HelloIntent')
def hello(firstname):
speech_text = "Hello %s" % firstname
return statement(speech_text)
if __name__ == '__main__':
app.run()
In the code above:
- The
Rak
object is created by passing in the Flask application and a route to forward Rogo speaker requests to. - The
intent
decorator mapsHelloIntent
to a view functionhello
. - The intent's
firstname
slot is implicitly mapped tohello
'sfirstname
parameter.
To install Flask-Rak
pip install flask-ask
To install from your local clone or fork of the project, run:
python setup.py install
update new pip package to https://pypi.org/
python setup.py sdist
twine upload dist/*