Skip to content

Commit

Permalink
feat:persona pipeline (#648)
Browse files Browse the repository at this point in the history
* feat:persona pipeline

* feat:persona pipeline

* fix

* .

* .
  • Loading branch information
JarbasAl authored Jan 31, 2025
1 parent 96d4fa1 commit 4c729a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
16 changes: 10 additions & 6 deletions ovos_core/intent_services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from ovos_utils.log import LOG, log_deprecation, deprecated
from ovos_utils.metrics import Stopwatch
from padacioso.opm import PadaciosoPipeline as PadaciosoService
from ovos_persona import PersonaService
import warnings


Expand Down Expand Up @@ -113,6 +114,7 @@ def _load_pipeline_plugins(self):
self._common_qa = CommonQAService(self.bus, self.config.get("common_query"))
self._stop = StopService(self.bus)
self._ocp = OCPPipelineMatcher(self.bus, config=self.config.get("OCP", {}))
self._persona = PersonaService(self.bus, config=self.config.get("persona", {}))

def update_skill_name_dict(self, message):
"""Messagebus handler, updates dict of id to skill name conversions."""
Expand Down Expand Up @@ -203,7 +205,9 @@ def get_pipeline(self, skips=None, session=None) -> Tuple[str, Callable]:
"adapt_medium": self._adapt_service.match_medium,
"fallback_medium": self._fallback.medium_prio,
"adapt_low": self._adapt_service.match_low,
"fallback_low": self._fallback.low_prio
"fallback_low": self._fallback.low_prio,
"ovos-persona-pipeline-plugin-high": self._persona.match_high,
"ovos-persona-pipeline-plugin-low": self._persona.match_low
}
if self._padacioso_service is not None:
matchers.update({
Expand Down Expand Up @@ -270,28 +274,28 @@ def _handle_deactivate(self, message):
def _emit_match_message(self, match: Union[IntentHandlerMatch, PipelineMatch], message: Message, lang: str):
"""
Emit a reply message for a matched intent, updating session and skill activation.
This method processes matched intents from either a pipeline matcher or an intent handler,
creating a reply message with matched intent details and managing skill activation.
Args:
match (Union[IntentHandlerMatch, PipelineMatch]): The matched intent object containing
utterance and matching information.
message (Message): The original messagebus message that triggered the intent match.
lang (str): The language of the pipeline plugin match
Details:
- Handles two types of matches: PipelineMatch and IntentHandlerMatch
- Creates a reply message with matched intent data
- Activates the corresponding skill if not previously deactivated
- Updates session information
- Emits the reply message on the messagebus
Side Effects:
- Modifies session state
- Emits a messagebus event
- Can trigger skill activation events
Returns:
None
"""
Expand Down
1 change: 1 addition & 0 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ padacioso>=1.0.0, <2.0.0
ovos-adapt-parser>=1.0.5, <2.0.0
ovos_ocp_pipeline_plugin>=1.0.10, <2.0.0
ovos-common-query-pipeline-plugin>=1.0.5, <2.0.0
ovos-persona>=0.4.4,<1.0.0

ovos-utils[extras]>=0.6.0,<1.0.0
ovos_bus_client>=0.1.4,<2.0.0
Expand Down

0 comments on commit 4c729a8

Please sign in to comment.