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 @@ -12,7 +12,7 @@
"enable-wire-tests": true,
"runtime-version": true
},
"originGitCommit": "596e7bdfa377f40f3301b1d394c9f0215af5f6d4",
"originGitCommit": "229defd4c32f220af07902c24efca5e94b4c47a4",
"originGitCommitIsDirty": true,
"invokedBy": "manual",
"sdkVersion": "0.11.4"
Expand Down
3 changes: 3 additions & 0 deletions .fernignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ src/main/java/com/deepgram/resources/agent/v1/types/AgentV1ConversationText.java
# default Visitor method for source and binary compatibility with callers compiled before the Deepgram provider existed.
src/main/java/com/deepgram/types/ThinkSettingsV1Provider.java

# Retains the previous public PhoneLLM constant spelling after Fern removed the underscore before 2.
src/main/java/com/deepgram/types/DeepgramThinkProviderModel.java

# Restores the FLUX_RENEE_EN constant that generator 4.18.0 dropped. The voice is live:
# POST /v2/speak?model=flux-renee-en returns 200 with valid audio, and the name resolves in the
# server's model registry (an invented flux-* name is rejected with INVALID_QUERY_PARAMETER), so the
Expand Down
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Current temporarily frozen files:
- `src/main/java/com/deepgram/resources/agent/v1/websocket/V1WebSocketClient.java` - Agent V1 already delivers every raw control frame through `onMessage(String)`. Suppress generic errors for unknown frames only when a raw handler is registered; otherwise retain legacy `onError` delivery. Preserve the generated Think Live, dynamic-injection, and frustration handlers during reconciliation.
- `src/main/java/com/deepgram/resources/agent/v1/types/AgentV1ConversationText.java` restores the legacy `content(...): _FinalStage` builder stage and defaults omitted or empty `conversational_behavior` to `default`. The schema now requires the wire field, while this shim preserves source and binary compatibility for callers compiled before Think Live existed. `ConversationalBehaviorStage` remains as an intentionally retained generated type, even though the restored legacy stage no longer returns it.
- `src/main/java/com/deepgram/types/ThinkSettingsV1Provider.java` makes `Visitor.visitDeepgram(DeepgramThinkProvider)` default to `_visitUnknown` for source and binary compatibility with implementations compiled before the provider existed. Fern now generates the distinct Think provider and model types (`think-fast` and `phonellm-mini-alpha-2-fp8`), including `temperature`, `reasoning_mode`, and `voice_prompt_opt_out`; retain only this Visitor default until Fern generates it or the next major release. Guarded by `src/test/java/com/deepgram/RegenTypesTest.java` and `AgentV1ThinkLiveWireTest.java`.
- `src/main/java/com/deepgram/types/DeepgramThinkProviderModel.java` retains the deprecated `PHONELLM_MINI_ALPHA_2_FP8` static-field alias after Fern renamed the generated constant to `PHONELLM_MINI_ALPHA2FP8`. Both represent `phonellm-mini-alpha-2-fp8`; keep the alias until the next major release to avoid a source break. The patch also keeps the internal `Value` enum constant named `PHONELLM_MINI_ALPHA_2_FP8` (not renamed to match the static field) because a Java enum-switch resolves by the old ordinal/name at the bytecode level: code compiled against the previous release that switches on `getEnumValue()` using the old name silently falls through to `default` instead of erroring if the enum constant is renamed, even though the public static field alias keeps "pass it as a value" usage working. Re-apply both the alias and the un-renamed `Value` constant after regen until Fern stops renaming enum constants outright on this kind of rename. Guarded by the Think-provider regression tests.
- `src/main/java/com/deepgram/resources/agent/v1/types/AgentV1ThinkLiveUpdated.java` - fields-less event type with a manual `hashCode()` patch. Fern generates `equals()` but no matching `hashCode()`, violating the Object contract; retain the patch, freeze entry, and `RegenTypesTest.FieldsLessMessageContract` assertion until Fern fixes the pattern.
- `src/main/java/com/deepgram/core/ClientOptions.java` - preserves release-please version markers, correct SDK header constants, and the accurate `close()` lifecycle Javadoc that Fern currently overwrites; use the standard `.bak` swap/restore workflow during regen review. Since generator 4.18.0 Fern emits a `getSdkVersion()` helper reading `Package.getImplementationVersion()` instead of a literal. That *does* resolve in the published artifact (CI publishes via `./mvnw deploy -P release`, and `pom.xml`'s maven-jar-plugin sets `addDefaultImplementationEntries=true`, so the JAR manifest carries `Implementation-Version`), but it resolves to `null` under Gradle and in tests, where it silently falls back to a hardcoded literal the generator does not keep current. We keep the explicit literals because they are correct in every context and because `.github/release-please-config.json` already lists this file in `extra-files`, so release-please bumps it alongside `pom.xml`, `build.gradle`, and `.fern/metadata.json`. Fern also emits `User-Agent` with a `com.deepgram.` prefix while leaving `X-Fern-SDK-Name` on the `com.deepgram:` Maven-coordinate form; we keep both on the colon form. Fern 4.22.1 tracks and closes child WebSockets before shutting down SDK-owned OkHttp resources; the permanent custom client wrappers inherit it, so do not add wrapper-local lifecycle code and retain Fern's lifecycle implementation during reconciliation.
- `src/main/java/com/deepgram/core/ReconnectingWebSocketListener.java` - carries bug fixes for `maxRetries(0)` semantics ("connect once, don't retry") and a configurable `connectionTimeoutMs` field (was hardcoded 4000ms), plus an `applyOptionsOverride(...)` hook used by `TransportWebSocketFactory` to apply per-transport reconnect policy; pull this back out once the fixes are upstreamed into the Fern generator. Use the standard `.bak` swap/restore workflow during regen review.
Expand Down
2 changes: 1 addition & 1 deletion examples/agent/ProviderCombinations.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static void main(String[] args) {
// Combination 4: Deepgram Think + Deepgram Speak
System.out.println("=== Combination 4: Deepgram Think + Deepgram ===");
DeepgramThinkProvider deepgramThinkProvider = DeepgramThinkProvider.builder()
.model(DeepgramThinkProviderModel.PHONELLM_MINI_ALPHA_2_FP8)
.model(DeepgramThinkProviderModel.PHONELLM_MINI_ALPHA2FP8)
.reasoningMode(DeepgramThinkProviderReasoningMode.NONE)
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ public CompletableFuture<DeepgramApiHttpResponse<MediaTranscribeResponse>> trans
QueryStringMapper.addQueryParameter(
httpUrl, "redact", request.getRedact().get(), false);
}
if (request.getRedactUsage().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "redact_usage", request.getRedactUsage().get(), false);
}
if (request.getSmartFormat().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "smart_format", request.getSmartFormat().get(), false);
Expand Down Expand Up @@ -409,6 +413,10 @@ public CompletableFuture<DeepgramApiHttpResponse<MediaTranscribeResponse>> trans
QueryStringMapper.addQueryParameter(
httpUrl, "redact", request.getRedact().get(), false);
}
if (request.getRedactUsage().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "redact_usage", request.getRedactUsage().get(), false);
}
if (request.getSmartFormat().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "smart_format", request.getSmartFormat().get(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ public DeepgramApiHttpResponse<MediaTranscribeResponse> transcribeUrl(
QueryStringMapper.addQueryParameter(
httpUrl, "redact", request.getRedact().get(), false);
}
if (request.getRedactUsage().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "redact_usage", request.getRedactUsage().get(), false);
}
if (request.getSmartFormat().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "smart_format", request.getSmartFormat().get(), false);
Expand Down Expand Up @@ -387,6 +391,10 @@ public DeepgramApiHttpResponse<MediaTranscribeResponse> transcribeFile(
QueryStringMapper.addQueryParameter(
httpUrl, "redact", request.getRedact().get(), false);
}
if (request.getRedactUsage().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "redact_usage", request.getRedactUsage().get(), false);
}
if (request.getSmartFormat().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "smart_format", request.getSmartFormat().get(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ public final class ListenV1RequestUrl {

private final Optional<String> redact;

private final Optional<Boolean> redactUsage;

private final Optional<Boolean> smartFormat;

private final Optional<Boolean> utterances;
Expand Down Expand Up @@ -146,6 +148,7 @@ private ListenV1RequestUrl(
Optional<Boolean> profanityFilter,
Optional<Boolean> punctuate,
Optional<String> redact,
Optional<Boolean> redactUsage,
Optional<Boolean> smartFormat,
Optional<Boolean> utterances,
Optional<Double> uttSplit,
Expand Down Expand Up @@ -186,6 +189,7 @@ private ListenV1RequestUrl(
this.profanityFilter = profanityFilter;
this.punctuate = punctuate;
this.redact = redact;
this.redactUsage = redactUsage;
this.smartFormat = smartFormat;
this.utterances = utterances;
this.uttSplit = uttSplit;
Expand Down Expand Up @@ -461,6 +465,14 @@ public Optional<String> getRedact() {
return redact;
}

/**
* @return Replaces the values of user-supplied text parameters (<code>keyterm</code>, <code>keywords</code>, <code>replace</code>, <code>search</code>, <code>extra</code>, <code>custom_topic</code>, and <code>custom_intent</code>) with <code>[REDACTED]</code> in this request's usage records. Does not affect transcription, the response, <code>tag</code>, or <code>callback</code>. Independent of <code>mip_opt_out</code>. https://developers.deepgram.com/docs/redact-usage
*/
@JsonIgnore
public Optional<Boolean> getRedactUsage() {
return redactUsage;
}

/**
* @return Apply formatting to transcript output. When set to true, additional formatting will be applied to transcripts to improve readability
*/
Expand Down Expand Up @@ -551,6 +563,7 @@ private boolean equalTo(ListenV1RequestUrl other) {
&& profanityFilter.equals(other.profanityFilter)
&& punctuate.equals(other.punctuate)
&& redact.equals(other.redact)
&& redactUsage.equals(other.redactUsage)
&& smartFormat.equals(other.smartFormat)
&& utterances.equals(other.utterances)
&& uttSplit.equals(other.uttSplit)
Expand Down Expand Up @@ -595,6 +608,7 @@ public int hashCode() {
this.profanityFilter,
this.punctuate,
this.redact,
this.redactUsage,
this.smartFormat,
this.utterances,
this.uttSplit,
Expand Down Expand Up @@ -882,6 +896,13 @@ default _FinalStage languageHint(String languageHint) {

_FinalStage redact(String redact);

/**
* <p>Replaces the values of user-supplied text parameters (<code>keyterm</code>, <code>keywords</code>, <code>replace</code>, <code>search</code>, <code>extra</code>, <code>custom_topic</code>, and <code>custom_intent</code>) with <code>[REDACTED]</code> in this request's usage records. Does not affect transcription, the response, <code>tag</code>, or <code>callback</code>. Independent of <code>mip_opt_out</code>. https://developers.deepgram.com/docs/redact-usage</p>
*/
_FinalStage redactUsage(Optional<Boolean> redactUsage);

_FinalStage redactUsage(Boolean redactUsage);

/**
* <p>Apply formatting to transcript output. When set to true, additional formatting will be applied to transcripts to improve readability</p>
*/
Expand Down Expand Up @@ -932,6 +953,8 @@ public static final class Builder implements UrlStage, _FinalStage {

private Optional<Boolean> smartFormat = Optional.empty();

private Optional<Boolean> redactUsage = Optional.empty();

private Optional<String> redact = Optional.empty();

private Optional<Boolean> punctuate = Optional.empty();
Expand Down Expand Up @@ -1038,6 +1061,7 @@ public Builder from(ListenV1RequestUrl other) {
profanityFilter(other.getProfanityFilter());
punctuate(other.getPunctuate());
redact(other.getRedact());
redactUsage(other.getRedactUsage());
smartFormat(other.getSmartFormat());
utterances(other.getUtterances());
uttSplit(other.getUttSplit());
Expand Down Expand Up @@ -1154,6 +1178,26 @@ public _FinalStage smartFormat(Optional<Boolean> smartFormat) {
return this;
}

/**
* <p>Replaces the values of user-supplied text parameters (<code>keyterm</code>, <code>keywords</code>, <code>replace</code>, <code>search</code>, <code>extra</code>, <code>custom_topic</code>, and <code>custom_intent</code>) with <code>[REDACTED]</code> in this request's usage records. Does not affect transcription, the response, <code>tag</code>, or <code>callback</code>. Independent of <code>mip_opt_out</code>. https://developers.deepgram.com/docs/redact-usage</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage redactUsage(Boolean redactUsage) {
this.redactUsage = Optional.ofNullable(redactUsage);
return this;
}

/**
* <p>Replaces the values of user-supplied text parameters (<code>keyterm</code>, <code>keywords</code>, <code>replace</code>, <code>search</code>, <code>extra</code>, <code>custom_topic</code>, and <code>custom_intent</code>) with <code>[REDACTED]</code> in this request's usage records. Does not affect transcription, the response, <code>tag</code>, or <code>callback</code>. Independent of <code>mip_opt_out</code>. https://developers.deepgram.com/docs/redact-usage</p>
*/
@java.lang.Override
@JsonSetter(value = "redact_usage", nulls = Nulls.SKIP)
public _FinalStage redactUsage(Optional<Boolean> redactUsage) {
this.redactUsage = redactUsage;
return this;
}

/**
* <p>Redaction removes sensitive information from your transcripts</p>
* @return Reference to {@code this} so that method calls can be chained together.
Expand Down Expand Up @@ -1908,6 +1952,7 @@ public ListenV1RequestUrl build() {
profanityFilter,
punctuate,
redact,
redactUsage,
smartFormat,
utterances,
uttSplit,
Expand Down
Loading
Loading