diff --git a/.fern/metadata.json b/.fern/metadata.json index a700e01..5eded74 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -11,8 +11,8 @@ }, "enable-wire-tests": true }, - "originGitCommit": "d1854cf6d560a0e27c9f46c1d83a6d7d9924f045", + "originGitCommit": "0052a020a7becd03b349857664c9f4a89b6c449a", "originGitCommitIsDirty": true, "invokedBy": "manual", - "sdkVersion": "0.4.0" + "sdkVersion": "0.4.1" } \ No newline at end of file diff --git a/src/main/java/com/deepgram/core/Environment.java b/src/main/java/com/deepgram/core/Environment.java index 681ef6c..ab2a5b6 100644 --- a/src/main/java/com/deepgram/core/Environment.java +++ b/src/main/java/com/deepgram/core/Environment.java @@ -5,35 +5,35 @@ public final class Environment { public static final Environment PRODUCTION = - new Environment("https://api.deepgram.com", "wss://agent.deepgram.com", "wss://api.deepgram.com"); + new Environment("https://api.deepgram.com", "wss://api.deepgram.com", "wss://agent.deepgram.com"); public static final Environment AGENT = - new Environment("https://agent.deepgram.com", "wss://agent.deepgram.com", "wss://api.deepgram.com"); + new Environment("https://agent.deepgram.com", "wss://api.deepgram.com", "wss://agent.deepgram.com"); private final String base; - private final String agent; - private final String production; - Environment(String base, String agent, String production) { + private final String agent; + + Environment(String base, String production, String agent) { this.base = base; - this.agent = agent; this.production = production; + this.agent = agent; } public String getBaseURL() { return this.base; } - public String getAgentURL() { - return this.agent; - } - public String getProductionURL() { return this.production; } + public String getAgentURL() { + return this.agent; + } + public static Builder custom() { return new Builder(); } @@ -41,27 +41,27 @@ public static Builder custom() { public static class Builder { private String base; - private String agent; - private String production; + private String agent; + public Builder base(String base) { this.base = base; return this; } - public Builder agent(String agent) { - this.agent = agent; + public Builder production(String production) { + this.production = production; return this; } - public Builder production(String production) { - this.production = production; + public Builder agent(String agent) { + this.agent = agent; return this; } public Environment build() { - return new Environment(base, agent, production); + return new Environment(base, production, agent); } } } diff --git a/src/main/java/com/deepgram/resources/agent/v1/settings/think/models/AsyncRawModelsClient.java b/src/main/java/com/deepgram/resources/agent/v1/settings/think/models/AsyncRawModelsClient.java index 6b629c5..50769cd 100644 --- a/src/main/java/com/deepgram/resources/agent/v1/settings/think/models/AsyncRawModelsClient.java +++ b/src/main/java/com/deepgram/resources/agent/v1/settings/think/models/AsyncRawModelsClient.java @@ -42,7 +42,7 @@ public CompletableFuture> li * Retrieves the available think models that can be used for AI agent processing */ public CompletableFuture> list(RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getBaseURL()) + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getAgentURL()) .newBuilder() .addPathSegments("v1/agent/settings/think/models"); if (requestOptions != null) { diff --git a/src/main/java/com/deepgram/resources/agent/v1/settings/think/models/RawModelsClient.java b/src/main/java/com/deepgram/resources/agent/v1/settings/think/models/RawModelsClient.java index 7795451..f1f069b 100644 --- a/src/main/java/com/deepgram/resources/agent/v1/settings/think/models/RawModelsClient.java +++ b/src/main/java/com/deepgram/resources/agent/v1/settings/think/models/RawModelsClient.java @@ -38,7 +38,7 @@ public DeepgramApiHttpResponse list() { * Retrieves the available think models that can be used for AI agent processing */ public DeepgramApiHttpResponse list(RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getBaseURL()) + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getAgentURL()) .newBuilder() .addPathSegments("v1/agent/settings/think/models"); if (requestOptions != null) { diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentContextListenProvider.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentContextListenProvider.java index 606be37..eea1585 100644 --- a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentContextListenProvider.java +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentContextListenProvider.java @@ -3,6 +3,8 @@ */ package com.deepgram.resources.agent.v1.types; +import com.deepgram.types.DeepgramListenProviderV1; +import com.deepgram.types.DeepgramListenProviderV2; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; @@ -26,11 +28,11 @@ public T visit(Visitor visitor) { return value.visit(visitor); } - public static AgentV1SettingsAgentContextListenProvider v1(AgentV1SettingsAgentContextListenProviderV1 value) { + public static AgentV1SettingsAgentContextListenProvider v1(DeepgramListenProviderV1 value) { return new AgentV1SettingsAgentContextListenProvider(new V1Value(value)); } - public static AgentV1SettingsAgentContextListenProvider v2(AgentV1SettingsAgentContextListenProviderV2 value) { + public static AgentV1SettingsAgentContextListenProvider v2(DeepgramListenProviderV2 value) { return new AgentV1SettingsAgentContextListenProvider(new V2Value(value)); } @@ -46,14 +48,14 @@ public boolean _isUnknown() { return value instanceof _UnknownValue; } - public Optional getV1() { + public Optional getV1() { if (isV1()) { return Optional.of(((V1Value) value).value); } return Optional.empty(); } - public Optional getV2() { + public Optional getV2() { if (isV2()) { return Optional.of(((V2Value) value).value); } @@ -90,9 +92,9 @@ private Value getValue() { } public interface Visitor { - T visitV1(AgentV1SettingsAgentContextListenProviderV1 v1); + T visitV1(DeepgramListenProviderV1 v1); - T visitV2(AgentV1SettingsAgentContextListenProviderV2 v2); + T visitV2(DeepgramListenProviderV2 v2); T _visitUnknown(Object unknownType); } @@ -109,12 +111,12 @@ private interface Value { private static final class V1Value implements Value { @JsonUnwrapped @JsonIgnoreProperties(value = "version", allowSetters = true) - private AgentV1SettingsAgentContextListenProviderV1 value; + private DeepgramListenProviderV1 value; @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) private V1Value() {} - private V1Value(AgentV1SettingsAgentContextListenProviderV1 value) { + private V1Value(DeepgramListenProviderV1 value) { this.value = value; } @@ -149,12 +151,12 @@ public String toString() { private static final class V2Value implements Value { @JsonUnwrapped @JsonIgnoreProperties(value = "version", allowSetters = true) - private AgentV1SettingsAgentContextListenProviderV2 value; + private DeepgramListenProviderV2 value; @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) private V2Value() {} - private V2Value(AgentV1SettingsAgentContextListenProviderV2 value) { + private V2Value(DeepgramListenProviderV2 value) { this.value = value; } diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentListenProvider.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentListenProvider.java index dd0810b..4309ec0 100644 --- a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentListenProvider.java +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentListenProvider.java @@ -3,6 +3,8 @@ */ package com.deepgram.resources.agent.v1.types; +import com.deepgram.types.DeepgramListenProviderV1; +import com.deepgram.types.DeepgramListenProviderV2; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; @@ -26,11 +28,11 @@ public T visit(Visitor visitor) { return value.visit(visitor); } - public static AgentV1SettingsAgentListenProvider v1(AgentV1SettingsAgentListenProviderV1 value) { + public static AgentV1SettingsAgentListenProvider v1(DeepgramListenProviderV1 value) { return new AgentV1SettingsAgentListenProvider(new V1Value(value)); } - public static AgentV1SettingsAgentListenProvider v2(AgentV1SettingsAgentListenProviderV2 value) { + public static AgentV1SettingsAgentListenProvider v2(DeepgramListenProviderV2 value) { return new AgentV1SettingsAgentListenProvider(new V2Value(value)); } @@ -46,14 +48,14 @@ public boolean _isUnknown() { return value instanceof _UnknownValue; } - public Optional getV1() { + public Optional getV1() { if (isV1()) { return Optional.of(((V1Value) value).value); } return Optional.empty(); } - public Optional getV2() { + public Optional getV2() { if (isV2()) { return Optional.of(((V2Value) value).value); } @@ -90,9 +92,9 @@ private Value getValue() { } public interface Visitor { - T visitV1(AgentV1SettingsAgentListenProviderV1 v1); + T visitV1(DeepgramListenProviderV1 v1); - T visitV2(AgentV1SettingsAgentListenProviderV2 v2); + T visitV2(DeepgramListenProviderV2 v2); T _visitUnknown(Object unknownType); } @@ -109,12 +111,12 @@ private interface Value { private static final class V1Value implements Value { @JsonUnwrapped @JsonIgnoreProperties(value = "version", allowSetters = true) - private AgentV1SettingsAgentListenProviderV1 value; + private DeepgramListenProviderV1 value; @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) private V1Value() {} - private V1Value(AgentV1SettingsAgentListenProviderV1 value) { + private V1Value(DeepgramListenProviderV1 value) { this.value = value; } @@ -149,12 +151,12 @@ public String toString() { private static final class V2Value implements Value { @JsonUnwrapped @JsonIgnoreProperties(value = "version", allowSetters = true) - private AgentV1SettingsAgentListenProviderV2 value; + private DeepgramListenProviderV2 value; @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) private V2Value() {} - private V2Value(AgentV1SettingsAgentListenProviderV2 value) { + private V2Value(DeepgramListenProviderV2 value) { this.value = value; } diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentListenProviderV1.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentListenProviderV1.java deleted file mode 100644 index 4d94cc0..0000000 --- a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentListenProviderV1.java +++ /dev/null @@ -1,214 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.deepgram.resources.agent.v1.types; - -import com.deepgram.core.ObjectMappers; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -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; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AgentV1SettingsAgentListenProviderV1.Builder.class) -public final class AgentV1SettingsAgentListenProviderV1 { - private final Optional model; - - private final Optional language; - - private final Optional> keyterms; - - private final Optional smartFormat; - - private final Map additionalProperties; - - private AgentV1SettingsAgentListenProviderV1( - Optional model, - Optional language, - Optional> keyterms, - Optional smartFormat, - Map additionalProperties) { - this.model = model; - this.language = language; - this.keyterms = keyterms; - this.smartFormat = smartFormat; - this.additionalProperties = additionalProperties; - } - - /** - * @return Provider type for speech-to-text - */ - @JsonProperty("type") - public String getType() { - return "deepgram"; - } - - /** - * @return Model to use for speech to text using the V1 API (e.g. Nova-3, Nova-2) - */ - @JsonProperty("model") - public Optional getModel() { - return model; - } - - /** - * @return Language code to use for speech-to-text. Can be a BCP-47 language tag (e.g. en), or multi for code-switching transcription - */ - @JsonProperty("language") - public Optional getLanguage() { - return language; - } - - /** - * @return Prompt keyterm recognition to improve Keyword Recall Rate - */ - @JsonProperty("keyterms") - public Optional> getKeyterms() { - return keyterms; - } - - /** - * @return Applies smart formatting to improve transcript readability - */ - @JsonProperty("smart_format") - public Optional getSmartFormat() { - return smartFormat; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AgentV1SettingsAgentListenProviderV1 - && equalTo((AgentV1SettingsAgentListenProviderV1) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AgentV1SettingsAgentListenProviderV1 other) { - return model.equals(other.model) - && language.equals(other.language) - && keyterms.equals(other.keyterms) - && smartFormat.equals(other.smartFormat); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.model, this.language, this.keyterms, this.smartFormat); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional model = Optional.empty(); - - private Optional language = Optional.empty(); - - private Optional> keyterms = Optional.empty(); - - private Optional smartFormat = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AgentV1SettingsAgentListenProviderV1 other) { - model(other.getModel()); - language(other.getLanguage()); - keyterms(other.getKeyterms()); - smartFormat(other.getSmartFormat()); - return this; - } - - /** - *

Model to use for speech to text using the V1 API (e.g. Nova-3, Nova-2)

- */ - @JsonSetter(value = "model", nulls = Nulls.SKIP) - public Builder model(Optional model) { - this.model = model; - return this; - } - - public Builder model(String model) { - this.model = Optional.ofNullable(model); - return this; - } - - /** - *

Language code to use for speech-to-text. Can be a BCP-47 language tag (e.g. en), or multi for code-switching transcription

- */ - @JsonSetter(value = "language", nulls = Nulls.SKIP) - public Builder language(Optional language) { - this.language = language; - return this; - } - - public Builder language(String language) { - this.language = Optional.ofNullable(language); - return this; - } - - /** - *

Prompt keyterm recognition to improve Keyword Recall Rate

- */ - @JsonSetter(value = "keyterms", nulls = Nulls.SKIP) - public Builder keyterms(Optional> keyterms) { - this.keyterms = keyterms; - return this; - } - - public Builder keyterms(List keyterms) { - this.keyterms = Optional.ofNullable(keyterms); - return this; - } - - /** - *

Applies smart formatting to improve transcript readability

- */ - @JsonSetter(value = "smart_format", nulls = Nulls.SKIP) - public Builder smartFormat(Optional smartFormat) { - this.smartFormat = smartFormat; - return this; - } - - public Builder smartFormat(Boolean smartFormat) { - this.smartFormat = Optional.ofNullable(smartFormat); - return this; - } - - public AgentV1SettingsAgentListenProviderV1 build() { - return new AgentV1SettingsAgentListenProviderV1( - model, language, keyterms, smartFormat, additionalProperties); - } - - public Builder additionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - return this; - } - - public Builder additionalProperties(Map additionalProperties) { - this.additionalProperties.putAll(additionalProperties); - return this; - } - } -} diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentListenProviderV2.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentListenProviderV2.java deleted file mode 100644 index 90debd3..0000000 --- a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentListenProviderV2.java +++ /dev/null @@ -1,183 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.deepgram.resources.agent.v1.types; - -import com.deepgram.core.ObjectMappers; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -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) -@JsonDeserialize(builder = AgentV1SettingsAgentListenProviderV2.Builder.class) -public final class AgentV1SettingsAgentListenProviderV2 { - private final String model; - - private final Optional> keyterms; - - private final Map additionalProperties; - - private AgentV1SettingsAgentListenProviderV2( - String model, Optional> keyterms, Map additionalProperties) { - this.model = model; - this.keyterms = keyterms; - this.additionalProperties = additionalProperties; - } - - /** - * @return Provider type for speech-to-text - */ - @JsonProperty("type") - public String getType() { - return "deepgram"; - } - - /** - * @return Model to use for speech to text using the V2 API (e.g. flux-general-en) - */ - @JsonProperty("model") - public String getModel() { - return model; - } - - /** - * @return Prompt keyterm recognition to improve Keyword Recall Rate - */ - @JsonProperty("keyterms") - public Optional> getKeyterms() { - return keyterms; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AgentV1SettingsAgentListenProviderV2 - && equalTo((AgentV1SettingsAgentListenProviderV2) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AgentV1SettingsAgentListenProviderV2 other) { - return model.equals(other.model) && keyterms.equals(other.keyterms); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.model, this.keyterms); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ModelStage builder() { - return new Builder(); - } - - public interface ModelStage { - /** - *

Model to use for speech to text using the V2 API (e.g. flux-general-en)

- */ - _FinalStage model(@NotNull String model); - - Builder from(AgentV1SettingsAgentListenProviderV2 other); - } - - public interface _FinalStage { - AgentV1SettingsAgentListenProviderV2 build(); - - _FinalStage additionalProperty(String key, Object value); - - _FinalStage additionalProperties(Map additionalProperties); - - /** - *

Prompt keyterm recognition to improve Keyword Recall Rate

- */ - _FinalStage keyterms(Optional> keyterms); - - _FinalStage keyterms(List keyterms); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ModelStage, _FinalStage { - private String model; - - private Optional> keyterms = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AgentV1SettingsAgentListenProviderV2 other) { - model(other.getModel()); - keyterms(other.getKeyterms()); - return this; - } - - /** - *

Model to use for speech to text using the V2 API (e.g. flux-general-en)

- *

Model to use for speech to text using the V2 API (e.g. flux-general-en)

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("model") - public _FinalStage model(@NotNull String model) { - this.model = Objects.requireNonNull(model, "model must not be null"); - return this; - } - - /** - *

Prompt keyterm recognition to improve Keyword Recall Rate

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage keyterms(List keyterms) { - this.keyterms = Optional.ofNullable(keyterms); - return this; - } - - /** - *

Prompt keyterm recognition to improve Keyword Recall Rate

- */ - @java.lang.Override - @JsonSetter(value = "keyterms", nulls = Nulls.SKIP) - public _FinalStage keyterms(Optional> keyterms) { - this.keyterms = keyterms; - return this; - } - - @java.lang.Override - public AgentV1SettingsAgentListenProviderV2 build() { - return new AgentV1SettingsAgentListenProviderV2(model, keyterms, additionalProperties); - } - - @java.lang.Override - public Builder additionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - return this; - } - - @java.lang.Override - public Builder additionalProperties(Map additionalProperties) { - this.additionalProperties.putAll(additionalProperties); - return this; - } - } -} diff --git a/src/main/java/com/deepgram/resources/listen/v1/media/AsyncRawMediaClient.java b/src/main/java/com/deepgram/resources/listen/v1/media/AsyncRawMediaClient.java index 5bdd368..a186d87 100644 --- a/src/main/java/com/deepgram/resources/listen/v1/media/AsyncRawMediaClient.java +++ b/src/main/java/com/deepgram/resources/listen/v1/media/AsyncRawMediaClient.java @@ -99,6 +99,10 @@ public CompletableFuture> trans QueryStringMapper.addQueryParameter( httpUrl, "diarize", request.getDiarize().get(), false); } + if (request.getDiarizeModel().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "diarize_model", request.getDiarizeModel().get(), false); + } if (request.getDictation().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "dictation", request.getDictation().get(), false); @@ -336,6 +340,10 @@ public CompletableFuture> trans QueryStringMapper.addQueryParameter( httpUrl, "diarize", request.getDiarize().get(), false); } + if (request.getDiarizeModel().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "diarize_model", request.getDiarizeModel().get(), false); + } if (request.getDictation().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "dictation", request.getDictation().get(), false); diff --git a/src/main/java/com/deepgram/resources/listen/v1/media/RawMediaClient.java b/src/main/java/com/deepgram/resources/listen/v1/media/RawMediaClient.java index 7dbd0fb..f263224 100644 --- a/src/main/java/com/deepgram/resources/listen/v1/media/RawMediaClient.java +++ b/src/main/java/com/deepgram/resources/listen/v1/media/RawMediaClient.java @@ -94,6 +94,10 @@ public DeepgramApiHttpResponse transcribeUrl( QueryStringMapper.addQueryParameter( httpUrl, "diarize", request.getDiarize().get(), false); } + if (request.getDiarizeModel().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "diarize_model", request.getDiarizeModel().get(), false); + } if (request.getDictation().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "dictation", request.getDictation().get(), false); @@ -315,6 +319,10 @@ public DeepgramApiHttpResponse transcribeFile( QueryStringMapper.addQueryParameter( httpUrl, "diarize", request.getDiarize().get(), false); } + if (request.getDiarizeModel().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "diarize_model", request.getDiarizeModel().get(), false); + } if (request.getDictation().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "dictation", request.getDictation().get(), false); diff --git a/src/main/java/com/deepgram/resources/listen/v1/media/requests/ListenV1RequestUrl.java b/src/main/java/com/deepgram/resources/listen/v1/media/requests/ListenV1RequestUrl.java index 52388cf..d59ed17 100644 --- a/src/main/java/com/deepgram/resources/listen/v1/media/requests/ListenV1RequestUrl.java +++ b/src/main/java/com/deepgram/resources/listen/v1/media/requests/ListenV1RequestUrl.java @@ -7,6 +7,7 @@ import com.deepgram.resources.listen.v1.media.types.MediaTranscribeRequestCallbackMethod; import com.deepgram.resources.listen.v1.media.types.MediaTranscribeRequestCustomIntentMode; import com.deepgram.resources.listen.v1.media.types.MediaTranscribeRequestCustomTopicMode; +import com.deepgram.resources.listen.v1.media.types.MediaTranscribeRequestDiarizeModel; import com.deepgram.resources.listen.v1.media.types.MediaTranscribeRequestEncoding; import com.deepgram.resources.listen.v1.media.types.MediaTranscribeRequestModel; import com.deepgram.resources.listen.v1.media.types.MediaTranscribeRequestSummarize; @@ -69,6 +70,8 @@ public final class ListenV1RequestUrl { private final Optional diarize; + private final Optional diarizeModel; + private final Optional dictation; private final Optional encoding; @@ -127,6 +130,7 @@ private ListenV1RequestUrl( Optional detectEntities, Optional detectLanguage, Optional diarize, + Optional diarizeModel, Optional dictation, Optional encoding, Optional fillerWords, @@ -165,6 +169,7 @@ private ListenV1RequestUrl( this.detectEntities = detectEntities; this.detectLanguage = detectLanguage; this.diarize = diarize; + this.diarizeModel = diarizeModel; this.dictation = dictation; this.encoding = encoding; this.fillerWords = fillerWords; @@ -338,6 +343,14 @@ public Optional getDiarize() { return diarize; } + /** + * @return Select and enable a specific batch diarization model version. If specifying this parameter, you should not set the deprecated diarize=true parameter. Not accepted on streaming requests. + */ + @JsonIgnore + public Optional getDiarizeModel() { + return diarizeModel; + } + /** * @return Dictation mode for controlling formatting with dictated speech */ @@ -510,6 +523,7 @@ private boolean equalTo(ListenV1RequestUrl other) { && detectEntities.equals(other.detectEntities) && detectLanguage.equals(other.detectLanguage) && diarize.equals(other.diarize) + && diarizeModel.equals(other.diarizeModel) && dictation.equals(other.dictation) && encoding.equals(other.encoding) && fillerWords.equals(other.fillerWords) @@ -552,6 +566,7 @@ public int hashCode() { this.detectEntities, this.detectLanguage, this.diarize, + this.diarizeModel, this.dictation, this.encoding, this.fillerWords, @@ -743,6 +758,13 @@ public interface _FinalStage { _FinalStage diarize(Boolean diarize); + /** + *

Select and enable a specific batch diarization model version. If specifying this parameter, you should not set the deprecated diarize=true parameter. Not accepted on streaming requests.

+ */ + _FinalStage diarizeModel(Optional diarizeModel); + + _FinalStage diarizeModel(MediaTranscribeRequestDiarizeModel diarizeModel); + /** *

Dictation mode for controlling formatting with dictated speech

*/ @@ -901,6 +923,8 @@ public static final class Builder implements UrlStage, _FinalStage { private Optional dictation = Optional.empty(); + private Optional diarizeModel = Optional.empty(); + private Optional diarize = Optional.empty(); private Optional detectLanguage = Optional.empty(); @@ -965,6 +989,7 @@ public Builder from(ListenV1RequestUrl other) { detectEntities(other.getDetectEntities()); detectLanguage(other.getDetectLanguage()); diarize(other.getDiarize()); + diarizeModel(other.getDiarizeModel()); dictation(other.getDictation()); encoding(other.getEncoding()); fillerWords(other.getFillerWords()); @@ -1333,6 +1358,26 @@ public _FinalStage dictation(Optional dictation) { return this; } + /** + *

Select and enable a specific batch diarization model version. If specifying this parameter, you should not set the deprecated diarize=true parameter. Not accepted on streaming requests.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage diarizeModel(MediaTranscribeRequestDiarizeModel diarizeModel) { + this.diarizeModel = Optional.ofNullable(diarizeModel); + return this; + } + + /** + *

Select and enable a specific batch diarization model version. If specifying this parameter, you should not set the deprecated diarize=true parameter. Not accepted on streaming requests.

+ */ + @java.lang.Override + @JsonSetter(value = "diarize_model", nulls = Nulls.SKIP) + public _FinalStage diarizeModel(Optional diarizeModel) { + this.diarizeModel = diarizeModel; + return this; + } + /** *

Recognize speaker changes. Each word in the transcript will be assigned a speaker number starting at 0

* @return Reference to {@code this} so that method calls can be chained together. @@ -1783,6 +1828,7 @@ public ListenV1RequestUrl build() { detectEntities, detectLanguage, diarize, + diarizeModel, dictation, encoding, fillerWords, diff --git a/src/main/java/com/deepgram/resources/listen/v1/media/requests/MediaTranscribeRequestOctetStream.java b/src/main/java/com/deepgram/resources/listen/v1/media/requests/MediaTranscribeRequestOctetStream.java index df4b6bb..078a697 100644 --- a/src/main/java/com/deepgram/resources/listen/v1/media/requests/MediaTranscribeRequestOctetStream.java +++ b/src/main/java/com/deepgram/resources/listen/v1/media/requests/MediaTranscribeRequestOctetStream.java @@ -7,6 +7,7 @@ import com.deepgram.resources.listen.v1.media.types.MediaTranscribeRequestCallbackMethod; import com.deepgram.resources.listen.v1.media.types.MediaTranscribeRequestCustomIntentMode; import com.deepgram.resources.listen.v1.media.types.MediaTranscribeRequestCustomTopicMode; +import com.deepgram.resources.listen.v1.media.types.MediaTranscribeRequestDiarizeModel; import com.deepgram.resources.listen.v1.media.types.MediaTranscribeRequestEncoding; import com.deepgram.resources.listen.v1.media.types.MediaTranscribeRequestModel; import com.deepgram.resources.listen.v1.media.types.MediaTranscribeRequestSummarize; @@ -69,6 +70,8 @@ public final class MediaTranscribeRequestOctetStream { private final Optional diarize; + private final Optional diarizeModel; + private final Optional dictation; private final Optional encoding; @@ -127,6 +130,7 @@ private MediaTranscribeRequestOctetStream( Optional detectEntities, Optional detectLanguage, Optional diarize, + Optional diarizeModel, Optional dictation, Optional encoding, Optional fillerWords, @@ -165,6 +169,7 @@ private MediaTranscribeRequestOctetStream( this.detectEntities = detectEntities; this.detectLanguage = detectLanguage; this.diarize = diarize; + this.diarizeModel = diarizeModel; this.dictation = dictation; this.encoding = encoding; this.fillerWords = fillerWords; @@ -338,6 +343,14 @@ public Optional getDiarize() { return diarize; } + /** + * @return Select and enable a specific batch diarization model version. If specifying this parameter, you should not set the deprecated diarize=true parameter. Not accepted on streaming requests. + */ + @JsonIgnore + public Optional getDiarizeModel() { + return diarizeModel; + } + /** * @return Dictation mode for controlling formatting with dictated speech */ @@ -510,6 +523,7 @@ private boolean equalTo(MediaTranscribeRequestOctetStream other) { && detectEntities.equals(other.detectEntities) && detectLanguage.equals(other.detectLanguage) && diarize.equals(other.diarize) + && diarizeModel.equals(other.diarizeModel) && dictation.equals(other.dictation) && encoding.equals(other.encoding) && fillerWords.equals(other.fillerWords) @@ -552,6 +566,7 @@ public int hashCode() { this.detectEntities, this.detectLanguage, this.diarize, + this.diarizeModel, this.dictation, this.encoding, this.fillerWords, @@ -743,6 +758,13 @@ public interface _FinalStage { _FinalStage diarize(Boolean diarize); + /** + *

Select and enable a specific batch diarization model version. If specifying this parameter, you should not set the deprecated diarize=true parameter. Not accepted on streaming requests.

+ */ + _FinalStage diarizeModel(Optional diarizeModel); + + _FinalStage diarizeModel(MediaTranscribeRequestDiarizeModel diarizeModel); + /** *

Dictation mode for controlling formatting with dictated speech

*/ @@ -901,6 +923,8 @@ public static final class Builder implements BodyStage, _FinalStage { private Optional dictation = Optional.empty(); + private Optional diarizeModel = Optional.empty(); + private Optional diarize = Optional.empty(); private Optional detectLanguage = Optional.empty(); @@ -965,6 +989,7 @@ public Builder from(MediaTranscribeRequestOctetStream other) { detectEntities(other.getDetectEntities()); detectLanguage(other.getDetectLanguage()); diarize(other.getDiarize()); + diarizeModel(other.getDiarizeModel()); dictation(other.getDictation()); encoding(other.getEncoding()); fillerWords(other.getFillerWords()); @@ -1333,6 +1358,26 @@ public _FinalStage dictation(Optional dictation) { return this; } + /** + *

Select and enable a specific batch diarization model version. If specifying this parameter, you should not set the deprecated diarize=true parameter. Not accepted on streaming requests.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage diarizeModel(MediaTranscribeRequestDiarizeModel diarizeModel) { + this.diarizeModel = Optional.ofNullable(diarizeModel); + return this; + } + + /** + *

Select and enable a specific batch diarization model version. If specifying this parameter, you should not set the deprecated diarize=true parameter. Not accepted on streaming requests.

+ */ + @java.lang.Override + @JsonSetter(value = "diarize_model", nulls = Nulls.SKIP) + public _FinalStage diarizeModel(Optional diarizeModel) { + this.diarizeModel = diarizeModel; + return this; + } + /** *

Recognize speaker changes. Each word in the transcript will be assigned a speaker number starting at 0

* @return Reference to {@code this} so that method calls can be chained together. @@ -1783,6 +1828,7 @@ public MediaTranscribeRequestOctetStream build() { detectEntities, detectLanguage, diarize, + diarizeModel, dictation, encoding, fillerWords, diff --git a/src/main/java/com/deepgram/resources/listen/v1/media/types/MediaTranscribeRequestDiarizeModel.java b/src/main/java/com/deepgram/resources/listen/v1/media/types/MediaTranscribeRequestDiarizeModel.java new file mode 100644 index 0000000..e2cd42f --- /dev/null +++ b/src/main/java/com/deepgram/resources/listen/v1/media/types/MediaTranscribeRequestDiarizeModel.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.deepgram.resources.listen.v1.media.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class MediaTranscribeRequestDiarizeModel { + public static final MediaTranscribeRequestDiarizeModel V2 = new MediaTranscribeRequestDiarizeModel(Value.V2, "v2"); + + public static final MediaTranscribeRequestDiarizeModel V1 = new MediaTranscribeRequestDiarizeModel(Value.V1, "v1"); + + public static final MediaTranscribeRequestDiarizeModel LATEST = + new MediaTranscribeRequestDiarizeModel(Value.LATEST, "latest"); + + private final Value value; + + private final String string; + + MediaTranscribeRequestDiarizeModel(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof MediaTranscribeRequestDiarizeModel + && this.string.equals(((MediaTranscribeRequestDiarizeModel) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case V2: + return visitor.visitV2(); + case V1: + return visitor.visitV1(); + case LATEST: + return visitor.visitLatest(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static MediaTranscribeRequestDiarizeModel valueOf(String value) { + switch (value) { + case "v2": + return V2; + case "v1": + return V1; + case "latest": + return LATEST; + default: + return new MediaTranscribeRequestDiarizeModel(Value.UNKNOWN, value); + } + } + + public enum Value { + LATEST, + + V1, + + V2, + + UNKNOWN + } + + public interface Visitor { + T visitLatest(); + + T visitV1(); + + T visitV2(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentContextListenProviderV1.java b/src/main/java/com/deepgram/types/DeepgramListenProviderV1.java similarity index 79% rename from src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentContextListenProviderV1.java rename to src/main/java/com/deepgram/types/DeepgramListenProviderV1.java index 55c5633..925c3ac 100644 --- a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentContextListenProviderV1.java +++ b/src/main/java/com/deepgram/types/DeepgramListenProviderV1.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.deepgram.resources.agent.v1.types; +package com.deepgram.types; import com.deepgram.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -19,8 +19,10 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AgentV1SettingsAgentContextListenProviderV1.Builder.class) -public final class AgentV1SettingsAgentContextListenProviderV1 { +@JsonDeserialize(builder = DeepgramListenProviderV1.Builder.class) +public final class DeepgramListenProviderV1 { + private final Optional version; + private final Optional model; private final Optional language; @@ -31,12 +33,14 @@ public final class AgentV1SettingsAgentContextListenProviderV1 { private final Map additionalProperties; - private AgentV1SettingsAgentContextListenProviderV1( + private DeepgramListenProviderV1( + Optional version, Optional model, Optional language, Optional> keyterms, Optional smartFormat, Map additionalProperties) { + this.version = version; this.model = model; this.language = language; this.keyterms = keyterms; @@ -52,6 +56,14 @@ public String getType() { return "deepgram"; } + /** + * @return Specifies usage of the V1 Deepgram speech-to-text API + */ + @JsonProperty("version") + public Optional getVersion() { + return version; + } + /** * @return Model to use for speech to text using the V1 API (e.g. Nova-3, Nova-2) */ @@ -87,8 +99,7 @@ public Optional getSmartFormat() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof AgentV1SettingsAgentContextListenProviderV1 - && equalTo((AgentV1SettingsAgentContextListenProviderV1) other); + return other instanceof DeepgramListenProviderV1 && equalTo((DeepgramListenProviderV1) other); } @JsonAnyGetter @@ -96,8 +107,9 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(AgentV1SettingsAgentContextListenProviderV1 other) { - return model.equals(other.model) + private boolean equalTo(DeepgramListenProviderV1 other) { + return version.equals(other.version) + && model.equals(other.model) && language.equals(other.language) && keyterms.equals(other.keyterms) && smartFormat.equals(other.smartFormat); @@ -105,7 +117,7 @@ private boolean equalTo(AgentV1SettingsAgentContextListenProviderV1 other) { @java.lang.Override public int hashCode() { - return Objects.hash(this.model, this.language, this.keyterms, this.smartFormat); + return Objects.hash(this.version, this.model, this.language, this.keyterms, this.smartFormat); } @java.lang.Override @@ -119,6 +131,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional version = Optional.empty(); + private Optional model = Optional.empty(); private Optional language = Optional.empty(); @@ -132,7 +146,8 @@ public static final class Builder { private Builder() {} - public Builder from(AgentV1SettingsAgentContextListenProviderV1 other) { + public Builder from(DeepgramListenProviderV1 other) { + version(other.getVersion()); model(other.getModel()); language(other.getLanguage()); keyterms(other.getKeyterms()); @@ -140,6 +155,20 @@ public Builder from(AgentV1SettingsAgentContextListenProviderV1 other) { return this; } + /** + *

Specifies usage of the V1 Deepgram speech-to-text API

+ */ + @JsonSetter(value = "version", nulls = Nulls.SKIP) + public Builder version(Optional version) { + this.version = version; + return this; + } + + public Builder version(String version) { + this.version = Optional.ofNullable(version); + return this; + } + /** *

Model to use for speech to text using the V1 API (e.g. Nova-3, Nova-2)

*/ @@ -196,9 +225,8 @@ public Builder smartFormat(Boolean smartFormat) { return this; } - public AgentV1SettingsAgentContextListenProviderV1 build() { - return new AgentV1SettingsAgentContextListenProviderV1( - model, language, keyterms, smartFormat, additionalProperties); + public DeepgramListenProviderV1 build() { + return new DeepgramListenProviderV1(version, model, language, keyterms, smartFormat, additionalProperties); } public Builder additionalProperty(String key, Object value) { diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentContextListenProviderV2.java b/src/main/java/com/deepgram/types/DeepgramListenProviderV2.java similarity index 69% rename from src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentContextListenProviderV2.java rename to src/main/java/com/deepgram/types/DeepgramListenProviderV2.java index e6f0a07..7f76b77 100644 --- a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentContextListenProviderV2.java +++ b/src/main/java/com/deepgram/types/DeepgramListenProviderV2.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.deepgram.resources.agent.v1.types; +package com.deepgram.types; import com.deepgram.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -20,21 +20,25 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AgentV1SettingsAgentContextListenProviderV2.Builder.class) -public final class AgentV1SettingsAgentContextListenProviderV2 { +@JsonDeserialize(builder = DeepgramListenProviderV2.Builder.class) +public final class DeepgramListenProviderV2 { + private final Optional version; + private final String model; - private final Optional languageHint; + private final Optional languageHint; private final Optional> keyterms; private final Map additionalProperties; - private AgentV1SettingsAgentContextListenProviderV2( + private DeepgramListenProviderV2( + Optional version, String model, - Optional languageHint, + Optional languageHint, Optional> keyterms, Map additionalProperties) { + this.version = version; this.model = model; this.languageHint = languageHint; this.keyterms = keyterms; @@ -49,6 +53,14 @@ public String getType() { return "deepgram"; } + /** + * @return Specifies usage of the V2 Deepgram speech-to-text API (e.g. Flux) + */ + @JsonProperty("version") + public Optional getVersion() { + return version; + } + /** * @return Model to use for speech to text using the V2 API (e.g. flux-general-en, flux-general-multi) */ @@ -61,7 +73,7 @@ public String getModel() { * @return One or more BCP-47 language codes to bias the model toward specific languages. Only supported when model is flux-general-multi. Without hints, the model auto-detects the spoken language. See the Language Prompting guide for details. */ @JsonProperty("language_hint") - public Optional getLanguageHint() { + public Optional getLanguageHint() { return languageHint; } @@ -76,8 +88,7 @@ public Optional> getKeyterms() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof AgentV1SettingsAgentContextListenProviderV2 - && equalTo((AgentV1SettingsAgentContextListenProviderV2) other); + return other instanceof DeepgramListenProviderV2 && equalTo((DeepgramListenProviderV2) other); } @JsonAnyGetter @@ -85,13 +96,16 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(AgentV1SettingsAgentContextListenProviderV2 other) { - return model.equals(other.model) && languageHint.equals(other.languageHint) && keyterms.equals(other.keyterms); + private boolean equalTo(DeepgramListenProviderV2 other) { + return version.equals(other.version) + && model.equals(other.model) + && languageHint.equals(other.languageHint) + && keyterms.equals(other.keyterms); } @java.lang.Override public int hashCode() { - return Objects.hash(this.model, this.languageHint, this.keyterms); + return Objects.hash(this.version, this.model, this.languageHint, this.keyterms); } @java.lang.Override @@ -109,22 +123,29 @@ public interface ModelStage { */ _FinalStage model(@NotNull String model); - Builder from(AgentV1SettingsAgentContextListenProviderV2 other); + Builder from(DeepgramListenProviderV2 other); } public interface _FinalStage { - AgentV1SettingsAgentContextListenProviderV2 build(); + DeepgramListenProviderV2 build(); _FinalStage additionalProperty(String key, Object value); _FinalStage additionalProperties(Map additionalProperties); + /** + *

Specifies usage of the V2 Deepgram speech-to-text API (e.g. Flux)

+ */ + _FinalStage version(Optional version); + + _FinalStage version(String version); + /** *

One or more BCP-47 language codes to bias the model toward specific languages. Only supported when model is flux-general-multi. Without hints, the model auto-detects the spoken language. See the Language Prompting guide for details.

*/ - _FinalStage languageHint(Optional languageHint); + _FinalStage languageHint(Optional languageHint); - _FinalStage languageHint(AgentV1SettingsAgentContextListenProviderV2LanguageHint languageHint); + _FinalStage languageHint(DeepgramListenProviderV2LanguageHint languageHint); /** *

Prompt keyterm recognition to improve Keyword Recall Rate

@@ -140,7 +161,9 @@ public static final class Builder implements ModelStage, _FinalStage { private Optional> keyterms = Optional.empty(); - private Optional languageHint = Optional.empty(); + private Optional languageHint = Optional.empty(); + + private Optional version = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -148,7 +171,8 @@ public static final class Builder implements ModelStage, _FinalStage { private Builder() {} @java.lang.Override - public Builder from(AgentV1SettingsAgentContextListenProviderV2 other) { + public Builder from(DeepgramListenProviderV2 other) { + version(other.getVersion()); model(other.getModel()); languageHint(other.getLanguageHint()); keyterms(other.getKeyterms()); @@ -192,7 +216,7 @@ public _FinalStage keyterms(Optional> keyterms) { * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage languageHint(AgentV1SettingsAgentContextListenProviderV2LanguageHint languageHint) { + public _FinalStage languageHint(DeepgramListenProviderV2LanguageHint languageHint) { this.languageHint = Optional.ofNullable(languageHint); return this; } @@ -202,15 +226,34 @@ public _FinalStage languageHint(AgentV1SettingsAgentContextListenProviderV2Langu */ @java.lang.Override @JsonSetter(value = "language_hint", nulls = Nulls.SKIP) - public _FinalStage languageHint( - Optional languageHint) { + public _FinalStage languageHint(Optional languageHint) { this.languageHint = languageHint; return this; } + /** + *

Specifies usage of the V2 Deepgram speech-to-text API (e.g. Flux)

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage version(String version) { + this.version = Optional.ofNullable(version); + return this; + } + + /** + *

Specifies usage of the V2 Deepgram speech-to-text API (e.g. Flux)

+ */ + @java.lang.Override + @JsonSetter(value = "version", nulls = Nulls.SKIP) + public _FinalStage version(Optional version) { + this.version = version; + return this; + } + @java.lang.Override - public AgentV1SettingsAgentContextListenProviderV2 build() { - return new AgentV1SettingsAgentContextListenProviderV2(model, languageHint, keyterms, additionalProperties); + public DeepgramListenProviderV2 build() { + return new DeepgramListenProviderV2(version, model, languageHint, keyterms, additionalProperties); } @java.lang.Override diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentContextListenProviderV2LanguageHint.java b/src/main/java/com/deepgram/types/DeepgramListenProviderV2LanguageHint.java similarity index 62% rename from src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentContextListenProviderV2LanguageHint.java rename to src/main/java/com/deepgram/types/DeepgramListenProviderV2LanguageHint.java index abcf8bb..cc07718 100644 --- a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1SettingsAgentContextListenProviderV2LanguageHint.java +++ b/src/main/java/com/deepgram/types/DeepgramListenProviderV2LanguageHint.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.deepgram.resources.agent.v1.types; +package com.deepgram.types; import com.deepgram.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonValue; @@ -15,13 +15,13 @@ import java.util.List; import java.util.Objects; -@JsonDeserialize(using = AgentV1SettingsAgentContextListenProviderV2LanguageHint.Deserializer.class) -public final class AgentV1SettingsAgentContextListenProviderV2LanguageHint { +@JsonDeserialize(using = DeepgramListenProviderV2LanguageHint.Deserializer.class) +public final class DeepgramListenProviderV2LanguageHint { private final Object value; private final int type; - private AgentV1SettingsAgentContextListenProviderV2LanguageHint(Object value, int type) { + private DeepgramListenProviderV2LanguageHint(Object value, int type) { this.value = value; this.type = type; } @@ -44,11 +44,11 @@ public T visit(Visitor visitor) { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof AgentV1SettingsAgentContextListenProviderV2LanguageHint - && equalTo((AgentV1SettingsAgentContextListenProviderV2LanguageHint) other); + return other instanceof DeepgramListenProviderV2LanguageHint + && equalTo((DeepgramListenProviderV2LanguageHint) other); } - private boolean equalTo(AgentV1SettingsAgentContextListenProviderV2LanguageHint other) { + private boolean equalTo(DeepgramListenProviderV2LanguageHint other) { return value.equals(other.value); } @@ -62,12 +62,12 @@ public String toString() { return this.value.toString(); } - public static AgentV1SettingsAgentContextListenProviderV2LanguageHint of(String value) { - return new AgentV1SettingsAgentContextListenProviderV2LanguageHint(value, 0); + public static DeepgramListenProviderV2LanguageHint of(String value) { + return new DeepgramListenProviderV2LanguageHint(value, 0); } - public static AgentV1SettingsAgentContextListenProviderV2LanguageHint of(List value) { - return new AgentV1SettingsAgentContextListenProviderV2LanguageHint(value, 1); + public static DeepgramListenProviderV2LanguageHint of(List value) { + return new DeepgramListenProviderV2LanguageHint(value, 1); } public interface Visitor { @@ -76,14 +76,14 @@ public interface Visitor { T visit(List value); } - static final class Deserializer extends StdDeserializer { + static final class Deserializer extends StdDeserializer { Deserializer() { - super(AgentV1SettingsAgentContextListenProviderV2LanguageHint.class); + super(DeepgramListenProviderV2LanguageHint.class); } @java.lang.Override - public AgentV1SettingsAgentContextListenProviderV2LanguageHint deserialize( - JsonParser p, DeserializationContext context) throws IOException { + public DeepgramListenProviderV2LanguageHint deserialize(JsonParser p, DeserializationContext context) + throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class));