From 7db57109dc34d9cb5346176a0c25f27a7db80865 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Sat, 26 Jul 2025 10:35:07 -0400 Subject: [PATCH] Add RTVI to local-simple-bot.py --- examples/quickstart/local-simple-bot.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/quickstart/local-simple-bot.py b/examples/quickstart/local-simple-bot.py index 90dcc5116..c31e498ac 100644 --- a/examples/quickstart/local-simple-bot.py +++ b/examples/quickstart/local-simple-bot.py @@ -15,6 +15,7 @@ from pipecat.pipeline.pipeline import Pipeline 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.services.cartesia.tts import CartesiaTTSService from pipecat.services.deepgram.stt import DeepgramSTTService from pipecat.services.openai.llm import OpenAILLMService @@ -45,9 +46,12 @@ async def run_bot(transport: BaseTransport, _: argparse.Namespace, handle_sigint context = OpenAILLMContext(messages) context_aggregator = llm.create_context_aggregator(context) + rtvi = RTVIProcessor(config=RTVIConfig(config=[])) + pipeline = Pipeline( [ transport.input(), # Transport user input + rtvi, # RTVI processor stt, context_aggregator.user(), # User responses llm, # LLM @@ -63,6 +67,7 @@ async def run_bot(transport: BaseTransport, _: argparse.Namespace, handle_sigint enable_metrics=True, enable_usage_metrics=True, ), + observers=[RTVIObserver(rtvi)], ) @transport.event_handler("on_client_connected")