Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"enable-wire-tests": true
},
"originGitCommit": "05bd7add608b322a6278fa20da22f2ed501d50ef",
"originGitCommit": "d1854cf6d560a0e27c9f46c1d83a6d7d9924f045",
"originGitCommitIsDirty": true,
"invokedBy": "manual",
"sdkVersion": "0.3.1"
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ The `.bak` files are our manually patched versions protected by `.fernignore`. T
3. In `.fernignore`, replace each `.bak` path back to the original path for files that still need patches.
4. Remove `.fernignore` entries entirely for any files where the generator now produces correct output.
5. Delete all `.bak` files once review is complete.
6. Run checks (`./gradlew test`) to verify.
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.
7. Commit as `chore: re-apply manual patches after regen` and push.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ import com.deepgram.DeepgramClient;
import com.deepgram.resources.agent.v1.types.AgentV1InjectUserMessage;
import com.deepgram.resources.agent.v1.types.AgentV1Settings;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgent;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThink;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContext;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContextThink;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAudio;
import com.deepgram.resources.agent.v1.websocket.V1WebSocketClient;
import com.deepgram.types.OpenAiThinkProvider;
Expand All @@ -357,8 +358,9 @@ agentWs.onWelcome(welcome -> {

agentWs.sendSettings(AgentV1Settings.builder()
.audio(AgentV1SettingsAudio.builder().build())
.agent(AgentV1SettingsAgent.builder()
.think(AgentV1SettingsAgentThink.of(
.agent(AgentV1SettingsAgent.of(
AgentV1SettingsAgentContext.builder()
.think(AgentV1SettingsAgentContextThink.of(
ThinkSettingsV1.builder()
.provider(ThinkSettingsV1Provider.openAi(
OpenAiThinkProvider.builder()
Expand All @@ -367,7 +369,7 @@ agentWs.onWelcome(welcome -> {
.prompt("You are a helpful voice assistant. Keep responses brief.")
.build()))
.greeting("Hello! How can I help you today?")
.build())
.build()))
.build());
});

Expand Down
18 changes: 10 additions & 8 deletions examples/agent/CustomProviders.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import com.deepgram.DeepgramClient;
import com.deepgram.resources.agent.v1.types.AgentV1Settings;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgent;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentSpeak;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThink;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContext;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContextSpeak;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContextThink;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAudio;
import com.deepgram.resources.agent.v1.websocket.V1WebSocketClient;
import com.deepgram.types.Anthropic;
Expand Down Expand Up @@ -65,18 +66,19 @@ public static void main(String[] args) {
.model(DeepgramSpeakProviderModel.AURA2ASTERIA_EN)
.build();

AgentV1SettingsAgentSpeak speakSettings = AgentV1SettingsAgentSpeak.of(SpeakSettingsV1.builder()
.provider(SpeakSettingsV1Provider.deepgram(deepgramSpeakProvider))
.build());
AgentV1SettingsAgentContextSpeak speakSettings =
AgentV1SettingsAgentContextSpeak.of(SpeakSettingsV1.builder()
.provider(SpeakSettingsV1Provider.deepgram(deepgramSpeakProvider))
.build());

AgentV1SettingsAgent agentConfig = AgentV1SettingsAgent.builder()
.think(AgentV1SettingsAgentThink.of(ThinkSettingsV1.builder()
AgentV1SettingsAgent agentConfig = AgentV1SettingsAgent.of(AgentV1SettingsAgentContext.builder()
.think(AgentV1SettingsAgentContextThink.of(ThinkSettingsV1.builder()
.provider(ThinkSettingsV1Provider.anthropic(anthropicProvider))
.prompt("You are a helpful assistant. Keep responses concise.")
.build()))
.speak(speakSettings)
.greeting("Hello! I'm powered by Anthropic Claude with Deepgram voices.")
.build();
.build());

AgentV1Settings settings = AgentV1Settings.builder()
.audio(AgentV1SettingsAudio.builder().build())
Expand Down
9 changes: 5 additions & 4 deletions examples/agent/InjectMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import com.deepgram.resources.agent.v1.types.AgentV1InjectUserMessage;
import com.deepgram.resources.agent.v1.types.AgentV1Settings;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgent;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThink;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContext;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContextThink;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAudio;
import com.deepgram.resources.agent.v1.websocket.V1WebSocketClient;
import com.deepgram.types.OpenAiThinkProvider;
Expand Down Expand Up @@ -57,14 +58,14 @@ public static void main(String[] args) {

AgentV1Settings settings = AgentV1Settings.builder()
.audio(AgentV1SettingsAudio.builder().build())
.agent(AgentV1SettingsAgent.builder()
.think(AgentV1SettingsAgentThink.of(ThinkSettingsV1.builder()
.agent(AgentV1SettingsAgent.of(AgentV1SettingsAgentContext.builder()
.think(AgentV1SettingsAgentContextThink.of(ThinkSettingsV1.builder()
.provider(ThinkSettingsV1Provider.openAi(openAiProvider))
.prompt(
"You are a helpful voice assistant. Keep responses brief and conversational.")
.build()))
.greeting("Hello! I'm ready to chat.")
.build())
.build()))
.build();

wsClient.sendSettings(settings);
Expand Down
25 changes: 13 additions & 12 deletions examples/agent/ProviderCombinations.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgent;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentSpeak;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThink;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContext;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContextSpeak;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContextThink;
import com.deepgram.types.Anthropic;
import com.deepgram.types.AnthropicThinkProviderModel;
import com.deepgram.types.Deepgram;
Expand Down Expand Up @@ -30,7 +31,7 @@ public static void main(String[] args) {
Deepgram deepgramSpeak = Deepgram.builder()
.model(DeepgramSpeakProviderModel.AURA2ASTERIA_EN)
.build();
AgentV1SettingsAgentSpeak speakSettings = AgentV1SettingsAgentSpeak.of(SpeakSettingsV1.builder()
AgentV1SettingsAgentContextSpeak speakSettings = AgentV1SettingsAgentContextSpeak.of(SpeakSettingsV1.builder()
.provider(SpeakSettingsV1Provider.deepgram(deepgramSpeak))
.build());

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

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

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

AgentV1SettingsAgent googleConfig = AgentV1SettingsAgent.builder()
.think(AgentV1SettingsAgentThink.of(ThinkSettingsV1.builder()
AgentV1SettingsAgent googleConfig = AgentV1SettingsAgent.of(AgentV1SettingsAgentContext.builder()
.think(AgentV1SettingsAgentContextThink.of(ThinkSettingsV1.builder()
.provider(ThinkSettingsV1Provider.google(googleProvider))
.prompt("You are a helpful assistant powered by Google Gemini.")
.build()))
.speak(speakSettings)
.greeting("Hello! I'm powered by Google Gemini.")
.build();
.build());
System.out.println(" Think: Google Gemini 2.5 Flash");
System.out.println(" Speak: Deepgram Aura 2 Asteria");
System.out.println(" Config built successfully.");
Expand Down
9 changes: 5 additions & 4 deletions examples/agent/VoiceAgent.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import com.deepgram.DeepgramClient;
import com.deepgram.resources.agent.v1.types.AgentV1Settings;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgent;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentThink;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContext;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAgentContextThink;
import com.deepgram.resources.agent.v1.types.AgentV1SettingsAudio;
import com.deepgram.resources.agent.v1.websocket.V1WebSocketClient;
import com.deepgram.types.OpenAiThinkProvider;
Expand Down Expand Up @@ -62,13 +63,13 @@ public static void main(String[] args) {
.model(OpenAiThinkProviderModel.GPT4O_MINI)
.build();

AgentV1SettingsAgent agentConfig = AgentV1SettingsAgent.builder()
.think(AgentV1SettingsAgentThink.of(ThinkSettingsV1.builder()
AgentV1SettingsAgent agentConfig = AgentV1SettingsAgent.of(AgentV1SettingsAgentContext.builder()
.think(AgentV1SettingsAgentContextThink.of(ThinkSettingsV1.builder()
.provider(ThinkSettingsV1Provider.openAi(openAiProvider))
.prompt("You are a helpful voice assistant. Keep your responses brief.")
.build()))
.greeting("Hello! How can I help you today?")
.build();
.build());

AgentV1Settings settings = AgentV1Settings.builder()
.audio(AgentV1SettingsAudio.builder().build())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import org.jetbrains.annotations.NotNull;

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

private final String content;

private final Optional<List<String>> languagesHinted;

private final Optional<List<String>> languages;

private final Map<String, Object> additionalProperties;

private AgentV1ConversationText(
AgentV1ConversationTextRole role, String content, Map<String, Object> additionalProperties) {
AgentV1ConversationTextRole role,
String content,
Optional<List<String>> languagesHinted,
Optional<List<String>> languages,
Map<String, Object> additionalProperties) {
this.role = role;
this.content = content;
this.languagesHinted = languagesHinted;
this.languages = languages;
this.additionalProperties = additionalProperties;
}

Expand Down Expand Up @@ -56,6 +69,22 @@ public String getContent() {
return content;
}

/**
* @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.
*/
@JsonProperty("languages_hinted")
public Optional<List<String>> getLanguagesHinted() {
return languagesHinted;
}

/**
* @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.
*/
@JsonProperty("languages")
public Optional<List<String>> getLanguages() {
return languages;
}

@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
Expand All @@ -68,12 +97,15 @@ public Map<String, Object> getAdditionalProperties() {
}

private boolean equalTo(AgentV1ConversationText other) {
return role.equals(other.role) && content.equals(other.content);
return role.equals(other.role)
&& content.equals(other.content)
&& languagesHinted.equals(other.languagesHinted)
&& languages.equals(other.languages);
}

@java.lang.Override
public int hashCode() {
return Objects.hash(this.role, this.content);
return Objects.hash(this.role, this.content, this.languagesHinted, this.languages);
}

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

_FinalStage additionalProperties(Map<String, Object> additionalProperties);

/**
* <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>
*/
_FinalStage languagesHinted(Optional<List<String>> languagesHinted);

_FinalStage languagesHinted(List<String> languagesHinted);

/**
* <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>
*/
_FinalStage languages(Optional<List<String>> languages);

_FinalStage languages(List<String> languages);
}

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

private String content;

private Optional<List<String>> languages = Optional.empty();

private Optional<List<String>> languagesHinted = Optional.empty();

@JsonAnySetter
private Map<String, Object> additionalProperties = new HashMap<>();

Expand All @@ -124,6 +174,8 @@ private Builder() {}
public Builder from(AgentV1ConversationText other) {
role(other.getRole());
content(other.getContent());
languagesHinted(other.getLanguagesHinted());
languages(other.getLanguages());
return this;
}

Expand Down Expand Up @@ -151,9 +203,49 @@ public _FinalStage content(@NotNull String content) {
return this;
}

/**
* <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>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage languages(List<String> languages) {
this.languages = Optional.ofNullable(languages);
return this;
}

/**
* <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>
*/
@java.lang.Override
@JsonSetter(value = "languages", nulls = Nulls.SKIP)
public _FinalStage languages(Optional<List<String>> languages) {
this.languages = languages;
return this;
}

/**
* <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>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage languagesHinted(List<String> languagesHinted) {
this.languagesHinted = Optional.ofNullable(languagesHinted);
return this;
}

/**
* <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>
*/
@java.lang.Override
@JsonSetter(value = "languages_hinted", nulls = Nulls.SKIP)
public _FinalStage languagesHinted(Optional<List<String>> languagesHinted) {
this.languagesHinted = languagesHinted;
return this;
}

@java.lang.Override
public AgentV1ConversationText build() {
return new AgentV1ConversationText(role, content, additionalProperties);
return new AgentV1ConversationText(role, content, languagesHinted, languages, additionalProperties);
}

@java.lang.Override
Expand Down
Loading
Loading