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: 2 additions & 2 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"skip_validation": true
}
},
"originGitCommit": "14c0ca94fcd0279d99570389d7b688dc3a18ea41",
"originGitCommit": "ff8fd2b74fdd5c081e9f111d59d3619f7e286dd8",
"originGitCommitIsDirty": true,
"invokedBy": "manual",
"sdkVersion": "7.5.0"
"sdkVersion": "7.5.1"
}
12 changes: 12 additions & 0 deletions .fernignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py
# resurrecting the invalid values. Frozen so Fern won't delete it again.
src/deepgram/listen/v2/types/listen_v2close_stream_type.py

# Backward-compat shim for the `stt_latency` removal from AgentV1LatencyReport (the
# 2026-07-20 regen; API change in deepgram-docs #1006). LatencyReport is a
# server-emitted (read-only) message, so re-adding the optional `stt_latency` field
# has no request/wire impact — it keeps `report.stt_latency` resolving (to None, since
# the server no longer emits it) instead of raising AttributeError, so the removal
# stays a minor release rather than a major break. Remove the field and unfreeze when
# it is intentionally retired in a future major release.
src/deepgram/agent/v1/types/agent_v1latency_report.py
src/deepgram/agent/v1/requests/agent_v1latency_report.py

# Package __init__.py files that carry hand-applied legacy alias re-exports for the
# above shims. Fern would otherwise regenerate these and strip the legacy entries on
# every regen. Frozen to preserve the public-import surface for renamed types/params.
Expand Down Expand Up @@ -139,6 +149,8 @@ tests/custom/test_compat_aliases.py
tests/custom/test_eot_thresholds_feature.py
tests/custom/test_language_hint_compat.py
tests/custom/test_language_hints_feature.py
tests/custom/test_latency_report_stt_compat.py
tests/custom/test_listen_v2_connect_wire.py
tests/custom/test_listen_v2_regen_constraints.py
tests/custom/test_query_encoder.py
tests/custom/test_secure_logging.py
Expand Down
5 changes: 4 additions & 1 deletion examples/14-transcription-live-websocket-v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
try:
with client.listen.v2.connect(
model="flux-general-en",
# Flux STT numerals: format spoken numbers as digits (e.g. "one twenty" -> "120").
# Connection-time only — it cannot be toggled mid-stream via Configure.
numerals="true",
) as connection:

def on_message(message: ListenV2SocketClientResponse) -> None:
Expand All @@ -46,7 +49,7 @@ def on_message(message: ListenV2SocketClientResponse) -> None:
print(f" event: {message.get('event', '')}")
print(f" turn_index: {message.get('turn_index', '')}")
elif isinstance(message, ListenV2TurnInfo):
print(f"Received TurnInfo event")
print("Received TurnInfo event")
print(f" transcript: {message.transcript}")
print(f" event: {message.event}")
print(f" turn_index: {message.turn_index}")
Expand Down
436 changes: 218 additions & 218 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dynamic = ["version"]

[tool.poetry]
name = "deepgram-sdk"
version = "7.5.0"
version = "7.5.1"
description = ""
readme = "README.md"
authors = []
Expand Down
24 changes: 24 additions & 0 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -5465,6 +5465,30 @@ asyncio.run(main())
<dl>
<dd>

**language_hint:** `typing.Optional[str]` — Language hint(s) to constrain and prioritize language detection (flux-general-multi)

</dd>
</dl>

<dl>
<dd>

**profanity_filter:** `typing.Optional[str]` — Remove profanity from transcripts

</dd>
</dl>

<dl>
<dd>

**numerals:** `typing.Optional[str]` — Convert numbers from written format to numerical format

</dd>
</dl>

<dl>
<dd>

**mip_opt_out:** `typing.Optional[str]` — Opts out requests from the Deepgram Model Improvement Program

