Porting the Hello World Skill
This article explains, step-by-step, how the Classic Core Hello World Skill can be ported to the Mark II running Dinkum.
- 1.
- 2.
- 3.Go to the skills directory and make a new directory for your new Skill.
cd /opt/mycroft-dinkum/skillsmkdir hello.mark2
- 4.Next to the Dinkum repo, clone the Skill repo.
cd /optsudo git clone https://github.com/MycroftAI/skill-hello-world.git
- 5.Copy the files from the Skill repo into the new Skill directory.
cp -r skill-hello-world/* mycroft-dinkum/skills/hello.mark2/
from mycroft import MycroftSkill, intent_handler
to:
from mycroft.skills import MycroftSkill, intent_handler
Replace responses such as
self.speak_dialog("welcome")
with:
return self.end_session(dialog=dialog, gui=gui)
For example:
# self.speak_dialog("hello.world")
dialog = "hello.world"
gui = None
return self.end_session(dialog=dialog, gui=gui)
def create_skill():
return HelloWorldSkill()
becomes:
def create_skill(skill_id: str):
return HelloWorldSkill(skill_id=skill_id)
def __init__(self, skill_id: str):
""" 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__(skill_id=skill_id, name="HelloSkill")
self.learning = True
To
/opt/mycroft-dinkum/services/enclosure/service/skills.json add: { "name": "Hello World Skill", "skill_gid": "hello.mark2" },
To
/etc/systemd/system/dinkum-skills.service add:--skill /opt/mycroft-dinkum/skills/hello.mark2
sudo systemctl daemon-reload
sudo systemctl restart dinkum-skills.service
“Hey Mycroft, how are you?”
Last modified 2mo ago