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,7 @@ public record Text2VecAwsVectorizer(
@SerializedName("service") Service service,
@SerializedName("targetModel") String targetModel,
@SerializedName("targetVariant") String targetVariant,
@SerializedName("dimensions") Integer dimensions,

/**
* Weaviate defaults to {@code true} if the value is not provided.
Expand Down Expand Up @@ -83,6 +84,7 @@ public Text2VecAwsVectorizer(
Service service,
String targetModel,
String targetVariant,
Integer dimensions,

boolean vectorizeCollectionName,
List<String> sourceProperties,
Expand All @@ -94,6 +96,7 @@ public Text2VecAwsVectorizer(
this.service = service;
this.targetModel = targetModel;
this.targetVariant = targetVariant;
this.dimensions = dimensions;

this.vectorizeCollectionName = false;
this.sourceProperties = sourceProperties;
Expand All @@ -109,6 +112,7 @@ public Text2VecAwsVectorizer(Builder builder) {
builder.service,
builder.targetModel,
builder.targetVariant,
builder.dimensions,

builder.vectorizeCollectionName,
builder.sourceProperties,
Expand All @@ -128,6 +132,7 @@ public abstract static class Builder implements ObjectBuilder<Text2VecAwsVectori
private String region;
private String targetModel;
private String targetVariant;
private Integer dimensions;

protected Builder(Service service) {
this.service = service;
Expand Down Expand Up @@ -160,6 +165,11 @@ public Builder targetVariant(String targetVariant) {
return this;
}

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

/** Add properties to include in the embedding. */
public Builder sourceProperties(String... properties) {
return sourceProperties(Arrays.asList(properties));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public static Object[][] testCases() {
},
{
VectorConfig.class,
Text2VecAwsVectorizer.bedrock("amazon.titan-embed-text-v2:0"),
Text2VecAwsVectorizer.bedrock("amazon.titan-embed-text-v2:0", v -> v.dimensions(512)),
"""
{
"vectorIndexType": "hnsw",
Expand All @@ -180,6 +180,7 @@ public static Object[][] testCases() {
"text2vec-aws": {
"service": "bedrock",
"model": "amazon.titan-embed-text-v2:0",
"dimensions": 512,
"vectorizeClassName": false
}
}
Expand Down
Loading