From 5de8c25606874fe5c23aa1c2faa8b9eb018c46e8 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2026 11:59:35 +0000 Subject: [PATCH] SDK regeneration --- .fern/metadata.json | 4 +- .../java/com/deepgram/core/ClientOptions.java | 6 +- .../agent/v1/types/AgentV1ThinkUpdated.java | 78 ++++ .../agent/v1/types/AgentV1UpdateThink.java | 126 ++++++ .../v1/types/AgentV1UpdateThinkThink.java | 98 +++++ .../AgentV1UpdateThinkThinkContextLength.java | 271 ++++++++++++ ...eThinkThinkContextLengthContextLength.java | 108 +++++ ...UpdateThinkThinkContextLengthEndpoint.java | 141 ++++++ ...eThinkThinkContextLengthFunctionsItem.java | 205 +++++++++ ...inkContextLengthFunctionsItemEndpoint.java | 167 ++++++++ ...UpdateThinkThinkContextLengthProvider.java | 404 ++++++++++++++++++ ...nkThinkContextLengthProviderAnthropic.java | 219 ++++++++++ ...nkContextLengthProviderAnthropicModel.java | 89 ++++ ...kThinkContextLengthProviderAwsBedrock.java | 224 ++++++++++ ...xtLengthProviderAwsBedrockCredentials.java | 235 ++++++++++ ...ngthProviderAwsBedrockCredentialsType.java | 88 ++++ ...kContextLengthProviderAwsBedrockModel.java | 89 ++++ ...ThinkThinkContextLengthProviderGoogle.java | 219 ++++++++++ ...ThinkContextLengthProviderGoogleModel.java | 99 +++++ ...teThinkThinkContextLengthProviderGroq.java | 149 +++++++ ...ThinkThinkContextLengthProviderOpenAi.java | 219 ++++++++++ ...ThinkContextLengthProviderOpenAiModel.java | 153 +++++++ .../types/AgentV1UpdateThinkThinkOneItem.java | 270 ++++++++++++ ...1UpdateThinkThinkOneItemContextLength.java | 108 +++++ ...gentV1UpdateThinkThinkOneItemEndpoint.java | 141 ++++++ ...1UpdateThinkThinkOneItemFunctionsItem.java | 205 +++++++++ ...hinkThinkOneItemFunctionsItemEndpoint.java | 166 +++++++ ...gentV1UpdateThinkThinkOneItemProvider.java | 401 +++++++++++++++++ ...ateThinkThinkOneItemProviderAnthropic.java | 219 ++++++++++ ...inkThinkOneItemProviderAnthropicModel.java | 88 ++++ ...teThinkThinkOneItemProviderAwsBedrock.java | 222 ++++++++++ ...kOneItemProviderAwsBedrockCredentials.java | 235 ++++++++++ ...ItemProviderAwsBedrockCredentialsType.java | 87 ++++ ...nkThinkOneItemProviderAwsBedrockModel.java | 88 ++++ ...UpdateThinkThinkOneItemProviderGoogle.java | 218 ++++++++++ ...eThinkThinkOneItemProviderGoogleModel.java | 97 +++++ ...V1UpdateThinkThinkOneItemProviderGroq.java | 149 +++++++ ...UpdateThinkThinkOneItemProviderOpenAi.java | 218 ++++++++++ ...eThinkThinkOneItemProviderOpenAiModel.java | 152 +++++++ .../agent/v1/websocket/V1WebSocketClient.java | 29 ++ .../v2/types/ListenV2ConfigureFailure.java | 178 ++++++++ .../v2/websocket/V2WebSocketClient.java | 46 ++ 42 files changed, 6703 insertions(+), 5 deletions(-) create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1ThinkUpdated.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThink.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThink.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLength.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthContextLength.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthEndpoint.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthFunctionsItem.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthFunctionsItemEndpoint.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProvider.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAnthropic.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAnthropicModel.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAwsBedrock.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentials.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentialsType.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockModel.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderGoogle.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderGoogleModel.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderGroq.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderOpenAi.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItem.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemContextLength.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemEndpoint.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemFunctionsItem.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemFunctionsItemEndpoint.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProvider.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAnthropic.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAnthropicModel.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAwsBedrock.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentials.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentialsType.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAwsBedrockModel.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderGoogle.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderGoogleModel.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderGroq.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderOpenAi.java create mode 100644 src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderOpenAiModel.java create mode 100644 src/main/java/com/deepgram/resources/listen/v2/types/ListenV2ConfigureFailure.java diff --git a/.fern/metadata.json b/.fern/metadata.json index 0d96d08..92e8cb3 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -11,6 +11,6 @@ }, "enable-wire-tests": true }, - "originGitCommit": "e994b5ab79ae6fe3560daff055acdf80d315b48e", - "sdkVersion": "0.2.0" + "originGitCommit": "8bcf185d00ea632a19706a24a462d2205678b6c3", + "sdkVersion": "0.2.1" } \ No newline at end of file diff --git a/src/main/java/com/deepgram/core/ClientOptions.java b/src/main/java/com/deepgram/core/ClientOptions.java index f71f8f8..5885ca3 100644 --- a/src/main/java/com/deepgram/core/ClientOptions.java +++ b/src/main/java/com/deepgram/core/ClientOptions.java @@ -41,10 +41,10 @@ private ClientOptions( this.headers.putAll(headers); this.headers.putAll(new HashMap() { { - put("User-Agent", "com.deepgram:deepgram-java-sdk/0.2.0"); // x-release-please-version + put("User-Agent", "com.deepgram:deepgram-sdk/0.2.1"); put("X-Fern-Language", "JAVA"); - put("X-Fern-SDK-Name", "com.deepgram:deepgram-java-sdk"); - put("X-Fern-SDK-Version", "0.2.0"); // x-release-please-version + put("X-Fern-SDK-Name", "com.deepgram.fern:api-sdk"); + put("X-Fern-SDK-Version", "0.2.1"); } }); this.headerSuppliers = headerSuppliers; diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1ThinkUpdated.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1ThinkUpdated.java new file mode 100644 index 0000000..5668a71 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1ThinkUpdated.java @@ -0,0 +1,78 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AgentV1ThinkUpdated.Builder.class) +public final class AgentV1ThinkUpdated { + private final Map additionalProperties; + + private AgentV1ThinkUpdated(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + /** + * @return Message type identifier for think update confirmation + */ + @JsonProperty("type") + public String getType() { + return "ThinkUpdated"; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1ThinkUpdated; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AgentV1ThinkUpdated other) { + return this; + } + + public AgentV1ThinkUpdated build() { + return new AgentV1ThinkUpdated(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/AgentV1UpdateThink.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThink.java new file mode 100644 index 0000000..dd78f07 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThink.java @@ -0,0 +1,126 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AgentV1UpdateThink.Builder.class) +public final class AgentV1UpdateThink { + private final AgentV1UpdateThinkThink think; + + private final Map additionalProperties; + + private AgentV1UpdateThink(AgentV1UpdateThinkThink think, Map additionalProperties) { + this.think = think; + this.additionalProperties = additionalProperties; + } + + /** + * @return Message type identifier for updating the think model + */ + @JsonProperty("type") + public String getType() { + return "UpdateThink"; + } + + @JsonProperty("think") + public AgentV1UpdateThinkThink getThink() { + return think; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThink && equalTo((AgentV1UpdateThink) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThink other) { + return think.equals(other.think); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.think); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ThinkStage builder() { + return new Builder(); + } + + public interface ThinkStage { + _FinalStage think(@NotNull AgentV1UpdateThinkThink think); + + Builder from(AgentV1UpdateThink other); + } + + public interface _FinalStage { + AgentV1UpdateThink build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ThinkStage, _FinalStage { + private AgentV1UpdateThinkThink think; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AgentV1UpdateThink other) { + think(other.getThink()); + return this; + } + + @java.lang.Override + @JsonSetter("think") + public _FinalStage think(@NotNull AgentV1UpdateThinkThink think) { + this.think = Objects.requireNonNull(think, "think must not be null"); + return this; + } + + @java.lang.Override + public AgentV1UpdateThink build() { + return new AgentV1UpdateThink(think, 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/agent/v1/types/AgentV1UpdateThinkThink.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThink.java new file mode 100644 index 0000000..6fd87ce --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThink.java @@ -0,0 +1,98 @@ +/** + * 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.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.List; +import java.util.Objects; + +@JsonDeserialize(using = AgentV1UpdateThinkThink.Deserializer.class) +public final class AgentV1UpdateThinkThink { + private final Object value; + + private final int type; + + private AgentV1UpdateThinkThink(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((AgentV1UpdateThinkThinkContextLength) this.value); + } else if (this.type == 1) { + return visitor.visit((List) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThink && equalTo((AgentV1UpdateThinkThink) other); + } + + private boolean equalTo(AgentV1UpdateThinkThink other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AgentV1UpdateThinkThink of(AgentV1UpdateThinkThinkContextLength value) { + return new AgentV1UpdateThinkThink(value, 0); + } + + public static AgentV1UpdateThinkThink of(List value) { + return new AgentV1UpdateThinkThink(value, 1); + } + + public interface Visitor { + T visit(AgentV1UpdateThinkThinkContextLength value); + + T visit(List value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AgentV1UpdateThinkThink.class); + } + + @java.lang.Override + public AgentV1UpdateThinkThink deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, AgentV1UpdateThinkThinkContextLength.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue( + value, new TypeReference>() {})); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLength.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLength.java new file mode 100644 index 0000000..43b3953 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLength.java @@ -0,0 +1,271 @@ +/** + * 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 = AgentV1UpdateThinkThinkContextLength.Builder.class) +public final class AgentV1UpdateThinkThinkContextLength { + private final AgentV1UpdateThinkThinkContextLengthProvider provider; + + private final Optional endpoint; + + private final Optional> functions; + + private final Optional prompt; + + private final Optional contextLength; + + private final Map additionalProperties; + + private AgentV1UpdateThinkThinkContextLength( + AgentV1UpdateThinkThinkContextLengthProvider provider, + Optional endpoint, + Optional> functions, + Optional prompt, + Optional contextLength, + Map additionalProperties) { + this.provider = provider; + this.endpoint = endpoint; + this.functions = functions; + this.prompt = prompt; + this.contextLength = contextLength; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public AgentV1UpdateThinkThinkContextLengthProvider getProvider() { + return provider; + } + + /** + * @return Optional for non-Deepgram LLM providers. When present, must include url field and headers object + */ + @JsonProperty("endpoint") + public Optional getEndpoint() { + return endpoint; + } + + @JsonProperty("functions") + public Optional> getFunctions() { + return functions; + } + + @JsonProperty("prompt") + public Optional getPrompt() { + return prompt; + } + + /** + * @return Specifies the number of characters retained in context between user messages, agent responses, and function calls. This setting is only configurable when a custom think endpoint is used + */ + @JsonProperty("context_length") + public Optional getContextLength() { + return contextLength; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkContextLength + && equalTo((AgentV1UpdateThinkThinkContextLength) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThinkThinkContextLength other) { + return provider.equals(other.provider) + && endpoint.equals(other.endpoint) + && functions.equals(other.functions) + && prompt.equals(other.prompt) + && contextLength.equals(other.contextLength); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.provider, this.endpoint, this.functions, this.prompt, this.contextLength); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ProviderStage builder() { + return new Builder(); + } + + public interface ProviderStage { + _FinalStage provider(@NotNull AgentV1UpdateThinkThinkContextLengthProvider provider); + + Builder from(AgentV1UpdateThinkThinkContextLength other); + } + + public interface _FinalStage { + AgentV1UpdateThinkThinkContextLength build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

Optional for non-Deepgram LLM providers. When present, must include url field and headers object

+ */ + _FinalStage endpoint(Optional endpoint); + + _FinalStage endpoint(AgentV1UpdateThinkThinkContextLengthEndpoint endpoint); + + _FinalStage functions(Optional> functions); + + _FinalStage functions(List functions); + + _FinalStage prompt(Optional prompt); + + _FinalStage prompt(String prompt); + + /** + *

Specifies the number of characters retained in context between user messages, agent responses, and function calls. This setting is only configurable when a custom think endpoint is used

+ */ + _FinalStage contextLength(Optional contextLength); + + _FinalStage contextLength(AgentV1UpdateThinkThinkContextLengthContextLength contextLength); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ProviderStage, _FinalStage { + private AgentV1UpdateThinkThinkContextLengthProvider provider; + + private Optional contextLength = Optional.empty(); + + private Optional prompt = Optional.empty(); + + private Optional> functions = Optional.empty(); + + private Optional endpoint = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AgentV1UpdateThinkThinkContextLength other) { + provider(other.getProvider()); + endpoint(other.getEndpoint()); + functions(other.getFunctions()); + prompt(other.getPrompt()); + contextLength(other.getContextLength()); + return this; + } + + @java.lang.Override + @JsonSetter("provider") + public _FinalStage provider(@NotNull AgentV1UpdateThinkThinkContextLengthProvider provider) { + this.provider = Objects.requireNonNull(provider, "provider must not be null"); + return this; + } + + /** + *

Specifies the number of characters retained in context between user messages, agent responses, and function calls. This setting is only configurable when a custom think endpoint is used

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

Specifies the number of characters retained in context between user messages, agent responses, and function calls. This setting is only configurable when a custom think endpoint is used

+ */ + @java.lang.Override + @JsonSetter(value = "context_length", nulls = Nulls.SKIP) + public _FinalStage contextLength(Optional contextLength) { + this.contextLength = contextLength; + return this; + } + + @java.lang.Override + public _FinalStage prompt(String prompt) { + this.prompt = Optional.ofNullable(prompt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "prompt", nulls = Nulls.SKIP) + public _FinalStage prompt(Optional prompt) { + this.prompt = prompt; + return this; + } + + @java.lang.Override + public _FinalStage functions(List functions) { + this.functions = Optional.ofNullable(functions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "functions", nulls = Nulls.SKIP) + public _FinalStage functions(Optional> functions) { + this.functions = functions; + return this; + } + + /** + *

Optional for non-Deepgram LLM providers. When present, must include url field and headers object

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

Optional for non-Deepgram LLM providers. When present, must include url field and headers object

+ */ + @java.lang.Override + @JsonSetter(value = "endpoint", nulls = Nulls.SKIP) + public _FinalStage endpoint(Optional endpoint) { + this.endpoint = endpoint; + return this; + } + + @java.lang.Override + public AgentV1UpdateThinkThinkContextLength build() { + return new AgentV1UpdateThinkThinkContextLength( + provider, endpoint, functions, prompt, contextLength, 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/agent/v1/types/AgentV1UpdateThinkThinkContextLengthContextLength.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthContextLength.java new file mode 100644 index 0000000..548fcf5 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthContextLength.java @@ -0,0 +1,108 @@ +/** + * 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.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AgentV1UpdateThinkThinkContextLengthContextLength.Deserializer.class) +public final class AgentV1UpdateThinkThinkContextLengthContextLength { + private final Object value; + + private final int type; + + private AgentV1UpdateThinkThinkContextLengthContextLength(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((double) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkContextLengthContextLength + && equalTo((AgentV1UpdateThinkThinkContextLengthContextLength) other); + } + + private boolean equalTo(AgentV1UpdateThinkThinkContextLengthContextLength other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + /** + * @param value must be one of the following: + *
    + *
  • "max"
  • + *
+ */ + public static AgentV1UpdateThinkThinkContextLengthContextLength of(String value) { + return new AgentV1UpdateThinkThinkContextLengthContextLength(value, 0); + } + + public static AgentV1UpdateThinkThinkContextLengthContextLength of(double value) { + return new AgentV1UpdateThinkThinkContextLengthContextLength(value, 1); + } + + public interface Visitor { + /** + * @param value must be one of the following: + *
    + *
  • "max"
  • + *
+ */ + T visit(String value); + + T visit(double value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AgentV1UpdateThinkThinkContextLengthContextLength.class); + } + + @java.lang.Override + public AgentV1UpdateThinkThinkContextLengthContextLength deserialize( + JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + if (value instanceof Double) { + return of((Double) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthEndpoint.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthEndpoint.java new file mode 100644 index 0000000..351205a --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthEndpoint.java @@ -0,0 +1,141 @@ +/** + * 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.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AgentV1UpdateThinkThinkContextLengthEndpoint.Builder.class) +public final class AgentV1UpdateThinkThinkContextLengthEndpoint { + private final Optional url; + + private final Optional> headers; + + private final Map additionalProperties; + + private AgentV1UpdateThinkThinkContextLengthEndpoint( + Optional url, Optional> headers, Map additionalProperties) { + this.url = url; + this.headers = headers; + this.additionalProperties = additionalProperties; + } + + /** + * @return Custom LLM endpoint URL + */ + @JsonProperty("url") + public Optional getUrl() { + return url; + } + + /** + * @return Custom headers for the endpoint + */ + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkContextLengthEndpoint + && equalTo((AgentV1UpdateThinkThinkContextLengthEndpoint) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThinkThinkContextLengthEndpoint other) { + return url.equals(other.url) && headers.equals(other.headers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.url, this.headers); + } + + @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 url = Optional.empty(); + + private Optional> headers = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AgentV1UpdateThinkThinkContextLengthEndpoint other) { + url(other.getUrl()); + headers(other.getHeaders()); + return this; + } + + /** + *

Custom LLM endpoint URL

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

Custom headers for the endpoint

+ */ + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public Builder headers(Optional> headers) { + this.headers = headers; + return this; + } + + public Builder headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + public AgentV1UpdateThinkThinkContextLengthEndpoint build() { + return new AgentV1UpdateThinkThinkContextLengthEndpoint(url, headers, 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/AgentV1UpdateThinkThinkContextLengthFunctionsItem.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthFunctionsItem.java new file mode 100644 index 0000000..1f0aa0b --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthFunctionsItem.java @@ -0,0 +1,205 @@ +/** + * 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.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AgentV1UpdateThinkThinkContextLengthFunctionsItem.Builder.class) +public final class AgentV1UpdateThinkThinkContextLengthFunctionsItem { + private final Optional name; + + private final Optional description; + + private final Optional> parameters; + + private final Optional endpoint; + + private final Map additionalProperties; + + private AgentV1UpdateThinkThinkContextLengthFunctionsItem( + Optional name, + Optional description, + Optional> parameters, + Optional endpoint, + Map additionalProperties) { + this.name = name; + this.description = description; + this.parameters = parameters; + this.endpoint = endpoint; + this.additionalProperties = additionalProperties; + } + + /** + * @return Function name + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Function description + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return Function parameters + */ + @JsonProperty("parameters") + public Optional> getParameters() { + return parameters; + } + + /** + * @return The Function endpoint to call. if not passed, function is called client-side + */ + @JsonProperty("endpoint") + public Optional getEndpoint() { + return endpoint; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkContextLengthFunctionsItem + && equalTo((AgentV1UpdateThinkThinkContextLengthFunctionsItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThinkThinkContextLengthFunctionsItem other) { + return name.equals(other.name) + && description.equals(other.description) + && parameters.equals(other.parameters) + && endpoint.equals(other.endpoint); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.parameters, this.endpoint); + } + + @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 name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional> parameters = Optional.empty(); + + private Optional endpoint = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AgentV1UpdateThinkThinkContextLengthFunctionsItem other) { + name(other.getName()); + description(other.getDescription()); + parameters(other.getParameters()); + endpoint(other.getEndpoint()); + return this; + } + + /** + *

Function name

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

Function description

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

Function parameters

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

The Function endpoint to call. if not passed, function is called client-side

+ */ + @JsonSetter(value = "endpoint", nulls = Nulls.SKIP) + public Builder endpoint(Optional endpoint) { + this.endpoint = endpoint; + return this; + } + + public Builder endpoint(AgentV1UpdateThinkThinkContextLengthFunctionsItemEndpoint endpoint) { + this.endpoint = Optional.ofNullable(endpoint); + return this; + } + + public AgentV1UpdateThinkThinkContextLengthFunctionsItem build() { + return new AgentV1UpdateThinkThinkContextLengthFunctionsItem( + name, description, parameters, endpoint, 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/AgentV1UpdateThinkThinkContextLengthFunctionsItemEndpoint.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthFunctionsItemEndpoint.java new file mode 100644 index 0000000..202a6ce --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthFunctionsItemEndpoint.java @@ -0,0 +1,167 @@ +/** + * 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.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AgentV1UpdateThinkThinkContextLengthFunctionsItemEndpoint.Builder.class) +public final class AgentV1UpdateThinkThinkContextLengthFunctionsItemEndpoint { + private final Optional url; + + private final Optional method; + + private final Optional> headers; + + private final Map additionalProperties; + + private AgentV1UpdateThinkThinkContextLengthFunctionsItemEndpoint( + Optional url, + Optional method, + Optional> headers, + Map additionalProperties) { + this.url = url; + this.method = method; + this.headers = headers; + this.additionalProperties = additionalProperties; + } + + /** + * @return Endpoint URL + */ + @JsonProperty("url") + public Optional getUrl() { + return url; + } + + /** + * @return HTTP method + */ + @JsonProperty("method") + public Optional getMethod() { + return method; + } + + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkContextLengthFunctionsItemEndpoint + && equalTo((AgentV1UpdateThinkThinkContextLengthFunctionsItemEndpoint) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThinkThinkContextLengthFunctionsItemEndpoint other) { + return url.equals(other.url) && method.equals(other.method) && headers.equals(other.headers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.url, this.method, this.headers); + } + + @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 url = Optional.empty(); + + private Optional method = Optional.empty(); + + private Optional> headers = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AgentV1UpdateThinkThinkContextLengthFunctionsItemEndpoint other) { + url(other.getUrl()); + method(other.getMethod()); + headers(other.getHeaders()); + return this; + } + + /** + *

Endpoint URL

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

HTTP method

+ */ + @JsonSetter(value = "method", nulls = Nulls.SKIP) + public Builder method(Optional method) { + this.method = method; + return this; + } + + public Builder method(String method) { + this.method = Optional.ofNullable(method); + return this; + } + + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public Builder headers(Optional> headers) { + this.headers = headers; + return this; + } + + public Builder headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + public AgentV1UpdateThinkThinkContextLengthFunctionsItemEndpoint build() { + return new AgentV1UpdateThinkThinkContextLengthFunctionsItemEndpoint( + url, method, headers, 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/AgentV1UpdateThinkThinkContextLengthProvider.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProvider.java new file mode 100644 index 0000000..014b8f5 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProvider.java @@ -0,0 +1,404 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.deepgram.resources.agent.v1.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class AgentV1UpdateThinkThinkContextLengthProvider { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private AgentV1UpdateThinkThinkContextLengthProvider(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static AgentV1UpdateThinkThinkContextLengthProvider openAi( + AgentV1UpdateThinkThinkContextLengthProviderOpenAi value) { + return new AgentV1UpdateThinkThinkContextLengthProvider(new OpenAiValue(value)); + } + + public static AgentV1UpdateThinkThinkContextLengthProvider awsBedrock( + AgentV1UpdateThinkThinkContextLengthProviderAwsBedrock value) { + return new AgentV1UpdateThinkThinkContextLengthProvider(new AwsBedrockValue(value)); + } + + public static AgentV1UpdateThinkThinkContextLengthProvider anthropic( + AgentV1UpdateThinkThinkContextLengthProviderAnthropic value) { + return new AgentV1UpdateThinkThinkContextLengthProvider(new AnthropicValue(value)); + } + + public static AgentV1UpdateThinkThinkContextLengthProvider google( + AgentV1UpdateThinkThinkContextLengthProviderGoogle value) { + return new AgentV1UpdateThinkThinkContextLengthProvider(new GoogleValue(value)); + } + + public static AgentV1UpdateThinkThinkContextLengthProvider groq( + AgentV1UpdateThinkThinkContextLengthProviderGroq value) { + return new AgentV1UpdateThinkThinkContextLengthProvider(new GroqValue(value)); + } + + public boolean isOpenAi() { + return value instanceof OpenAiValue; + } + + public boolean isAwsBedrock() { + return value instanceof AwsBedrockValue; + } + + public boolean isAnthropic() { + return value instanceof AnthropicValue; + } + + public boolean isGoogle() { + return value instanceof GoogleValue; + } + + public boolean isGroq() { + return value instanceof GroqValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getOpenAi() { + if (isOpenAi()) { + return Optional.of(((OpenAiValue) value).value); + } + return Optional.empty(); + } + + public Optional getAwsBedrock() { + if (isAwsBedrock()) { + return Optional.of(((AwsBedrockValue) value).value); + } + return Optional.empty(); + } + + public Optional getAnthropic() { + if (isAnthropic()) { + return Optional.of(((AnthropicValue) value).value); + } + return Optional.empty(); + } + + public Optional getGoogle() { + if (isGoogle()) { + return Optional.of(((GoogleValue) value).value); + } + return Optional.empty(); + } + + public Optional getGroq() { + if (isGroq()) { + return Optional.of(((GroqValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkContextLengthProvider + && value.equals(((AgentV1UpdateThinkThinkContextLengthProvider) other).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return value.toString(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitOpenAi(AgentV1UpdateThinkThinkContextLengthProviderOpenAi openAi); + + T visitAwsBedrock(AgentV1UpdateThinkThinkContextLengthProviderAwsBedrock awsBedrock); + + T visitAnthropic(AgentV1UpdateThinkThinkContextLengthProviderAnthropic anthropic); + + T visitGoogle(AgentV1UpdateThinkThinkContextLengthProviderGoogle google); + + T visitGroq(AgentV1UpdateThinkThinkContextLengthProviderGroq groq); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(OpenAiValue.class), + @JsonSubTypes.Type(AwsBedrockValue.class), + @JsonSubTypes.Type(AnthropicValue.class), + @JsonSubTypes.Type(GoogleValue.class), + @JsonSubTypes.Type(GroqValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("open_ai") + @JsonIgnoreProperties("type") + private static final class OpenAiValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private AgentV1UpdateThinkThinkContextLengthProviderOpenAi value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private OpenAiValue() {} + + private OpenAiValue(AgentV1UpdateThinkThinkContextLengthProviderOpenAi value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitOpenAi(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OpenAiValue && equalTo((OpenAiValue) other); + } + + private boolean equalTo(OpenAiValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AgentV1UpdateThinkThinkContextLengthProvider{" + "value: " + value + "}"; + } + } + + @JsonTypeName("aws_bedrock") + @JsonIgnoreProperties("type") + private static final class AwsBedrockValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private AgentV1UpdateThinkThinkContextLengthProviderAwsBedrock value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private AwsBedrockValue() {} + + private AwsBedrockValue(AgentV1UpdateThinkThinkContextLengthProviderAwsBedrock value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitAwsBedrock(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AwsBedrockValue && equalTo((AwsBedrockValue) other); + } + + private boolean equalTo(AwsBedrockValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AgentV1UpdateThinkThinkContextLengthProvider{" + "value: " + value + "}"; + } + } + + @JsonTypeName("anthropic") + @JsonIgnoreProperties("type") + private static final class AnthropicValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private AgentV1UpdateThinkThinkContextLengthProviderAnthropic value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private AnthropicValue() {} + + private AnthropicValue(AgentV1UpdateThinkThinkContextLengthProviderAnthropic value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitAnthropic(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AnthropicValue && equalTo((AnthropicValue) other); + } + + private boolean equalTo(AnthropicValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AgentV1UpdateThinkThinkContextLengthProvider{" + "value: " + value + "}"; + } + } + + @JsonTypeName("google") + @JsonIgnoreProperties("type") + private static final class GoogleValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private AgentV1UpdateThinkThinkContextLengthProviderGoogle value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private GoogleValue() {} + + private GoogleValue(AgentV1UpdateThinkThinkContextLengthProviderGoogle value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitGoogle(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GoogleValue && equalTo((GoogleValue) other); + } + + private boolean equalTo(GoogleValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AgentV1UpdateThinkThinkContextLengthProvider{" + "value: " + value + "}"; + } + } + + @JsonTypeName("groq") + @JsonIgnoreProperties("type") + private static final class GroqValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private AgentV1UpdateThinkThinkContextLengthProviderGroq value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private GroqValue() {} + + private GroqValue(AgentV1UpdateThinkThinkContextLengthProviderGroq value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitGroq(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GroqValue && equalTo((GroqValue) other); + } + + private boolean equalTo(GroqValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AgentV1UpdateThinkThinkContextLengthProvider{" + "value: " + value + "}"; + } + } + + @JsonIgnoreProperties("type") + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "AgentV1UpdateThinkThinkContextLengthProvider{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAnthropic.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAnthropic.java new file mode 100644 index 0000000..eef266c --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAnthropic.java @@ -0,0 +1,219 @@ +/** + * 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.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AgentV1UpdateThinkThinkContextLengthProviderAnthropic.Builder.class) +public final class AgentV1UpdateThinkThinkContextLengthProviderAnthropic { + private final Optional version; + + private final AgentV1UpdateThinkThinkContextLengthProviderAnthropicModel model; + + private final Optional temperature; + + private final Map additionalProperties; + + private AgentV1UpdateThinkThinkContextLengthProviderAnthropic( + Optional version, + AgentV1UpdateThinkThinkContextLengthProviderAnthropicModel model, + Optional temperature, + Map additionalProperties) { + this.version = version; + this.model = model; + this.temperature = temperature; + this.additionalProperties = additionalProperties; + } + + /** + * @return The REST API version for the Anthropic Messages API + */ + @JsonProperty("version") + public Optional getVersion() { + return version; + } + + /** + * @return Anthropic model to use + */ + @JsonProperty("model") + public AgentV1UpdateThinkThinkContextLengthProviderAnthropicModel getModel() { + return model; + } + + /** + * @return Anthropic temperature (0-1) + */ + @JsonProperty("temperature") + public Optional getTemperature() { + return temperature; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkContextLengthProviderAnthropic + && equalTo((AgentV1UpdateThinkThinkContextLengthProviderAnthropic) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThinkThinkContextLengthProviderAnthropic other) { + return version.equals(other.version) && model.equals(other.model) && temperature.equals(other.temperature); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.version, this.model, this.temperature); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + /** + *

Anthropic model to use

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

The REST API version for the Anthropic Messages API

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

Anthropic temperature (0-1)

+ */ + _FinalStage temperature(Optional temperature); + + _FinalStage temperature(Double temperature); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private AgentV1UpdateThinkThinkContextLengthProviderAnthropicModel model; + + private Optional temperature = Optional.empty(); + + private Optional version = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AgentV1UpdateThinkThinkContextLengthProviderAnthropic other) { + version(other.getVersion()); + model(other.getModel()); + temperature(other.getTemperature()); + return this; + } + + /** + *

Anthropic model to use

+ *

Anthropic model to use

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

Anthropic temperature (0-1)

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

Anthropic temperature (0-1)

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

The REST API version for the Anthropic Messages API

+ * @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; + } + + /** + *

The REST API version for the Anthropic Messages API

+ */ + @java.lang.Override + @JsonSetter(value = "version", nulls = Nulls.SKIP) + public _FinalStage version(Optional version) { + this.version = version; + return this; + } + + @java.lang.Override + public AgentV1UpdateThinkThinkContextLengthProviderAnthropic build() { + return new AgentV1UpdateThinkThinkContextLengthProviderAnthropic( + version, model, temperature, 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/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAnthropicModel.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAnthropicModel.java new file mode 100644 index 0000000..226e163 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAnthropicModel.java @@ -0,0 +1,89 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.deepgram.resources.agent.v1.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class AgentV1UpdateThinkThinkContextLengthProviderAnthropicModel { + public static final AgentV1UpdateThinkThinkContextLengthProviderAnthropicModel CLAUDE_SONNET420250514 = + new AgentV1UpdateThinkThinkContextLengthProviderAnthropicModel( + Value.CLAUDE_SONNET420250514, "claude-sonnet-4-20250514"); + + public static final AgentV1UpdateThinkThinkContextLengthProviderAnthropicModel CLAUDE35HAIKU_LATEST = + new AgentV1UpdateThinkThinkContextLengthProviderAnthropicModel( + Value.CLAUDE35HAIKU_LATEST, "claude-3-5-haiku-latest"); + + private final Value value; + + private final String string; + + AgentV1UpdateThinkThinkContextLengthProviderAnthropicModel(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 AgentV1UpdateThinkThinkContextLengthProviderAnthropicModel + && this.string.equals( + ((AgentV1UpdateThinkThinkContextLengthProviderAnthropicModel) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CLAUDE_SONNET420250514: + return visitor.visitClaudeSonnet420250514(); + case CLAUDE35HAIKU_LATEST: + return visitor.visitClaude35HaikuLatest(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AgentV1UpdateThinkThinkContextLengthProviderAnthropicModel valueOf(String value) { + switch (value) { + case "claude-sonnet-4-20250514": + return CLAUDE_SONNET420250514; + case "claude-3-5-haiku-latest": + return CLAUDE35HAIKU_LATEST; + default: + return new AgentV1UpdateThinkThinkContextLengthProviderAnthropicModel(Value.UNKNOWN, value); + } + } + + public enum Value { + CLAUDE35HAIKU_LATEST, + + CLAUDE_SONNET420250514, + + UNKNOWN + } + + public interface Visitor { + T visitClaude35HaikuLatest(); + + T visitClaudeSonnet420250514(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAwsBedrock.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAwsBedrock.java new file mode 100644 index 0000000..fe3df8d --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAwsBedrock.java @@ -0,0 +1,224 @@ +/** + * 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.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AgentV1UpdateThinkThinkContextLengthProviderAwsBedrock.Builder.class) +public final class AgentV1UpdateThinkThinkContextLengthProviderAwsBedrock { + private final AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockModel model; + + private final Optional temperature; + + private final Optional credentials; + + private final Map additionalProperties; + + private AgentV1UpdateThinkThinkContextLengthProviderAwsBedrock( + AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockModel model, + Optional temperature, + Optional credentials, + Map additionalProperties) { + this.model = model; + this.temperature = temperature; + this.credentials = credentials; + this.additionalProperties = additionalProperties; + } + + /** + * @return AWS Bedrock model to use + */ + @JsonProperty("model") + public AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockModel getModel() { + return model; + } + + /** + * @return AWS Bedrock temperature (0-2) + */ + @JsonProperty("temperature") + public Optional getTemperature() { + return temperature; + } + + /** + * @return AWS credentials type (STS short-lived or IAM long-lived) + */ + @JsonProperty("credentials") + public Optional getCredentials() { + return credentials; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkContextLengthProviderAwsBedrock + && equalTo((AgentV1UpdateThinkThinkContextLengthProviderAwsBedrock) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThinkThinkContextLengthProviderAwsBedrock other) { + return model.equals(other.model) + && temperature.equals(other.temperature) + && credentials.equals(other.credentials); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.model, this.temperature, this.credentials); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + /** + *

AWS Bedrock model to use

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

AWS Bedrock temperature (0-2)

+ */ + _FinalStage temperature(Optional temperature); + + _FinalStage temperature(Double temperature); + + /** + *

AWS credentials type (STS short-lived or IAM long-lived)

+ */ + _FinalStage credentials( + Optional credentials); + + _FinalStage credentials(AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentials credentials); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockModel model; + + private Optional credentials = + Optional.empty(); + + private Optional temperature = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AgentV1UpdateThinkThinkContextLengthProviderAwsBedrock other) { + model(other.getModel()); + temperature(other.getTemperature()); + credentials(other.getCredentials()); + return this; + } + + /** + *

AWS Bedrock model to use

+ *

AWS Bedrock model to use

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

AWS credentials type (STS short-lived or IAM long-lived)

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

AWS credentials type (STS short-lived or IAM long-lived)

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

AWS Bedrock temperature (0-2)

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

AWS Bedrock temperature (0-2)

+ */ + @java.lang.Override + @JsonSetter(value = "temperature", nulls = Nulls.SKIP) + public _FinalStage temperature(Optional temperature) { + this.temperature = temperature; + return this; + } + + @java.lang.Override + public AgentV1UpdateThinkThinkContextLengthProviderAwsBedrock build() { + return new AgentV1UpdateThinkThinkContextLengthProviderAwsBedrock( + model, temperature, credentials, 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/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentials.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentials.java new file mode 100644 index 0000000..7f01b72 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentials.java @@ -0,0 +1,235 @@ +/** + * 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.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentials.Builder.class) +public final class AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentials { + private final Optional type; + + private final Optional region; + + private final Optional accessKeyId; + + private final Optional secretAccessKey; + + private final Optional sessionToken; + + private final Map additionalProperties; + + private AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentials( + Optional type, + Optional region, + Optional accessKeyId, + Optional secretAccessKey, + Optional sessionToken, + Map additionalProperties) { + this.type = type; + this.region = region; + this.accessKeyId = accessKeyId; + this.secretAccessKey = secretAccessKey; + this.sessionToken = sessionToken; + this.additionalProperties = additionalProperties; + } + + /** + * @return AWS credentials type (STS short-lived or IAM long-lived) + */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return AWS region + */ + @JsonProperty("region") + public Optional getRegion() { + return region; + } + + /** + * @return AWS access key + */ + @JsonProperty("access_key_id") + public Optional getAccessKeyId() { + return accessKeyId; + } + + /** + * @return AWS secret access key + */ + @JsonProperty("secret_access_key") + public Optional getSecretAccessKey() { + return secretAccessKey; + } + + /** + * @return AWS session token (required for STS only) + */ + @JsonProperty("session_token") + public Optional getSessionToken() { + return sessionToken; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentials + && equalTo((AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentials) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentials other) { + return type.equals(other.type) + && region.equals(other.region) + && accessKeyId.equals(other.accessKeyId) + && secretAccessKey.equals(other.secretAccessKey) + && sessionToken.equals(other.sessionToken); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.region, this.accessKeyId, this.secretAccessKey, this.sessionToken); + } + + @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 type = Optional.empty(); + + private Optional region = Optional.empty(); + + private Optional accessKeyId = Optional.empty(); + + private Optional secretAccessKey = Optional.empty(); + + private Optional sessionToken = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentials other) { + type(other.getType()); + region(other.getRegion()); + accessKeyId(other.getAccessKeyId()); + secretAccessKey(other.getSecretAccessKey()); + sessionToken(other.getSessionToken()); + return this; + } + + /** + *

AWS credentials type (STS short-lived or IAM long-lived)

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

AWS region

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

AWS access key

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

AWS secret access key

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

AWS session token (required for STS only)

+ */ + @JsonSetter(value = "session_token", nulls = Nulls.SKIP) + public Builder sessionToken(Optional sessionToken) { + this.sessionToken = sessionToken; + return this; + } + + public Builder sessionToken(String sessionToken) { + this.sessionToken = Optional.ofNullable(sessionToken); + return this; + } + + public AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentials build() { + return new AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentials( + type, region, accessKeyId, secretAccessKey, sessionToken, 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/AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentialsType.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentialsType.java new file mode 100644 index 0000000..21de6c2 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentialsType.java @@ -0,0 +1,88 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.deepgram.resources.agent.v1.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentialsType { + public static final AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentialsType IAM = + new AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentialsType(Value.IAM, "iam"); + + public static final AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentialsType STS = + new AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentialsType(Value.STS, "sts"); + + private final Value value; + + private final String string; + + AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentialsType(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 AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentialsType + && this.string.equals( + ((AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentialsType) other) + .string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case IAM: + return visitor.visitIam(); + case STS: + return visitor.visitSts(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentialsType valueOf(String value) { + switch (value) { + case "iam": + return IAM; + case "sts": + return STS; + default: + return new AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockCredentialsType(Value.UNKNOWN, value); + } + } + + public enum Value { + STS, + + IAM, + + UNKNOWN + } + + public interface Visitor { + T visitSts(); + + T visitIam(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockModel.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockModel.java new file mode 100644 index 0000000..f408f37 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockModel.java @@ -0,0 +1,89 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.deepgram.resources.agent.v1.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockModel { + public static final AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockModel ANTHROPIC_CLAUDE35HAIKU20240307V10 = + new AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockModel( + Value.ANTHROPIC_CLAUDE35HAIKU20240307V10, "anthropic/claude-3-5-haiku-20240307-v1:0"); + + public static final AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockModel + ANTHROPIC_CLAUDE35SONNET20240620V10 = new AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockModel( + Value.ANTHROPIC_CLAUDE35SONNET20240620V10, "anthropic/claude-3-5-sonnet-20240620-v1:0"); + + private final Value value; + + private final String string; + + AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockModel(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 AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockModel + && this.string.equals( + ((AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockModel) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ANTHROPIC_CLAUDE35HAIKU20240307V10: + return visitor.visitAnthropicClaude35Haiku20240307V10(); + case ANTHROPIC_CLAUDE35SONNET20240620V10: + return visitor.visitAnthropicClaude35Sonnet20240620V10(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockModel valueOf(String value) { + switch (value) { + case "anthropic/claude-3-5-haiku-20240307-v1:0": + return ANTHROPIC_CLAUDE35HAIKU20240307V10; + case "anthropic/claude-3-5-sonnet-20240620-v1:0": + return ANTHROPIC_CLAUDE35SONNET20240620V10; + default: + return new AgentV1UpdateThinkThinkContextLengthProviderAwsBedrockModel(Value.UNKNOWN, value); + } + } + + public enum Value { + ANTHROPIC_CLAUDE35SONNET20240620V10, + + ANTHROPIC_CLAUDE35HAIKU20240307V10, + + UNKNOWN + } + + public interface Visitor { + T visitAnthropicClaude35Sonnet20240620V10(); + + T visitAnthropicClaude35Haiku20240307V10(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderGoogle.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderGoogle.java new file mode 100644 index 0000000..4f5e9a6 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderGoogle.java @@ -0,0 +1,219 @@ +/** + * 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.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AgentV1UpdateThinkThinkContextLengthProviderGoogle.Builder.class) +public final class AgentV1UpdateThinkThinkContextLengthProviderGoogle { + private final Optional version; + + private final AgentV1UpdateThinkThinkContextLengthProviderGoogleModel model; + + private final Optional temperature; + + private final Map additionalProperties; + + private AgentV1UpdateThinkThinkContextLengthProviderGoogle( + Optional version, + AgentV1UpdateThinkThinkContextLengthProviderGoogleModel model, + Optional temperature, + Map additionalProperties) { + this.version = version; + this.model = model; + this.temperature = temperature; + this.additionalProperties = additionalProperties; + } + + /** + * @return The REST API version for the Google generative language API + */ + @JsonProperty("version") + public Optional getVersion() { + return version; + } + + /** + * @return Google model to use + */ + @JsonProperty("model") + public AgentV1UpdateThinkThinkContextLengthProviderGoogleModel getModel() { + return model; + } + + /** + * @return Google temperature (0-2) + */ + @JsonProperty("temperature") + public Optional getTemperature() { + return temperature; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkContextLengthProviderGoogle + && equalTo((AgentV1UpdateThinkThinkContextLengthProviderGoogle) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThinkThinkContextLengthProviderGoogle other) { + return version.equals(other.version) && model.equals(other.model) && temperature.equals(other.temperature); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.version, this.model, this.temperature); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + /** + *

Google model to use

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

The REST API version for the Google generative language API

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

Google temperature (0-2)

+ */ + _FinalStage temperature(Optional temperature); + + _FinalStage temperature(Double temperature); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private AgentV1UpdateThinkThinkContextLengthProviderGoogleModel model; + + private Optional temperature = Optional.empty(); + + private Optional version = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AgentV1UpdateThinkThinkContextLengthProviderGoogle other) { + version(other.getVersion()); + model(other.getModel()); + temperature(other.getTemperature()); + return this; + } + + /** + *

Google model to use

+ *

Google model to use

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

Google temperature (0-2)

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

Google temperature (0-2)

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

The REST API version for the Google generative language API

+ * @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; + } + + /** + *

The REST API version for the Google generative language API

+ */ + @java.lang.Override + @JsonSetter(value = "version", nulls = Nulls.SKIP) + public _FinalStage version(Optional version) { + this.version = version; + return this; + } + + @java.lang.Override + public AgentV1UpdateThinkThinkContextLengthProviderGoogle build() { + return new AgentV1UpdateThinkThinkContextLengthProviderGoogle( + version, model, temperature, 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/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderGoogleModel.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderGoogleModel.java new file mode 100644 index 0000000..c55bbe5 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderGoogleModel.java @@ -0,0 +1,99 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.deepgram.resources.agent.v1.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class AgentV1UpdateThinkThinkContextLengthProviderGoogleModel { + public static final AgentV1UpdateThinkThinkContextLengthProviderGoogleModel GEMINI20FLASH_LITE = + new AgentV1UpdateThinkThinkContextLengthProviderGoogleModel( + Value.GEMINI20FLASH_LITE, "gemini-2.0-flash-lite"); + + public static final AgentV1UpdateThinkThinkContextLengthProviderGoogleModel GEMINI25FLASH = + new AgentV1UpdateThinkThinkContextLengthProviderGoogleModel(Value.GEMINI25FLASH, "gemini-2.5-flash"); + + public static final AgentV1UpdateThinkThinkContextLengthProviderGoogleModel GEMINI20FLASH = + new AgentV1UpdateThinkThinkContextLengthProviderGoogleModel(Value.GEMINI20FLASH, "gemini-2.0-flash"); + + private final Value value; + + private final String string; + + AgentV1UpdateThinkThinkContextLengthProviderGoogleModel(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 AgentV1UpdateThinkThinkContextLengthProviderGoogleModel + && this.string.equals( + ((AgentV1UpdateThinkThinkContextLengthProviderGoogleModel) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case GEMINI20FLASH_LITE: + return visitor.visitGemini20FlashLite(); + case GEMINI25FLASH: + return visitor.visitGemini25Flash(); + case GEMINI20FLASH: + return visitor.visitGemini20Flash(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AgentV1UpdateThinkThinkContextLengthProviderGoogleModel valueOf(String value) { + switch (value) { + case "gemini-2.0-flash-lite": + return GEMINI20FLASH_LITE; + case "gemini-2.5-flash": + return GEMINI25FLASH; + case "gemini-2.0-flash": + return GEMINI20FLASH; + default: + return new AgentV1UpdateThinkThinkContextLengthProviderGoogleModel(Value.UNKNOWN, value); + } + } + + public enum Value { + GEMINI20FLASH, + + GEMINI20FLASH_LITE, + + GEMINI25FLASH, + + UNKNOWN + } + + public interface Visitor { + T visitGemini20Flash(); + + T visitGemini20FlashLite(); + + T visitGemini25Flash(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderGroq.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderGroq.java new file mode 100644 index 0000000..bce145c --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderGroq.java @@ -0,0 +1,149 @@ +/** + * 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.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AgentV1UpdateThinkThinkContextLengthProviderGroq.Builder.class) +public final class AgentV1UpdateThinkThinkContextLengthProviderGroq { + private final Optional version; + + private final Optional temperature; + + private final Map additionalProperties; + + private AgentV1UpdateThinkThinkContextLengthProviderGroq( + Optional version, Optional temperature, Map additionalProperties) { + this.version = version; + this.temperature = temperature; + this.additionalProperties = additionalProperties; + } + + /** + * @return The REST API version for the Groq's chat completions API (mostly OpenAI-compatible) + */ + @JsonProperty("version") + public Optional getVersion() { + return version; + } + + /** + * @return Groq model to use + */ + @JsonProperty("model") + public String getModel() { + return "openai/gpt-oss-20b"; + } + + /** + * @return Groq temperature (0-2) + */ + @JsonProperty("temperature") + public Optional getTemperature() { + return temperature; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkContextLengthProviderGroq + && equalTo((AgentV1UpdateThinkThinkContextLengthProviderGroq) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThinkThinkContextLengthProviderGroq other) { + return version.equals(other.version) && temperature.equals(other.temperature); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.version, this.temperature); + } + + @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 version = Optional.empty(); + + private Optional temperature = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AgentV1UpdateThinkThinkContextLengthProviderGroq other) { + version(other.getVersion()); + temperature(other.getTemperature()); + return this; + } + + /** + *

The REST API version for the Groq's chat completions API (mostly OpenAI-compatible)

+ */ + @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; + } + + /** + *

Groq temperature (0-2)

+ */ + @JsonSetter(value = "temperature", nulls = Nulls.SKIP) + public Builder temperature(Optional temperature) { + this.temperature = temperature; + return this; + } + + public Builder temperature(Double temperature) { + this.temperature = Optional.ofNullable(temperature); + return this; + } + + public AgentV1UpdateThinkThinkContextLengthProviderGroq build() { + return new AgentV1UpdateThinkThinkContextLengthProviderGroq(version, temperature, 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/AgentV1UpdateThinkThinkContextLengthProviderOpenAi.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderOpenAi.java new file mode 100644 index 0000000..cf4e9ba --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderOpenAi.java @@ -0,0 +1,219 @@ +/** + * 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.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AgentV1UpdateThinkThinkContextLengthProviderOpenAi.Builder.class) +public final class AgentV1UpdateThinkThinkContextLengthProviderOpenAi { + private final Optional version; + + private final AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel model; + + private final Optional temperature; + + private final Map additionalProperties; + + private AgentV1UpdateThinkThinkContextLengthProviderOpenAi( + Optional version, + AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel model, + Optional temperature, + Map additionalProperties) { + this.version = version; + this.model = model; + this.temperature = temperature; + this.additionalProperties = additionalProperties; + } + + /** + * @return The REST API version for the OpenAI chat completions API + */ + @JsonProperty("version") + public Optional getVersion() { + return version; + } + + /** + * @return OpenAI model to use + */ + @JsonProperty("model") + public AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel getModel() { + return model; + } + + /** + * @return OpenAI temperature (0-2) + */ + @JsonProperty("temperature") + public Optional getTemperature() { + return temperature; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkContextLengthProviderOpenAi + && equalTo((AgentV1UpdateThinkThinkContextLengthProviderOpenAi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThinkThinkContextLengthProviderOpenAi other) { + return version.equals(other.version) && model.equals(other.model) && temperature.equals(other.temperature); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.version, this.model, this.temperature); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + /** + *

OpenAI model to use

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

The REST API version for the OpenAI chat completions API

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

OpenAI temperature (0-2)

+ */ + _FinalStage temperature(Optional temperature); + + _FinalStage temperature(Double temperature); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel model; + + private Optional temperature = Optional.empty(); + + private Optional version = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AgentV1UpdateThinkThinkContextLengthProviderOpenAi other) { + version(other.getVersion()); + model(other.getModel()); + temperature(other.getTemperature()); + return this; + } + + /** + *

OpenAI model to use

+ *

OpenAI model to use

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

OpenAI temperature (0-2)

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

OpenAI temperature (0-2)

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

The REST API version for the OpenAI chat completions API

+ * @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; + } + + /** + *

The REST API version for the OpenAI chat completions API

+ */ + @java.lang.Override + @JsonSetter(value = "version", nulls = Nulls.SKIP) + public _FinalStage version(Optional version) { + this.version = version; + return this; + } + + @java.lang.Override + public AgentV1UpdateThinkThinkContextLengthProviderOpenAi build() { + return new AgentV1UpdateThinkThinkContextLengthProviderOpenAi( + version, model, temperature, 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/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel.java new file mode 100644 index 0000000..4c6adfa --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel.java @@ -0,0 +1,153 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.deepgram.resources.agent.v1.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel { + public static final AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel GPT5MINI = + new AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel(Value.GPT5MINI, "gpt-5-mini"); + + public static final AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel GPT4O_MINI = + new AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel(Value.GPT4O_MINI, "gpt-4o-mini"); + + public static final AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel GPT4O = + new AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel(Value.GPT4O, "gpt-4o"); + + public static final AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel GPT41NANO = + new AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel(Value.GPT41NANO, "gpt-4.1-nano"); + + public static final AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel GPT5 = + new AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel(Value.GPT5, "gpt-5"); + + public static final AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel GPT41MINI = + new AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel(Value.GPT41MINI, "gpt-4.1-mini"); + + public static final AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel GPT5NANO = + new AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel(Value.GPT5NANO, "gpt-5-nano"); + + public static final AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel GPT41 = + new AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel(Value.GPT41, "gpt-4.1"); + + private final Value value; + + private final String string; + + AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel(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 AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel + && this.string.equals( + ((AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case GPT5MINI: + return visitor.visitGpt5Mini(); + case GPT4O_MINI: + return visitor.visitGpt4OMini(); + case GPT4O: + return visitor.visitGpt4O(); + case GPT41NANO: + return visitor.visitGpt41Nano(); + case GPT5: + return visitor.visitGpt5(); + case GPT41MINI: + return visitor.visitGpt41Mini(); + case GPT5NANO: + return visitor.visitGpt5Nano(); + case GPT41: + return visitor.visitGpt41(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel valueOf(String value) { + switch (value) { + case "gpt-5-mini": + return GPT5MINI; + case "gpt-4o-mini": + return GPT4O_MINI; + case "gpt-4o": + return GPT4O; + case "gpt-4.1-nano": + return GPT41NANO; + case "gpt-5": + return GPT5; + case "gpt-4.1-mini": + return GPT41MINI; + case "gpt-5-nano": + return GPT5NANO; + case "gpt-4.1": + return GPT41; + default: + return new AgentV1UpdateThinkThinkContextLengthProviderOpenAiModel(Value.UNKNOWN, value); + } + } + + public enum Value { + GPT5, + + GPT5MINI, + + GPT5NANO, + + GPT41, + + GPT41MINI, + + GPT41NANO, + + GPT4O, + + GPT4O_MINI, + + UNKNOWN + } + + public interface Visitor { + T visitGpt5(); + + T visitGpt5Mini(); + + T visitGpt5Nano(); + + T visitGpt41(); + + T visitGpt41Mini(); + + T visitGpt41Nano(); + + T visitGpt4O(); + + T visitGpt4OMini(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItem.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItem.java new file mode 100644 index 0000000..fdf7378 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItem.java @@ -0,0 +1,270 @@ +/** + * 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 = AgentV1UpdateThinkThinkOneItem.Builder.class) +public final class AgentV1UpdateThinkThinkOneItem { + private final AgentV1UpdateThinkThinkOneItemProvider provider; + + private final Optional endpoint; + + private final Optional> functions; + + private final Optional prompt; + + private final Optional contextLength; + + private final Map additionalProperties; + + private AgentV1UpdateThinkThinkOneItem( + AgentV1UpdateThinkThinkOneItemProvider provider, + Optional endpoint, + Optional> functions, + Optional prompt, + Optional contextLength, + Map additionalProperties) { + this.provider = provider; + this.endpoint = endpoint; + this.functions = functions; + this.prompt = prompt; + this.contextLength = contextLength; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("provider") + public AgentV1UpdateThinkThinkOneItemProvider getProvider() { + return provider; + } + + /** + * @return Optional for non-Deepgram LLM providers. When present, must include url field and headers object + */ + @JsonProperty("endpoint") + public Optional getEndpoint() { + return endpoint; + } + + @JsonProperty("functions") + public Optional> getFunctions() { + return functions; + } + + @JsonProperty("prompt") + public Optional getPrompt() { + return prompt; + } + + /** + * @return Specifies the number of characters retained in context between user messages, agent responses, and function calls. This setting is only configurable when a custom think endpoint is used + */ + @JsonProperty("context_length") + public Optional getContextLength() { + return contextLength; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkOneItem && equalTo((AgentV1UpdateThinkThinkOneItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThinkThinkOneItem other) { + return provider.equals(other.provider) + && endpoint.equals(other.endpoint) + && functions.equals(other.functions) + && prompt.equals(other.prompt) + && contextLength.equals(other.contextLength); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.provider, this.endpoint, this.functions, this.prompt, this.contextLength); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ProviderStage builder() { + return new Builder(); + } + + public interface ProviderStage { + _FinalStage provider(@NotNull AgentV1UpdateThinkThinkOneItemProvider provider); + + Builder from(AgentV1UpdateThinkThinkOneItem other); + } + + public interface _FinalStage { + AgentV1UpdateThinkThinkOneItem build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

Optional for non-Deepgram LLM providers. When present, must include url field and headers object

+ */ + _FinalStage endpoint(Optional endpoint); + + _FinalStage endpoint(AgentV1UpdateThinkThinkOneItemEndpoint endpoint); + + _FinalStage functions(Optional> functions); + + _FinalStage functions(List functions); + + _FinalStage prompt(Optional prompt); + + _FinalStage prompt(String prompt); + + /** + *

Specifies the number of characters retained in context between user messages, agent responses, and function calls. This setting is only configurable when a custom think endpoint is used

+ */ + _FinalStage contextLength(Optional contextLength); + + _FinalStage contextLength(AgentV1UpdateThinkThinkOneItemContextLength contextLength); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ProviderStage, _FinalStage { + private AgentV1UpdateThinkThinkOneItemProvider provider; + + private Optional contextLength = Optional.empty(); + + private Optional prompt = Optional.empty(); + + private Optional> functions = Optional.empty(); + + private Optional endpoint = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AgentV1UpdateThinkThinkOneItem other) { + provider(other.getProvider()); + endpoint(other.getEndpoint()); + functions(other.getFunctions()); + prompt(other.getPrompt()); + contextLength(other.getContextLength()); + return this; + } + + @java.lang.Override + @JsonSetter("provider") + public _FinalStage provider(@NotNull AgentV1UpdateThinkThinkOneItemProvider provider) { + this.provider = Objects.requireNonNull(provider, "provider must not be null"); + return this; + } + + /** + *

Specifies the number of characters retained in context between user messages, agent responses, and function calls. This setting is only configurable when a custom think endpoint is used

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

Specifies the number of characters retained in context between user messages, agent responses, and function calls. This setting is only configurable when a custom think endpoint is used

+ */ + @java.lang.Override + @JsonSetter(value = "context_length", nulls = Nulls.SKIP) + public _FinalStage contextLength(Optional contextLength) { + this.contextLength = contextLength; + return this; + } + + @java.lang.Override + public _FinalStage prompt(String prompt) { + this.prompt = Optional.ofNullable(prompt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "prompt", nulls = Nulls.SKIP) + public _FinalStage prompt(Optional prompt) { + this.prompt = prompt; + return this; + } + + @java.lang.Override + public _FinalStage functions(List functions) { + this.functions = Optional.ofNullable(functions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "functions", nulls = Nulls.SKIP) + public _FinalStage functions(Optional> functions) { + this.functions = functions; + return this; + } + + /** + *

Optional for non-Deepgram LLM providers. When present, must include url field and headers object

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

Optional for non-Deepgram LLM providers. When present, must include url field and headers object

+ */ + @java.lang.Override + @JsonSetter(value = "endpoint", nulls = Nulls.SKIP) + public _FinalStage endpoint(Optional endpoint) { + this.endpoint = endpoint; + return this; + } + + @java.lang.Override + public AgentV1UpdateThinkThinkOneItem build() { + return new AgentV1UpdateThinkThinkOneItem( + provider, endpoint, functions, prompt, contextLength, 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/agent/v1/types/AgentV1UpdateThinkThinkOneItemContextLength.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemContextLength.java new file mode 100644 index 0000000..5e5497c --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemContextLength.java @@ -0,0 +1,108 @@ +/** + * 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.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AgentV1UpdateThinkThinkOneItemContextLength.Deserializer.class) +public final class AgentV1UpdateThinkThinkOneItemContextLength { + private final Object value; + + private final int type; + + private AgentV1UpdateThinkThinkOneItemContextLength(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((double) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkOneItemContextLength + && equalTo((AgentV1UpdateThinkThinkOneItemContextLength) other); + } + + private boolean equalTo(AgentV1UpdateThinkThinkOneItemContextLength other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + /** + * @param value must be one of the following: + *
    + *
  • "max"
  • + *
+ */ + public static AgentV1UpdateThinkThinkOneItemContextLength of(String value) { + return new AgentV1UpdateThinkThinkOneItemContextLength(value, 0); + } + + public static AgentV1UpdateThinkThinkOneItemContextLength of(double value) { + return new AgentV1UpdateThinkThinkOneItemContextLength(value, 1); + } + + public interface Visitor { + /** + * @param value must be one of the following: + *
    + *
  • "max"
  • + *
+ */ + T visit(String value); + + T visit(double value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AgentV1UpdateThinkThinkOneItemContextLength.class); + } + + @java.lang.Override + public AgentV1UpdateThinkThinkOneItemContextLength deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + if (value instanceof Double) { + return of((Double) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemEndpoint.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemEndpoint.java new file mode 100644 index 0000000..da069f4 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemEndpoint.java @@ -0,0 +1,141 @@ +/** + * 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.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AgentV1UpdateThinkThinkOneItemEndpoint.Builder.class) +public final class AgentV1UpdateThinkThinkOneItemEndpoint { + private final Optional url; + + private final Optional> headers; + + private final Map additionalProperties; + + private AgentV1UpdateThinkThinkOneItemEndpoint( + Optional url, Optional> headers, Map additionalProperties) { + this.url = url; + this.headers = headers; + this.additionalProperties = additionalProperties; + } + + /** + * @return Custom LLM endpoint URL + */ + @JsonProperty("url") + public Optional getUrl() { + return url; + } + + /** + * @return Custom headers for the endpoint + */ + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkOneItemEndpoint + && equalTo((AgentV1UpdateThinkThinkOneItemEndpoint) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThinkThinkOneItemEndpoint other) { + return url.equals(other.url) && headers.equals(other.headers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.url, this.headers); + } + + @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 url = Optional.empty(); + + private Optional> headers = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AgentV1UpdateThinkThinkOneItemEndpoint other) { + url(other.getUrl()); + headers(other.getHeaders()); + return this; + } + + /** + *

Custom LLM endpoint URL

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

Custom headers for the endpoint

+ */ + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public Builder headers(Optional> headers) { + this.headers = headers; + return this; + } + + public Builder headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + public AgentV1UpdateThinkThinkOneItemEndpoint build() { + return new AgentV1UpdateThinkThinkOneItemEndpoint(url, headers, 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/AgentV1UpdateThinkThinkOneItemFunctionsItem.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemFunctionsItem.java new file mode 100644 index 0000000..b92c1bb --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemFunctionsItem.java @@ -0,0 +1,205 @@ +/** + * 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.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AgentV1UpdateThinkThinkOneItemFunctionsItem.Builder.class) +public final class AgentV1UpdateThinkThinkOneItemFunctionsItem { + private final Optional name; + + private final Optional description; + + private final Optional> parameters; + + private final Optional endpoint; + + private final Map additionalProperties; + + private AgentV1UpdateThinkThinkOneItemFunctionsItem( + Optional name, + Optional description, + Optional> parameters, + Optional endpoint, + Map additionalProperties) { + this.name = name; + this.description = description; + this.parameters = parameters; + this.endpoint = endpoint; + this.additionalProperties = additionalProperties; + } + + /** + * @return Function name + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Function description + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return Function parameters + */ + @JsonProperty("parameters") + public Optional> getParameters() { + return parameters; + } + + /** + * @return The Function endpoint to call. if not passed, function is called client-side + */ + @JsonProperty("endpoint") + public Optional getEndpoint() { + return endpoint; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkOneItemFunctionsItem + && equalTo((AgentV1UpdateThinkThinkOneItemFunctionsItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThinkThinkOneItemFunctionsItem other) { + return name.equals(other.name) + && description.equals(other.description) + && parameters.equals(other.parameters) + && endpoint.equals(other.endpoint); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.parameters, this.endpoint); + } + + @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 name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional> parameters = Optional.empty(); + + private Optional endpoint = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AgentV1UpdateThinkThinkOneItemFunctionsItem other) { + name(other.getName()); + description(other.getDescription()); + parameters(other.getParameters()); + endpoint(other.getEndpoint()); + return this; + } + + /** + *

Function name

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

Function description

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

Function parameters

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

The Function endpoint to call. if not passed, function is called client-side

+ */ + @JsonSetter(value = "endpoint", nulls = Nulls.SKIP) + public Builder endpoint(Optional endpoint) { + this.endpoint = endpoint; + return this; + } + + public Builder endpoint(AgentV1UpdateThinkThinkOneItemFunctionsItemEndpoint endpoint) { + this.endpoint = Optional.ofNullable(endpoint); + return this; + } + + public AgentV1UpdateThinkThinkOneItemFunctionsItem build() { + return new AgentV1UpdateThinkThinkOneItemFunctionsItem( + name, description, parameters, endpoint, 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/AgentV1UpdateThinkThinkOneItemFunctionsItemEndpoint.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemFunctionsItemEndpoint.java new file mode 100644 index 0000000..040608f --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemFunctionsItemEndpoint.java @@ -0,0 +1,166 @@ +/** + * 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.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AgentV1UpdateThinkThinkOneItemFunctionsItemEndpoint.Builder.class) +public final class AgentV1UpdateThinkThinkOneItemFunctionsItemEndpoint { + private final Optional url; + + private final Optional method; + + private final Optional> headers; + + private final Map additionalProperties; + + private AgentV1UpdateThinkThinkOneItemFunctionsItemEndpoint( + Optional url, + Optional method, + Optional> headers, + Map additionalProperties) { + this.url = url; + this.method = method; + this.headers = headers; + this.additionalProperties = additionalProperties; + } + + /** + * @return Endpoint URL + */ + @JsonProperty("url") + public Optional getUrl() { + return url; + } + + /** + * @return HTTP method + */ + @JsonProperty("method") + public Optional getMethod() { + return method; + } + + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkOneItemFunctionsItemEndpoint + && equalTo((AgentV1UpdateThinkThinkOneItemFunctionsItemEndpoint) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThinkThinkOneItemFunctionsItemEndpoint other) { + return url.equals(other.url) && method.equals(other.method) && headers.equals(other.headers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.url, this.method, this.headers); + } + + @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 url = Optional.empty(); + + private Optional method = Optional.empty(); + + private Optional> headers = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AgentV1UpdateThinkThinkOneItemFunctionsItemEndpoint other) { + url(other.getUrl()); + method(other.getMethod()); + headers(other.getHeaders()); + return this; + } + + /** + *

Endpoint URL

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

HTTP method

+ */ + @JsonSetter(value = "method", nulls = Nulls.SKIP) + public Builder method(Optional method) { + this.method = method; + return this; + } + + public Builder method(String method) { + this.method = Optional.ofNullable(method); + return this; + } + + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public Builder headers(Optional> headers) { + this.headers = headers; + return this; + } + + public Builder headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + public AgentV1UpdateThinkThinkOneItemFunctionsItemEndpoint build() { + return new AgentV1UpdateThinkThinkOneItemFunctionsItemEndpoint(url, method, headers, 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/AgentV1UpdateThinkThinkOneItemProvider.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProvider.java new file mode 100644 index 0000000..803898c --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProvider.java @@ -0,0 +1,401 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.deepgram.resources.agent.v1.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class AgentV1UpdateThinkThinkOneItemProvider { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private AgentV1UpdateThinkThinkOneItemProvider(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static AgentV1UpdateThinkThinkOneItemProvider openAi(AgentV1UpdateThinkThinkOneItemProviderOpenAi value) { + return new AgentV1UpdateThinkThinkOneItemProvider(new OpenAiValue(value)); + } + + public static AgentV1UpdateThinkThinkOneItemProvider awsBedrock( + AgentV1UpdateThinkThinkOneItemProviderAwsBedrock value) { + return new AgentV1UpdateThinkThinkOneItemProvider(new AwsBedrockValue(value)); + } + + public static AgentV1UpdateThinkThinkOneItemProvider anthropic( + AgentV1UpdateThinkThinkOneItemProviderAnthropic value) { + return new AgentV1UpdateThinkThinkOneItemProvider(new AnthropicValue(value)); + } + + public static AgentV1UpdateThinkThinkOneItemProvider google(AgentV1UpdateThinkThinkOneItemProviderGoogle value) { + return new AgentV1UpdateThinkThinkOneItemProvider(new GoogleValue(value)); + } + + public static AgentV1UpdateThinkThinkOneItemProvider groq(AgentV1UpdateThinkThinkOneItemProviderGroq value) { + return new AgentV1UpdateThinkThinkOneItemProvider(new GroqValue(value)); + } + + public boolean isOpenAi() { + return value instanceof OpenAiValue; + } + + public boolean isAwsBedrock() { + return value instanceof AwsBedrockValue; + } + + public boolean isAnthropic() { + return value instanceof AnthropicValue; + } + + public boolean isGoogle() { + return value instanceof GoogleValue; + } + + public boolean isGroq() { + return value instanceof GroqValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getOpenAi() { + if (isOpenAi()) { + return Optional.of(((OpenAiValue) value).value); + } + return Optional.empty(); + } + + public Optional getAwsBedrock() { + if (isAwsBedrock()) { + return Optional.of(((AwsBedrockValue) value).value); + } + return Optional.empty(); + } + + public Optional getAnthropic() { + if (isAnthropic()) { + return Optional.of(((AnthropicValue) value).value); + } + return Optional.empty(); + } + + public Optional getGoogle() { + if (isGoogle()) { + return Optional.of(((GoogleValue) value).value); + } + return Optional.empty(); + } + + public Optional getGroq() { + if (isGroq()) { + return Optional.of(((GroqValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkOneItemProvider + && value.equals(((AgentV1UpdateThinkThinkOneItemProvider) other).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return value.toString(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitOpenAi(AgentV1UpdateThinkThinkOneItemProviderOpenAi openAi); + + T visitAwsBedrock(AgentV1UpdateThinkThinkOneItemProviderAwsBedrock awsBedrock); + + T visitAnthropic(AgentV1UpdateThinkThinkOneItemProviderAnthropic anthropic); + + T visitGoogle(AgentV1UpdateThinkThinkOneItemProviderGoogle google); + + T visitGroq(AgentV1UpdateThinkThinkOneItemProviderGroq groq); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(OpenAiValue.class), + @JsonSubTypes.Type(AwsBedrockValue.class), + @JsonSubTypes.Type(AnthropicValue.class), + @JsonSubTypes.Type(GoogleValue.class), + @JsonSubTypes.Type(GroqValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("open_ai") + @JsonIgnoreProperties("type") + private static final class OpenAiValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private AgentV1UpdateThinkThinkOneItemProviderOpenAi value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private OpenAiValue() {} + + private OpenAiValue(AgentV1UpdateThinkThinkOneItemProviderOpenAi value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitOpenAi(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OpenAiValue && equalTo((OpenAiValue) other); + } + + private boolean equalTo(OpenAiValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AgentV1UpdateThinkThinkOneItemProvider{" + "value: " + value + "}"; + } + } + + @JsonTypeName("aws_bedrock") + @JsonIgnoreProperties("type") + private static final class AwsBedrockValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private AgentV1UpdateThinkThinkOneItemProviderAwsBedrock value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private AwsBedrockValue() {} + + private AwsBedrockValue(AgentV1UpdateThinkThinkOneItemProviderAwsBedrock value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitAwsBedrock(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AwsBedrockValue && equalTo((AwsBedrockValue) other); + } + + private boolean equalTo(AwsBedrockValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AgentV1UpdateThinkThinkOneItemProvider{" + "value: " + value + "}"; + } + } + + @JsonTypeName("anthropic") + @JsonIgnoreProperties("type") + private static final class AnthropicValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private AgentV1UpdateThinkThinkOneItemProviderAnthropic value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private AnthropicValue() {} + + private AnthropicValue(AgentV1UpdateThinkThinkOneItemProviderAnthropic value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitAnthropic(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AnthropicValue && equalTo((AnthropicValue) other); + } + + private boolean equalTo(AnthropicValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AgentV1UpdateThinkThinkOneItemProvider{" + "value: " + value + "}"; + } + } + + @JsonTypeName("google") + @JsonIgnoreProperties("type") + private static final class GoogleValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private AgentV1UpdateThinkThinkOneItemProviderGoogle value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private GoogleValue() {} + + private GoogleValue(AgentV1UpdateThinkThinkOneItemProviderGoogle value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitGoogle(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GoogleValue && equalTo((GoogleValue) other); + } + + private boolean equalTo(GoogleValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AgentV1UpdateThinkThinkOneItemProvider{" + "value: " + value + "}"; + } + } + + @JsonTypeName("groq") + @JsonIgnoreProperties("type") + private static final class GroqValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private AgentV1UpdateThinkThinkOneItemProviderGroq value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private GroqValue() {} + + private GroqValue(AgentV1UpdateThinkThinkOneItemProviderGroq value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitGroq(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GroqValue && equalTo((GroqValue) other); + } + + private boolean equalTo(GroqValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "AgentV1UpdateThinkThinkOneItemProvider{" + "value: " + value + "}"; + } + } + + @JsonIgnoreProperties("type") + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "AgentV1UpdateThinkThinkOneItemProvider{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAnthropic.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAnthropic.java new file mode 100644 index 0000000..866b87d --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAnthropic.java @@ -0,0 +1,219 @@ +/** + * 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.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AgentV1UpdateThinkThinkOneItemProviderAnthropic.Builder.class) +public final class AgentV1UpdateThinkThinkOneItemProviderAnthropic { + private final Optional version; + + private final AgentV1UpdateThinkThinkOneItemProviderAnthropicModel model; + + private final Optional temperature; + + private final Map additionalProperties; + + private AgentV1UpdateThinkThinkOneItemProviderAnthropic( + Optional version, + AgentV1UpdateThinkThinkOneItemProviderAnthropicModel model, + Optional temperature, + Map additionalProperties) { + this.version = version; + this.model = model; + this.temperature = temperature; + this.additionalProperties = additionalProperties; + } + + /** + * @return The REST API version for the Anthropic Messages API + */ + @JsonProperty("version") + public Optional getVersion() { + return version; + } + + /** + * @return Anthropic model to use + */ + @JsonProperty("model") + public AgentV1UpdateThinkThinkOneItemProviderAnthropicModel getModel() { + return model; + } + + /** + * @return Anthropic temperature (0-1) + */ + @JsonProperty("temperature") + public Optional getTemperature() { + return temperature; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkOneItemProviderAnthropic + && equalTo((AgentV1UpdateThinkThinkOneItemProviderAnthropic) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThinkThinkOneItemProviderAnthropic other) { + return version.equals(other.version) && model.equals(other.model) && temperature.equals(other.temperature); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.version, this.model, this.temperature); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + /** + *

Anthropic model to use

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

The REST API version for the Anthropic Messages API

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

Anthropic temperature (0-1)

+ */ + _FinalStage temperature(Optional temperature); + + _FinalStage temperature(Double temperature); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private AgentV1UpdateThinkThinkOneItemProviderAnthropicModel model; + + private Optional temperature = Optional.empty(); + + private Optional version = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AgentV1UpdateThinkThinkOneItemProviderAnthropic other) { + version(other.getVersion()); + model(other.getModel()); + temperature(other.getTemperature()); + return this; + } + + /** + *

Anthropic model to use

+ *

Anthropic model to use

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

Anthropic temperature (0-1)

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

Anthropic temperature (0-1)

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

The REST API version for the Anthropic Messages API

+ * @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; + } + + /** + *

The REST API version for the Anthropic Messages API

+ */ + @java.lang.Override + @JsonSetter(value = "version", nulls = Nulls.SKIP) + public _FinalStage version(Optional version) { + this.version = version; + return this; + } + + @java.lang.Override + public AgentV1UpdateThinkThinkOneItemProviderAnthropic build() { + return new AgentV1UpdateThinkThinkOneItemProviderAnthropic( + version, model, temperature, 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/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAnthropicModel.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAnthropicModel.java new file mode 100644 index 0000000..1ec75ee --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAnthropicModel.java @@ -0,0 +1,88 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.deepgram.resources.agent.v1.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class AgentV1UpdateThinkThinkOneItemProviderAnthropicModel { + public static final AgentV1UpdateThinkThinkOneItemProviderAnthropicModel CLAUDE_SONNET420250514 = + new AgentV1UpdateThinkThinkOneItemProviderAnthropicModel( + Value.CLAUDE_SONNET420250514, "claude-sonnet-4-20250514"); + + public static final AgentV1UpdateThinkThinkOneItemProviderAnthropicModel CLAUDE35HAIKU_LATEST = + new AgentV1UpdateThinkThinkOneItemProviderAnthropicModel( + Value.CLAUDE35HAIKU_LATEST, "claude-3-5-haiku-latest"); + + private final Value value; + + private final String string; + + AgentV1UpdateThinkThinkOneItemProviderAnthropicModel(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 AgentV1UpdateThinkThinkOneItemProviderAnthropicModel + && this.string.equals(((AgentV1UpdateThinkThinkOneItemProviderAnthropicModel) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CLAUDE_SONNET420250514: + return visitor.visitClaudeSonnet420250514(); + case CLAUDE35HAIKU_LATEST: + return visitor.visitClaude35HaikuLatest(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AgentV1UpdateThinkThinkOneItemProviderAnthropicModel valueOf(String value) { + switch (value) { + case "claude-sonnet-4-20250514": + return CLAUDE_SONNET420250514; + case "claude-3-5-haiku-latest": + return CLAUDE35HAIKU_LATEST; + default: + return new AgentV1UpdateThinkThinkOneItemProviderAnthropicModel(Value.UNKNOWN, value); + } + } + + public enum Value { + CLAUDE35HAIKU_LATEST, + + CLAUDE_SONNET420250514, + + UNKNOWN + } + + public interface Visitor { + T visitClaude35HaikuLatest(); + + T visitClaudeSonnet420250514(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAwsBedrock.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAwsBedrock.java new file mode 100644 index 0000000..cab7bc6 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAwsBedrock.java @@ -0,0 +1,222 @@ +/** + * 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.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AgentV1UpdateThinkThinkOneItemProviderAwsBedrock.Builder.class) +public final class AgentV1UpdateThinkThinkOneItemProviderAwsBedrock { + private final AgentV1UpdateThinkThinkOneItemProviderAwsBedrockModel model; + + private final Optional temperature; + + private final Optional credentials; + + private final Map additionalProperties; + + private AgentV1UpdateThinkThinkOneItemProviderAwsBedrock( + AgentV1UpdateThinkThinkOneItemProviderAwsBedrockModel model, + Optional temperature, + Optional credentials, + Map additionalProperties) { + this.model = model; + this.temperature = temperature; + this.credentials = credentials; + this.additionalProperties = additionalProperties; + } + + /** + * @return AWS Bedrock model to use + */ + @JsonProperty("model") + public AgentV1UpdateThinkThinkOneItemProviderAwsBedrockModel getModel() { + return model; + } + + /** + * @return AWS Bedrock temperature (0-2) + */ + @JsonProperty("temperature") + public Optional getTemperature() { + return temperature; + } + + /** + * @return AWS credentials type (STS short-lived or IAM long-lived) + */ + @JsonProperty("credentials") + public Optional getCredentials() { + return credentials; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkOneItemProviderAwsBedrock + && equalTo((AgentV1UpdateThinkThinkOneItemProviderAwsBedrock) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThinkThinkOneItemProviderAwsBedrock other) { + return model.equals(other.model) + && temperature.equals(other.temperature) + && credentials.equals(other.credentials); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.model, this.temperature, this.credentials); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + /** + *

AWS Bedrock model to use

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

AWS Bedrock temperature (0-2)

+ */ + _FinalStage temperature(Optional temperature); + + _FinalStage temperature(Double temperature); + + /** + *

AWS credentials type (STS short-lived or IAM long-lived)

+ */ + _FinalStage credentials(Optional credentials); + + _FinalStage credentials(AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentials credentials); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private AgentV1UpdateThinkThinkOneItemProviderAwsBedrockModel model; + + private Optional credentials = Optional.empty(); + + private Optional temperature = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AgentV1UpdateThinkThinkOneItemProviderAwsBedrock other) { + model(other.getModel()); + temperature(other.getTemperature()); + credentials(other.getCredentials()); + return this; + } + + /** + *

AWS Bedrock model to use

+ *

AWS Bedrock model to use

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

AWS credentials type (STS short-lived or IAM long-lived)

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

AWS credentials type (STS short-lived or IAM long-lived)

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

AWS Bedrock temperature (0-2)

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

AWS Bedrock temperature (0-2)

+ */ + @java.lang.Override + @JsonSetter(value = "temperature", nulls = Nulls.SKIP) + public _FinalStage temperature(Optional temperature) { + this.temperature = temperature; + return this; + } + + @java.lang.Override + public AgentV1UpdateThinkThinkOneItemProviderAwsBedrock build() { + return new AgentV1UpdateThinkThinkOneItemProviderAwsBedrock( + model, temperature, credentials, 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/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentials.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentials.java new file mode 100644 index 0000000..849cad4 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentials.java @@ -0,0 +1,235 @@ +/** + * 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.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentials.Builder.class) +public final class AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentials { + private final Optional type; + + private final Optional region; + + private final Optional accessKeyId; + + private final Optional secretAccessKey; + + private final Optional sessionToken; + + private final Map additionalProperties; + + private AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentials( + Optional type, + Optional region, + Optional accessKeyId, + Optional secretAccessKey, + Optional sessionToken, + Map additionalProperties) { + this.type = type; + this.region = region; + this.accessKeyId = accessKeyId; + this.secretAccessKey = secretAccessKey; + this.sessionToken = sessionToken; + this.additionalProperties = additionalProperties; + } + + /** + * @return AWS credentials type (STS short-lived or IAM long-lived) + */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return AWS region + */ + @JsonProperty("region") + public Optional getRegion() { + return region; + } + + /** + * @return AWS access key + */ + @JsonProperty("access_key_id") + public Optional getAccessKeyId() { + return accessKeyId; + } + + /** + * @return AWS secret access key + */ + @JsonProperty("secret_access_key") + public Optional getSecretAccessKey() { + return secretAccessKey; + } + + /** + * @return AWS session token (required for STS only) + */ + @JsonProperty("session_token") + public Optional getSessionToken() { + return sessionToken; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentials + && equalTo((AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentials) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentials other) { + return type.equals(other.type) + && region.equals(other.region) + && accessKeyId.equals(other.accessKeyId) + && secretAccessKey.equals(other.secretAccessKey) + && sessionToken.equals(other.sessionToken); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.region, this.accessKeyId, this.secretAccessKey, this.sessionToken); + } + + @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 type = Optional.empty(); + + private Optional region = Optional.empty(); + + private Optional accessKeyId = Optional.empty(); + + private Optional secretAccessKey = Optional.empty(); + + private Optional sessionToken = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentials other) { + type(other.getType()); + region(other.getRegion()); + accessKeyId(other.getAccessKeyId()); + secretAccessKey(other.getSecretAccessKey()); + sessionToken(other.getSessionToken()); + return this; + } + + /** + *

AWS credentials type (STS short-lived or IAM long-lived)

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

AWS region

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

AWS access key

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

AWS secret access key

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

AWS session token (required for STS only)

+ */ + @JsonSetter(value = "session_token", nulls = Nulls.SKIP) + public Builder sessionToken(Optional sessionToken) { + this.sessionToken = sessionToken; + return this; + } + + public Builder sessionToken(String sessionToken) { + this.sessionToken = Optional.ofNullable(sessionToken); + return this; + } + + public AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentials build() { + return new AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentials( + type, region, accessKeyId, secretAccessKey, sessionToken, 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/AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentialsType.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentialsType.java new file mode 100644 index 0000000..3891454 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentialsType.java @@ -0,0 +1,87 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.deepgram.resources.agent.v1.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentialsType { + public static final AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentialsType IAM = + new AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentialsType(Value.IAM, "iam"); + + public static final AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentialsType STS = + new AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentialsType(Value.STS, "sts"); + + private final Value value; + + private final String string; + + AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentialsType(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 AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentialsType + && this.string.equals( + ((AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentialsType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case IAM: + return visitor.visitIam(); + case STS: + return visitor.visitSts(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentialsType valueOf(String value) { + switch (value) { + case "iam": + return IAM; + case "sts": + return STS; + default: + return new AgentV1UpdateThinkThinkOneItemProviderAwsBedrockCredentialsType(Value.UNKNOWN, value); + } + } + + public enum Value { + STS, + + IAM, + + UNKNOWN + } + + public interface Visitor { + T visitSts(); + + T visitIam(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAwsBedrockModel.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAwsBedrockModel.java new file mode 100644 index 0000000..4f4ad8e --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderAwsBedrockModel.java @@ -0,0 +1,88 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.deepgram.resources.agent.v1.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class AgentV1UpdateThinkThinkOneItemProviderAwsBedrockModel { + public static final AgentV1UpdateThinkThinkOneItemProviderAwsBedrockModel ANTHROPIC_CLAUDE35HAIKU20240307V10 = + new AgentV1UpdateThinkThinkOneItemProviderAwsBedrockModel( + Value.ANTHROPIC_CLAUDE35HAIKU20240307V10, "anthropic/claude-3-5-haiku-20240307-v1:0"); + + public static final AgentV1UpdateThinkThinkOneItemProviderAwsBedrockModel ANTHROPIC_CLAUDE35SONNET20240620V10 = + new AgentV1UpdateThinkThinkOneItemProviderAwsBedrockModel( + Value.ANTHROPIC_CLAUDE35SONNET20240620V10, "anthropic/claude-3-5-sonnet-20240620-v1:0"); + + private final Value value; + + private final String string; + + AgentV1UpdateThinkThinkOneItemProviderAwsBedrockModel(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 AgentV1UpdateThinkThinkOneItemProviderAwsBedrockModel + && this.string.equals(((AgentV1UpdateThinkThinkOneItemProviderAwsBedrockModel) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ANTHROPIC_CLAUDE35HAIKU20240307V10: + return visitor.visitAnthropicClaude35Haiku20240307V10(); + case ANTHROPIC_CLAUDE35SONNET20240620V10: + return visitor.visitAnthropicClaude35Sonnet20240620V10(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AgentV1UpdateThinkThinkOneItemProviderAwsBedrockModel valueOf(String value) { + switch (value) { + case "anthropic/claude-3-5-haiku-20240307-v1:0": + return ANTHROPIC_CLAUDE35HAIKU20240307V10; + case "anthropic/claude-3-5-sonnet-20240620-v1:0": + return ANTHROPIC_CLAUDE35SONNET20240620V10; + default: + return new AgentV1UpdateThinkThinkOneItemProviderAwsBedrockModel(Value.UNKNOWN, value); + } + } + + public enum Value { + ANTHROPIC_CLAUDE35SONNET20240620V10, + + ANTHROPIC_CLAUDE35HAIKU20240307V10, + + UNKNOWN + } + + public interface Visitor { + T visitAnthropicClaude35Sonnet20240620V10(); + + T visitAnthropicClaude35Haiku20240307V10(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderGoogle.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderGoogle.java new file mode 100644 index 0000000..9147815 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderGoogle.java @@ -0,0 +1,218 @@ +/** + * 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.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AgentV1UpdateThinkThinkOneItemProviderGoogle.Builder.class) +public final class AgentV1UpdateThinkThinkOneItemProviderGoogle { + private final Optional version; + + private final AgentV1UpdateThinkThinkOneItemProviderGoogleModel model; + + private final Optional temperature; + + private final Map additionalProperties; + + private AgentV1UpdateThinkThinkOneItemProviderGoogle( + Optional version, + AgentV1UpdateThinkThinkOneItemProviderGoogleModel model, + Optional temperature, + Map additionalProperties) { + this.version = version; + this.model = model; + this.temperature = temperature; + this.additionalProperties = additionalProperties; + } + + /** + * @return The REST API version for the Google generative language API + */ + @JsonProperty("version") + public Optional getVersion() { + return version; + } + + /** + * @return Google model to use + */ + @JsonProperty("model") + public AgentV1UpdateThinkThinkOneItemProviderGoogleModel getModel() { + return model; + } + + /** + * @return Google temperature (0-2) + */ + @JsonProperty("temperature") + public Optional getTemperature() { + return temperature; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkOneItemProviderGoogle + && equalTo((AgentV1UpdateThinkThinkOneItemProviderGoogle) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThinkThinkOneItemProviderGoogle other) { + return version.equals(other.version) && model.equals(other.model) && temperature.equals(other.temperature); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.version, this.model, this.temperature); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + /** + *

Google model to use

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

The REST API version for the Google generative language API

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

Google temperature (0-2)

+ */ + _FinalStage temperature(Optional temperature); + + _FinalStage temperature(Double temperature); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private AgentV1UpdateThinkThinkOneItemProviderGoogleModel model; + + private Optional temperature = Optional.empty(); + + private Optional version = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AgentV1UpdateThinkThinkOneItemProviderGoogle other) { + version(other.getVersion()); + model(other.getModel()); + temperature(other.getTemperature()); + return this; + } + + /** + *

Google model to use

+ *

Google model to use

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

Google temperature (0-2)

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

Google temperature (0-2)

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

The REST API version for the Google generative language API

+ * @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; + } + + /** + *

The REST API version for the Google generative language API

+ */ + @java.lang.Override + @JsonSetter(value = "version", nulls = Nulls.SKIP) + public _FinalStage version(Optional version) { + this.version = version; + return this; + } + + @java.lang.Override + public AgentV1UpdateThinkThinkOneItemProviderGoogle build() { + return new AgentV1UpdateThinkThinkOneItemProviderGoogle(version, model, temperature, 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/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderGoogleModel.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderGoogleModel.java new file mode 100644 index 0000000..14f6de6 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderGoogleModel.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.deepgram.resources.agent.v1.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class AgentV1UpdateThinkThinkOneItemProviderGoogleModel { + public static final AgentV1UpdateThinkThinkOneItemProviderGoogleModel GEMINI20FLASH_LITE = + new AgentV1UpdateThinkThinkOneItemProviderGoogleModel(Value.GEMINI20FLASH_LITE, "gemini-2.0-flash-lite"); + + public static final AgentV1UpdateThinkThinkOneItemProviderGoogleModel GEMINI25FLASH = + new AgentV1UpdateThinkThinkOneItemProviderGoogleModel(Value.GEMINI25FLASH, "gemini-2.5-flash"); + + public static final AgentV1UpdateThinkThinkOneItemProviderGoogleModel GEMINI20FLASH = + new AgentV1UpdateThinkThinkOneItemProviderGoogleModel(Value.GEMINI20FLASH, "gemini-2.0-flash"); + + private final Value value; + + private final String string; + + AgentV1UpdateThinkThinkOneItemProviderGoogleModel(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 AgentV1UpdateThinkThinkOneItemProviderGoogleModel + && this.string.equals(((AgentV1UpdateThinkThinkOneItemProviderGoogleModel) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case GEMINI20FLASH_LITE: + return visitor.visitGemini20FlashLite(); + case GEMINI25FLASH: + return visitor.visitGemini25Flash(); + case GEMINI20FLASH: + return visitor.visitGemini20Flash(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AgentV1UpdateThinkThinkOneItemProviderGoogleModel valueOf(String value) { + switch (value) { + case "gemini-2.0-flash-lite": + return GEMINI20FLASH_LITE; + case "gemini-2.5-flash": + return GEMINI25FLASH; + case "gemini-2.0-flash": + return GEMINI20FLASH; + default: + return new AgentV1UpdateThinkThinkOneItemProviderGoogleModel(Value.UNKNOWN, value); + } + } + + public enum Value { + GEMINI20FLASH, + + GEMINI20FLASH_LITE, + + GEMINI25FLASH, + + UNKNOWN + } + + public interface Visitor { + T visitGemini20Flash(); + + T visitGemini20FlashLite(); + + T visitGemini25Flash(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderGroq.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderGroq.java new file mode 100644 index 0000000..d00ae53 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderGroq.java @@ -0,0 +1,149 @@ +/** + * 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.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AgentV1UpdateThinkThinkOneItemProviderGroq.Builder.class) +public final class AgentV1UpdateThinkThinkOneItemProviderGroq { + private final Optional version; + + private final Optional temperature; + + private final Map additionalProperties; + + private AgentV1UpdateThinkThinkOneItemProviderGroq( + Optional version, Optional temperature, Map additionalProperties) { + this.version = version; + this.temperature = temperature; + this.additionalProperties = additionalProperties; + } + + /** + * @return The REST API version for the Groq's chat completions API (mostly OpenAI-compatible) + */ + @JsonProperty("version") + public Optional getVersion() { + return version; + } + + /** + * @return Groq model to use + */ + @JsonProperty("model") + public String getModel() { + return "openai/gpt-oss-20b"; + } + + /** + * @return Groq temperature (0-2) + */ + @JsonProperty("temperature") + public Optional getTemperature() { + return temperature; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkOneItemProviderGroq + && equalTo((AgentV1UpdateThinkThinkOneItemProviderGroq) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThinkThinkOneItemProviderGroq other) { + return version.equals(other.version) && temperature.equals(other.temperature); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.version, this.temperature); + } + + @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 version = Optional.empty(); + + private Optional temperature = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AgentV1UpdateThinkThinkOneItemProviderGroq other) { + version(other.getVersion()); + temperature(other.getTemperature()); + return this; + } + + /** + *

The REST API version for the Groq's chat completions API (mostly OpenAI-compatible)

+ */ + @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; + } + + /** + *

Groq temperature (0-2)

+ */ + @JsonSetter(value = "temperature", nulls = Nulls.SKIP) + public Builder temperature(Optional temperature) { + this.temperature = temperature; + return this; + } + + public Builder temperature(Double temperature) { + this.temperature = Optional.ofNullable(temperature); + return this; + } + + public AgentV1UpdateThinkThinkOneItemProviderGroq build() { + return new AgentV1UpdateThinkThinkOneItemProviderGroq(version, temperature, 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/AgentV1UpdateThinkThinkOneItemProviderOpenAi.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderOpenAi.java new file mode 100644 index 0000000..c238125 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderOpenAi.java @@ -0,0 +1,218 @@ +/** + * 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.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AgentV1UpdateThinkThinkOneItemProviderOpenAi.Builder.class) +public final class AgentV1UpdateThinkThinkOneItemProviderOpenAi { + private final Optional version; + + private final AgentV1UpdateThinkThinkOneItemProviderOpenAiModel model; + + private final Optional temperature; + + private final Map additionalProperties; + + private AgentV1UpdateThinkThinkOneItemProviderOpenAi( + Optional version, + AgentV1UpdateThinkThinkOneItemProviderOpenAiModel model, + Optional temperature, + Map additionalProperties) { + this.version = version; + this.model = model; + this.temperature = temperature; + this.additionalProperties = additionalProperties; + } + + /** + * @return The REST API version for the OpenAI chat completions API + */ + @JsonProperty("version") + public Optional getVersion() { + return version; + } + + /** + * @return OpenAI model to use + */ + @JsonProperty("model") + public AgentV1UpdateThinkThinkOneItemProviderOpenAiModel getModel() { + return model; + } + + /** + * @return OpenAI temperature (0-2) + */ + @JsonProperty("temperature") + public Optional getTemperature() { + return temperature; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AgentV1UpdateThinkThinkOneItemProviderOpenAi + && equalTo((AgentV1UpdateThinkThinkOneItemProviderOpenAi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AgentV1UpdateThinkThinkOneItemProviderOpenAi other) { + return version.equals(other.version) && model.equals(other.model) && temperature.equals(other.temperature); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.version, this.model, this.temperature); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + /** + *

OpenAI model to use

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

The REST API version for the OpenAI chat completions API

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

OpenAI temperature (0-2)

+ */ + _FinalStage temperature(Optional temperature); + + _FinalStage temperature(Double temperature); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private AgentV1UpdateThinkThinkOneItemProviderOpenAiModel model; + + private Optional temperature = Optional.empty(); + + private Optional version = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AgentV1UpdateThinkThinkOneItemProviderOpenAi other) { + version(other.getVersion()); + model(other.getModel()); + temperature(other.getTemperature()); + return this; + } + + /** + *

OpenAI model to use

+ *

OpenAI model to use

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

OpenAI temperature (0-2)

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

OpenAI temperature (0-2)

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

The REST API version for the OpenAI chat completions API

+ * @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; + } + + /** + *

The REST API version for the OpenAI chat completions API

+ */ + @java.lang.Override + @JsonSetter(value = "version", nulls = Nulls.SKIP) + public _FinalStage version(Optional version) { + this.version = version; + return this; + } + + @java.lang.Override + public AgentV1UpdateThinkThinkOneItemProviderOpenAi build() { + return new AgentV1UpdateThinkThinkOneItemProviderOpenAi(version, model, temperature, 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/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderOpenAiModel.java b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderOpenAiModel.java new file mode 100644 index 0000000..124ffc3 --- /dev/null +++ b/src/main/java/com/deepgram/resources/agent/v1/types/AgentV1UpdateThinkThinkOneItemProviderOpenAiModel.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.deepgram.resources.agent.v1.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class AgentV1UpdateThinkThinkOneItemProviderOpenAiModel { + public static final AgentV1UpdateThinkThinkOneItemProviderOpenAiModel GPT5MINI = + new AgentV1UpdateThinkThinkOneItemProviderOpenAiModel(Value.GPT5MINI, "gpt-5-mini"); + + public static final AgentV1UpdateThinkThinkOneItemProviderOpenAiModel GPT4O_MINI = + new AgentV1UpdateThinkThinkOneItemProviderOpenAiModel(Value.GPT4O_MINI, "gpt-4o-mini"); + + public static final AgentV1UpdateThinkThinkOneItemProviderOpenAiModel GPT4O = + new AgentV1UpdateThinkThinkOneItemProviderOpenAiModel(Value.GPT4O, "gpt-4o"); + + public static final AgentV1UpdateThinkThinkOneItemProviderOpenAiModel GPT41NANO = + new AgentV1UpdateThinkThinkOneItemProviderOpenAiModel(Value.GPT41NANO, "gpt-4.1-nano"); + + public static final AgentV1UpdateThinkThinkOneItemProviderOpenAiModel GPT5 = + new AgentV1UpdateThinkThinkOneItemProviderOpenAiModel(Value.GPT5, "gpt-5"); + + public static final AgentV1UpdateThinkThinkOneItemProviderOpenAiModel GPT41MINI = + new AgentV1UpdateThinkThinkOneItemProviderOpenAiModel(Value.GPT41MINI, "gpt-4.1-mini"); + + public static final AgentV1UpdateThinkThinkOneItemProviderOpenAiModel GPT5NANO = + new AgentV1UpdateThinkThinkOneItemProviderOpenAiModel(Value.GPT5NANO, "gpt-5-nano"); + + public static final AgentV1UpdateThinkThinkOneItemProviderOpenAiModel GPT41 = + new AgentV1UpdateThinkThinkOneItemProviderOpenAiModel(Value.GPT41, "gpt-4.1"); + + private final Value value; + + private final String string; + + AgentV1UpdateThinkThinkOneItemProviderOpenAiModel(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 AgentV1UpdateThinkThinkOneItemProviderOpenAiModel + && this.string.equals(((AgentV1UpdateThinkThinkOneItemProviderOpenAiModel) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case GPT5MINI: + return visitor.visitGpt5Mini(); + case GPT4O_MINI: + return visitor.visitGpt4OMini(); + case GPT4O: + return visitor.visitGpt4O(); + case GPT41NANO: + return visitor.visitGpt41Nano(); + case GPT5: + return visitor.visitGpt5(); + case GPT41MINI: + return visitor.visitGpt41Mini(); + case GPT5NANO: + return visitor.visitGpt5Nano(); + case GPT41: + return visitor.visitGpt41(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AgentV1UpdateThinkThinkOneItemProviderOpenAiModel valueOf(String value) { + switch (value) { + case "gpt-5-mini": + return GPT5MINI; + case "gpt-4o-mini": + return GPT4O_MINI; + case "gpt-4o": + return GPT4O; + case "gpt-4.1-nano": + return GPT41NANO; + case "gpt-5": + return GPT5; + case "gpt-4.1-mini": + return GPT41MINI; + case "gpt-5-nano": + return GPT5NANO; + case "gpt-4.1": + return GPT41; + default: + return new AgentV1UpdateThinkThinkOneItemProviderOpenAiModel(Value.UNKNOWN, value); + } + } + + public enum Value { + GPT5, + + GPT5MINI, + + GPT5NANO, + + GPT41, + + GPT41MINI, + + GPT41NANO, + + GPT4O, + + GPT4O_MINI, + + UNKNOWN + } + + public interface Visitor { + T visitGpt5(); + + T visitGpt5Mini(); + + T visitGpt5Nano(); + + T visitGpt41(); + + T visitGpt41Mini(); + + T visitGpt41Nano(); + + T visitGpt4O(); + + T visitGpt4OMini(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/deepgram/resources/agent/v1/websocket/V1WebSocketClient.java b/src/main/java/com/deepgram/resources/agent/v1/websocket/V1WebSocketClient.java index 5e78613..5add524 100644 --- a/src/main/java/com/deepgram/resources/agent/v1/websocket/V1WebSocketClient.java +++ b/src/main/java/com/deepgram/resources/agent/v1/websocket/V1WebSocketClient.java @@ -24,8 +24,10 @@ import com.deepgram.resources.agent.v1.types.AgentV1Settings; import com.deepgram.resources.agent.v1.types.AgentV1SettingsApplied; import com.deepgram.resources.agent.v1.types.AgentV1SpeakUpdated; +import com.deepgram.resources.agent.v1.types.AgentV1ThinkUpdated; import com.deepgram.resources.agent.v1.types.AgentV1UpdatePrompt; import com.deepgram.resources.agent.v1.types.AgentV1UpdateSpeak; +import com.deepgram.resources.agent.v1.types.AgentV1UpdateThink; import com.deepgram.resources.agent.v1.types.AgentV1UserStartedSpeaking; import com.deepgram.resources.agent.v1.types.AgentV1Warning; import com.deepgram.resources.agent.v1.types.AgentV1Welcome; @@ -76,6 +78,8 @@ public class V1WebSocketClient implements AutoCloseable { private volatile Consumer speakUpdatedHandler; + private volatile Consumer thinkUpdatedHandler; + private volatile Consumer injectionRefusedHandler; private volatile Consumer welcomeHandler; @@ -275,6 +279,15 @@ public CompletableFuture sendUpdatePrompt(AgentV1UpdatePrompt message) { return sendMessage(message); } + /** + * Sends an AgentV1UpdateThink message to the server asynchronously. + * @param message the message to send + * @return a CompletableFuture that completes when the message is sent + */ + public CompletableFuture sendUpdateThink(AgentV1UpdateThink message) { + return sendMessage(message); + } + /** * Sends an AgentV1Media message to the server asynchronously. * @param message the message to send @@ -317,6 +330,14 @@ public void onSpeakUpdated(Consumer handler) { this.speakUpdatedHandler = handler; } + /** + * Registers a handler for AgentV1ThinkUpdated messages from the server. + * @param handler the handler to invoke when a message is received + */ + public void onThinkUpdated(Consumer handler) { + this.thinkUpdatedHandler = handler; + } + /** * Registers a handler for AgentV1InjectionRefused messages from the server. * @param handler the handler to invoke when a message is received @@ -533,6 +554,14 @@ private void handleIncomingMessage(String json) { } } break; + case "ThinkUpdated": + if (thinkUpdatedHandler != null) { + AgentV1ThinkUpdated event = objectMapper.treeToValue(node, AgentV1ThinkUpdated.class); + if (event != null) { + thinkUpdatedHandler.accept(event); + } + } + break; case "InjectionRefused": if (injectionRefusedHandler != null) { AgentV1InjectionRefused event = objectMapper.treeToValue(node, AgentV1InjectionRefused.class); diff --git a/src/main/java/com/deepgram/resources/listen/v2/types/ListenV2ConfigureFailure.java b/src/main/java/com/deepgram/resources/listen/v2/types/ListenV2ConfigureFailure.java new file mode 100644 index 0000000..d1399b7 --- /dev/null +++ b/src/main/java/com/deepgram/resources/listen/v2/types/ListenV2ConfigureFailure.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.deepgram.resources.listen.v2.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.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListenV2ConfigureFailure.Builder.class) +public final class ListenV2ConfigureFailure { + private final String requestId; + + private final double sequenceId; + + private final Map additionalProperties; + + private ListenV2ConfigureFailure(String requestId, double sequenceId, Map additionalProperties) { + this.requestId = requestId; + this.sequenceId = sequenceId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Message type identifier + */ + @JsonProperty("type") + public String getType() { + return "ConfigureFailure"; + } + + /** + * @return The unique identifier of the request + */ + @JsonProperty("request_id") + public String getRequestId() { + return requestId; + } + + /** + * @return Starts at 0 and increments for each message the server sends + * to the client. This includes messages of other types, like + * TurnInfo messages. + */ + @JsonProperty("sequence_id") + public double getSequenceId() { + return sequenceId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListenV2ConfigureFailure && equalTo((ListenV2ConfigureFailure) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListenV2ConfigureFailure other) { + return requestId.equals(other.requestId) && sequenceId == other.sequenceId; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.requestId, this.sequenceId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RequestIdStage builder() { + return new Builder(); + } + + public interface RequestIdStage { + /** + *

The unique identifier of the request

+ */ + SequenceIdStage requestId(@NotNull String requestId); + + Builder from(ListenV2ConfigureFailure other); + } + + public interface SequenceIdStage { + /** + *

Starts at 0 and increments for each message the server sends + * to the client. This includes messages of other types, like + * TurnInfo messages.

+ */ + _FinalStage sequenceId(double sequenceId); + } + + public interface _FinalStage { + ListenV2ConfigureFailure build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RequestIdStage, SequenceIdStage, _FinalStage { + private String requestId; + + private double sequenceId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ListenV2ConfigureFailure other) { + requestId(other.getRequestId()); + sequenceId(other.getSequenceId()); + return this; + } + + /** + *

The unique identifier of the request

+ *

The unique identifier of the request

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

Starts at 0 and increments for each message the server sends + * to the client. This includes messages of other types, like + * TurnInfo messages.

+ *

Starts at 0 and increments for each message the server sends + * to the client. This includes messages of other types, like + * TurnInfo messages.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("sequence_id") + public _FinalStage sequenceId(double sequenceId) { + this.sequenceId = sequenceId; + return this; + } + + @java.lang.Override + public ListenV2ConfigureFailure build() { + return new ListenV2ConfigureFailure(requestId, sequenceId, 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/v2/websocket/V2WebSocketClient.java b/src/main/java/com/deepgram/resources/listen/v2/websocket/V2WebSocketClient.java index 7de5666..bcf3caa 100644 --- a/src/main/java/com/deepgram/resources/listen/v2/websocket/V2WebSocketClient.java +++ b/src/main/java/com/deepgram/resources/listen/v2/websocket/V2WebSocketClient.java @@ -9,6 +9,7 @@ import com.deepgram.core.ReconnectingWebSocketListener; import com.deepgram.core.WebSocketReadyState; import com.deepgram.resources.listen.v2.types.ListenV2CloseStream; +import com.deepgram.resources.listen.v2.types.ListenV2ConfigureFailure; import com.deepgram.resources.listen.v2.types.ListenV2Connected; import com.deepgram.resources.listen.v2.types.ListenV2FatalError; import com.deepgram.resources.listen.v2.types.ListenV2TurnInfo; @@ -57,6 +58,10 @@ public class V2WebSocketClient implements AutoCloseable { private volatile Consumer turnInfoHandler; + private volatile Consumer listenV2ConfigureSuccessHandler; + + private volatile Consumer configureFailureHandler; + private volatile Consumer errorHandler; /** @@ -229,6 +234,15 @@ public CompletableFuture sendCloseStream(ListenV2CloseStream message) { return sendMessage(message); } + /** + * Sends a ListenV2Configure message to the server asynchronously. + * @param message the message to send + * @return a CompletableFuture that completes when the message is sent + */ + public CompletableFuture sendListenV2Configure(Object message) { + return sendMessage(message); + } + /** * Registers a handler for ListenV2Connected messages from the server. * @param handler the handler to invoke when a message is received @@ -245,6 +259,22 @@ public void onTurnInfo(Consumer handler) { this.turnInfoHandler = handler; } + /** + * Registers a handler for ListenV2ConfigureSuccess messages from the server. + * @param handler the handler to invoke when a message is received + */ + public void onListenV2ConfigureSuccess(Consumer handler) { + this.listenV2ConfigureSuccessHandler = handler; + } + + /** + * Registers a handler for ListenV2ConfigureFailure messages from the server. + * @param handler the handler to invoke when a message is received + */ + public void onConfigureFailure(Consumer handler) { + this.configureFailureHandler = handler; + } + /** * Registers a handler for ListenV2FatalError messages from the server. * @param handler the handler to invoke when a message is received @@ -364,6 +394,22 @@ private void handleIncomingMessage(String json) { } } break; + case "ListenV2ConfigureSuccess": + if (listenV2ConfigureSuccessHandler != null) { + Object event = objectMapper.treeToValue(node, Object.class); + if (event != null) { + listenV2ConfigureSuccessHandler.accept(event); + } + } + break; + case "ConfigureFailure": + if (configureFailureHandler != null) { + ListenV2ConfigureFailure event = objectMapper.treeToValue(node, ListenV2ConfigureFailure.class); + if (event != null) { + configureFailureHandler.accept(event); + } + } + break; case "Error": if (errorHandler != null) { ListenV2FatalError event = objectMapper.treeToValue(node, ListenV2FatalError.class);