diff --git a/samples/reddit/helloworld.py b/samples/reddit/helloworld.py new file mode 100644 index 0000000..fc8523f --- /dev/null +++ b/samples/reddit/helloworld.py @@ -0,0 +1,47 @@ +import logging +import os +from flask import Flask +from flask_ask import Ask, request, session, question, statement + + +app = Flask(__name__) +ask = Ask(app, "/") +logging.getLogger('flask_ask').setLevel(logging.DEBUG) + + +@ask.launch +def launch(): + speech_text = 'Welcome to the Alexa Skills Kit, you can say hello' + return question("how ya doin?") + + +@ask.intent('HelloWorldIntent') +def hello_world(): + return "Hello" + + +@ask.intent('YesIntent') +def share_headlines(): + return statement("the world is shit") + +@ask.intent('NoIntent') +def no(): + return statement("the world is shit") + +@ask.intent('AMAZON.HelpIntent') +def help(): + speech_text = 'You can say hello to me!' + return question(speech_text).reprompt(speech_text).simple_card('HelloWorld', speech_text) + + +@ask.session_ended +def session_ended(): + return "{}", 200 + + +if __name__ == '__main__': + if 'ASK_VERIFY_REQUESTS' in os.environ: + verify = str(os.environ.get('ASK_VERIFY_REQUESTS', '')).lower() + if verify == 'false': + app.config['ASK_VERIFY_REQUESTS'] = False + app.run(debug=True) diff --git a/samples/reddit/speech_assets/IntentSchema.json b/samples/reddit/speech_assets/IntentSchema.json new file mode 100644 index 0000000..37c2405 --- /dev/null +++ b/samples/reddit/speech_assets/IntentSchema.json @@ -0,0 +1,10 @@ +{ + "intents": [ + { + "intent": "HelloWorldIntent" + }, + { + "intent": "AMAZON.HelpIntent" + } + ] +} diff --git a/samples/reddit/speech_assets/SampleUtterances.txt b/samples/reddit/speech_assets/SampleUtterances.txt new file mode 100644 index 0000000..d9f178e --- /dev/null +++ b/samples/reddit/speech_assets/SampleUtterances.txt @@ -0,0 +1,7 @@ +HelloWorldIntent say hello +HelloWorldIntent say hello world +HelloWorldIntent hello +HelloWorldIntent say hi +HelloWorldIntent say hi world +HelloWorldIntent hi +HelloWorldIntent how are you