-
Notifications
You must be signed in to change notification settings - Fork 9
/
alexahelpers.py
47 lines (41 loc) · 1.08 KB
/
alexahelpers.py
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
41
42
43
44
45
46
47
"""
Alexa skill helpers
(c) 2018 Balloon Inc. VOF
Wouter Devriendt
"""
# --------------- Helpers that build all of the responses ----------------------
def build_speechlet_response(title, output, reprompt_text, should_end_session):
return {
'outputSpeech': {
'type': 'PlainText',
'text': output
},
'card': {
'type': 'Simple',
'title': "Jenkins - " + title,
'content': output
},
'reprompt': {
'outputSpeech': {
'type': 'PlainText',
'text': reprompt_text
}
},
'shouldEndSession': should_end_session
}
def build_speechlet_directive():
return {
"outputSpeech" : None,
"card" : None,
"directives" : [ {
"type" : "Dialog.Delegate"
} ],
"reprompt" : None,
"shouldEndSession" : False
}
def build_response(session_attributes, speechlet_response):
return {
'version': '1.0',
'sessionAttributes': session_attributes,
'response': speechlet_response
}