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
4 changes: 3 additions & 1 deletion sdk/rt/speechmatics/rt/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class OperatingPoint(str, Enum):
ENHANCED = "enhanced"
STANDARD = "standard"
MELIA_1 = "melia-1"
OAK_1 = "oak-1"


class Model(str, Enum):
Expand All @@ -49,6 +50,7 @@ class Model(str, Enum):
ENHANCED = "enhanced"
STANDARD = "standard"
MELIA_1 = "melia-1"
OAK_1 = "oak-1"


@dataclass
Expand Down Expand Up @@ -399,7 +401,7 @@ class TranscriptionConfig:
Recognition is restricted to these languages, which improves accuracy on multilingual
audio. Typically used with ``language="multi"``. Hints take precedence over ``language``,
so the transcript may not contain the language named there.
Applicable only for the next-gen models (e.g. melia-1).
Applicable only for the next-gen models (e.g. melia-1, oak-1).
Defaults to None.
language_hints_strict: (Optional) Controls how strictly ``language_hints`` is applied, and is
only valid alongside it.
Expand Down
9 changes: 9 additions & 0 deletions tests/rt/test_models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
from speechmatics.rt._models import Model
from speechmatics.rt._models import TranscriptionConfig


class TestModelToDict:
def test_oak_model_gets_serialized(self):
config = TranscriptionConfig(model=Model.OAK_1)
result = config.to_dict()
assert result["model"] == Model.OAK_1
assert "operating_point" not in result


class TestLanguageHintsToDict:
def test_language_hints_serializes_correctly(self):
config = TranscriptionConfig(language_hints=["en", "fr"])
Expand Down
Loading