Skip to content

Commit f44678a

Browse files
feat!: sdk regeneration 2026-05-05 (#49)
## Summary - Regenerate the Java SDK with the latest Fern output. - Re-apply the manual patch to `src/main/java/com/deepgram/core/ClientOptions.java` (release-please version markers + Deepgram SDK header constants — Fern still strips both). - Update README and four `examples/agent/` files for the AgentV1SettingsAgent schema restructure. - Update AGENTS.md verify step to `./gradlew test compileExamples` so future regen reviews catch the hand-maintained `examples/` directory. ## Breaking Changes - `AgentV1SettingsAgent` is now a discriminated union: `AgentV1SettingsAgent.of(AgentV1SettingsAgentContext)` or `.of(String)`. The previous `AgentV1SettingsAgent.builder()` is removed. - The `think` / `speak` / `listen` / `greeting` fields moved from `AgentV1SettingsAgent` into `AgentV1SettingsAgentContext`. - `AgentV1SettingsAgentContext.messages` is now nested under `.context.messages` via the new `AgentV1SettingsAgentContextContext` type. - Downstream Java consumers will need import and constructor updates. Pre-1.0; release-please will land this as `0.4.0`. ## Additional Changes - Add `AgentV1SettingsAgentContextContext` — new conversation-history container at `AgentV1SettingsAgentContext.context`. - Add `AgentV1SettingsAgentContextListen`, `AgentV1SettingsAgentContextListenProvider`, `AgentV1SettingsAgentContextListenProviderV1`, `AgentV1SettingsAgentContextListenProviderV2`, `AgentV1SettingsAgentContextListenProviderV2LanguageHint` for per-context Listen overrides. - Add `AgentV1SettingsAgentContextSpeak`, `AgentV1SettingsAgentContextThink` for per-context Speak/Think overrides (the original `AgentV1SettingsAgentSpeak` / `AgentV1SettingsAgentThink` types are retained). - Add `AgentV1SettingsAudioOutputContainer`. - Add `GroqThinkProviderReasoningMode`, `OpenAiThinkProviderReasoningMode`. ## Validation - `./gradlew test compileExamples` ✅ - `./gradlew unitTest` ✅ - `./gradlew integrationTest` ✅ - `./gradlew check` ✅ (after `spotlessApply` reformatted one example) - `mvn test` ✅ (55 tests pass) - All 41 examples compile against the regenerated SDK. 31 ran end-to-end against the live Deepgram API; 6 long-running streaming/agent examples connected and progressed through their happy path before being cut off at the 60s test ceiling. 4 examples failed for pre-existing environmental reasons (local proxy required / placeholder webhook URL / missing CLI arg / missing SageMaker fixture) — none are regen-induced regressions. --------- Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
1 parent 0519ad3 commit f44678a

33 files changed

Lines changed: 2240 additions & 338 deletions

.fern/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"enable-wire-tests": true
1313
},
14-
"originGitCommit": "05bd7add608b322a6278fa20da22f2ed501d50ef",
14+
"originGitCommit": "d1854cf6d560a0e27c9f46c1d83a6d7d9924f045",
1515
"originGitCommitIsDirty": true,
1616
"invokedBy": "manual",
1717
"sdkVersion": "0.3.1"

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,5 @@ The `.bak` files are our manually patched versions protected by `.fernignore`. T
7070
3. In `.fernignore`, replace each `.bak` path back to the original path for files that still need patches.
7171
4. Remove `.fernignore` entries entirely for any files where the generator now produces correct output.
7272
5. Delete all `.bak` files once review is complete.
73-
6. Run checks (`./gradlew test`) to verify.
73+
6. Run checks (`./gradlew test compileExamples`) to verify. `test` covers unit/wire tests including the README snippet compilation; `compileExamples` separately compiles the hand-maintained `examples/` directory and catches stale API call sites that `test` alone would miss.
7474
7. Commit as `chore: re-apply manual patches after regen` and push.

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,8 @@ import com.deepgram.DeepgramClient;
338338
import com.deepgram.resources.agent.v1.types.AgentV1InjectUserMessage;
339339
import com.deepgram.resources.agent.v1.types.AgentV1Settings;
340340
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgent;
341-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThink;
341+
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContext;
342+
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContextThink;
342343
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAudio;
343344
import com.deepgram.resources.agent.v1.websocket.V1WebSocketClient;
344345
import com.deepgram.types.OpenAiThinkProvider;
@@ -357,8 +358,9 @@ agentWs.onWelcome(welcome -> {
357358

358359
agentWs.sendSettings(AgentV1Settings.builder()
359360
.audio(AgentV1SettingsAudio.builder().build())
360-
.agent(AgentV1SettingsAgent.builder()
361-
.think(AgentV1SettingsAgentThink.of(
361+
.agent(AgentV1SettingsAgent.of(
362+
AgentV1SettingsAgentContext.builder()
363+
.think(AgentV1SettingsAgentContextThink.of(
362364
ThinkSettingsV1.builder()
363365
.provider(ThinkSettingsV1Provider.openAi(
364366
OpenAiThinkProvider.builder()
@@ -367,7 +369,7 @@ agentWs.onWelcome(welcome -> {
367369
.prompt("You are a helpful voice assistant. Keep responses brief.")
368370
.build()))
369371
.greeting("Hello! How can I help you today?")
370-
.build())
372+
.build()))
371373
.build());
372374
});
373375

examples/agent/CustomProviders.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import com.deepgram.DeepgramClient;
22
import com.deepgram.resources.agent.v1.types.AgentV1Settings;
33
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgent;
4-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentSpeak;
5-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThink;
4+
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContext;
5+
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContextSpeak;
6+
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContextThink;
67
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAudio;
78
import com.deepgram.resources.agent.v1.websocket.V1WebSocketClient;
89
import com.deepgram.types.Anthropic;
@@ -65,18 +66,19 @@ public static void main(String[] args) {
6566
.model(DeepgramSpeakProviderModel.AURA2ASTERIA_EN)
6667
.build();
6768

68-
AgentV1SettingsAgentSpeak speakSettings = AgentV1SettingsAgentSpeak.of(SpeakSettingsV1.builder()
69-
.provider(SpeakSettingsV1Provider.deepgram(deepgramSpeakProvider))
70-
.build());
69+
AgentV1SettingsAgentContextSpeak speakSettings =
70+
AgentV1SettingsAgentContextSpeak.of(SpeakSettingsV1.builder()
71+
.provider(SpeakSettingsV1Provider.deepgram(deepgramSpeakProvider))
72+
.build());
7173

72-
AgentV1SettingsAgent agentConfig = AgentV1SettingsAgent.builder()
73-
.think(AgentV1SettingsAgentThink.of(ThinkSettingsV1.builder()
74+
AgentV1SettingsAgent agentConfig = AgentV1SettingsAgent.of(AgentV1SettingsAgentContext.builder()
75+
.think(AgentV1SettingsAgentContextThink.of(ThinkSettingsV1.builder()
7476
.provider(ThinkSettingsV1Provider.anthropic(anthropicProvider))
7577
.prompt("You are a helpful assistant. Keep responses concise.")
7678
.build()))
7779
.speak(speakSettings)
7880
.greeting("Hello! I'm powered by Anthropic Claude with Deepgram voices.")
79-
.build();
81+
.build());
8082

8183
AgentV1Settings settings = AgentV1Settings.builder()
8284
.audio(AgentV1SettingsAudio.builder().build())

examples/agent/InjectMessage.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
import com.deepgram.resources.agent.v1.types.AgentV1InjectUserMessage;
44
import com.deepgram.resources.agent.v1.types.AgentV1Settings;
55
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgent;
6-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThink;
6+
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContext;
7+
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContextThink;
78
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAudio;
89
import com.deepgram.resources.agent.v1.websocket.V1WebSocketClient;
910
import com.deepgram.types.OpenAiThinkProvider;
@@ -57,14 +58,14 @@ public static void main(String[] args) {
5758

5859
AgentV1Settings settings = AgentV1Settings.builder()
5960
.audio(AgentV1SettingsAudio.builder().build())
60-
.agent(AgentV1SettingsAgent.builder()
61-
.think(AgentV1SettingsAgentThink.of(ThinkSettingsV1.builder()
61+
.agent(AgentV1SettingsAgent.of(AgentV1SettingsAgentContext.builder()
62+
.think(AgentV1SettingsAgentContextThink.of(ThinkSettingsV1.builder()
6263
.provider(ThinkSettingsV1Provider.openAi(openAiProvider))
6364
.prompt(
6465
"You are a helpful voice assistant. Keep responses brief and conversational.")
6566
.build()))
6667
.greeting("Hello! I'm ready to chat.")
67-
.build())
68+
.build()))
6869
.build();
6970

7071
wsClient.sendSettings(settings);

examples/agent/ProviderCombinations.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgent;
2-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentSpeak;
3-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThink;
2+
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContext;
3+
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContextSpeak;
4+
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContextThink;
45
import com.deepgram.types.Anthropic;
56
import com.deepgram.types.AnthropicThinkProviderModel;
67
import com.deepgram.types.Deepgram;
@@ -30,7 +31,7 @@ public static void main(String[] args) {
3031
Deepgram deepgramSpeak = Deepgram.builder()
3132
.model(DeepgramSpeakProviderModel.AURA2ASTERIA_EN)
3233
.build();
33-
AgentV1SettingsAgentSpeak speakSettings = AgentV1SettingsAgentSpeak.of(SpeakSettingsV1.builder()
34+
AgentV1SettingsAgentContextSpeak speakSettings = AgentV1SettingsAgentContextSpeak.of(SpeakSettingsV1.builder()
3435
.provider(SpeakSettingsV1Provider.deepgram(deepgramSpeak))
3536
.build());
3637

@@ -40,14 +41,14 @@ public static void main(String[] args) {
4041
.model(OpenAiThinkProviderModel.GPT4O_MINI)
4142
.build();
4243

43-
AgentV1SettingsAgent openAiConfig = AgentV1SettingsAgent.builder()
44-
.think(AgentV1SettingsAgentThink.of(ThinkSettingsV1.builder()
44+
AgentV1SettingsAgent openAiConfig = AgentV1SettingsAgent.of(AgentV1SettingsAgentContext.builder()
45+
.think(AgentV1SettingsAgentContextThink.of(ThinkSettingsV1.builder()
4546
.provider(ThinkSettingsV1Provider.openAi(openAiProvider))
4647
.prompt("You are a helpful assistant powered by OpenAI.")
4748
.build()))
4849
.speak(speakSettings)
4950
.greeting("Hello! I'm powered by OpenAI GPT-4o Mini.")
50-
.build();
51+
.build());
5152
System.out.println(" Think: OpenAI GPT-4o Mini");
5253
System.out.println(" Speak: Deepgram Aura 2 Asteria");
5354
System.out.println(" Config built successfully.");
@@ -59,14 +60,14 @@ public static void main(String[] args) {
5960
.model(AnthropicThinkProviderModel.CLAUDE_SONNET420250514)
6061
.build();
6162

62-
AgentV1SettingsAgent anthropicConfig = AgentV1SettingsAgent.builder()
63-
.think(AgentV1SettingsAgentThink.of(ThinkSettingsV1.builder()
63+
AgentV1SettingsAgent anthropicConfig = AgentV1SettingsAgent.of(AgentV1SettingsAgentContext.builder()
64+
.think(AgentV1SettingsAgentContextThink.of(ThinkSettingsV1.builder()
6465
.provider(ThinkSettingsV1Provider.anthropic(anthropicProvider))
6566
.prompt("You are a helpful assistant powered by Anthropic Claude.")
6667
.build()))
6768
.speak(speakSettings)
6869
.greeting("Hello! I'm powered by Anthropic Claude.")
69-
.build();
70+
.build());
7071
System.out.println(" Think: Anthropic Claude Sonnet 4");
7172
System.out.println(" Speak: Deepgram Aura 2 Asteria");
7273
System.out.println(" Config built successfully.");
@@ -77,14 +78,14 @@ public static void main(String[] args) {
7778
Google googleProvider =
7879
Google.builder().model(GoogleThinkProviderModel.GEMINI25FLASH).build();
7980

80-
AgentV1SettingsAgent googleConfig = AgentV1SettingsAgent.builder()
81-
.think(AgentV1SettingsAgentThink.of(ThinkSettingsV1.builder()
81+
AgentV1SettingsAgent googleConfig = AgentV1SettingsAgent.of(AgentV1SettingsAgentContext.builder()
82+
.think(AgentV1SettingsAgentContextThink.of(ThinkSettingsV1.builder()
8283
.provider(ThinkSettingsV1Provider.google(googleProvider))
8384
.prompt("You are a helpful assistant powered by Google Gemini.")
8485
.build()))
8586
.speak(speakSettings)
8687
.greeting("Hello! I'm powered by Google Gemini.")
87-
.build();
88+
.build());
8889
System.out.println(" Think: Google Gemini 2.5 Flash");
8990
System.out.println(" Speak: Deepgram Aura 2 Asteria");
9091
System.out.println(" Config built successfully.");

examples/agent/VoiceAgent.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import com.deepgram.DeepgramClient;
22
import com.deepgram.resources.agent.v1.types.AgentV1Settings;
33
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgent;
4-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThink;
4+
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContext;
5+
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContextThink;
56
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAudio;
67
import com.deepgram.resources.agent.v1.websocket.V1WebSocketClient;
78
import com.deepgram.types.OpenAiThinkProvider;
@@ -62,13 +63,13 @@ public static void main(String[] args) {
6263
.model(OpenAiThinkProviderModel.GPT4O_MINI)
6364
.build();
6465

65-
AgentV1SettingsAgent agentConfig = AgentV1SettingsAgent.builder()
66-
.think(AgentV1SettingsAgentThink.of(ThinkSettingsV1.builder()
66+
AgentV1SettingsAgent agentConfig = AgentV1SettingsAgent.of(AgentV1SettingsAgentContext.builder()
67+
.think(AgentV1SettingsAgentContextThink.of(ThinkSettingsV1.builder()
6768
.provider(ThinkSettingsV1Provider.openAi(openAiProvider))
6869
.prompt("You are a helpful voice assistant. Keep your responses brief.")
6970
.build()))
7071
.greeting("Hello! How can I help you today?")
71-
.build();
72+
.build());
7273

7374
AgentV1Settings settings = AgentV1Settings.builder()
7475
.audio(AgentV1SettingsAudio.builder().build())

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

Lines changed: 96 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@
1010
import com.fasterxml.jackson.annotation.JsonInclude;
1111
import com.fasterxml.jackson.annotation.JsonProperty;
1212
import com.fasterxml.jackson.annotation.JsonSetter;
13+
import com.fasterxml.jackson.annotation.Nulls;
1314
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
1415
import java.util.HashMap;
16+
import java.util.List;
1517
import java.util.Map;
1618
import java.util.Objects;
19+
import java.util.Optional;
1720
import org.jetbrains.annotations.NotNull;
1821

1922
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@@ -23,12 +26,22 @@ public final class AgentV1ConversationText {
2326

2427
private final String content;
2528

29+
private final Optional<List<String>> languagesHinted;
30+
31+
private final Optional<List<String>> languages;
32+
2633
private final Map<String, Object> additionalProperties;
2734

2835
private AgentV1ConversationText(
29-
AgentV1ConversationTextRole role, String content, Map<String, Object> additionalProperties) {
36+
AgentV1ConversationTextRole role,
37+
String content,
38+
Optional<List<String>> languagesHinted,
39+
Optional<List<String>> languages,
40+
Map<String, Object> additionalProperties) {
3041
this.role = role;
3142
this.content = content;
43+
this.languagesHinted = languagesHinted;
44+
this.languages = languages;
3245
this.additionalProperties = additionalProperties;
3346
}
3447

@@ -56,6 +69,22 @@ public String getContent() {
5669
return content;
5770
}
5871

72+
/**
73+
* @return The language hints that were active at the time of the turn. Only present on user-role messages when the listen model is flux-general-multi.
74+
*/
75+
@JsonProperty("languages_hinted")
76+
public Optional<List<String>> getLanguagesHinted() {
77+
return languagesHinted;
78+
}
79+
80+
/**
81+
* @return Languages detected in the user's speech, sorted by word count (descending). Only present on user-role messages when the listen model is flux-general-multi.
82+
*/
83+
@JsonProperty("languages")
84+
public Optional<List<String>> getLanguages() {
85+
return languages;
86+
}
87+
5988
@java.lang.Override
6089
public boolean equals(Object other) {
6190
if (this == other) return true;
@@ -68,12 +97,15 @@ public Map<String, Object> getAdditionalProperties() {
6897
}
6998

7099
private boolean equalTo(AgentV1ConversationText other) {
71-
return role.equals(other.role) && content.equals(other.content);
100+
return role.equals(other.role)
101+
&& content.equals(other.content)
102+
&& languagesHinted.equals(other.languagesHinted)
103+
&& languages.equals(other.languages);
72104
}
73105

74106
@java.lang.Override
75107
public int hashCode() {
76-
return Objects.hash(this.role, this.content);
108+
return Objects.hash(this.role, this.content, this.languagesHinted, this.languages);
77109
}
78110

79111
@java.lang.Override
@@ -107,6 +139,20 @@ public interface _FinalStage {
107139
_FinalStage additionalProperty(String key, Object value);
108140

109141
_FinalStage additionalProperties(Map<String, Object> additionalProperties);
142+
143+
/**
144+
* <p>The language hints that were active at the time of the turn. Only present on user-role messages when the listen model is flux-general-multi.</p>
145+
*/
146+
_FinalStage languagesHinted(Optional<List<String>> languagesHinted);
147+
148+
_FinalStage languagesHinted(List<String> languagesHinted);
149+
150+
/**
151+
* <p>Languages detected in the user's speech, sorted by word count (descending). Only present on user-role messages when the listen model is flux-general-multi.</p>
152+
*/
153+
_FinalStage languages(Optional<List<String>> languages);
154+
155+
_FinalStage languages(List<String> languages);
110156
}
111157

112158
@JsonIgnoreProperties(ignoreUnknown = true)
@@ -115,6 +161,10 @@ public static final class Builder implements RoleStage, ContentStage, _FinalStag
115161

116162
private String content;
117163

164+
private Optional<List<String>> languages = Optional.empty();
165+
166+
private Optional<List<String>> languagesHinted = Optional.empty();
167+
118168
@JsonAnySetter
119169
private Map<String, Object> additionalProperties = new HashMap<>();
120170

@@ -124,6 +174,8 @@ private Builder() {}
124174
public Builder from(AgentV1ConversationText other) {
125175
role(other.getRole());
126176
content(other.getContent());
177+
languagesHinted(other.getLanguagesHinted());
178+
languages(other.getLanguages());
127179
return this;
128180
}
129181

@@ -151,9 +203,49 @@ public _FinalStage content(@NotNull String content) {
151203
return this;
152204
}
153205

206+
/**
207+
* <p>Languages detected in the user's speech, sorted by word count (descending). Only present on user-role messages when the listen model is flux-general-multi.</p>
208+
* @return Reference to {@code this} so that method calls can be chained together.
209+
*/
210+
@java.lang.Override
211+
public _FinalStage languages(List<String> languages) {
212+
this.languages = Optional.ofNullable(languages);
213+
return this;
214+
}
215+
216+
/**
217+
* <p>Languages detected in the user's speech, sorted by word count (descending). Only present on user-role messages when the listen model is flux-general-multi.</p>
218+
*/
219+
@java.lang.Override
220+
@JsonSetter(value = "languages", nulls = Nulls.SKIP)
221+
public _FinalStage languages(Optional<List<String>> languages) {
222+
this.languages = languages;
223+
return this;
224+
}
225+
226+
/**
227+
* <p>The language hints that were active at the time of the turn. Only present on user-role messages when the listen model is flux-general-multi.</p>
228+
* @return Reference to {@code this} so that method calls can be chained together.
229+
*/
230+
@java.lang.Override
231+
public _FinalStage languagesHinted(List<String> languagesHinted) {
232+
this.languagesHinted = Optional.ofNullable(languagesHinted);
233+
return this;
234+
}
235+
236+
/**
237+
* <p>The language hints that were active at the time of the turn. Only present on user-role messages when the listen model is flux-general-multi.</p>
238+
*/
239+
@java.lang.Override
240+
@JsonSetter(value = "languages_hinted", nulls = Nulls.SKIP)
241+
public _FinalStage languagesHinted(Optional<List<String>> languagesHinted) {
242+
this.languagesHinted = languagesHinted;
243+
return this;
244+
}
245+
154246
@java.lang.Override
155247
public AgentV1ConversationText build() {
156-
return new AgentV1ConversationText(role, content, additionalProperties);
248+
return new AgentV1ConversationText(role, content, languagesHinted, languages, additionalProperties);
157249
}
158250

159251
@java.lang.Override

0 commit comments

Comments
 (0)