From 1743d4bbad450c92a2f9f31a0e291b5a98669706 Mon Sep 17 00:00:00 2001 From: miro Date: Sat, 20 Jul 2024 19:52:05 +0100 Subject: [PATCH] update imports and entrypoint --- ovos_core/intent_services/__init__.py | 14 ++++++++------ ovos_core/intent_services/padacioso_service.py | 1 + setup.py | 10 ++++++++++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ovos_core/intent_services/__init__.py b/ovos_core/intent_services/__init__.py index 51da1f6a8425..39dbb62b8fc6 100644 --- a/ovos_core/intent_services/__init__.py +++ b/ovos_core/intent_services/__init__.py @@ -14,6 +14,7 @@ # from typing import Tuple, Callable +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 @@ -22,20 +23,19 @@ 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 -from ovos_core.intent_services.adapt_service import AdaptService from ovos_core.intent_services.commonqa_service import CommonQAService from ovos_core.intent_services.converse_service import ConverseService from ovos_core.intent_services.fallback_service import FallbackService from ovos_core.intent_services.ocp_service import OCPPipelineMatcher -from ovos_core.intent_services.padacioso_service import PadaciosoService from ovos_core.intent_services.stop_service import StopService from ovos_core.transformers import MetadataTransformersService, UtteranceTransformersService from ovos_plugin_manager.templates.pipeline import IntentMatch class IntentService: - """Mycroft intent service. parses utterances using a variety of systems. + """OVOS intent service. parses utterances using a variety of systems. The intent service also provides the internal API for registering and querying the intent service. @@ -57,7 +57,7 @@ def __init__(self, bus, config=None): if self.config["padatious"].get("disabled"): LOG.info("padatious forcefully disabled in config") else: - from ovos_core.intent_services.padatious_service import PadatiousService + from ovos_padatious.opm import PadatiousPipeline as PadatiousService self.padatious_service = PadatiousService(bus, self.config["padatious"]) except ImportError: LOG.error(f'Failed to create padatious intent handlers, padatious not installed') @@ -370,10 +370,12 @@ def handle_utterance(self, message: Message): if match: LOG.info(f"{pipeline} match: {match}") if match.skill_id and match.skill_id in sess.blacklisted_skills: - LOG.debug(f"ignoring match, skill_id '{match.skill_id}' blacklisted by Session '{sess.session_id}'") + LOG.debug( + f"ignoring match, skill_id '{match.skill_id}' blacklisted by Session '{sess.session_id}'") continue if match.intent_type and match.intent_type in sess.blacklisted_intents: - LOG.debug(f"ignoring match, intent '{match.intent_type}' blacklisted by Session '{sess.session_id}'") + LOG.debug( + f"ignoring match, intent '{match.intent_type}' blacklisted by Session '{sess.session_id}'") continue try: self._emit_match_message(match, message) diff --git a/ovos_core/intent_services/padacioso_service.py b/ovos_core/intent_services/padacioso_service.py index 0fa243b7d2b2..8caf454e346f 100644 --- a/ovos_core/intent_services/padacioso_service.py +++ b/ovos_core/intent_services/padacioso_service.py @@ -1,2 +1,3 @@ # backwards compat imports from padacioso.opm import PadaciosoPipeline as PadaciosoService, PadaciosoIntent +from padacioso import IntentContainer as FallbackIntentContainer diff --git a/setup.py b/setup.py index cecb0a706429..183bdefb5331 100644 --- a/setup.py +++ b/setup.py @@ -57,6 +57,15 @@ def required(requirements_file): with open("README.md", "r") as f: long_description = f.read() +PLUGIN_ENTRY_POINT = [ + 'ovos-converse-pipeline-plugin=ovos_core.intent_services.converse_service:ConverseService', + 'ovos-fallback-pipeline-plugin=ovos_core.intent_services.fallback_service:FallbackService', + 'ovos-ocp-pipeline-plugin=ovos_core.intent_services.ocp_service:OCPPipelineMatcher', + 'ovos-stop-pipeline-plugin=ovos_core.intent_services.stop_service:StopService', + 'ovos-common-query-pipeline-plugin=ovos_core.intent_services.commonqa_service:CommonQAService' +] + + setup( name='ovos-core', version=get_version(), @@ -84,6 +93,7 @@ def required(requirements_file): "License :: OSI Approved :: Apache Software License", ], entry_points={ + 'opm.pipeline': PLUGIN_ENTRY_POINT, 'console_scripts': [ 'ovos-core=ovos_core.__main__:main', # TODO - remove below console_scripts in 0.1.0 (backwards compat)