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 -- July 16, 2024 #23

Merged
merged 2 commits into from
Jul 16, 2024
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
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.1.0'
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/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.1.0",
"X-Fern-Language",
"JAVA"));
this.headerSuppliers = headerSuppliers;
Expand Down
144 changes: 95 additions & 49 deletions src/main/java/com/cohere/api/requests/ChatRequest.java

Large diffs are not rendered by default.

144 changes: 95 additions & 49 deletions src/main/java/com/cohere/api/requests/ChatStreamRequest.java

Large diffs are not rendered by default.

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/Bedrock, 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/Bedrock, 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/Bedrock, 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/Bedrock, 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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
public enum ChatRequestCitationQuality {
FAST("fast"),

ACCURATE("accurate");
ACCURATE("accurate"),

OFF("off");

private final String value;

Expand Down
Loading
Loading