diff --git a/examples/runner-examples/01-all-transport-bot.py b/examples/runner-examples/01-all-transport-bot.py index a8c33db77..982abc58d 100644 --- a/examples/runner-examples/01-all-transport-bot.py +++ b/examples/runner-examples/01-all-transport-bot.py @@ -105,6 +105,8 @@ async def run_bot(transport: BaseTransport): async def bot(runner_args: RunnerArguments): """Main bot entry point compatible with Pipecat Cloud.""" + transport = None + if isinstance(runner_args, DailyRunnerArguments): from pipecat.transports.services.daily import DailyParams, DailyTransport @@ -199,6 +201,13 @@ async def bot(runner_args: RunnerArguments): serializer=serializer, ), ) + else: + logger.error(f"Unsupported runner arguments type: {type(runner_args)}") + return + + if transport is None: + logger.error("Failed to create transport") + return await run_bot(transport) diff --git a/examples/runner-examples/02-two-transport-bot.py b/examples/runner-examples/02-two-transport-bot.py index 90d059f12..31ec577e1 100644 --- a/examples/runner-examples/02-two-transport-bot.py +++ b/examples/runner-examples/02-two-transport-bot.py @@ -6,7 +6,18 @@ """Pipecat Cloud-compatible bot example. -Transports are Daily or SmallWebRTC.""" +Transports are Daily or SmallWebRTC. + +Run it with: + +- WebRTC transport:: + + python 02-two-transport-bot.py + +- Daily transport:: + + python 02-two-transport-bot.py --transport daily +""" import os @@ -93,6 +104,8 @@ async def run_bot(transport: BaseTransport): async def bot(runner_args: RunnerArguments): """Main bot entry point compatible with Pipecat Cloud.""" + transport = None + if isinstance(runner_args, DailyRunnerArguments): from pipecat.transports.services.daily import DailyParams, DailyTransport @@ -127,6 +140,13 @@ async def bot(runner_args: RunnerArguments): ), webrtc_connection=runner_args.webrtc_connection, ) + else: + logger.error(f"Unsupported runner arguments type: {type(runner_args)}") + return + + if transport is None: + logger.error("Failed to create transport") + return await run_bot(transport) diff --git a/examples/runner-examples/03-single-transport-bot.py b/examples/runner-examples/03-single-transport-bot.py index ca6a65f62..bfa2ca3d3 100644 --- a/examples/runner-examples/03-single-transport-bot.py +++ b/examples/runner-examples/03-single-transport-bot.py @@ -4,9 +4,14 @@ # SPDX-License-Identifier: BSD 2-Clause License # -"""Pipecat Cloud-compatible bot example. +"""Pipecat development runner example. -Transports are Daily or SmallWebRTC.""" +This example has a single transport—SmallWebRTCTransport. + +Run it with:: + + python 03-single-transport-bot.py +""" import os