Skip to content

Commit

Permalink
SDK regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Dec 14, 2023
1 parent 3648f41 commit a9616bb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.cohere'
artifactId = 'cohere-java'
version = '1.0.0'
version = '1.0.1'
from components.java
}
}
Expand Down
2 changes: 1 addition & 1 deletion sample-app/src/main/java/sample/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

public final class App {
public static void main(String[] args) {
// import com.cohere.api.CohereApiClient
// import com.cohere.api.Cohere
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
import okhttp3.RequestBody;
import okhttp3.Response;

public class CohereApiClient {
public class Cohere {
protected final ClientOptions clientOptions;

protected final Supplier<ConnectorsClient> connectorsClient;

public CohereApiClient(ClientOptions clientOptions) {
public Cohere(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
this.connectorsClient = Suppliers.memoize(() -> new ConnectorsClient(clientOptions));
}
Expand Down Expand Up @@ -484,7 +484,7 @@ public ConnectorsClient connectors() {
return this.connectorsClient.get();
}

public static CohereApiClientBuilder builder() {
return new CohereApiClientBuilder();
public static CohereBuilder builder() {
return new CohereBuilder();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@
import com.cohere.api.core.ClientOptions;
import com.cohere.api.core.Environment;

public final class CohereApiClientBuilder {
public final class CohereBuilder {
private ClientOptions.Builder clientOptionsBuilder = ClientOptions.builder();

private Environment environment = Environment.PRODUCTION;

public CohereApiClientBuilder token(String token) {
public CohereBuilder token(String token) {
this.clientOptionsBuilder.addHeader("Authorization", "Bearer " + token);
return this;
}

public CohereApiClientBuilder environment(Environment environment) {
public CohereBuilder environment(Environment environment) {
this.environment = environment;
return this;
}

public CohereApiClientBuilder url(String url) {
public CohereBuilder url(String url) {
this.environment = Environment.custom(url);
return this;
}

public CohereApiClient build() {
public Cohere build() {
clientOptionsBuilder.environment(this.environment);
return new CohereApiClient(clientOptionsBuilder.build());
return new Cohere(clientOptionsBuilder.build());
}
}
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 @@ -29,7 +29,7 @@ private ClientOptions(
"X-Fern-SDK-Name",
"com.cohere.fern:api-sdk",
"X-Fern-SDK-Version",
"1.0.0",
"1.0.1",
"X-Fern-Language",
"JAVA"));
this.headerSuppliers = headerSuppliers;
Expand Down

0 comments on commit a9616bb

Please sign in to comment.