Skip to content

Commit fccb3e3

Browse files
feat!: (regen) diarization v2 batch GA, listen-provider dedup, think/models route fix (#57)
## 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 the `com.deepgram:deepgram-java-sdk` values and re-added `// x-release-please-version` markers. Generator still overwrites these. - **`ReconnectingWebSocketListener.java`** — re-applied the three fixes from #45: 1. `maxRetries(0)` semantics: `retryCount > maxRetries` (initial attempt always proceeds; cap applies to retries only). 2. Configurable `connectionTimeoutMs` on `ReconnectOptions` (default 4000ms; was hardcoded). 3. `applyOptionsOverride(...)` runtime hook used by `TransportWebSocketFactory` to 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 `.fernignore` at their original paths. ### Notable generator changes (non-patch) - Listen provider type refactor — moved `AgentV1SettingsAgentContextListenProvider{V1,V2,V2LanguageHint}` from `resources/agent/v1/types/` → top-level `types/DeepgramListenProvider*` and deleted `AgentV1SettingsAgentListenProvider{V1,V2}` (~400 lines combined). - New listen/media types: `ListenV1RequestUrl`, `MediaTranscribeRequestOctetStream`, `MediaTranscribeRequestDiarizeModel`; `AsyncRawMediaClient`/`RawMediaClient` updated. - Small updates to `Environment.java`, `RawModelsClient.java`, `.fern/metadata.json`. ## Test plan - [x] `./gradlew test compileExamples` passes (includes regression tests for `maxRetries(0)`, `applyOptionsOverride`, `connectionTimeoutMs`). - [ ] Reviewer confirms listen-provider type rename does not break public API contract. --------- Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
1 parent de2dd4b commit fccb3e3

16 files changed

Lines changed: 370 additions & 489 deletions

.fern/metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
},
1212
"enable-wire-tests": true
1313
},
14-
"originGitCommit": "d1854cf6d560a0e27c9f46c1d83a6d7d9924f045",
14+
"originGitCommit": "0052a020a7becd03b349857664c9f4a89b6c449a",
1515
"originGitCommitIsDirty": true,
1616
"invokedBy": "manual",
17-
"sdkVersion": "0.4.0"
17+
"sdkVersion": "0.4.1"
1818
}

src/main/java/com/deepgram/core/Environment.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,63 +5,63 @@
55