</dd>
Expand Down
3 changes: 3 additions & 0 deletions src/deepgram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
ListenV2LanguageHint,
ListenV2MipOptOut,
ListenV2Model,
ListenV2Numerals,
ListenV2ProfanityFilter,
ListenV2SampleRate,
ListenV2Tag,
Expand Down Expand Up @@ -710,6 +711,7 @@
"ListenV2LanguageHintParams": ".requests",
"ListenV2MipOptOut": ".types",
"ListenV2Model": ".types",
"ListenV2Numerals": ".types",
"ListenV2ProfanityFilter": ".types",
"ListenV2SampleRate": ".types",
"ListenV2Tag": ".types",
Expand Down Expand Up @@ -1163,6 +1165,7 @@ def __dir__():
"ListenV2LanguageHintParams",
"ListenV2MipOptOut",
"ListenV2Model",
"ListenV2Numerals",
"ListenV2ProfanityFilter",
"ListenV2SampleRate",
"ListenV2Tag",
Expand Down
6 changes: 5 additions & 1 deletion src/deepgram/agent/v1/requests/agent_v1latency_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ class AgentV1LatencyReportParams(typing_extensions.TypedDict):
Message type identifier for the latency report
"""

# Backward-compat: mirrors the read-side shim in types/agent_v1latency_report.py.
# The API spec removed `stt_latency` (deepgram-docs #1006); kept here so the
# public request TypedDict shape is unchanged. No wire impact — the client never
# sends a LatencyReport. Remove and unfreeze in a future major.
stt_latency: typing_extensions.NotRequired[float]
"""
Speech-to-text: time from audio received to transcript produced, in seconds
Deprecated. Speech-to-text latency, no longer reported by the server.
"""

ttt_token_latency: typing_extensions.NotRequired[float]
Expand Down
8 changes: 7 additions & 1 deletion src/deepgram/agent/v1/types/agent_v1latency_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ class AgentV1LatencyReport(UncheckedBaseModel):
Message type identifier for the latency report
"""

# Backward-compat: the API spec removed `stt_latency` from the LatencyReport
# schema (deepgram-docs #1006). LatencyReport is a server-emitted (read-only)
# message, so re-adding the field has no request/wire impact — it simply keeps
# `report.stt_latency` resolving (to None, since the server no longer emits it)
# instead of raising AttributeError, avoiding a major-version break. Remove this
# shim and unfreeze when the field is intentionally retired in a future major.
stt_latency: typing.Optional[float] = pydantic.Field(default=None)
"""
Speech-to-text: time from audio received to transcript produced, in seconds
Deprecated. Speech-to-text latency, no longer reported by the server.
"""

ttt_token_latency: typing.Optional[float] = pydantic.Field(default=None)
Expand Down
4 changes: 2 additions & 2 deletions src/deepgram/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ def get_headers(self) -> typing.Dict[str, str]:
import platform

