diff --git a/sdk/rt/pyproject.toml b/sdk/rt/pyproject.toml index ab70780..b2d84b1 100644 --- a/sdk/rt/pyproject.toml +++ b/sdk/rt/pyproject.toml @@ -10,7 +10,7 @@ readme = "README.md" authors = [{ name = "Speechmatics", email = "support@speechmatics.com" }] license = "MIT" requires-python = ">=3.9" -dependencies = ["websockets>=10.0"] +dependencies = ["websockets>=10.0", "typing-extensions>=4.5.0"] classifiers = [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", diff --git a/sdk/rt/speechmatics/rt/__init__.py b/sdk/rt/speechmatics/rt/__init__.py index 861257e..e8ca1e9 100644 --- a/sdk/rt/speechmatics/rt/__init__.py +++ b/sdk/rt/speechmatics/rt/__init__.py @@ -21,6 +21,7 @@ from ._models import ClientMessageType from ._models import ConnectionConfig from ._models import ConversationConfig +from ._models import Model from ._models import OperatingPoint from ._models import ServerMessageType from ._models import SessionInfo @@ -49,6 +50,7 @@ "EventEmitter", "JWTAuth", "Microphone", + "Model", "OperatingPoint", "ServerMessageType", "SessionError", diff --git a/sdk/rt/speechmatics/rt/_models.py b/sdk/rt/speechmatics/rt/_models.py index b0e9a8e..98bef5b 100644 --- a/sdk/rt/speechmatics/rt/_models.py +++ b/sdk/rt/speechmatics/rt/_models.py @@ -8,9 +8,10 @@ from typing import Any from typing import Optional from typing import cast -from warnings import deprecated from warnings import warn +from typing_extensions import deprecated + class AudioEncoding(str, Enum): """ @@ -468,7 +469,10 @@ def to_dict(self) -> dict[str, Any]: >>> # "max_delay": 5.0 >>> # } """ - return asdict(self, dict_factory=lambda x: {k: v for (k, v) in x if v is not None}) + result = asdict(self, dict_factory=lambda x: {k: v for (k, v) in x if v is not None}) + if self.model is _UNSET: + result.pop("model", None) + return result @dataclass