Update foundational examples to use the development runner

This commit is contained in:
Mark Backman
2025-07-31 22:00:55 -04:00
parent ff45b77fdf
commit f1b1d5b130
144 changed files with 1903 additions and 958 deletions

View File

@@ -4,7 +4,6 @@
# SPDX-License-Identifier: BSD 2-Clause License
#
import argparse
import os
from dataclasses import dataclass
@@ -25,6 +24,8 @@ from pipecat.pipeline.sync_parallel_pipeline import SyncParallelPipeline
from pipecat.pipeline.task import PipelineTask
from pipecat.processors.aggregators.sentence import SentenceAggregator
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport
from pipecat.services.cartesia.tts import CartesiaHttpTTSService
from pipecat.services.fal.image import FalImageGenService
from pipecat.services.openai.llm import OpenAILLMService
@@ -82,7 +83,7 @@ transport_params = {
}
async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_sigint: bool):
async def run_bot(transport: BaseTransport):
"""Run the Calendar Month Narration bot using WebRTC transport.
Args:
@@ -169,11 +170,17 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si
await task.cancel()
# Run the pipeline
runner = PipelineRunner(handle_sigint=handle_sigint)
runner = PipelineRunner(handle_sigint=False)
await runner.run(task)
if __name__ == "__main__":
from pipecat.examples.run import main
async def bot(runner_args: RunnerArguments):
"""Main bot entry point compatible with Pipecat Cloud."""
transport = await create_transport(runner_args, transport_params)
await run_bot(transport)
main(run_example, transport_params=transport_params)
if __name__ == "__main__":
from pipecat.runner.run import main
main()