headers: typing.Dict[str, str] = {
"User-Agent": "deepgram-sdk/7.5.0", # x-release-please-version
"User-Agent": "deepgram-sdk/7.5.1", # x-release-please-version
"X-Fern-Language": "Python",
"X-Fern-Runtime": f"python/{platform.python_version()}",
"X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}",
"X-Fern-SDK-Name": "deepgram-sdk",
"X-Fern-SDK-Version": "7.5.0", # x-release-please-version
"X-Fern-SDK-Version": "7.5.1", # x-release-please-version
**(self.get_custom_headers() or {}),
}
headers["Authorization"] = f"Token {self.api_key}"
Expand Down
9 changes: 9 additions & 0 deletions src/deepgram/listen/v2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from ...types.listen_v2eot_timeout_ms import ListenV2EotTimeoutMs
from ...types.listen_v2mip_opt_out import ListenV2MipOptOut
from ...types.listen_v2model import ListenV2Model
from ...types.listen_v2numerals import ListenV2Numerals
from ...types.listen_v2profanity_filter import ListenV2ProfanityFilter
from ...types.listen_v2sample_rate import ListenV2SampleRate
from ...types.listen_v2tag import ListenV2Tag
Expand Down Expand Up @@ -61,6 +62,7 @@ def connect(
keyterm: typing.Optional[ListenV2KeytermParams] = None,
language_hint: typing.Optional[ListenV2LanguageHintParams] = None,
profanity_filter: typing.Optional[ListenV2ProfanityFilter] = None,
numerals: typing.Optional[ListenV2Numerals] = None,
mip_opt_out: typing.Optional[ListenV2MipOptOut] = None,
tag: typing.Optional[ListenV2Tag] = None,
authorization: typing.Optional[str] = None,
Expand Down Expand Up @@ -90,6 +92,8 @@ def connect(

profanity_filter : typing.Optional[ListenV2ProfanityFilter]

numerals : typing.Optional[ListenV2Numerals]

mip_opt_out : typing.Optional[ListenV2MipOptOut]

tag : typing.Optional[ListenV2Tag]
Expand Down Expand Up @@ -132,6 +136,7 @@ def connect(
direction="write",
),
"profanity_filter": profanity_filter,
"numerals": numerals,
"mip_opt_out": mip_opt_out,
"tag": tag,
**(
Expand Down Expand Up @@ -196,6 +201,7 @@ async def connect(
keyterm: typing.Optional[ListenV2KeytermParams] = None,
language_hint: typing.Optional[ListenV2LanguageHintParams] = None,
profanity_filter: typing.Optional[ListenV2ProfanityFilter] = None,
numerals: typing.Optional[ListenV2Numerals] = None,
mip_opt_out: typing.Optional[ListenV2MipOptOut] = None,
tag: typing.Optional[ListenV2Tag] = None,
authorization: typing.Optional[str] = None,
Expand Down Expand Up @@ -225,6 +231,8 @@ async def connect(

profanity_filter : typing.Optional[ListenV2ProfanityFilter]

numerals : typing.Optional[ListenV2Numerals]

mip_opt_out : typing.Optional[ListenV2MipOptOut]

tag : typing.Optional[ListenV2Tag]
Expand Down Expand Up @@ -267,6 +275,7 @@ async def connect(
direction="write",
),
"profanity_filter": profanity_filter,
"numerals": numerals,
"mip_opt_out": mip_opt_out,
"tag": tag,
**(
Expand Down
9 changes: 9 additions & 0 deletions src/deepgram/listen/v2/raw_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from ...types.listen_v2eot_timeout_ms import ListenV2EotTimeoutMs
from ...types.listen_v2mip_opt_out import ListenV2MipOptOut
from ...types.listen_v2model import ListenV2Model
from ...types.listen_v2numerals import ListenV2Numerals
from ...types.listen_v2profanity_filter import ListenV2ProfanityFilter
from ...types.listen_v2sample_rate import ListenV2SampleRate
from ...types.listen_v2tag import ListenV2Tag
Expand Down Expand Up @@ -49,6 +50,7 @@ def connect(
keyterm: typing.Optional[ListenV2KeytermParams] = None,
language_hint: typing.Optional[ListenV2LanguageHintParams] = None,
profanity_filter: typing.Optional[ListenV2ProfanityFilter] = None,
numerals: typing.Optional[ListenV2Numerals] = None,
mip_opt_out: typing.Optional[ListenV2MipOptOut] = None,
tag: typing.Optional[ListenV2Tag] = None,
authorization: typing.Optional[str] = None,
Expand Down Expand Up @@ -78,6 +80,8 @@ def connect(

profanity_filter : typing.Optional[ListenV2ProfanityFilter]

numerals : typing.Optional[ListenV2Numerals]

mip_opt_out : typing.Optional[ListenV2MipOptOut]

tag : typing.Optional[ListenV2Tag]
Expand Down Expand Up @@ -120,6 +124,7 @@ def connect(
direction="write",
),
"profanity_filter": profanity_filter,
"numerals": numerals,
"mip_opt_out": mip_opt_out,
"tag": tag,
**(
Expand Down Expand Up @@ -173,6 +178,7 @@ async def connect(
keyterm: typing.Optional[ListenV2KeytermParams] = None,
language_hint: typing.Optional[ListenV2LanguageHintParams] = None,
profanity_filter: typing.Optional[ListenV2ProfanityFilter] = None,
numerals: typing.Optional[ListenV2Numerals] = None,
mip_opt_out: typing.Optional[ListenV2MipOptOut] = None,
tag: typing.Optional[ListenV2Tag] = None,
authorization: typing.Optional[str] = None,
Expand Down Expand Up @@ -202,6 +208,8 @@ async def connect(

profanity_filter : typing.Optional[ListenV2ProfanityFilter]

numerals : typing.Optional[ListenV2Numerals]

mip_opt_out : typing.Optional[ListenV2MipOptOut]

tag : typing.Optional[ListenV2Tag]
Expand Down Expand Up @@ -244,6 +252,7 @@ async def connect(
direction="write",
),
"profanity_filter": profanity_filter,
"numerals": numerals,
"mip_opt_out": mip_opt_out,
"tag": tag,
**(
Expand Down
64 changes: 52 additions & 12 deletions src/deepgram/speak/v1/audio/types/audio_generate_request_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

AudioGenerateRequestModel = typing.Union[
typing.Literal[
"aura-angus-en",
"aura-arcas-en",
"aura-asteria-en",
"aura-luna-en",
"aura-stella-en",
"aura-athena-en",
"aura-helios-en",
"aura-hera-en",
"aura-luna-en",
"aura-orion-en",
"aura-arcas-en",
"aura-perseus-en",
"aura-angus-en",
"aura-orpheus-en",
"aura-helios-en",
"aura-perseus-en",
"aura-stella-en",
"aura-zeus-en",
"aura-2-amalthea-en",
"aura-2-andromeda-en",
Expand All @@ -26,8 +26,8 @@
"aura-2-atlas-en",
"aura-2-aurora-en",
"aura-2-callista-en",
"aura-2-cordelia-en",
"aura-2-cora-en",
"aura-2-cordelia-en",
"aura-2-delia-en",
"aura-2-draco-en",
"aura-2-electra-en",
Expand Down Expand Up @@ -57,16 +57,56 @@
"aura-2-theia-en",
"aura-2-vesta-en",
"aura-2-zeus-en",
"aura-2-sirio-es",
"aura-2-nestor-es",
"aura-2-agustina-es",
"aura-2-alvaro-es",
"aura-2-antonia-es",
"aura-2-aquila-es",
"aura-2-carina-es",
"aura-2-celeste-es",
"aura-2-alvaro-es",
"aura-2-diana-es",
"aura-2-aquila-es",
"aura-2-selena-es",
"aura-2-estrella-es",
"aura-2-gloria-es",
"aura-2-javier-es",
"aura-2-luciano-es",
"aura-2-nestor-es",
"aura-2-olivia-es",
"aura-2-selena-es",
"aura-2-silvia-es",
"aura-2-sirio-es",
"aura-2-valerio-es",
"aura-2-aurelia-de",
"aura-2-elara-de",
"aura-2-fabian-de",
"aura-2-julius-de",
"aura-2-kara-de",
"aura-2-lara-de",
"aura-2-viktoria-de",
"aura-2-beatrix-nl",
"aura-2-cornelia-nl",
"aura-2-daphne-nl",
"aura-2-hestia-nl",
"aura-2-lars-nl",
"aura-2-leda-nl",
"aura-2-rhea-nl",
"aura-2-roman-nl",
"aura-2-sander-nl",
"aura-2-agathe-fr",
"aura-2-hector-fr",
"aura-2-cesare-it",
"aura-2-cinzia-it",
"aura-2-demetra-it",
"aura-2-dionisio-it",
"aura-2-elio-it",
"aura-2-flavio-it",
"aura-2-livia-it",
"aura-2-maia-it",
"aura-2-melia-it",
"aura-2-perseo-it",
"aura-2-ama-ja",
"aura-2-ebisu-ja",
"aura-2-fujin-ja",
"aura-2-izanami-ja",
"aura-2-uzume-ja",
],
typing.Any,
]
4 changes: 2 additions & 2 deletions src/deepgram/speak/v2/audio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def generate(
Parameters
----------
model : str
Flux TTS model used to synthesize the submitted text, in the form `flux-{voice}-{language}` (for example, `flux-alexis-en`). Required; unlike the v1 (Aura) endpoint there is no default and only flux models are accepted. English-only at launch. The voice catalog is not yet finalized, so this is typed as a free-form string rather than a closed enum; it can be locked to an enum (matching STT Flux `ListenV2Model`) once the GA catalog is confirmed.
Flux TTS model used to synthesize the submitted text, in the form `flux-{voice}-{language}` (for example, `flux-alexis-en`). Required; unlike the v1 (Aura) endpoint there is no default and only flux models are accepted. English-only at launch.

text : str
The text content to be converted to speech. The server normalizes and preprocesses the text (e.g. stripping inline controls) before synthesis.
Expand Down Expand Up @@ -156,7 +156,7 @@ async def generate(
Parameters
----------
model : str
Flux TTS model used to synthesize the submitted text, in the form `flux-{voice}-{language}` (for example, `flux-alexis-en`). Required; unlike the v1 (Aura) endpoint there is no default and only flux models are accepted. English-only at launch. The voice catalog is not yet finalized, so this is typed as a free-form string rather than a closed enum; it can be locked to an enum (matching STT Flux `ListenV2Model`) once the GA catalog is confirmed.
Flux TTS model used to synthesize the submitted text, in the form `flux-{voice}-{language}` (for example, `flux-alexis-en`). Required; unlike the v1 (Aura) endpoint there is no default and only flux models are accepted. English-only at launch.

text : str
The text content to be converted to speech. The server normalizes and preprocesses the text (e.g. stripping inline controls) before synthesis.
Expand Down
Loading
Loading