From 5445bb0363a420cabf13150db3102594c4b20f46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Sun, 17 Nov 2024 22:40:00 +0100 Subject: [PATCH] rtvi: add on_bot_started event --- CHANGELOG.md | 2 ++ src/pipecat/processors/frameworks/rtvi.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f04218baa..f5abfef49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Added RTVI `on_bot_started` event which is useful in single turn. + - Added `DailyTransport` events `dialin-connected`, `dialin-stopped`, `dialin-error` and `dialin-warning`. Needs daily-python >= 0.13.0. diff --git a/src/pipecat/processors/frameworks/rtvi.py b/src/pipecat/processors/frameworks/rtvi.py index 83b0afcde..5764dbc57 100644 --- a/src/pipecat/processors/frameworks/rtvi.py +++ b/src/pipecat/processors/frameworks/rtvi.py @@ -591,6 +591,7 @@ class RTVIProcessor(FrameProcessor): self._message_queue = asyncio.Queue() self._message_task = self.get_event_loop().create_task(self._message_task_handler()) + self._register_event_handler("on_bot_started") self._register_event_handler("on_client_ready") def register_action(self, action: RTVIAction): @@ -679,7 +680,7 @@ class RTVIProcessor(FrameProcessor): await self._pipeline.cleanup() async def _start(self, frame: StartFrame): - pass + await self._call_event_handler("on_bot_started") async def _stop(self, frame: EndFrame): await self._cancel_tasks()