from adapt.intent import IntentBuilder
from mycroft import MycroftSkill, intent_handler
from ovos_utils.process_utils import RuntimeRequirements
from ovos_utils import classproperty
class HelloWorldSkill(MycroftSkill):
def __init__(self):
""" The __init__ method is called when the Skill is first constructed.
It is often used to declare variables or perform setup actions, however
it cannot utilise MycroftSkill methods as the class does not yet exist.
"""
super().__init__()
self.learning = True
@classproperty
def runtime_requirements(self):
return RuntimeRequirements(internet_before_load=False,
network_before_load=False,
gui_before_load=False,
requires_internet=False,
requires_network=False,
requires_gui=False,
no_internet_fallback=True,
no_network_fallback=True,
no_gui_fallback=True)
def initialize(self):
""" Perform any final setup needed for the skill here.
This function is invoked after the skill is fully constructed and
registered with the system. Intents will be registered and Skill
settings will be available."""
my_setting = self.settings.get('my_setting')
@intent_handler(IntentBuilder('ThankYouIntent').require('ThankYouKeyword'))
def handle_thank_you_intent(self, message):
""" This is an Adapt intent handler, it is triggered by a keyword."""
self.speak_dialog("welcome")
@intent_handler('HowAreYou.intent')
def handle_how_are_you_intent(self, message):
""" This is a Padatious intent handler.
It is triggered using a list of sample phrases."""
self.speak_dialog("how.are.you")
@intent_handler(IntentBuilder('HelloWorldIntent')
.require('HelloWorldKeyword'))
def handle_hello_world_intent(self, message):
""" Skills can log useful information. These will appear in the CLI and
the skills.log file."""
self.log.info("There are five types of log messages: "
"info, debug, warning, error, and exception.")
self.speak_dialog("hello.world")
def stop(self):
pass
def create_skill():
return HelloWorldSkill()