Skip to content

Commit f1bac65

Browse files
feat!: sdk regeneration 2026-04-27 (#42)
* chore: initialize SDK regeneration branch * chore: unfreeze files pending regen * chore(repo): ignore agent docs and Claude skills in fern regen * chore(regen): automate ClientOptions patch reapply * SDK regeneration * chore: re-apply manual patches after regen - Restore ClientOptions.java SDK header constants and release-please version markers (overwritten by Fern with com.deepgram.fern:api-sdk and version 0.2.2). - Restore context7.json and add it to .fernignore so future regens don't delete it. - Rewrite the Agent WebSocket README snippet for the upstream agent settings restructure: ThinkSettingsV1 and ThinkSettingsV1Provider replace the AgentV1SettingsAgentThinkOneItem wrappers, and OpenAiThinkProvider now requires .builder().model(...) instead of accepting a free-form Map. * fix(examples): align Java examples with regenerated SDK types * chore(regen): align Java patch workflow with backup-restore strategy * chore(repo): dedupe agent entries in .fernignore --------- Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
1 parent 716e4cd commit f1bac65

209 files changed

Lines changed: 11531 additions & 14181 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/review-regen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Read AGENTS.md for full context on the regeneration workflow and freeze classifi
1414
- Patches still needed (must be re-applied)
1515
- New changes from the generator worth noting
1616
5. Wait for user direction on which patches to re-apply.
17-
6. Re-apply confirmed patches to the generated files.
17+
6. Re-apply confirmed patches to the generated files. If `src/main/java/com/deepgram/core/ClientOptions.java` still needs the patch, restore it through the standard `.bak` swap/restore workflow used for other temporarily frozen files.
1818
7. In `.fernignore`, replace each `.bak` path back to the original path for files that still need patches.
1919
8. Remove `.fernignore` entries entirely for files where patches are no longer needed.
2020
9. Delete all `.bak` files.

.fern/metadata.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"cliVersion": "4.46.0",
2+
"cliVersion": "4.92.0",
33
"generatorName": "fernapi/fern-java-sdk",
4-
"generatorVersion": "4.0.4",
4+
"generatorVersion": "4.6.1",
55
"generatorConfig": {
66
"package-prefix": "com.deepgram",
77
"base-api-exception-class-name": "DeepgramHttpException",
@@ -11,6 +11,8 @@
1111
},
1212
"enable-wire-tests": true
1313
},
14-
"originGitCommit": "e994b5ab79ae6fe3560daff055acdf80d315b48e",
15-
"sdkVersion": "0.2.1"
14+
"originGitCommit": "0d16d3b0d2f3da69dc058ea78f235b2b11288371",
15+
"originGitCommitIsDirty": true,
16+
"invokedBy": "manual",
17+
"sdkVersion": "0.2.2"
1618
}

.fernignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ examples/
4545
.githooks/
4646
.github/
4747
.gitignore
48+
context7.json
4849

4950
# Build output
5051
target/
5152

52-
# Agent files (Claude Code, OpenCode, other agent tools)
53+
# Agent files (Claude Code, OpenCode, and shared agent tooling)
5354
# .agents/skills/ holds agent-agnostic skills discoverable via `npx skills`.
5455
# CLAUDE.md is kept here defensively alongside AGENTS.md — some agent tooling
5556
# expects one name, some the other, and layouts vary across checkouts.

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ How to identify:
4747

4848
Current temporarily frozen files:
4949

50-
- `src/main/java/com/deepgram/core/ClientOptions.java` - preserves release-please version markers and correct SDK header constants that Fern currently overwrites
50+
- `src/main/java/com/deepgram/core/ClientOptions.java` - preserves release-please version markers and correct SDK header constants that Fern currently overwrites; use the standard `.bak` swap/restore workflow during regen review
5151

5252
### Prepare repo for regeneration
5353

@@ -66,7 +66,7 @@ Current temporarily frozen files:
6666
The `.bak` files are our manually patched versions protected by `.fernignore`. The original paths now contain the freshly generated versions. By comparing the two, we can see what the generator now produces versus what we had patched.
6767

6868
1. Diff each `.bak` file against the new generated version to understand what changed and whether our patches are still needed.
69-
2. Re-apply any patches that are still necessary to the newly generated files.
69+
2. Re-apply any patches that are still necessary to the newly generated files. For `src/main/java/com/deepgram/core/ClientOptions.java`, use the standard `.bak` restore flow if the generated output still overwrites the Deepgram SDK header constants and `// x-release-please-version` markers.
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.

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,12 @@ import com.deepgram.resources.agent.v1.types.AgentV1InjectUserMessage;
335335
import com.deepgram.resources.agent.v1.types.AgentV1Settings;
336336
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgent;
337337
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThink;
338-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThinkOneItem;
339-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThinkOneItemProvider;
340338
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAudio;
341339
import com.deepgram.resources.agent.v1.websocket.V1WebSocketClient;
342340
import com.deepgram.types.OpenAiThinkProvider;
343-
import java.util.List;
344-
import java.util.Map;
341+
import com.deepgram.types.OpenAiThinkProviderModel;
342+
import com.deepgram.types.ThinkSettingsV1;
343+
import com.deepgram.types.ThinkSettingsV1Provider;
345344
import java.util.concurrent.TimeUnit;
346345

