|
33 | 33 | from ovos_utils.log import LOG, log_deprecation, deprecated |
34 | 34 | from ovos_utils.metrics import Stopwatch |
35 | 35 | from padacioso.opm import PadaciosoPipeline as PadaciosoService |
| 36 | +from ovos_persona import PersonaService |
36 | 37 | import warnings |
37 | 38 |
|
38 | 39 |
|
@@ -113,6 +114,7 @@ def _load_pipeline_plugins(self): |
113 | 114 | self._common_qa = CommonQAService(self.bus, self.config.get("common_query")) |
114 | 115 | self._stop = StopService(self.bus) |
115 | 116 | self._ocp = OCPPipelineMatcher(self.bus, config=self.config.get("OCP", {})) |
| 117 | + self._persona = PersonaService(self.bus, config=self.config.get("persona", {})) |
116 | 118 |
|
117 | 119 | def update_skill_name_dict(self, message): |
118 | 120 | """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]: |
203 | 205 | "adapt_medium": self._adapt_service.match_medium, |
204 | 206 | "fallback_medium": self._fallback.medium_prio, |
205 | 207 | "adapt_low": self._adapt_service.match_low, |
206 | | - "fallback_low": self._fallback.low_prio |
| 208 | + "fallback_low": self._fallback.low_prio, |
| 209 | + "ovos-persona-pipeline-plugin-high": self._persona.match_high, |
| 210 | + "ovos-persona-pipeline-plugin-low": self._persona.match_low |
207 | 211 | } |
208 | 212 | if self._padacioso_service is not None: |
209 | 213 | matchers.update({ |
@@ -270,28 +274,28 @@ def _handle_deactivate(self, message): |
270 | 274 | def _emit_match_message(self, match: Union[IntentHandlerMatch, PipelineMatch], message: Message, lang: str): |
271 | 275 | """ |
272 | 276 | Emit a reply message for a matched intent, updating session and skill activation. |
273 | | - |
| 277 | +
|
274 | 278 | This method processes matched intents from either a pipeline matcher or an intent handler, |
275 | 279 | creating a reply message with matched intent details and managing skill activation. |
276 | | - |
| 280 | +
|
277 | 281 | Args: |
278 | 282 | match (Union[IntentHandlerMatch, PipelineMatch]): The matched intent object containing |
279 | 283 | utterance and matching information. |
280 | 284 | message (Message): The original messagebus message that triggered the intent match. |
281 | 285 | lang (str): The language of the pipeline plugin match |
282 | | - |
| 286 | +
|
283 | 287 | Details: |
284 | 288 | - Handles two types of matches: PipelineMatch and IntentHandlerMatch |
285 | 289 | - Creates a reply message with matched intent data |
286 | 290 | - Activates the corresponding skill if not previously deactivated |
287 | 291 | - Updates session information |
288 | 292 | - Emits the reply message on the messagebus |
289 | | - |
| 293 | +
|
290 | 294 | Side Effects: |
291 | 295 | - Modifies session state |
292 | 296 | - Emits a messagebus event |
293 | 297 | - Can trigger skill activation events |
294 | | - |
| 298 | +
|
295 | 299 | Returns: |
296 | 300 | None |
297 | 301 | """ |
|
0 commit comments