Skip to content

Commit

Permalink
bus api interface
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Sep 21, 2023
1 parent 19ad4c6 commit c78717f
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions ovos_workshop/skills/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1556,34 +1556,10 @@ def _validate_intent_name(self, intent_parser: Union[IntentBuilder, Intent], han
raise ValueError(f'The intent name {name} is already taken')
return name

def _register_adapt_intent_classic(self,
intent_parser: Union[IntentBuilder, Intent, str],
handler: callable):
"""
< ovos-core 0.0.8 munging happened skill side,
since 0.0.8 pipeline plugins are skill_id aware out of the box
any needed munging happens plugin side
"""
name = self._validate_intent_name(intent_parser, handler)

# old mycroft needs things munged before registering
munge_intent_parser(intent_parser, name, self.skill_id)
self.intent_service.register_adapt_intent(name, intent_parser)
if handler:
self.add_event(intent_parser.name, handler, 'mycroft.skill.handler')

@backwards_compat(classic_core=_register_adapt_intent_classic,
pre_008=_register_adapt_intent_classic)
def _register_adapt_intent(self,
intent_parser: Union[IntentBuilder, Intent, str],
handler: callable):
"""
< ovos-core 0.0.8 munging happened skill side,
since 0.0.8 pipeline plugins are skill_id aware out of the box
any needed munging happens plugin side
"""
name = self._validate_intent_name(intent_parser, handler)

intent = self.intent_service.register_keyword_intent(name=name,
required=intent_parser.requires,
at_least_one=intent_parser.at_least_one,
Expand Down Expand Up @@ -1751,8 +1727,6 @@ def set_context(self, context: str, word: str = '', origin: str = ''):
raise ValueError('Context should be a string')
if not isinstance(word, str):
raise ValueError('Word should be a string')

context = self._alphanumeric_skill_id + context
self.intent_service.set_context(context, word, origin)

def remove_context(self, context: str):
Expand All @@ -1761,7 +1735,7 @@ def remove_context(self, context: str):
"""
if not isinstance(context, str):
raise ValueError('context should be a string')
context = self._alphanumeric_skill_id + context

self.intent_service.remove_context(context)

def handle_set_cross_context(self, message: Message):
Expand Down

0 comments on commit c78717f

Please sign in to comment.