Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Skill: CatchAll Fallback asks to repeat phrase when no intent determined #1340

Open
auwsom opened this issue Jun 7, 2020 · 5 comments
Open

Comments

@auwsom
Copy link

auwsom commented Jun 7, 2020

Following the docs on Fallbacks here: https://mycroft-ai.gitbook.io/docs/skill-development/skill-types/fallback-skill, and the example here: https://github.com/forslund/fallback-meaning, and figuring out the correct syntax by trial and error here: MycroftAI/mycroft-core#2611, and adding the following lines of code (the second part replacing the Arthur Dent intent finding), the fallback now asks a follow up question 'What was that?' whenever an intent cannot be determined. (several variation on that vocab could be added to the self.speak_dialog('CatchAllFallback')

from mycroft.messagebus.message import Message
.....
    def handle_fallback(self, message):
        self.speak('what was that?')
        self.bus.emit(Message('recognizer_loop:wakeword', {"utterance": "homie"}))
        return True

I had started it in the fallback-unknown skill, but didnt want it to tell me to 'Please wait a moment as I finish booting up'.. which is coming from def make_intent_failure_handler in mycroft/skills/fallback_skill.py

@forslund , I'm actually debugging it right now.. I didnt realize the it is overriding other skills until I started working on another one. Any suggestion on how to catch just everything that isnt a skill intent? I thought that was what the fallbacks did, but your example uses several word verification steps.

@auwsom
Copy link
Author

auwsom commented Jun 7, 2020

Actually, just putting:

        self.speak('what was that?')
        self.bus.emit(Message('mycroft.mic.listen'))
        return True

in place of:
#self.speak_dialog('unknown')
in fallback-unknown seems to work..

@krisgesling
Copy link
Contributor

krisgesling commented Jun 8, 2020

Hey, we strongly encourage the use of dialog and vocab files rather than having the messages directly in the code. It is generally easier to read the code, and makes it translatable for those using Mycroft in other languages.

Did you have a dialog/en-us/unknown.dialog file for the above?

@auwsom
Copy link
Author

auwsom commented Jun 8, 2020

@krisgesling , yes, I see those there. In the back of my mind I figured they were for localization.

However, as skills scale up, starting complex drastically increases complexity. For example, I will be trying to create a skill that creates other skills. It will be much. much easier to accomplish that small feat with a simplified 'seed' skill, that references a single file holding json data for all intents, dialog, vocab, etc.. than trying to create and write to all those files.. localization could be done within that..

Step by step Im appreciating the complexity (and therefore power) of mycroft, but I always try to start dirt simple, because it has saved me from overcomplicating code many times. That said, I may have to come back to some of the builtin complexity of mycroft as I learn more functionality. ..until then though, Im hoping not.. ;)

..so I hope you can see the counterargument for not using all those various files.. and not trying to cause any rifts here, as were all on the same team! just explaining

@auwsom
Copy link
Author

auwsom commented Jun 8, 2020

Speaking of, I need to understand 'contexts' next, and/or how I can use some kind of fallback skill to catch all commands of a single context, without having the commands overlap intents, Open Chrome vs Open Homepage or Open file for example.

@krisgesling
Copy link
Contributor

Yeah totally understand starting simple and building up :)

For contexts, the docs need some love but here are some example skills to give you an idea:

However for the open examples, I'd probably use Adapt intents, each would require two keywords

  1. "open"
  2. [ application, webpage, file ]

I believe someone else took a similar approach and dynamically generated the 2nd keyword but I can't find it right now :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants