Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public record Multi2VecCohereVectorizer(
@SerializedName("baseURL") String baseUrl,
/** Inference model to use. */
@SerializedName("model") String model,
/** The number of dimensions for the generated embeddings. */
@SerializedName("dimensions") Integer dimensions,
/** The truncate strategy to use. */
@SerializedName("truncate") String truncate,
/** BLOB properties included in the embedding. */
Expand Down Expand Up @@ -71,6 +73,7 @@ public static Multi2VecCohereVectorizer of(Function<Builder, ObjectBuilder<Multi
public Multi2VecCohereVectorizer(
String baseUrl,
String model,
Integer dimensions,
String truncate,
List<String> imageFields,
List<String> textFields,
Expand All @@ -81,6 +84,7 @@ public Multi2VecCohereVectorizer(
this.vectorizeCollectionName = false;
this.baseUrl = baseUrl;
this.model = model;
this.dimensions = dimensions;
this.truncate = truncate;
this.imageFields = imageFields;
this.textFields = textFields;
Expand All @@ -93,6 +97,7 @@ public Multi2VecCohereVectorizer(Builder builder) {
this(
builder.baseUrl,
builder.model,
builder.dimensions,
builder.truncate,
builder.imageFields.keySet().stream().toList(),
builder.textFields.keySet().stream().toList(),
Expand All @@ -114,6 +119,7 @@ public static class Builder implements ObjectBuilder<Multi2VecCohereVectorizer>

private String baseUrl;
private String model;
private Integer dimensions;
private String truncate;

/** Set base URL of the embedding service. */
Expand All @@ -127,6 +133,11 @@ public Builder model(String model) {
return this;
}

public Builder dimensions(Integer dimensions) {
this.dimensions = dimensions;
return this;
}

public Builder truncate(String truncate) {
this.truncate = truncate;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
public record Text2VecCohereVectorizer(
@SerializedName("baseUrl") String baseUrl,
@SerializedName("model") String model,
@SerializedName("dimensions") Integer dimensions,
@SerializedName("truncate") Truncate truncate,

/**
Expand Down Expand Up @@ -68,13 +69,15 @@ public static Text2VecCohereVectorizer of(
public Text2VecCohereVectorizer(
String baseUrl,
String model,
Integer dimensions,
Truncate truncate,

boolean vectorizeCollectionName,
List<String> sourceProperties,
VectorIndex vectorIndex,
Quantization quantization) {
this.model = model;
this.dimensions = dimensions;
this.truncate = truncate;
this.baseUrl = baseUrl;

Expand All @@ -88,6 +91,7 @@ public Text2VecCohereVectorizer(Builder builder) {
this(
builder.baseUrl,
builder.model,
builder.dimensions,
builder.truncate,
builder.vectorizeCollectionName,
builder.sourceProperties,
Expand All @@ -102,6 +106,7 @@ public static class Builder implements ObjectBuilder<Text2VecCohereVectorizer> {
private VectorIndex vectorIndex = VectorIndex.DEFAULT_VECTOR_INDEX;

private String model;
private Integer dimensions;
private Truncate truncate;
private String baseUrl;

Expand All @@ -115,6 +120,11 @@ public Builder model(String model) {
return this;
}

public Builder dimensions(Integer dimensions) {
this.dimensions = dimensions;
return this;
}

public Builder truncate(Truncate truncate) {
this.truncate = truncate;
return this;
Expand Down