diff --git a/examples/foundational/12a-describe-video-gemini-flash.py b/examples/foundational/12a-describe-video-gemini-flash.py index 33240dd13..2cf8db7df 100644 --- a/examples/foundational/12a-describe-video-gemini-flash.py +++ b/examples/foundational/12a-describe-video-gemini-flash.py @@ -19,7 +19,7 @@ from pipecat.processors.frame_processor import FrameDirection, FrameProcessor from pipecat.services.elevenlabs import ElevenLabsTTSService from pipecat.services.google import GoogleLLMService from pipecat.transports.services.daily import DailyParams, DailyTransport -from pipecat.vad.silero import SileroVAD +from pipecat.vad.silero import SileroVADAnalyzer from runner import configure @@ -56,12 +56,12 @@ async def main(room_url: str, token): 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"), @@ -89,10 +89,17 @@ 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, - vision_aggregator, google, tts, transport.output()]) + pipeline = Pipeline([ + transport.input(), + user_response, + image_requester, + vision_aggregator, + google, + tts, + transport.output() + ]) - task = PipelineTask(pipeline) + task = PipelineTask(pipeline, allow_interruptions=True) runner = PipelineRunner() diff --git a/examples/foundational/12b-describe-video-gpt-4o.py b/examples/foundational/12b-describe-video-gpt-4o.py index dd386c8b4..669f251a9 100644 --- a/examples/foundational/12b-describe-video-gpt-4o.py +++ b/examples/foundational/12b-describe-video-gpt-4o.py @@ -19,7 +19,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, DailyTransport -from pipecat.vad.silero import SileroVAD +from pipecat.vad.silero import SileroVADAnalyzer from runner import configure @@ -56,12 +56,12 @@ async def main(room_url: str, token): 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"), @@ -74,7 +74,7 @@ async def main(room_url: str, token): vision_aggregator = VisionImageFrameAggregator() - google = OpenAILLMService( + gpt4o = OpenAILLMService( api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o" ) @@ -92,10 +92,17 @@ 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, - vision_aggregator, google, tts, transport.output()]) + pipeline = Pipeline([ + transport.input(), + user_response, + image_requester, + vision_aggregator, + gpt4o, + tts, + transport.output() + ]) - task = PipelineTask(pipeline) + task = PipelineTask(pipeline, allow_interruptions=True) runner = PipelineRunner()