From 6e518cc704b16cab3bd1697ab6addc5e64f888a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Mon, 4 Aug 2025 09:32:15 -0700 Subject: [PATCH] examples(quickstart): allow Daily transport --- CHANGELOG.md | 4 ++++ examples/quickstart/bot.py | 38 ++++++++++++++++++++++++++++---------- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a874eaba0..5c5bb4683 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed an issue in `TaskObserver` (a proxy to all observers) that was degrading global performance. +### Other + +- Allow Daily transport to quickstart bot example. + ## [0.0.77] - 2025-07-31 ### Added diff --git a/examples/quickstart/bot.py b/examples/quickstart/bot.py index 503965e98..8684f0fc4 100644 --- a/examples/quickstart/bot.py +++ b/examples/quickstart/bot.py @@ -32,12 +32,13 @@ from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext from pipecat.processors.frameworks.rtvi import RTVIConfig, RTVIObserver, RTVIProcessor -from pipecat.runner.types import RunnerArguments +from pipecat.runner.types import DailyRunnerArguments, RunnerArguments, SmallWebRTCRunnerArguments from pipecat.services.cartesia.tts import CartesiaTTSService from pipecat.services.deepgram.stt import DeepgramSTTService from pipecat.services.openai.llm import OpenAILLMService from pipecat.transports.base_transport import BaseTransport, TransportParams from pipecat.transports.network.small_webrtc import SmallWebRTCTransport +from pipecat.transports.services.daily import DailyParams, DailyTransport load_dotenv(override=True) @@ -108,16 +109,33 @@ async def run_bot(transport: BaseTransport): async def bot(runner_args: RunnerArguments): """Main bot entry point for the bot starter.""" - transport = SmallWebRTCTransport( - params=TransportParams( - audio_in_enabled=True, - audio_out_enabled=True, - vad_analyzer=SileroVADAnalyzer(), - ), - webrtc_connection=runner_args.webrtc_connection, - ) + transport = None - await run_bot(transport) + if isinstance(runner_args, SmallWebRTCRunnerArguments): + transport = SmallWebRTCTransport( + params=TransportParams( + audio_in_enabled=True, + audio_out_enabled=True, + vad_analyzer=SileroVADAnalyzer(), + ), + webrtc_connection=runner_args.webrtc_connection, + ) + elif isinstance(runner_args, DailyRunnerArguments): + transport = DailyTransport( + runner_args.room_url, + runner_args.token, + "Pipecat Quickstart", + params=DailyParams( + audio_in_enabled=True, + audio_out_enabled=True, + vad_analyzer=SileroVADAnalyzer(), + ), + ) + else: + logger.warning("Unsupported transport") + + if transport: + await run_bot(transport) if __name__ == "__main__":