From f06aa300d01b202f018265c3e880f147566b302c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Wed, 25 Sep 2024 16:35:49 -0700 Subject: [PATCH] rtvi: add on_bot_ready event --- src/pipecat/processors/frameworks/rtvi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pipecat/processors/frameworks/rtvi.py b/src/pipecat/processors/frameworks/rtvi.py index 1458cc21d..930b2331d 100644 --- a/src/pipecat/processors/frameworks/rtvi.py +++ b/src/pipecat/processors/frameworks/rtvi.py @@ -324,6 +324,8 @@ def __init__( self._message_task = self.get_event_loop().create_task(self._message_task_handler()) self._message_queue = asyncio.Queue() + self._register_event_handler("on_bot_ready") + def register_action(self, action: RTVIAction): id = self._action_id(action.service, action.action) self._registered_actions[id] = action @@ -624,8 +626,9 @@ async def _handle_action(self, request_id: str | None, data: RTVIActionRun): async def _maybe_send_bot_ready(self): if self._pipeline_started and self._client_ready: - await self._send_bot_ready() await self._update_config(self._config, False) + await self._send_bot_ready() + await self._call_event_handler("on_bot_ready") async def _send_bot_ready(self): if not self._params.send_bot_ready: