Skip to content

Commit

Permalink
Merge pull request #567 from OpenVoiceOS/release-0.2.3a1
Browse files Browse the repository at this point in the history
Release 0.2.3a1
  • Loading branch information
JarbasAl authored Oct 15, 2024
2 parents 69433c5 + c61369d commit 8147381
Show file tree
Hide file tree
Showing 71 changed files with 98 additions and 2,858 deletions.
14 changes: 11 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# Changelog

## [0.2.1a1](https://github.com/OpenVoiceOS/ovos-core/tree/0.2.1a1) (2024-10-15)
## [0.2.3a1](https://github.com/OpenVoiceOS/ovos-core/tree/0.2.3a1) (2024-10-15)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-core/compare/0.2.0...0.2.1a1)
[Full Changelog](https://github.com/OpenVoiceOS/ovos-core/compare/0.2.2a1...0.2.3a1)

**Merged pull requests:**

- requirements:latest stable packages [\#563](https://github.com/OpenVoiceOS/ovos-core/pull/563) ([JarbasAl](https://github.com/JarbasAl))
- fix:log\_spam [\#566](https://github.com/OpenVoiceOS/ovos-core/pull/566) ([JarbasAl](https://github.com/JarbasAl))

## [0.2.2a1](https://github.com/OpenVoiceOS/ovos-core/tree/0.2.2a1) (2024-10-15)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-core/compare/0.2.1...0.2.2a1)

**Merged pull requests:**

- deprecate ready setting [\#554](https://github.com/OpenVoiceOS/ovos-core/pull/554) ([JarbasAl](https://github.com/JarbasAl))



Expand Down
104 changes: 53 additions & 51 deletions ovos_core/intent_services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
#
from typing import Tuple, Callable

from ocp_pipeline.opm import OCPPipelineMatcher
from ovos_adapt.opm import AdaptPipeline as AdaptService
from ovos_bus_client.message import Message
from ovos_bus_client.session import SessionManager
from ovos_bus_client.util import get_message_lang
from ovos_workshop.intents import open_intent_envelope

from ocp_pipeline.opm import OCPPipelineMatcher
from ovos_adapt.opm import AdaptPipeline as AdaptService
from ovos_commonqa.opm import CommonQAService
from ovos_config.config import Configuration
from ovos_config.locale import setup_locale, get_valid_languages, get_full_lang_code
Expand All @@ -29,7 +31,6 @@
from ovos_plugin_manager.templates.pipeline import IntentMatch
from ovos_utils.log import LOG, deprecated, log_deprecation
from ovos_utils.metrics import Stopwatch
from ovos_workshop.intents import open_intent_envelope
from padacioso.opm import PadaciosoPipeline as PadaciosoService


Expand Down Expand Up @@ -89,99 +90,100 @@ def __init__(self, bus, config=None):
self.bus.on('intent.service.padatious.entities.manifest.get', self.handle_entity_manifest)

@property
@deprecated("direct access to self.adapt_service is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
def adapt_service(self):
log_deprecation("direct access to self.adapt_service is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
return self._adapt_service

@property
@deprecated("direct access to self.padatious_service is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
def padatious_service(self):
log_deprecation("direct access to self.padatious_service is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
return self._padatious_service

@property
@deprecated("direct access to self.padacioso_service is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
def padacioso_service(self):
log_deprecation("direct access to self.padacioso_service is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
return self._padacioso_service

@property
@deprecated("direct access to self.fallback is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
def fallback(self):

log_deprecation("direct access to self.fallback is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
return self._fallback

@property
@deprecated("direct access to self.converse is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
def converse(self):
log_deprecation("direct access to self.converse is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
return self._converse

@property
@deprecated("direct access to self.common_qa is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
def common_qa(self):
log_deprecation("direct access to self.common_qa is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
return self._common_qa

@property
@deprecated("direct access to self.stop is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
def stop(self):
log_deprecation("direct access to self.stop is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
return self._stop

@property
@deprecated("direct access to self.ocp is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
def ocp(self):
log_deprecation("direct access to self.ocp is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
return self._ocp

@adapt_service.setter
@deprecated("direct access to self.adapt_service is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
def adapt_service(self, value):
log_deprecation("direct access to self.adapt_service is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
self._adapt_service = value

@padatious_service.setter
@deprecated("direct access to self.padatious_service is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
def padatious_service(self, value):
log_deprecation("direct access to self.padatious_service is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
self._padatious_service = value

@padacioso_service.setter
@deprecated("direct access to self.padacioso_service is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
def padacioso_service(self, value):
log_deprecation("direct access to self.padacioso_service is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
self._padacioso_service = value

@fallback.setter
@deprecated("direct access to self.fallback is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
def fallback(self, value):
log_deprecation("direct access to self.fallback is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
self._fallback = value

@converse.setter
@deprecated("direct access to self.converse is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
def converse(self, value):
log_deprecation("direct access to self.converse is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
self._converse = value

@common_qa.setter
@deprecated("direct access to self.common_qa is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
def common_qa(self, value):
log_deprecation("direct access to self.common_qa is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
self._common_qa = value

@stop.setter
@deprecated("direct access to self.stop is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
def stop(self, value):
log_deprecation("direct access to self.stop is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
self._stop = value

@ocp.setter
@deprecated("direct access to self.ocp is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
def ocp(self, value):
log_deprecation("direct access to self.ocp is deprecated, "
"pipelines are in the progress of being replaced with plugins", "1.0.0")
self._ocp = value

def _load_pipeline_plugins(self):
Expand Down Expand Up @@ -209,7 +211,7 @@ def _load_pipeline_plugins(self):
def registered_intents(self):
lang = get_message_lang()
return [parser.__dict__
for parser in self.adapt_service.engines[lang].intent_parsers]
for parser in self._adapt_service.engines[lang].intent_parsers]

def update_skill_name_dict(self, message):
"""Messagebus handler, updates dict of id to skill name conversions."""
Expand Down Expand Up @@ -454,7 +456,7 @@ def handle_utterance(self, message: Message):
# tag language of this utterance
lang = self.disambiguate_lang(message)

try:
try: # TODO - uncouple lingua franca from core, up to skills to ensure locale is loaded if needed
setup_locale(lang)
except Exception as e:
LOG.exception(f"Failed to set lingua_franca default lang to {lang}")
Expand Down Expand Up @@ -524,7 +526,7 @@ def handle_register_vocab(self, message):
regex_str = message.data.get('regex')
alias_of = message.data.get('alias_of')
lang = get_message_lang(message)
self.adapt_service.register_vocabulary(entity_value, entity_type,
self._adapt_service.register_vocabulary(entity_value, entity_type,
alias_of, regex_str, lang)
self.registered_vocab.append(message.data)

Expand All @@ -535,7 +537,7 @@ def handle_register_intent(self, message):
message (Message): message containing intent info
"""
intent = open_intent_envelope(message)
self.adapt_service.register_intent(intent)
self._adapt_service.register_intent(intent)

def handle_detach_intent(self, message):
"""Remover adapt intent.
Expand All @@ -544,7 +546,7 @@ def handle_detach_intent(self, message):
message (Message): message containing intent info
"""
intent_name = message.data.get('intent_name')
self.adapt_service.detach_intent(intent_name)
self._adapt_service.detach_intent(intent_name)

def handle_detach_skill(self, message):
"""Remove all intents registered for a specific skill.
Expand All @@ -553,7 +555,7 @@ def handle_detach_skill(self, message):
message (Message): message containing intent info
"""
skill_id = message.data.get('skill_id')
self.adapt_service.detach_skill(skill_id)
self._adapt_service.detach_skill(skill_id)

def handle_add_context(self, message):
"""Add context
Expand Down Expand Up @@ -652,7 +654,7 @@ def handle_get_adapt(self, message: Message):
"""
utterance = message.data["utterance"]
lang = get_message_lang(message)
intent = self.adapt_service.match_intent((utterance,), lang, message.serialize())
intent = self._adapt_service.match_intent((utterance,), lang, message.serialize())
intent_data = intent.intent_data if intent else None
self.bus.emit(message.reply("intent.service.adapt.reply",
{"intent": intent_data}))
Expand Down Expand Up @@ -714,15 +716,15 @@ def handle_entity_manifest(self, message):
def shutdown(self):
self.utterance_plugins.shutdown()
self.metadata_plugins.shutdown()
self.adapt_service.shutdown()
self.padacioso_service.shutdown()
if self.padatious_service:
self.padatious_service.shutdown()
self.common_qa.shutdown()
self.converse.shutdown()
self.fallback.shutdown()
if self.ocp:
self.ocp.shutdown()
self._adapt_service.shutdown()
self._padacioso_service.shutdown()
if self._padatious_service:
self._padatious_service.shutdown()
self._common_qa.shutdown()
self._converse.shutdown()
self._fallback.shutdown()
if self._ocp:
self._ocp.shutdown()

self.bus.remove('register_vocab', self.handle_register_vocab)
self.bus.remove('register_intent', self.handle_register_intent)
Expand Down
Loading

0 comments on commit 8147381

Please sign in to comment.