feat: (regen) diarization v2 batch GA, listen-provider dedup, think/models route fix#714
Merged
Conversation
Reconciles the .bak files (pre-regen manual patches) against Fern's
freshly generated output. All 20 temporarily-frozen patches still
needed; none became obsolete.
Re-applied:
- socket clients (agent/v1, listen/v1, listen/v2, speak/v1): broad
Exception catch, optional control-message defaults; agent also gets
_sanitize_numeric_types; listen/v2 also gets send_configure raw shim
+ typing.Any response
- agent_v1settings types/requests: callable AgentV1SettingsAgent
wrapper, broadened agent union, legacy messages= validator + read-
side property, legacy TypedDict shape
- agent_v1settings_audio_output: container typed as Optional[str]
- core/query_encoder: bool -> lowercase coercion before urlencode
- tests/wire/test_manage_v1_projects_keys: CreateKeyV1RequestOneParams
alias coverage
- 7 package __init__.py files: legacy alias re-exports for
CreateKeyV1RequestOne[Params], AgentV1HistoryContent[Params],
AgentV1HistoryFunctionCalls[Params], and
AgentV1SettingsAgentContextMessagesItem*[Params]
New listen-provider compat aliases (spec dedup on 2026-05-14):
The spec consolidated AgentV1SettingsAgent[Context]ListenProviderV{1,2,
V2LanguageHint} into top-level DeepgramListenProvider* types. To keep
the old public import paths working through this minor version, this
adds 10 hand-written alias files (5 types + 5 requests) that re-export
from the new DeepgramListenProvider* names, plus regression coverage
in tests/custom/test_compat_aliases.py.
.fernignore is restored to the pre-prepare state (.bak paths swapped
back to originals) and extended with the 10 new alias entries.
AGENTS.md documents the new permanently frozen entries. All .bak files
are deleted.
Verification: ruff src clean, mypy clean (801 files), pytest 199 passed.
Reverts Fern's pyproject.toml bump (7.1.1 -> 7.1.2) and the matching User-Agent / X-Fern-SDK-Version bumps in client_wrapper.py. Both files are listed in .github/release-please-config.json's extra-files, so they're release-please's responsibility, not Fern's. Letting Fern bump them here just creates phantom intermediate versions that release-please overwrites on the next release. Note: client_wrapper.py on main is at "7.0.1" (stale; release-please's generic extra-file matcher isn't catching this file). This PR resets it to "7.1.1" to match the manifest and the actual released version.
lukeocodes
approved these changes
May 15, 2026
GregHolmes
pushed a commit
that referenced
this pull request
May 19, 2026
🤖 I have created a release *beep* *boop* ## 7.2.0 — what's in this release This release bundles two Fern SDK regenerations (2026-05-14 and 2026-05-15) plus the manual patches re-applied on top of each. See the full changelog: [`v7.1.1...v7.2.0`](v7.1.1...v7.2.0). ### Features **Diarization v2 batch GA — #714** - Listen-provider rename: spec deduplicated 5 PascalCase types into 3 canonical top-level names [`DeepgramListenProviderV1`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/types/deepgram_listen_provider_v1.py), [`DeepgramListenProviderV2`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/types/deepgram_listen_provider_v2.py), [`DeepgramListenProviderV2LanguageHint`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/types/deepgram_listen_provider_v2language_hint.py) (plus matching TypedDicts under [`src/deepgram/requests/`](https://github.com/deepgram/deepgram-python-sdk/tree/main/src/deepgram/requests)). - 10 hand-written compat alias files preserve the old names — re-exports under [`src/deepgram/agent/v1/types/`](https://github.com/deepgram/deepgram-python-sdk/tree/main/src/deepgram/agent/v1/types) and [`src/deepgram/agent/v1/requests/`](https://github.com/deepgram/deepgram-python-sdk/tree/main/src/deepgram/agent/v1/requests) for both [`AgentV1SettingsAgentContextListenProvider{V1,V2,V2LanguageHint}`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py) and [`AgentV1SettingsAgentListenProvider{V1,V2}`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py), so the rename is fully backward-compatible. All 10 added to `.fernignore` as permanently frozen; regression coverage in [`tests/custom/test_compat_aliases.py`](https://github.com/deepgram/deepgram-python-sdk/blob/main/tests/custom/test_compat_aliases.py). ### Bug fixes **think/models routed to `agent_rest` — #715** - [`agent/v1/settings/think/models/raw_client.py`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/agent/v1/settings/think/models/raw_client.py) now resolves the base URL via `environment.agent_rest`. - [`DeepgramClientEnvironment`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/environment.py) reshape supports this: [`DeepgramClientEnvironment.AGENT`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/environment.py) was dropped and a new `agent_rest` kwarg was added to [`DeepgramClientEnvironment.__init__`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/environment.py). This is corrective rather than breaking — the old `.AGENT` env routed REST traffic to the wrong host, so [`agent.v1.settings.think.models.list()`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/agent/v1/settings/think/models/raw_client.py) and any other caller of that endpoint was already broken. Callers building a custom environment should pass the new `agent_rest=` slot. ### Patches preserved through regen Both regens re-applied 20 hand-maintained patches (still listed in `.fernignore`). No patches dropped this cycle. **Socket clients** — broad `except Exception` for custom transports, optional `message=` defaults on control sends: - [`agent/v1/socket_client.py`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/agent/v1/socket_client.py) — also restored `_sanitize_numeric_types` (float→int sanitizer). - [`listen/v1/socket_client.py`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/listen/v1/socket_client.py). - [`listen/v2/socket_client.py`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/listen/v2/socket_client.py) — also kept `send_configure` as a raw `typing.Any` shim and `typing.Any` in the response Union (generator now emits `ListenV2Configure`/`ListenV2ConfigureSuccess` but we don't yet have evidence the new typed models are wire-correct). - [`speak/v1/socket_client.py`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/speak/v1/socket_client.py). **Agent settings** — callable [`AgentV1SettingsAgent(...)`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/agent/v1/types/agent_v1settings.py) wrapper (generator now emits a `Union[AgentV1SettingsAgentContext, str]` alias, which would break callable usage), broadened [`AgentV1Settings.agent`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/agent/v1/types/agent_v1settings.py) union (accepts wrapper + context + agent-id string), legacy `messages=` validator + read-side property, legacy TypedDict shapes in [`agent/v1/requests/agent_v1settings.py`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/agent/v1/requests/agent_v1settings.py). [`agent_v1settings_audio_output.container`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/agent/v1/types/agent_v1settings_audio_output.py) kept as `Optional[str]` instead of the regenerated `AgentV1SettingsAudioOutputContainer` enum. **Misc** — [`core/query_encoder.py`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/core/query_encoder.py) bool → lowercase coercion before `urlencode`; wire test [`tests/wire/test_manage_v1_projects_keys.py`](https://github.com/deepgram/deepgram-python-sdk/blob/main/tests/wire/test_manage_v1_projects_keys.py) restored `CreateKeyV1RequestOneParams` alias coverage; 7 package `__init__.py` files restored compat re-exports for `CreateKeyV1RequestOne(+Params)`, `AgentV1HistoryContent(+Params)`, `AgentV1HistoryFunctionCalls(+Params)`, `AgentV1SettingsAgentContextMessagesItem*(+Params)`. ### Near miss (from #715) Initial review classified [`agent/v1/types/agent_v1settings.py`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/agent/v1/types/agent_v1settings.py) and [`agent/v1/requests/agent_v1settings.py`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/agent/v1/requests/agent_v1settings.py) as droppable (the new generator declares `agent: AgentV1SettingsAgent` and `AgentV1SettingsAgent` is now itself `Union[AgentV1SettingsAgentContext, str]`, structurally equivalent). Pytest caught the issue: because we patch `AgentV1SettingsAgent` back to a class for callable backward compat, the bare `agent: AgentV1SettingsAgent` field rejects string values. Both patches restored to broaden to `Union[AgentV1SettingsAgent, AgentV1SettingsAgentContext, str]`. [`tests/custom/test_compat_aliases.py`](https://github.com/deepgram/deepgram-python-sdk/blob/main/tests/custom/test_compat_aliases.py) covers this regression. ### Validation - `uv run pytest -q` — 199 passed / 4 skipped (aiohttp/client autodetect cases, not regen-related). - `uv run mypy src` — clean (801 files). - `uv run ruff check src` — clean (the 57 pre-existing errors live in `tests/manual/`, untouched by regen). ### Cross-SDK reference The `agent_rest` env fix has equivalents in deepgram/deepgram-js-sdk#499 and deepgram/deepgram-java-sdk#59. The JS SDK additionally needed a `src/Client.ts` patch because `client.fetch()` passthrough started defaulting to `agentRest` instead of `base`. Python has no equivalent passthrough in the hand-maintained [`client.py`](https://github.com/deepgram/deepgram-python-sdk/blob/main/src/deepgram/client.py), so no analogous patch was required here. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fern SDK regeneration on 2026-05-14, with manual patches re-applied.
What's in this PR
7b085e8,fern-api[bot]): new generated files from the spec at0052a02.pyproject.tomlbumped7.1.1→7.1.2. Fern generator unchanged (5.8.3).2179f61): 20 patched files, none became obsolete after this regen.DeepgramListenProvider*names. To preserve backward compat over a minor version bump, 10 hand-written alias files re-export from the new names.Patch categories re-applied
agent/v1,listen/v1,listen/v2,speak/v1): broadexcept Exception, optional control-message defaults,_sanitize_numeric_types(agent),send_configureraw shim +typing.Anyresponse (listen/v2).AgentV1SettingsAgent(...)wrapper, broadenedagentunion (accepts wrapper + context + agent-id string), legacymessages=validator + read-side property, legacy TypedDict shapes.agent_v1settings_audio_output.container: kept asOptional[str]instead of the enum alias.core/query_encoder: bool → lowercase coercion beforeurlencode.CreateKeyV1RequestOneParamsalias coverage.__init__.pyfiles: legacy alias re-exports forCreateKeyV1RequestOne[Params],AgentV1HistoryContent[Params],AgentV1HistoryFunctionCalls[Params], andAgentV1SettingsAgentContextMessagesItem*[Params].New compat aliases (listen-provider rename)
10 alias files added under
src/deepgram/agent/v1/{types,requests}/, each a one-linefrom ....{types,requests}.deepgram_listen_provider_* import DeepgramListenProvider*re-export. All 10 added to.fernignoreas permanently frozen.AGENTS.mdupdated. Regression tests intests/custom/test_compat_aliases.pyconfirm each alias resolves to the matchingDeepgramListenProvider*target.Test plan
.bakpatches diffed against new gen; categorized via subagent (all still needed)DeepgramListenProvider*exports kept__init__.pyfiles.fernignorereconciled (paths swapped back, 10 new entries added).bakfiles deletedruff check srccleanmypy srcclean (801 files)pytest .— 199 passed / 4 skipped (the skipped are aiohttp/client autodetect cases, not regen-related)