Skip to content

Commit

Permalink
rtvi: add on_bot_ready event
Browse files Browse the repository at this point in the history
  • Loading branch information
aconchillo committed Sep 25, 2024
1 parent c4e94e2 commit f06aa30
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pipecat/processors/frameworks/rtvi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit f06aa30

Please sign in to comment.