Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
9008370
feat: add text2vec-cohere vectorizer
bevzzz Oct 24, 2025
6c204d0
feat: add text2vec-huggingface module
bevzzz Oct 27, 2025
f374b61
feat: add text2vec-morph vectorizer
bevzzz Oct 27, 2025
c38376a
feat: add text2vec-model2vec vectorizer
bevzzz Oct 27, 2025
cbc0e8f
chore: standardize namic in text2vec-weaviate vectorizer
bevzzz Oct 27, 2025
efb3974
feat: add text2vec-voyageai vectorizer
bevzzz Oct 27, 2025
e07ee01
feat: add text2vec-transformers vectorizer
bevzzz Oct 27, 2025
7b5437e
chore: add Google's vectorizers
bevzzz Oct 27, 2025
63f34db
feat: add text2vec-openai vectorizer
bevzzz Oct 27, 2025
1762ba3
feat: add text2vec-ollama vectorizer
bevzzz Oct 27, 2025
68fcb20
feat: add text2vec-mistral vectorizer
bevzzz Oct 27, 2025
51bfc4a
feat: add text2vec-nvidia vectorizer
bevzzz Oct 27, 2025
3335689
feat: add Jina vectorizers
bevzzz Oct 27, 2025
75710aa
feat: add text2vec-databricks vectorizer
bevzzz Oct 27, 2025
400f6c3
feat: add Azure OpenAI vectorizer
bevzzz Oct 27, 2025
b74ac15
feat: add ref2vec-centroid vectorizer
bevzzz Oct 27, 2025
ba47135
fix: remove sourceProperties from ref2vec
bevzzz Oct 27, 2025
fa87e9e
chore: add AWS vectorizer module
bevzzz Oct 27, 2025
20be1f3
feat: multi2vec-aws module
bevzzz Oct 27, 2025
e7227b9
feat: muli2vec-nvidia module
bevzzz Oct 27, 2025
cd473bc
feat: add multi2vec-cohere module
bevzzz Oct 27, 2025
21dc2e5
feat: add multi2multivec-jinaai and multi2vec-bind vectorizer modules
bevzzz Oct 27, 2025
4047aec
feat: add multi2vec-voyageai
bevzzz Oct 27, 2025
1471ecf
feat: add multi2vec-jinaai module
bevzzz Oct 27, 2025
484c0ba
feat: add multi2vec-google vectorizer
bevzzz Oct 27, 2025
5ca18f9
feat: register vectorizer adapters in the type adapter factory
bevzzz Oct 27, 2025
e4eb52b
feat: provide separate builder for AWS sagemaker/bedrock
bevzzz Oct 27, 2025
29d6b9b
chore: fix inconsistencies
bevzzz Oct 27, 2025
7c552e4
feat: add static factories for vectorizer modules
bevzzz Oct 28, 2025
a12ac45
chore: fix imports
bevzzz Oct 28, 2025
9fb8e49
test: fix connection to Transformers container
bevzzz Oct 28, 2025
c8a9577
chore: add converters and type checkers for VectorConfig variants
bevzzz Oct 28, 2025
fb0556b
fix: rename file
bevzzz Oct 28, 2025
d4774a2
test: migrate to model2vec container for tests
bevzzz Oct 29, 2025
328493f
chore: use consistent spelling for module names
bevzzz Oct 29, 2025
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
2 changes: 1 addition & 1 deletion src/it/java/io/weaviate/containers/Container.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

