Skip to content

Commit

Permalink
🌿 Fern Regeneration -- May 22, 2024 (#19)
Browse files Browse the repository at this point in the history
* SDK regeneration

* clientName != null

---------

Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
Co-authored-by: Billy Trend <[email protected]>
  • Loading branch information
fern-api[bot] and billytrend-cohere committed May 22, 2024
1 parent e42b4ff commit 19ab61e
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 12 deletions.
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.7'
version = '1.0.8'
from components.java
pom {
name = 'cohere'
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.7",
"1.0.8",
"X-Fern-Language",
"JAVA"));
this.headerSuppliers = headerSuppliers;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/cohere/api/core/Environment.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package com.cohere.api.core;

public final class Environment {
public static final Environment PRODUCTION = new Environment("https://api.cohere.ai/v1");
public static final Environment PRODUCTION = new Environment("https://api.cohere.com/v1");

private final String url;

Expand Down
43 changes: 41 additions & 2 deletions src/main/java/com/cohere/api/requests/ChatRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public final class ChatRequest {

private final Optional<List<ToolResult>> toolResults;

private final Optional<Boolean> forceSingleStep;

private final Map<String, Object> additionalProperties;

private ChatRequest(
Expand All @@ -99,6 +101,7 @@ private ChatRequest(
Optional<Boolean> returnPrompt,
Optional<List<Tool>> tools,
Optional<List<ToolResult>> toolResults,
Optional<Boolean> forceSingleStep,
Map<String, Object> additionalProperties) {
this.message = message;
this.model = model;
Expand All @@ -123,6 +126,7 @@ private ChatRequest(
this.returnPrompt = returnPrompt;
this.tools = tools;
this.toolResults = toolResults;
this.forceSingleStep = forceSingleStep;
this.additionalProperties = additionalProperties;
}

Expand Down Expand Up @@ -392,6 +396,14 @@ public Optional<List<ToolResult>> getToolResults() {
return toolResults;
}

/**
* @return Forces the chat to be single step. Defaults to <code>false</code>.
*/
@JsonProperty("force_single_step")
public Optional<Boolean> getForceSingleStep() {
return forceSingleStep;
}

@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
Expand Down Expand Up @@ -426,7 +438,8 @@ private boolean equalTo(ChatRequest other) {
&& rawPrompting.equals(other.rawPrompting)
&& returnPrompt.equals(other.returnPrompt)
&& tools.equals(other.tools)
&& toolResults.equals(other.toolResults);
&& toolResults.equals(other.toolResults)
&& forceSingleStep.equals(other.forceSingleStep);
}

@java.lang.Override
Expand Down Expand Up @@ -454,7 +467,8 @@ public int hashCode() {
this.rawPrompting,
this.returnPrompt,
this.tools,
this.toolResults);
this.toolResults,
this.forceSingleStep);
}

@java.lang.Override
Expand Down Expand Up @@ -562,12 +576,18 @@ public interface _FinalStage {
_FinalStage toolResults(Optional<List<ToolResult>> toolResults);

_FinalStage toolResults(List<ToolResult> toolResults);

_FinalStage forceSingleStep(Optional<Boolean> forceSingleStep);

_FinalStage forceSingleStep(Boolean forceSingleStep);
}

@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder implements MessageStage, _FinalStage {
private String message;

private Optional<Boolean> forceSingleStep = Optional.empty();

private Optional<List<ToolResult>> toolResults = Optional.empty();

private Optional<List<Tool>> tools = Optional.empty();
Expand Down Expand Up @@ -642,6 +662,7 @@ public Builder from(ChatRequest other) {
returnPrompt(other.getReturnPrompt());
tools(other.getTools());
toolResults(other.getToolResults());
forceSingleStep(other.getForceSingleStep());
return this;
}

Expand All @@ -657,6 +678,23 @@ public _FinalStage message(String message) {
return this;
}

/**
* <p>Forces the chat to be single step. Defaults to <code>false</code>.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage forceSingleStep(Boolean forceSingleStep) {
this.forceSingleStep = Optional.of(forceSingleStep);
return this;
}

@java.lang.Override
@JsonSetter(value = "force_single_step", nulls = Nulls.SKIP)
public _FinalStage forceSingleStep(Optional<Boolean> forceSingleStep) {
this.forceSingleStep = forceSingleStep;
return this;
}

/**
* <p>A list of results from invoking tools recommended by the model in the previous chat turn. Results are used to produce a text response and will be referenced in citations. When using <code>tool_results</code>, <code>tools</code> must be passed as well.
* Each tool_result contains information about how it was invoked, as well as a list of outputs in the form of dictionaries.</p>
Expand Down Expand Up @@ -1127,6 +1165,7 @@ public ChatRequest build() {
returnPrompt,
tools,
toolResults,
forceSingleStep,
additionalProperties);
}
}
Expand Down
43 changes: 41 additions & 2 deletions src/main/java/com/cohere/api/requests/ChatStreamRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public final class ChatStreamRequest {

private final Optional<List<ToolResult>> toolResults;

private final Optional<Boolean> forceSingleStep;

private final Map<String, Object> additionalProperties;

private ChatStreamRequest(
Expand All @@ -99,6 +101,7 @@ private ChatStreamRequest(
Optional<Boolean> returnPrompt,
Optional<List<Tool>> tools,
Optional<List<ToolResult>> toolResults,
Optional<Boolean> forceSingleStep,
Map<String, Object> additionalProperties) {
this.message = message;
this.model = model;
Expand All @@ -123,6 +126,7 @@ private ChatStreamRequest(
this.returnPrompt = returnPrompt;
this.tools = tools;
this.toolResults = toolResults;
this.forceSingleStep = forceSingleStep;
this.additionalProperties = additionalProperties;
}

Expand Down Expand Up @@ -392,6 +396,14 @@ public Optional<List<ToolResult>> getToolResults() {
return toolResults;
}

/**
* @return Forces the chat to be single step. Defaults to <code>false</code>.
*/
@JsonProperty("force_single_step")
public Optional<Boolean> getForceSingleStep() {
return forceSingleStep;
}

@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
Expand Down Expand Up @@ -426,7 +438,8 @@ private boolean equalTo(ChatStreamRequest other) {
&& rawPrompting.equals(other.rawPrompting)
&& returnPrompt.equals(other.returnPrompt)
&& tools.equals(other.tools)
&& toolResults.equals(other.toolResults);
&& toolResults.equals(other.toolResults)
&& forceSingleStep.equals(other.forceSingleStep);
}

@java.lang.Override
Expand Down Expand Up @@ -454,7 +467,8 @@ public int hashCode() {
this.rawPrompting,
this.returnPrompt,
this.tools,
this.toolResults);
this.toolResults,
this.forceSingleStep);
}

@java.lang.Override
Expand Down Expand Up @@ -562,12 +576,18 @@ public interface _FinalStage {
_FinalStage toolResults(Optional<List<ToolResult>> toolResults);

_FinalStage toolResults(List<ToolResult> toolResults);

_FinalStage forceSingleStep(Optional<Boolean> forceSingleStep);

_FinalStage forceSingleStep(Boolean forceSingleStep);
}

@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder implements MessageStage, _FinalStage {
private String message;

private Optional<Boolean> forceSingleStep = Optional.empty();

private Optional<List<ToolResult>> toolResults = Optional.empty();

private Optional<List<Tool>> tools = Optional.empty();
Expand Down Expand Up @@ -642,6 +662,7 @@ public Builder from(ChatStreamRequest other) {
returnPrompt(other.getReturnPrompt());
tools(other.getTools());
toolResults(other.getToolResults());
forceSingleStep(other.getForceSingleStep());
return this;
}

Expand All @@ -657,6 +678,23 @@ public _FinalStage message(String message) {
return this;
}

/**
* <p>Forces the chat to be single step. Defaults to <code>false</code>.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage forceSingleStep(Boolean forceSingleStep) {
this.forceSingleStep = Optional.of(forceSingleStep);
return this;
}

@java.lang.Override
@JsonSetter(value = "force_single_step", nulls = Nulls.SKIP)
public _FinalStage forceSingleStep(Optional<Boolean> forceSingleStep) {
this.forceSingleStep = forceSingleStep;
return this;
}

/**
* <p>A list of results from invoking tools recommended by the model in the previous chat turn. Results are used to produce a text response and will be referenced in citations. When using <code>tool_results</code>, <code>tools</code> must be passed as well.
* Each tool_result contains information about how it was invoked, as well as a list of outputs in the form of dictionaries.</p>
Expand Down Expand Up @@ -1127,6 +1165,7 @@ public ChatStreamRequest build() {
returnPrompt,
tools,
toolResults,
forceSingleStep,
additionalProperties);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/cohere/api/requests/ClassifyRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public Optional<String> getModel() {
}

/**
* @return The ID of a custom playground preset. You can create presets in the <a href="https://dashboard.cohere.ai/playground/classify?model=large">playground</a>. If you use a preset, all other parameters become optional, and any included parameters will override the preset's parameters.
* @return The ID of a custom playground preset. You can create presets in the <a href="https://dashboard.cohere.com/playground/classify?model=large">playground</a>. If you use a preset, all other parameters become optional, and any included parameters will override the preset's parameters.
*/
@JsonProperty("preset")
public Optional<String> getPreset() {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/cohere/api/requests/GenerateRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public Optional<Double> getSeed() {
}

/**
* @return Identifier of a custom preset. A preset is a combination of parameters, such as prompt, temperature etc. You can create presets in the <a href="https://dashboard.cohere.ai/playground/generate">playground</a>.
* @return Identifier of a custom preset. A preset is a combination of parameters, such as prompt, temperature etc. You can create presets in the <a href="https://dashboard.cohere.com/playground/generate">playground</a>.
* When a preset is specified, the <code>prompt</code> parameter becomes optional, and any included parameters will override the preset's parameters.
*/
@JsonProperty("preset")
Expand Down Expand Up @@ -598,7 +598,7 @@ public _FinalStage endSequences(Optional<List<String>> endSequences) {
}

/**
* <p>Identifier of a custom preset. A preset is a combination of parameters, such as prompt, temperature etc. You can create presets in the <a href="https://dashboard.cohere.ai/playground/generate">playground</a>.
* <p>Identifier of a custom preset. A preset is a combination of parameters, such as prompt, temperature etc. You can create presets in the <a href="https://dashboard.cohere.com/playground/generate">playground</a>.
* When a preset is specified, the <code>prompt</code> parameter becomes optional, and any included parameters will override the preset's parameters.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public Optional<Double> getSeed() {
}

/**
* @return Identifier of a custom preset. A preset is a combination of parameters, such as prompt, temperature etc. You can create presets in the <a href="https://dashboard.cohere.ai/playground/generate">playground</a>.
* @return Identifier of a custom preset. A preset is a combination of parameters, such as prompt, temperature etc. You can create presets in the <a href="https://dashboard.cohere.com/playground/generate">playground</a>.
* When a preset is specified, the <code>prompt</code> parameter becomes optional, and any included parameters will override the preset's parameters.
*/
@JsonProperty("preset")
Expand Down Expand Up @@ -598,7 +598,7 @@ public _FinalStage endSequences(Optional<List<String>> endSequences) {
}

/**
* <p>Identifier of a custom preset. A preset is a combination of parameters, such as prompt, temperature etc. You can create presets in the <a href="https://dashboard.cohere.ai/playground/generate">playground</a>.
* <p>Identifier of a custom preset. A preset is a combination of parameters, such as prompt, temperature etc. You can create presets in the <a href="https://dashboard.cohere.com/playground/generate">playground</a>.
* When a preset is specified, the <code>prompt</code> parameter becomes optional, and any included parameters will override the preset's parameters.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
Expand Down

0 comments on commit 19ab61e

Please sign in to comment.