How can I match two skills from one utterance/sentence?


#1

I’m a little confused on how to combine two skills together. For example- I want one skill to succeed, but I want Mycroft to search the utterance again to see it matches another skill as well and answer the 2nd skill as well.

https://github.com/JarbasAl/skill-good-manners/blob/master/init.py

I was looking at this skill, but tbh the code is a little confusing and I couldn’t find much information regarding the message bus (perhaps, I’m not looking properly). Would anyone have a bit of an idea for this kinda problem? Thanks


#2

Hi there,

I’m wondering if you have any examples to show the behaviour you are trying to achieve? What would the user say, and then what are you wanting the two Mycroft skills to respond with?

There are a few ways to achieve this, some of which were outlined in the other thread, but it depends on what you are really aiming to do.


#3

Basically I just want to check one intent/sentence to match another skill, inside my own skill.


#4

Yes this makes sense but unfortunately is not yet possible, particularly in this broad context of “Any valid utterance and any other valid utterance”.

One challenge is being able to extract out multiple intents and the many possibilities that come with that. It seems simple at first - split the utterance on “and” then handle both halves as independent queries. However consider these examples:

  1. “Start a timer for 5 minutes and another for 20 minutes”
    In this case we need the context from one intent to properly parse the second half.

  2. “Play Piano and I by Alicia Keys”
    This time there is only one intent. Which shows that we need to check both the whole utterance as well as components.

These are just two quick examples off the top of my head but we need to look at what all of those edge cases might be. We’re also working to speed up Mycroft’s response times and checking multiple possible utterances simultaneously adds greater complexity to that.

How would you rate your programming experience, is it something you are keen to explore, or more looking for an existing solution? There might be others reading along interested in helping out?

If you’re not a programmer, thinking through what some of these challenging phrases might be is also extremely helpful for those who do have the coding skills.


#7

Like mentioned in another thread, would it be possible to send an utterance to message bus and then match it to all the intents?


#8

In that example we are essentially just issuing a new utterance to the messagebus, and Mycroft would treat that like a user had spoken it. This then goes through the normal intent handling process and will get actioned by whichever Skill has the highest match.

Unfortunately, the functionality that I think you are looking for would probably require a significant restructure of at least the intent handling process.

As an example, the Timer Skill doesn’t know what to do with “Play Alicia Keys on Spotify and start a time for 5 minutes”, so we would need to do some pre-processing of the utterance to realise that there are actually two intents there. We also don’t want 30 Skills to all fire up and try to respond to every utterance as it will consume significant system resources and be extremely slow.

This is functionality that we are looking at for the future, however not a priority for the team at the moment.