-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
40 lines (30 loc) · 1.43 KB
/
app.py
File metadata and controls
40 lines (30 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import os
from dotenv import load_dotenv
from flask import Flask
from flask_ask_sdk.skill_adapter import SkillAdapter
from ask_sdk_core.skill_builder import SkillBuilder
from intents.launch_request_handler import LaunchRequestHandler
from intents.help_intent_handler import HelpIntentHandler
from intents.cancel_or_stop_intent_handler import CancelOrStopIntentHandler
from intents.session_ended_request_handler import SessionEndedRequestHandler
from intents.catch_all_exception_handler import CatchAllExceptionHandler
from intents.first_order_intent_handler import FirstOrderIntentHandler
from intents.second_order_intent_handler import SecondOrderIntentHandler
from intents.third_order_intent_handler import ThirdOrderIntentHandler
load_dotenv()
sb = SkillBuilder()
sb.add_request_handler(LaunchRequestHandler())
sb.add_request_handler(CancelOrStopIntentHandler())
sb.add_request_handler(SessionEndedRequestHandler())
sb.add_request_handler(HelpIntentHandler())
sb.add_request_handler(FirstOrderIntentHandler())
sb.add_request_handler(SecondOrderIntentHandler())
sb.add_request_handler(ThirdOrderIntentHandler())
sb.add_exception_handler(CatchAllExceptionHandler())
app = Flask(__name__)
skill_response = SkillAdapter(skill = sb.create(),
skill_id = os.getenv('SKILL_ID'),
app = app)
skill_response.register(app = app, route = "/")
if __name__ == '__main__':
app.run(threaded = True)