feat!: (regen) diarization v2 batch GA, listen-provider dedup, think/models route fix#57
Merged
Conversation
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* ## 0.5.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: [`v0.4.0...v0.5.0`](v0.4.0...v0.5.0). ### ⚠ Breaking changes **[`Environment`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/core/Environment.java) constructor signature changed (3-arg → 4-arg) — #57 + #59** - New `agentRest` field, [`getAgentRestURL()`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/core/Environment.java) getter, and [`Environment.Builder#agentRest(...)`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/core/Environment.java) builder method. - [`Environment.AGENT`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/core/Environment.java) was dropped in favor of the dedicated `agentRest` REST host. - This fixes a previously broken route: [`agent.v1.settings.think.models.list()`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/resources/agent/v1/settings/think/models/RawModelsClient.java) now correctly targets `env.agentRest` instead of [`getAgentURL()`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/core/Environment.java). Any caller of that endpoint was already broken before; this is a corrective break. - Callers building a custom [`Environment`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/core/Environment.java) must add the new `agentRest(...)` slot via [`Environment.custom()`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/core/Environment.java). **Listen-provider type refactor — #57** - `AgentV1SettingsAgentContextListenProvider{V1, V2, V2LanguageHint}` deleted in favor of canonical top-level types [`DeepgramListenProviderV1`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/types/DeepgramListenProviderV1.java), [`DeepgramListenProviderV2`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/types/DeepgramListenProviderV2.java), [`DeepgramListenProviderV2LanguageHint`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/types/DeepgramListenProviderV2LanguageHint.java). - `AgentV1SettingsAgentListenProvider{V1, V2}` subtypes also deleted (~958 lines removed across the two wrapper hierarchies, deduped against the canonical top-level types). The sealed-type wrappers [`AgentV1SettingsAgentContextListenProvider`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentContextListenProvider.java) and [`AgentV1SettingsAgentListenProvider`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentListenProvider.java) remain. ### Features **Diarization v2 batch GA — #57** - New listen/media request types: [`ListenV1RequestUrl`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/resources/listen/v1/media/requests/ListenV1RequestUrl.java), [`MediaTranscribeRequestOctetStream`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/resources/listen/v1/media/requests/MediaTranscribeRequestOctetStream.java), [`MediaTranscribeRequestDiarizeModel`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/resources/listen/v1/media/types/MediaTranscribeRequestDiarizeModel.java). - [`AsyncRawMediaClient`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/resources/listen/v1/media/AsyncRawMediaClient.java) / [`RawMediaClient`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/resources/listen/v1/media/RawMediaClient.java) updated to surface the new diarize-model and octet-stream request paths. ### Bug fixes **think/models routed to `agentRest` — #59** - [`RawModelsClient`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/resources/agent/v1/settings/think/models/RawModelsClient.java) and [`AsyncRawModelsClient`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/resources/agent/v1/settings/think/models/AsyncRawModelsClient.java) (under `agent/v1/settings/think/models/`) now resolve their base URL via [`environment().getAgentRestURL()`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/core/Environment.java) instead of [`getAgentURL()`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/core/Environment.java). (Same root cause as the breaking change above.) ### Patches preserved through regen Both regens re-applied the same hand-maintained patches (still listed in `.fernignore`): - [`ClientOptions`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/core/ClientOptions.java) — restored SDK identity headers (`User-Agent`, `X-Fern-SDK-Name`, `X-Fern-SDK-Version`) to the `com.deepgram:deepgram-java-sdk` values and re-added `// x-release-please-version` markers. Generator still overwrites these to the wrong artifact id (`com.deepgram:deepgram-sdk` / `com.deepgram.fern:api-sdk`) and strips the markers. - [`ReconnectingWebSocketListener`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/core/ReconnectingWebSocketListener.java) — re-applied the three fixes originally landed in #45: 1. `maxRetries(0)` semantics: `retryCount > maxRetries` (initial connect attempt always proceeds; the cap applies only to retries). 2. Configurable `connectionTimeoutMs` on [`ReconnectOptions`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/core/ReconnectingWebSocketListener.java) (nested in the same file; default 4000 ms, previously hardcoded). 3. [`applyOptionsOverride(...)`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/core/ReconnectingWebSocketListener.java) runtime hook used by [`TransportWebSocketFactory`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/core/transport/TransportWebSocketFactory.java) to apply per-transport reconnect policy from [`DeepgramTransportFactory`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/core/transport/DeepgramTransportFactory.java) without editing generated WS clients. 4. `volatile` qualifier on option-derived fields. No patches were dropped this cycle — the generator has not caught up on any of the above. ### Validation - `./gradlew test compileExamples` — BUILD SUCCESSFUL on both regen PRs. - [`ReconnectingWebSocketListenerTest`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/test/java/com/deepgram/core/ReconnectingWebSocketListenerTest.java) covers the re-applied WS patches. - [`EnvironmentTest`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/test/java/com/deepgram/core/EnvironmentTest.java) and [`ClientBuilderTest`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/test/java/com/deepgram/ClientBuilderTest.java) updated to build agent-shaped environments via [`Environment.custom().agentRest(...)`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/core/Environment.java). ### Cross-SDK reference The `agentRest` env fix has equivalents in deepgram/deepgram-python-sdk#715 and deepgram/deepgram-js-sdk#499. The JS SDK additionally needed a `client.fetch()` passthrough patch; Java has no equivalent passthrough in [`DeepgramClient`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/DeepgramClient.java) / [`DeepgramClientBuilder`](https://github.com/deepgram/deepgram-java-sdk/blob/main/src/main/java/com/deepgram/DeepgramClientBuilder.java), 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 for 2026-05-14.
Patches re-applied
ClientOptions.java— restored SDK identity headers (User-Agent,X-Fern-SDK-Name,X-Fern-SDK-Version) to thecom.deepgram:deepgram-java-sdkvalues and re-added// x-release-please-versionmarkers. Generator still overwrites these.ReconnectingWebSocketListener.java— re-applied the three fixes from fix(reconnect): listener bug fixes + transport factory policy hook #45:maxRetries(0)semantics:retryCount > maxRetries(initial attempt always proceeds; cap applies to retries only).connectionTimeoutMsonReconnectOptions(default 4000ms; was hardcoded).applyOptionsOverride(...)runtime hook used byTransportWebSocketFactoryto apply per-transport reconnect policy without editing generated WS clients.No patches were dropped — the generator has not caught up on any of the above. Both files remain in
.fernignoreat their original paths.Notable generator changes (non-patch)
AgentV1SettingsAgentContextListenProvider{V1,V2,V2LanguageHint}fromresources/agent/v1/types/→ top-leveltypes/DeepgramListenProvider*and deletedAgentV1SettingsAgentListenProvider{V1,V2}(~400 lines combined).ListenV1RequestUrl,MediaTranscribeRequestOctetStream,MediaTranscribeRequestDiarizeModel;AsyncRawMediaClient/RawMediaClientupdated.Environment.java,RawModelsClient.java,.fern/metadata.json.Test plan
./gradlew test compileExamplespasses (includes regression tests formaxRetries(0),applyOptionsOverride,connectionTimeoutMs).