Skip to content

Commit ecbfe1a

Browse files
authored
Fix export new Model in rt sdk (#115)
1 parent d6e9298 commit ecbfe1a

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

sdk/rt/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ readme = "README.md"
1010
authors = [{ name = "Speechmatics", email = "support@speechmatics.com" }]
1111
license = "MIT"
1212
requires-python = ">=3.9"
13-
dependencies = ["websockets>=10.0"]
13+
dependencies = ["websockets>=10.0", "typing-extensions>=4.5.0"]
1414
classifiers = [
1515
"Development Status :: 4 - Beta",
1616
"Intended Audience :: Developers",

sdk/rt/speechmatics/rt/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from ._models import ClientMessageType
2222
from ._models import ConnectionConfig
2323
from ._models import ConversationConfig
24+
from ._models import Model
2425
from ._models import OperatingPoint
2526
from ._models import ServerMessageType
2627
from ._models import SessionInfo
@@ -49,6 +50,7 @@
4950
"EventEmitter",
5051
"JWTAuth",
5152
"Microphone",
53+
"Model",
5254
"OperatingPoint",
5355
"ServerMessageType",
5456
"SessionError",

sdk/rt/speechmatics/rt/_models.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
from typing import Any
99
from typing import Optional
1010
from typing import cast
11-
from warnings import deprecated
1211
from warnings import warn
1312

13+
from typing_extensions import deprecated
14+
1415

1516
class AudioEncoding(str, Enum):
1617
"""
@@ -468,7 +469,10 @@ def to_dict(self) -> dict[str, Any]:
468469
>>> # "max_delay": 5.0
469470
>>> # }
470471
"""
471-
return asdict(self, dict_factory=lambda x: {k: v for (k, v) in x if v is not None})
472+
result = asdict(self, dict_factory=lambda x: {k: v for (k, v) in x if v is not None})
473+
if self.model is _UNSET:
474+
result.pop("model", None)
475+
return result
472476

473477

474478
@dataclass

0 commit comments

Comments
 (0)