Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import io.weaviate.client6.v1.internal.ObjectBuilder;

public record CohereReranker(
@SerializedName("baseURL") String baseUrl,
@SerializedName("model") String model) implements Reranker {

public static final String RERANK_ENGLISH_V2 = "rerank-english-v2.0";
Expand All @@ -32,12 +33,18 @@ public static CohereReranker of(Function<Builder, ObjectBuilder<CohereReranker>>
}

public CohereReranker(Builder builder) {
this(builder.model);
this(builder.baseUrl, builder.model);
}

public static class Builder implements ObjectBuilder<CohereReranker> {
private String baseUrl;
private String model;

public Builder baseUrl(String baseUrl) {
this.baseUrl = baseUrl;
return this;
}

public Builder model(String model) {
this.model = model;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1362,10 +1362,12 @@ public static Object[][] testCases() {
{
Reranker.class,
Reranker.cohere(rerank -> rerank
Comment thread
bevzzz marked this conversation as resolved.
.baseUrl("example.com")
.model(CohereReranker.RERANK_ENGLISH_V2)),
"""
{
"reranker-cohere": {
"baseURL": "example.com",
"model": "rerank-english-v2.0"
}
}
Expand Down
Loading