347346
DeepgramClient client = DeepgramClient.builder().build();
@@ -355,12 +354,14 @@ agentWs.onWelcome(welcome -> {
355354
agentWs.sendSettings(AgentV1Settings.builder()
356355
.audio(AgentV1SettingsAudio.builder().build())
357356
.agent(AgentV1SettingsAgent.builder()
358-
.think(AgentV1SettingsAgentThink.of(List.of(
359-
AgentV1SettingsAgentThinkOneItem.builder()
360-
.provider(AgentV1SettingsAgentThinkOneItemProvider.of(
361-
OpenAiThinkProvider.of(Map.of("model", "gpt-4o-mini"))))
357+
.think(AgentV1SettingsAgentThink.of(
358+
ThinkSettingsV1.builder()
359+
.provider(ThinkSettingsV1Provider.openAi(
360+
OpenAiThinkProvider.builder()
361+
.model(OpenAiThinkProviderModel.GPT4O_MINI)
362+
.build()))
362363
.prompt("You are a helpful voice assistant. Keep responses brief.")
363-
.build())))
364+
.build()))
364365
.greeting("Hello! How can I help you today?")
365366
.build())
366367
.build());

build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@ sourceSets {
8080
examples {
8181
java {
8282
srcDir 'examples'
83-
// Exclude examples that still need API updates.
84-
exclude 'manage/ListModels.java' // Duplicate class name with agent/ListModels
85-
exclude 'manage/MemberPermissions.java' // getScopes() not in generated API
86-
exclude 'manage/UsageBreakdown.java' // getModels() return type mismatch
8783
}
8884
compileClasspath += sourceSets.main.output + configurations.runtimeClasspath
8985
runtimeClasspath += sourceSets.main.output + configurations.runtimeClasspath

examples/agent/CustomProviders.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
import com.deepgram.resources.agent.v1.types.AgentV1Settings;
33
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgent;
44
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentSpeak;
5-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentSpeakEndpoint;
6-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentSpeakEndpointProvider;
7-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentSpeakOneItemProviderDeepgramModel;
85
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThink;
9-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThinkOneItem;
10-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThinkOneItemProvider;
116
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAudio;
12-
import com.deepgram.resources.agent.v1.types.Deepgram;
137
import com.deepgram.resources.agent.v1.websocket.V1WebSocketClient;
148
import com.deepgram.types.Anthropic;
15-
import java.util.List;
16-
import java.util.Map;
9+
import com.deepgram.types.AnthropicThinkProviderModel;
10+
import com.deepgram.types.Deepgram;
11+
import com.deepgram.types.DeepgramSpeakProviderModel;
12+
import com.deepgram.types.SpeakSettingsV1;
13+
import com.deepgram.types.SpeakSettingsV1Provider;
14+
import com.deepgram.types.ThinkSettingsV1;
15+
import com.deepgram.types.ThinkSettingsV1Provider;
1716
import java.util.concurrent.CompletableFuture;
1817
import java.util.concurrent.CountDownLatch;
1918
import java.util.concurrent.TimeUnit;
@@ -57,23 +56,24 @@ public static void main(String[] args) {
5756

5857
try {
5958
// Configure Anthropic as the think provider
60-
Anthropic anthropicProvider = Anthropic.of(Map.of("model", "claude-sonnet-4-20250514"));
59+
Anthropic anthropicProvider = Anthropic.builder()
60+
.model(AnthropicThinkProviderModel.CLAUDE_SONNET420250514)
61+
.build();
6162

6263
// Configure Deepgram as the speak provider
6364
Deepgram deepgramSpeakProvider = Deepgram.builder()
64-
.model(AgentV1SettingsAgentSpeakOneItemProviderDeepgramModel.AURA2ASTERIA_EN)
65+
.model(DeepgramSpeakProviderModel.AURA2ASTERIA_EN)
6566
.build();
6667

67-
AgentV1SettingsAgentSpeak speakSettings =
68-
AgentV1SettingsAgentSpeak.of(AgentV1SettingsAgentSpeakEndpoint.builder()
69-
.provider(AgentV1SettingsAgentSpeakEndpointProvider.deepgram(deepgramSpeakProvider))
70-
.build());
68+
AgentV1SettingsAgentSpeak speakSettings = AgentV1SettingsAgentSpeak.of(SpeakSettingsV1.builder()
69+
.provider(SpeakSettingsV1Provider.deepgram(deepgramSpeakProvider))
70+
.build());
7171

7272
AgentV1SettingsAgent agentConfig = AgentV1SettingsAgent.builder()
73-
.think(AgentV1SettingsAgentThink.of(List.of(AgentV1SettingsAgentThinkOneItem.builder()
74-
.provider(AgentV1SettingsAgentThinkOneItemProvider.of(anthropicProvider))
73+
.think(AgentV1SettingsAgentThink.of(ThinkSettingsV1.builder()
74+
.provider(ThinkSettingsV1Provider.anthropic(anthropicProvider))
7575
.prompt("You are a helpful assistant. Keep responses concise.")
76-
.build())))
76+
.build()))
7777
.speak(speakSettings)
7878
.greeting("Hello! I'm powered by Anthropic Claude with Deepgram voices.")
7979
.build();

examples/agent/InjectMessage.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
import com.deepgram.resources.agent.v1.types.AgentV1Settings;
55
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgent;
66
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThink;
7-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThinkOneItem;
8-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThinkOneItemProvider;
97
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAudio;
108
import com.deepgram.resources.agent.v1.websocket.V1WebSocketClient;
119
import com.deepgram.types.OpenAiThinkProvider;
12-
import java.util.List;
13-
import java.util.Map;
10+
import com.deepgram.types.OpenAiThinkProviderModel;
11+
import com.deepgram.types.ThinkSettingsV1;
12+
import com.deepgram.types.ThinkSettingsV1Provider;
1413
import java.util.concurrent.CompletableFuture;
1514
import java.util.concurrent.CountDownLatch;
1615
import java.util.concurrent.TimeUnit;
@@ -52,18 +51,18 @@ public static void main(String[] args) {
5251

5352
try {
5453
// Configure the agent
55-
OpenAiThinkProvider openAiProvider = OpenAiThinkProvider.of(Map.of("model", "gpt-4o-mini"));
54+
OpenAiThinkProvider openAiProvider = OpenAiThinkProvider.builder()
55+
.model(OpenAiThinkProviderModel.GPT4O_MINI)
56+
.build();
5657

5758
AgentV1Settings settings = AgentV1Settings.builder()
5859
.audio(AgentV1SettingsAudio.builder().build())
5960
.agent(AgentV1SettingsAgent.builder()
60-
.think(AgentV1SettingsAgentThink.of(
61-
List.of(AgentV1SettingsAgentThinkOneItem.builder()
62-
.provider(
63-
AgentV1SettingsAgentThinkOneItemProvider.of(openAiProvider))
64-
.prompt(
65-
"You are a helpful voice assistant. Keep responses brief and conversational.")
66-
.build())))
61+
.think(AgentV1SettingsAgentThink.of(ThinkSettingsV1.builder()
62+
.provider(ThinkSettingsV1Provider.openAi(openAiProvider))
63+
.prompt(
64+
"You are a helpful voice assistant. Keep responses brief and conversational.")
65+
.build()))
6766
.greeting("Hello! I'm ready to chat.")
6867
.build())
6968
.build();

examples/agent/ProviderCombinations.java

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgent;
22
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentSpeak;
3-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentSpeakEndpoint;
4-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentSpeakEndpointProvider;
5-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentSpeakOneItemProviderDeepgramModel;
63
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThink;
7-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThinkOneItem;
8-
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThinkOneItemProvider;
9-
import com.deepgram.resources.agent.v1.types.Deepgram;
104
import com.deepgram.types.Anthropic;
5+
import com.deepgram.types.AnthropicThinkProviderModel;
6+
import com.deepgram.types.Deepgram;
7+
import com.deepgram.types.DeepgramSpeakProviderModel;
118
import com.deepgram.types.Google;
9+
import com.deepgram.types.GoogleThinkProviderModel;
1210
import com.deepgram.types.OpenAiThinkProvider;
13-
import java.util.List;
14-
import java.util.Map;
11+
import com.deepgram.types.OpenAiThinkProviderModel;
12+
import com.deepgram.types.SpeakSettingsV1;
13+
import com.deepgram.types.SpeakSettingsV1Provider;
14+
import com.deepgram.types.ThinkSettingsV1;
15+
import com.deepgram.types.ThinkSettingsV1Provider;
1516

1617
/**
1718
* Demonstrates building different provider combination configurations for comparison. Shows how to configure OpenAI,
@@ -27,22 +28,23 @@ public static void main(String[] args) {
2728

2829
// Shared speak provider (Deepgram TTS)
2930
Deepgram deepgramSpeak = Deepgram.builder()
30-
.model(AgentV1SettingsAgentSpeakOneItemProviderDeepgramModel.AURA2ASTERIA_EN)
31+
.model(DeepgramSpeakProviderModel.AURA2ASTERIA_EN)
3132
.build();
32-
AgentV1SettingsAgentSpeak speakSettings =
33-
AgentV1SettingsAgentSpeak.of(AgentV1SettingsAgentSpeakEndpoint.builder()
34-
.provider(AgentV1SettingsAgentSpeakEndpointProvider.deepgram(deepgramSpeak))
35-
.build());
33+
AgentV1SettingsAgentSpeak speakSettings = AgentV1SettingsAgentSpeak.of(SpeakSettingsV1.builder()
34+
.provider(SpeakSettingsV1Provider.deepgram(deepgramSpeak))
35+
.build());
3636

3737
// Combination 1: OpenAI GPT-4o Mini + Deepgram
3838
System.out.println("=== Combination 1: OpenAI + Deepgram ===");
39-
OpenAiThinkProvider openAiProvider = OpenAiThinkProvider.of(Map.of("model", "gpt-4o-mini"));
39+
OpenAiThinkProvider openAiProvider = OpenAiThinkProvider.builder()
40+
.model(OpenAiThinkProviderModel.GPT4O_MINI)
41+
.build();
4042

4143
AgentV1SettingsAgent openAiConfig = AgentV1SettingsAgent.builder()
42-
.think(AgentV1SettingsAgentThink.of(List.of(AgentV1SettingsAgentThinkOneItem.builder()
43-
.provider(AgentV1SettingsAgentThinkOneItemProvider.of(openAiProvider))
44+
.think(AgentV1SettingsAgentThink.of(ThinkSettingsV1.builder()
45+
.provider(ThinkSettingsV1Provider.openAi(openAiProvider))
4446
.prompt("You are a helpful assistant powered by OpenAI.")
45-
.build())))
47+
.build()))
4648
.speak(speakSettings)
4749
.greeting("Hello! I'm powered by OpenAI GPT-4o Mini.")
4850
.build();
@@ -53,13 +55,15 @@ public static void main(String[] args) {
5355

5456
// Combination 2: Anthropic Claude + Deepgram
5557
System.out.println("=== Combination 2: Anthropic + Deepgram ===");
56-
Anthropic anthropicProvider = Anthropic.of(Map.of("model", "claude-sonnet-4-20250514"));
58+
Anthropic anthropicProvider = Anthropic.builder()
59+
.model(AnthropicThinkProviderModel.CLAUDE_SONNET420250514)
60+
.build();
5761

5862
AgentV1SettingsAgent anthropicConfig = AgentV1SettingsAgent.builder()
59-
.think(AgentV1SettingsAgentThink.of(List.of(AgentV1SettingsAgentThinkOneItem.builder()
60-
.provider(AgentV1SettingsAgentThinkOneItemProvider.of(anthropicProvider))
63+
.think(AgentV1SettingsAgentThink.of(ThinkSettingsV1.builder()
64+
.provider(ThinkSettingsV1Provider.anthropic(anthropicProvider))
6165
.prompt("You are a helpful assistant powered by Anthropic Claude.")
62-
.build())))
66+
.build()))
6367
.speak(speakSettings)
6468
.greeting("Hello! I'm powered by Anthropic Claude.")
6569
.build();
@@ -70,13 +74,14 @@ public static void main(String[] args) {
7074

7175
// Combination 3: Google Gemini + Deepgram
7276
System.out.println("=== Combination 3: Google + Deepgram ===");
73-
Google googleProvider = Google.of(Map.of("model", "gemini-2.5-flash"));
77+
Google googleProvider =
78+
Google.builder().model(GoogleThinkProviderModel.GEMINI25FLASH).build();
7479

7580
AgentV1SettingsAgent googleConfig = AgentV1SettingsAgent.builder()
76-
.think(AgentV1SettingsAgentThink.of(List.of(AgentV1SettingsAgentThinkOneItem.builder()
77-
.provider(AgentV1SettingsAgentThinkOneItemProvider.of(googleProvider))
81+
.think(AgentV1SettingsAgentThink.of(ThinkSettingsV1.builder()
82+
.provider(ThinkSettingsV1Provider.google(googleProvider))
7883
.prompt("You are a helpful assistant powered by Google Gemini.")
79-
.build())))
84+
.build()))
8085
.speak(speakSettings)
8186
.greeting("Hello! I'm powered by Google Gemini.")
8287
.build();

0 commit comments

Comments
 (0)