Jarbas Guidelines for skill development - Building Intents and basic language support

Just made a new blog post with some guidelines on skill making, i plan on making a series of these regarding some aspects and nuances of skill design

https://jarbasai.github.io//posts/2017/10/skill_guidelines_1/

This focus on providing basic language support and correctly building intents

1 Like

Good stuff jarbas! Thanks for the post.

Hi @Jarbas_Ai,
thank you for the post. I have a question about the multi language: it is not clear for me if adding the translated files in the relative directories is enough and automatically managed, so the correct files are loaded according to the language set in the conf file, or, the correct files should be loaded by code (I saw this skill)?
In your example when you check for the supported languages, you have a static list, in that case if a new language is added is required a change in the code.
Sorry, but I have not a clear vision about.
Thank you.

jarbasai, this was a great read and gave me some ideas for my first skill.
I do have a question about using Padatious. In the tomato example a {type} is utilized. Do you know if it is possible to pass the {type} value when using a speak_dialog? I love the padatious approach and think passing the {type} to the speak_dialog would be great in customizing the responses. Cheers!

when loading skills mycroft checks the configured language, it will check the skill folder for this language and automatically load the vocab and dialog for the current language

let’s use the example of the jokes skill, it does not use dialog files, in this case it only speaks english jokes so other languages are not supported, with skills of this kind you can safely shut them down since they will not be used correctly or triggered at all, this applies mainly to skills that generate speech at runtime, an in these cases it does need changes to the code to support more languages, which may or not be trivial depending on skill

for skills that use only .voc / . dialog / .intent files just adding the correct language directories is enough to provide support to other languages

1 Like

in a skill when handling the intent you can get the “type” by

type = message.data.get("type")

same can be done for any Keyword from adapt used in registering intent, useful for .optional() keywords in particular

for speaking dialog files it has nothing to do with padatious, but you can pass any words you wish at runtime

file.dialog

i love { thing }

in code

self.speak_dialog("file", {"thing": "pizza"})

thank you. Clear now.