Skip to content

Commit 7e39d09

Browse files
SDK regeneration
1 parent f3e48e3 commit 7e39d09

197 files changed

Lines changed: 11434 additions & 14090 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.fern/metadata.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"cliVersion": "4.46.0",
2+
"cliVersion": "4.92.0",
33
"generatorName": "fernapi/fern-java-sdk",
4-
"generatorVersion": "4.0.4",
4+
"generatorVersion": "4.6.1",
55
"generatorConfig": {
66
"package-prefix": "com.deepgram",
77
"base-api-exception-class-name": "DeepgramHttpException",
@@ -11,6 +11,8 @@
1111
},
1212
"enable-wire-tests": true
1313
},
14-
"originGitCommit": "e994b5ab79ae6fe3560daff055acdf80d315b48e",
15-
"sdkVersion": "0.2.1"
14+
"originGitCommit": "0d16d3b0d2f3da69dc058ea78f235b2b11288371",
15+
"originGitCommitIsDirty": true,
16+
"invokedBy": "manual",
17+
"sdkVersion": "0.2.2"
1618
}

context7.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/main/java/com/deepgram/AsyncDeepgramApiClient.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import com.deepgram.resources.read.AsyncReadClient;
1313
import com.deepgram.resources.selfhosted.AsyncSelfHostedClient;
1414
import com.deepgram.resources.speak.AsyncSpeakClient;
15+
import com.deepgram.resources.voiceagent.AsyncVoiceAgentClient;
1516
import java.util.function.Supplier;
1617

