-
Notifications
You must be signed in to change notification settings - Fork 1
/
__init__.py
executable file
·33 lines (26 loc) · 1.23 KB
/
__init__.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
from adapt.intent import IntentBuilder
from mycroft.skills.core import MycroftSkill, intent_handler
from mycroft.util.log import getLogger
__author__ = 'Lucas Vogel'
LOGGER = getLogger(__name__)
class HelpMeSkill(MycroftSkill):
def get_user_response(self, dialog):
response = self.get_response(dialog)
return response
@intent_handler(IntentBuilder("").require("help.me"))
def handle_medical_emergency(self, message):# They said help me
#ask for body part
bodypart = self.get_user_response("which.part")
# They said the body part
specificypart = self.get_user_response("what.exactly")
#they specify the body part
painlevel = self.get_user_response("pain.level")
summary = "Okay, so in your " + bodypart + ", more specifically " + specificypart + ", you experience level " + painlevel + " pain."
self.speak(summary)
shouldcallambulance =self.get_user_response("serious")
if shouldcallambulance == "yes": # if the patient needs an ambulance
self.speak_dialog("calling.ambulance")
else: # if the patient does not want an ambulance
self.speak_dialog("not.calling.ambulance")
def create_skill():
return HelpMeSkill()