Skip to content

Commit

Permalink
update imports and entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Jul 20, 2024
1 parent fe4f186 commit 1743d4b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ovos_core/intent_services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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')
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions ovos_core/intent_services/padacioso_service.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# backwards compat imports
from padacioso.opm import PadaciosoPipeline as PadaciosoService, PadaciosoIntent
from padacioso import IntentContainer as FallbackIntentContainer
10 changes: 10 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1743d4b

Please sign in to comment.