diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..e69de29 diff --git a/ngrok.exe b/ngrok.exe new file mode 100644 index 0000000..0ec6adb Binary files /dev/null and b/ngrok.exe differ diff --git a/samples/reddit/helloworld.py b/samples/reddit/main.py similarity index 79% rename from samples/reddit/helloworld.py rename to samples/reddit/main.py index acdf1f1..1cb6e8f 100644 --- a/samples/reddit/helloworld.py +++ b/samples/reddit/main.py @@ -12,11 +12,11 @@ logging.getLogger('flask_ask').setLevel(logging.DEBUG) @ask.launch def launch(): - return question("This will take about 5 minutes. Are you Ready?") + return question("Each excercise will take about 5 minutes. Are you Ready?") def get_workoutplan(): - with open("workouts.yaml", 'r') as stream: + with open("C:/Users/John/Desktop/GST/samples/reddit/workouts.yaml", 'r') as stream: exercises = yaml.load(stream) exercise_names = random.sample(list(exercises), 5) workout_plan = [] @@ -26,14 +26,17 @@ def get_workoutplan(): return workout_plan -@ask.intent('YesIntent') -def start_workout(): +@ask.intent('YesIntent', mapping={'part': 'Part'}) +def start_workout(part): + print(part) workout_plan = get_workoutplan() - response = "" + response = "Do " + for excercise in workout_plan[:-1]: response += excercise + ", " response += " and " + workout_plan[-1] - return statement(workout_plan) + print(response) + return statement(response) @ask.intent('NoIntent') def no(): @@ -44,6 +47,7 @@ def help(): speech_text = 'If you want a quick workout just say "workout"' return statement(speech_text) + @ask.session_ended def session_ended(): return "{}", 200 @@ -54,4 +58,4 @@ if __name__ == '__main__': verify = str(os.environ.get('ASK_VERIFY_REQUESTS', '')).lower() if verify == 'false': app.config['ASK_VERIFY_REQUESTS'] = False - app.run(debug=True) + app.run() diff --git a/samples/reddit/speech_assets/IntentSchema.json b/samples/reddit/speech_assets/IntentSchema.json index 37c2405..bd9db8d 100644 --- a/samples/reddit/speech_assets/IntentSchema.json +++ b/samples/reddit/speech_assets/IntentSchema.json @@ -1,10 +1,50 @@ + { - "intents": [ - { - "intent": "HelloWorldIntent" - }, - { - "intent": "AMAZON.HelpIntent" - } - ] -} + "interactionModel": { + "languageModel": { + "invocationName": "give me a workout", + "intents": [ + { + "name": "AMAZON.CancelIntent", + "samples": [] + }, + { + "name": "AMAZON.HelpIntent", + "samples": [] + }, + { + "name": "AMAZON.StopIntent", + "samples": [] + }, + { + "name": "YesIntent", + "slots": [], + "samples": [ + "yes" + ] + }, + { + "name": "NoIntent", + "slots": [], + "samples": [ + "no" + ] + }, + { + "name": "HelloWorldIntent", + "slots": [], + "samples": [ + "let's workout", + "give me todays workout", + "what's todays workout" + ] + }, + { + "name": "AMAZON.NavigateHomeIntent", + "samples": [] + } + ], + "types": [] + } + } +} \ No newline at end of file diff --git a/samples/reddit/speech_assets/customSlotTypes/NAME_OF_BODY_PARTS b/samples/reddit/speech_assets/customSlotTypes/NAME_OF_BODY_PARTS new file mode 100644 index 0000000..451682c --- /dev/null +++ b/samples/reddit/speech_assets/customSlotTypes/NAME_OF_BODY_PARTS @@ -0,0 +1,4 @@ +Chest +Legs +Torso +Upper body