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 .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"skip_validation": true
}
},
"originGitCommit": "330b1dab41a5004329de2c1ea6396dc4b1ea930c",
"originGitCommit": "229defd4c32f220af07902c24efca5e94b4c47a4",
"originGitCommitIsDirty": true,
"invokedBy": "manual",
"sdkVersion": "7.18.0"
Expand Down
297 changes: 148 additions & 149 deletions poetry.lock

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions src/deepgram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
ListenV1ProfanityFilter,
ListenV1Punctuate,
ListenV1Redact,
ListenV1RedactUsage,
ListenV1Replace,
ListenV1RequestFile,
ListenV1Response,
Expand Down Expand Up @@ -169,6 +170,7 @@
ListenV1VadEvents,
ListenV1Version,
ListenV2ConfigureNumerals,
ListenV2ConfigureRedactUsage,
ListenV2EagerEotThreshold,
ListenV2Encoding,
ListenV2EotThreshold,
Expand All @@ -180,6 +182,7 @@
ListenV2Numerals,
ListenV2ProfanityFilter,
ListenV2Redact,
ListenV2RedactUsage,
ListenV2SampleRate,
ListenV2Tag,
OpenAiSpeakProvider,
Expand Down Expand Up @@ -231,6 +234,7 @@
SpeakV2Expressivity,
SpeakV2MipOptOut,
SpeakV2Model,
SpeakV2NormalizeVolume,
SpeakV2Response,
SpeakV2SampleRate,
SpeakV2Speed,
Expand Down Expand Up @@ -661,6 +665,7 @@
"ListenV1ProfanityFilter": ".types",
"ListenV1Punctuate": ".types",
"ListenV1Redact": ".types",
"ListenV1RedactUsage": ".types",
"ListenV1Replace": ".types",
"ListenV1RequestFile": ".types",
"ListenV1Response": ".types",
Expand Down Expand Up @@ -719,6 +724,7 @@
"ListenV1VadEvents": ".types",
"ListenV1Version": ".types",
"ListenV2ConfigureNumerals": ".types",
"ListenV2ConfigureRedactUsage": ".types",
"ListenV2EagerEotThreshold": ".types",
"ListenV2Encoding": ".types",
"ListenV2EotThreshold": ".types",
Expand All @@ -732,6 +738,7 @@
"ListenV2Numerals": ".types",
"ListenV2ProfanityFilter": ".types",
"ListenV2Redact": ".types",
"ListenV2RedactUsage": ".types",
"ListenV2SampleRate": ".types",
"ListenV2Tag": ".types",
"OpenAiSpeakProvider": ".types",
Expand Down Expand Up @@ -818,6 +825,7 @@
"SpeakV2Expressivity": ".types",
"SpeakV2MipOptOut": ".types",
"SpeakV2Model": ".types",
"SpeakV2NormalizeVolume": ".types",
"SpeakV2Response": ".types",
"SpeakV2SampleRate": ".types",
"SpeakV2Speed": ".types",
Expand Down Expand Up @@ -1156,6 +1164,7 @@ def __dir__():
"ListenV1ProfanityFilter",
"ListenV1Punctuate",
"ListenV1Redact",
"ListenV1RedactUsage",
"ListenV1Replace",
"ListenV1RequestFile",
"ListenV1Response",
Expand Down Expand Up @@ -1214,6 +1223,7 @@ def __dir__():
"ListenV1VadEvents",
"ListenV1Version",
"ListenV2ConfigureNumerals",
"ListenV2ConfigureRedactUsage",
"ListenV2EagerEotThreshold",
"ListenV2Encoding",
"ListenV2EotThreshold",
Expand All @@ -1227,6 +1237,7 @@ def __dir__():
"ListenV2Numerals",
"ListenV2ProfanityFilter",
"ListenV2Redact",
"ListenV2RedactUsage",
"ListenV2SampleRate",
"ListenV2Tag",
"OpenAiSpeakProvider",
Expand Down Expand Up @@ -1313,6 +1324,7 @@ def __dir__():
"SpeakV2Expressivity",
"SpeakV2MipOptOut",
"SpeakV2Model",
"SpeakV2NormalizeVolume",
"SpeakV2Response",
"SpeakV2SampleRate",
"SpeakV2Speed",
Expand Down
1 change: 1 addition & 0 deletions src/deepgram/agent/v1/socket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
except ImportError:
from websockets import WebSocketClientProtocol # type: ignore


def _sanitize_numeric_types(obj: typing.Any) -> typing.Any:
"""Convert whole-number floats to integers for wire-compatible JSON."""
if isinstance(obj, dict):
Expand Down
2 changes: 2 additions & 0 deletions src/deepgram/agent/v1/types/agent_v1settings_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

class AgentV1SettingsAgent(AgentV1SettingsAgentContext):
if IS_PYDANTIC_V2:

