diff --git a/ovos_core/intent_services/__init__.py b/ovos_core/intent_services/__init__.py index f8afb4ec8af2..42146554ec24 100644 --- a/ovos_core/intent_services/__init__.py +++ b/ovos_core/intent_services/__init__.py @@ -222,7 +222,7 @@ def disambiguate_lang(message): return default_lang - def get_pipeline(self, skip_converse=False, skip_fallback=False): + def get_pipeline(self, skips=None): """return a list of matcher functions ordered by priority utterances will be sent to each matcher in order until one can handle the utterance the list can be configured in mycroft.conf under intents.pipeline, @@ -252,11 +252,8 @@ def get_pipeline(self, skip_converse=False, skip_fallback=False): "padacioso_low": self.padacioso_service.match_low, "fallback_low": self.fallback.low_prio } + matchers = {k: v for k, v in matchers.items() if k not in skips} pipeline = list(self.pipeline) - if skip_converse and "converse" in pipeline: - pipeline.remove("converse") - if skip_fallback: - pipeline = [p for p in pipeline if not p.startswith("fallback_")] return [matchers[k] for k in pipeline] def handle_utterance(self, message): @@ -441,7 +438,10 @@ def handle_get_intent(self, message): lang = get_message_lang(message) # Loop through the matching functions until a match is found. - for match_func in self.get_pipeline(skip_converse=True, skip_fallback=True): + for match_func in self.get_pipeline(skips=["converse", + "fallback_high", + "fallback_medium", + "fallback_low"]): match = match_func([utterance], lang, message) if match: if match.intent_type: