Skip to content

Commit e444ce1

Browse files
SDK regeneration (#82)
Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
1 parent 8cc2db7 commit e444ce1

31 files changed

+391
-105
lines changed

.fern/metadata.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"cliVersion": "4.23.0",
2+
"cliVersion": "4.48.0",
33
"generatorName": "fernapi/fern-java-sdk",
4-
"generatorVersion": "3.42.7",
4+
"generatorVersion": "4.0.6",
55
"generatorConfig": {
66
"client-class-name": "Cohere"
77
},
8-
"originGitCommit": "7ffcb80a5edaf952524b88ad8960151e148ff39b",
9-
"sdkVersion": "1.10.0"
8+
"originGitCommit": "5bd36abb3df64eb4dd528f855dedf6d6a2b4cf52",
9+
"sdkVersion": "1.7.1"
1010
}

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ java {
4747

4848
group = 'com.cohere'
4949

50-
version = '1.10.0'
50+
version = '1.7.1'
5151

5252
jar {
5353
dependsOn(":generatePomFileForMavenPublication")
@@ -78,7 +78,7 @@ publishing {
7878
maven(MavenPublication) {
7979
groupId = 'com.cohere'
8080
artifactId = 'cohere-java'
81-
version = '1.10.0'
81+
version = '1.7.1'
8282
from components.java
8383
pom {
8484
name = 'cohere'

reference.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4868,14 +4868,6 @@ client.finetuning().updateFinetunedModel(
48684868

48694869
**settings:** `Settings` — FinetunedModel settings such as dataset, hyperparameters...
48704870

4871-
</dd>
4872-
</dl>
4873-
4874-
<dl>
4875-
<dd>
4876-
4877-
**status:** `Optional<Status>` — Current stage in the life-cycle of the fine-tuned model.
4878-
48794871
</dd>
48804872
</dl>
48814873
</dd>

src/main/java/com/cohere/api/core/ClientOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ private ClientOptions(
3838
this.headers.putAll(headers);
3939
this.headers.putAll(new HashMap<String, String>() {
4040
{
41-
put("User-Agent", "com.cohere:cohere-java/1.10.0");
41+
put("User-Agent", "com.cohere:cohere-java/1.7.1");
4242
put("X-Fern-Language", "JAVA");
4343
put("X-Fern-SDK-Name", "com.cohere.fern:api-sdk");
44-
put("X-Fern-SDK-Version", "1.10.0");
44+
put("X-Fern-SDK-Version", "1.7.1");
4545
}
4646
});
4747
this.headerSuppliers = headerSuppliers;
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
package com.cohere.api.core;
5+
6+
import com.fasterxml.jackson.core.JsonGenerator;
7+
import com.fasterxml.jackson.databind.JsonSerializer;
8+
import com.fasterxml.jackson.databind.SerializerProvider;
9+
import com.fasterxml.jackson.databind.module.SimpleModule;
10+
import java.io.IOException;
11+
12+
/**
13+
* Custom serializer that writes integer-valued doubles without a decimal point.
14+
* For example, {@code 24000.0} is serialized as {@code 24000} instead of {@code 24000.0}.
15+
* Non-integer values like {@code 3.14} are serialized normally.
16+
*/
17+
class DoubleSerializer extends JsonSerializer<Double> {
18+
private static final SimpleModule MODULE;
19+
20+
static {
21+
MODULE = new SimpleModule()
22+
.addSerializer(Double.class, new DoubleSerializer())
23+
.addSerializer(double.class, new DoubleSerializer());
24+
}
25+
26+
/**
27+
* Gets a module wrapping this serializer as an adapter for the Jackson ObjectMapper.
28+
*
29+
* @return A {@link SimpleModule} to be plugged onto Jackson ObjectMapper.
30+
*/
31+
public static SimpleModule getModule() {
32+
return MODULE;
33+
}
34+
35+
@Override
36+
public void serialize(Double value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
37+
if (value != null && value == Math.floor(value) && !Double.isInfinite(value) && !Double.isNaN(value)) {
38+
gen.writeNumber(value.longValue());
39+
} else {
40+
gen.writeNumber(value);
41+
}
42+
}
43+
}

src/main/java/com/cohere/api/core/ObjectMappers.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public final class ObjectMappers {
1818
.addModule(new Jdk8Module())
1919
.addModule(new JavaTimeModule())
2020
.addModule(DateTimeDeserializer.getModule())
21+
.addModule(DoubleSerializer.getModule())
2122
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
2223
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
2324
.build();

src/main/java/com/cohere/api/resources/batches/requests/BatchesListBatchesRequest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import com.cohere.api.core.ObjectMappers;
77
import com.fasterxml.jackson.annotation.JsonAnyGetter;
88
import com.fasterxml.jackson.annotation.JsonAnySetter;
9+
import com.fasterxml.jackson.annotation.JsonIgnore;
910
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
1011
import com.fasterxml.jackson.annotation.JsonInclude;
11-
import com.fasterxml.jackson.annotation.JsonProperty;
1212
import com.fasterxml.jackson.annotation.JsonSetter;
1313
import com.fasterxml.jackson.annotation.Nulls;
1414
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@@ -45,7 +45,7 @@ private BatchesListBatchesRequest(
4545
* If unspecified, at most 50 batches will be returned.
4646
* The maximum value is 1000; values above 1000 will be coerced to 1000.
4747
*/
48-
@JsonProperty("page_size")
48+
@JsonIgnore
4949
public Optional<Integer> getPageSize() {
5050
return pageSize;
5151
}
@@ -54,7 +54,7 @@ public Optional<Integer> getPageSize() {
5454
* @return A page token, received from a previous <code>ListBatches</code> call.
5555
* Provide this to retrieve the subsequent page.
5656
*/
57-
@JsonProperty("page_token")
57+
@JsonIgnore
5858
public Optional<String> getPageToken() {
5959
return pageToken;
6060
}
@@ -63,7 +63,7 @@ public Optional<String> getPageToken() {
6363
* @return Batches can be ordered by creation time or last updated time.
6464
* Use <code>created_at</code> for creation time or <code>updated_at</code> for last updated time.
6565
*/
66-
@JsonProperty("order_by")
66+
@JsonIgnore
6767
public Optional<String> getOrderBy() {
6868
return orderBy;
6969
}

src/main/java/com/cohere/api/resources/connectors/requests/ConnectorsListRequest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import com.cohere.api.core.ObjectMappers;
77
import com.fasterxml.jackson.annotation.JsonAnyGetter;
88
import com.fasterxml.jackson.annotation.JsonAnySetter;
9+
import com.fasterxml.jackson.annotation.JsonIgnore;
910
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
1011
import com.fasterxml.jackson.annotation.JsonInclude;
11-
import com.fasterxml.jackson.annotation.JsonProperty;
1212
import com.fasterxml.jackson.annotation.JsonSetter;
1313
import com.fasterxml.jackson.annotation.Nulls;
1414
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@@ -36,15 +36,15 @@ private ConnectorsListRequest(
3636
/**
3737
* @return Maximum number of connectors to return [0, 100].
3838
*/
39-
@JsonProperty("limit")
39+
@JsonIgnore
4040
public Optional<Double> getLimit() {
4141
return limit;
4242
}
4343

4444
/**
4545
* @return Number of connectors to skip before returning results [0, inf].
4646
*/
47-
@JsonProperty("offset")
47+
@JsonIgnore
4848
public Optional<Double> getOffset() {
4949
return offset;
5050
}

src/main/java/com/cohere/api/resources/connectors/requests/ConnectorsOAuthAuthorizeRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import com.cohere.api.core.ObjectMappers;
77
import com.fasterxml.jackson.annotation.JsonAnyGetter;
88
import com.fasterxml.jackson.annotation.JsonAnySetter;
9+
import com.fasterxml.jackson.annotation.JsonIgnore;
910
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
1011
import com.fasterxml.jackson.annotation.JsonInclude;
11-
import com.fasterxml.jackson.annotation.JsonProperty;
1212
import com.fasterxml.jackson.annotation.JsonSetter;
1313
import com.fasterxml.jackson.annotation.Nulls;
1414
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@@ -33,7 +33,7 @@ private ConnectorsOAuthAuthorizeRequest(
3333
/**
3434
* @return The URL to redirect to after the connector has been authorized.
3535
*/
36-
@JsonProperty("after_token_redirect")
36+
@JsonIgnore
3737
public Optional<String> getAfterTokenRedirect() {
3838
return afterTokenRedirect;
3939
}

src/main/java/com/cohere/api/resources/datasets/requests/DatasetsCreateRequest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
import com.cohere.api.types.DatasetType;
88
import com.fasterxml.jackson.annotation.JsonAnyGetter;
99
import com.fasterxml.jackson.annotation.JsonAnySetter;
10+
import com.fasterxml.jackson.annotation.JsonIgnore;
1011
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
1112
import com.fasterxml.jackson.annotation.JsonInclude;
12-
import com.fasterxml.jackson.annotation.JsonProperty;
1313
import com.fasterxml.jackson.annotation.JsonSetter;
1414
import com.fasterxml.jackson.annotation.Nulls;
1515
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@@ -66,63 +66,63 @@ private DatasetsCreateRequest(
6666
/**
6767
* @return List of names of fields that will be persisted in the Dataset. By default the Dataset will retain only the required fields indicated in the <a href="https://docs.cohere.com/docs/datasets#dataset-types">schema for the corresponding Dataset type</a>. For example, datasets of type <code>embed-input</code> will drop all fields other than the required <code>text</code> field. If any of the fields in <code>keep_fields</code> are missing from the uploaded file, Dataset validation will fail.
6868
*/
69-
@JsonProperty("keep_fields")
69+
@JsonIgnore
7070
public Optional<List<String>> getKeepFields() {
7171
return keepFields;
7272
}
7373

7474
/**
7575
* @return List of names of fields that will be persisted in the Dataset. By default the Dataset will retain only the required fields indicated in the <a href="https://docs.cohere.com/docs/datasets#dataset-types">schema for the corresponding Dataset type</a>. For example, Datasets of type <code>embed-input</code> will drop all fields other than the required <code>text</code> field. If any of the fields in <code>optional_fields</code> are missing from the uploaded file, Dataset validation will pass.
7676
*/
77-
@JsonProperty("optional_fields")
77+
@JsonIgnore
7878
public Optional<List<String>> getOptionalFields() {
7979
return optionalFields;
8080
}
8181

8282
/**
8383
* @return The name of the uploaded dataset.
8484
*/
85-
@JsonProperty("name")
85+
@JsonIgnore
8686
public String getName() {
8787
return name;
8888
}
8989

9090
/**
9191
* @return The dataset type, which is used to validate the data. The only valid type is <code>embed-input</code> used in conjunction with the Embed Jobs API.
9292
*/
93-
@JsonProperty("type")
93+
@JsonIgnore
9494
public DatasetType getType() {
9595
return type;
9696
}
9797

9898
/**
9999
* @return Indicates if the original file should be stored.
100100
*/
101-
@JsonProperty("keep_original_file")
101+
@JsonIgnore
102102
public Optional<Boolean> getKeepOriginalFile() {
103103
return keepOriginalFile;
104104
}
105105

106106
/**
107107
* @return Indicates whether rows with malformed input should be dropped (instead of failing the validation check). Dropped rows will be returned in the warnings field.
108108
*/
109-
@JsonProperty("skip_malformed_input")
109+
@JsonIgnore
110110
public Optional<Boolean> getSkipMalformedInput() {
111111
return skipMalformedInput;
112112
}
113113

114114
/**
115115
* @return Raw .txt uploads will be split into entries using the text_separator value.
116116
*/
117-
@JsonProperty("text_separator")
117+
@JsonIgnore
118118
public Optional<String> getTextSeparator() {
119119
return textSeparator;
120120
}
121121

122122
/**
123123
* @return The delimiter used for .csv uploads.
124124
*/
125-
@JsonProperty("csv_delimiter")
125+
@JsonIgnore
126126
public Optional<String> getCsvDelimiter() {
127127
return csvDelimiter;
128128
}

0 commit comments

Comments
 (0)