diff --git a/docs/api/conf.py b/docs/api/conf.py index aca7fd923..5ea2c8b47 100644 --- a/docs/api/conf.py +++ b/docs/api/conf.py @@ -250,7 +250,6 @@ def setup(app): excludes = [ str(project_root / "src/pipecat/pipeline/to_be_updated"), - str(project_root / "src/pipecat/examples"), str(project_root / "src/pipecat/tests"), "**/test_*.py", "**/tests/*.py", diff --git a/examples/aws-strands/black-box.py b/examples/aws-strands/black-box.py index 12ce441a0..8f730bf3d 100644 --- a/examples/aws-strands/black-box.py +++ b/examples/aws-strands/black-box.py @@ -201,6 +201,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/aws-strands/explain-thinking.py b/examples/aws-strands/explain-thinking.py index 1bc04d8e5..530de1aea 100644 --- a/examples/aws-strands/explain-thinking.py +++ b/examples/aws-strands/explain-thinking.py @@ -244,6 +244,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/01-say-one-thing-piper.py b/examples/foundational/01-say-one-thing-piper.py index 5093a9612..738c3a1d7 100644 --- a/examples/foundational/01-say-one-thing-piper.py +++ b/examples/foundational/01-say-one-thing-piper.py @@ -55,6 +55,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/01-say-one-thing-rime.py b/examples/foundational/01-say-one-thing-rime.py index 67542e596..32518592c 100644 --- a/examples/foundational/01-say-one-thing-rime.py +++ b/examples/foundational/01-say-one-thing-rime.py @@ -56,6 +56,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/01-say-one-thing.py b/examples/foundational/01-say-one-thing.py index 4a34a3c3d..c5f330227 100644 --- a/examples/foundational/01-say-one-thing.py +++ b/examples/foundational/01-say-one-thing.py @@ -53,6 +53,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/01c-fastpitch.py b/examples/foundational/01c-fastpitch.py index 0795097fb..992b7d5e0 100644 --- a/examples/foundational/01c-fastpitch.py +++ b/examples/foundational/01c-fastpitch.py @@ -50,6 +50,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/02-llm-say-one-thing.py b/examples/foundational/02-llm-say-one-thing.py index b76385d7d..922503b7c 100644 --- a/examples/foundational/02-llm-say-one-thing.py +++ b/examples/foundational/02-llm-say-one-thing.py @@ -63,6 +63,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/03-still-frame.py b/examples/foundational/03-still-frame.py index 106250e11..f3381b13b 100644 --- a/examples/foundational/03-still-frame.py +++ b/examples/foundational/03-still-frame.py @@ -68,6 +68,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/03b-still-frame-imagen.py b/examples/foundational/03b-still-frame-imagen.py index 0414fe8de..5d1df6bb6 100644 --- a/examples/foundational/03b-still-frame-imagen.py +++ b/examples/foundational/03b-still-frame-imagen.py @@ -71,6 +71,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/05-sync-speech-and-image.py b/examples/foundational/05-sync-speech-and-image.py index d4c816714..9a3cba7df 100644 --- a/examples/foundational/05-sync-speech-and-image.py +++ b/examples/foundational/05-sync-speech-and-image.py @@ -174,6 +174,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/06-listen-and-respond.py b/examples/foundational/06-listen-and-respond.py index b660459cf..02129fb10 100644 --- a/examples/foundational/06-listen-and-respond.py +++ b/examples/foundational/06-listen-and-respond.py @@ -137,6 +137,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/06a-image-sync.py b/examples/foundational/06a-image-sync.py index d8b2e7c04..f55b1082b 100644 --- a/examples/foundational/06a-image-sync.py +++ b/examples/foundational/06a-image-sync.py @@ -154,6 +154,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07-interruptible-cartesia-http.py b/examples/foundational/07-interruptible-cartesia-http.py index eff98b1e7..7f40e648a 100644 --- a/examples/foundational/07-interruptible-cartesia-http.py +++ b/examples/foundational/07-interruptible-cartesia-http.py @@ -107,6 +107,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07-interruptible.py b/examples/foundational/07-interruptible.py index b69aaba92..c4c60adcc 100644 --- a/examples/foundational/07-interruptible.py +++ b/examples/foundational/07-interruptible.py @@ -106,6 +106,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07a-interruptible-speechmatics.py b/examples/foundational/07a-interruptible-speechmatics.py index 1582e79ba..d4d1d9c58 100644 --- a/examples/foundational/07a-interruptible-speechmatics.py +++ b/examples/foundational/07a-interruptible-speechmatics.py @@ -148,6 +148,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07aa-interruptible-soniox.py b/examples/foundational/07aa-interruptible-soniox.py index a879821a2..b530d8022 100644 --- a/examples/foundational/07aa-interruptible-soniox.py +++ b/examples/foundational/07aa-interruptible-soniox.py @@ -104,6 +104,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07b-interruptible-langchain.py b/examples/foundational/07b-interruptible-langchain.py index 55bfa6cdf..5c5307a05 100644 --- a/examples/foundational/07b-interruptible-langchain.py +++ b/examples/foundational/07b-interruptible-langchain.py @@ -139,6 +139,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07c-interruptible-deepgram-vad.py b/examples/foundational/07c-interruptible-deepgram-vad.py index 86cb363e2..400c267ad 100644 --- a/examples/foundational/07c-interruptible-deepgram-vad.py +++ b/examples/foundational/07c-interruptible-deepgram-vad.py @@ -118,6 +118,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07c-interruptible-deepgram.py b/examples/foundational/07c-interruptible-deepgram.py index cce7c245d..34d836697 100644 --- a/examples/foundational/07c-interruptible-deepgram.py +++ b/examples/foundational/07c-interruptible-deepgram.py @@ -104,6 +104,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07d-interruptible-elevenlabs-http.py b/examples/foundational/07d-interruptible-elevenlabs-http.py index 6b4a5b55c..32f9154ec 100644 --- a/examples/foundational/07d-interruptible-elevenlabs-http.py +++ b/examples/foundational/07d-interruptible-elevenlabs-http.py @@ -111,6 +111,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07d-interruptible-elevenlabs.py b/examples/foundational/07d-interruptible-elevenlabs.py index 491f15c4d..11bffc324 100644 --- a/examples/foundational/07d-interruptible-elevenlabs.py +++ b/examples/foundational/07d-interruptible-elevenlabs.py @@ -107,6 +107,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07e-interruptible-playht-http.py b/examples/foundational/07e-interruptible-playht-http.py index d628714c2..1982bbc16 100644 --- a/examples/foundational/07e-interruptible-playht-http.py +++ b/examples/foundational/07e-interruptible-playht-http.py @@ -107,6 +107,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07e-interruptible-playht.py b/examples/foundational/07e-interruptible-playht.py index d5b24dc49..e358d1455 100644 --- a/examples/foundational/07e-interruptible-playht.py +++ b/examples/foundational/07e-interruptible-playht.py @@ -109,6 +109,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07f-interruptible-azure.py b/examples/foundational/07f-interruptible-azure.py index 1e8e7d7f3..ae9c22663 100644 --- a/examples/foundational/07f-interruptible-azure.py +++ b/examples/foundational/07f-interruptible-azure.py @@ -113,6 +113,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07g-interruptible-openai.py b/examples/foundational/07g-interruptible-openai.py index fb85c1af4..12765271e 100644 --- a/examples/foundational/07g-interruptible-openai.py +++ b/examples/foundational/07g-interruptible-openai.py @@ -108,6 +108,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07h-interruptible-openpipe.py b/examples/foundational/07h-interruptible-openpipe.py index 719067b21..f9407e94c 100644 --- a/examples/foundational/07h-interruptible-openpipe.py +++ b/examples/foundational/07h-interruptible-openpipe.py @@ -112,6 +112,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07i-interruptible-xtts.py b/examples/foundational/07i-interruptible-xtts.py index 32dddd965..352ba5f7c 100644 --- a/examples/foundational/07i-interruptible-xtts.py +++ b/examples/foundational/07i-interruptible-xtts.py @@ -110,6 +110,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07j-interruptible-gladia.py b/examples/foundational/07j-interruptible-gladia.py index 4cf7b2f04..f3e65eda8 100644 --- a/examples/foundational/07j-interruptible-gladia.py +++ b/examples/foundational/07j-interruptible-gladia.py @@ -114,6 +114,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07k-interruptible-lmnt.py b/examples/foundational/07k-interruptible-lmnt.py index 3d4616276..322bd6a04 100644 --- a/examples/foundational/07k-interruptible-lmnt.py +++ b/examples/foundational/07k-interruptible-lmnt.py @@ -103,6 +103,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07l-interruptible-groq.py b/examples/foundational/07l-interruptible-groq.py index 6acccee63..2d441d7b4 100644 --- a/examples/foundational/07l-interruptible-groq.py +++ b/examples/foundational/07l-interruptible-groq.py @@ -108,6 +108,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07m-interruptible-aws.py b/examples/foundational/07m-interruptible-aws.py index 5cd1a579a..da7b307ea 100644 --- a/examples/foundational/07m-interruptible-aws.py +++ b/examples/foundational/07m-interruptible-aws.py @@ -110,6 +110,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07n-interruptible-google.py b/examples/foundational/07n-interruptible-google.py index 319c97f78..d1405b5c2 100644 --- a/examples/foundational/07n-interruptible-google.py +++ b/examples/foundational/07n-interruptible-google.py @@ -116,6 +116,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07o-interruptible-assemblyai.py b/examples/foundational/07o-interruptible-assemblyai.py index 2a1a8da8d..61f722f8a 100644 --- a/examples/foundational/07o-interruptible-assemblyai.py +++ b/examples/foundational/07o-interruptible-assemblyai.py @@ -109,6 +109,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07p-interruptible-krisp.py b/examples/foundational/07p-interruptible-krisp.py index 167749e77..a4d84b182 100644 --- a/examples/foundational/07p-interruptible-krisp.py +++ b/examples/foundational/07p-interruptible-krisp.py @@ -107,6 +107,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07q-interruptible-rime-http.py b/examples/foundational/07q-interruptible-rime-http.py index 7790a1c82..88b4ba5e3 100644 --- a/examples/foundational/07q-interruptible-rime-http.py +++ b/examples/foundational/07q-interruptible-rime-http.py @@ -112,6 +112,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07q-interruptible-rime.py b/examples/foundational/07q-interruptible-rime.py index fb5e453fd..d242b2989 100644 --- a/examples/foundational/07q-interruptible-rime.py +++ b/examples/foundational/07q-interruptible-rime.py @@ -106,6 +106,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07r-interruptible-riva-nim.py b/examples/foundational/07r-interruptible-riva-nim.py index 7092f6633..623919c17 100644 --- a/examples/foundational/07r-interruptible-riva-nim.py +++ b/examples/foundational/07r-interruptible-riva-nim.py @@ -103,6 +103,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07s-interruptible-google-audio-in.py b/examples/foundational/07s-interruptible-google-audio-in.py index 67701c53b..09580a746 100644 --- a/examples/foundational/07s-interruptible-google-audio-in.py +++ b/examples/foundational/07s-interruptible-google-audio-in.py @@ -284,6 +284,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07t-interruptible-fish.py b/examples/foundational/07t-interruptible-fish.py index 69babfc05..df47b6a8e 100644 --- a/examples/foundational/07t-interruptible-fish.py +++ b/examples/foundational/07t-interruptible-fish.py @@ -107,6 +107,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07u-interruptible-ultravox.py b/examples/foundational/07u-interruptible-ultravox.py index b81f43461..051f43980 100644 --- a/examples/foundational/07u-interruptible-ultravox.py +++ b/examples/foundational/07u-interruptible-ultravox.py @@ -97,6 +97,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07v-interruptible-neuphonic-http.py b/examples/foundational/07v-interruptible-neuphonic-http.py index 7c6389a13..3125d1e19 100644 --- a/examples/foundational/07v-interruptible-neuphonic-http.py +++ b/examples/foundational/07v-interruptible-neuphonic-http.py @@ -111,6 +111,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07v-interruptible-neuphonic.py b/examples/foundational/07v-interruptible-neuphonic.py index 34aee1977..029ef10eb 100644 --- a/examples/foundational/07v-interruptible-neuphonic.py +++ b/examples/foundational/07v-interruptible-neuphonic.py @@ -106,6 +106,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07w-interruptible-fal.py b/examples/foundational/07w-interruptible-fal.py index 2ef942ad2..daca61a42 100644 --- a/examples/foundational/07w-interruptible-fal.py +++ b/examples/foundational/07w-interruptible-fal.py @@ -109,6 +109,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07y-interruptible-minimax.py b/examples/foundational/07y-interruptible-minimax.py index 97bb655d3..562f7d50e 100644 --- a/examples/foundational/07y-interruptible-minimax.py +++ b/examples/foundational/07y-interruptible-minimax.py @@ -113,6 +113,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/07z-interruptible-sarvam.py b/examples/foundational/07z-interruptible-sarvam.py index 2fdf1634a..811ff0bed 100644 --- a/examples/foundational/07z-interruptible-sarvam.py +++ b/examples/foundational/07z-interruptible-sarvam.py @@ -112,6 +112,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/09-mirror.py b/examples/foundational/09-mirror.py index 67c21945c..69bad3c6e 100644 --- a/examples/foundational/09-mirror.py +++ b/examples/foundational/09-mirror.py @@ -96,6 +96,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/09a-local-mirror.py b/examples/foundational/09a-local-mirror.py index 5cbde5700..fff79f339 100644 --- a/examples/foundational/09a-local-mirror.py +++ b/examples/foundational/09a-local-mirror.py @@ -11,7 +11,6 @@ import tkinter as tk from dotenv import load_dotenv from loguru import logger -from pipecat.examples.run import maybe_capture_participant_camera from pipecat.frames.frames import ( Frame, InputAudioRawFrame, @@ -23,6 +22,7 @@ from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.frame_processor import FrameDirection, FrameProcessor +from pipecat.runner.utils import maybe_capture_participant_camera from pipecat.transports.base_transport import BaseTransport, TransportParams from pipecat.transports.local.tk import TkLocalTransport, TkTransportParams from pipecat.transports.services.daily import DailyParams @@ -121,6 +121,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/10-wake-phrase.py b/examples/foundational/10-wake-phrase.py index fb72e6a2a..ff3d9f10a 100644 --- a/examples/foundational/10-wake-phrase.py +++ b/examples/foundational/10-wake-phrase.py @@ -110,6 +110,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/11-sound-effects.py b/examples/foundational/11-sound-effects.py index 3ca4f8855..5a434441a 100644 --- a/examples/foundational/11-sound-effects.py +++ b/examples/foundational/11-sound-effects.py @@ -162,6 +162,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/12-describe-video.py b/examples/foundational/12-describe-video.py index c7edd67c4..6d1e2c096 100644 --- a/examples/foundational/12-describe-video.py +++ b/examples/foundational/12-describe-video.py @@ -12,7 +12,6 @@ from dotenv import load_dotenv from loguru import logger from pipecat.audio.vad.silero import SileroVADAnalyzer -from pipecat.examples.run import get_transport_client_id, maybe_capture_participant_camera from pipecat.frames.frames import Frame, TextFrame, UserImageRequestFrame from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner @@ -20,6 +19,7 @@ from pipecat.pipeline.task import PipelineTask from pipecat.processors.aggregators.user_response import UserResponseAggregator from pipecat.processors.aggregators.vision_image_frame import VisionImageFrameAggregator from pipecat.processors.frame_processor import FrameDirection, FrameProcessor +from pipecat.runner.utils import get_transport_client_id, maybe_capture_participant_camera from pipecat.services.cartesia.tts import CartesiaTTSService from pipecat.services.deepgram.stt import DeepgramSTTService from pipecat.services.moondream.vision import MoondreamService @@ -125,6 +125,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/12a-describe-video-gemini-flash.py b/examples/foundational/12a-describe-video-gemini-flash.py index 1c762e067..120f1d0ea 100644 --- a/examples/foundational/12a-describe-video-gemini-flash.py +++ b/examples/foundational/12a-describe-video-gemini-flash.py @@ -12,7 +12,6 @@ from dotenv import load_dotenv from loguru import logger from pipecat.audio.vad.silero import SileroVADAnalyzer -from pipecat.examples.run import get_transport_client_id, maybe_capture_participant_camera from pipecat.frames.frames import Frame, TextFrame, UserImageRequestFrame from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner @@ -20,6 +19,7 @@ from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.user_response import UserResponseAggregator from pipecat.processors.aggregators.vision_image_frame import VisionImageFrameAggregator from pipecat.processors.frame_processor import FrameDirection, FrameProcessor +from pipecat.runner.utils import get_transport_client_id, maybe_capture_participant_camera from pipecat.services.cartesia.tts import CartesiaTTSService from pipecat.services.deepgram.stt import DeepgramSTTService from pipecat.services.google.llm import GoogleLLMService @@ -131,6 +131,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/12b-describe-video-gpt-4o.py b/examples/foundational/12b-describe-video-gpt-4o.py index c5492c022..5a379f9b0 100644 --- a/examples/foundational/12b-describe-video-gpt-4o.py +++ b/examples/foundational/12b-describe-video-gpt-4o.py @@ -12,7 +12,6 @@ from dotenv import load_dotenv from loguru import logger from pipecat.audio.vad.silero import SileroVADAnalyzer -from pipecat.examples.run import get_transport_client_id, maybe_capture_participant_camera from pipecat.frames.frames import Frame, TextFrame, UserImageRequestFrame from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner @@ -20,6 +19,7 @@ from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.user_response import UserResponseAggregator from pipecat.processors.aggregators.vision_image_frame import VisionImageFrameAggregator from pipecat.processors.frame_processor import FrameDirection, FrameProcessor +from pipecat.runner.utils import get_transport_client_id, maybe_capture_participant_camera from pipecat.services.cartesia.tts import CartesiaTTSService from pipecat.services.deepgram.stt import DeepgramSTTService from pipecat.services.openai.llm import OpenAILLMService @@ -131,6 +131,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/12c-describe-video-anthropic.py b/examples/foundational/12c-describe-video-anthropic.py index 34b7d6bed..8e13eff67 100644 --- a/examples/foundational/12c-describe-video-anthropic.py +++ b/examples/foundational/12c-describe-video-anthropic.py @@ -12,7 +12,6 @@ from dotenv import load_dotenv from loguru import logger from pipecat.audio.vad.silero import SileroVADAnalyzer -from pipecat.examples.run import get_transport_client_id, maybe_capture_participant_camera from pipecat.frames.frames import Frame, TextFrame, UserImageRequestFrame from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner @@ -20,6 +19,7 @@ from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.user_response import UserResponseAggregator from pipecat.processors.aggregators.vision_image_frame import VisionImageFrameAggregator from pipecat.processors.frame_processor import FrameDirection, FrameProcessor +from pipecat.runner.utils import get_transport_client_id, maybe_capture_participant_camera from pipecat.services.anthropic.llm import AnthropicLLMService from pipecat.services.cartesia.tts import CartesiaTTSService from pipecat.services.deepgram.stt import DeepgramSTTService @@ -131,6 +131,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/13-whisper-transcription.py b/examples/foundational/13-whisper-transcription.py index 8a5b951a8..167147d48 100644 --- a/examples/foundational/13-whisper-transcription.py +++ b/examples/foundational/13-whisper-transcription.py @@ -72,6 +72,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/13b-deepgram-transcription.py b/examples/foundational/13b-deepgram-transcription.py index ae8953f0a..aeeb0aa62 100644 --- a/examples/foundational/13b-deepgram-transcription.py +++ b/examples/foundational/13b-deepgram-transcription.py @@ -66,6 +66,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/13c-gladia-transcription.py b/examples/foundational/13c-gladia-transcription.py index 2e4f5b375..768e35c28 100644 --- a/examples/foundational/13c-gladia-transcription.py +++ b/examples/foundational/13c-gladia-transcription.py @@ -66,6 +66,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/13c-gladia-translation.py b/examples/foundational/13c-gladia-translation.py index 74e9437c0..0acacd8f7 100644 --- a/examples/foundational/13c-gladia-translation.py +++ b/examples/foundational/13c-gladia-translation.py @@ -87,6 +87,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/13d-assemblyai-transcription.py b/examples/foundational/13d-assemblyai-transcription.py index de22b9bb6..4266cf81d 100644 --- a/examples/foundational/13d-assemblyai-transcription.py +++ b/examples/foundational/13d-assemblyai-transcription.py @@ -65,6 +65,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/13e-whisper-mlx.py b/examples/foundational/13e-whisper-mlx.py index d06788570..f6296cef9 100644 --- a/examples/foundational/13e-whisper-mlx.py +++ b/examples/foundational/13e-whisper-mlx.py @@ -99,6 +99,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/13f-cartesia-transcription.py b/examples/foundational/13f-cartesia-transcription.py index 147d5fb3e..9bdcde93f 100644 --- a/examples/foundational/13f-cartesia-transcription.py +++ b/examples/foundational/13f-cartesia-transcription.py @@ -66,6 +66,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/13g-sambanova-transcription.py b/examples/foundational/13g-sambanova-transcription.py index bff8aa4d4..2cc0f634c 100644 --- a/examples/foundational/13g-sambanova-transcription.py +++ b/examples/foundational/13g-sambanova-transcription.py @@ -103,6 +103,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/13h-speechmatics-transcription.py b/examples/foundational/13h-speechmatics-transcription.py index ec3197e19..079e7f830 100644 --- a/examples/foundational/13h-speechmatics-transcription.py +++ b/examples/foundational/13h-speechmatics-transcription.py @@ -84,6 +84,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/13i-soniox-transcription.py b/examples/foundational/13i-soniox-transcription.py index 5bec62f28..243a07007 100644 --- a/examples/foundational/13i-soniox-transcription.py +++ b/examples/foundational/13i-soniox-transcription.py @@ -76,6 +76,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14-function-calling.py b/examples/foundational/14-function-calling.py index b8fddd227..1fbbd2539 100644 --- a/examples/foundational/14-function-calling.py +++ b/examples/foundational/14-function-calling.py @@ -156,6 +156,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14a-function-calling-anthropic.py b/examples/foundational/14a-function-calling-anthropic.py index cb0766262..85ee62abc 100644 --- a/examples/foundational/14a-function-calling-anthropic.py +++ b/examples/foundational/14a-function-calling-anthropic.py @@ -149,6 +149,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14b-function-calling-anthropic-video.py b/examples/foundational/14b-function-calling-anthropic-video.py index b9d9b2f71..98e4d5cc9 100644 --- a/examples/foundational/14b-function-calling-anthropic-video.py +++ b/examples/foundational/14b-function-calling-anthropic-video.py @@ -14,11 +14,11 @@ from loguru import logger from pipecat.adapters.schemas.function_schema import FunctionSchema from pipecat.adapters.schemas.tools_schema import ToolsSchema 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 PipelineParams, PipelineTask from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext +from pipecat.runner.utils import get_transport_client_id, maybe_capture_participant_camera from pipecat.services.anthropic.llm import AnthropicLLMService from pipecat.services.cartesia.tts import CartesiaTTSService from pipecat.services.deepgram.stt import DeepgramSTTService @@ -200,6 +200,6 @@ If you need to use a tool, simply use the tool. Do not tell the user the tool yo if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14c-function-calling-together.py b/examples/foundational/14c-function-calling-together.py index e1fc55eb3..3a59e30ca 100644 --- a/examples/foundational/14c-function-calling-together.py +++ b/examples/foundational/14c-function-calling-together.py @@ -141,6 +141,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14d-function-calling-video.py b/examples/foundational/14d-function-calling-video.py index a6f21922d..84462ef06 100644 --- a/examples/foundational/14d-function-calling-video.py +++ b/examples/foundational/14d-function-calling-video.py @@ -14,11 +14,11 @@ from loguru import logger from pipecat.adapters.schemas.function_schema import FunctionSchema from pipecat.adapters.schemas.tools_schema import ToolsSchema 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 PipelineParams, PipelineTask from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext +from pipecat.runner.utils import get_transport_client_id, maybe_capture_participant_camera from pipecat.services.cartesia.tts import CartesiaTTSService from pipecat.services.deepgram.stt import DeepgramSTTService from pipecat.services.llm_service import FunctionCallParams @@ -189,6 +189,6 @@ indicate you should use the get_image tool are: if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14e-function-calling-google.py b/examples/foundational/14e-function-calling-google.py index 92ebe4135..c01f19b5e 100644 --- a/examples/foundational/14e-function-calling-google.py +++ b/examples/foundational/14e-function-calling-google.py @@ -14,12 +14,12 @@ from loguru import logger from pipecat.adapters.schemas.function_schema import FunctionSchema from pipecat.adapters.schemas.tools_schema import ToolsSchema from pipecat.audio.vad.silero import SileroVADAnalyzer -from pipecat.examples.run import get_transport_client_id, maybe_capture_participant_camera from pipecat.frames.frames import TTSSpeakFrame 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.runner.utils import get_transport_client_id, maybe_capture_participant_camera from pipecat.services.cartesia.tts import CartesiaTTSService from pipecat.services.deepgram.stt import DeepgramSTTService from pipecat.services.google.llm import GoogleLLMService @@ -211,6 +211,6 @@ indicate you should use the get_image tool are: if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14f-function-calling-groq.py b/examples/foundational/14f-function-calling-groq.py index d527642d0..4f74c7e46 100644 --- a/examples/foundational/14f-function-calling-groq.py +++ b/examples/foundational/14f-function-calling-groq.py @@ -143,6 +143,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14g-function-calling-grok.py b/examples/foundational/14g-function-calling-grok.py index 00aa32aa2..32812a66f 100644 --- a/examples/foundational/14g-function-calling-grok.py +++ b/examples/foundational/14g-function-calling-grok.py @@ -133,6 +133,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14h-function-calling-azure.py b/examples/foundational/14h-function-calling-azure.py index cf8480c75..a1af0cd8e 100644 --- a/examples/foundational/14h-function-calling-azure.py +++ b/examples/foundational/14h-function-calling-azure.py @@ -142,6 +142,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14i-function-calling-fireworks.py b/examples/foundational/14i-function-calling-fireworks.py index 0921d73d6..69e94478f 100644 --- a/examples/foundational/14i-function-calling-fireworks.py +++ b/examples/foundational/14i-function-calling-fireworks.py @@ -141,6 +141,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14j-function-calling-nim.py b/examples/foundational/14j-function-calling-nim.py index 6aa101ee8..2ed382b52 100644 --- a/examples/foundational/14j-function-calling-nim.py +++ b/examples/foundational/14j-function-calling-nim.py @@ -139,6 +139,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14k-function-calling-cerebras.py b/examples/foundational/14k-function-calling-cerebras.py index 5a6bcf91c..8a2de3611 100644 --- a/examples/foundational/14k-function-calling-cerebras.py +++ b/examples/foundational/14k-function-calling-cerebras.py @@ -148,6 +148,6 @@ Start by asking me for my location. Then, use 'get_weather_current' to give me a if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14l-function-calling-deepseek.py b/examples/foundational/14l-function-calling-deepseek.py index 814a4147d..f5e1d437e 100644 --- a/examples/foundational/14l-function-calling-deepseek.py +++ b/examples/foundational/14l-function-calling-deepseek.py @@ -148,6 +148,6 @@ Start by asking me for my location. Then, use 'get_weather_current' to give me a if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14m-function-calling-openrouter.py b/examples/foundational/14m-function-calling-openrouter.py index aac0923ca..303968c60 100644 --- a/examples/foundational/14m-function-calling-openrouter.py +++ b/examples/foundational/14m-function-calling-openrouter.py @@ -142,6 +142,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14n-function-calling-perplexity.py b/examples/foundational/14n-function-calling-perplexity.py index 144c3a3df..1a18c03ec 100644 --- a/examples/foundational/14n-function-calling-perplexity.py +++ b/examples/foundational/14n-function-calling-perplexity.py @@ -112,6 +112,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14o-function-calling-gemini-openai-format.py b/examples/foundational/14o-function-calling-gemini-openai-format.py index 7d236bf4c..dd3f4659b 100644 --- a/examples/foundational/14o-function-calling-gemini-openai-format.py +++ b/examples/foundational/14o-function-calling-gemini-openai-format.py @@ -138,6 +138,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14p-function-calling-gemini-vertex-ai.py b/examples/foundational/14p-function-calling-gemini-vertex-ai.py index 1fc6b0fc4..5196cf813 100644 --- a/examples/foundational/14p-function-calling-gemini-vertex-ai.py +++ b/examples/foundational/14p-function-calling-gemini-vertex-ai.py @@ -144,6 +144,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14q-function-calling-qwen.py b/examples/foundational/14q-function-calling-qwen.py index 7cf2182c0..5f9afbeff 100644 --- a/examples/foundational/14q-function-calling-qwen.py +++ b/examples/foundational/14q-function-calling-qwen.py @@ -140,6 +140,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14r-function-calling-aws.py b/examples/foundational/14r-function-calling-aws.py index a14c37cf9..6ca3033b7 100644 --- a/examples/foundational/14r-function-calling-aws.py +++ b/examples/foundational/14r-function-calling-aws.py @@ -157,6 +157,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14s-function-calling-sambanova.py b/examples/foundational/14s-function-calling-sambanova.py index dd11af527..6cc743d93 100644 --- a/examples/foundational/14s-function-calling-sambanova.py +++ b/examples/foundational/14s-function-calling-sambanova.py @@ -147,6 +147,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14t-function-calling-direct.py b/examples/foundational/14t-function-calling-direct.py index 7778461f6..985ebd40e 100644 --- a/examples/foundational/14t-function-calling-direct.py +++ b/examples/foundational/14t-function-calling-direct.py @@ -141,6 +141,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/14u-function-calling-ollama.py b/examples/foundational/14u-function-calling-ollama.py index 39220b791..77bda12bf 100644 --- a/examples/foundational/14u-function-calling-ollama.py +++ b/examples/foundational/14u-function-calling-ollama.py @@ -157,6 +157,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/15-switch-voices.py b/examples/foundational/15-switch-voices.py index ce2a358af..052d4337e 100644 --- a/examples/foundational/15-switch-voices.py +++ b/examples/foundational/15-switch-voices.py @@ -178,6 +178,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/15a-switch-languages.py b/examples/foundational/15a-switch-languages.py index 61cc2e3bd..d15be8abc 100644 --- a/examples/foundational/15a-switch-languages.py +++ b/examples/foundational/15a-switch-languages.py @@ -166,6 +166,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/16-gpu-container-local-bot.py b/examples/foundational/16-gpu-container-local-bot.py index fe8437be0..05d89ddd7 100644 --- a/examples/foundational/16-gpu-container-local-bot.py +++ b/examples/foundational/16-gpu-container-local-bot.py @@ -143,6 +143,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/17-detect-user-idle.py b/examples/foundational/17-detect-user-idle.py index bb6975829..70b51d9db 100644 --- a/examples/foundational/17-detect-user-idle.py +++ b/examples/foundational/17-detect-user-idle.py @@ -140,6 +140,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/18-gstreamer-filesrc.py b/examples/foundational/18-gstreamer-filesrc.py index 94cbaed84..4277ae35c 100644 --- a/examples/foundational/18-gstreamer-filesrc.py +++ b/examples/foundational/18-gstreamer-filesrc.py @@ -66,7 +66,7 @@ async def run_example(transport: BaseTransport, args: argparse.Namespace, handle if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main parser = argparse.ArgumentParser(description="Pipecat Bot Runner") parser.add_argument("-i", "--input", type=str, required=True, help="Input video file") diff --git a/examples/foundational/18a-gstreamer-videotestsrc.py b/examples/foundational/18a-gstreamer-videotestsrc.py index 91b7535bd..20fc80c72 100644 --- a/examples/foundational/18a-gstreamer-videotestsrc.py +++ b/examples/foundational/18a-gstreamer-videotestsrc.py @@ -62,6 +62,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/19-openai-realtime-beta.py b/examples/foundational/19-openai-realtime-beta.py index 71b20eb0f..c389377d5 100644 --- a/examples/foundational/19-openai-realtime-beta.py +++ b/examples/foundational/19-openai-realtime-beta.py @@ -217,6 +217,6 @@ Remember, your responses should be short. Just one or two sentences, usually.""" if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/19a-azure-realtime-beta.py b/examples/foundational/19a-azure-realtime-beta.py index 81017188c..8adf4ce40 100644 --- a/examples/foundational/19a-azure-realtime-beta.py +++ b/examples/foundational/19a-azure-realtime-beta.py @@ -201,6 +201,6 @@ Remember, your responses should be short. Just one or two sentences, usually.""" if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/20a-persistent-context-openai.py b/examples/foundational/20a-persistent-context-openai.py index 9dd6ba42c..ab67e9685 100644 --- a/examples/foundational/20a-persistent-context-openai.py +++ b/examples/foundational/20a-persistent-context-openai.py @@ -245,6 +245,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/20b-persistent-context-openai-realtime.py b/examples/foundational/20b-persistent-context-openai-realtime.py index 2315254cb..50f1a14a5 100644 --- a/examples/foundational/20b-persistent-context-openai-realtime.py +++ b/examples/foundational/20b-persistent-context-openai-realtime.py @@ -255,6 +255,6 @@ Remember, your responses should be short. Just one or two sentences, usually.""" if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/20c-persistent-context-anthropic.py b/examples/foundational/20c-persistent-context-anthropic.py index 1c5f2c5a0..cfc5b5a71 100644 --- a/examples/foundational/20c-persistent-context-anthropic.py +++ b/examples/foundational/20c-persistent-context-anthropic.py @@ -244,6 +244,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/20d-persistent-context-gemini.py b/examples/foundational/20d-persistent-context-gemini.py index c9489539d..d44754173 100644 --- a/examples/foundational/20d-persistent-context-gemini.py +++ b/examples/foundational/20d-persistent-context-gemini.py @@ -15,13 +15,13 @@ from loguru import logger from pipecat.audio.vad.silero import SileroVADAnalyzer from pipecat.audio.vad.vad_analyzer import VADParams -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 PipelineParams, PipelineTask from pipecat.processors.aggregators.openai_llm_context import ( OpenAILLMContext, ) +from pipecat.runner.utils import get_transport_client_id, maybe_capture_participant_camera from pipecat.services.cartesia.tts import CartesiaTTSService from pipecat.services.deepgram.stt import DeepgramSTTService from pipecat.services.google.llm import GoogleLLMService @@ -303,6 +303,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/20e-persistent-context-aws-nova-sonic.py b/examples/foundational/20e-persistent-context-aws-nova-sonic.py index 7fa4c7e54..615a57cae 100644 --- a/examples/foundational/20e-persistent-context-aws-nova-sonic.py +++ b/examples/foundational/20e-persistent-context-aws-nova-sonic.py @@ -268,6 +268,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/21a-tavus-video-service.py b/examples/foundational/21a-tavus-video-service.py index 532cce847..b952f13db 100644 --- a/examples/foundational/21a-tavus-video-service.py +++ b/examples/foundational/21a-tavus-video-service.py @@ -124,6 +124,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/22-natural-conversation.py b/examples/foundational/22-natural-conversation.py index e3662ac85..55b836c49 100644 --- a/examples/foundational/22-natural-conversation.py +++ b/examples/foundational/22-natural-conversation.py @@ -170,6 +170,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/22b-natural-conversation-proposal.py b/examples/foundational/22b-natural-conversation-proposal.py index 74f280124..9a8621402 100644 --- a/examples/foundational/22b-natural-conversation-proposal.py +++ b/examples/foundational/22b-natural-conversation-proposal.py @@ -390,6 +390,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/22c-natural-conversation-mixed-llms.py b/examples/foundational/22c-natural-conversation-mixed-llms.py index 00d799cc8..cd603592c 100644 --- a/examples/foundational/22c-natural-conversation-mixed-llms.py +++ b/examples/foundational/22c-natural-conversation-mixed-llms.py @@ -606,6 +606,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/22d-natural-conversation-gemini-audio.py b/examples/foundational/22d-natural-conversation-gemini-audio.py index 0d053febf..989c1d9c2 100644 --- a/examples/foundational/22d-natural-conversation-gemini-audio.py +++ b/examples/foundational/22d-natural-conversation-gemini-audio.py @@ -780,6 +780,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/23-bot-background-sound.py b/examples/foundational/23-bot-background-sound.py index a74b81f65..0f11ab70d 100644 --- a/examples/foundational/23-bot-background-sound.py +++ b/examples/foundational/23-bot-background-sound.py @@ -136,6 +136,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/24-stt-mute-filter.py b/examples/foundational/24-stt-mute-filter.py index 2706bebaf..e051cf106 100644 --- a/examples/foundational/24-stt-mute-filter.py +++ b/examples/foundational/24-stt-mute-filter.py @@ -152,6 +152,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/25-google-audio-in.py b/examples/foundational/25-google-audio-in.py index 00c2c0941..cca546f70 100644 --- a/examples/foundational/25-google-audio-in.py +++ b/examples/foundational/25-google-audio-in.py @@ -379,6 +379,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/26-gemini-multimodal-live.py b/examples/foundational/26-gemini-multimodal-live.py index 7d9a19995..0aabdb38f 100644 --- a/examples/foundational/26-gemini-multimodal-live.py +++ b/examples/foundational/26-gemini-multimodal-live.py @@ -118,6 +118,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/26a-gemini-multimodal-live-transcription.py b/examples/foundational/26a-gemini-multimodal-live-transcription.py index a919f6297..3cefc46cf 100644 --- a/examples/foundational/26a-gemini-multimodal-live-transcription.py +++ b/examples/foundational/26a-gemini-multimodal-live-transcription.py @@ -138,6 +138,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/26b-gemini-multimodal-live-function-calling.py b/examples/foundational/26b-gemini-multimodal-live-function-calling.py index c21559b12..4ffba8e4e 100644 --- a/examples/foundational/26b-gemini-multimodal-live-function-calling.py +++ b/examples/foundational/26b-gemini-multimodal-live-function-calling.py @@ -173,6 +173,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/26c-gemini-multimodal-live-video.py b/examples/foundational/26c-gemini-multimodal-live-video.py index 50c283aae..8cbe3e014 100644 --- a/examples/foundational/26c-gemini-multimodal-live-video.py +++ b/examples/foundational/26c-gemini-multimodal-live-video.py @@ -13,11 +13,11 @@ from loguru import logger from pipecat.audio.vad.silero import SileroVADAnalyzer from pipecat.audio.vad.vad_analyzer import VADParams -from pipecat.examples.run import maybe_capture_participant_camera, maybe_capture_participant_screen 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.runner.utils import maybe_capture_participant_camera, maybe_capture_participant_screen from pipecat.services.gemini_multimodal_live.gemini import GeminiMultimodalLiveLLMService from pipecat.transports.base_transport import BaseTransport, TransportParams from pipecat.transports.services.daily import DailyParams @@ -111,6 +111,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/26d-gemini-multimodal-live-text.py b/examples/foundational/26d-gemini-multimodal-live-text.py index f5d0f3630..573e79fd0 100644 --- a/examples/foundational/26d-gemini-multimodal-live-text.py +++ b/examples/foundational/26d-gemini-multimodal-live-text.py @@ -141,6 +141,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/26e-gemini-multimodal-google-search.py b/examples/foundational/26e-gemini-multimodal-google-search.py index 907634694..b4844d7ce 100644 --- a/examples/foundational/26e-gemini-multimodal-google-search.py +++ b/examples/foundational/26e-gemini-multimodal-google-search.py @@ -132,6 +132,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/26f-gemini-multimodal-live-files-api.py b/examples/foundational/26f-gemini-multimodal-live-files-api.py index 07b427c37..c65561ac0 100644 --- a/examples/foundational/26f-gemini-multimodal-live-files-api.py +++ b/examples/foundational/26f-gemini-multimodal-live-files-api.py @@ -223,7 +223,7 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main upload_example_file = input(""" diff --git a/examples/foundational/26g-gemini-multimodal-live-groundingMetadata.py b/examples/foundational/26g-gemini-multimodal-live-groundingMetadata.py index b96e3ab26..a9a73b4d5 100644 --- a/examples/foundational/26g-gemini-multimodal-live-groundingMetadata.py +++ b/examples/foundational/26g-gemini-multimodal-live-groundingMetadata.py @@ -160,6 +160,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/27-simli-layer.py b/examples/foundational/27-simli-layer.py index 40f6b0c3d..defd76f8c 100644 --- a/examples/foundational/27-simli-layer.py +++ b/examples/foundational/27-simli-layer.py @@ -113,6 +113,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/28-transcription-processor.py b/examples/foundational/28-transcription-processor.py index 82ca13bbc..5841d22b3 100644 --- a/examples/foundational/28-transcription-processor.py +++ b/examples/foundational/28-transcription-processor.py @@ -181,6 +181,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/29-turn-tracking-observer.py b/examples/foundational/29-turn-tracking-observer.py index 3467f044c..0dc6cd460 100644 --- a/examples/foundational/29-turn-tracking-observer.py +++ b/examples/foundational/29-turn-tracking-observer.py @@ -122,6 +122,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/30-observer.py b/examples/foundational/30-observer.py index 161031415..1d5cc6291 100644 --- a/examples/foundational/30-observer.py +++ b/examples/foundational/30-observer.py @@ -167,6 +167,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/32-gemini-grounding-metadata.py b/examples/foundational/32-gemini-grounding-metadata.py index e4729bfd5..bec021b4b 100644 --- a/examples/foundational/32-gemini-grounding-metadata.py +++ b/examples/foundational/32-gemini-grounding-metadata.py @@ -153,6 +153,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/33-gemini-rag.py b/examples/foundational/33-gemini-rag.py index dcb4c9a8c..b3385dd84 100644 --- a/examples/foundational/33-gemini-rag.py +++ b/examples/foundational/33-gemini-rag.py @@ -260,6 +260,6 @@ Your response will be turned into speech so use only simple words and punctuatio if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/34-audio-recording.py b/examples/foundational/34-audio-recording.py index 692904d0d..6b7208b59 100644 --- a/examples/foundational/34-audio-recording.py +++ b/examples/foundational/34-audio-recording.py @@ -194,6 +194,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/35-pattern-pair-voice-switching.py b/examples/foundational/35-pattern-pair-voice-switching.py index 07860f98b..2c93872dd 100644 --- a/examples/foundational/35-pattern-pair-voice-switching.py +++ b/examples/foundational/35-pattern-pair-voice-switching.py @@ -232,6 +232,6 @@ Remember: Use narrator voice for EVERYTHING except the actual quoted dialogue."" if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/36-user-email-gathering.py b/examples/foundational/36-user-email-gathering.py index 528200182..c512330d4 100644 --- a/examples/foundational/36-user-email-gathering.py +++ b/examples/foundational/36-user-email-gathering.py @@ -150,6 +150,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/37-mem0.py b/examples/foundational/37-mem0.py index b7ceb885e..6be3f1f75 100644 --- a/examples/foundational/37-mem0.py +++ b/examples/foundational/37-mem0.py @@ -291,6 +291,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/38-smart-turn-fal.py b/examples/foundational/38-smart-turn-fal.py index a3fac43ab..cfb4616c0 100644 --- a/examples/foundational/38-smart-turn-fal.py +++ b/examples/foundational/38-smart-turn-fal.py @@ -119,6 +119,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/38a-smart-turn-local-coreml.py b/examples/foundational/38a-smart-turn-local-coreml.py index 043e2e0bd..b25a2685e 100644 --- a/examples/foundational/38a-smart-turn-local-coreml.py +++ b/examples/foundational/38a-smart-turn-local-coreml.py @@ -135,6 +135,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/38b-smart-turn-local.py b/examples/foundational/38b-smart-turn-local.py index 7541603ba..691817085 100644 --- a/examples/foundational/38b-smart-turn-local.py +++ b/examples/foundational/38b-smart-turn-local.py @@ -135,6 +135,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/39-mcp-stdio.py b/examples/foundational/39-mcp-stdio.py index 634ed8393..7b91eeb4e 100644 --- a/examples/foundational/39-mcp-stdio.py +++ b/examples/foundational/39-mcp-stdio.py @@ -192,6 +192,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/39a-mcp-run-sse.py b/examples/foundational/39a-mcp-run-sse.py index fbbcbcc6a..9e1f5b4c8 100644 --- a/examples/foundational/39a-mcp-run-sse.py +++ b/examples/foundational/39a-mcp-run-sse.py @@ -124,6 +124,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/39b-multiple-mcp.py b/examples/foundational/39b-multiple-mcp.py index 7d1396834..3c94537c5 100644 --- a/examples/foundational/39b-multiple-mcp.py +++ b/examples/foundational/39b-multiple-mcp.py @@ -203,6 +203,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/39c-mcp-run-http.py b/examples/foundational/39c-mcp-run-http.py index 6c39da75c..f6b7746fb 100644 --- a/examples/foundational/39c-mcp-run-http.py +++ b/examples/foundational/39c-mcp-run-http.py @@ -128,6 +128,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/40-aws-nova-sonic.py b/examples/foundational/40-aws-nova-sonic.py index ecfc4c1fb..220c60f73 100644 --- a/examples/foundational/40-aws-nova-sonic.py +++ b/examples/foundational/40-aws-nova-sonic.py @@ -173,6 +173,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/41a-text-only-webrtc.py b/examples/foundational/41a-text-only-webrtc.py index 2441b6380..cf5f1008b 100644 --- a/examples/foundational/41a-text-only-webrtc.py +++ b/examples/foundational/41a-text-only-webrtc.py @@ -156,6 +156,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/41b-text-and-audio-webrtc.py b/examples/foundational/41b-text-and-audio-webrtc.py index 4e8f10605..cda3c7c0b 100644 --- a/examples/foundational/41b-text-and-audio-webrtc.py +++ b/examples/foundational/41b-text-and-audio-webrtc.py @@ -172,6 +172,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/foundational/42-interruption-config.py b/examples/foundational/42-interruption-config.py index 7f83b7023..6503be77d 100644 --- a/examples/foundational/42-interruption-config.py +++ b/examples/foundational/42-interruption-config.py @@ -118,6 +118,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/open-telemetry/jaeger/bot.py b/examples/open-telemetry/jaeger/bot.py index 5b16814b5..e1b87382b 100644 --- a/examples/open-telemetry/jaeger/bot.py +++ b/examples/open-telemetry/jaeger/bot.py @@ -165,6 +165,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/examples/open-telemetry/langfuse/bot.py b/examples/open-telemetry/langfuse/bot.py index b1bf65d99..b454a2d0d 100644 --- a/examples/open-telemetry/langfuse/bot.py +++ b/examples/open-telemetry/langfuse/bot.py @@ -162,6 +162,6 @@ async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_si if __name__ == "__main__": - from pipecat.examples.run import main + from pipecat.runner.local import main main(run_example, transport_params=transport_params) diff --git a/src/pipecat/examples/__init__.py b/src/pipecat/examples/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/pipecat/examples/daily_runner.py b/src/pipecat/examples/daily_runner.py deleted file mode 100644 index d8d6acd81..000000000 --- a/src/pipecat/examples/daily_runner.py +++ /dev/null @@ -1,89 +0,0 @@ -# -# Copyright (c) 2024–2025, Daily -# -# SPDX-License-Identifier: BSD 2-Clause License -# - -"""Daily.co room configuration utilities for Pipecat examples.""" - -import argparse -import os -from typing import Optional - -import aiohttp - -from pipecat.transports.services.helpers.daily_rest import DailyRESTHelper - - -async def configure(aiohttp_session: aiohttp.ClientSession): - """Configure Daily.co room URL and token from arguments or environment. - - Args: - aiohttp_session: HTTP session for making API requests. - - Returns: - Tuple containing the room URL and authentication token. - - Raises: - Exception: If room URL or API key are not provided. - """ - (url, token, _) = await configure_with_args(aiohttp_session) - return (url, token) - - -async def configure_with_args( - aiohttp_session: aiohttp.ClientSession, parser: Optional[argparse.ArgumentParser] = None -): - """Configure Daily.co room with command-line argument parsing. - - Args: - aiohttp_session: HTTP session for making API requests. - parser: Optional argument parser. If None, creates a default one. - - Returns: - Tuple containing room URL, authentication token, and parsed arguments. - - Raises: - Exception: If room URL or API key are not provided via arguments or environment. - """ - if not parser: - parser = argparse.ArgumentParser(description="Daily AI SDK Bot Sample") - parser.add_argument( - "-u", "--url", type=str, required=False, help="URL of the Daily room to join" - ) - parser.add_argument( - "-k", - "--apikey", - type=str, - required=False, - help="Daily API Key (needed to create an owner token for the room)", - ) - - args, unknown = parser.parse_known_args() - - url = args.url or os.getenv("DAILY_SAMPLE_ROOM_URL") - key = args.apikey or os.getenv("DAILY_API_KEY") - - if not url: - raise Exception( - "No Daily room specified. use the -u/--url option from the command line, or set DAILY_SAMPLE_ROOM_URL in your environment to specify a Daily room URL." - ) - - if not key: - raise Exception( - "No Daily API key specified. use the -k/--apikey option from the command line, or set DAILY_API_KEY in your environment to specify a Daily API key, available from https://dashboard.daily.co/developers." - ) - - daily_rest_helper = DailyRESTHelper( - daily_api_key=key, - daily_api_url=os.getenv("DAILY_API_URL", "https://api.daily.co/v1"), - aiohttp_session=aiohttp_session, - ) - - # Create a meeting token for the given room with an expiration 1 hour in - # the future. - expiry_time: float = 60 * 60 - - token = await daily_rest_helper.get_token(url, expiry_time) - - return (url, token, args) diff --git a/src/pipecat/examples/run.py b/src/pipecat/examples/run.py deleted file mode 100644 index afd7a86ac..000000000 --- a/src/pipecat/examples/run.py +++ /dev/null @@ -1,437 +0,0 @@ -# -# Copyright (c) 2024–2025, Daily -# -# SPDX-License-Identifier: BSD 2-Clause License -# - -"""Pipecat example runner with support for multiple transport types. - -This module provides a unified interface for running Pipecat examples across -different transport types including Daily.co, WebRTC, and Twilio. It handles -setup, configuration, and lifecycle management for each transport type. - -Example usage: - SmallWebRTCTransport:: - - python bot.py --transport webrtc - - DailyTransport:: - - python bot.py --transport daily - - Twilio:: - - python bot.py --transport twilio --proxy username.ngrok.io - # Note: Concurrently, run an ngrok tunnel to your local server: - # ngrok http 7860 -""" - -import argparse -import asyncio -import json -import os -import re -import sys -from contextlib import asynccontextmanager -from typing import Any, Callable, Dict, Mapping, Optional - -import aiohttp -import uvicorn -from dotenv import load_dotenv -from fastapi import BackgroundTasks, FastAPI, WebSocket -from fastapi.middleware.cors import CORSMiddleware -from fastapi.responses import HTMLResponse, RedirectResponse -from loguru import logger - -from pipecat.serializers.twilio import TwilioFrameSerializer -from pipecat.transports.base_transport import BaseTransport, TransportParams -from pipecat.transports.network.fastapi_websocket import ( - FastAPIWebsocketParams, - FastAPIWebsocketTransport, -) -from pipecat.transports.network.small_webrtc import SmallWebRTCTransport -from pipecat.transports.network.webrtc_connection import IceServer, SmallWebRTCConnection -from pipecat.transports.services.daily import DailyParams, DailyTransport - -# Load environment variables -load_dotenv(override=True) - - -def get_transport_client_id(transport: BaseTransport, client: Any) -> str: - """Get client identifier from transport-specific client object. - - Args: - transport: The transport instance. - client: Transport-specific client object. - - Returns: - Client identifier string, empty if transport not supported. - """ - if isinstance(transport, SmallWebRTCTransport): - return client.pc_id - elif isinstance(transport, DailyTransport): - return client["id"] - logger.warning(f"Unable to get client id from unsupported transport {type(transport)}") - return "" - - -async def maybe_capture_participant_camera( - transport: BaseTransport, client: Any, framerate: int = 0 -): - """Capture participant camera video if transport supports it. - - Args: - transport: The transport instance. - client: Transport-specific client object. - framerate: Video capture framerate. Defaults to 0 (auto). - """ - if isinstance(transport, DailyTransport): - await transport.capture_participant_video( - client["id"], framerate=framerate, video_source="camera" - ) - - -async def maybe_capture_participant_screen( - transport: BaseTransport, client: Any, framerate: int = 0 -): - """Capture participant screen video if transport supports it. - - Args: - transport: The transport instance. - client: Transport-specific client object. - framerate: Video capture framerate. Defaults to 0 (auto). - """ - if isinstance(transport, DailyTransport): - await transport.capture_participant_video( - client["id"], framerate=framerate, video_source="screenVideo" - ) - - -def smallwebrtc_sdp_cleanup_ice_candidates(text: str, pattern: str) -> str: - """Clean up ICE candidates in SDP text for SmallWebRTC. - - Args: - text: SDP text to clean up. - pattern: Pattern to match for candidate filtering. - - Returns: - Cleaned SDP text with filtered ICE candidates. - """ - result = [] - lines = text.splitlines() - for line in lines: - if re.search("a=candidate", line): - if re.search(pattern, line) and not re.search("raddr", line): - result.append(line) - else: - result.append(line) - return "\r\n".join(result) - - -def smallwebrtc_sdp_cleanup_fingerprints(text: str) -> str: - """Remove unsupported fingerprint algorithms from SDP text. - - Args: - text: SDP text to clean up. - - Returns: - SDP text with sha-384 and sha-512 fingerprints removed. - """ - result = [] - lines = text.splitlines() - for line in lines: - if not re.search("sha-384", line) and not re.search("sha-512", line): - result.append(line) - return "\r\n".join(result) - - -def smallwebrtc_sdp_munging(sdp: str, host: str) -> str: - """Apply SDP modifications for SmallWebRTC compatibility. - - Args: - sdp: Original SDP string. - host: Host address for ICE candidate filtering. - - Returns: - Modified SDP string with fingerprint and ICE candidate cleanup. - """ - sdp = smallwebrtc_sdp_cleanup_fingerprints(sdp) - sdp = smallwebrtc_sdp_cleanup_ice_candidates(sdp, host) - return sdp - - -def run_example_daily( - run_example: Callable, - args: argparse.Namespace, - transport_params: Mapping[str, Callable] = {}, -): - """Run example using Daily.co transport. - - Args: - run_example: The example function to run. - args: Parsed command-line arguments. - transport_params: Mapping of transport names to parameter factory functions. - """ - logger.info("Running example with DailyTransport...") - - from pipecat.examples.daily_runner import configure - - async def run(): - async with aiohttp.ClientSession() as session: - (room_url, token) = await configure(session) - - # Run example function with DailyTransport transport arguments. - params: DailyParams = transport_params[args.transport]() - transport = DailyTransport(room_url, token, "Pipecat", params=params) - await run_example(transport, args, True) - - asyncio.run(run()) - - -def run_example_webrtc( - run_example: Callable, - args: argparse.Namespace, - transport_params: Mapping[str, Callable] = {}, -): - """Run example using WebRTC transport with FastAPI server. - - Args: - run_example: The example function to run. - args: Parsed command-line arguments. - transport_params: Mapping of transport names to parameter factory functions. - """ - logger.info("Running example with SmallWebRTCTransport...") - - from pipecat_ai_small_webrtc_prebuilt.frontend import SmallWebRTCPrebuiltUI - - app = FastAPI() - - # Store connections by pc_id - pcs_map: Dict[str, SmallWebRTCConnection] = {} - - # Mount the frontend at / - app.mount("/client", SmallWebRTCPrebuiltUI) - - @app.get("/", include_in_schema=False) - async def root_redirect(): - """Redirect root requests to client interface.""" - return RedirectResponse(url="/client/") - - @app.post("/api/offer") - async def offer(request: dict, background_tasks: BackgroundTasks): - """Handle WebRTC offer requests and manage peer connections. - - Args: - request: WebRTC offer request containing SDP and connection details. - background_tasks: FastAPI background tasks for running examples. - - Returns: - WebRTC answer with connection details. - """ - pc_id = request.get("pc_id") - - if pc_id and pc_id in pcs_map: - pipecat_connection = pcs_map[pc_id] - logger.info(f"Reusing existing connection for pc_id: {pc_id}") - await pipecat_connection.renegotiate( - sdp=request["sdp"], - type=request["type"], - restart_pc=request.get("restart_pc", False), - ) - else: - pipecat_connection = SmallWebRTCConnection() - await pipecat_connection.initialize(sdp=request["sdp"], type=request["type"]) - - @pipecat_connection.event_handler("closed") - async def handle_disconnected(webrtc_connection: SmallWebRTCConnection): - """Handle WebRTC connection closure and cleanup. - - Args: - webrtc_connection: The closed WebRTC connection. - """ - logger.info(f"Discarding peer connection for pc_id: {webrtc_connection.pc_id}") - pcs_map.pop(webrtc_connection.pc_id, None) - - # Run example function with SmallWebRTC transport arguments. - params: TransportParams = transport_params[args.transport]() - transport = SmallWebRTCTransport(params=params, webrtc_connection=pipecat_connection) - background_tasks.add_task(run_example, transport, args, False) - - answer = pipecat_connection.get_answer() - - if args.esp32 and args.host: - answer["sdp"] = smallwebrtc_sdp_munging(answer["sdp"], args.host) - - # Updating the peer connection inside the map - pcs_map[answer["pc_id"]] = pipecat_connection - - return answer - - @asynccontextmanager - async def lifespan(app: FastAPI): - """Manage FastAPI application lifecycle and cleanup connections. - - Args: - app: The FastAPI application instance. - - Yields: - Control to the FastAPI application runtime. - """ - yield # Run app - coros = [pc.disconnect() for pc in pcs_map.values()] - await asyncio.gather(*coros) - pcs_map.clear() - - uvicorn.run(app, host=args.host, port=args.port) - - -def run_example_twilio( - run_example: Callable, - args: argparse.Namespace, - transport_params: Mapping[str, Callable] = {}, -): - """Run example using Twilio transport with FastAPI WebSocket server. - - Args: - run_example: The example function to run. - args: Parsed command-line arguments. - transport_params: Mapping of transport names to parameter factory functions. - """ - logger.info("Running example with FastAPIWebsocketTransport (Twilio)...") - - app = FastAPI() - - app.add_middleware( - CORSMiddleware, - allow_origins=["*"], # Allow all origins for testing - allow_credentials=True, - allow_methods=["*"], - allow_headers=["*"], - ) - - @app.post("/") - async def start_call(): - """Handle Twilio webhook and return TwiML response. - - Returns: - TwiML XML response directing call to WebSocket stream. - """ - logger.debug("POST TwiML") - - xml_content = f""" - - - - - - - """ - return HTMLResponse(content=xml_content, media_type="application/xml") - - @app.websocket("/ws") - async def websocket_endpoint(websocket: WebSocket): - """Handle Twilio WebSocket connections for voice streaming. - - Args: - websocket: The WebSocket connection from Twilio. - """ - await websocket.accept() - - logger.debug("WebSocket connection accepted") - - # Reading Twilio data. - start_data = websocket.iter_text() - await start_data.__anext__() - call_data = json.loads(await start_data.__anext__()) - print(call_data, flush=True) - stream_sid = call_data["start"]["streamSid"] - call_sid = call_data["start"]["callSid"] - - # Create websocket transport and update params. - params: FastAPIWebsocketParams = transport_params[args.transport]() - params.add_wav_header = False - params.serializer = TwilioFrameSerializer( - stream_sid=stream_sid, - call_sid=call_sid, - account_sid=os.getenv("TWILIO_ACCOUNT_SID", ""), - auth_token=os.getenv("TWILIO_AUTH_TOKEN", ""), - ) - transport = FastAPIWebsocketTransport(websocket=websocket, params=params) - await run_example(transport, args, False) - - uvicorn.run(app, host=args.host, port=args.port) - - -def run_main( - run_example: Callable, - args: argparse.Namespace, - transport_params: Mapping[str, Callable] = {}, -): - """Run the example with the specified transport type. - - Args: - run_example: The example function to run. - args: Parsed command-line arguments. - transport_params: Mapping of transport names to parameter factory functions. - """ - if args.transport not in transport_params: - logger.error(f"Transport '{args.transport}' not supported by this example") - return - - match args.transport: - case "daily": - run_example_daily(run_example, args, transport_params) - case "webrtc": - run_example_webrtc(run_example, args, transport_params) - case "twilio": - run_example_twilio(run_example, args, transport_params) - - -def main( - run_example: Callable, - *, - parser: Optional[argparse.ArgumentParser] = None, - transport_params: Mapping[str, Callable] = {}, -): - """Main entry point for running Pipecat examples with transport selection. - - Args: - run_example: The example function to run. - parser: Optional argument parser. If None, creates a default one. - transport_params: Mapping of transport names to parameter factory functions. - """ - if not parser: - parser = argparse.ArgumentParser(description="Pipecat Bot Runner") - parser.add_argument( - "--host", default="localhost", help="Host for HTTP server (default: localhost)" - ) - parser.add_argument( - "--port", type=int, default=7860, help="Port for HTTP server (default: 7860)" - ) - parser.add_argument( - "--transport", - "-t", - type=str, - choices=["daily", "webrtc", "twilio"], - default="webrtc", - help="The transport this example should use", - ) - parser.add_argument( - "--proxy", "-x", help="A public proxy host name (no protocol, e.g. proxy.example.com)" - ) - parser.add_argument( - "--esp32", action="store_true", default=False, help="Perform SDP munging for the ESP32" - ) - parser.add_argument("--verbose", "-v", action="count", default=0) - args = parser.parse_args() - - if args.esp32 and args.host == "localhost": - logger.error("For ESP32, you need to specify `--host IP` so we can do SDP munging.") - return - - # Log level - logger.remove(0) - logger.add(sys.stderr, level="TRACE" if args.verbose else "DEBUG") - - # Import the bot file - run_main(run_example, args, transport_params)