diff --git a/examples/foundational/06-listen-and-respond.py b/examples/foundational/06-listen-and-respond.py index 3ba220912..e561c3c64 100644 --- a/examples/foundational/06-listen-and-respond.py +++ b/examples/foundational/06-listen-and-respond.py @@ -21,7 +21,7 @@ from pipecat.processors.logger import FrameLogger from pipecat.services.elevenlabs import ElevenLabsTTSService from pipecat.services.openai import OpenAILLMService from pipecat.transports.services.daily import DailyParams, DailyTransport -from pipecat.vad.silero import SileroVAD +from pipecat.vad.silero import SileroVADAnalyzer from runner import configure @@ -41,14 +41,13 @@ async def main(room_url: str, token): token, "Respond bot", DailyParams( - audio_in_enabled=True, # This is so Silero VAD can get audio data audio_out_enabled=True, - transcription_enabled=True + transcription_enabled=True, + vad_enabled=True, + vad_analyzer=SileroVADAnalyzer() ) ) - vad = SileroVAD() - tts = ElevenLabsTTSService( aiohttp_session=session, api_key=os.getenv("ELEVENLABS_API_KEY"), @@ -71,7 +70,7 @@ async def main(room_url: str, token): tma_in = LLMUserResponseAggregator(messages) tma_out = LLMAssistantResponseAggregator(messages) - pipeline = Pipeline([fl_in, transport.input(), vad, tma_in, llm, + pipeline = Pipeline([fl_in, transport.input(), tma_in, llm, fl_out, tts, tma_out, transport.output()]) task = PipelineTask(pipeline) diff --git a/examples/foundational/07-interruptible.py b/examples/foundational/07-interruptible.py index 67c2eddc9..70c74f5e2 100644 --- a/examples/foundational/07-interruptible.py +++ b/examples/foundational/07-interruptible.py @@ -38,7 +38,6 @@ async def main(room_url: str, token): token, "Respond bot", DailyParams( - audio_in_enabled=True, audio_out_enabled=True, transcription_enabled=True, vad_enabled=True, diff --git a/examples/foundational/12-describe-video.py b/examples/foundational/12-describe-video.py index feef343fc..68033b77f 100644 --- a/examples/foundational/12-describe-video.py +++ b/examples/foundational/12-describe-video.py @@ -19,7 +19,7 @@ from pipecat.processors.frame_processor import FrameDirection, FrameProcessor from pipecat.services.elevenlabs import ElevenLabsTTSService from pipecat.services.moondream import MoondreamService from pipecat.transports.services.daily import DailyParams, DailyTransport -from pipecat.vad.silero import SileroVAD +from pipecat.vad.silero import SileroVADAnalyzer from runner import configure @@ -54,14 +54,13 @@ async def main(room_url: str, token): token, "Describe participant video", DailyParams( - audio_in_enabled=True, # This is so Silero VAD can get audio data audio_out_enabled=True, - transcription_enabled=True + transcription_enabled=True, + vad_enabled=True, + vad_analyzer=SileroVADAnalyzer() ) ) - vad = SileroVAD() - tts = ElevenLabsTTSService( aiohttp_session=session, api_key=os.getenv("ELEVENLABS_API_KEY"), @@ -90,7 +89,7 @@ async def main(room_url: str, token): transport.capture_participant_transcription(participant["id"]) image_requester.set_participant_id(participant["id"]) - pipeline = Pipeline([transport.input(), vad, user_response, image_requester, + pipeline = Pipeline([transport.input(), user_response, image_requester, vision_aggregator, moondream, tts, transport.output()]) task = PipelineTask(pipeline) diff --git a/examples/moondream-chatbot/bot.py b/examples/moondream-chatbot/bot.py index 4a731d379..6a43f617e 100644 --- a/examples/moondream-chatbot/bot.py +++ b/examples/moondream-chatbot/bot.py @@ -29,7 +29,7 @@ from pipecat.services.elevenlabs import ElevenLabsTTSService from pipecat.services.moondream import MoondreamService from pipecat.services.openai import OpenAILLMService from pipecat.transports.services.daily import DailyParams, DailyTransport -from pipecat.vad.silero import SileroVAD +from pipecat.vad.silero import SileroVADAnalyzer from runner import configure @@ -127,17 +127,16 @@ async def main(room_url: str, token): token, "Chatbot", DailyParams( - audio_in_enabled=True, audio_out_enabled=True, camera_out_enabled=True, camera_out_width=1024, camera_out_height=576, - transcription_enabled=True + transcription_enabled=True, + vad_enabled=True, + vad_analyzer=SileroVADAnalyzer() ) ) - vad = SileroVAD() - tts = ElevenLabsTTSService( aiohttp_session=session, api_key=os.getenv("ELEVENLABS_API_KEY"), @@ -169,7 +168,7 @@ async def main(room_url: str, token): ura = LLMUserResponseAggregator(messages) - pipeline = Pipeline([transport.input(), vad, ura, llm, + pipeline = Pipeline([transport.input(), ura, llm, ParallelPipeline( [sa, ir, va, moondream], [tf, imgf]), diff --git a/examples/simple-chatbot/bot.py b/examples/simple-chatbot/bot.py index bde15aee8..e379ae049 100644 --- a/examples/simple-chatbot/bot.py +++ b/examples/simple-chatbot/bot.py @@ -21,7 +21,7 @@ from pipecat.processors.frame_processor import FrameDirection, FrameProcessor from pipecat.services.elevenlabs import ElevenLabsTTSService from pipecat.services.openai import OpenAILLMService from pipecat.transports.services.daily import DailyParams, DailyTranscriptionSettings, DailyTransport -from pipecat.vad.silero import SileroVAD +from pipecat.vad.silero import SileroVADAnalyzer from runner import configure @@ -82,11 +82,12 @@ async def main(room_url: str, token): token, "Chatbot", DailyParams( - audio_in_enabled=True, audio_out_enabled=True, camera_out_enabled=True, camera_out_width=1024, camera_out_height=576, + vad_enabled=True, + vad_analyzer=SileroVADAnalyzer(), transcription_enabled=True, # # Spanish @@ -99,8 +100,6 @@ async def main(room_url: str, token): ) ) - vad = SileroVAD() - tts = ElevenLabsTTSService( aiohttp_session=session, api_key=os.getenv("ELEVENLABS_API_KEY"), @@ -139,10 +138,10 @@ async def main(room_url: str, token): ta = TalkingAnimation() - pipeline = Pipeline([transport.input(), vad, user_response, + pipeline = Pipeline([transport.input(), user_response, llm, tts, ta, transport.output()]) - task = PipelineTask(pipeline) + task = PipelineTask(pipeline, allow_interruptions=True) await task.queue_frame(quiet_frame) @transport.event_handler("on_first_participant_joined")