Provide specific groups of vocab that can be said anywhere in a sentence.
__init__.py
:
from mycroft import MycroftSkill, intent_handler, AdaptIntent # AdaptIntent == IntentBuilder
class HelloSkill(MycroftSkill):
@intent_handler(AdaptIntent().require('Hello').require('Person'))
def handle_hello(self, message):
self.speak('Hello, ' + message.data['Person'])
vocab/en-us/Hello.voc
:
Hi
Hello
vocab/en-us/Person.voc
:
Bob
Joe
Sue
test/intent/hello.intent.json
:
{
"utterance": "Hi Joe",
"intent_type": "handle_hello",
"intent": {
"Hello": "Hi",
"Person": "Joe"
}
}
Describe a list of example utterances with possible extracted entities.
__init__.py
:
from mycroft import MycroftSkill, intent_file_handler
class HelloSkill(MycroftSkill):
def initialize(self):
self.register_entity_file('person.entity')
@intent_file_handler('hello.intent')
def handle_hello(self, message):
self.speak('Hello, ' + message.data['person'])
vocab/en-us/hello.intent
:
Hi {person}
Hello {person}
vocab/en-us/person.entity
:
Bob
Joe
Sue
test/intent/hello.intent.json
:
{
"utterance": "Hi Joe",
"intent_type": "hello.intent",
"intent": {
"person": "Joe"
}
}
Apologies, I'm just getting to this on my list now. Really appreciate you putting this together. These are some great examples of how Adapt and Padatious work, however I'd also like to provide some guidance on scenarios where it makes more sense to use Adapt over Padatious or vice-versa. My guess is that you would use Adapt where your Intent has some very specific phrasing, and you have a clear list of entities, but it makes more sense to use Padatious where the Intent might be a little "fuzzy" or where more slang / informal language would be used. What do you think?