Intents
- to triggers actions. One of the most frequently used keywords is play
. This means that several Skills can all use the word play
in their Intents
- causing something called an intent collision - where Mycroft doesn't know which Skill to invoke because there are so many to choose from.Intent
which uses the play
keyword. The confidence score is designed so that there is a much higher probability of the right Skill being invoked to handle an Intent
which has the keyword play
in it.CommonPlaySkill
class instead of MycroftSkill
CommonPlaySkill
class instead of the normal MycroftSkill
. Your Skill also needs to implement two methods, CPS_match_query_phrase
and CPS_start
.phrase
is sent from the PlaybackControlSkill
, and is the entire phrase said by the user with the play
keyword stripped out. So if the user says"Play something by Professor Elemental"
phrase
argument will contain"something by Professor Elemental"
CPSMatchLevel
enum type.CPSMatchLevel.EXACT
(The input matches exact)CPSMatchLevel.MULTI_KEY
(The input contains multiple matches such as Artist and Album title)CPSMatchLevel.TITLE
(The phrase contains a matching title)CPSMatchLevel.ARTIST
(The phrase contains a matching artist)CPSMatchLevel.CATEGORY
(The phrase contains a category supported by the skill, Rock, bitpop, Podcast etc.)CPSMatchLevel.GENERIC
(Generic match, maybe contains the skill title but no media match)CPSMatchLevel.EXACT
is the greatest confidence and the CPSMatchLevel.GENERIC
is lowest.CPS_start()
method as an argument.CPS_start
simply starts the playback using the data and/or the phrase to determine what to play.self.audioservice
object can be used to start playback or queue up tracks.CommonPlaySkill
match_one
function in mycroft.util.parse
can be used to fuzzy match one of the elements in the dict.CPS_match_query_phrase
method to use it to select the best match. This fuzzy matching system will match strings that are close to one of the keys in the above dict
. This means phrases like "play crazy comet" will be matched with a fairly high confidence despite not being the exact string in the dictionary.CPS_start
method.