From f75f361629bf16b12d96e9a368e57ca03c010ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6kmen=20G=C3=B6rgen?= Date: Thu, 23 Apr 2026 22:40:51 +0200 Subject: [PATCH 1/6] bump `aic-sdk` to 2.2.0 and update `AICFilter` with `model_id` and `enhancement_level` changes. --- examples/voice/voice-aicoustics.py | 3 +- pyproject.toml | 2 +- uv.lock | 64 +++++++++++++----------------- 3 files changed, 30 insertions(+), 39 deletions(-) diff --git a/examples/voice/voice-aicoustics.py b/examples/voice/voice-aicoustics.py index 39110de88..cb1e8e55c 100644 --- a/examples/voice/voice-aicoustics.py +++ b/examples/voice/voice-aicoustics.py @@ -40,7 +40,8 @@ def _create_aic_filter() -> AICFilter: return AICFilter( license_key=license_key, - model_id="quail-vf-2.0-l-16khz", + model_id="quail-vf-2.1-l-16khz", + enhancement_level=0.8, ) diff --git a/pyproject.toml b/pyproject.toml index 906f8fff5..49594e73d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,7 +52,7 @@ Issues = "https://github.com/pipecat-ai/pipecat/issues" Changelog = "https://github.com/pipecat-ai/pipecat/blob/main/CHANGELOG.md" [project.optional-dependencies] -aic = [ "aic-sdk~=2.1.0" ] +aic = [ "aic-sdk~=2.2.0" ] anthropic = [ "anthropic>=0.49.0,<1" ] assemblyai = [ "pipecat-ai[websockets-base]" ] asyncai = [ "pipecat-ai[websockets-base]" ] diff --git a/uv.lock b/uv.lock index 671cb95cd..1ca35c541 100644 --- a/uv.lock +++ b/uv.lock @@ -28,37 +28,37 @@ wheels = [ [[package]] name = "aic-sdk" -version = "2.1.1" +version = "2.2.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "numpy" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/c9/31/1631b1c8abbdcaa5978d2561b9f13430b1e9ed2b6e27d6e9cecc890ad4bd/aic_sdk-2.1.1.tar.gz", hash = "sha256:2d56a29ea79cc5373e44bdb09db58c837b4e6b5b09ce4c8a932ef709f535230e", size = 5315222, upload-time = "2026-03-19T10:50:59.52Z" } +sdist = { url = "https://files.pythonhosted.org/packages/2a/d6/bcb93b6a67b4dd88582ac244e92c057ccd0c356ebcdfb22cb8d01c097297/aic_sdk-2.2.0.tar.gz", hash = "sha256:1e459031e9a545956730443765dbe8d480f3f858abc940230c7b2e37126eaf61", size = 3345678, upload-time = "2026-04-23T14:02:17.92Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/49/55/6ba78de1d50304358d6044d5d955e252a2249a0f4b2cee09236fdbf45f5c/aic_sdk-2.1.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:83f9de8456b0e029e103a25ab85145a63594531e5ba97bc42f3c930e936f4bae", size = 3577462, upload-time = "2026-03-19T10:50:17.706Z" }, - { url = "https://files.pythonhosted.org/packages/ec/dc/c4b53ed252cf5bc882481bdf0473b1a2ca8ee0131aeaeb4bae6955db8e7a/aic_sdk-2.1.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:074d3fba2e31cf79e7834107e00910681fa94bd97d773b4230db54edf0f741c1", size = 3192533, upload-time = "2026-03-19T10:50:19.547Z" }, - { url = "https://files.pythonhosted.org/packages/1d/1c/b86207570a96d643317b3bbe3c6141daa3cef3a0982266fe39163613593c/aic_sdk-2.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:490611f754c6ac3392f54b52f6f6ccd0787bae940217e0e5800bc3ab69ed4c9a", size = 3124929, upload-time = "2026-03-19T10:50:21.441Z" }, - { url = "https://files.pythonhosted.org/packages/d3/dc/b5a45a0447431161dd9ffd2de7ac80bb456399395127d0e8bcf7c9a30e81/aic_sdk-2.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:babc3ad0b4850ac389fb36fda72800b30262af2371bb6e7704ef2e5de6922766", size = 3476070, upload-time = "2026-03-19T10:50:23.016Z" }, - { url = "https://files.pythonhosted.org/packages/e2/4d/ee7c17c147641b0df140b5a5a444d57dc1581aebe5de8a9ad8fec09f1067/aic_sdk-2.1.1-cp311-cp311-win_amd64.whl", hash = "sha256:fb06ad8f1999fef7239d193886daf8f378ed09633e46b33b53d378be1060e271", size = 2961137, upload-time = "2026-03-19T10:50:25Z" }, - { url = "https://files.pythonhosted.org/packages/ad/38/561b3e3577e0ea1c947689a9726b13129e2595f175bfb2dd32423767cd14/aic_sdk-2.1.1-cp311-cp311-win_arm64.whl", hash = "sha256:7d78cd33338815d282f996b0febb5c21f47f5217befc96b9d3e93783189ef6e2", size = 2659726, upload-time = "2026-03-19T10:50:26.609Z" }, - { url = "https://files.pythonhosted.org/packages/23/e6/526373728757dec7fdbcbcbcb44152dc9233235a03e90f27df96ba9a5960/aic_sdk-2.1.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:eaddc53ad93c642895beaaf04a5157b65d00b63a986a2ed60ea970017949725a", size = 3578492, upload-time = "2026-03-19T10:50:28.357Z" }, - { url = "https://files.pythonhosted.org/packages/c8/35/cdc914c1b0fd2292b404d689f0948d96135903f437bb20bf729dba04e899/aic_sdk-2.1.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b790c72a278217bdbd8cbef2261d7e902684eb979dde5ec891d075d1c4c7e97e", size = 3192709, upload-time = "2026-03-19T10:50:30.617Z" }, - { url = "https://files.pythonhosted.org/packages/2f/88/7c00e5683a729e8294171dcb59430af7a429d54666c567b30b20be7f6174/aic_sdk-2.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:db6f2794db724e7f55d4cf1233d0bf802777fbf943eae9a1c05786dbe6e43910", size = 3124760, upload-time = "2026-03-19T10:50:32.587Z" }, - { url = "https://files.pythonhosted.org/packages/42/b1/a575df4e2ee5e6f9e3dec777fd91c40b1bdcbf30a36c74eeac4e7425d085/aic_sdk-2.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2413fb23dceef8232cd4b4553775f1ca668e1270dd2b35b73359ac3dbd58d701", size = 3477318, upload-time = "2026-03-19T10:50:34.336Z" }, - { url = "https://files.pythonhosted.org/packages/36/8d/6009b04f27053258673c260b0cd6f72bda8f5c50bfe6500b7f2f574dd304/aic_sdk-2.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:d370ef2166675ad79e16822cc26f67d3b7e0f8fe52567dc42e77339ec11f124e", size = 2958807, upload-time = "2026-03-19T10:50:35.966Z" }, - { url = "https://files.pythonhosted.org/packages/4f/cb/298d765c6b62867ed3eec21dcd566e4926955041612494b793a57e08db3f/aic_sdk-2.1.1-cp312-cp312-win_arm64.whl", hash = "sha256:c60e9d8e3c363b3ba03e3d666f99c706700b3636cbc98443d08fdc2084d0651b", size = 2656909, upload-time = "2026-03-19T10:50:37.749Z" }, - { url = "https://files.pythonhosted.org/packages/89/e2/966a72c4c0c5b771187a0494cdef1a8f27d137225ccddb5fa04612f4a7ad/aic_sdk-2.1.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:2db12980bf64c4a66a1d0bb469aa45c314315b8ac8328dc2a94f6e65480da359", size = 3577887, upload-time = "2026-03-19T10:50:39.126Z" }, - { url = "https://files.pythonhosted.org/packages/8e/78/61518fce28d058859d9065baeff6d0dbabd709245fa42a6c20286dd49fa3/aic_sdk-2.1.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:c168ed46cba940b1808ffe8a6c709b09091b918c9120f1318672fd340caa35b4", size = 3192498, upload-time = "2026-03-19T10:50:40.978Z" }, - { url = "https://files.pythonhosted.org/packages/94/98/fbf4800329a2e51cdfd9ee19f0db998495374b16a935ae5d9183a40c5bb8/aic_sdk-2.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:46fe3f666f2e6488e421c6d5d8abe12e5905940cfa67ea63ca6535f51cca2233", size = 3124253, upload-time = "2026-03-19T10:50:42.518Z" }, - { url = "https://files.pythonhosted.org/packages/90/bf/6485d64c3c2d9c579a95b05e96b08152ffa5e0d133b7ee7f1f07c10d8535/aic_sdk-2.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c8a3518aae32a8f60acb9ff598d2a04d1b2de82c9614990b2a20a17db38657d4", size = 3476777, upload-time = "2026-03-19T10:50:44.034Z" }, - { url = "https://files.pythonhosted.org/packages/6d/28/ad19c96dcba75a5cb93683d123cb2356734e39df4dd7a52545e8c494786f/aic_sdk-2.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:1a706954c0bd18552703ea792f16789e9e823795c16dd8a94b5e1a54ec451d95", size = 2958541, upload-time = "2026-03-19T10:50:45.793Z" }, - { url = "https://files.pythonhosted.org/packages/b9/f8/36a32f14ccdf55535176a1da44619647df53fc99560869204a6e2f741926/aic_sdk-2.1.1-cp313-cp313-win_arm64.whl", hash = "sha256:e30fa36e3e516e403f0770b1e213d2217c9f3c61a36615f59316d0d6d0f81e6a", size = 2656460, upload-time = "2026-03-19T10:50:47.785Z" }, - { url = "https://files.pythonhosted.org/packages/21/e0/3a9dd88872eae43e8885d171840f97a4a9c31578d81be588402b42fd242c/aic_sdk-2.1.1-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:0b54b143e34f0adaa72863999a3913faab938f3444d9ee7bb97d2edce2fb10d8", size = 3579058, upload-time = "2026-03-19T10:50:49.32Z" }, - { url = "https://files.pythonhosted.org/packages/38/d4/58715c8188afb594a8673edfa5a04b016a62a96d18e883522667f27032e2/aic_sdk-2.1.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:357feeee734e8338118fb6f4d8496709756006d780eaac484da06c314e133298", size = 3193006, upload-time = "2026-03-19T10:50:50.701Z" }, - { url = "https://files.pythonhosted.org/packages/7e/1a/bbcef1e4dad8b653516b94fab9602b8292d821d3d0ecee9a66ea6487845a/aic_sdk-2.1.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85e0d5092e70fa746fd758d1c7fc9896740da0a57e698949afc10bac9fe12216", size = 3125311, upload-time = "2026-03-19T10:50:52.576Z" }, - { url = "https://files.pythonhosted.org/packages/5d/7f/482760d46ec39dcc91dfc8500be9e032b81124907aa6cafce22df94b6194/aic_sdk-2.1.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:38087d418d1ff8215ce6c634db3eb7c40f109f096e7e5736f56f7a35a751e886", size = 3478229, upload-time = "2026-03-19T10:50:54.613Z" }, - { url = "https://files.pythonhosted.org/packages/e9/f2/8aa7bb5c140ae2f8c0fb3e3b2e75a4125f3614b49a1da0897e301ca73446/aic_sdk-2.1.1-cp314-cp314-win_amd64.whl", hash = "sha256:7fd3e2b7f2ac79b83722abc66db0813061f6a53143cb39aaabff034ef1811665", size = 2960375, upload-time = "2026-03-19T10:50:56.467Z" }, - { url = "https://files.pythonhosted.org/packages/92/25/76a52222b8f096218cb4dc24d3d4930bbf5769987cc6c6c4999cdbf404eb/aic_sdk-2.1.1-cp314-cp314-win_arm64.whl", hash = "sha256:ac14f55a31906e36f51d8e5585d0096a1e1de685711bb16d3f6baaac120c4102", size = 2658269, upload-time = "2026-03-19T10:50:57.96Z" }, + { url = "https://files.pythonhosted.org/packages/78/6d/c3179c3f21f1bf78c4db445776719de522c7927daf386c1d3fc3d8a4c54e/aic_sdk-2.2.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:95a69557c1331b7c72ca8fe624254a4ab3651062dee09097372c508fe13574b8", size = 4066328, upload-time = "2026-04-23T14:01:40.372Z" }, + { url = "https://files.pythonhosted.org/packages/51/dc/137d3608634529adb2b66e78322b304e7a5f28839b6a130574efba9a1310/aic_sdk-2.2.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d2a56d36e9135165a4ecb65ee4712ac1b943593d95708b04854b10ed6c7ef518", size = 3655869, upload-time = "2026-04-23T14:01:41.589Z" }, + { url = "https://files.pythonhosted.org/packages/46/b2/58d5937c1ab6f2c0561d52bf6fe36fa84ef5a42950f378b118ef41514860/aic_sdk-2.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1a7ced8d9955087505a959b8193b6623a9844ef4ed65bea956857f957530d6f4", size = 3565036, upload-time = "2026-04-23T14:01:43.338Z" }, + { url = "https://files.pythonhosted.org/packages/a5/61/7ac4b02acfa04fbfe478fd69a2b3d25ae442534879866ff99bb00a2f23b0/aic_sdk-2.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:75a4f89d8e859d74b25a20803db27e5b796661c2e4c479314d0ec5a5a845633e", size = 3932959, upload-time = "2026-04-23T14:01:44.763Z" }, + { url = "https://files.pythonhosted.org/packages/b5/2a/6239e4717738b703078d5b88629bd6980c8776c9011e9350a3ef46cd0993/aic_sdk-2.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:e5ebf942eb32dcca28ce6369d89d4687c088f5645cbc39704e409f930ad99c78", size = 3384308, upload-time = "2026-04-23T14:01:46.793Z" }, + { url = "https://files.pythonhosted.org/packages/6c/41/a9f79589b302e0a7888905a9072c98fcc020a85acd1cd8ee416db251c74f/aic_sdk-2.2.0-cp311-cp311-win_arm64.whl", hash = "sha256:91fdc07b357cbdfaf8b9c33bd65a54aa9577a2c0166be391b782b44676ed1c62", size = 3064103, upload-time = "2026-04-23T14:01:48.132Z" }, + { url = "https://files.pythonhosted.org/packages/f1/0c/5ba002a33e737406b47fca0bc44cd5d3eefef35ddc2f545b89dae2c6806a/aic_sdk-2.2.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:088a0c2ce0f577c20f5c40d3ae3a09508cd8a905b564cf3764adc1259742f81d", size = 4067060, upload-time = "2026-04-23T14:01:49.454Z" }, + { url = "https://files.pythonhosted.org/packages/35/3d/c9ee338a1203a2a44ebad190cb75fd1f92d250dce7edfca657c4cdd2a0bc/aic_sdk-2.2.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ba08d6ae21c50d93966ab75a89769776070b268c8732836faaedfbded0414afe", size = 3655275, upload-time = "2026-04-23T14:01:51.057Z" }, + { url = "https://files.pythonhosted.org/packages/84/2a/645845f903c86d34852ae0f27ce98944fe0b2ddc5d81a137faba058a3c6d/aic_sdk-2.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6aae0a1d36b26eecb2ade05fc1adad2e82e0c9b38e65ce215dc8c9b239f7fe4b", size = 3562283, upload-time = "2026-04-23T14:01:52.367Z" }, + { url = "https://files.pythonhosted.org/packages/de/a6/6f5a5d5727257c7d7d8c4ee31f18edb4428a1986feedeca85986a9edba61/aic_sdk-2.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dbc3b3d398b35894ccefd3891cd779f325d87587a2d5b0445cc4662fd95a7751", size = 3932655, upload-time = "2026-04-23T14:01:53.891Z" }, + { url = "https://files.pythonhosted.org/packages/51/40/fb36fb2700f1ca5797a9293a4c573acf32bc177bdf0919880775e4f57429/aic_sdk-2.2.0-cp312-cp312-win_amd64.whl", hash = "sha256:d08d5286f24a7d6a4f236feedb1dcdf3de6032d490c652d870f56b80711487c6", size = 3382782, upload-time = "2026-04-23T14:01:55.256Z" }, + { url = "https://files.pythonhosted.org/packages/23/71/ba0296d148ef284a6316c5699f0cf3cb5bb3d116c67ee8ed8fef4862401d/aic_sdk-2.2.0-cp312-cp312-win_arm64.whl", hash = "sha256:6169a9c073f47d6e6ae661ce78b829c5446f9a9c0e6e04e764f83bb4362ad165", size = 3061053, upload-time = "2026-04-23T14:01:56.755Z" }, + { url = "https://files.pythonhosted.org/packages/1a/1c/313b7c6d8959e97096f3466cde73d6db9ef94e9b8a2cfa54fa2378fb81a8/aic_sdk-2.2.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:55197e48b970ba8a158ca250f75e30d4ac1df666291f2c7f508ff3c7222f7e38", size = 4066265, upload-time = "2026-04-23T14:01:58.514Z" }, + { url = "https://files.pythonhosted.org/packages/1d/63/963e47170897ae4bd6b02611b2472b3276a61a2e2906be299ceaedd3e2d4/aic_sdk-2.2.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:099114a5b3a541d0f520dfcd87b195594fcdb6321fe6e62c5d4610d15a03d498", size = 3654664, upload-time = "2026-04-23T14:02:00.246Z" }, + { url = "https://files.pythonhosted.org/packages/36/05/4e760cfdbd78e5be74c60ec9efc3ef846c56f69fad05698242d3e933b3ff/aic_sdk-2.2.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3532d58306f1d25d1108d58b25d4d8dceb37febc85497d0c23e4579811533e4f", size = 3561807, upload-time = "2026-04-23T14:02:01.489Z" }, + { url = "https://files.pythonhosted.org/packages/2c/99/6e67dac214f1993395ed8cb7e9cb51b66b48829e62ddfc67dde08211b183/aic_sdk-2.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c71f7b3964efe4bc8fb5fd2ad3091f08f3c119f811f30c30ce488540387e9d34", size = 3931923, upload-time = "2026-04-23T14:02:03.064Z" }, + { url = "https://files.pythonhosted.org/packages/cf/49/435e1b240611fbabe73c0fc528aa162ab64afcb4022033e6e0ba14585f1b/aic_sdk-2.2.0-cp313-cp313-win_amd64.whl", hash = "sha256:9d43afdae40ce615bdaecd77768dfe0ef28bad67982e8142994171aab00aa6c1", size = 3382400, upload-time = "2026-04-23T14:02:04.592Z" }, + { url = "https://files.pythonhosted.org/packages/0b/74/de149fbc0e9f7b30dadc9e105fce67dde27b8a7c566901901470d0b516cf/aic_sdk-2.2.0-cp313-cp313-win_arm64.whl", hash = "sha256:2795535f065c4e4d178e70887ce7cdba8df012d4d682d1485fb0f9f0ef3e2d89", size = 3060500, upload-time = "2026-04-23T14:02:06.119Z" }, + { url = "https://files.pythonhosted.org/packages/7e/1a/f44c9088fa03dbf4b9d9fefe5f0367d0fed5a22999bc0a1e03394637b520/aic_sdk-2.2.0-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:0310151c7cf46fcd998ff41c7db515661f669ff4a0f592286aad4a35b4a08116", size = 4067817, upload-time = "2026-04-23T14:02:07.956Z" }, + { url = "https://files.pythonhosted.org/packages/26/5e/8b7fc359db566dbb427d87340692281f467fa806d9cb8becbd13fa82dce6/aic_sdk-2.2.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:314eb4354bb3e4952e05720c5c76df0bb1a746c958e93706f8e950f890f46dfa", size = 3655548, upload-time = "2026-04-23T14:02:09.815Z" }, + { url = "https://files.pythonhosted.org/packages/61/a8/8d079c7f488e71b181771343be7694060466c7adb75d907c96933d4ff7d5/aic_sdk-2.2.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c75c0b5b4c57d55910672a948d7502b96efc8101969463d01d5f13f1a2ff6a4c", size = 3563212, upload-time = "2026-04-23T14:02:11.17Z" }, + { url = "https://files.pythonhosted.org/packages/4a/86/fa9b3407128949fa19f84f43fc8b577e517172aa536ef1c1b495d8730c40/aic_sdk-2.2.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d12b998904b08a5ff5e97b8e0e878149b8e853cf32dacf72ba03dd42c890684e", size = 3933253, upload-time = "2026-04-23T14:02:13.336Z" }, + { url = "https://files.pythonhosted.org/packages/ca/64/eb913bf179c75007bf4bdff688aa3c91b88bc2e6b4a8f920881ac26b9511/aic_sdk-2.2.0-cp314-cp314-win_amd64.whl", hash = "sha256:b93c9a47ac81cdc94ec4d74f7fcba4380bedce4431373eb4ddd20861bb4aa65e", size = 3384593, upload-time = "2026-04-23T14:02:14.718Z" }, + { url = "https://files.pythonhosted.org/packages/02/a2/237bfab9c23e97c583552846671743fd7451c94eecad2e96dfe756e1dbab/aic_sdk-2.2.0-cp314-cp314-win_arm64.whl", hash = "sha256:62d8165322d4c5d824e5cbd675e0bd0650bfdc1df3aa58edc320d5716b376b9a", size = 3062145, upload-time = "2026-04-23T14:02:16.517Z" }, ] [[package]] @@ -1903,9 +1903,7 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/fb/c6/dba32cab7e3a625b011aa5647486e2d28423a48845a2998c126dd69c85e1/greenlet-3.4.0-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:805bebb4945094acbab757d34d6e1098be6de8966009ab9ca54f06ff492def58", size = 285504, upload-time = "2026-04-08T15:52:14.071Z" }, { url = "https://files.pythonhosted.org/packages/54/f4/7cb5c2b1feb9a1f50e038be79980dfa969aa91979e5e3a18fdbcfad2c517/greenlet-3.4.0-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:439fc2f12b9b512d9dfa681c5afe5f6b3232c708d13e6f02c845e0d9f4c2d8c6", size = 605476, upload-time = "2026-04-08T16:24:37.064Z" }, { url = "https://files.pythonhosted.org/packages/d6/af/b66ab0b2f9a4c5a867c136bf66d9599f34f21a1bcca26a2884a29c450bd9/greenlet-3.4.0-cp311-cp311-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a70ed1cb0295bee1df57b63bf7f46b4e56a5c93709eea769c1fec1bb23a95875", size = 618336, upload-time = "2026-04-08T16:30:56.59Z" }, - { url = "https://files.pythonhosted.org/packages/6d/31/56c43d2b5de476f77d36ceeec436328533bff960a4cba9a07616e93063ab/greenlet-3.4.0-cp311-cp311-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:8c5696c42e6bb5cfb7c6ff4453789081c66b9b91f061e5e9367fa15792644e76", size = 625045, upload-time = "2026-04-08T16:40:37.111Z" }, { url = "https://files.pythonhosted.org/packages/e5/5c/8c5633ece6ba611d64bf2770219a98dd439921d6424e4e8cf16b0ac74ea5/greenlet-3.4.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c660bce1940a1acae5f51f0a064f1bc785d07ea16efcb4bc708090afc4d69e83", size = 613515, upload-time = "2026-04-08T15:56:32.478Z" }, - { url = "https://files.pythonhosted.org/packages/80/ca/704d4e2c90acb8bdf7ae593f5cbc95f58e82de95cc540fb75631c1054533/greenlet-3.4.0-cp311-cp311-manylinux_2_39_riscv64.whl", hash = "sha256:89995ce5ddcd2896d89615116dd39b9703bfa0c07b583b85b89bf1b5d6eddf81", size = 419745, upload-time = "2026-04-08T16:43:04.022Z" }, { url = "https://files.pythonhosted.org/packages/a9/df/950d15bca0d90a0e7395eb777903060504cdb509b7b705631e8fb69ff415/greenlet-3.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:ee407d4d1ca9dc632265aee1c8732c4a2d60adff848057cdebfe5fe94eb2c8a2", size = 1574623, upload-time = "2026-04-08T16:26:18.596Z" }, { url = "https://files.pythonhosted.org/packages/1a/e7/0839afab829fcb7333c9ff6d80c040949510055d2d4d63251f0d1c7c804e/greenlet-3.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:956215d5e355fffa7c021d168728321fd4d31fd730ac609b1653b450f6a4bc71", size = 1639579, upload-time = "2026-04-08T15:57:29.231Z" }, { url = "https://files.pythonhosted.org/packages/d9/2b/b4482401e9bcaf9f5c97f67ead38db89c19520ff6d0d6699979c6efcc200/greenlet-3.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:5cb614ace7c27571270354e9c9f696554d073f8aa9319079dcba466bbdead711", size = 238233, upload-time = "2026-04-08T17:02:54.286Z" }, @@ -1913,9 +1911,7 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/65/8b/3669ad3b3f247a791b2b4aceb3aa5a31f5f6817bf547e4e1ff712338145a/greenlet-3.4.0-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:1a54a921561dd9518d31d2d3db4d7f80e589083063ab4d3e2e950756ef809e1a", size = 286902, upload-time = "2026-04-08T15:52:12.138Z" }, { url = "https://files.pythonhosted.org/packages/38/3e/3c0e19b82900873e2d8469b590a6c4b3dfd2b316d0591f1c26b38a4879a5/greenlet-3.4.0-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:16dec271460a9a2b154e3b1c2fa1050ce6280878430320e85e08c166772e3f97", size = 606099, upload-time = "2026-04-08T16:24:38.408Z" }, { url = "https://files.pythonhosted.org/packages/b5/33/99fef65e7754fc76a4ed14794074c38c9ed3394a5bd129d7f61b705f3168/greenlet-3.4.0-cp312-cp312-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:90036ce224ed6fe75508c1907a77e4540176dcf0744473627785dd519c6f9996", size = 618837, upload-time = "2026-04-08T16:30:58.298Z" }, - { url = "https://files.pythonhosted.org/packages/44/57/eae2cac10421feae6c0987e3dc106c6d86262b1cb379e171b017aba893a6/greenlet-3.4.0-cp312-cp312-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:6f0def07ec9a71d72315cf26c061aceee53b306c36ed38c35caba952ea1b319d", size = 624901, upload-time = "2026-04-08T16:40:38.981Z" }, { url = "https://files.pythonhosted.org/packages/36/f7/229f3aed6948faa20e0616a0b8568da22e365ede6a54d7d369058b128afd/greenlet-3.4.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a1c4f6b453006efb8310affb2d132832e9bbb4fc01ce6df6b70d810d38f1f6dc", size = 615062, upload-time = "2026-04-08T15:56:33.766Z" }, - { url = "https://files.pythonhosted.org/packages/6a/8a/0e73c9b94f31d1cc257fe79a0eff621674141cdae7d6d00f40de378a1e42/greenlet-3.4.0-cp312-cp312-manylinux_2_39_riscv64.whl", hash = "sha256:0e1254cf0cbaa17b04320c3a78575f29f3c161ef38f59c977108f19ffddaf077", size = 423927, upload-time = "2026-04-08T16:43:05.293Z" }, { url = "https://files.pythonhosted.org/packages/08/97/d988180011aa40135c46cd0d0cf01dd97f7162bae14139b4a3ef54889ba5/greenlet-3.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:9b2d9a138ffa0e306d0e2b72976d2fb10b97e690d40ab36a472acaab0838e2de", size = 1573511, upload-time = "2026-04-08T16:26:20.058Z" }, { url = "https://files.pythonhosted.org/packages/d4/0f/a5a26fe152fb3d12e6a474181f6e9848283504d0afd095f353d85726374b/greenlet-3.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:8424683caf46eb0eb6f626cb95e008e8cc30d0cb675bdfa48200925c79b38a08", size = 1640396, upload-time = "2026-04-08T15:57:30.88Z" }, { url = "https://files.pythonhosted.org/packages/42/cf/bb2c32d9a100e36ee9f6e38fad6b1e082b8184010cb06259b49e1266ca01/greenlet-3.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0a53fb071531d003b075c444014ff8f8b1a9898d36bb88abd9ac7b3524648a2", size = 238892, upload-time = "2026-04-08T17:03:10.094Z" }, @@ -1923,9 +1919,7 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/7a/75/7e9cd1126a1e1f0cd67b0eda02e5221b28488d352684704a78ed505bd719/greenlet-3.4.0-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:43748988b097f9c6f09364f260741aa73c80747f63389824435c7a50bfdfd5c1", size = 285856, upload-time = "2026-04-08T15:52:45.82Z" }, { url = "https://files.pythonhosted.org/packages/9d/c4/3e2df392e5cb199527c4d9dbcaa75c14edcc394b45040f0189f649631e3c/greenlet-3.4.0-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5566e4e2cd7a880e8c27618e3eab20f3494452d12fd5129edef7b2f7aa9a36d1", size = 610208, upload-time = "2026-04-08T16:24:39.674Z" }, { url = "https://files.pythonhosted.org/packages/da/af/750cdfda1d1bd30a6c28080245be8d0346e669a98fdbae7f4102aa95fff3/greenlet-3.4.0-cp313-cp313-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1054c5a3c78e2ab599d452f23f7adafef55062a783a8e241d24f3b633ba6ff82", size = 621269, upload-time = "2026-04-08T16:30:59.767Z" }, - { url = "https://files.pythonhosted.org/packages/e0/93/c8c508d68ba93232784bbc1b5474d92371f2897dfc6bc281b419f2e0d492/greenlet-3.4.0-cp313-cp313-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:98eedd1803353daf1cd9ef23eef23eda5a4d22f99b1f998d273a8b78b70dd47f", size = 628455, upload-time = "2026-04-08T16:40:40.698Z" }, { url = "https://files.pythonhosted.org/packages/54/78/0cbc693622cd54ebe25207efbb3a0eb07c2639cb8594f6e3aaaa0bb077a8/greenlet-3.4.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f82cb6cddc27dd81c96b1506f4aa7def15070c3b2a67d4e46fd19016aacce6cf", size = 617549, upload-time = "2026-04-08T15:56:34.893Z" }, - { url = "https://files.pythonhosted.org/packages/7f/46/cfaaa0ade435a60550fd83d07dfd5c41f873a01da17ede5c4cade0b9bab8/greenlet-3.4.0-cp313-cp313-manylinux_2_39_riscv64.whl", hash = "sha256:b7857e2202aae67bc5725e0c1f6403c20a8ff46094ece015e7d474f5f7020b55", size = 426238, upload-time = "2026-04-08T16:43:06.865Z" }, { url = "https://files.pythonhosted.org/packages/ba/c0/8966767de01343c1ff47e8b855dc78e7d1a8ed2b7b9c83576a57e289f81d/greenlet-3.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:227a46251ecba4ff46ae742bc5ce95c91d5aceb4b02f885487aff269c127a729", size = 1575310, upload-time = "2026-04-08T16:26:21.671Z" }, { url = "https://files.pythonhosted.org/packages/b8/38/bcdc71ba05e9a5fda87f63ffc2abcd1f15693b659346df994a48c968003d/greenlet-3.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:5b99e87be7eba788dd5b75ba1cde5639edffdec5f91fe0d734a249535ec3408c", size = 1640435, upload-time = "2026-04-08T15:57:32.572Z" }, { url = "https://files.pythonhosted.org/packages/a1/c2/19b664b7173b9e4ef5f77e8cef9f14c20ec7fce7920dc1ccd7afd955d093/greenlet-3.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:849f8bc17acd6295fcb5de8e46d55cc0e52381c56eaf50a2afd258e97bc65940", size = 238760, upload-time = "2026-04-08T17:04:03.878Z" }, @@ -1933,9 +1927,7 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/78/02/bde66806e8f169cf90b14d02c500c44cdbe02c8e224c9c67bafd1b8cadd1/greenlet-3.4.0-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:10a07aca6babdd18c16a3f4f8880acfffc2b88dfe431ad6aa5f5740759d7d75e", size = 286291, upload-time = "2026-04-08T17:09:34.307Z" }, { url = "https://files.pythonhosted.org/packages/05/1f/39da1c336a87d47c58352fb8a78541ce63d63ae57c5b9dae1fe02801bbc2/greenlet-3.4.0-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:076e21040b3a917d3ce4ad68fb5c3c6b32f1405616c4a57aa83120979649bd3d", size = 656749, upload-time = "2026-04-08T16:24:41.721Z" }, { url = "https://files.pythonhosted.org/packages/d3/6c/90ee29a4ee27af7aa2e2ec408799eeb69ee3fcc5abcecac6ddd07a5cd0f2/greenlet-3.4.0-cp314-cp314-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e82689eea4a237e530bb5cb41b180ef81fa2160e1f89422a67be7d90da67f615", size = 669084, upload-time = "2026-04-08T16:31:01.372Z" }, - { url = "https://files.pythonhosted.org/packages/d2/4a/74078d3936712cff6d3c91a930016f476ce4198d84e224fe6d81d3e02880/greenlet-3.4.0-cp314-cp314-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:06c2d3b89e0c62ba50bd7adf491b14f39da9e7e701647cb7b9ff4c99bee04b19", size = 673405, upload-time = "2026-04-08T16:40:42.527Z" }, { url = "https://files.pythonhosted.org/packages/07/49/d4cad6e5381a50947bb973d2f6cf6592621451b09368b8c20d9b8af49c5b/greenlet-3.4.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4df3b0b2289ec686d3c821a5fee44259c05cfe824dd5e6e12c8e5f5df23085cf", size = 665621, upload-time = "2026-04-08T15:56:35.995Z" }, - { url = "https://files.pythonhosted.org/packages/79/3e/df8a83ab894751bc31e1106fdfaa80ca9753222f106b04de93faaa55feb7/greenlet-3.4.0-cp314-cp314-manylinux_2_39_riscv64.whl", hash = "sha256:070b8bac2ff3b4d9e0ff36a0d19e42103331d9737e8504747cd1e659f76297bd", size = 471670, upload-time = "2026-04-08T16:43:08.512Z" }, { url = "https://files.pythonhosted.org/packages/37/31/d1edd54f424761b5d47718822f506b435b6aab2f3f93b465441143ea5119/greenlet-3.4.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:8bff29d586ea415688f4cec96a591fcc3bf762d046a796cdadc1fdb6e7f2d5bf", size = 1622259, upload-time = "2026-04-08T16:26:23.201Z" }, { url = "https://files.pythonhosted.org/packages/b0/c6/6d3f9cdcb21c4e12a79cb332579f1c6aa1af78eb68059c5a957c7812d95e/greenlet-3.4.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:8a569c2fb840c53c13a2b8967c63621fafbd1a0e015b9c82f408c33d626a2fda", size = 1686916, upload-time = "2026-04-08T15:57:34.282Z" }, { url = "https://files.pythonhosted.org/packages/63/45/c1ca4a1ad975de4727e52d3ffe641ae23e1d7a8ffaa8ff7a0477e1827b92/greenlet-3.4.0-cp314-cp314-win_amd64.whl", hash = "sha256:207ba5b97ea8b0b60eb43ffcacf26969dd83726095161d676aac03ff913ee50d", size = 239821, upload-time = "2026-04-08T17:03:48.423Z" }, @@ -1943,9 +1935,7 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d4/8f/18d72b629783f5e8d045a76f5325c1e938e659a9e4da79c7dcd10169a48d/greenlet-3.4.0-cp314-cp314t-macosx_11_0_universal2.whl", hash = "sha256:d70012e51df2dbbccfaf63a40aaf9b40c8bed37c3e3a38751c926301ce538ece", size = 294681, upload-time = "2026-04-08T15:52:35.778Z" }, { url = "https://files.pythonhosted.org/packages/9e/ad/5fa86ec46769c4153820d58a04062285b3b9e10ba3d461ee257b68dcbf53/greenlet-3.4.0-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a58bec0751f43068cd40cff31bb3ca02ad6000b3a51ca81367af4eb5abc480c8", size = 658899, upload-time = "2026-04-08T16:24:43.32Z" }, { url = "https://files.pythonhosted.org/packages/43/f0/4e8174ca0e87ae748c409f055a1ba161038c43cc0a5a6f1433a26ac2e5bf/greenlet-3.4.0-cp314-cp314t-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:05fa0803561028f4b2e3b490ee41216a842eaee11aed004cc343a996d9523aa2", size = 665284, upload-time = "2026-04-08T16:31:02.833Z" }, - { url = "https://files.pythonhosted.org/packages/ef/92/466b0d9afd44b8af623139a3599d651c7564fa4152f25f117e1ee5949ffb/greenlet-3.4.0-cp314-cp314t-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c4cd56a9eb7a6444edbc19062f7b6fbc8f287c663b946e3171d899693b1c19fa", size = 665872, upload-time = "2026-04-08T16:40:43.912Z" }, { url = "https://files.pythonhosted.org/packages/19/da/991cf7cd33662e2df92a1274b7eb4d61769294d38a1bba8a45f31364845e/greenlet-3.4.0-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e60d38719cb80b3ab5e85f9f1aed4960acfde09868af6762ccb27b260d68f4ed", size = 661861, upload-time = "2026-04-08T15:56:37.269Z" }, - { url = "https://files.pythonhosted.org/packages/0d/14/3395a7ef3e260de0325152ddfe19dffb3e49fe10873b94654352b53ad48e/greenlet-3.4.0-cp314-cp314t-manylinux_2_39_riscv64.whl", hash = "sha256:1f85f204c4d54134ae850d401fa435c89cd667d5ce9dc567571776b45941af72", size = 489237, upload-time = "2026-04-08T16:43:09.993Z" }, { url = "https://files.pythonhosted.org/packages/36/c5/6c2c708e14db3d9caea4b459d8464f58c32047451142fe2cfd90e7458f41/greenlet-3.4.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:7f50c804733b43eded05ae694691c9aa68bca7d0a867d67d4a3f514742a2d53f", size = 1622182, upload-time = "2026-04-08T16:26:24.777Z" }, { url = "https://files.pythonhosted.org/packages/7a/4c/50c5fed19378e11a29fabab1f6be39ea95358f4a0a07e115a51ca93385d8/greenlet-3.4.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:2d4f0635dc4aa638cda4b2f5a07ae9a2cff9280327b581a3fcb6f317b4fbc38a", size = 1685050, upload-time = "2026-04-08T15:57:36.453Z" }, { url = "https://files.pythonhosted.org/packages/db/72/85ae954d734703ab48e622c59d4ce35d77ce840c265814af9c078cacc7aa/greenlet-3.4.0-cp314-cp314t-win_amd64.whl", hash = "sha256:1a4a48f24681300c640f143ba7c404270e1ebbbcf34331d7104a4ff40f8ea705", size = 245554, upload-time = "2026-04-08T17:03:50.044Z" }, @@ -4437,7 +4427,7 @@ docs = [ [package.metadata] requires-dist = [ { name = "accelerate", marker = "extra == 'moondream'", specifier = "~=1.10.0" }, - { name = "aic-sdk", marker = "extra == 'aic'", specifier = "~=2.1.0" }, + { name = "aic-sdk", marker = "extra == 'aic'", specifier = "~=2.2.0" }, { name = "aioboto3", marker = "extra == 'aws'", specifier = ">=15.5.0,<16" }, { name = "aiofiles", specifier = ">=24.1.0,<27" }, { name = "aiohttp", specifier = ">=3.11.12,<4" }, From a2fbed86cfc99bfccf6d7a4500d23a00bec8d69f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6kmen=20G=C3=B6rgen?= Date: Fri, 24 Apr 2026 09:07:31 +0200 Subject: [PATCH 2/6] add adaptive audio enhancement example and support for runtime enhancement level updates in `AICFilter`. --- examples/mcp/mcp-aic-adaptive.py | 212 ++++++++++++++++++++++++ src/pipecat/audio/filters/aic_filter.py | 21 ++- 2 files changed, 231 insertions(+), 2 deletions(-) create mode 100644 examples/mcp/mcp-aic-adaptive.py diff --git a/examples/mcp/mcp-aic-adaptive.py b/examples/mcp/mcp-aic-adaptive.py new file mode 100644 index 000000000..2625fca1f --- /dev/null +++ b/examples/mcp/mcp-aic-adaptive.py @@ -0,0 +1,212 @@ +# +# Copyright (c) 2024-2026, Daily +# +# SPDX-License-Identifier: BSD 2-Clause License +# + +"""Voice assistant with LLM-controlled audio enhancement. + +Demonstrates how an LLM can dynamically adjust ai-coustics audio enhancement +in response to user feedback during a call. The LLM receives a +`set_audio_enhancement_level` tool and uses it whenever the user reports audio +quality issues. The tool pushes a `FilterUpdateSettingsFrame` into the pipeline, +which the transport's input stage forwards to the `AICFilter` instance. + +Required env vars: + AICOUSTICS_LICENSE_KEY – ai-coustics SDK license key + ANTHROPIC_API_KEY – Anthropic API key + DEEPGRAM_API_KEY – Deepgram STT key + CARTESIA_API_KEY – Cartesia TTS key + +Optional env vars: + AICOUSTICS_MODEL_ID – Enhancement model ID (default: quail-vf-2.1-l-16khz) +""" + +import os + +from dotenv import load_dotenv +from loguru import logger + +from pipecat.adapters.schemas.function_schema import FunctionSchema +from pipecat.adapters.schemas.tools_schema import ToolsSchema +from pipecat.audio.filters.aic_filter import AICFilter +from pipecat.frames.frames import FilterUpdateSettingsFrame, LLMRunFrame +from pipecat.pipeline.pipeline import Pipeline +from pipecat.pipeline.runner import PipelineRunner +from pipecat.pipeline.task import PipelineParams, PipelineTask +from pipecat.processors.aggregators.llm_context import LLMContext +from pipecat.processors.aggregators.llm_response_universal import ( + LLMContextAggregatorPair, + LLMUserAggregatorParams, +) +from pipecat.runner.types import RunnerArguments +from pipecat.runner.utils import create_transport +from pipecat.services.anthropic.llm import AnthropicLLMService +from pipecat.services.cartesia.tts import CartesiaTTSService +from pipecat.services.deepgram.stt import DeepgramSTTService +from pipecat.services.llm_service import FunctionCallParams +from pipecat.transports.base_transport import BaseTransport, TransportParams +from pipecat.transports.daily.transport import DailyParams +from pipecat.transports.websocket.fastapi import FastAPIWebsocketParams + +load_dotenv(override=True) + +_DEFAULT_ENHANCEMENT_LEVEL = 0.5 +_MODEL_ID = os.getenv("AICOUSTICS_MODEL_ID", "quail-vf-2.1-l-16khz") + +aic_filter = AICFilter( + license_key=os.getenv("AICOUSTICS_LICENSE_KEY", ""), + model_id=_MODEL_ID, + enhancement_level=_DEFAULT_ENHANCEMENT_LEVEL, +) +aic_vad = aic_filter.create_vad_analyzer(speech_hold_duration=0.05, sensitivity=6.0) + +# We use lambdas to defer transport parameter creation until the transport +# type is selected at runtime. +transport_params = { + "daily": lambda: DailyParams( + audio_in_enabled=True, + audio_out_enabled=True, + audio_in_filter=aic_filter, + ), + "twilio": lambda: FastAPIWebsocketParams( + audio_in_enabled=True, + audio_out_enabled=True, + audio_in_filter=aic_filter, + ), + "webrtc": lambda: TransportParams( + audio_in_enabled=True, + audio_out_enabled=True, + audio_in_filter=aic_filter, + ), +} + +_set_enhancement_schema = FunctionSchema( + name="set_audio_enhancement_level", + description=( + "Adjust the ai-coustics audio enhancement strength for the caller's microphone. " + "Use this when the user reports audio quality issues such as background noise, " + "echo, or difficulty being heard. Higher values apply stronger enhancement." + ), + properties={ + "level": { + "type": "number", + "description": "Enhancement strength between 0.0 (off) and 1.0 (maximum).", + }, + "reason": { + "type": "string", + "description": "Brief reason for the change, for logging purposes.", + }, + }, + required=["level"], +) + +_SYSTEM_PROMPT = f"""\ +You are a helpful voice assistant. + +You have a `set_audio_enhancement_level` tool that controls the ai-coustics audio \ +enhancement applied to the caller's microphone input. The current level is \ +{_DEFAULT_ENHANCEMENT_LEVEL}. + +Use the tool proactively when: +- The user says they can't be heard, the audio is noisy, or asks you to improve the sound quality. +- You detect repeated misunderstandings that may be caused by poor audio. +- The user asks to "boost", "improve", "fix", or "turn up" audio quality. + +After adjusting, briefly confirm the change in one sentence. + +Your output will be spoken aloud. Avoid bullet points, emojis, or markdown formatting. +""" + + +async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): + logger.info("Starting bot") + + stt = DeepgramSTTService(api_key=os.environ["DEEPGRAM_API_KEY"]) + + tts = CartesiaTTSService( + api_key=os.environ["CARTESIA_API_KEY"], + settings=CartesiaTTSService.Settings( + voice="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady + ), + ) + + llm = AnthropicLLMService( + api_key=os.environ["ANTHROPIC_API_KEY"], + settings=AnthropicLLMService.Settings( + system_instruction=_SYSTEM_PROMPT, + ), + ) + + # task is defined below; capture it via a mutable cell so the handler closure can + # reference it before the variable is assigned. + task_ref: list[PipelineTask] = [] + + async def set_audio_enhancement_level(params: FunctionCallParams): + level = float(params.arguments["level"]) + reason = params.arguments.get("reason", "") + if task_ref: + await task_ref[0].queue_frames( + [FilterUpdateSettingsFrame(settings={"enhancement_level": level})] + ) + logger.info(f"Audio enhancement → {level}" + (f" ({reason})" if reason else "")) + await params.result_callback(f"Audio enhancement level set to {level}.") + + llm.register_function("set_audio_enhancement_level", set_audio_enhancement_level) + + tools = ToolsSchema(standard_tools=[_set_enhancement_schema]) + context = LLMContext(tools=tools) + user_aggregator, assistant_aggregator = LLMContextAggregatorPair( + context, + user_params=LLMUserAggregatorParams(vad_analyzer=aic_vad), + ) + + pipeline = Pipeline( + [ + transport.input(), + stt, + user_aggregator, + llm, + tts, + transport.output(), + assistant_aggregator, + ] + ) + + task = PipelineTask( + pipeline, + params=PipelineParams( + enable_metrics=True, + enable_usage_metrics=True, + ), + idle_timeout_secs=runner_args.pipeline_idle_timeout_secs, + ) + task_ref.append(task) + + @transport.event_handler("on_client_connected") + async def on_client_connected(transport, client): + logger.info("Client connected") + context.add_message( + {"role": "developer", "content": "Please introduce yourself to the user."} + ) + await task.queue_frames([LLMRunFrame()]) + + @transport.event_handler("on_client_disconnected") + async def on_client_disconnected(transport, client): + logger.info("Client disconnected") + await task.cancel() + + runner = PipelineRunner(handle_sigint=runner_args.handle_sigint) + await runner.run(task) + + +async def bot(runner_args: RunnerArguments): + """Main bot entry point compatible with Pipecat Cloud.""" + transport = await create_transport(runner_args, transport_params) + await run_bot(transport, runner_args) + + +if __name__ == "__main__": + from pipecat.runner.run import main + + main() diff --git a/src/pipecat/audio/filters/aic_filter.py b/src/pipecat/audio/filters/aic_filter.py index 1bdf723ae..af6b8648c 100644 --- a/src/pipecat/audio/filters/aic_filter.py +++ b/src/pipecat/audio/filters/aic_filter.py @@ -32,7 +32,7 @@ from loguru import logger from pipecat.audio.filters.base_audio_filter import BaseAudioFilter from pipecat.audio.vad.aic_vad import AICVADAnalyzer -from pipecat.frames.frames import FilterControlFrame, FilterEnableFrame +from pipecat.frames.frames import FilterControlFrame, FilterEnableFrame, FilterUpdateSettingsFrame class AICModelManager: @@ -446,7 +446,13 @@ class AICFilter(BaseAudioFilter): self._model_cache_key = None async def process_frame(self, frame: FilterControlFrame): - """Process control frames to enable/disable filtering. + """Process control frames to enable/disable filtering or update settings. + + Handles ``FilterEnableFrame`` (bypass toggle) and ``FilterUpdateSettingsFrame`` + with the following keys: + + - ``enhancement_level`` (float, 0.0–1.0): Adjust enhancement strength at runtime. + - ``bypass`` (bool): Enable or disable the filter at runtime. Args: frame: The control frame containing filter commands. @@ -462,6 +468,17 @@ class AICFilter(BaseAudioFilter): self._apply_enhancement_level() except Exception as e: # noqa: BLE001 logger.error(f"AIC set_parameter failed: {e}") + elif isinstance(frame, FilterUpdateSettingsFrame): + if "enhancement_level" in frame.settings: + val = float(frame.settings["enhancement_level"]) + if 0.0 <= val <= 1.0: + self._enhancement_level = val + self._apply_enhancement_level() + else: + logger.warning(f"AIC enhancement_level {val} out of range [0.0, 1.0]; ignored.") + if "bypass" in frame.settings: + self._bypass = bool(frame.settings["bypass"]) + self._apply_bypass() async def filter(self, audio: bytes) -> bytes: """Apply AIC enhancement to audio data. From ea12b107422e866e451230ffbbaf1b0272938be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6kmen=20G=C3=B6rgen?= Date: Fri, 24 Apr 2026 09:19:59 +0200 Subject: [PATCH 3/6] rename `mcp-aic-adaptive.py` to `mcp-aicoustics-adaptive.py`. --- examples/mcp/{mcp-aic-adaptive.py => mcp-aicoustics-adaptive.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/mcp/{mcp-aic-adaptive.py => mcp-aicoustics-adaptive.py} (100%) diff --git a/examples/mcp/mcp-aic-adaptive.py b/examples/mcp/mcp-aicoustics-adaptive.py similarity index 100% rename from examples/mcp/mcp-aic-adaptive.py rename to examples/mcp/mcp-aicoustics-adaptive.py From 3b2127f91242b245029c3eabe47f873ab39c2114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6kmen=20G=C3=B6rgen?= Date: Sat, 25 Apr 2026 09:49:03 +0200 Subject: [PATCH 4/6] rename environment variables and references from `AICOUSTICS` to `AIC`. --- env.example | 2 +- examples/mcp/mcp-aicoustics-adaptive.py | 8 ++++---- examples/voice/voice-aicoustics.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/env.example b/env.example index 8fd258331..d449db6b2 100644 --- a/env.example +++ b/env.example @@ -1,5 +1,5 @@ # AI-COUSTICS -AICOUSTICS_LICENSE_KEY=... +AIC_LICENSE_KEY=... # Anthropic ANTHROPIC_API_KEY=... diff --git a/examples/mcp/mcp-aicoustics-adaptive.py b/examples/mcp/mcp-aicoustics-adaptive.py index 2625fca1f..433fc2663 100644 --- a/examples/mcp/mcp-aicoustics-adaptive.py +++ b/examples/mcp/mcp-aicoustics-adaptive.py @@ -13,13 +13,13 @@ quality issues. The tool pushes a `FilterUpdateSettingsFrame` into the pipeline, which the transport's input stage forwards to the `AICFilter` instance. Required env vars: - AICOUSTICS_LICENSE_KEY – ai-coustics SDK license key + AIC_LICENSE_KEY – ai-coustics SDK license key ANTHROPIC_API_KEY – Anthropic API key DEEPGRAM_API_KEY – Deepgram STT key CARTESIA_API_KEY – Cartesia TTS key Optional env vars: - AICOUSTICS_MODEL_ID – Enhancement model ID (default: quail-vf-2.1-l-16khz) + AIC_MODEL_ID – Enhancement model ID (default: quail-vf-2.1-l-16khz) """ import os @@ -52,10 +52,10 @@ from pipecat.transports.websocket.fastapi import FastAPIWebsocketParams load_dotenv(override=True) _DEFAULT_ENHANCEMENT_LEVEL = 0.5 -_MODEL_ID = os.getenv("AICOUSTICS_MODEL_ID", "quail-vf-2.1-l-16khz") +_MODEL_ID = os.getenv("AIC_MODEL_ID", "quail-vf-2.1-l-16khz") aic_filter = AICFilter( - license_key=os.getenv("AICOUSTICS_LICENSE_KEY", ""), + license_key=os.getenv("AIC_LICENSE_KEY", ""), model_id=_MODEL_ID, enhancement_level=_DEFAULT_ENHANCEMENT_LEVEL, ) diff --git a/examples/voice/voice-aicoustics.py b/examples/voice/voice-aicoustics.py index cb1e8e55c..386f80cbd 100644 --- a/examples/voice/voice-aicoustics.py +++ b/examples/voice/voice-aicoustics.py @@ -36,7 +36,7 @@ load_dotenv(override=True) def _create_aic_filter() -> AICFilter: - license_key = os.getenv("AICOUSTICS_LICENSE_KEY", "") + license_key = os.getenv("AIC_LICENSE_KEY", "") return AICFilter( license_key=license_key, From 3bbfc4285450581a1494b21f0ff299c304ade29e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6kmen=20G=C3=B6rgen?= Date: Sat, 25 Apr 2026 10:05:47 +0200 Subject: [PATCH 5/6] remove adaptive audio enhancement example and support for runtime enhancement level updates in `AICFilter`. --- examples/mcp/mcp-aicoustics-adaptive.py | 212 ------------------------ src/pipecat/audio/filters/aic_filter.py | 21 +-- 2 files changed, 2 insertions(+), 231 deletions(-) delete mode 100644 examples/mcp/mcp-aicoustics-adaptive.py diff --git a/examples/mcp/mcp-aicoustics-adaptive.py b/examples/mcp/mcp-aicoustics-adaptive.py deleted file mode 100644 index 433fc2663..000000000 --- a/examples/mcp/mcp-aicoustics-adaptive.py +++ /dev/null @@ -1,212 +0,0 @@ -# -# Copyright (c) 2024-2026, Daily -# -# SPDX-License-Identifier: BSD 2-Clause License -# - -"""Voice assistant with LLM-controlled audio enhancement. - -Demonstrates how an LLM can dynamically adjust ai-coustics audio enhancement -in response to user feedback during a call. The LLM receives a -`set_audio_enhancement_level` tool and uses it whenever the user reports audio -quality issues. The tool pushes a `FilterUpdateSettingsFrame` into the pipeline, -which the transport's input stage forwards to the `AICFilter` instance. - -Required env vars: - AIC_LICENSE_KEY – ai-coustics SDK license key - ANTHROPIC_API_KEY – Anthropic API key - DEEPGRAM_API_KEY – Deepgram STT key - CARTESIA_API_KEY – Cartesia TTS key - -Optional env vars: - AIC_MODEL_ID – Enhancement model ID (default: quail-vf-2.1-l-16khz) -""" - -import os - -from dotenv import load_dotenv -from loguru import logger - -from pipecat.adapters.schemas.function_schema import FunctionSchema -from pipecat.adapters.schemas.tools_schema import ToolsSchema -from pipecat.audio.filters.aic_filter import AICFilter -from pipecat.frames.frames import FilterUpdateSettingsFrame, LLMRunFrame -from pipecat.pipeline.pipeline import Pipeline -from pipecat.pipeline.runner import PipelineRunner -from pipecat.pipeline.task import PipelineParams, PipelineTask -from pipecat.processors.aggregators.llm_context import LLMContext -from pipecat.processors.aggregators.llm_response_universal import ( - LLMContextAggregatorPair, - LLMUserAggregatorParams, -) -from pipecat.runner.types import RunnerArguments -from pipecat.runner.utils import create_transport -from pipecat.services.anthropic.llm import AnthropicLLMService -from pipecat.services.cartesia.tts import CartesiaTTSService -from pipecat.services.deepgram.stt import DeepgramSTTService -from pipecat.services.llm_service import FunctionCallParams -from pipecat.transports.base_transport import BaseTransport, TransportParams -from pipecat.transports.daily.transport import DailyParams -from pipecat.transports.websocket.fastapi import FastAPIWebsocketParams - -load_dotenv(override=True) - -_DEFAULT_ENHANCEMENT_LEVEL = 0.5 -_MODEL_ID = os.getenv("AIC_MODEL_ID", "quail-vf-2.1-l-16khz") - -aic_filter = AICFilter( - license_key=os.getenv("AIC_LICENSE_KEY", ""), - model_id=_MODEL_ID, - enhancement_level=_DEFAULT_ENHANCEMENT_LEVEL, -) -aic_vad = aic_filter.create_vad_analyzer(speech_hold_duration=0.05, sensitivity=6.0) - -# We use lambdas to defer transport parameter creation until the transport -# type is selected at runtime. -transport_params = { - "daily": lambda: DailyParams( - audio_in_enabled=True, - audio_out_enabled=True, - audio_in_filter=aic_filter, - ), - "twilio": lambda: FastAPIWebsocketParams( - audio_in_enabled=True, - audio_out_enabled=True, - audio_in_filter=aic_filter, - ), - "webrtc": lambda: TransportParams( - audio_in_enabled=True, - audio_out_enabled=True, - audio_in_filter=aic_filter, - ), -} - -_set_enhancement_schema = FunctionSchema( - name="set_audio_enhancement_level", - description=( - "Adjust the ai-coustics audio enhancement strength for the caller's microphone. " - "Use this when the user reports audio quality issues such as background noise, " - "echo, or difficulty being heard. Higher values apply stronger enhancement." - ), - properties={ - "level": { - "type": "number", - "description": "Enhancement strength between 0.0 (off) and 1.0 (maximum).", - }, - "reason": { - "type": "string", - "description": "Brief reason for the change, for logging purposes.", - }, - }, - required=["level"], -) - -_SYSTEM_PROMPT = f"""\ -You are a helpful voice assistant. - -You have a `set_audio_enhancement_level` tool that controls the ai-coustics audio \ -enhancement applied to the caller's microphone input. The current level is \ -{_DEFAULT_ENHANCEMENT_LEVEL}. - -Use the tool proactively when: -- The user says they can't be heard, the audio is noisy, or asks you to improve the sound quality. -- You detect repeated misunderstandings that may be caused by poor audio. -- The user asks to "boost", "improve", "fix", or "turn up" audio quality. - -After adjusting, briefly confirm the change in one sentence. - -Your output will be spoken aloud. Avoid bullet points, emojis, or markdown formatting. -""" - - -async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): - logger.info("Starting bot") - - stt = DeepgramSTTService(api_key=os.environ["DEEPGRAM_API_KEY"]) - - tts = CartesiaTTSService( - api_key=os.environ["CARTESIA_API_KEY"], - settings=CartesiaTTSService.Settings( - voice="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady - ), - ) - - llm = AnthropicLLMService( - api_key=os.environ["ANTHROPIC_API_KEY"], - settings=AnthropicLLMService.Settings( - system_instruction=_SYSTEM_PROMPT, - ), - ) - - # task is defined below; capture it via a mutable cell so the handler closure can - # reference it before the variable is assigned. - task_ref: list[PipelineTask] = [] - - async def set_audio_enhancement_level(params: FunctionCallParams): - level = float(params.arguments["level"]) - reason = params.arguments.get("reason", "") - if task_ref: - await task_ref[0].queue_frames( - [FilterUpdateSettingsFrame(settings={"enhancement_level": level})] - ) - logger.info(f"Audio enhancement → {level}" + (f" ({reason})" if reason else "")) - await params.result_callback(f"Audio enhancement level set to {level}.") - - llm.register_function("set_audio_enhancement_level", set_audio_enhancement_level) - - tools = ToolsSchema(standard_tools=[_set_enhancement_schema]) - context = LLMContext(tools=tools) - user_aggregator, assistant_aggregator = LLMContextAggregatorPair( - context, - user_params=LLMUserAggregatorParams(vad_analyzer=aic_vad), - ) - - pipeline = Pipeline( - [ - transport.input(), - stt, - user_aggregator, - llm, - tts, - transport.output(), - assistant_aggregator, - ] - ) - - task = PipelineTask( - pipeline, - params=PipelineParams( - enable_metrics=True, - enable_usage_metrics=True, - ), - idle_timeout_secs=runner_args.pipeline_idle_timeout_secs, - ) - task_ref.append(task) - - @transport.event_handler("on_client_connected") - async def on_client_connected(transport, client): - logger.info("Client connected") - context.add_message( - {"role": "developer", "content": "Please introduce yourself to the user."} - ) - await task.queue_frames([LLMRunFrame()]) - - @transport.event_handler("on_client_disconnected") - async def on_client_disconnected(transport, client): - logger.info("Client disconnected") - await task.cancel() - - runner = PipelineRunner(handle_sigint=runner_args.handle_sigint) - await runner.run(task) - - -async def bot(runner_args: RunnerArguments): - """Main bot entry point compatible with Pipecat Cloud.""" - transport = await create_transport(runner_args, transport_params) - await run_bot(transport, runner_args) - - -if __name__ == "__main__": - from pipecat.runner.run import main - - main() diff --git a/src/pipecat/audio/filters/aic_filter.py b/src/pipecat/audio/filters/aic_filter.py index af6b8648c..1bdf723ae 100644 --- a/src/pipecat/audio/filters/aic_filter.py +++ b/src/pipecat/audio/filters/aic_filter.py @@ -32,7 +32,7 @@ from loguru import logger from pipecat.audio.filters.base_audio_filter import BaseAudioFilter from pipecat.audio.vad.aic_vad import AICVADAnalyzer -from pipecat.frames.frames import FilterControlFrame, FilterEnableFrame, FilterUpdateSettingsFrame +from pipecat.frames.frames import FilterControlFrame, FilterEnableFrame class AICModelManager: @@ -446,13 +446,7 @@ class AICFilter(BaseAudioFilter): self._model_cache_key = None async def process_frame(self, frame: FilterControlFrame): - """Process control frames to enable/disable filtering or update settings. - - Handles ``FilterEnableFrame`` (bypass toggle) and ``FilterUpdateSettingsFrame`` - with the following keys: - - - ``enhancement_level`` (float, 0.0–1.0): Adjust enhancement strength at runtime. - - ``bypass`` (bool): Enable or disable the filter at runtime. + """Process control frames to enable/disable filtering. Args: frame: The control frame containing filter commands. @@ -468,17 +462,6 @@ class AICFilter(BaseAudioFilter): self._apply_enhancement_level() except Exception as e: # noqa: BLE001 logger.error(f"AIC set_parameter failed: {e}") - elif isinstance(frame, FilterUpdateSettingsFrame): - if "enhancement_level" in frame.settings: - val = float(frame.settings["enhancement_level"]) - if 0.0 <= val <= 1.0: - self._enhancement_level = val - self._apply_enhancement_level() - else: - logger.warning(f"AIC enhancement_level {val} out of range [0.0, 1.0]; ignored.") - if "bypass" in frame.settings: - self._bypass = bool(frame.settings["bypass"]) - self._apply_bypass() async def filter(self, audio: bytes) -> bytes: """Apply AIC enhancement to audio data. From e25dccfc6b2ea96871d5003bf4e2d2584e6b42e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6kmen=20G=C3=B6rgen?= Date: Sat, 25 Apr 2026 10:13:06 +0200 Subject: [PATCH 6/6] update `aic-sdk` to `~=2.2.0` and rename `AICOUSTICS_LICENSE_KEY` to `AIC_LICENSE_KEY`. --- changelog/4362.changed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/4362.changed.md diff --git a/changelog/4362.changed.md b/changelog/4362.changed.md new file mode 100644 index 000000000..a34761e47 --- /dev/null +++ b/changelog/4362.changed.md @@ -0,0 +1 @@ +- Updated `aic-sdk` dependency to `~=2.2.0`. The `AIC_LICENSE_KEY` environment variable replaces the previous `AICOUSTICS_LICENSE_KEY`.