Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌿 Fern Regeneration -- June 17, 2024 #20

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.cohere'
artifactId = 'cohere-java'
version = '1.0.8'
version = '1.0.9'
from components.java
pom {
name = 'cohere'
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/cohere/api/Cohere.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ public Cohere(ClientOptions clientOptions) {

/**
* Generates a text response to a user message.
* To learn how to use Chat with Streaming and RAG follow <a href="https://docs.cohere.com/docs/cochat-beta#various-ways-of-using-the-chat-endpoint">this guide</a>.
* To learn how to use the Chat API with Streaming and RAG follow our <a href="https://docs.cohere.com/docs/chat-api">Text Generation guides</a>.
*/
public Iterable<StreamedChatResponse> chatStream(ChatStreamRequest request) {
return chatStream(request, null);
}

/**
* Generates a text response to a user message.
* To learn how to use Chat with Streaming and RAG follow <a href="https://docs.cohere.com/docs/cochat-beta#various-ways-of-using-the-chat-endpoint">this guide</a>.
* To learn how to use the Chat API with Streaming and RAG follow our <a href="https://docs.cohere.com/docs/chat-api">Text Generation guides</a>.
*/
public Iterable<StreamedChatResponse> chatStream(ChatStreamRequest request, RequestOptions requestOptions) {
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
Expand Down Expand Up @@ -119,15 +119,15 @@ public Iterable<StreamedChatResponse> chatStream(ChatStreamRequest request, Requ

/**
* Generates a text response to a user message.
* To learn how to use Chat with Streaming and RAG follow <a href="https://docs.cohere.com/docs/cochat-beta#various-ways-of-using-the-chat-endpoint">this guide</a>.
* To learn how to use the Chat API with Streaming and RAG follow our <a href="https://docs.cohere.com/docs/chat-api">Text Generation guides</a>.
*/
public NonStreamedChatResponse chat(ChatRequest request) {
return chat(request, null);
}

/**
* Generates a text response to a user message.
* To learn how to use Chat with Streaming and RAG follow <a href="https://docs.cohere.com/docs/cochat-beta#various-ways-of-using-the-chat-endpoint">this guide</a>.
* To learn how to use the Chat API with Streaming and RAG follow our <a href="https://docs.cohere.com/docs/chat-api">Text Generation guides</a>.
*/
public NonStreamedChatResponse chat(ChatRequest request, RequestOptions requestOptions) {
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/cohere/api/CohereBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public Cohere build() {
throw new RuntimeException("Please provide token or set the CO_API_KEY environment variable.");
}
this.clientOptionsBuilder.addHeader("Authorization", "Bearer " + this.token);
if (clientName != null) {
if (clientName.isPresent()) {
this.clientOptionsBuilder.addHeader("X-Client-Name", this.clientName);
}
clientOptionsBuilder.environment(this.environment);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/cohere/api/core/ClientOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private ClientOptions(
"X-Fern-SDK-Name",
"com.cohere.fern:api-sdk",
"X-Fern-SDK-Version",
"1.0.8",
"1.0.9",
"X-Fern-Language",
"JAVA"));
this.headerSuppliers = headerSuppliers;
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/com/cohere/api/requests/ChatRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public final class ChatRequest {

private final Optional<Double> p;

private final Optional<Double> seed;
private final Optional<Integer> seed;

private final Optional<List<String>> stopSequences;

Expand Down Expand Up @@ -93,7 +93,7 @@ private ChatRequest(
Optional<Integer> maxInputTokens,
Optional<Integer> k,
Optional<Double> p,
Optional<Double> seed,
Optional<Integer> seed,
Optional<List<String>> stopSequences,
Optional<Double> frequencyPenalty,
Optional<Double> presencePenalty,
Expand Down Expand Up @@ -308,7 +308,7 @@ public Optional<Double> getP() {
* Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker, Private Deployments
*/
@JsonProperty("seed")
public Optional<Double> getSeed() {
public Optional<Integer> getSeed() {
return seed;
}

Expand Down Expand Up @@ -545,9 +545,9 @@ public interface _FinalStage {

_FinalStage p(Double p);

_FinalStage seed(Optional<Double> seed);
_FinalStage seed(Optional<Integer> seed);

_FinalStage seed(Double seed);
_FinalStage seed(Integer seed);

_FinalStage stopSequences(Optional<List<String>> stopSequences);

Expand Down Expand Up @@ -602,7 +602,7 @@ public static final class Builder implements MessageStage, _FinalStage {

private Optional<List<String>> stopSequences = Optional.empty();

private Optional<Double> seed = Optional.empty();
private Optional<Integer> seed = Optional.empty();

private Optional<Double> p = Optional.empty();

Expand Down Expand Up @@ -851,14 +851,14 @@ public _FinalStage stopSequences(Optional<List<String>> stopSequences) {
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage seed(Double seed) {
public _FinalStage seed(Integer seed) {
this.seed = Optional.of(seed);
return this;
}

@java.lang.Override
@JsonSetter(value = "seed", nulls = Nulls.SKIP)
public _FinalStage seed(Optional<Double> seed) {
public _FinalStage seed(Optional<Integer> seed) {
this.seed = seed;
return this;
}
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/com/cohere/api/requests/ChatStreamRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public final class ChatStreamRequest {

private final Optional<Double> p;

private final Optional<Double> seed;
private final Optional<Integer> seed;

private final Optional<List<String>> stopSequences;

Expand Down Expand Up @@ -93,7 +93,7 @@ private ChatStreamRequest(
Optional<Integer> maxInputTokens,
Optional<Integer> k,
Optional<Double> p,
Optional<Double> seed,
Optional<Integer> seed,
Optional<List<String>> stopSequences,
Optional<Double> frequencyPenalty,
Optional<Double> presencePenalty,
Expand Down Expand Up @@ -308,7 +308,7 @@ public Optional<Double> getP() {
* Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker, Private Deployments
*/
@JsonProperty("seed")
public Optional<Double> getSeed() {
public Optional<Integer> getSeed() {
return seed;
}

Expand Down Expand Up @@ -545,9 +545,9 @@ public interface _FinalStage {

_FinalStage p(Double p);

_FinalStage seed(Optional<Double> seed);
_FinalStage seed(Optional<Integer> seed);

_FinalStage seed(Double seed);
_FinalStage seed(Integer seed);

_FinalStage stopSequences(Optional<List<String>> stopSequences);

Expand Down Expand Up @@ -602,7 +602,7 @@ public static final class Builder implements MessageStage, _FinalStage {

private Optional<List<String>> stopSequences = Optional.empty();

private Optional<Double> seed = Optional.empty();
private Optional<Integer> seed = Optional.empty();

private Optional<Double> p = Optional.empty();

Expand Down Expand Up @@ -851,14 +851,14 @@ public _FinalStage stopSequences(Optional<List<String>> stopSequences) {
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage seed(Double seed) {
public _FinalStage seed(Integer seed) {
this.seed = Optional.of(seed);
return this;
}

@java.lang.Override
@JsonSetter(value = "seed", nulls = Nulls.SKIP)
public _FinalStage seed(Optional<Double> seed) {
public _FinalStage seed(Optional<Integer> seed) {
this.seed = seed;
return this;
}
Expand Down
28 changes: 18 additions & 10 deletions src/main/java/com/cohere/api/requests/GenerateRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public final class GenerateRequest {

private final Optional<Double> temperature;

private final Optional<Double> seed;
private final Optional<Integer> seed;

private final Optional<String> preset;

Expand Down Expand Up @@ -64,7 +64,7 @@ private GenerateRequest(
Optional<Integer> maxTokens,
Optional<GenerateRequestTruncate> truncate,
Optional<Double> temperature,
Optional<Double> seed,
Optional<Integer> seed,
Optional<String> preset,
Optional<List<String>> endSequences,
Optional<List<String>> stopSequences,
Expand Down Expand Up @@ -165,10 +165,14 @@ public Optional<Double> getTemperature() {
}

/**
* @return If specified, the backend will make a best effort to sample tokens deterministically, such that repeated requests with the same seed and parameters should return the same result. However, determinsim cannot be totally guaranteed.
* @return If specified, the backend will make a best effort to sample tokens
* deterministically, such that repeated requests with the same
* seed and parameters should return the same result. However,
* determinism cannot be totally guaranteed.
* Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker, Private Deployments
*/
@JsonProperty("seed")
public Optional<Double> getSeed() {
public Optional<Integer> getSeed() {
return seed;
}

Expand Down Expand Up @@ -341,9 +345,9 @@ public interface _FinalStage {

_FinalStage temperature(Double temperature);

_FinalStage seed(Optional<Double> seed);
_FinalStage seed(Optional<Integer> seed);

_FinalStage seed(Double seed);
_FinalStage seed(Integer seed);

_FinalStage preset(Optional<String> preset);

Expand Down Expand Up @@ -404,7 +408,7 @@ public static final class Builder implements PromptStage, _FinalStage {

private Optional<String> preset = Optional.empty();

private Optional<Double> seed = Optional.empty();
private Optional<Integer> seed = Optional.empty();

private Optional<Double> temperature = Optional.empty();

Expand Down Expand Up @@ -616,18 +620,22 @@ public _FinalStage preset(Optional<String> preset) {
}

/**
* <p>If specified, the backend will make a best effort to sample tokens deterministically, such that repeated requests with the same seed and parameters should return the same result. However, determinsim cannot be totally guaranteed.</p>
* <p>If specified, the backend will make a best effort to sample tokens
* deterministically, such that repeated requests with the same
* seed and parameters should return the same result. However,
* determinism cannot be totally guaranteed.
* Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker, Private Deployments</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage seed(Double seed) {
public _FinalStage seed(Integer seed) {
this.seed = Optional.of(seed);
return this;
}

@java.lang.Override
@JsonSetter(value = "seed", nulls = Nulls.SKIP)
public _FinalStage seed(Optional<Double> seed) {
public _FinalStage seed(Optional<Integer> seed) {
this.seed = seed;
return this;
}
Expand Down
28 changes: 18 additions & 10 deletions src/main/java/com/cohere/api/requests/GenerateStreamRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public final class GenerateStreamRequest {

private final Optional<Double> temperature;

private final Optional<Double> seed;
private final Optional<Integer> seed;

private final Optional<String> preset;

Expand Down Expand Up @@ -64,7 +64,7 @@ private GenerateStreamRequest(
Optional<Integer> maxTokens,
Optional<GenerateStreamRequestTruncate> truncate,
Optional<Double> temperature,
Optional<Double> seed,
Optional<Integer> seed,
Optional<String> preset,
Optional<List<String>> endSequences,
Optional<List<String>> stopSequences,
Expand Down Expand Up @@ -165,10 +165,14 @@ public Optional<Double> getTemperature() {
}

/**
* @return If specified, the backend will make a best effort to sample tokens deterministically, such that repeated requests with the same seed and parameters should return the same result. However, determinsim cannot be totally guaranteed.
* @return If specified, the backend will make a best effort to sample tokens
* deterministically, such that repeated requests with the same
* seed and parameters should return the same result. However,
* determinism cannot be totally guaranteed.
* Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker, Private Deployments
*/
@JsonProperty("seed")
public Optional<Double> getSeed() {
public Optional<Integer> getSeed() {
return seed;
}

Expand Down Expand Up @@ -341,9 +345,9 @@ public interface _FinalStage {

_FinalStage temperature(Double temperature);

_FinalStage seed(Optional<Double> seed);
_FinalStage seed(Optional<Integer> seed);

_FinalStage seed(Double seed);
_FinalStage seed(Integer seed);

_FinalStage preset(Optional<String> preset);

Expand Down Expand Up @@ -404,7 +408,7 @@ public static final class Builder implements PromptStage, _FinalStage {

private Optional<String> preset = Optional.empty();

private Optional<Double> seed = Optional.empty();
private Optional<Integer> seed = Optional.empty();

private Optional<Double> temperature = Optional.empty();

Expand Down Expand Up @@ -616,18 +620,22 @@ public _FinalStage preset(Optional<String> preset) {
}

/**
* <p>If specified, the backend will make a best effort to sample tokens deterministically, such that repeated requests with the same seed and parameters should return the same result. However, determinsim cannot be totally guaranteed.</p>
* <p>If specified, the backend will make a best effort to sample tokens
* deterministically, such that repeated requests with the same
* seed and parameters should return the same result. However,
* determinism cannot be totally guaranteed.
* Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker, Private Deployments</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage seed(Double seed) {
public _FinalStage seed(Integer seed) {
this.seed = Optional.of(seed);
return this;
}

@java.lang.Override
@JsonSetter(value = "seed", nulls = Nulls.SKIP)
public _FinalStage seed(Optional<Double> seed) {
public _FinalStage seed(Optional<Integer> seed) {
this.seed = seed;
return this;
}
Expand Down
Loading
Loading