Update demos with RunnerArguments, runner_args

This commit is contained in:
Mark Backman
2025-07-30 21:49:58 -04:00
parent dbf9899de8
commit 027ab8fedf
3 changed files with 10 additions and 10 deletions

View File

@@ -33,7 +33,7 @@ from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext
from pipecat.processors.frameworks.rtvi import RTVIConfig, RTVIObserver, RTVIProcessor from pipecat.processors.frameworks.rtvi import RTVIConfig, RTVIObserver, RTVIProcessor
from pipecat.runner.run import SmallWebRTCSessionArguments from pipecat.runner.types import RunnerArguments
from pipecat.services.cartesia.tts import CartesiaTTSService from pipecat.services.cartesia.tts import CartesiaTTSService
from pipecat.services.deepgram.stt import DeepgramSTTService from pipecat.services.deepgram.stt import DeepgramSTTService
from pipecat.services.openai.llm import OpenAILLMService from pipecat.services.openai.llm import OpenAILLMService
@@ -106,7 +106,7 @@ async def run_bot(transport: BaseTransport):
await runner.run(task) await runner.run(task)
async def bot(session_args: SmallWebRTCSessionArguments): async def bot(runner_args: RunnerArguments):
"""Main bot entry point for the bot starter.""" """Main bot entry point for the bot starter."""
transport = SmallWebRTCTransport( transport = SmallWebRTCTransport(
@@ -115,7 +115,7 @@ async def bot(session_args: SmallWebRTCSessionArguments):
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(), vad_analyzer=SileroVADAnalyzer(),
), ),
webrtc_connection=session_args.webrtc_connection, webrtc_connection=runner_args.webrtc_connection,
) )
await run_bot(transport) await run_bot(transport)

View File

@@ -26,7 +26,6 @@ import os
from dotenv import load_dotenv from dotenv import load_dotenv
from loguru import logger from loguru import logger
from pipecatcloud import WebSocketSessionArguments
from pipecat.audio.vad.silero import SileroVADAnalyzer from pipecat.audio.vad.silero import SileroVADAnalyzer
from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.pipeline import Pipeline
@@ -34,6 +33,7 @@ from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext
from pipecat.processors.frameworks.rtvi import RTVIConfig, RTVIObserver, RTVIProcessor from pipecat.processors.frameworks.rtvi import RTVIConfig, RTVIObserver, RTVIProcessor
from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import parse_telephony_websocket from pipecat.runner.utils import parse_telephony_websocket
from pipecat.serializers.twilio import TwilioFrameSerializer from pipecat.serializers.twilio import TwilioFrameSerializer
from pipecat.services.cartesia.tts import CartesiaTTSService from pipecat.services.cartesia.tts import CartesiaTTSService
@@ -111,10 +111,10 @@ async def run_bot(transport: BaseTransport):
await runner.run(task) await runner.run(task)
async def bot(session_args: WebSocketSessionArguments): async def bot(runner_args: RunnerArguments):
"""Main bot entry point for the bot starter.""" """Main bot entry point for the bot starter."""
transport_type, call_data = await parse_telephony_websocket(session_args.websocket) transport_type, call_data = await parse_telephony_websocket(runner_args.websocket)
logger.info(f"Auto-detected transport: {transport_type}") logger.info(f"Auto-detected transport: {transport_type}")
serializer = TwilioFrameSerializer( serializer = TwilioFrameSerializer(
@@ -125,7 +125,7 @@ async def bot(session_args: WebSocketSessionArguments):
) )
transport = FastAPIWebsocketTransport( transport = FastAPIWebsocketTransport(
websocket=session_args.websocket, websocket=runner_args.websocket,
params=FastAPIWebsocketParams( params=FastAPIWebsocketParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,

View File

@@ -32,7 +32,7 @@ from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext
from pipecat.processors.frameworks.rtvi import RTVIConfig, RTVIObserver, RTVIProcessor from pipecat.processors.frameworks.rtvi import RTVIConfig, RTVIObserver, RTVIProcessor
from pipecat.runner.run import SmallWebRTCSessionArguments from pipecat.runner.types import RunnerArguments
from pipecat.services.cartesia.tts import CartesiaTTSService from pipecat.services.cartesia.tts import CartesiaTTSService
from pipecat.services.deepgram.stt import DeepgramSTTService from pipecat.services.deepgram.stt import DeepgramSTTService
from pipecat.services.openai.llm import OpenAILLMService from pipecat.services.openai.llm import OpenAILLMService
@@ -105,7 +105,7 @@ async def run_bot(transport: BaseTransport):
await runner.run(task) await runner.run(task)
async def bot(session_args: SmallWebRTCSessionArguments): async def bot(runner_args: RunnerArguments):
"""Main bot entry point for the bot starter.""" """Main bot entry point for the bot starter."""
transport = SmallWebRTCTransport( transport = SmallWebRTCTransport(
@@ -114,7 +114,7 @@ async def bot(session_args: SmallWebRTCSessionArguments):
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(), vad_analyzer=SileroVADAnalyzer(),
), ),
webrtc_connection=session_args.webrtc_connection, webrtc_connection=runner_args.webrtc_connection,
) )
await run_bot(transport) await run_bot(transport)