[Previous: Setup Development Environment] [Next: Test Natural Language]
Now, once the development environment is set up, we can create a Genie skill.
We have provided example skills for your reference. To load the examples, run the following command:
./load-examples.sh
This command will load all officially enabled skills in Genie assistant. Check Thingpedia for a full list of these skills. Note that all IoT devices are supported via Home Assistant, they do not work in this skill developing environment yet. Once loaded, the example skills will be added to workdir
. You can use them as a reference when developing your skill.
If you only want to play with existing skills, you can skip the following steps and directly go to the deploy step.
If you are interested in creating your own skill, we encourage you to start with a skill with a public web service that requires no authentication or only needs an API key. You can find a collective list of public APIs from toddmotto/public-apis.
First, initialize the project by running
./init.sh --skill_name $YOUR_SKILL_NAME
If
init.sh
produces error
./lib.sh: line 31: declare: -g: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
then your bash probably needs to be updated. The default bash on MacOS does not supportdeclare -g
. See https://itnext.io/upgrading-bash-on-macos-7138bd1066ba for instructions on using homebrew to update bash.
This will add your skill to the workdir
in your Genie SDK directory. The skill directory contains pre-populated package.json
, manifest.tt
, and index.js
files. See detailed skill package layout here. You can find more skill examples in the thingpedia-common-devices repository.
The skill name is a string that uniquely identifies the skill. A reverse domain name notation is required. E.g., the name of the Yelp skill is com.yelp
if the service is provided by yelp.com
.
You can also add an icon for your skill, which will be used by Genie as the avatar for your skill responses to users' requests. Simply put your icon under the skill directory with the name icon.png
. A 512x512 PNG image is recommended.
Note that, if you have loaded example skills, when you synthesize data and train models in the following steps, those skills will also be included. If you wish to build an agent with only the skill you create, remove devices
and workdir
folders created first before you run init.sh
.
A skill must include a skill manifest written in ThingTalk, i.e., manifest.tt
. The skill manifest specifies:
We have written a ThingTalk syntax highlighting plugin for VS Code.
Check Skill Manifest Guide for more details.
[Previous: Setup Development Environment] [Next: Test Natural Language Support]