Merge pull request #4003 from pipecat-ai/pk/fix-deprecated-vad-analyzer-usage

Fix deprecated vad_analyzer usage in examples
This commit is contained in:
kompfner
2026-03-11 20:55:39 -04:00
committed by GitHub
25 changed files with 136 additions and 107 deletions

View File

@@ -30,24 +30,20 @@ from pipecat.transports.websocket.fastapi import FastAPIWebsocketParams
load_dotenv(override=True) load_dotenv(override=True)
# We store functions so objects (e.g. SileroVADAnalyzer) don't get # We use lambdas to defer transport parameter creation until the transport
# instantiated. The function will be called when the desired transport gets # type is selected at runtime.
# selected.
transport_params = { transport_params = {
"daily": lambda: DailyParams( "daily": lambda: DailyParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"webrtc": lambda: TransportParams( "webrtc": lambda: TransportParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
} }

View File

@@ -13,6 +13,7 @@ from pipecat.frames.frames import Frame, TranscriptionFrame
from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineTask from pipecat.pipeline.task import PipelineTask
from pipecat.processors.audio.vad_processor import VADProcessor
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport from pipecat.runner.utils import create_transport
@@ -40,15 +41,12 @@ class TranscriptionLogger(FrameProcessor):
transport_params = { transport_params = {
"daily": lambda: DailyParams( "daily": lambda: DailyParams(
audio_in_enabled=True, audio_in_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(
audio_in_enabled=True, audio_in_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"webrtc": lambda: TransportParams( "webrtc": lambda: TransportParams(
audio_in_enabled=True, audio_in_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
} }
@@ -59,8 +57,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
stt = WhisperSTTService() stt = WhisperSTTService()
tl = TranscriptionLogger() tl = TranscriptionLogger()
vad_processor = VADProcessor(vad_analyzer=SileroVADAnalyzer())
pipeline = Pipeline([transport.input(), stt, tl]) pipeline = Pipeline([transport.input(), vad_processor, stt, tl])
task = PipelineTask( task = PipelineTask(
pipeline, pipeline,

View File

@@ -15,6 +15,7 @@ from pipecat.frames.frames import Frame, TranscriptionFrame
from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineTask from pipecat.pipeline.task import PipelineTask
from pipecat.processors.audio.vad_processor import VADProcessor
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
from pipecat.services.whisper.stt import WhisperSTTService from pipecat.services.whisper.stt import WhisperSTTService
from pipecat.transports.local.audio import LocalAudioTransport, LocalAudioTransportParams from pipecat.transports.local.audio import LocalAudioTransport, LocalAudioTransportParams
@@ -40,15 +41,15 @@ async def main():
transport = LocalAudioTransport( transport = LocalAudioTransport(
LocalAudioTransportParams( LocalAudioTransportParams(
audio_in_enabled=True, audio_in_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
) )
) )
stt = WhisperSTTService() stt = WhisperSTTService()
tl = TranscriptionLogger() tl = TranscriptionLogger()
vad_processor = VADProcessor(vad_analyzer=SileroVADAnalyzer())
pipeline = Pipeline([transport.input(), stt, tl]) pipeline = Pipeline([transport.input(), vad_processor, stt, tl])
task = PipelineTask(pipeline) task = PipelineTask(pipeline)

View File

@@ -15,6 +15,7 @@ from pipecat.frames.frames import Frame, TranscriptionFrame, UserStoppedSpeaking
from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.processors.audio.vad_processor import VADProcessor
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport from pipecat.runner.utils import create_transport
@@ -61,15 +62,12 @@ class TranscriptionLogger(FrameProcessor):
transport_params = { transport_params = {
"daily": lambda: DailyParams( "daily": lambda: DailyParams(
audio_in_enabled=True, audio_in_enabled=True,
vad_analyzer=SileroVADAnalyzer(params=VADParams(stop_secs=STOP_SECS)),
), ),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(
audio_in_enabled=True, audio_in_enabled=True,
vad_analyzer=SileroVADAnalyzer(params=VADParams(stop_secs=STOP_SECS)),
), ),
"webrtc": lambda: TransportParams( "webrtc": lambda: TransportParams(
audio_in_enabled=True, audio_in_enabled=True,
vad_analyzer=SileroVADAnalyzer(params=VADParams(stop_secs=STOP_SECS)),
), ),
} }
@@ -84,8 +82,11 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
) )
tl = TranscriptionLogger() tl = TranscriptionLogger()
vad_processor = VADProcessor(
vad_analyzer=SileroVADAnalyzer(params=VADParams(stop_secs=STOP_SECS))
)
pipeline = Pipeline([transport.input(), stt, tl]) pipeline = Pipeline([transport.input(), vad_processor, stt, tl])
task = PipelineTask( task = PipelineTask(
pipeline, pipeline,

View File

@@ -16,6 +16,7 @@ from pipecat.frames.frames import Frame, TranscriptionFrame, UserStoppedSpeaking
from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.processors.audio.vad_processor import VADProcessor
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport from pipecat.runner.utils import create_transport
@@ -62,15 +63,12 @@ class TranscriptionLogger(FrameProcessor):
transport_params = { transport_params = {
"daily": lambda: DailyParams( "daily": lambda: DailyParams(
audio_in_enabled=True, audio_in_enabled=True,
vad_analyzer=SileroVADAnalyzer(params=VADParams(stop_secs=STOP_SECS)),
), ),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(
audio_in_enabled=True, audio_in_enabled=True,
vad_analyzer=SileroVADAnalyzer(params=VADParams(stop_secs=STOP_SECS)),
), ),
"webrtc": lambda: TransportParams( "webrtc": lambda: TransportParams(
audio_in_enabled=True, audio_in_enabled=True,
vad_analyzer=SileroVADAnalyzer(params=VADParams(stop_secs=STOP_SECS)),
), ),
} }
@@ -86,8 +84,11 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
) )
tl = TranscriptionLogger() tl = TranscriptionLogger()
vad_processor = VADProcessor(
vad_analyzer=SileroVADAnalyzer(params=VADParams(stop_secs=STOP_SECS))
)
pipeline = Pipeline([transport.input(), stt, tl]) pipeline = Pipeline([transport.input(), vad_processor, stt, tl])
task = PipelineTask( task = PipelineTask(
pipeline, pipeline,

View File

@@ -14,6 +14,7 @@ from pipecat.frames.frames import Frame, TranscriptionFrame
from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineTask from pipecat.pipeline.task import PipelineTask
from pipecat.processors.audio.vad_processor import VADProcessor
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport from pipecat.runner.utils import create_transport
@@ -39,15 +40,12 @@ class TranscriptionLogger(FrameProcessor):
transport_params = { transport_params = {
"daily": lambda: DailyParams( "daily": lambda: DailyParams(
audio_in_enabled=True, audio_in_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(
audio_in_enabled=True, audio_in_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"webrtc": lambda: TransportParams( "webrtc": lambda: TransportParams(
audio_in_enabled=True, audio_in_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
} }
@@ -60,8 +58,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
) )
tl = TranscriptionLogger() tl = TranscriptionLogger()
vad_processor = VADProcessor(vad_analyzer=SileroVADAnalyzer())
pipeline = Pipeline([transport.input(), stt, tl]) pipeline = Pipeline([transport.input(), vad_processor, stt, tl])
task = PipelineTask( task = PipelineTask(
pipeline, pipeline,

View File

@@ -14,6 +14,7 @@ from pipecat.frames.frames import Frame, TranscriptionFrame
from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineTask from pipecat.pipeline.task import PipelineTask
from pipecat.processors.audio.vad_processor import VADProcessor
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport from pipecat.runner.utils import create_transport
@@ -39,15 +40,12 @@ class TranscriptionLogger(FrameProcessor):
transport_params = { transport_params = {
"daily": lambda: DailyParams( "daily": lambda: DailyParams(
audio_in_enabled=True, audio_in_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(
audio_in_enabled=True, audio_in_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"webrtc": lambda: TransportParams( "webrtc": lambda: TransportParams(
audio_in_enabled=True, audio_in_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
} }
@@ -61,8 +59,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
) )
tl = TranscriptionLogger() tl = TranscriptionLogger()
vad_processor = VADProcessor(vad_analyzer=SileroVADAnalyzer())
pipeline = Pipeline([transport.input(), stt, tl]) pipeline = Pipeline([transport.input(), vad_processor, stt, tl])
task = PipelineTask( task = PipelineTask(
pipeline, pipeline,

View File

@@ -14,6 +14,7 @@ from pipecat.frames.frames import Frame, TranscriptionFrame
from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineTask from pipecat.pipeline.task import PipelineTask
from pipecat.processors.audio.vad_processor import VADProcessor
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport from pipecat.runner.utils import create_transport
@@ -39,11 +40,9 @@ class TranscriptionLogger(FrameProcessor):
# We use lambdas to defer transport parameter creation until the transport # We use lambdas to defer transport parameter creation until the transport
# type is selected at runtime. # type is selected at runtime.
transport_params = { transport_params = {
"daily": lambda: DailyParams(audio_in_enabled=True, vad_analyzer=SileroVADAnalyzer()), "daily": lambda: DailyParams(audio_in_enabled=True),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(audio_in_enabled=True),
audio_in_enabled=True, vad_analyzer=SileroVADAnalyzer() "webrtc": lambda: TransportParams(audio_in_enabled=True),
),
"webrtc": lambda: TransportParams(audio_in_enabled=True, vad_analyzer=SileroVADAnalyzer()),
} }
@@ -53,8 +52,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
stt = ElevenLabsRealtimeSTTService(api_key=os.getenv("ELEVENLABS_API_KEY")) stt = ElevenLabsRealtimeSTTService(api_key=os.getenv("ELEVENLABS_API_KEY"))
tl = TranscriptionLogger() tl = TranscriptionLogger()
vad_processor = VADProcessor(vad_analyzer=SileroVADAnalyzer())
pipeline = Pipeline([transport.input(), stt, tl]) pipeline = Pipeline([transport.input(), vad_processor, stt, tl])
task = PipelineTask( task = PipelineTask(
pipeline, pipeline,

View File

@@ -14,6 +14,7 @@ from pipecat.frames.frames import Frame, TranscriptionFrame
from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineTask from pipecat.pipeline.task import PipelineTask
from pipecat.processors.audio.vad_processor import VADProcessor
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport from pipecat.runner.utils import create_transport
@@ -39,11 +40,9 @@ class TranscriptionLogger(FrameProcessor):
# We use lambdas to defer transport parameter creation until the transport # We use lambdas to defer transport parameter creation until the transport
# type is selected at runtime. # type is selected at runtime.
transport_params = { transport_params = {
"daily": lambda: DailyParams(audio_in_enabled=True, vad_analyzer=SileroVADAnalyzer()), "daily": lambda: DailyParams(audio_in_enabled=True),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(audio_in_enabled=True),
audio_in_enabled=True, vad_analyzer=SileroVADAnalyzer() "webrtc": lambda: TransportParams(audio_in_enabled=True),
),
"webrtc": lambda: TransportParams(audio_in_enabled=True, vad_analyzer=SileroVADAnalyzer()),
} }
@@ -59,8 +58,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
) )
tl = TranscriptionLogger() tl = TranscriptionLogger()
vad_processor = VADProcessor(vad_analyzer=SileroVADAnalyzer())
pipeline = Pipeline([transport.input(), stt, tl]) pipeline = Pipeline([transport.input(), vad_processor, stt, tl])
task = PipelineTask( task = PipelineTask(
pipeline, pipeline,

View File

@@ -24,6 +24,7 @@ from pipecat.processors.aggregators.llm_context import LLMContext
from pipecat.processors.aggregators.llm_response_universal import ( from pipecat.processors.aggregators.llm_response_universal import (
AssistantTurnStoppedMessage, AssistantTurnStoppedMessage,
LLMContextAggregatorPair, LLMContextAggregatorPair,
LLMUserAggregatorParams,
UserTurnStoppedMessage, UserTurnStoppedMessage,
) )
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
@@ -119,17 +120,14 @@ transport_params = {
"daily": lambda: DailyParams( "daily": lambda: DailyParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"webrtc": lambda: TransportParams( "webrtc": lambda: TransportParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
} }
@@ -187,7 +185,10 @@ Remember, your responses should be short. Just one or two sentences, usually. Re
tools, tools,
) )
user_aggregator, assistant_aggregator = LLMContextAggregatorPair(context) user_aggregator, assistant_aggregator = LLMContextAggregatorPair(
context,
user_params=LLMUserAggregatorParams(vad_analyzer=SileroVADAnalyzer()),
)
pipeline = Pipeline( pipeline = Pipeline(
[ [

View File

@@ -19,7 +19,10 @@ from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.processors.aggregators.llm_context import LLMContext from pipecat.processors.aggregators.llm_context import LLMContext
from pipecat.processors.aggregators.llm_response_universal import LLMContextAggregatorPair from pipecat.processors.aggregators.llm_response_universal import (
LLMContextAggregatorPair,
LLMUserAggregatorParams,
)
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport from pipecat.runner.utils import create_transport
from pipecat.services.azure.realtime.llm import AzureRealtimeLLMService from pipecat.services.azure.realtime.llm import AzureRealtimeLLMService
@@ -93,17 +96,14 @@ transport_params = {
"daily": lambda: DailyParams( "daily": lambda: DailyParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"webrtc": lambda: TransportParams( "webrtc": lambda: TransportParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
} }
@@ -172,7 +172,10 @@ Remember, your responses should be short. Just one or two sentences, usually. Re
tools, tools,
) )
user_aggregator, assistant_aggregator = LLMContextAggregatorPair(context) user_aggregator, assistant_aggregator = LLMContextAggregatorPair(
context,
user_params=LLMUserAggregatorParams(vad_analyzer=SileroVADAnalyzer()),
)
pipeline = Pipeline( pipeline = Pipeline(
[ [

View File

@@ -19,7 +19,10 @@ from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.processors.aggregators.llm_context import LLMContext from pipecat.processors.aggregators.llm_context import LLMContext
from pipecat.processors.aggregators.llm_response_universal import LLMContextAggregatorPair from pipecat.processors.aggregators.llm_response_universal import (
LLMContextAggregatorPair,
LLMUserAggregatorParams,
)
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport from pipecat.runner.utils import create_transport
from pipecat.services.cartesia.tts import CartesiaTTSService from pipecat.services.cartesia.tts import CartesiaTTSService
@@ -98,17 +101,14 @@ transport_params = {
"daily": lambda: DailyParams( "daily": lambda: DailyParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"webrtc": lambda: TransportParams( "webrtc": lambda: TransportParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
} }
@@ -175,7 +175,10 @@ Remember, your responses should be short. Just one or two sentences, usually. Re
tools, tools,
) )
user_aggregator, assistant_aggregator = LLMContextAggregatorPair(context) user_aggregator, assistant_aggregator = LLMContextAggregatorPair(
context,
user_params=LLMUserAggregatorParams(vad_analyzer=SileroVADAnalyzer()),
)
pipeline = Pipeline( pipeline = Pipeline(
[ [

View File

@@ -17,7 +17,10 @@ from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.processors.aggregators.llm_context import LLMContext from pipecat.processors.aggregators.llm_context import LLMContext
from pipecat.processors.aggregators.llm_response_universal import LLMContextAggregatorPair from pipecat.processors.aggregators.llm_response_universal import (
LLMContextAggregatorPair,
LLMUserAggregatorParams,
)
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import ( from pipecat.runner.utils import (
create_transport, create_transport,
@@ -46,13 +49,11 @@ transport_params = {
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
video_in_enabled=True, video_in_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"webrtc": lambda: TransportParams( "webrtc": lambda: TransportParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
video_in_enabled=True, video_in_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
} }
@@ -103,7 +104,10 @@ Remember, your responses should be short. Just one or two sentences, usually. Re
[{"role": "user", "content": "Say hello!"}], [{"role": "user", "content": "Say hello!"}],
) )
user_aggregator, assistant_aggregator = LLMContextAggregatorPair(context) user_aggregator, assistant_aggregator = LLMContextAggregatorPair(
context,
user_params=LLMUserAggregatorParams(vad_analyzer=SileroVADAnalyzer()),
)
pipeline = Pipeline( pipeline = Pipeline(
[ [

View File

@@ -21,7 +21,10 @@ from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.processors.aggregators.llm_context import LLMContext from pipecat.processors.aggregators.llm_context import LLMContext
from pipecat.processors.aggregators.llm_response_universal import LLMContextAggregatorPair from pipecat.processors.aggregators.llm_response_universal import (
LLMContextAggregatorPair,
LLMUserAggregatorParams,
)
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport from pipecat.runner.utils import create_transport
from pipecat.services.deepgram.stt import DeepgramSTTService from pipecat.services.deepgram.stt import DeepgramSTTService
@@ -153,17 +156,14 @@ transport_params = {
"daily": lambda: DailyParams( "daily": lambda: DailyParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"webrtc": lambda: TransportParams( "webrtc": lambda: TransportParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
} }
@@ -214,7 +214,10 @@ Remember, your responses should be short. Just one or two sentences, usually."""
llm.register_function("load_conversation", load_conversation) llm.register_function("load_conversation", load_conversation)
context = LLMContext([{"role": "user", "content": "Say hello!"}], tools) context = LLMContext([{"role": "user", "content": "Say hello!"}], tools)
user_aggregator, assistant_aggregator = LLMContextAggregatorPair(context) user_aggregator, assistant_aggregator = LLMContextAggregatorPair(
context,
user_params=LLMUserAggregatorParams(vad_analyzer=SileroVADAnalyzer()),
)
pipeline = Pipeline( pipeline = Pipeline(
[ [

View File

@@ -21,7 +21,10 @@ from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.processors.aggregators.llm_context import LLMContext from pipecat.processors.aggregators.llm_context import LLMContext
from pipecat.processors.aggregators.llm_response_universal import LLMContextAggregatorPair from pipecat.processors.aggregators.llm_response_universal import (
LLMContextAggregatorPair,
LLMUserAggregatorParams,
)
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport from pipecat.runner.utils import create_transport
from pipecat.services.aws.nova_sonic.llm import AWSNovaSonicLLMService from pipecat.services.aws.nova_sonic.llm import AWSNovaSonicLLMService
@@ -189,17 +192,14 @@ transport_params = {
"daily": lambda: DailyParams( "daily": lambda: DailyParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"webrtc": lambda: TransportParams( "webrtc": lambda: TransportParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
} }
@@ -236,7 +236,10 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
llm.register_function("load_conversation", load_conversation) llm.register_function("load_conversation", load_conversation)
context = LLMContext(tools=tools) context = LLMContext(tools=tools)
user_aggregator, assistant_aggregator = LLMContextAggregatorPair(context) user_aggregator, assistant_aggregator = LLMContextAggregatorPair(
context,
user_params=LLMUserAggregatorParams(vad_analyzer=SileroVADAnalyzer()),
)
pipeline = Pipeline( pipeline = Pipeline(
[ [

View File

@@ -28,7 +28,10 @@ from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.processors.aggregators.llm_context import LLMContext from pipecat.processors.aggregators.llm_context import LLMContext
from pipecat.processors.aggregators.llm_response_universal import LLMContextAggregatorPair from pipecat.processors.aggregators.llm_response_universal import (
LLMContextAggregatorPair,
LLMUserAggregatorParams,
)
from pipecat.processors.frame_processor import FrameProcessor from pipecat.processors.frame_processor import FrameProcessor
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport from pipecat.runner.utils import create_transport
@@ -270,17 +273,14 @@ transport_params = {
"daily": lambda: DailyParams( "daily": lambda: DailyParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"webrtc": lambda: TransportParams( "webrtc": lambda: TransportParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
} }
@@ -324,7 +324,10 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
] ]
context = LLMContext(messages) context = LLMContext(messages)
context_aggregator = LLMContextAggregatorPair(context) context_aggregator = LLMContextAggregatorPair(
context,
user_params=LLMUserAggregatorParams(vad_analyzer=SileroVADAnalyzer()),
)
audio_collector = UserAudioCollector(context, context_aggregator.user()) audio_collector = UserAudioCollector(context, context_aggregator.user())
input_transcription_context_filter = InputTranscriptionContextFilter() input_transcription_context_filter = InputTranscriptionContextFilter()
transcription_frames_emitter = InputTranscriptionFrameEmitter() transcription_frames_emitter = InputTranscriptionFrameEmitter()

View File

@@ -24,6 +24,7 @@ from pipecat.processors.aggregators.llm_context import LLMContext
from pipecat.processors.aggregators.llm_response_universal import ( from pipecat.processors.aggregators.llm_response_universal import (
AssistantTurnStoppedMessage, AssistantTurnStoppedMessage,
LLMContextAggregatorPair, LLMContextAggregatorPair,
LLMUserAggregatorParams,
UserTurnStoppedMessage, UserTurnStoppedMessage,
) )
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
@@ -87,17 +88,14 @@ transport_params = {
"daily": lambda: DailyParams( "daily": lambda: DailyParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"webrtc": lambda: TransportParams( "webrtc": lambda: TransportParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
} }
@@ -147,7 +145,10 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
# Set up context and context management. # Set up context and context management.
context = LLMContext(tools=tools) context = LLMContext(tools=tools)
user_aggregator, assistant_aggregator = LLMContextAggregatorPair(context) user_aggregator, assistant_aggregator = LLMContextAggregatorPair(
context,
user_params=LLMUserAggregatorParams(vad_analyzer=SileroVADAnalyzer()),
)
# Build the pipeline # Build the pipeline
pipeline = Pipeline( pipeline = Pipeline(

View File

@@ -19,6 +19,7 @@ from pipecat.processors.aggregators.llm_context import LLMContext
from pipecat.processors.aggregators.llm_response_universal import ( from pipecat.processors.aggregators.llm_response_universal import (
AssistantTurnStoppedMessage, AssistantTurnStoppedMessage,
LLMContextAggregatorPair, LLMContextAggregatorPair,
LLMUserAggregatorParams,
) )
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport from pipecat.runner.utils import create_transport
@@ -34,17 +35,14 @@ transport_params = {
"daily": lambda: DailyParams( "daily": lambda: DailyParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"webrtc": lambda: TransportParams( "webrtc": lambda: TransportParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
} }
@@ -65,7 +63,10 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
] ]
context = LLMContext(messages) context = LLMContext(messages)
user_aggregator, assistant_aggregator = LLMContextAggregatorPair(context) user_aggregator, assistant_aggregator = LLMContextAggregatorPair(
context,
user_params=LLMUserAggregatorParams(vad_analyzer=SileroVADAnalyzer()),
)
pipeline = Pipeline( pipeline = Pipeline(
[ [

View File

@@ -19,6 +19,7 @@ from pipecat.processors.aggregators.llm_context import LLMContext
from pipecat.processors.aggregators.llm_response_universal import ( from pipecat.processors.aggregators.llm_response_universal import (
AssistantTurnStoppedMessage, AssistantTurnStoppedMessage,
LLMContextAggregatorPair, LLMContextAggregatorPair,
LLMUserAggregatorParams,
) )
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport from pipecat.runner.utils import create_transport
@@ -34,17 +35,14 @@ transport_params = {
"daily": lambda: DailyParams( "daily": lambda: DailyParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"webrtc": lambda: TransportParams( "webrtc": lambda: TransportParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
} }
@@ -62,7 +60,10 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
] ]
context = LLMContext(messages) context = LLMContext(messages)
user_aggregator, assistant_aggregator = LLMContextAggregatorPair(context) user_aggregator, assistant_aggregator = LLMContextAggregatorPair(
context,
user_params=LLMUserAggregatorParams(vad_analyzer=SileroVADAnalyzer()),
)
pipeline = Pipeline( pipeline = Pipeline(
[ [

View File

@@ -16,7 +16,10 @@ from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.processors.aggregators.llm_context import LLMContext from pipecat.processors.aggregators.llm_context import LLMContext
from pipecat.processors.aggregators.llm_response_universal import LLMContextAggregatorPair from pipecat.processors.aggregators.llm_response_universal import (
LLMContextAggregatorPair,
LLMUserAggregatorParams,
)
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport from pipecat.runner.utils import create_transport
from pipecat.services.google.gemini_live.vertex.llm import GeminiLiveVertexLLMService from pipecat.services.google.gemini_live.vertex.llm import GeminiLiveVertexLLMService
@@ -30,17 +33,14 @@ transport_params = {
"daily": lambda: DailyParams( "daily": lambda: DailyParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"webrtc": lambda: TransportParams( "webrtc": lambda: TransportParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
} }
@@ -58,7 +58,10 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
) )
context = LLMContext() context = LLMContext()
user_aggregator, assistant_aggregator = LLMContextAggregatorPair(context) user_aggregator, assistant_aggregator = LLMContextAggregatorPair(
context,
user_params=LLMUserAggregatorParams(vad_analyzer=SileroVADAnalyzer()),
)
pipeline = Pipeline( pipeline = Pipeline(
[ [

View File

@@ -16,7 +16,10 @@ from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.processors.aggregators.llm_context import LLMContext from pipecat.processors.aggregators.llm_context import LLMContext
from pipecat.processors.aggregators.llm_response_universal import LLMContextAggregatorPair from pipecat.processors.aggregators.llm_response_universal import (
LLMContextAggregatorPair,
LLMUserAggregatorParams,
)
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport from pipecat.runner.utils import create_transport
from pipecat.services.google.gemini_live.llm import GeminiLiveLLMService from pipecat.services.google.gemini_live.llm import GeminiLiveLLMService
@@ -30,17 +33,14 @@ transport_params = {
"daily": lambda: DailyParams( "daily": lambda: DailyParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"webrtc": lambda: TransportParams( "webrtc": lambda: TransportParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
} }
@@ -56,7 +56,10 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
) )
context = LLMContext() context = LLMContext()
user_aggregator, assistant_aggregator = LLMContextAggregatorPair(context) user_aggregator, assistant_aggregator = LLMContextAggregatorPair(
context,
user_params=LLMUserAggregatorParams(vad_analyzer=SileroVADAnalyzer()),
)
pipeline = Pipeline( pipeline = Pipeline(
[ [

View File

@@ -21,6 +21,7 @@ from pipecat.processors.aggregators.llm_context import LLMContext
from pipecat.processors.aggregators.llm_response_universal import ( from pipecat.processors.aggregators.llm_response_universal import (
AssistantTurnStoppedMessage, AssistantTurnStoppedMessage,
LLMContextAggregatorPair, LLMContextAggregatorPair,
LLMUserAggregatorParams,
) )
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport from pipecat.runner.utils import create_transport
@@ -35,17 +36,14 @@ transport_params = {
"daily": lambda: DailyParams( "daily": lambda: DailyParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"webrtc": lambda: TransportParams( "webrtc": lambda: TransportParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
} }
@@ -73,7 +71,10 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
] ]
context = LLMContext(messages) context = LLMContext(messages)
user_aggregator, assistant_aggregator = LLMContextAggregatorPair(context) user_aggregator, assistant_aggregator = LLMContextAggregatorPair(
context,
user_params=LLMUserAggregatorParams(vad_analyzer=SileroVADAnalyzer()),
)
pipeline = Pipeline( pipeline = Pipeline(
[ [

View File

@@ -19,6 +19,7 @@ from pipecat.processors.aggregators.llm_context import LLMContext
from pipecat.processors.aggregators.llm_response_universal import ( from pipecat.processors.aggregators.llm_response_universal import (
AssistantTurnStoppedMessage, AssistantTurnStoppedMessage,
LLMContextAggregatorPair, LLMContextAggregatorPair,
LLMUserAggregatorParams,
) )
from pipecat.runner.types import RunnerArguments from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport from pipecat.runner.utils import create_transport
@@ -34,17 +35,14 @@ transport_params = {
"daily": lambda: DailyParams( "daily": lambda: DailyParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"twilio": lambda: FastAPIWebsocketParams( "twilio": lambda: FastAPIWebsocketParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
"webrtc": lambda: TransportParams( "webrtc": lambda: TransportParams(
audio_in_enabled=True, audio_in_enabled=True,
audio_out_enabled=True, audio_out_enabled=True,
vad_analyzer=SileroVADAnalyzer(),
), ),
} }
@@ -62,7 +60,10 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
] ]
context = LLMContext(messages) context = LLMContext(messages)
user_aggregator, assistant_aggregator = LLMContextAggregatorPair(context) user_aggregator, assistant_aggregator = LLMContextAggregatorPair(
context,
user_params=LLMUserAggregatorParams(vad_analyzer=SileroVADAnalyzer()),
)
pipeline = Pipeline( pipeline = Pipeline(
[ [

View File

@@ -150,8 +150,9 @@ class BaseInputTransport(FrameProcessor):
with warnings.catch_warnings(): with warnings.catch_warnings():
warnings.simplefilter("always") warnings.simplefilter("always")
warnings.warn( warnings.warn(
"Parameter 'vad_analyzer' is deprecated, use `LLMUserAggregator`'s new " "Parameter 'vad_analyzer' is deprecated. Use `LLMUserAggregator`'s "
"`vad_analyzer` parameter instead.", "`vad_analyzer` parameter, or `VADProcessor` if no `LLMUserAggregator` "
"is needed.",
DeprecationWarning, DeprecationWarning,
) )

View File

@@ -115,8 +115,9 @@ class TransportParams(BaseModel):
vad_analyzer: Voice Activity Detection analyzer instance. vad_analyzer: Voice Activity Detection analyzer instance.
.. deprecated:: 0.0.101 .. deprecated:: 0.0.101
The `vad_analyzer` parameter is deprecated, use `LLMUSerAggregator`'s The `vad_analyzer` parameter is deprecated. Use `LLMUserAggregator`'s
new `vad_analyzer` parameter instead. `vad_analyzer` parameter, or `VADProcessor` if no `LLMUserAggregator`
is needed.
turn_analyzer: Turn-taking analyzer instance for conversation management. turn_analyzer: Turn-taking analyzer instance for conversation management.