1718
public class AsyncDeepgramApiClient {
@@ -31,6 +32,8 @@ public class AsyncDeepgramApiClient {
3132

3233
protected final Supplier<AsyncSpeakClient> speakClient;
3334

35+
protected final Supplier<AsyncVoiceAgentClient> voiceAgentClient;
36+
3437
public AsyncDeepgramApiClient(ClientOptions clientOptions) {
3538
this.clientOptions = clientOptions;
3639
this.agentClient = Suppliers.memoize(() -> new AsyncAgentClient(clientOptions));
@@ -40,6 +43,7 @@ public AsyncDeepgramApiClient(ClientOptions clientOptions) {
4043
this.readClient = Suppliers.memoize(() -> new AsyncReadClient(clientOptions));
4144
this.selfHostedClient = Suppliers.memoize(() -> new AsyncSelfHostedClient(clientOptions));
4245
this.speakClient = Suppliers.memoize(() -> new AsyncSpeakClient(clientOptions));
46+
this.voiceAgentClient = Suppliers.memoize(() -> new AsyncVoiceAgentClient(clientOptions));
4347
}
4448

4549
public AsyncAgentClient agent() {
@@ -70,6 +74,10 @@ public AsyncSpeakClient speak() {
7074
return this.speakClient.get();
7175
}
7276

77+
public AsyncVoiceAgentClient voiceAgent() {
78+
return this.voiceAgentClient.get();
79+
}
80+
7381
public static AsyncDeepgramApiClientBuilder builder() {
7482
return new AsyncDeepgramApiClientBuilder();
7583
}

src/main/java/com/deepgram/DeepgramApiClient.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import com.deepgram.resources.read.ReadClient;
1313
import com.deepgram.resources.selfhosted.SelfHostedClient;
1414
import com.deepgram.resources.speak.SpeakClient;
15+
import com.deepgram.resources.voiceagent.VoiceAgentClient;
1516
import java.util.function.Supplier;
1617

1718
public class DeepgramApiClient {
@@ -31,6 +32,8 @@ public class DeepgramApiClient {
3132

3233
protected final Supplier<SpeakClient> speakClient;
3334

35+
protected final Supplier<VoiceAgentClient> voiceAgentClient;
36+
3437
public DeepgramApiClient(ClientOptions clientOptions) {
3538
this.clientOptions = clientOptions;
3639
this.agentClient = Suppliers.memoize(() -> new AgentClient(clientOptions));
@@ -40,6 +43,7 @@ public DeepgramApiClient(ClientOptions clientOptions) {
4043
this.readClient = Suppliers.memoize(() -> new ReadClient(clientOptions));
4144
this.selfHostedClient = Suppliers.memoize(() -> new SelfHostedClient(clientOptions));
4245
this.speakClient = Suppliers.memoize(() -> new SpeakClient(clientOptions));
46+
this.voiceAgentClient = Suppliers.memoize(() -> new VoiceAgentClient(clientOptions));
4347
}
4448

4549
public AgentClient agent() {
@@ -70,6 +74,10 @@ public SpeakClient speak() {
7074
return this.speakClient.get();
7175
}
7276

77+
public VoiceAgentClient voiceAgent() {
78+
return this.voiceAgentClient.get();
79+
}
80+
7381
public static DeepgramApiClientBuilder builder() {
7482
return new DeepgramApiClientBuilder();
7583
}

src/main/java/com/deepgram/core/ClientOptions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ private ClientOptions(
4141
this.headers.putAll(headers);
4242
this.headers.putAll(new HashMap<String, String>() {
4343
{
44-
put("User-Agent", "com.deepgram:deepgram-java-sdk/0.2.1"); // x-release-please-version
44+
put("User-Agent", "com.deepgram:deepgram-sdk/0.2.2");
4545
put("X-Fern-Language", "JAVA");
46-
put("X-Fern-SDK-Name", "com.deepgram:deepgram-java-sdk");
47-
put("X-Fern-SDK-Version", "0.2.1"); // x-release-please-version
46+
put("X-Fern-SDK-Name", "com.deepgram.fern:api-sdk");
47+
put("X-Fern-SDK-Version", "0.2.2");
4848
}
4949
});
5050
this.headerSuppliers = headerSuppliers;

src/main/java/com/deepgram/core/RetryInterceptor.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ public class RetryInterceptor implements Interceptor {
1919
private static final Duration MAX_RETRY_DELAY = Duration.ofMillis(60000);
2020
private static final double JITTER_FACTOR = 0.2;
2121

22-
private final ExponentialBackoff backoff;
22+
private final int maxRetries;
2323
private final Random random = new Random();
2424

2525
public RetryInterceptor(int maxRetries) {
26-
this.backoff = new ExponentialBackoff(maxRetries);
26+
this.maxRetries = maxRetries;
2727
}
2828

2929
@Override
@@ -38,7 +38,8 @@ public Response intercept(Chain chain) throws IOException {
3838
}
3939

4040
private Response retryChain(Response response, Chain chain) throws IOException {
41-
Optional<Duration> nextBackoff = this.backoff.nextBackoff(response);
41+
ExponentialBackoff backoff = new ExponentialBackoff(this.maxRetries);
42+
Optional<Duration> nextBackoff = backoff.nextBackoff(response);
4243
while (nextBackoff.isPresent()) {
4344
try {
4445
Thread.sleep(nextBackoff.get().toMillis());
@@ -48,7 +49,7 @@ private Response retryChain(Response response, Chain chain) throws IOException {
4849
response.close();
4950
response = chain.proceed(chain.request());
5051
if (shouldRetry(response.code())) {
51-
nextBackoff = this.backoff.nextBackoff(response);
52+
nextBackoff = backoff.nextBackoff(response);
5253
} else {
5354
return response;
5455
}

src/main/java/com/deepgram/resources/agent/v1/types/AgentV1ConversationTextRole.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
import com.fasterxml.jackson.annotation.JsonValue;
88

99
public final class AgentV1ConversationTextRole {
10+
public static final AgentV1ConversationTextRole USER = new AgentV1ConversationTextRole(Value.USER, "user");
11+
1012
public static final AgentV1ConversationTextRole ASSISTANT =
1113
new AgentV1ConversationTextRole(Value.ASSISTANT, "assistant");
1214

13-
public static final AgentV1ConversationTextRole USER = new AgentV1ConversationTextRole(Value.USER, "user");
14-
1515
private final Value value;
1616

1717
private final String string;
@@ -45,10 +45,10 @@ public int hashCode() {
4545

4646
public <T> T visit(Visitor<T> visitor) {
4747
switch (value) {
48-
case ASSISTANT:
49-
return visitor.visitAssistant();
5048
case USER:
5149
return visitor.visitUser();
50+
case ASSISTANT:
51+
return visitor.visitAssistant();
5252
case UNKNOWN:
5353
default:
5454
return visitor.visitUnknown(string);
@@ -58,10 +58,10 @@ public <T> T visit(Visitor<T> visitor) {
5858
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
5959
public static AgentV1ConversationTextRole valueOf(String value) {
6060
switch (value) {
61-
case "assistant":
62-
return ASSISTANT;
6361
case "user":
6462
return USER;
63+
case "assistant":
64+
return ASSISTANT;
6565
default:
6666
return new AgentV1ConversationTextRole(Value.UNKNOWN, value);
6767
}

src/main/java/com/deepgram/resources/agent/v1/types/AgentV1FunctionCallRequestFunctionsItem.java

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
import com.fasterxml.jackson.annotation.JsonInclude;
1111
import com.fasterxml.jackson.annotation.JsonProperty;
1212
import com.fasterxml.jackson.annotation.JsonSetter;
13+
import com.fasterxml.jackson.annotation.Nulls;
1314
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
1415
import java.util.HashMap;
1516
import java.util.Map;
1617
import java.util.Objects;
18+
import java.util.Optional;
1719
import org.jetbrains.annotations.NotNull;
1820

1921
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@@ -27,14 +29,22 @@ public final class AgentV1FunctionCallRequestFunctionsItem {
2729

2830
private final boolean clientSide;
2931

32+
private final Optional<String> thoughtSignature;
33+
3034
private final Map<String, Object> additionalProperties;
3135

3236
private AgentV1FunctionCallRequestFunctionsItem(
33-
String id, String name, String arguments, boolean clientSide, Map<String, Object> additionalProperties) {
37+
String id,
38+
String name,
39+
String arguments,
40+
boolean clientSide,
41+
Optional<String> thoughtSignature,
42+
Map<String, Object> additionalProperties) {
3443
this.id = id;
3544
this.name = name;
3645
this.arguments = arguments;
3746
this.clientSide = clientSide;
47+
this.thoughtSignature = thoughtSignature;
3848
this.additionalProperties = additionalProperties;
3949
}
4050

@@ -70,6 +80,14 @@ public boolean getClientSide() {
7080
return clientSide;
7181
}
7282

83+
/**
84+
* @return Some Gemini models require this as an additional function call identifier
85+
*/
86+
@JsonProperty("thought_signature")
87+
public Optional<String> getThoughtSignature() {
88+
return thoughtSignature;
89+
}
90+
7391
@java.lang.Override
7492
public boolean equals(Object other) {
7593
if (this == other) return true;
@@ -86,12 +104,13 @@ private boolean equalTo(AgentV1FunctionCallRequestFunctionsItem other) {
86104
return id.equals(other.id)
87105
&& name.equals(other.name)
88106
&& arguments.equals(other.arguments)
89-
&& clientSide == other.clientSide;
107+
&& clientSide == other.clientSide
108+
&& thoughtSignature.equals(other.thoughtSignature);
90109
}
91110

92111
@java.lang.Override
93112
public int hashCode() {
94-
return Objects.hash(this.id, this.name, this.arguments, this.clientSide);
113+
return Objects.hash(this.id, this.name, this.arguments, this.clientSide, this.thoughtSignature);
95114
}
96115

97116
@java.lang.Override
@@ -139,6 +158,13 @@ public interface _FinalStage {
139158
_FinalStage additionalProperty(String key, Object value);
140159

141160
_FinalStage additionalProperties(Map<String, Object> additionalProperties);
161+
162+
/**
163+
* <p>Some Gemini models require this as an additional function call identifier</p>
164+
*/
165+
_FinalStage thoughtSignature(Optional<String> thoughtSignature);
166+
167+
_FinalStage thoughtSignature(String thoughtSignature);
142168
}
143169

144170
@JsonIgnoreProperties(ignoreUnknown = true)
@@ -151,6 +177,8 @@ public static final class Builder implements IdStage, NameStage, ArgumentsStage,
151177

152178
private boolean clientSide;
153179

180+
private Optional<String> thoughtSignature = Optional.empty();
181+
154182
@JsonAnySetter
155183
private Map<String, Object> additionalProperties = new HashMap<>();
156184

@@ -162,6 +190,7 @@ public Builder from(AgentV1FunctionCallRequestFunctionsItem other) {
162190
name(other.getName());
163191
arguments(other.getArguments());
164192
clientSide(other.getClientSide());
193+
thoughtSignature(other.getThoughtSignature());
165194
return this;
166195
}
167196

@@ -213,9 +242,30 @@ public _FinalStage clientSide(boolean clientSide) {
213242
return this;
214243
}
215244

245+
/**
246+
* <p>Some Gemini models require this as an additional function call identifier</p>
247+
* @return Reference to {@code this} so that method calls can be chained together.
248+
*/
249+
@java.lang.Override
250+
public _FinalStage thoughtSignature(String thoughtSignature) {
251+
this.thoughtSignature = Optional.ofNullable(thoughtSignature);
252+
return this;
253+
}
254+
255+
/**
256+
* <p>Some Gemini models require this as an additional function call identifier</p>
257+
*/
258+
@java.lang.Override
259+
@JsonSetter(value = "thought_signature", nulls = Nulls.SKIP)
260+
public _FinalStage thoughtSignature(Optional<String> thoughtSignature) {
261+
this.thoughtSignature = thoughtSignature;
262+
return this;
263+
}
264+
216265
@java.lang.Override
217266
public AgentV1FunctionCallRequestFunctionsItem build() {
218-
return new AgentV1FunctionCallRequestFunctionsItem(id, name, arguments, clientSide, additionalProperties);
267+
return new AgentV1FunctionCallRequestFunctionsItem(
268+
id, name, arguments, clientSide, thoughtSignature, additionalProperties);
219269
}
220270

221271
@java.lang.Override

0 commit comments

Comments
 (0)