Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/rt/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions sdk/rt/speechmatics/rt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -49,6 +50,7 @@
"EventEmitter",
"JWTAuth",
"Microphone",
"Model",
"OperatingPoint",
"ServerMessageType",
"SessionError",
Expand Down
8 changes: 6 additions & 2 deletions sdk/rt/speechmatics/rt/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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
Expand Down
Loading