From 7c5ab50702dc30c01529c310f1bfa194468398cd Mon Sep 17 00:00:00 2001 From: miro Date: Fri, 31 Jan 2025 02:45:49 +0000 Subject: [PATCH 1/5] feat:persona pipeline --- ovos_core/intent_services/__init__.py | 16 ++++++++++------ requirements/requirements.txt | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ovos_core/intent_services/__init__.py b/ovos_core/intent_services/__init__.py index 92e8060694a..7ae4dc9bd36 100644 --- a/ovos_core/intent_services/__init__.py +++ b/ovos_core/intent_services/__init__.py @@ -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 @@ -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.""" @@ -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, + "persona_high": self._persona.match_high, + "persona_low": self._persona.match_low } if self._padacioso_service is not None: matchers.update({ @@ -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 """ diff --git a/requirements/requirements.txt b/requirements/requirements.txt index f2170d3750d..3e87b1bea68 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -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.0,<1.0.0 ovos-utils[extras]>=0.6.0,<1.0.0 ovos_bus_client>=0.1.4,<2.0.0 From 1f5d55548435c29de90674263382954d0b03fa99 Mon Sep 17 00:00:00 2001 From: miro Date: Fri, 31 Jan 2025 02:50:02 +0000 Subject: [PATCH 2/5] feat:persona pipeline --- ovos_core/intent_services/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ovos_core/intent_services/__init__.py b/ovos_core/intent_services/__init__.py index 7ae4dc9bd36..8c719495f13 100644 --- a/ovos_core/intent_services/__init__.py +++ b/ovos_core/intent_services/__init__.py @@ -206,8 +206,8 @@ def get_pipeline(self, skips=None, session=None) -> Tuple[str, Callable]: "fallback_medium": self._fallback.medium_prio, "adapt_low": self._adapt_service.match_low, "fallback_low": self._fallback.low_prio, - "persona_high": self._persona.match_high, - "persona_low": self._persona.match_low + "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({ From 2ae0e502c2fbe0b06194c2bedd01232ecd9bb94f Mon Sep 17 00:00:00 2001 From: miro Date: Fri, 31 Jan 2025 05:21:33 +0000 Subject: [PATCH 3/5] fix --- requirements/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 3e87b1bea68..1511aa66cc0 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -7,7 +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.0,<1.0.0 +ovos-persona>=0.4.1,<1.0.0 ovos-utils[extras]>=0.6.0,<1.0.0 ovos_bus_client>=0.1.4,<2.0.0 From 8b06094c75c4b8bf73e11f23cca184c547922140 Mon Sep 17 00:00:00 2001 From: miro Date: Fri, 31 Jan 2025 05:44:09 +0000 Subject: [PATCH 4/5] . --- requirements/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 1511aa66cc0..a3f7d73374b 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -7,7 +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.1,<1.0.0 +ovos-persona>=0.4.3,<1.0.0 ovos-utils[extras]>=0.6.0,<1.0.0 ovos_bus_client>=0.1.4,<2.0.0 From c659fa350ed0edaf8a095babba255bd76bed763e Mon Sep 17 00:00:00 2001 From: miro Date: Fri, 31 Jan 2025 06:04:09 +0000 Subject: [PATCH 5/5] . --- requirements/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index a3f7d73374b..cbe30a2a348 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -7,7 +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.3,<1.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