Skip to content

Commit

Permalink
enable ocp with utils 0.0.38 compat (#491)
Browse files Browse the repository at this point in the history
* enable ocp with utils 0.0.38 compat

* the great uglification

* unittests with utils 0.0.38
  • Loading branch information
JarbasAl committed Jun 2, 2024
1 parent acb9d00 commit 5bd3530
Show file tree
Hide file tree
Showing 9 changed files with 452 additions and 68 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ jobs:
sudo apt install libfann-dev
pip install .[lgpl]
pytest --cov-append --cov=ovos_core --cov-report xml test/unittests/skills
- name: Generate coverage report with utils 0.0.38
run: |
pip install ovos-utils==0.0.38
pytest --cov-append --cov=ovos_core --cov-report xml test/end2end
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ jobs:
- name: Run unittests with padatious
run: |
pytest --cov-append --cov=ovos_core --cov-report xml test/unittests/skills
- name: Run unittests with utils 0.0.38
run: |
pip install ovos-utils==0.0.38
pytest --cov-append --cov=ovos_core --cov-report xml test/end2end
- name: Upload coverage
if: "${{ matrix.python-version == '3.9' }}"
env:
Expand Down
15 changes: 2 additions & 13 deletions ovos_core/intent_services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from ovos_core.intent_services.fallback_service import FallbackService
from ovos_core.intent_services.padacioso_service import PadaciosoService
from ovos_core.intent_services.stop_service import StopService
from ovos_core.intent_services.ocp_service import OCPPipelineMatcher
from ovos_core.transformers import MetadataTransformersService, UtteranceTransformersService
from ovos_utils.log import LOG, deprecated, log_deprecation
from ovos_utils.metrics import Stopwatch
Expand Down Expand Up @@ -74,12 +75,10 @@ def __init__(self, bus, config=None):
self.converse = ConverseService(bus)
self.common_qa = CommonQAService(bus)
self.stop = StopService(bus)
self.ocp = None
self.ocp = OCPPipelineMatcher(self.bus, config=self.config.get("OCP", {}))
self.utterance_plugins = UtteranceTransformersService(bus)
self.metadata_plugins = MetadataTransformersService(bus)

self._load_ocp_pipeline() # TODO - enable by default once stable

# connection SessionManager to the bus,
# this will sync default session across all components
SessionManager.connect_to_bus(self.bus)
Expand Down Expand Up @@ -108,16 +107,6 @@ def __init__(self, bus, config=None):
self.bus.on('intent.service.padatious.manifest.get', self.handle_padatious_manifest)
self.bus.on('intent.service.padatious.entities.manifest.get', self.handle_entity_manifest)

def _load_ocp_pipeline(self):
"""EXPERIMENTAL: this feature is not yet ready for end users"""
if self.config.get("experimental_ocp_pipeline", False):
LOG.warning("EXPERIMENTAL: the OCP pipeline is enabled!")
try:
from ovos_core.intent_services.ocp_service import OCPPipelineMatcher
self.ocp = OCPPipelineMatcher(self.bus, config=self.config.get("OCP", {}))
except ImportError:
LOG.error("OCPPipelineMatcher unavailable, please install ovos-utils >= 0.1.0")

@property
def registered_intents(self):
lang = get_message_lang()
Expand Down
Loading

0 comments on commit 5bd3530

Please sign in to comment.