66
public final class Environment {
77
public static final Environment PRODUCTION =
8-
new Environment("https://api.deepgram.com", "wss://agent.deepgram.com", "wss://api.deepgram.com");
8+
new Environment("https://api.deepgram.com", "wss://api.deepgram.com", "wss://agent.deepgram.com");
99

1010
public static final Environment AGENT =
11-
new Environment("https://agent.deepgram.com", "wss://agent.deepgram.com", "wss://api.deepgram.com");
11+
new Environment("https://agent.deepgram.com", "wss://api.deepgram.com", "wss://agent.deepgram.com");
1212

1313
private final String base;
1414

15-
private final String agent;
16-
1715
private final String production;
1816

19-
Environment(String base, String agent, String production) {
17+
private final String agent;
18+
19+
Environment(String base, String production, String agent) {
2020
this.base = base;
21-
this.agent = agent;
2221
this.production = production;
22+
this.agent = agent;
2323
}
2424

2525
public String getBaseURL() {
2626
return this.base;
2727
}
2828

29-
public String getAgentURL() {
30-
return this.agent;
31-
}
32-
3329
public String getProductionURL() {
3430
return this.production;
3531
}
3632

33+
public String getAgentURL() {
34+
return this.agent;
35+
}
36+
3737
public static Builder custom() {
3838
return new Builder();
3939
}
4040

4141
public static class Builder {
4242
private String base;
4343

44-
private String agent;
45-
4644
private String production;
4745

46+
private String agent;
47+
4848
public Builder base(String base) {
4949
this.base = base;
5050
return this;
5151
}
5252

53-
public Builder agent(String agent) {
54-
this.agent = agent;
53+
public Builder production(String production) {
54+
this.production = production;
5555
return this;
5656
}
5757

58-
public Builder production(String production) {
59-
this.production = production;
58+
public Builder agent(String agent) {
59+
this.agent = agent;
6060
return this;
6161
}
6262

6363
public Environment build() {
64-
return new Environment(base, agent, production);
64+
return new Environment(base, production, agent);
6565
}
6666
}
6767
}

src/main/java/com/deepgram/resources/agent/v1/settings/think/models/AsyncRawModelsClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public CompletableFuture<DeepgramApiHttpResponse<AgentThinkModelsV1Response>> li
4242
* Retrieves the available think models that can be used for AI agent processing
4343
*/
4444
public CompletableFuture<DeepgramApiHttpResponse<AgentThinkModelsV1Response>> list(RequestOptions requestOptions) {
45-
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getBaseURL())
45+
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getAgentURL())
4646
.newBuilder()
4747
.addPathSegments("v1/agent/settings/think/models");
4848
if (requestOptions != null) {

src/main/java/com/deepgram/resources/agent/v1/settings/think/models/RawModelsClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public DeepgramApiHttpResponse<AgentThinkModelsV1Response> list() {
3838
* Retrieves the available think models that can be used for AI agent processing
3939
*/
4040
public DeepgramApiHttpResponse<AgentThinkModelsV1Response> list(RequestOptions requestOptions) {
41-
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getBaseURL())
41+
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getAgentURL())
4242
.newBuilder()
4343
.addPathSegments("v1/agent/settings/think/models");
4444
if (requestOptions != null) {

src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentContextListenProvider.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
*/
44
package com.deepgram.resources.agent.v1.types;
55

6+
import com.deepgram.types.DeepgramListenProviderV1;
7+
import com.deepgram.types.DeepgramListenProviderV2;
68
import com.fasterxml.jackson.annotation.JsonCreator;
79
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
810
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -26,11 +28,11 @@ public <T> T visit(Visitor<T> visitor) {
2628
return value.visit(visitor);
2729
}
2830

29-
public static AgentV1SettingsAgentContextListenProvider v1(AgentV1SettingsAgentContextListenProviderV1 value) {
31+
public static AgentV1SettingsAgentContextListenProvider v1(DeepgramListenProviderV1 value) {
3032
return new AgentV1SettingsAgentContextListenProvider(new V1Value(value));
3133
}
3234

33-
public static AgentV1SettingsAgentContextListenProvider v2(AgentV1SettingsAgentContextListenProviderV2 value) {
35+
public static AgentV1SettingsAgentContextListenProvider v2(DeepgramListenProviderV2 value) {
3436
return new AgentV1SettingsAgentContextListenProvider(new V2Value(value));
3537
}
3638

@@ -46,14 +48,14 @@ public boolean _isUnknown() {
4648
return value instanceof _UnknownValue;
4749
}
4850

49-
public Optional<AgentV1SettingsAgentContextListenProviderV1> getV1() {
51+
public Optional<DeepgramListenProviderV1> getV1() {
5052
if (isV1()) {
5153
return Optional.of(((V1Value) value).value);
5254
}
5355
return Optional.empty();
5456
}
5557

56-
public Optional<AgentV1SettingsAgentContextListenProviderV2> getV2() {
58+
public Optional<DeepgramListenProviderV2> getV2() {
5759
if (isV2()) {
5860
return Optional.of(((V2Value) value).value);
5961
}
@@ -90,9 +92,9 @@ private Value getValue() {
9092
}
9193

9294
public interface Visitor<T> {
93-
T visitV1(AgentV1SettingsAgentContextListenProviderV1 v1);
95+
T visitV1(DeepgramListenProviderV1 v1);
9496

95-
T visitV2(AgentV1SettingsAgentContextListenProviderV2 v2);
97+
T visitV2(DeepgramListenProviderV2 v2);
9698

9799
T _visitUnknown(Object unknownType);
98100
}
@@ -109,12 +111,12 @@ private interface Value {
109111
private static final class V1Value implements Value {
110112
@JsonUnwrapped
111113
@JsonIgnoreProperties(value = "version", allowSetters = true)
112-
private AgentV1SettingsAgentContextListenProviderV1 value;
114+
private DeepgramListenProviderV1 value;
113115

114116
@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
115117
private V1Value() {}
116118

117-
private V1Value(AgentV1SettingsAgentContextListenProviderV1 value) {
119+
private V1Value(DeepgramListenProviderV1 value) {
118120
this.value = value;
119121
}
120122

@@ -149,12 +151,12 @@ public String toString() {
149151
private static final class V2Value implements Value {
150152
@JsonUnwrapped
151153
@JsonIgnoreProperties(value = "version", allowSetters = true)
152-
private AgentV1SettingsAgentContextListenProviderV2 value;
154+
private DeepgramListenProviderV2 value;
153155

154156
@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
155157
private V2Value() {}
156158

157-
private V2Value(AgentV1SettingsAgentContextListenProviderV2 value) {
159+
private V2Value(DeepgramListenProviderV2 value) {
158160
this.value = value;
159161
}
160162

src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentListenProvider.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
*/
44
package com.deepgram.resources.agent.v1.types;
55

6+
import com.deepgram.types.DeepgramListenProviderV1;
7+
import com.deepgram.types.DeepgramListenProviderV2;
68
import com.fasterxml.jackson.annotation.JsonCreator;
79
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
810
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -26,11 +28,11 @@ public <T> T visit(Visitor<T> visitor) {
2628
return value.visit(visitor);
2729
}
2830

29-
public static AgentV1SettingsAgentListenProvider v1(AgentV1SettingsAgentListenProviderV1 value) {
31+
public static AgentV1SettingsAgentListenProvider v1(DeepgramListenProviderV1 value) {
3032
return new AgentV1SettingsAgentListenProvider(new V1Value(value));
3133
}
3234

33-
public static AgentV1SettingsAgentListenProvider v2(AgentV1SettingsAgentListenProviderV2 value) {
35+
public static AgentV1SettingsAgentListenProvider v2(DeepgramListenProviderV2 value) {
3436
return new AgentV1SettingsAgentListenProvider(new V2Value(value));
3537
}
3638

@@ -46,14 +48,14 @@ public boolean _isUnknown() {
4648
return value instanceof _UnknownValue;
4749
}
4850

49-
public Optional<AgentV1SettingsAgentListenProviderV1> getV1() {
51+
public Optional<DeepgramListenProviderV1> getV1() {
5052
if (isV1()) {
5153
return Optional.of(((V1Value) value).value);
5254
}
5355
return Optional.empty();
5456
}
5557

56-
public Optional<AgentV1SettingsAgentListenProviderV2> getV2() {
58+
public Optional<DeepgramListenProviderV2> getV2() {
5759
if (isV2()) {
5860
return Optional.of(((V2Value) value).value);
5961
}
@@ -90,9 +92,9 @@ private Value getValue() {
9092
}
9193

9294
public interface Visitor<T> {
93-
T visitV1(AgentV1SettingsAgentListenProviderV1 v1);
95+
T visitV1(DeepgramListenProviderV1 v1);
9496

95-
T visitV2(AgentV1SettingsAgentListenProviderV2 v2);
97+
T visitV2(DeepgramListenProviderV2 v2);
9698

9799
T _visitUnknown(Object unknownType);
98100
}
@@ -109,12 +111,12 @@ private interface Value {
109111
private static final class V1Value implements Value {
110112
@JsonUnwrapped
111113
@JsonIgnoreProperties(value = "version", allowSetters = true)
112-
private AgentV1SettingsAgentListenProviderV1 value;
114+
private DeepgramListenProviderV1 value;
113115

114116
@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
115117
private V1Value() {}
116118

117-
private V1Value(AgentV1SettingsAgentListenProviderV1 value) {
119+
private V1Value(DeepgramListenProviderV1 value) {
118120
this.value = value;
119121
}
120122

@@ -149,12 +151,12 @@ public String toString() {
149151
private static final class V2Value implements Value {
150152
@JsonUnwrapped
151153
@JsonIgnoreProperties(value = "version", allowSetters = true)
152-
private AgentV1SettingsAgentListenProviderV2 value;
154+
private DeepgramListenProviderV2 value;
153155

154156
@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
155157
private V2Value() {}
156158

157-
private V2Value(AgentV1SettingsAgentListenProviderV2 value) {
159+
private V2Value(DeepgramListenProviderV2 value) {
158160
this.value = value;
159161
}
160162

0 commit comments

Comments
 (0)