@pydantic.model_validator(mode="before")
@classmethod
def _migrate_legacy_nested_context(cls, values: typing.Any) -> typing.Any:
Expand All @@ -33,6 +34,7 @@ def _migrate_legacy_nested_context(cls, values: typing.Any) -> typing.Any:
values["listen"] = listen.dict()
return values
else:

@pydantic.root_validator(pre=True) # type: ignore[deprecated]
def _migrate_legacy_nested_context(cls, values: typing.Any) -> typing.Any: # type: ignore[no-redef]
if not isinstance(values, dict):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class AgentV1SettingsAgentContext(UncheckedBaseModel):
"""

if IS_PYDANTIC_V2:

@pydantic.model_validator(mode="before")
@classmethod
def _migrate_legacy_messages_to_context(cls, values: typing.Any) -> typing.Any:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class AgentV1SettingsAgentContextListenProvider_V2(UncheckedBaseModel):
keyterms: typing.Optional[typing.List[str]] = None

if IS_PYDANTIC_V2:

@pydantic.model_validator(mode="before")
@classmethod
def _migrate_language_hint(cls, values: typing.Any) -> typing.Any:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class AgentV1SettingsAgentListenProvider_V2(UncheckedBaseModel):
keyterms: typing.Optional[typing.List[str]] = None

if IS_PYDANTIC_V2:

@pydantic.model_validator(mode="before")
@classmethod
def _migrate_language_hint(cls, values: typing.Any) -> typing.Any:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class AgentV1UpdateListenListen(UncheckedBaseModel):
provider: AgentV1UpdateListenListenProvider

if IS_PYDANTIC_V2:

@pydantic.model_validator(mode="before")
@classmethod
def _migrate_legacy_provider(cls, values: typing.Any) -> typing.Any:
Expand Down
9 changes: 9 additions & 0 deletions src/deepgram/listen/v1/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from ...types.listen_v1profanity_filter import ListenV1ProfanityFilter
from ...types.listen_v1punctuate import ListenV1Punctuate
from ...types.listen_v1redact import ListenV1Redact
from ...types.listen_v1redact_usage import ListenV1RedactUsage
from ...types.listen_v1replace import ListenV1Replace
from ...types.listen_v1sample_rate import ListenV1SampleRate
from ...types.listen_v1search import ListenV1Search
Expand Down Expand Up @@ -100,6 +101,7 @@ def connect(
profanity_filter: typing.Optional[ListenV1ProfanityFilter] = None,
punctuate: typing.Optional[ListenV1Punctuate] = None,
redact: typing.Optional[ListenV1Redact] = None,
redact_usage: typing.Optional[ListenV1RedactUsage] = None,
replace: typing.Optional[ListenV1Replace] = None,
sample_rate: typing.Optional[ListenV1SampleRate] = None,
search: typing.Optional[ListenV1Search] = None,
Expand Down Expand Up @@ -163,6 +165,8 @@ def connect(

redact : typing.Optional[ListenV1Redact]

redact_usage : typing.Optional[ListenV1RedactUsage]

replace : typing.Optional[ListenV1Replace]

sample_rate : typing.Optional[ListenV1SampleRate]
Expand Down Expand Up @@ -224,6 +228,7 @@ def connect(
"profanity_filter": profanity_filter,
"punctuate": punctuate,
"redact": redact,
"redact_usage": redact_usage,
"replace": replace,
"sample_rate": sample_rate,
"search": search,
Expand Down Expand Up @@ -317,6 +322,7 @@ async def connect(
profanity_filter: typing.Optional[ListenV1ProfanityFilter] = None,
punctuate: typing.Optional[ListenV1Punctuate] = None,
redact: typing.Optional[ListenV1Redact] = None,
redact_usage: typing.Optional[ListenV1RedactUsage] = None,
replace: typing.Optional[ListenV1Replace] = None,
sample_rate: typing.Optional[ListenV1SampleRate] = None,
search: typing.Optional[ListenV1Search] = None,
Expand Down Expand Up @@ -380,6 +386,8 @@ async def connect(

redact : typing.Optional[ListenV1Redact]

redact_usage : typing.Optional[ListenV1RedactUsage]

replace : typing.Optional[ListenV1Replace]

sample_rate : typing.Optional[ListenV1SampleRate]
Expand Down Expand Up @@ -441,6 +449,7 @@ async def connect(
"profanity_filter": profanity_filter,
"punctuate": punctuate,
"redact": redact,
"redact_usage": redact_usage,
"replace": replace,
"sample_rate": sample_rate,
"search": search,
Expand Down
20 changes: 20 additions & 0 deletions src/deepgram/listen/v1/media/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def transcribe_url(
profanity_filter: typing.Optional[bool] = None,
punctuate: typing.Optional[bool] = None,
redact: typing.Optional[str] = None,
redact_usage: typing.Optional[bool] = None,
replace: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
search: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
smart_format: typing.Optional[bool] = None,
Expand Down Expand Up @@ -182,6 +183,9 @@ def transcribe_url(
redact : typing.Optional[str]
Redaction removes sensitive information from your transcripts

redact_usage : typing.Optional[bool]
Replaces the values of user-supplied text parameters (`keyterm`, `keywords`, `replace`, `search`, `extra`, `custom_topic`, and `custom_intent`) with `[REDACTED]` in this request's usage records. Does not affect transcription, the response, `tag`, or `callback`. Independent of `mip_opt_out`. https://developers.deepgram.com/docs/redact-usage

replace : typing.Optional[typing.Union[str, typing.Sequence[str]]]
Search for terms or phrases in submitted audio and replaces them

Expand Down Expand Up @@ -255,6 +259,7 @@ def transcribe_url(
profanity_filter=profanity_filter,
punctuate=punctuate,
redact=redact,
redact_usage=redact_usage,
replace=replace,
search=search,
smart_format=smart_format,
Expand Down Expand Up @@ -301,6 +306,7 @@ def transcribe_file(
profanity_filter: typing.Optional[bool] = None,
punctuate: typing.Optional[bool] = None,
redact: typing.Optional[str] = None,
redact_usage: typing.Optional[bool] = None,
replace: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
search: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
smart_format: typing.Optional[bool] = None,
Expand Down Expand Up @@ -414,6 +420,9 @@ def transcribe_file(
redact : typing.Optional[str]
Redaction removes sensitive information from your transcripts

redact_usage : typing.Optional[bool]
Replaces the values of user-supplied text parameters (`keyterm`, `keywords`, `replace`, `search`, `extra`, `custom_topic`, and `custom_intent`) with `[REDACTED]` in this request's usage records. Does not affect transcription, the response, `tag`, or `callback`. Independent of `mip_opt_out`. https://developers.deepgram.com/docs/redact-usage

replace : typing.Optional[typing.Union[str, typing.Sequence[str]]]
Search for terms or phrases in submitted audio and replaces them

Expand Down Expand Up @@ -485,6 +494,7 @@ def transcribe_file(
profanity_filter=profanity_filter,
punctuate=punctuate,
redact=redact,
redact_usage=redact_usage,
replace=replace,
search=search,
smart_format=smart_format,
Expand Down Expand Up @@ -547,6 +557,7 @@ async def transcribe_url(
profanity_filter: typing.Optional[bool] = None,
punctuate: typing.Optional[bool] = None,
redact: typing.Optional[str] = None,
redact_usage: typing.Optional[bool] = None,
replace: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
search: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
smart_format: typing.Optional[bool] = None,
Expand Down Expand Up @@ -660,6 +671,9 @@ async def transcribe_url(
redact : typing.Optional[str]
Redaction removes sensitive information from your transcripts

redact_usage : typing.Optional[bool]
Replaces the values of user-supplied text parameters (`keyterm`, `keywords`, `replace`, `search`, `extra`, `custom_topic`, and `custom_intent`) with `[REDACTED]` in this request's usage records. Does not affect transcription, the response, `tag`, or `callback`. Independent of `mip_opt_out`. https://developers.deepgram.com/docs/redact-usage

replace : typing.Optional[typing.Union[str, typing.Sequence[str]]]
Search for terms or phrases in submitted audio and replaces them

Expand Down Expand Up @@ -741,6 +755,7 @@ async def main() -> None:
profanity_filter=profanity_filter,
punctuate=punctuate,
redact=redact,
redact_usage=redact_usage,
replace=replace,
search=search,
smart_format=smart_format,
Expand Down Expand Up @@ -787,6 +802,7 @@ async def transcribe_file(
profanity_filter: typing.Optional[bool] = None,
punctuate: typing.Optional[bool] = None,
redact: typing.Optional[str] = None,
redact_usage: typing.Optional[bool] = None,
replace: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
search: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
smart_format: typing.Optional[bool] = None,
Expand Down Expand Up @@ -900,6 +916,9 @@ async def transcribe_file(
redact : typing.Optional[str]
Redaction removes sensitive information from your transcripts

redact_usage : typing.Optional[bool]
Replaces the values of user-supplied text parameters (`keyterm`, `keywords`, `replace`, `search`, `extra`, `custom_topic`, and `custom_intent`) with `[REDACTED]` in this request's usage records. Does not affect transcription, the response, `tag`, or `callback`. Independent of `mip_opt_out`. https://developers.deepgram.com/docs/redact-usage

replace : typing.Optional[typing.Union[str, typing.Sequence[str]]]
Search for terms or phrases in submitted audio and replaces them

Expand Down Expand Up @@ -979,6 +998,7 @@ async def main() -> None:
profanity_filter=profanity_filter,
punctuate=punctuate,
redact=redact,
redact_usage=redact_usage,
replace=replace,
search=search,
smart_format=smart_format,
Expand Down
Loading
Loading