From 0a92e6bfd42841b83115abc6df948a6cb17e6b92 Mon Sep 17 00:00:00 2001 From: zack Date: Tue, 1 Sep 2026 12:02:06 -0400 Subject: [PATCH] feat(streaming): add universal-3-6-pro speech model Adds `universal-3-6-pro` to the streaming `SpeechModel` enum so it can be selected via `StreamingParameters(speech_model=...)`. The model name is passed straight through to the `speech_model` query parameter, so no other changes are needed. Bumps the version to 1.1.0. Co-Authored-By: Claude Opus 5 (1M context) --- assemblyai/__version__.py | 2 +- assemblyai/streaming/v3/models.py | 1 + tests/unit/test_streaming.py | 29 +++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/assemblyai/__version__.py b/assemblyai/__version__.py index 5becc17c..6849410a 100644 --- a/assemblyai/__version__.py +++ b/assemblyai/__version__.py @@ -1 +1 @@ -__version__ = "1.0.0" +__version__ = "1.1.0" diff --git a/assemblyai/streaming/v3/models.py b/assemblyai/streaming/v3/models.py index c33ff00f..8ce3acd8 100644 --- a/assemblyai/streaming/v3/models.py +++ b/assemblyai/streaming/v3/models.py @@ -200,6 +200,7 @@ class SpeechModel(str, Enum): u3_rt_pro_beta_1 = "u3-rt-pro-beta-1" whisper_rt = "whisper-rt" universal_3_5_pro = "universal-3-5-pro" + universal_3_6_pro = "universal-3-6-pro" u3_pro = "u3-pro" # Deprecated: Use u3_rt_pro instead def __str__(self): diff --git a/tests/unit/test_streaming.py b/tests/unit/test_streaming.py index 9040cd63..431f7523 100644 --- a/tests/unit/test_streaming.py +++ b/tests/unit/test_streaming.py @@ -1086,6 +1086,35 @@ def mocked_websocket_connect( assert "speech_model=universal-3-5-pro" in actual_url +def test_client_connect_with_universal_3_6_pro(mocker: MockFixture): + actual_url = None + + def mocked_websocket_connect( + url: str, additional_headers: dict, open_timeout: float + ): + nonlocal actual_url + actual_url = url + + mocker.patch( + "assemblyai.streaming.v3.client.websocket_connect", + new=mocked_websocket_connect, + ) + + _disable_rw_threads(mocker) + + options = StreamingClientOptions(api_key="test", api_host="api.example.com") + client = StreamingClient(options) + + params = StreamingParameters( + sample_rate=16000, + speech_model=SpeechModel.universal_3_6_pro, + ) + + client.connect(params) + + assert "speech_model=universal-3-6-pro" in actual_url + + def test_turn_event_with_speaker_label(): data = { "type": "Turn",