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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
},
"enable-wire-tests": true
},
"originGitCommit": "d1854cf6d560a0e27c9f46c1d83a6d7d9924f045",
"originGitCommit": "0052a020a7becd03b349857664c9f4a89b6c449a",
"originGitCommitIsDirty": true,
"invokedBy": "manual",
"sdkVersion": "0.4.0"
"sdkVersion": "0.4.1"
}
34 changes: 17 additions & 17 deletions src/main/java/com/deepgram/core/Environment.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,63 +5,63 @@

public final class Environment {
public static final Environment PRODUCTION =
new Environment("https://api.deepgram.com", "wss://agent.deepgram.com", "wss://api.deepgram.com");
new Environment("https://api.deepgram.com", "wss://api.deepgram.com", "wss://agent.deepgram.com");

public static final Environment AGENT =
new Environment("https://agent.deepgram.com", "wss://agent.deepgram.com", "wss://api.deepgram.com");
new Environment("https://agent.deepgram.com", "wss://api.deepgram.com", "wss://agent.deepgram.com");

private final String base;

private final String agent;

private final String production;

Environment(String base, String agent, String production) {
private final String agent;

Environment(String base, String production, String agent) {
this.base = base;
this.agent = agent;
this.production = production;
this.agent = agent;
}

public String getBaseURL() {
return this.base;
}

public String getAgentURL() {
return this.agent;
}

public String getProductionURL() {
return this.production;
}

public String getAgentURL() {
return this.agent;
}

public static Builder custom() {
return new Builder();
}

public static class Builder {
private String base;

private String agent;

private String production;

private String agent;

public Builder base(String base) {
this.base = base;
return this;
}

public Builder agent(String agent) {
this.agent = agent;
public Builder production(String production) {
this.production = production;
return this;
}

public Builder production(String production) {
this.production = production;
public Builder agent(String agent) {
this.agent = agent;
return this;
}

public Environment build() {
return new Environment(base, agent, production);
return new Environment(base, production, agent);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public CompletableFuture<DeepgramApiHttpResponse<AgentThinkModelsV1Response>> li
* Retrieves the available think models that can be used for AI agent processing
*/
public CompletableFuture<DeepgramApiHttpResponse<AgentThinkModelsV1Response>> list(RequestOptions requestOptions) {
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getBaseURL())
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getAgentURL())
.newBuilder()
.addPathSegments("v1/agent/settings/think/models");
if (requestOptions != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public DeepgramApiHttpResponse<AgentThinkModelsV1Response> list() {
* Retrieves the available think models that can be used for AI agent processing
*/
public DeepgramApiHttpResponse<AgentThinkModelsV1Response> list(RequestOptions requestOptions) {
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getBaseURL())
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getAgentURL())
.newBuilder()
.addPathSegments("v1/agent/settings/think/models");
if (requestOptions != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*/
package com.deepgram.resources.agent.v1.types;

import com.deepgram.types.DeepgramListenProviderV1;
import com.deepgram.types.DeepgramListenProviderV2;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand All @@ -26,11 +28,11 @@ public <T> T visit(Visitor<T> visitor) {
return value.visit(visitor);
}

public static AgentV1SettingsAgentContextListenProvider v1(AgentV1SettingsAgentContextListenProviderV1 value) {
public static AgentV1SettingsAgentContextListenProvider v1(DeepgramListenProviderV1 value) {
return new AgentV1SettingsAgentContextListenProvider(new V1Value(value));
}

public static AgentV1SettingsAgentContextListenProvider v2(AgentV1SettingsAgentContextListenProviderV2 value) {
public static AgentV1SettingsAgentContextListenProvider v2(DeepgramListenProviderV2 value) {
return new AgentV1SettingsAgentContextListenProvider(new V2Value(value));
}

Expand All @@ -46,14 +48,14 @@ public boolean _isUnknown() {
return value instanceof _UnknownValue;
}

public Optional<AgentV1SettingsAgentContextListenProviderV1> getV1() {
public Optional<DeepgramListenProviderV1> getV1() {
if (isV1()) {
return Optional.of(((V1Value) value).value);
}
return Optional.empty();
}

public Optional<AgentV1SettingsAgentContextListenProviderV2> getV2() {
public Optional<DeepgramListenProviderV2> getV2() {
if (isV2()) {
return Optional.of(((V2Value) value).value);
}
Expand Down Expand Up @@ -90,9 +92,9 @@ private Value getValue() {
}

public interface Visitor<T> {
T visitV1(AgentV1SettingsAgentContextListenProviderV1 v1);
T visitV1(DeepgramListenProviderV1 v1);

T visitV2(AgentV1SettingsAgentContextListenProviderV2 v2);
T visitV2(DeepgramListenProviderV2 v2);

T _visitUnknown(Object unknownType);
}
Expand All @@ -109,12 +111,12 @@ private interface Value {
private static final class V1Value implements Value {
@JsonUnwrapped
@JsonIgnoreProperties(value = "version", allowSetters = true)
private AgentV1SettingsAgentContextListenProviderV1 value;
private DeepgramListenProviderV1 value;

@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
private V1Value() {}

private V1Value(AgentV1SettingsAgentContextListenProviderV1 value) {
private V1Value(DeepgramListenProviderV1 value) {
this.value = value;
}

Expand Down Expand Up @@ -149,12 +151,12 @@ public String toString() {
private static final class V2Value implements Value {
@JsonUnwrapped
@JsonIgnoreProperties(value = "version", allowSetters = true)
private AgentV1SettingsAgentContextListenProviderV2 value;
private DeepgramListenProviderV2 value;

@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
private V2Value() {}

private V2Value(AgentV1SettingsAgentContextListenProviderV2 value) {
private V2Value(DeepgramListenProviderV2 value) {
this.value = value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*/
package com.deepgram.resources.agent.v1.types;

import com.deepgram.types.DeepgramListenProviderV1;
import com.deepgram.types.DeepgramListenProviderV2;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand All @@ -26,11 +28,11 @@ public <T> T visit(Visitor<T> visitor) {
return value.visit(visitor);
}

public static AgentV1SettingsAgentListenProvider v1(AgentV1SettingsAgentListenProviderV1 value) {
public static AgentV1SettingsAgentListenProvider v1(DeepgramListenProviderV1 value) {
return new AgentV1SettingsAgentListenProvider(new V1Value(value));
}

public static AgentV1SettingsAgentListenProvider v2(AgentV1SettingsAgentListenProviderV2 value) {
public static AgentV1SettingsAgentListenProvider v2(DeepgramListenProviderV2 value) {
return new AgentV1SettingsAgentListenProvider(new V2Value(value));
}

Expand All @@ -46,14 +48,14 @@ public boolean _isUnknown() {
return value instanceof _UnknownValue;
}

public Optional<AgentV1SettingsAgentListenProviderV1> getV1() {
public Optional<DeepgramListenProviderV1> getV1() {
if (isV1()) {
return Optional.of(((V1Value) value).value);
}
return Optional.empty();
}

public Optional<AgentV1SettingsAgentListenProviderV2> getV2() {
public Optional<DeepgramListenProviderV2> getV2() {
if (isV2()) {
return Optional.of(((V2Value) value).value);
}
Expand Down Expand Up @@ -90,9 +92,9 @@ private Value getValue() {
}

public interface Visitor<T> {
T visitV1(AgentV1SettingsAgentListenProviderV1 v1);
T visitV1(DeepgramListenProviderV1 v1);

T visitV2(AgentV1SettingsAgentListenProviderV2 v2);
T visitV2(DeepgramListenProviderV2 v2);

T _visitUnknown(Object unknownType);
}
Expand All @@ -109,12 +111,12 @@ private interface Value {
private static final class V1Value implements Value {
@JsonUnwrapped
@JsonIgnoreProperties(value = "version", allowSetters = true)
private AgentV1SettingsAgentListenProviderV1 value;
private DeepgramListenProviderV1 value;

@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
private V1Value() {}

private V1Value(AgentV1SettingsAgentListenProviderV1 value) {
private V1Value(DeepgramListenProviderV1 value) {
this.value = value;
}

Expand Down Expand Up @@ -149,12 +151,12 @@ public String toString() {
private static final class V2Value implements Value {
@JsonUnwrapped
@JsonIgnoreProperties(value = "version", allowSetters = true)
private AgentV1SettingsAgentListenProviderV2 value;
private DeepgramListenProviderV2 value;

@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
private V2Value() {}

private V2Value(AgentV1SettingsAgentListenProviderV2 value) {
private V2Value(DeepgramListenProviderV2 value) {
this.value = value;
}

Expand Down
Loading
Loading