public class Container {
public static final Weaviate WEAVIATE = Weaviate.createDefault();
public static final Contextionary CONTEXTIONARY = Contextionary.createDefault();
public static final Model2Vec MODEL2VEC = Model2Vec.createDefault();
public static final Img2VecNeural IMG2VEC_NEURAL = Img2VecNeural.createDefault();
public static final MinIo MINIO = MinIo.createDefault();

Expand Down
46 changes: 0 additions & 46 deletions src/it/java/io/weaviate/containers/Contextionary.java

This file was deleted.

3 changes: 3 additions & 0 deletions src/it/java/io/weaviate/containers/MinIo.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ public class MinIo extends MinIOContainer {
public static final String ACCESS_KEY = "minioadmin";
public static final String SECRET_KEY = "minioadmin";

public static final String HOST_NAME = "minio";
public static final String URL = HOST_NAME + ":9000";

static MinIo createDefault() {
return new MinIo();
}
Expand Down
40 changes: 40 additions & 0 deletions src/it/java/io/weaviate/containers/Model2Vec.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package io.weaviate.containers;

import org.testcontainers.containers.GenericContainer;

import io.weaviate.client6.v1.api.collections.VectorConfig;

public class Model2Vec extends GenericContainer<Model2Vec> {
public static final String VERSION = "minishlab-potion-retrieval-32M";
public static final String DOCKER_IMAGE = "cr.weaviate.io/semitechnologies/model2vec-inference";
public static final String MODULE = VectorConfig.Kind.TEXT2VEC_MODEL2VEC.jsonValue();

public static final String HOST_NAME = "model2vec";
public static final String URL = HOST_NAME + ":8080";

static Model2Vec createDefault() {
return new Builder().build();
}

static Model2Vec.Builder custom() {
return new Builder();
}

public static class Builder {
private String versionTag;

public Builder() {
this.versionTag = VERSION;
}

public Model2Vec build() {
var container = new Model2Vec(DOCKER_IMAGE + ":" + versionTag);
container.withCreateContainerCmdModifier(cmd -> cmd.withHostName(HOST_NAME));
return container;
}
}

public Model2Vec(String image) {
super(image);
}
}
9 changes: 5 additions & 4 deletions src/it/java/io/weaviate/containers/Weaviate.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ public Builder withDefaultVectorizer(String module) {
return this;
}

public Builder withContextionaryUrl(String url) {
addModules(Contextionary.MODULE);
environment.put("CONTEXTIONARY_URL", url);
public Builder withModel2VecUrl(String url) {
addModules(Model2Vec.MODULE);
environment.put("MODEL2VEC_INFERENCE_API", "http://" + url);
return this;
}

Expand All @@ -126,7 +126,7 @@ public Builder withImageInference(String url, String module) {

public Builder withOffloadS3(String accessKey, String secretKey) {
addModules("offload-s3");
environment.put("OFFLOAD_S3_ENDPOINT", "http://minio:9000");
environment.put("OFFLOAD_S3_ENDPOINT", "http://" + MinIo.URL);
environment.put("OFFLOAD_S3_BUCKET_AUTO_CREATE", "true");
environment.put("AWS_ACCESS_KEY_ID", accessKey);
environment.put("AWS_SECRET_KEY", secretKey);
Expand All @@ -138,6 +138,7 @@ public Builder withFilesystemBackup(String fsPath) {
environment.put("BACKUP_FILESYSTEM_PATH", fsPath);
return this;
}

public Builder withAdminUsers(String... admins) {
adminUsers.addAll(Arrays.asList(admins));
return this;
Expand Down
26 changes: 13 additions & 13 deletions src/it/java/io/weaviate/integration/SearchITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@
import io.weaviate.client6.v1.api.collections.vectorindex.MultiVector;
import io.weaviate.containers.Container;
import io.weaviate.containers.Container.ContainerGroup;
import io.weaviate.containers.Contextionary;
import io.weaviate.containers.Img2VecNeural;
import io.weaviate.containers.Model2Vec;
import io.weaviate.containers.Weaviate;

public class SearchITest extends ConcurrentTest {
private static final ContainerGroup compose = Container.compose(
Weaviate.custom()
.withContextionaryUrl(Contextionary.URL)
.withModel2VecUrl(Model2Vec.URL)
.withImageInference(Img2VecNeural.URL, Img2VecNeural.MODULE)
.addModules("generative-dummy")
.build(),
Container.IMG2VEC_NEURAL,
Container.CONTEXTIONARY);
Container.MODEL2VEC);
@ClassRule // Bind containers to the lifetime of the test
public static final TestRule _rule = compose.asTestRule();
private static final WeaviateClient client = compose.getClient();
Expand Down Expand Up @@ -151,7 +151,7 @@ public void testNearText() throws IOException {
client.collections.create(nsSongs,
col -> col
.properties(Property.text("title"))
.vectorConfig(VectorConfig.text2vecContextionary()));
.vectorConfig(VectorConfig.text2vecModel2Vec()));

var songs = client.collections.use(nsSongs);
var submarine = songs.data.insert(Map.of("title", "Yellow Submarine"));
Expand All @@ -160,7 +160,7 @@ public void testNearText() throws IOException {

var result = songs.query.nearText("forest",
opt -> opt
.distance(0.5f)
.distance(0.9f)
.moveTo(.98f, to -> to.concepts("tropical"))
.moveAway(.4f, away -> away.uuids(submarine.metadata().uuid()))
.returnProperties("title"));
Expand All @@ -173,7 +173,7 @@ public void testNearText() throws IOException {

@Test
public void testNearText_groupBy() throws IOException {
var vectorizer = VectorConfig.text2vecContextionary();
var vectorizer = VectorConfig.text2vecModel2Vec();

var nsArtists = ns("Artists");
client.collections.create(nsArtists,
Expand Down Expand Up @@ -370,7 +370,7 @@ public void testNearObject() throws IOException {
client.collections.create(nsAnimals,
collection -> collection
.properties(Property.text("kind"))
.vectorConfig(VectorConfig.text2vecContextionary()));
.vectorConfig(VectorConfig.text2vecModel2Vec()));

var animals = client.collections.use(nsAnimals);

Expand Down Expand Up @@ -399,7 +399,7 @@ public void testHybrid() throws IOException {
client.collections.create(nsHobbies,
collection -> collection
.properties(Property.text("name"), Property.text("description"))
.vectorConfig(VectorConfig.text2vecContextionary()));
.vectorConfig(VectorConfig.text2vecModel2Vec()));

var hobbies = client.collections.use(nsHobbies);

Expand Down Expand Up @@ -432,7 +432,7 @@ public void testBadRequest() throws IOException {
client.collections.create(nsThings,
collection -> collection
.properties(Property.text("name"))
.vectorConfig(VectorConfig.text2vecContextionary()));
.vectorConfig(VectorConfig.text2vecModel2Vec()));

var things = client.collections.use(nsThings);
var balloon = things.data.insert(Map.of("name", "balloon"));
Expand All @@ -449,7 +449,7 @@ public void testBadRequest_async() throws Throwable {
async.collections.create(nsThings,
collection -> collection
.properties(Property.text("name"))
.vectorConfig(VectorConfig.text2vecContextionary()))
.vectorConfig(VectorConfig.text2vecModel2Vec()))
.join();

var things = async.collections.use(nsThings);
Expand All @@ -470,7 +470,7 @@ public void testMetadataAll() throws IOException {
client.collections.create(nsThings,
c -> c
.properties(Property.text("name"))
.vectorConfig(VectorConfig.text2vecContextionary(
.vectorConfig(VectorConfig.text2vecModel2Vec(
t2v -> t2v.sourceProperties("name"))));

var things = client.collections.use(nsThings);
Expand Down Expand Up @@ -563,7 +563,7 @@ public void testGenerative_bm25() throws IOException {
c -> c
.properties(Property.text("title"))
.generativeModule(new DummyGenerative())
.vectorConfig(VectorConfig.text2vecContextionary(
.vectorConfig(VectorConfig.text2vecModel2Vec(
t2v -> t2v.sourceProperties("title"))));

var things = client.collections.use(nsThings);
Expand Down Expand Up @@ -604,7 +604,7 @@ public void testGenerative_bm25_groupBy() throws IOException {
c -> c
.properties(Property.text("title"))
.generativeModule(new DummyGenerative())
.vectorConfig(VectorConfig.text2vecContextionary(
.vectorConfig(VectorConfig.text2vecModel2Vec(
t2v -> t2v.sourceProperties("title"))));

var things = client.collections.use(nsThings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,27 +94,47 @@ public static Generative anyscale(Function<AnyscaleGenerative.Builder, ObjectBui
}

/**
* Configure a default {@code generative-aws} module.
* Configure a default {@code generative-aws} module with Bedrock integration.
*
* @param region AWS region.
* @param model Model to use with Bedrock service.
*/
public static Generative awsBedrock(String region, String model) {
return AwsGenerative.bedrock(region, model);
}

/**
* Configure a {@code generative-aws} module with Bedrock integration.
*
* @param region AWS region.
* @param model Model to use with Bedrock service.
* @param fn Lambda expression for optional parameters.
*/
public static Generative awsBedrock(String region, String model,
Function<AwsGenerative.BedrockBuilder, ObjectBuilder<AwsGenerative>> fn) {
return AwsGenerative.bedrock(region, model, fn);
}

/**
* Configure a default {@code generative-aws} module with Sagemaker integration.
*
* @param region AWS region.
* @param service AWS service to use, e.g. {@code "bedrock"} or
* {@code "sagemaker"}.
* @param baseUrl Base inference URL.
*/
public static Generative aws(String region, String service) {
return AwsGenerative.of(region, service);
public static Generative awsSagemaker(String region, String baseUrl) {
return AwsGenerative.sagemaker(region, baseUrl);
}

/**
* Configure a {@code generative-aws} module.
* Configure a {@code generative-aws} module with Sagemaker integration.
*
* @param region AWS region.
* @param service AWS service to use, e.g. {@code "bedrock"} or
* {@code "sagemaker"}.
* @param baseUrl Base inference URL.
* @param fn Lambda expression for optional parameters.
*/
public static Generative aws(String region, String service,
Function<AwsGenerative.Builder, ObjectBuilder<AwsGenerative>> fn) {
return AwsGenerative.of(region, service, fn);
public static Generative awsSagemaker(String region, String baseUrl,
Function<AwsGenerative.SagemakerBuilder, ObjectBuilder<AwsGenerative>> fn) {
return AwsGenerative.sagemaker(region, baseUrl, fn);
}

/** Configure a default {@code generative-cohere} module. */
Expand Down
Loading