diff --git a/CHANGELOG.md b/CHANGELOG.md index e8e93ab8f..efd40e61b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- The `PipelineParams` arg `allow_interruptions` now defaults to `True`. + - `TavusTransport` and `TavusVideoService` now send audio to Tavus using WebRTC audio tracks instead of `app-messages` over WebSocket. This should improve the overall audio quality. diff --git a/examples/chatbot-audio-recording/bot.py b/examples/chatbot-audio-recording/bot.py index 128c97c7e..a6c61cba8 100644 --- a/examples/chatbot-audio-recording/bot.py +++ b/examples/chatbot-audio-recording/bot.py @@ -133,7 +133,8 @@ async def main(): params=PipelineParams( audio_in_sample_rate=16000, audio_out_sample_rate=16000, - allow_interruptions=True, + enable_metrics=True, + enable_usage_metrics=True, ), ) diff --git a/examples/daily-custom-tracks/bot.py b/examples/daily-custom-tracks/bot.py index 17d0e2dfa..1b0b3b64d 100644 --- a/examples/daily-custom-tracks/bot.py +++ b/examples/daily-custom-tracks/bot.py @@ -71,6 +71,8 @@ async def main(): params=PipelineParams( audio_in_sample_rate=16000, audio_out_sample_rate=16000, + enable_metrics=True, + enable_usage_metrics=True, ), ) diff --git a/examples/daily-multi-translation/bot.py b/examples/daily-multi-translation/bot.py index 5f5037584..67a11863a 100644 --- a/examples/daily-multi-translation/bot.py +++ b/examples/daily-multi-translation/bot.py @@ -148,10 +148,8 @@ async def main(): params=PipelineParams( audio_in_sample_rate=16000, audio_out_sample_rate=16000, - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), observers=[TranscriptionLogObserver()], ) diff --git a/examples/deployment/flyio-example/bot.py b/examples/deployment/flyio-example/bot.py index 45d94a9e3..25b30f1b3 100644 --- a/examples/deployment/flyio-example/bot.py +++ b/examples/deployment/flyio-example/bot.py @@ -75,7 +75,13 @@ async def main(room_url: str, token: str): ] ) - task = PipelineTask(pipeline, params=PipelineParams(allow_interruptions=True)) + task = PipelineTask( + pipeline, + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), + ) @transport.event_handler("on_first_participant_joined") async def on_first_participant_joined(transport, participant): diff --git a/examples/deployment/modal-example/server/src/bot_gemini.py b/examples/deployment/modal-example/server/src/bot_gemini.py index 6c19c9923..39e4d0958 100644 --- a/examples/deployment/modal-example/server/src/bot_gemini.py +++ b/examples/deployment/modal-example/server/src/bot_gemini.py @@ -170,7 +170,6 @@ async def run_bot(room_url: str, token: str): task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/deployment/modal-example/server/src/bot_openai.py b/examples/deployment/modal-example/server/src/bot_openai.py index f85e61a81..5d920bbba 100644 --- a/examples/deployment/modal-example/server/src/bot_openai.py +++ b/examples/deployment/modal-example/server/src/bot_openai.py @@ -198,7 +198,6 @@ async def run_bot(room_url: str, token: str): task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/deployment/modal-example/server/src/bot_vllm.py b/examples/deployment/modal-example/server/src/bot_vllm.py index 3572fae88..af6e4c0a7 100644 --- a/examples/deployment/modal-example/server/src/bot_vllm.py +++ b/examples/deployment/modal-example/server/src/bot_vllm.py @@ -211,7 +211,6 @@ async def run_bot(room_url: str, token: str): task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/deployment/pipecat-cloud-example/bot.py b/examples/deployment/pipecat-cloud-example/bot.py index 5f355b881..c521954fc 100644 --- a/examples/deployment/pipecat-cloud-example/bot.py +++ b/examples/deployment/pipecat-cloud-example/bot.py @@ -67,10 +67,8 @@ async def main(transport: DailyTransport): task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/fal-smart-turn/server/bot.py b/examples/fal-smart-turn/server/bot.py index 8c3810535..1b94f3e31 100644 --- a/examples/fal-smart-turn/server/bot.py +++ b/examples/fal-smart-turn/server/bot.py @@ -192,7 +192,6 @@ async def main(transport: DailyTransport): task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/03b-still-frame-imagen.py b/examples/foundational/03b-still-frame-imagen.py index 83c68ef19..0414fe8de 100644 --- a/examples/foundational/03b-still-frame-imagen.py +++ b/examples/foundational/03b-still-frame-imagen.py @@ -47,7 +47,10 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( Pipeline([imagegen, transport.output()]), - params=PipelineParams(enable_metrics=True), + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), ) # Register an event handler so we can play the audio when the client joins diff --git a/examples/foundational/04-transports-small-webrtc.py b/examples/foundational/04-transports-small-webrtc.py index 627c13ad1..ffb1d9c9b 100644 --- a/examples/foundational/04-transports-small-webrtc.py +++ b/examples/foundational/04-transports-small-webrtc.py @@ -93,10 +93,8 @@ async def run_example(webrtc_connection: SmallWebRTCConnection): task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/04a-transports-daily.py b/examples/foundational/04a-transports-daily.py index a968c3abb..e330b53a9 100644 --- a/examples/foundational/04a-transports-daily.py +++ b/examples/foundational/04a-transports-daily.py @@ -75,10 +75,8 @@ async def main(): task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/04b-transports-livekit.py b/examples/foundational/04b-transports-livekit.py index 3cd5c7eea..b7c4887c3 100644 --- a/examples/foundational/04b-transports-livekit.py +++ b/examples/foundational/04b-transports-livekit.py @@ -158,7 +158,8 @@ async def main(): ], ), params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True + enable_metrics=True, + enable_usage_metrics=True, ), ) diff --git a/examples/foundational/06a-image-sync.py b/examples/foundational/06a-image-sync.py index 61ba1c6f4..d8b2e7c04 100644 --- a/examples/foundational/06a-image-sync.py +++ b/examples/foundational/06a-image-sync.py @@ -133,10 +133,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07-interruptible-cartesia-http.py b/examples/foundational/07-interruptible-cartesia-http.py index 75f8a0ddb..eff98b1e7 100644 --- a/examples/foundational/07-interruptible-cartesia-http.py +++ b/examples/foundational/07-interruptible-cartesia-http.py @@ -84,10 +84,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07-interruptible.py b/examples/foundational/07-interruptible.py index 9429f5a33..b69aaba92 100644 --- a/examples/foundational/07-interruptible.py +++ b/examples/foundational/07-interruptible.py @@ -83,10 +83,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07b-interruptible-langchain.py b/examples/foundational/07b-interruptible-langchain.py index 2a5e72c1a..55bfa6cdf 100644 --- a/examples/foundational/07b-interruptible-langchain.py +++ b/examples/foundational/07b-interruptible-langchain.py @@ -113,10 +113,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07c-interruptible-deepgram-vad.py b/examples/foundational/07c-interruptible-deepgram-vad.py index f228dcecd..86cb363e2 100644 --- a/examples/foundational/07c-interruptible-deepgram-vad.py +++ b/examples/foundational/07c-interruptible-deepgram-vad.py @@ -87,10 +87,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07c-interruptible-deepgram.py b/examples/foundational/07c-interruptible-deepgram.py index f523f2aa5..cce7c245d 100644 --- a/examples/foundational/07c-interruptible-deepgram.py +++ b/examples/foundational/07c-interruptible-deepgram.py @@ -81,10 +81,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07d-interruptible-elevenlabs-http.py b/examples/foundational/07d-interruptible-elevenlabs-http.py index eb7e03bf5..395b9331c 100644 --- a/examples/foundational/07d-interruptible-elevenlabs-http.py +++ b/examples/foundational/07d-interruptible-elevenlabs-http.py @@ -88,10 +88,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07d-interruptible-elevenlabs.py b/examples/foundational/07d-interruptible-elevenlabs.py index 945c0e47b..491f15c4d 100644 --- a/examples/foundational/07d-interruptible-elevenlabs.py +++ b/examples/foundational/07d-interruptible-elevenlabs.py @@ -84,10 +84,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07e-interruptible-playht-http.py b/examples/foundational/07e-interruptible-playht-http.py index 534cd6927..d628714c2 100644 --- a/examples/foundational/07e-interruptible-playht-http.py +++ b/examples/foundational/07e-interruptible-playht-http.py @@ -84,10 +84,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07e-interruptible-playht.py b/examples/foundational/07e-interruptible-playht.py index 1bbb04fe2..d5b24dc49 100644 --- a/examples/foundational/07e-interruptible-playht.py +++ b/examples/foundational/07e-interruptible-playht.py @@ -86,10 +86,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07f-interruptible-azure.py b/examples/foundational/07f-interruptible-azure.py index 0da653f4d..1e8e7d7f3 100644 --- a/examples/foundational/07f-interruptible-azure.py +++ b/examples/foundational/07f-interruptible-azure.py @@ -90,10 +90,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07g-interruptible-openai.py b/examples/foundational/07g-interruptible-openai.py index 5d028603e..fb85c1af4 100644 --- a/examples/foundational/07g-interruptible-openai.py +++ b/examples/foundational/07g-interruptible-openai.py @@ -84,11 +84,9 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, audio_out_sample_rate=24000, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07h-interruptible-openpipe.py b/examples/foundational/07h-interruptible-openpipe.py index e488ad6db..719067b21 100644 --- a/examples/foundational/07h-interruptible-openpipe.py +++ b/examples/foundational/07h-interruptible-openpipe.py @@ -89,10 +89,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07i-interruptible-xtts.py b/examples/foundational/07i-interruptible-xtts.py index 32c7a6348..32dddd965 100644 --- a/examples/foundational/07i-interruptible-xtts.py +++ b/examples/foundational/07i-interruptible-xtts.py @@ -87,10 +87,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07j-interruptible-gladia.py b/examples/foundational/07j-interruptible-gladia.py index 6975cfec7..4cf7b2f04 100644 --- a/examples/foundational/07j-interruptible-gladia.py +++ b/examples/foundational/07j-interruptible-gladia.py @@ -92,10 +92,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07k-interruptible-lmnt.py b/examples/foundational/07k-interruptible-lmnt.py index c3c46ab15..3d4616276 100644 --- a/examples/foundational/07k-interruptible-lmnt.py +++ b/examples/foundational/07k-interruptible-lmnt.py @@ -80,10 +80,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07l-interruptible-groq.py b/examples/foundational/07l-interruptible-groq.py index 3e73194ab..6acccee63 100644 --- a/examples/foundational/07l-interruptible-groq.py +++ b/examples/foundational/07l-interruptible-groq.py @@ -85,7 +85,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/07m-interruptible-aws.py b/examples/foundational/07m-interruptible-aws.py index 78ef705a1..5cd1a579a 100644 --- a/examples/foundational/07m-interruptible-aws.py +++ b/examples/foundational/07m-interruptible-aws.py @@ -87,10 +87,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07n-interruptible-google.py b/examples/foundational/07n-interruptible-google.py index 7e032513c..e8613e082 100644 --- a/examples/foundational/07n-interruptible-google.py +++ b/examples/foundational/07n-interruptible-google.py @@ -88,10 +88,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07o-interruptible-assemblyai.py b/examples/foundational/07o-interruptible-assemblyai.py index 72963c0dc..2a1a8da8d 100644 --- a/examples/foundational/07o-interruptible-assemblyai.py +++ b/examples/foundational/07o-interruptible-assemblyai.py @@ -86,10 +86,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07p-interruptible-krisp.py b/examples/foundational/07p-interruptible-krisp.py index 21046a3b9..167749e77 100644 --- a/examples/foundational/07p-interruptible-krisp.py +++ b/examples/foundational/07p-interruptible-krisp.py @@ -84,10 +84,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07q-interruptible-rime-http.py b/examples/foundational/07q-interruptible-rime-http.py index 132b743ab..7790a1c82 100644 --- a/examples/foundational/07q-interruptible-rime-http.py +++ b/examples/foundational/07q-interruptible-rime-http.py @@ -89,10 +89,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07q-interruptible-rime.py b/examples/foundational/07q-interruptible-rime.py index d859b83aa..fb5e453fd 100644 --- a/examples/foundational/07q-interruptible-rime.py +++ b/examples/foundational/07q-interruptible-rime.py @@ -83,10 +83,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07r-interruptible-riva-nim.py b/examples/foundational/07r-interruptible-riva-nim.py index 1d202bcb5..7092f6633 100644 --- a/examples/foundational/07r-interruptible-riva-nim.py +++ b/examples/foundational/07r-interruptible-riva-nim.py @@ -80,10 +80,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07s-interruptible-google-audio-in.py b/examples/foundational/07s-interruptible-google-audio-in.py index 9f8c9fbbf..c10ca02d0 100644 --- a/examples/foundational/07s-interruptible-google-audio-in.py +++ b/examples/foundational/07s-interruptible-google-audio-in.py @@ -258,7 +258,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/07t-interruptible-fish.py b/examples/foundational/07t-interruptible-fish.py index 50eee52ec..69babfc05 100644 --- a/examples/foundational/07t-interruptible-fish.py +++ b/examples/foundational/07t-interruptible-fish.py @@ -84,10 +84,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07u-interruptible-ultravox.py b/examples/foundational/07u-interruptible-ultravox.py index 23bc409f3..b81f43461 100644 --- a/examples/foundational/07u-interruptible-ultravox.py +++ b/examples/foundational/07u-interruptible-ultravox.py @@ -77,8 +77,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, + enable_usage_metrics=True, ), ) diff --git a/examples/foundational/07v-interruptible-neuphonic-http.py b/examples/foundational/07v-interruptible-neuphonic-http.py index 453caa00d..fda109c8f 100644 --- a/examples/foundational/07v-interruptible-neuphonic-http.py +++ b/examples/foundational/07v-interruptible-neuphonic-http.py @@ -84,10 +84,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07v-interruptible-neuphonic.py b/examples/foundational/07v-interruptible-neuphonic.py index 934875db4..34aee1977 100644 --- a/examples/foundational/07v-interruptible-neuphonic.py +++ b/examples/foundational/07v-interruptible-neuphonic.py @@ -83,10 +83,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07w-interruptible-fal.py b/examples/foundational/07w-interruptible-fal.py index 2b00c4b27..2ef942ad2 100644 --- a/examples/foundational/07w-interruptible-fal.py +++ b/examples/foundational/07w-interruptible-fal.py @@ -86,10 +86,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07x-interruptible-local.py b/examples/foundational/07x-interruptible-local.py index 94097d7c9..48725d9bd 100644 --- a/examples/foundational/07x-interruptible-local.py +++ b/examples/foundational/07x-interruptible-local.py @@ -70,10 +70,8 @@ async def main(): task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07y-interruptible-minimax.py b/examples/foundational/07y-interruptible-minimax.py index b01a51b57..97bb655d3 100644 --- a/examples/foundational/07y-interruptible-minimax.py +++ b/examples/foundational/07y-interruptible-minimax.py @@ -90,10 +90,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/07z-interruptible-sarvam.py b/examples/foundational/07z-interruptible-sarvam.py index 02225b209..2fdf1634a 100644 --- a/examples/foundational/07z-interruptible-sarvam.py +++ b/examples/foundational/07z-interruptible-sarvam.py @@ -89,10 +89,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/10-wake-phrase.py b/examples/foundational/10-wake-phrase.py index 186ff97aa..fb72e6a2a 100644 --- a/examples/foundational/10-wake-phrase.py +++ b/examples/foundational/10-wake-phrase.py @@ -85,7 +85,13 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si ] ) - task = PipelineTask(pipeline, params=PipelineParams(allow_interruptions=True)) + task = PipelineTask( + pipeline, + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), + ) @transport.event_handler("on_client_connected") async def on_client_connected(transport, client): diff --git a/examples/foundational/12a-describe-video-gemini-flash.py b/examples/foundational/12a-describe-video-gemini-flash.py index fa2d9aec6..1c762e067 100644 --- a/examples/foundational/12a-describe-video-gemini-flash.py +++ b/examples/foundational/12a-describe-video-gemini-flash.py @@ -101,7 +101,10 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, - params=PipelineParams(allow_interruptions=True), + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), ) @transport.event_handler("on_client_connected") diff --git a/examples/foundational/12b-describe-video-gpt-4o.py b/examples/foundational/12b-describe-video-gpt-4o.py index 3c7937f54..c5492c022 100644 --- a/examples/foundational/12b-describe-video-gpt-4o.py +++ b/examples/foundational/12b-describe-video-gpt-4o.py @@ -101,7 +101,10 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, - params=PipelineParams(allow_interruptions=True), + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), ) @transport.event_handler("on_client_connected") diff --git a/examples/foundational/12c-describe-video-anthropic.py b/examples/foundational/12c-describe-video-anthropic.py index 0e82f1077..34b7d6bed 100644 --- a/examples/foundational/12c-describe-video-anthropic.py +++ b/examples/foundational/12c-describe-video-anthropic.py @@ -101,7 +101,10 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, - params=PipelineParams(allow_interruptions=True), + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), ) @transport.event_handler("on_client_connected") diff --git a/examples/foundational/13e-whisper-mlx.py b/examples/foundational/13e-whisper-mlx.py index 5d7dc53e3..d06788570 100644 --- a/examples/foundational/13e-whisper-mlx.py +++ b/examples/foundational/13e-whisper-mlx.py @@ -84,7 +84,7 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si pipeline, params=PipelineParams( enable_metrics=True, - report_only_initial_ttfb=False, + enable_usage_metrics=True, ), ) diff --git a/examples/foundational/14-function-calling.py b/examples/foundational/14-function-calling.py index b4e09c99a..b8fddd227 100644 --- a/examples/foundational/14-function-calling.py +++ b/examples/foundational/14-function-calling.py @@ -134,10 +134,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/14a-function-calling-anthropic.py b/examples/foundational/14a-function-calling-anthropic.py index bf34e211c..cb0766262 100644 --- a/examples/foundational/14a-function-calling-anthropic.py +++ b/examples/foundational/14a-function-calling-anthropic.py @@ -127,8 +127,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, + enable_usage_metrics=True, ), ) diff --git a/examples/foundational/14b-function-calling-anthropic-video.py b/examples/foundational/14b-function-calling-anthropic-video.py index 04049984f..b9d9b2f71 100644 --- a/examples/foundational/14b-function-calling-anthropic-video.py +++ b/examples/foundational/14b-function-calling-anthropic-video.py @@ -172,8 +172,8 @@ If you need to use a tool, simply use the tool. Do not tell the user the tool yo task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, + enable_usage_metrics=True, ), ) diff --git a/examples/foundational/14c-function-calling-together.py b/examples/foundational/14c-function-calling-together.py index 1188f32e2..e1fc55eb3 100644 --- a/examples/foundational/14c-function-calling-together.py +++ b/examples/foundational/14c-function-calling-together.py @@ -16,7 +16,7 @@ from pipecat.audio.vad.silero import SileroVADAnalyzer from pipecat.frames.frames import TTSSpeakFrame from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner -from pipecat.pipeline.task import PipelineTask +from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext from pipecat.services.cartesia.tts import CartesiaTTSService from pipecat.services.deepgram.stt import DeepgramSTTService @@ -116,7 +116,13 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si ] ) - task = PipelineTask(pipeline) + task = PipelineTask( + pipeline, + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), + ) @transport.event_handler("on_client_connected") async def on_client_connected(transport, client): diff --git a/examples/foundational/14d-function-calling-video.py b/examples/foundational/14d-function-calling-video.py index 7761e1be2..a6f21922d 100644 --- a/examples/foundational/14d-function-calling-video.py +++ b/examples/foundational/14d-function-calling-video.py @@ -17,7 +17,7 @@ from pipecat.audio.vad.silero import SileroVADAnalyzer from pipecat.examples.run import get_transport_client_id, maybe_capture_participant_camera from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner -from pipecat.pipeline.task import PipelineTask +from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext from pipecat.services.cartesia.tts import CartesiaTTSService from pipecat.services.deepgram.stt import DeepgramSTTService @@ -158,7 +158,13 @@ indicate you should use the get_image tool are: ] ) - task = PipelineTask(pipeline) + task = PipelineTask( + pipeline, + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), + ) @transport.event_handler("on_client_connected") async def on_client_connected(transport, client): diff --git a/examples/foundational/14e-function-calling-google.py b/examples/foundational/14e-function-calling-google.py index ccbe952fb..92ebe4135 100644 --- a/examples/foundational/14e-function-calling-google.py +++ b/examples/foundational/14e-function-calling-google.py @@ -183,7 +183,6 @@ indicate you should use the get_image tool are: task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/14f-function-calling-groq.py b/examples/foundational/14f-function-calling-groq.py index 3ff56a915..d527642d0 100644 --- a/examples/foundational/14f-function-calling-groq.py +++ b/examples/foundational/14f-function-calling-groq.py @@ -121,7 +121,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/14g-function-calling-grok.py b/examples/foundational/14g-function-calling-grok.py index ce3349ecb..00aa32aa2 100644 --- a/examples/foundational/14g-function-calling-grok.py +++ b/examples/foundational/14g-function-calling-grok.py @@ -111,7 +111,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/14h-function-calling-azure.py b/examples/foundational/14h-function-calling-azure.py index 25cf7defa..cf8480c75 100644 --- a/examples/foundational/14h-function-calling-azure.py +++ b/examples/foundational/14h-function-calling-azure.py @@ -120,7 +120,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/14i-function-calling-fireworks.py b/examples/foundational/14i-function-calling-fireworks.py index 028d9fa64..0921d73d6 100644 --- a/examples/foundational/14i-function-calling-fireworks.py +++ b/examples/foundational/14i-function-calling-fireworks.py @@ -119,7 +119,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/14j-function-calling-nim.py b/examples/foundational/14j-function-calling-nim.py index d254e0d4f..0365a4369 100644 --- a/examples/foundational/14j-function-calling-nim.py +++ b/examples/foundational/14j-function-calling-nim.py @@ -117,7 +117,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/14k-function-calling-cerebras.py b/examples/foundational/14k-function-calling-cerebras.py index 70ffceffd..5a6bcf91c 100644 --- a/examples/foundational/14k-function-calling-cerebras.py +++ b/examples/foundational/14k-function-calling-cerebras.py @@ -126,10 +126,8 @@ Start by asking me for my location. Then, use 'get_weather_current' to give me a task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/14l-function-calling-deepseek.py b/examples/foundational/14l-function-calling-deepseek.py index 7e992942d..814a4147d 100644 --- a/examples/foundational/14l-function-calling-deepseek.py +++ b/examples/foundational/14l-function-calling-deepseek.py @@ -126,10 +126,8 @@ Start by asking me for my location. Then, use 'get_weather_current' to give me a task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/14m-function-calling-openrouter.py b/examples/foundational/14m-function-calling-openrouter.py index 023f725f6..aac0923ca 100644 --- a/examples/foundational/14m-function-calling-openrouter.py +++ b/examples/foundational/14m-function-calling-openrouter.py @@ -120,10 +120,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/14n-function-calling-perplexity.py b/examples/foundational/14n-function-calling-perplexity.py index c4a70d627..144c3a3df 100644 --- a/examples/foundational/14n-function-calling-perplexity.py +++ b/examples/foundational/14n-function-calling-perplexity.py @@ -90,10 +90,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/14o-function-calling-gemini-openai-format.py b/examples/foundational/14o-function-calling-gemini-openai-format.py index 8f0036e07..7d236bf4c 100644 --- a/examples/foundational/14o-function-calling-gemini-openai-format.py +++ b/examples/foundational/14o-function-calling-gemini-openai-format.py @@ -116,7 +116,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/14p-function-calling-gemini-vertex-ai.py b/examples/foundational/14p-function-calling-gemini-vertex-ai.py index 4348b663a..1fc6b0fc4 100644 --- a/examples/foundational/14p-function-calling-gemini-vertex-ai.py +++ b/examples/foundational/14p-function-calling-gemini-vertex-ai.py @@ -122,7 +122,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/14q-function-calling-qwen.py b/examples/foundational/14q-function-calling-qwen.py index 6e07a97e1..7cf2182c0 100644 --- a/examples/foundational/14q-function-calling-qwen.py +++ b/examples/foundational/14q-function-calling-qwen.py @@ -118,10 +118,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/14r-function-calling-aws.py b/examples/foundational/14r-function-calling-aws.py index 4443bec27..a14c37cf9 100644 --- a/examples/foundational/14r-function-calling-aws.py +++ b/examples/foundational/14r-function-calling-aws.py @@ -134,10 +134,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/15-switch-voices.py b/examples/foundational/15-switch-voices.py index 0735b62c0..ce2a358af 100644 --- a/examples/foundational/15-switch-voices.py +++ b/examples/foundational/15-switch-voices.py @@ -147,7 +147,13 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si ] ) - task = PipelineTask(pipeline, params=PipelineParams(allow_interruptions=True)) + task = PipelineTask( + pipeline, + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), + ) @transport.event_handler("on_client_connected") async def on_client_connected(transport, client): diff --git a/examples/foundational/15a-switch-languages.py b/examples/foundational/15a-switch-languages.py index 48bc7e63b..61cc2e3bd 100644 --- a/examples/foundational/15a-switch-languages.py +++ b/examples/foundational/15a-switch-languages.py @@ -135,7 +135,13 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si ] ) - task = PipelineTask(pipeline, params=PipelineParams(allow_interruptions=True)) + task = PipelineTask( + pipeline, + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), + ) @transport.event_handler("on_client_connected") async def on_client_connected(transport, client): diff --git a/examples/foundational/16-gpu-container-local-bot.py b/examples/foundational/16-gpu-container-local-bot.py index c13c2bbff..5d9eff072 100644 --- a/examples/foundational/16-gpu-container-local-bot.py +++ b/examples/foundational/16-gpu-container-local-bot.py @@ -90,8 +90,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, + enable_usage_metrics=True, ), ) diff --git a/examples/foundational/17-detect-user-idle.py b/examples/foundational/17-detect-user-idle.py index 8f5e3ba1d..bb6975829 100644 --- a/examples/foundational/17-detect-user-idle.py +++ b/examples/foundational/17-detect-user-idle.py @@ -117,9 +117,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, - report_only_initial_ttfb=True, + enable_usage_metrics=True, ), ) diff --git a/examples/foundational/19-openai-realtime-beta.py b/examples/foundational/19-openai-realtime-beta.py index 9eb816432..71b20eb0f 100644 --- a/examples/foundational/19-openai-realtime-beta.py +++ b/examples/foundational/19-openai-realtime-beta.py @@ -186,10 +186,8 @@ Remember, your responses should be short. Just one or two sentences, usually.""" task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/19a-azure-realtime-beta.py b/examples/foundational/19a-azure-realtime-beta.py index 54f0302e5..81017188c 100644 --- a/examples/foundational/19a-azure-realtime-beta.py +++ b/examples/foundational/19a-azure-realtime-beta.py @@ -179,10 +179,8 @@ Remember, your responses should be short. Just one or two sentences, usually.""" task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/20a-persistent-context-openai.py b/examples/foundational/20a-persistent-context-openai.py index 360d5f659..9dd6ba42c 100644 --- a/examples/foundational/20a-persistent-context-openai.py +++ b/examples/foundational/20a-persistent-context-openai.py @@ -223,10 +223,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/20b-persistent-context-openai-realtime.py b/examples/foundational/20b-persistent-context-openai-realtime.py index a1ea1f4c5..2315254cb 100644 --- a/examples/foundational/20b-persistent-context-openai-realtime.py +++ b/examples/foundational/20b-persistent-context-openai-realtime.py @@ -233,10 +233,8 @@ Remember, your responses should be short. Just one or two sentences, usually.""" task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/20c-persistent-context-anthropic.py b/examples/foundational/20c-persistent-context-anthropic.py index 686bed5a7..1c5f2c5a0 100644 --- a/examples/foundational/20c-persistent-context-anthropic.py +++ b/examples/foundational/20c-persistent-context-anthropic.py @@ -222,10 +222,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - # report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/20d-persistent-context-gemini.py b/examples/foundational/20d-persistent-context-gemini.py index 5219e3a2e..c9489539d 100644 --- a/examples/foundational/20d-persistent-context-gemini.py +++ b/examples/foundational/20d-persistent-context-gemini.py @@ -275,10 +275,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - # report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/20e-persistent-context-aws-nova-sonic.py b/examples/foundational/20e-persistent-context-aws-nova-sonic.py index 86630ce6d..7fa4c7e54 100644 --- a/examples/foundational/20e-persistent-context-aws-nova-sonic.py +++ b/examples/foundational/20e-persistent-context-aws-nova-sonic.py @@ -242,10 +242,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/21-tavus-transport.py b/examples/foundational/21-tavus-transport.py index 68614a854..8c6bb03fc 100644 --- a/examples/foundational/21-tavus-transport.py +++ b/examples/foundational/21-tavus-transport.py @@ -79,10 +79,8 @@ async def main(): params=PipelineParams( audio_in_sample_rate=16000, audio_out_sample_rate=24000, - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/21a-tavus-video-service.py b/examples/foundational/21a-tavus-video-service.py index db79d343d..532cce847 100644 --- a/examples/foundational/21a-tavus-video-service.py +++ b/examples/foundational/21a-tavus-video-service.py @@ -96,10 +96,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si params=PipelineParams( audio_in_sample_rate=16000, audio_out_sample_rate=24000, - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/22-natural-conversation.py b/examples/foundational/22-natural-conversation.py index 0a49f141c..e3662ac85 100644 --- a/examples/foundational/22-natural-conversation.py +++ b/examples/foundational/22-natural-conversation.py @@ -147,10 +147,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/22b-natural-conversation-proposal.py b/examples/foundational/22b-natural-conversation-proposal.py index b76bfd274..74f280124 100644 --- a/examples/foundational/22b-natural-conversation-proposal.py +++ b/examples/foundational/22b-natural-conversation-proposal.py @@ -353,10 +353,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/22c-natural-conversation-mixed-llms.py b/examples/foundational/22c-natural-conversation-mixed-llms.py index 0bcbf75bd..00d799cc8 100644 --- a/examples/foundational/22c-natural-conversation-mixed-llms.py +++ b/examples/foundational/22c-natural-conversation-mixed-llms.py @@ -564,7 +564,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/22d-natural-conversation-gemini-audio.py b/examples/foundational/22d-natural-conversation-gemini-audio.py index b6b66db0c..b8e21266f 100644 --- a/examples/foundational/22d-natural-conversation-gemini-audio.py +++ b/examples/foundational/22d-natural-conversation-gemini-audio.py @@ -746,7 +746,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/23-bot-background-sound.py b/examples/foundational/23-bot-background-sound.py index 098a62f86..a74b81f65 100644 --- a/examples/foundational/23-bot-background-sound.py +++ b/examples/foundational/23-bot-background-sound.py @@ -103,10 +103,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/24-stt-mute-filter.py b/examples/foundational/24-stt-mute-filter.py index c1c4580fd..2706bebaf 100644 --- a/examples/foundational/24-stt-mute-filter.py +++ b/examples/foundational/24-stt-mute-filter.py @@ -121,7 +121,13 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si ] ) - task = PipelineTask(pipeline, params=PipelineParams(allow_interruptions=True)) + task = PipelineTask( + pipeline, + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), + ) @transport.event_handler("on_client_connected") async def on_client_connected(transport, client): diff --git a/examples/foundational/25-google-audio-in.py b/examples/foundational/25-google-audio-in.py index 83005a3ed..e0c834c23 100644 --- a/examples/foundational/25-google-audio-in.py +++ b/examples/foundational/25-google-audio-in.py @@ -357,7 +357,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/26-gemini-multimodal-live.py b/examples/foundational/26-gemini-multimodal-live.py index 03c063982..7d9a19995 100644 --- a/examples/foundational/26-gemini-multimodal-live.py +++ b/examples/foundational/26-gemini-multimodal-live.py @@ -83,7 +83,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/26a-gemini-multimodal-live-transcription.py b/examples/foundational/26a-gemini-multimodal-live-transcription.py index 9da336459..a919f6297 100644 --- a/examples/foundational/26a-gemini-multimodal-live-transcription.py +++ b/examples/foundational/26a-gemini-multimodal-live-transcription.py @@ -107,7 +107,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/26b-gemini-multimodal-live-function-calling.py b/examples/foundational/26b-gemini-multimodal-live-function-calling.py index 15db2faa0..c21559b12 100644 --- a/examples/foundational/26b-gemini-multimodal-live-function-calling.py +++ b/examples/foundational/26b-gemini-multimodal-live-function-calling.py @@ -151,7 +151,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/26c-gemini-multimodal-live-video.py b/examples/foundational/26c-gemini-multimodal-live-video.py index c39aeb63b..50c283aae 100644 --- a/examples/foundational/26c-gemini-multimodal-live-video.py +++ b/examples/foundational/26c-gemini-multimodal-live-video.py @@ -82,7 +82,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/26d-gemini-multimodal-live-text.py b/examples/foundational/26d-gemini-multimodal-live-text.py index 036e383b9..f5d0f3630 100644 --- a/examples/foundational/26d-gemini-multimodal-live-text.py +++ b/examples/foundational/26d-gemini-multimodal-live-text.py @@ -119,7 +119,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/26e-gemini-multimodal-google-search.py b/examples/foundational/26e-gemini-multimodal-google-search.py index 8638dfc11..a9a2bc384 100644 --- a/examples/foundational/26e-gemini-multimodal-google-search.py +++ b/examples/foundational/26e-gemini-multimodal-google-search.py @@ -107,7 +107,13 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si ] ) - task = PipelineTask(pipeline, params=PipelineParams(allow_interruptions=True)) + task = PipelineTask( + pipeline, + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), + ) @transport.event_handler("on_client_connected") async def on_client_connected(transport, client): diff --git a/examples/foundational/27-simli-layer.py b/examples/foundational/27-simli-layer.py index 9f7f6aa38..40f6b0c3d 100644 --- a/examples/foundational/27-simli-layer.py +++ b/examples/foundational/27-simli-layer.py @@ -92,8 +92,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, + enable_usage_metrics=True, ), ) diff --git a/examples/foundational/28-transcription-processor.py b/examples/foundational/28-transcription-processor.py index d8211071c..82ca13bbc 100644 --- a/examples/foundational/28-transcription-processor.py +++ b/examples/foundational/28-transcription-processor.py @@ -152,7 +152,13 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si ] ) - task = PipelineTask(pipeline, params=PipelineParams(allow_interruptions=True)) + task = PipelineTask( + pipeline, + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), + ) @transport.event_handler("on_client_connected") async def on_client_connected(transport, client): diff --git a/examples/foundational/29-turn-tracking-observer.py b/examples/foundational/29-turn-tracking-observer.py index 987ef372f..3467f044c 100644 --- a/examples/foundational/29-turn-tracking-observer.py +++ b/examples/foundational/29-turn-tracking-observer.py @@ -84,10 +84,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), observers=[UserBotLatencyLogObserver()], ) diff --git a/examples/foundational/30-observer.py b/examples/foundational/30-observer.py index c8172d2fa..161031415 100644 --- a/examples/foundational/30-observer.py +++ b/examples/foundational/30-observer.py @@ -133,10 +133,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), observers=[ CustomObserver(), diff --git a/examples/foundational/32-gemini-grounding-metadata.py b/examples/foundational/32-gemini-grounding-metadata.py index 47b94b979..e4729bfd5 100644 --- a/examples/foundational/32-gemini-grounding-metadata.py +++ b/examples/foundational/32-gemini-grounding-metadata.py @@ -130,7 +130,10 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, - params=PipelineParams(allow_interruptions=True), + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), observers=[LLMSearchLoggerObserver()], ) diff --git a/examples/foundational/33-gemini-rag.py b/examples/foundational/33-gemini-rag.py index b1c88f289..dcb4c9a8c 100644 --- a/examples/foundational/33-gemini-rag.py +++ b/examples/foundational/33-gemini-rag.py @@ -239,7 +239,6 @@ Your response will be turned into speech so use only simple words and punctuatio task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/34-audio-recording.py b/examples/foundational/34-audio-recording.py index 5c6b60d72..692904d0d 100644 --- a/examples/foundational/34-audio-recording.py +++ b/examples/foundational/34-audio-recording.py @@ -146,7 +146,13 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si ] ) - task = PipelineTask(pipeline, params=PipelineParams(allow_interruptions=True)) + task = PipelineTask( + pipeline, + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), + ) @transport.event_handler("on_client_connected") async def on_client_connected(transport, client): diff --git a/examples/foundational/35-pattern-pair-voice-switching.py b/examples/foundational/35-pattern-pair-voice-switching.py index 2663380be..07860f98b 100644 --- a/examples/foundational/35-pattern-pair-voice-switching.py +++ b/examples/foundational/35-pattern-pair-voice-switching.py @@ -211,10 +211,8 @@ Remember: Use narrator voice for EVERYTHING except the actual quoted dialogue."" task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/36-user-email-gathering.py b/examples/foundational/36-user-email-gathering.py index 47996a492..528200182 100644 --- a/examples/foundational/36-user-email-gathering.py +++ b/examples/foundational/36-user-email-gathering.py @@ -129,10 +129,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/37-mem0.py b/examples/foundational/37-mem0.py index 654a53a80..b7ceb885e 100644 --- a/examples/foundational/37-mem0.py +++ b/examples/foundational/37-mem0.py @@ -257,7 +257,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/38-smart-turn-fal.py b/examples/foundational/38-smart-turn-fal.py index 1fa8a2891..120fe67dc 100644 --- a/examples/foundational/38-smart-turn-fal.py +++ b/examples/foundational/38-smart-turn-fal.py @@ -97,10 +97,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/38a-smart-turn-local-coreml.py b/examples/foundational/38a-smart-turn-local-coreml.py index ceedfcfbe..043e2e0bd 100644 --- a/examples/foundational/38a-smart-turn-local-coreml.py +++ b/examples/foundational/38a-smart-turn-local-coreml.py @@ -112,10 +112,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/38b-smart-turn-local.py b/examples/foundational/38b-smart-turn-local.py index 42fec18ad..08f21f875 100644 --- a/examples/foundational/38b-smart-turn-local.py +++ b/examples/foundational/38b-smart-turn-local.py @@ -112,10 +112,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, ), ) diff --git a/examples/foundational/39-mcp-stdio.py b/examples/foundational/39-mcp-stdio.py index 235a38523..634ed8393 100644 --- a/examples/foundational/39-mcp-stdio.py +++ b/examples/foundational/39-mcp-stdio.py @@ -170,8 +170,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, + enable_usage_metrics=True, ), ) diff --git a/examples/foundational/39a-mcp-run-sse.py b/examples/foundational/39a-mcp-run-sse.py index c02245174..8b43b3022 100644 --- a/examples/foundational/39a-mcp-run-sse.py +++ b/examples/foundational/39a-mcp-run-sse.py @@ -101,8 +101,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, + enable_usage_metrics=True, ), ) diff --git a/examples/foundational/39b-multiple-mcp.py b/examples/foundational/39b-multiple-mcp.py index fe2869a52..3ba90d580 100644 --- a/examples/foundational/39b-multiple-mcp.py +++ b/examples/foundational/39b-multiple-mcp.py @@ -180,8 +180,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, + enable_usage_metrics=True, ), ) diff --git a/examples/foundational/40-aws-nova-sonic.py b/examples/foundational/40-aws-nova-sonic.py index 38fc4c189..ef01f7a47 100644 --- a/examples/foundational/40-aws-nova-sonic.py +++ b/examples/foundational/40-aws-nova-sonic.py @@ -144,7 +144,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/foundational/41a-text-only-webrtc.py b/examples/foundational/41a-text-only-webrtc.py index bfd7a6051..2441b6380 100644 --- a/examples/foundational/41a-text-only-webrtc.py +++ b/examples/foundational/41a-text-only-webrtc.py @@ -112,8 +112,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, + enable_usage_metrics=True, ), observers=[RTVIObserver(rtvi)], ) diff --git a/examples/foundational/41b-text-and-audio-webrtc.py b/examples/foundational/41b-text-and-audio-webrtc.py index 5ac250286..4e8f10605 100644 --- a/examples/foundational/41b-text-and-audio-webrtc.py +++ b/examples/foundational/41b-text-and-audio-webrtc.py @@ -130,8 +130,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, + enable_usage_metrics=True, ), observers=[RTVIObserver(rtvi)], ) diff --git a/examples/foundational/42-interruption-config.py b/examples/foundational/42-interruption-config.py index 3cb64c204..9b57cc926 100644 --- a/examples/foundational/42-interruption-config.py +++ b/examples/foundational/42-interruption-config.py @@ -88,10 +88,8 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, - report_only_initial_ttfb=True, interruption_strategies=[MinWordsInterruptionStrategy(min_words=3)], ), ) diff --git a/examples/instant-voice/server/src/single_bot.py b/examples/instant-voice/server/src/single_bot.py index 6c4e2b1b4..23a6008cb 100644 --- a/examples/instant-voice/server/src/single_bot.py +++ b/examples/instant-voice/server/src/single_bot.py @@ -90,7 +90,10 @@ async def main(): task = PipelineTask( pipeline, - params=PipelineParams(allow_interruptions=True), + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), observers=[RTVIObserver(rtvi)], ) diff --git a/examples/news-chatbot/server/news_bot.py b/examples/news-chatbot/server/news_bot.py index c78752dfb..a24143051 100644 --- a/examples/news-chatbot/server/news_bot.py +++ b/examples/news-chatbot/server/news_bot.py @@ -140,7 +140,10 @@ async def main(): task = PipelineTask( pipeline, - params=PipelineParams(allow_interruptions=True), + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), observers=[GoogleRTVIObserver(rtvi)], ) diff --git a/examples/open-telemetry/jaeger/bot.py b/examples/open-telemetry/jaeger/bot.py index 0f3084fd3..980245a02 100644 --- a/examples/open-telemetry/jaeger/bot.py +++ b/examples/open-telemetry/jaeger/bot.py @@ -139,7 +139,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/open-telemetry/langfuse/bot.py b/examples/open-telemetry/langfuse/bot.py index 9c4f34695..08139ad19 100644 --- a/examples/open-telemetry/langfuse/bot.py +++ b/examples/open-telemetry/langfuse/bot.py @@ -136,7 +136,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/p2p-webrtc/daily-interop-bridge/bot.py b/examples/p2p-webrtc/daily-interop-bridge/bot.py index 659d3fcef..e8783ab71 100644 --- a/examples/p2p-webrtc/daily-interop-bridge/bot.py +++ b/examples/p2p-webrtc/daily-interop-bridge/bot.py @@ -97,7 +97,8 @@ async def run_bot(webrtc_connection): task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=False, + enable_metrics=True, + enable_usage_metrics=True, ), ) diff --git a/examples/p2p-webrtc/video-transform/server/bot.py b/examples/p2p-webrtc/video-transform/server/bot.py index 8b11ffe21..cd2ea2709 100644 --- a/examples/p2p-webrtc/video-transform/server/bot.py +++ b/examples/p2p-webrtc/video-transform/server/bot.py @@ -121,7 +121,8 @@ async def run_bot(webrtc_connection): task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, + enable_metrics=True, + enable_usage_metrics=True, ), observers=[RTVIObserver(rtvi)], ) diff --git a/examples/p2p-webrtc/voice-agent/bot.py b/examples/p2p-webrtc/voice-agent/bot.py index 505a768e6..42dd712b4 100644 --- a/examples/p2p-webrtc/voice-agent/bot.py +++ b/examples/p2p-webrtc/voice-agent/bot.py @@ -73,7 +73,8 @@ async def run_bot(webrtc_connection): task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, + enable_metrics=True, + enable_usage_metrics=True, ), ) diff --git a/examples/patient-intake/bot.py b/examples/patient-intake/bot.py index 62a50fa77..a51456246 100644 --- a/examples/patient-intake/bot.py +++ b/examples/patient-intake/bot.py @@ -350,7 +350,13 @@ async def main(): ] ) - task = PipelineTask(pipeline, params=PipelineParams(allow_interruptions=False)) + task = PipelineTask( + pipeline, + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), + ) @transport.event_handler("on_first_participant_joined") async def on_first_participant_joined(transport, participant): diff --git a/examples/phone-chatbot/daily-pstn-advanced-voicemail-detection/bot.py b/examples/phone-chatbot/daily-pstn-advanced-voicemail-detection/bot.py index 7eeaef39e..5ede2a59a 100644 --- a/examples/phone-chatbot/daily-pstn-advanced-voicemail-detection/bot.py +++ b/examples/phone-chatbot/daily-pstn-advanced-voicemail-detection/bot.py @@ -326,7 +326,10 @@ async def run_bot( # Create pipeline task voicemail_detection_pipeline_task = PipelineTask( voicemail_detection_pipeline, - params=PipelineParams(allow_interruptions=True), + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), ) # ------------ RETRY LOGIC VARIABLES ------------ @@ -471,7 +474,10 @@ async def run_bot( # Create pipeline task human_conversation_pipeline_task = PipelineTask( human_conversation_pipeline, - params=PipelineParams(allow_interruptions=True), + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), ) # Update participant left handler for human conversation phase diff --git a/examples/phone-chatbot/daily-pstn-call-transfer/bot.py b/examples/phone-chatbot/daily-pstn-call-transfer/bot.py index 9613be832..cd4e3a70a 100644 --- a/examples/phone-chatbot/daily-pstn-call-transfer/bot.py +++ b/examples/phone-chatbot/daily-pstn-call-transfer/bot.py @@ -454,7 +454,10 @@ async def run_bot( # Create pipeline task task = PipelineTask( pipeline, - params=PipelineParams(allow_interruptions=True), + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), ) # ------------ EVENT HANDLERS ------------ diff --git a/examples/phone-chatbot/daily-pstn-dial-in/bot.py b/examples/phone-chatbot/daily-pstn-dial-in/bot.py index 26310b052..112ce1ba6 100644 --- a/examples/phone-chatbot/daily-pstn-dial-in/bot.py +++ b/examples/phone-chatbot/daily-pstn-dial-in/bot.py @@ -148,7 +148,8 @@ async def run_bot( task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True # Enable barge-in so callers can interrupt the bot + enable_metrics=True, + enable_usage_metrics=True, ), ) logger.debug("setup task") diff --git a/examples/phone-chatbot/daily-pstn-dial-out/bot.py b/examples/phone-chatbot/daily-pstn-dial-out/bot.py index 752c4941d..3021a5cbf 100644 --- a/examples/phone-chatbot/daily-pstn-dial-out/bot.py +++ b/examples/phone-chatbot/daily-pstn-dial-out/bot.py @@ -140,7 +140,13 @@ async def run_bot( ) # Create pipeline task - task = PipelineTask(pipeline, params=PipelineParams(allow_interruptions=True)) + task = PipelineTask( + pipeline, + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), + ) # ------------ RETRY LOGIC VARIABLES ------------ max_retries = 5 diff --git a/examples/phone-chatbot/daily-pstn-simple-voicemail-detection/bot.py b/examples/phone-chatbot/daily-pstn-simple-voicemail-detection/bot.py index 46d8051f5..d4c99831c 100644 --- a/examples/phone-chatbot/daily-pstn-simple-voicemail-detection/bot.py +++ b/examples/phone-chatbot/daily-pstn-simple-voicemail-detection/bot.py @@ -107,7 +107,6 @@ async def run_bot( params: FunctionCallParams, ): """Function the bot can call to terminate the call.""" - await params.llm.queue_frame(EndTaskFrame(), FrameDirection.UPSTREAM) tools = [ @@ -211,7 +210,13 @@ async def run_bot( ) # Create pipeline task - task = PipelineTask(pipeline, params=PipelineParams(allow_interruptions=True)) + task = PipelineTask( + pipeline, + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), + ) # ------------ RETRY LOGIC VARIABLES ------------ max_retries = 5 diff --git a/examples/phone-chatbot/daily-twilio-sip-dial-in/bot.py b/examples/phone-chatbot/daily-twilio-sip-dial-in/bot.py index 3d4afbfcd..0b5f935aa 100644 --- a/examples/phone-chatbot/daily-twilio-sip-dial-in/bot.py +++ b/examples/phone-chatbot/daily-twilio-sip-dial-in/bot.py @@ -95,7 +95,8 @@ async def run_bot(room_url: str, token: str, call_id: str, sip_uri: str) -> None task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True # Enable barge-in so callers can interrupt the bot + enable_metrics=True, + enable_usage_metrics=True, ), ) diff --git a/examples/phone-chatbot/daily-twilio-sip-dial-out/bot.py b/examples/phone-chatbot/daily-twilio-sip-dial-out/bot.py index 5f65a821e..e1056dcb8 100644 --- a/examples/phone-chatbot/daily-twilio-sip-dial-out/bot.py +++ b/examples/phone-chatbot/daily-twilio-sip-dial-out/bot.py @@ -134,7 +134,13 @@ async def run_bot( ) # Create pipeline task - task = PipelineTask(pipeline, params=PipelineParams(allow_interruptions=True)) + task = PipelineTask( + pipeline, + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), + ) # ------------ RETRY LOGIC VARIABLES ------------ max_retries = 5 diff --git a/examples/plivo-chatbot/bot.py b/examples/plivo-chatbot/bot.py index 5ce4be0c6..88ce2c120 100644 --- a/examples/plivo-chatbot/bot.py +++ b/examples/plivo-chatbot/bot.py @@ -88,7 +88,8 @@ async def run_bot(websocket_client: WebSocket, stream_id: str, call_id: Optional params=PipelineParams( audio_in_sample_rate=8000, audio_out_sample_rate=8000, - allow_interruptions=True, + enable_metrics=True, + enable_usage_metrics=True, ), ) diff --git a/examples/sentry-metrics/bot.py b/examples/sentry-metrics/bot.py index 0980fdbf2..8ff412bb7 100644 --- a/examples/sentry-metrics/bot.py +++ b/examples/sentry-metrics/bot.py @@ -87,7 +87,10 @@ async def main(): task = PipelineTask( pipeline, - params=PipelineParams(allow_interruptions=True, enable_metrics=True), + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), ) @transport.event_handler("on_first_participant_joined") diff --git a/examples/simple-chatbot/server/bot-gemini.py b/examples/simple-chatbot/server/bot-gemini.py index a38dc11d3..27db5ebde 100644 --- a/examples/simple-chatbot/server/bot-gemini.py +++ b/examples/simple-chatbot/server/bot-gemini.py @@ -171,7 +171,6 @@ async def main(): task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/simple-chatbot/server/bot-openai.py b/examples/simple-chatbot/server/bot-openai.py index 63226396e..8316d3918 100644 --- a/examples/simple-chatbot/server/bot-openai.py +++ b/examples/simple-chatbot/server/bot-openai.py @@ -199,7 +199,6 @@ async def main(): task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/storytelling-chatbot/server/bot.py b/examples/storytelling-chatbot/server/bot.py index 47f948a3c..999ed8afc 100644 --- a/examples/storytelling-chatbot/server/bot.py +++ b/examples/storytelling-chatbot/server/bot.py @@ -106,7 +106,6 @@ async def main(room_url, token=None): main_task = PipelineTask( main_pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/studypal/studypal.py b/examples/studypal/studypal.py index 0117134cb..c175d50c1 100644 --- a/examples/studypal/studypal.py +++ b/examples/studypal/studypal.py @@ -157,8 +157,8 @@ Your task is to help the user understand and learn from this article in 2 senten pipeline, params=PipelineParams( audio_out_sample_rate=44100, - allow_interruptions=True, enable_metrics=True, + enable_usage_metrics=True, ), ) diff --git a/examples/telnyx-chatbot/bot.py b/examples/telnyx-chatbot/bot.py index 1abbbd348..790e3a81a 100644 --- a/examples/telnyx-chatbot/bot.py +++ b/examples/telnyx-chatbot/bot.py @@ -92,7 +92,8 @@ async def run_bot( params=PipelineParams( audio_in_sample_rate=8000, audio_out_sample_rate=8000, - allow_interruptions=True, + enable_metrics=True, + enable_usage_metrics=True, ), ) diff --git a/examples/translation-chatbot/bot.py b/examples/translation-chatbot/bot.py index d68261cd0..e845b6d07 100644 --- a/examples/translation-chatbot/bot.py +++ b/examples/translation-chatbot/bot.py @@ -26,6 +26,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.filters.stt_mute_filter import STTMuteConfig, STTMuteFilter, STTMuteStrategy from pipecat.processors.frame_processor import FrameDirection, FrameProcessor from pipecat.processors.frameworks.rtvi import RTVIObserver, RTVIProcessor from pipecat.processors.transcript_processor import TranscriptProcessor @@ -140,6 +141,14 @@ async def main(): stt = DeepgramSTTService(api_key=os.getenv("DEEPGRAM_API_KEY")) + stt_mute_processor = STTMuteFilter( + config=STTMuteConfig( + strategies={ + STTMuteStrategy.ALWAYS, + } + ), + ) + tts = CartesiaTTSService( api_key=os.getenv("CARTESIA_API_KEY"), voice_id="34dbb662-8e98-413c-a1ef-1a3407675fe7", # Spanish Narrator Man @@ -169,6 +178,7 @@ async def main(): [ transport.input(), rtvi, + stt_mute_processor, # We don't want to interrupt the translator bot stt, transcript.user(), # User transcripts tp, @@ -183,7 +193,6 @@ async def main(): task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=False, # We don't want to interrupt the translator bot enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/twilio-chatbot/bot.py b/examples/twilio-chatbot/bot.py index 8a05a5d17..04aa8e806 100644 --- a/examples/twilio-chatbot/bot.py +++ b/examples/twilio-chatbot/bot.py @@ -115,7 +115,8 @@ async def run_bot(websocket_client: WebSocket, stream_sid: str, call_sid: str, t params=PipelineParams( audio_in_sample_rate=8000, audio_out_sample_rate=8000, - allow_interruptions=True, + enable_metrics=True, + enable_usage_metrics=True, ), ) diff --git a/examples/twilio-chatbot/client/python/client.py b/examples/twilio-chatbot/client/python/client.py index d066a6a7e..fc9adecac 100644 --- a/examples/twilio-chatbot/client/python/client.py +++ b/examples/twilio-chatbot/client/python/client.py @@ -139,7 +139,8 @@ async def run_client(client_name: str, server_url: str, duration_secs: int): params=PipelineParams( audio_in_sample_rate=8000, audio_out_sample_rate=8000, - allow_interruptions=True, + enable_metrics=True, + enable_usage_metrics=True, ), ) diff --git a/examples/websocket/server/bot_fast_api.py b/examples/websocket/server/bot_fast_api.py index 421fe8dbf..fa1005136 100644 --- a/examples/websocket/server/bot_fast_api.py +++ b/examples/websocket/server/bot_fast_api.py @@ -85,7 +85,8 @@ async def run_bot(websocket_client): task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, + enable_metrics=True, + enable_usage_metrics=True, ), observers=[RTVIObserver(rtvi)], ) diff --git a/examples/websocket/server/bot_websocket_server.py b/examples/websocket/server/bot_websocket_server.py index 5274c11f6..e88ec60dd 100644 --- a/examples/websocket/server/bot_websocket_server.py +++ b/examples/websocket/server/bot_websocket_server.py @@ -78,7 +78,8 @@ async def run_bot_websocket_server(): task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, + enable_metrics=True, + enable_usage_metrics=True, ), observers=[RTVIObserver(rtvi)], ) diff --git a/examples/word-wrangler-gemini-live/server/bot.py b/examples/word-wrangler-gemini-live/server/bot.py index 7a0527636..f5086a5c1 100644 --- a/examples/word-wrangler-gemini-live/server/bot.py +++ b/examples/word-wrangler-gemini-live/server/bot.py @@ -135,7 +135,6 @@ Important guidelines: task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/word-wrangler-gemini-live/server/bot_phone_local.py b/examples/word-wrangler-gemini-live/server/bot_phone_local.py index 84f15ea30..0e2739411 100644 --- a/examples/word-wrangler-gemini-live/server/bot_phone_local.py +++ b/examples/word-wrangler-gemini-live/server/bot_phone_local.py @@ -678,7 +678,6 @@ Important guidelines: task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=False, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/examples/word-wrangler-gemini-live/server/bot_phone_twilio.py b/examples/word-wrangler-gemini-live/server/bot_phone_twilio.py index 2af8b2d4a..0b0c12e1e 100644 --- a/examples/word-wrangler-gemini-live/server/bot_phone_twilio.py +++ b/examples/word-wrangler-gemini-live/server/bot_phone_twilio.py @@ -695,7 +695,6 @@ Important guidelines: pipeline, params=PipelineParams( audio_out_sample_rate=8000, - allow_interruptions=False, enable_metrics=True, enable_usage_metrics=True, ), diff --git a/scripts/evals/eval.py b/scripts/evals/eval.py index 1ad165a4a..743b62222 100644 --- a/scripts/evals/eval.py +++ b/scripts/evals/eval.py @@ -262,7 +262,6 @@ async def run_eval_pipeline( task = PipelineTask( pipeline, params=PipelineParams( - allow_interruptions=True, audio_in_sample_rate=16000, audio_out_sample_rate=16000, ), diff --git a/src/pipecat/pipeline/task.py b/src/pipecat/pipeline/task.py index 736f98244..36f24c522 100644 --- a/src/pipecat/pipeline/task.py +++ b/src/pipecat/pipeline/task.py @@ -64,7 +64,7 @@ class PipelineParams(BaseModel): model_config = ConfigDict(arbitrary_types_allowed=True) - allow_interruptions: bool = False + allow_interruptions: bool = True audio_in_sample_rate: int = 16000 audio_out_sample_rate: int = 24000 enable_heartbeats: bool = False