diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml index 82aad7758..41e3eaf9e 100644 --- a/.github/workflows/create-release.yaml +++ b/.github/workflows/create-release.yaml @@ -16,7 +16,7 @@ jobs: || (github.event_name == 'pull_request' && github.event.pull_request.merged == true) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - name: Unpack secrets env: GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} @@ -37,7 +37,7 @@ jobs: -Dcentral-publishing.waitUntil=published \ deploy - name: Archive artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: name: jar-files path: "target/*.jar" @@ -49,12 +49,12 @@ jobs: needs: [ release ] steps: - name: Download artifacts to append to release - uses: actions/download-artifact@v4 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: name: jar-files path: target - name: Create a GitHub Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1 with: generate_release_notes: true draft: true diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index cbc21456b..5b13f073e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -15,18 +15,43 @@ env: DOCKER_IMAGES_TAR: docker-images.tar jobs: + maven-cache: + name: Cache Maven dependencies + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 + with: + distribution: "zulu" + java-version: "17" + cache: "maven" + - run: mvn dependency:go-offline + + unit: + name: Unit tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 + with: + distribution: "zulu" + java-version: "17" + cache: "maven" + - run: mvn test -Dtest='!*ITest' + docker-cache: + needs: unit name: Cache shared Docker images runs-on: ubuntu-latest steps: - name: Login to Docker Hub if: ${{ !github.event.pull_request.head.repo.fork }} - uses: docker/login-action@v3 + uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - id: cache-check - uses: actions/cache/restore@v4 + uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5 env: DOCKER_CACHE_KEY: docker-images-${{ env.IMG2VEC }}-${{ env.MINIO }}-${{ env.MODEL2VEC }} with: @@ -34,7 +59,7 @@ jobs: key: ${{ env.DOCKER_CACHE_KEY }} lookup-only: true # Only check if cache exists, don't download - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@v1.3.1 + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 with: tool-cache: false android: true @@ -52,44 +77,33 @@ jobs: docker save $IMG2VEC $MINIO -o $DOCKER_IMAGES_TAR - name: Cache images if: steps.cache-check.outputs.cache-hit != 'true' - uses: actions/cache/save@v4 + uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5 env: DOCKER_CACHE_KEY: docker-images-${{ env.IMG2VEC }}-${{ env.MINIO }}-${{ env.MODEL2VEC }} with: path: ${{ env.DOCKER_IMAGES_TAR }} key: ${{ env.DOCKER_CACHE_KEY }} - maven-cache: - name: Cache Maven dependencies - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: "zulu" - java-version: "17" - cache: "maven" - - run: mvn dependency:go-offline - - test: - name: Test + integration: + name: Integration Tests runs-on: ubuntu-latest - needs: [docker-cache, maven-cache] + needs: [maven-cache, unit, docker-cache] strategy: fail-fast: false matrix: - WEAVIATE_VERSION: ["1.32.24", "1.33.11", "1.34.7", "1.35.2", "1.36.1"] + WEAVIATE_VERSION: + ["1.32.24", "1.33.11", "1.34.7", "1.35.2", "1.36.9", "1.37.1"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - - uses: actions/cache/restore@v4 + - uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5 env: DOCKER_CACHE_KEY: docker-images-${{ env.IMG2VEC }}-${{ env.MINIO }}-${{ env.MODEL2VEC }} with: path: ${{ env.DOCKER_IMAGES_TAR }} key: ${{ env.DOCKER_CACHE_KEY }} - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@v1.3.1 + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 with: tool-cache: false android: true @@ -103,7 +117,7 @@ jobs: if [ -f $DOCKER_IMAGES_TAR ]; then docker load -i $DOCKER_IMAGES_TAR fi - - uses: actions/setup-java@v4 + - uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 name: Setup JDK with: distribution: "zulu" @@ -118,4 +132,4 @@ jobs: AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} OPENAI_APIKEY: ${{ secrets.OPENAI_APIKEY }} WEAVIATE_VERSION: ${{ matrix.WEAVIATE_VERSION }} - run: mvn verify -Dgpg.skip + run: mvn verify -Dtest='*ITest' -Dgpg.skip diff --git a/README.md b/README.md index 07b1f8c34..dbfdc21c1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Weaviate Java client Weaviate logo +# Weaviate Java client Weaviate logo [![Build Status](https://github.com/weaviate/java-client/actions/workflows/.github/workflows/test.yaml/badge.svg?branch=main)](https://github.com/weaviate/java-client/actions/workflows/.github/workflows/test.yaml) @@ -15,7 +15,7 @@ To start using Weaviate Java Client add the dependency to `pom.xml`: io.weaviate client6 - 6.1.0 + 6.2.0 ``` @@ -28,7 +28,7 @@ This ensures that all dynamically-loaded dependecies of `io.grpc` are resolved c io.weaviate client6 - 6.1.0 + 6.2.0 all ``` diff --git a/pom.xml b/pom.xml index 008298fbf..17c74bc8a 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ io.weaviate client6 jar - 6.1.0 + 6.2.0 ${project.groupId}:${project.artifactId} Official Java client for Weaviate Vector Search Engine @@ -42,7 +42,7 @@ scm:git:git://github.com/weaviate/java-client.git scm:git:ssh://github.com:weaviate/java-client.git https://github.com/weaviate/java-client/tree/main - 6.1.0 + 6.2.0 @@ -170,9 +170,8 @@ org.slf4j - slf4j-nop + slf4j-api ${slf4j.version} - test org.mock-server @@ -237,13 +236,11 @@ maven-surefire-plugin 3.5.4 - false - classes - 4 - true - 1 - true - balanced + + + ${project.basedir}/src/test/resources/logging.properties + + @@ -546,5 +543,5 @@ central-publishing-maven-plugin - + diff --git a/src/it/java/io/weaviate/containers/Container.java b/src/it/java/io/weaviate/containers/Container.java index 304dbea91..e0dddf681 100644 --- a/src/it/java/io/weaviate/containers/Container.java +++ b/src/it/java/io/weaviate/containers/Container.java @@ -19,6 +19,7 @@ public class Container { public static final MinIo MINIO = MinIo.createDefault(); public static ContainerGroup compose(Weaviate weaviate, GenericContainer... containers) { + assert weaviate != WEAVIATE : "cannot compose with static WEAVIATE contaier"; return new ContainerGroup(weaviate, containers); } @@ -50,7 +51,9 @@ public void start() { @Override public void stop() { weaviate.stop(); - containers.forEach(GenericContainer::stop); + containers.stream() + .dropWhile(c -> c == MODEL2VEC || c == IMG2VEC_NEURAL || c == MINIO) + .forEach(GenericContainer::stop); } private void setSharedNetwork() { diff --git a/src/it/java/io/weaviate/containers/Weaviate.java b/src/it/java/io/weaviate/containers/Weaviate.java index 02ea3c180..d7c7fcd03 100644 --- a/src/it/java/io/weaviate/containers/Weaviate.java +++ b/src/it/java/io/weaviate/containers/Weaviate.java @@ -28,9 +28,11 @@ public class Weaviate extends WeaviateContainer { public static final String DOCKER_IMAGE = "semitechnologies/weaviate"; public static final String LATEST_VERSION = Version.latest().semver.toString(); public static final String VERSION; + private static final boolean DEBUG; static { VERSION = System.getenv().getOrDefault("WEAVIATE_VERSION", LATEST_VERSION); + DEBUG = System.getenv("DEBUG") != null; } public static String OIDC_ISSUER = "https://auth.wcs.api.weaviate.io/auth/realms/SeMI"; @@ -42,7 +44,8 @@ public enum Version { V133(1, 33, 11), V134(1, 34, 7), V135(1, 35, 2), - V136(1, 36, 1); + V136(1, 36, 9), + V137(1, 37, 1); public final SemanticVersion semver; @@ -93,6 +96,9 @@ public String getContainerName() { public WeaviateClient getClient() { if (!isRunning()) { start(); + if (DEBUG) { + followOutput(frame -> System.out.println(frame.getUtf8String())); + } } if (clientInstance != null) { return clientInstance; @@ -302,6 +308,7 @@ public Weaviate build() { // Required in v1.36.1, but we'll just set it by default. c.withEnv("OBJECTS_TTL_DELETE_SCHEDULE", "@hourly"); + c.withEnv("ENABLE_EXPERIMENTAL_ALTER_SCHEMA_DROP_VECTOR_INDEX_ENDPOINT", "true"); var apiKeyUsers = new HashSet(); apiKeyUsers.addAll(adminUsers); diff --git a/src/it/java/io/weaviate/integration/BackupITest.java b/src/it/java/io/weaviate/integration/BackupITest.java index 0f51ca724..bcab53de8 100644 --- a/src/it/java/io/weaviate/integration/BackupITest.java +++ b/src/it/java/io/weaviate/integration/BackupITest.java @@ -7,15 +7,16 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; import java.util.concurrent.TimeoutException; import java.util.stream.IntStream; import org.assertj.core.api.Assertions; import org.assertj.core.api.InstanceOfAssertFactories; +import org.junit.AfterClass; import org.junit.Test; -import com.sun.nio.sctp.IllegalUnbindException; - import io.weaviate.ConcurrentTest; import io.weaviate.client6.v1.api.WeaviateClient; import io.weaviate.client6.v1.api.backup.Backup; @@ -25,10 +26,16 @@ import io.weaviate.containers.Weaviate; public class BackupITest extends ConcurrentTest { + private static final ExecutorService EXEC = Executors.newSingleThreadExecutor(); private static final WeaviateClient client = Weaviate.custom() .withFilesystemBackup("/tmp/backups").build() .getClient(); + @AfterClass + public static void tearDown() { + EXEC.shutdownNow(); + } + @Test public void test_lifecycle() throws IOException, TimeoutException { Weaviate.Version.V132.orSkip(); // List backups not implemented in earlier versions @@ -258,6 +265,6 @@ private CompletableFuture spamData(String collectionName) { throw new CompletionException(e); } return null; - }); + }, EXEC); } } diff --git a/src/it/java/io/weaviate/integration/BatchITest.java b/src/it/java/io/weaviate/integration/BatchITest.java new file mode 100644 index 000000000..a36ed6305 --- /dev/null +++ b/src/it/java/io/weaviate/integration/BatchITest.java @@ -0,0 +1,41 @@ +package io.weaviate.integration; + +import java.io.IOException; + +import org.assertj.core.api.Assertions; +import org.junit.BeforeClass; +import org.junit.Test; + +import io.weaviate.ConcurrentTest; +import io.weaviate.client6.v1.api.WeaviateClient; +import io.weaviate.client6.v1.api.collections.WeaviateObject; +import io.weaviate.client6.v1.api.collections.batch.BatchContext; +import io.weaviate.containers.Container; +import io.weaviate.containers.Weaviate; + +public class BatchITest extends ConcurrentTest { + private static final WeaviateClient client = Container.WEAVIATE.getClient(); + + @BeforeClass + public static void __() { + Weaviate.Version.V136.orSkip(); + } + + @Test + public void test10_000Objects() throws IOException { + var nsThings = ns("Things"); + + var things = client.collections.create(nsThings); + + // Act + try (BatchContext batch = things.batch.start()) { + for (int i = 0; i < 10_000; i++) { + batch.add(WeaviateObject.of()); + } + } catch (InterruptedException e) { + } + + // Assert + Assertions.assertThat(things.size()).isEqualTo(10_000); + } +} diff --git a/src/it/java/io/weaviate/integration/ClusterITest.java b/src/it/java/io/weaviate/integration/ClusterITest.java index baea17f70..1502dec05 100644 --- a/src/it/java/io/weaviate/integration/ClusterITest.java +++ b/src/it/java/io/weaviate/integration/ClusterITest.java @@ -3,6 +3,7 @@ import java.io.IOException; import org.assertj.core.api.Assertions; +import org.junit.AfterClass; import org.junit.Test; import io.weaviate.ConcurrentTest; @@ -17,7 +18,13 @@ import io.weaviate.containers.Weaviate.Version; public class ClusterITest extends ConcurrentTest { - private static final WeaviateClient client = Weaviate.cluster(3).getClient(); + private static final Weaviate cluster = Weaviate.cluster(3); + private static final WeaviateClient client = cluster.getClient(); + + @AfterClass + public static void tearDown() { + cluster.stop(); + } @Test public void test_shardingState() throws IOException { diff --git a/src/it/java/io/weaviate/integration/CollectionsITest.java b/src/it/java/io/weaviate/integration/CollectionsITest.java index ad513a2fb..889041277 100644 --- a/src/it/java/io/weaviate/integration/CollectionsITest.java +++ b/src/it/java/io/weaviate/integration/CollectionsITest.java @@ -20,6 +20,7 @@ import io.weaviate.client6.v1.api.collections.Replication; import io.weaviate.client6.v1.api.collections.Replication.AsyncReplicationConfig; import io.weaviate.client6.v1.api.collections.VectorConfig; +import io.weaviate.client6.v1.api.collections.VectorIndex; import io.weaviate.client6.v1.api.collections.config.PropertyIndexType; import io.weaviate.client6.v1.api.collections.config.Shard; import io.weaviate.client6.v1.api.collections.config.ShardStatus; @@ -370,8 +371,34 @@ public void test_dropPropertyIndex() throws IOException { .returns(false, Property::indexFilterable) .returns(false, Property::indexSearchable) .returns(false, Property::indexRangeFilters)); - } - + } + + @Test + public void test_dropVectorIndex() throws IOException { + Weaviate.Version.V137.orSkip(); + + // Arrange + var nsThings = ns("Things"); + var things = client.collections.create(nsThings, + c -> c.vectorConfig(VectorConfig.selfProvided("leaveme"), VectorConfig.selfProvided("dropme"))); + + var config = things.config.get(); + Assertions.assertThat(config).get() + .extracting(CollectionConfig::vectors, InstanceOfAssertFactories.map(String.class, VectorConfig.class)) + .hasSize(2) + .containsKey("dropme"); + + things.config.dropVectorIndex("dropme"); + + config = things.config.get(); + Assertions.assertThat(config).get() + .extracting(CollectionConfig::vectors, InstanceOfAssertFactories.map(String.class, VectorConfig.class)) + .hasSize(2) + .extractingByKey("dropme") + .extracting(VectorConfig::vectorIndex) + .matches(VectorIndex::isNone).as("is 'none'"); + } + @Test public void test_asyncReplicationConfig() throws IOException { Weaviate.Version.latest().orSkip(); diff --git a/src/it/java/io/weaviate/integration/DataITest.java b/src/it/java/io/weaviate/integration/DataITest.java index a0969655f..5136aca8e 100644 --- a/src/it/java/io/weaviate/integration/DataITest.java +++ b/src/it/java/io/weaviate/integration/DataITest.java @@ -486,7 +486,7 @@ public void testDataTypes() throws IOException { .asInstanceOf(InstanceOfAssertFactories.map(String.class, Object.class)) // Most of PhoneNumber fields are only present on read and are null on write. .usingRecursiveComparison() - .withComparatorForType(ORMITest::comparePhoneNumbers, PhoneNumber.class) + .withComparatorForType(OrmITest::comparePhoneNumbers, PhoneNumber.class) .isEqualTo(want); } diff --git a/src/it/java/io/weaviate/integration/OIDCSupportITest.java b/src/it/java/io/weaviate/integration/OidcSupportITest.java similarity index 96% rename from src/it/java/io/weaviate/integration/OIDCSupportITest.java rename to src/it/java/io/weaviate/integration/OidcSupportITest.java index fbbbd8c67..1bc9502b0 100644 --- a/src/it/java/io/weaviate/integration/OIDCSupportITest.java +++ b/src/it/java/io/weaviate/integration/OidcSupportITest.java @@ -9,6 +9,7 @@ import org.assertj.core.api.Assertions; import org.junit.Assume; +import org.junit.Ignore; import org.junit.Test; import io.weaviate.ConcurrentTest; @@ -28,7 +29,7 @@ * Additionally, {@code WCS_DUMMY_CI_PW} and {@code OKTA_CLIENT_SECRET} * environment variables must be set. */ -public class OIDCSupportITest extends ConcurrentTest { +public class OidcSupportITest extends ConcurrentTest { private static final String WCS_DUMMY_CI_USERNAME = "oidc-test-user@weaviate.io"; private static final String WCS_DUMMY_CI_PW = System.getenv("WCS_DUMMY_CI_PW"); @@ -66,10 +67,7 @@ public void test_bearerToken() throws Exception { var auth = SpyTokenProvider.spyOn(Authentication.bearerToken(t.accessToken(), t.refreshToken(), 0)); pingWeaviate(wcsContainer, auth); - var newT = auth.getToken(); - Assertions.assertThat(newT.accessToken()) - .as("expect access_token was refreshed") - .isNotEqualTo(t.accessToken()); + eventually(() -> auth.getToken() != t, 100, 5, "expect access_token was refreshed"); // Check that the new token authenticates requests. pingWeaviate(wcsContainer, auth); @@ -81,7 +79,7 @@ public void test_resourceOwnerPassword() throws Exception { Assume.assumeTrue("WCS_DUMMY_CI_PW is not set", WCS_DUMMY_CI_PW != null && !WCS_DUMMY_CI_PW.isBlank()); Assume.assumeTrue("no internet connection", hasInternetConnection()); - // Check norwal resource owner password flow works. + // Check normal resource owner password flow works. var password = Authentication.resourceOwnerPassword(WCS_DUMMY_CI_USERNAME, WCS_DUMMY_CI_PW, List.of()); var auth = SpyTokenProvider.spyOn(password); pingWeaviate(wcsContainer, auth); @@ -104,7 +102,7 @@ public void test_resourceOwnerPassword() throws Exception { @Test public void test_clientCredentials() throws Exception { - Assume.assumeTrue("OKTA_CLIENT_SECRET is not set", OKTA_CLIENT_SECRET != null && OKTA_CLIENT_SECRET.isBlank()); + Assume.assumeTrue("OKTA_CLIENT_SECRET is not set", OKTA_CLIENT_SECRET != null && !OKTA_CLIENT_SECRET.isBlank()); Assume.assumeTrue("no internet connection", hasInternetConnection()); // Check norwal client credentials flow works. diff --git a/src/it/java/io/weaviate/integration/ORMITest.java b/src/it/java/io/weaviate/integration/OrmITest.java similarity index 98% rename from src/it/java/io/weaviate/integration/ORMITest.java rename to src/it/java/io/weaviate/integration/OrmITest.java index 6095d91b4..fbfabb2bd 100644 --- a/src/it/java/io/weaviate/integration/ORMITest.java +++ b/src/it/java/io/weaviate/integration/OrmITest.java @@ -24,7 +24,7 @@ import io.weaviate.client6.v1.api.collections.query.Filter; import io.weaviate.containers.Container; -public class ORMITest extends ConcurrentTest { +public class OrmITest extends ConcurrentTest { private static final WeaviateClient client = Container.WEAVIATE.getClient(); @Collection("ORMITestThings") @@ -166,7 +166,7 @@ public void test_createCollection() throws Exception { // so we'll just always return true here. .withComparatorForFields((a, b) -> 0, "floatBoxedList") .withComparatorForType((a, b) -> Double.compare(a.doubleValue(), b.doubleValue()), Number.class) - .withComparatorForType(ORMITest::comparePhoneNumbers, PhoneNumber.class) + .withComparatorForType(OrmITest::comparePhoneNumbers, PhoneNumber.class) .build(); @Test diff --git a/src/it/java/io/weaviate/integration/RbacITest.java b/src/it/java/io/weaviate/integration/RbacITest.java index 57d6ca7e7..f3c183355 100644 --- a/src/it/java/io/weaviate/integration/RbacITest.java +++ b/src/it/java/io/weaviate/integration/RbacITest.java @@ -14,6 +14,7 @@ import io.weaviate.client6.v1.api.rbac.AliasesPermission; import io.weaviate.client6.v1.api.rbac.BackupsPermission; import io.weaviate.client6.v1.api.rbac.ClusterPermission; +import io.weaviate.client6.v1.api.rbac.McpPermission; import io.weaviate.client6.v1.api.rbac.CollectionsPermission; import io.weaviate.client6.v1.api.rbac.DataPermission; import io.weaviate.client6.v1.api.rbac.GroupsPermission; @@ -83,14 +84,11 @@ public void test_roles_Lifecycle() throws IOException { permissions.add( Permission.groups("my-group", GroupType.OIDC, GroupsPermission.Action.READ)); }); - - requireAtLeast(Weaviate.Version.V132, () -> { - permissions.add( - Permission.aliases("ThingsAlias", myCollection, AliasesPermission.Action.CREATE)); - }); - requireAtLeast(Weaviate.Version.V133, () -> { - permissions.add( - Permission.groups("my-group", GroupType.OIDC, GroupsPermission.Action.READ)); + requireAtLeast(Weaviate.Version.V137, () -> { + permissions.add(Permission.mcp( + McpPermission.Action.CREATE, + McpPermission.Action.READ, + McpPermission.Action.UPDATE)); }); // Act: create role diff --git a/src/it/java/io/weaviate/integration/SearchITest.java b/src/it/java/io/weaviate/integration/SearchITest.java index 35f0aa30d..a812e5d91 100644 --- a/src/it/java/io/weaviate/integration/SearchITest.java +++ b/src/it/java/io/weaviate/integration/SearchITest.java @@ -32,10 +32,14 @@ import io.weaviate.client6.v1.api.collections.generate.GenerativeObject; import io.weaviate.client6.v1.api.collections.generate.TaskOutput; import io.weaviate.client6.v1.api.collections.generative.DummyGenerative; +import io.weaviate.client6.v1.api.collections.query.FetchObjectById; import io.weaviate.client6.v1.api.collections.query.Filter; import io.weaviate.client6.v1.api.collections.query.GroupBy; import io.weaviate.client6.v1.api.collections.query.Metadata; +import io.weaviate.client6.v1.api.collections.query.QueryProfile; +import io.weaviate.client6.v1.api.collections.query.QueryResponse; import io.weaviate.client6.v1.api.collections.query.QueryResponseGroup; +import io.weaviate.client6.v1.api.collections.query.QueryResponseGrouped; import io.weaviate.client6.v1.api.collections.query.Rerank; import io.weaviate.client6.v1.api.collections.query.SortBy; import io.weaviate.client6.v1.api.collections.query.Target; @@ -47,6 +51,7 @@ import io.weaviate.containers.Img2VecNeural; import io.weaviate.containers.Model2Vec; import io.weaviate.containers.Weaviate; +import io.weaviate.containers.Weaviate.Version; public class SearchITest extends ConcurrentTest { private static final ContainerGroup compose = Container.compose( @@ -790,4 +795,93 @@ public void test_rerankQueries() throws IOException { // Assert: ranking not important really, just that the request was valid. Assertions.assertThat(got.objects()).hasSize(2); } + + @Test + public void testVectorizerModel2VecPropeties() throws IOException { + var collectionName = ns("Books"); + client.collections.create(collectionName, + col -> col + .properties(Property.text("title"), Property.text("author")) + .vectorConfig( + VectorConfig.text2vecModel2Vec("title_vec", v -> v.sourceProperties("title")), + VectorConfig.text2vecModel2Vec("author_vec", v -> v.sourceProperties("author")))); + + var books = client.collections.use(collectionName); + Assertions.assertThat(books).isNotNull(); + + WeaviateObject> dune = WeaviateObject.of( + o -> o.properties(Map.of( + "title", "Dune", + "author", "Frank Herbert"))); + WeaviateObject> abc = WeaviateObject.of( + o -> o.properties(Map.of( + "title", "ABC", + "author", "ABC"))); + + var resp = books.data.insertMany(dune, abc); + Assertions.assertThat(resp).isNotNull().satisfies(s -> { + Assertions.assertThat(s.errors()).isEmpty(); + }); + + // Assert that for Dune we have generated 2 different vectors + var gotDune = books.query.fetchObjectById(dune.uuid(), FetchObjectById.Builder::includeVector); + Assertions.assertThat(gotDune).get() + .extracting(WeaviateObject::vectors) + .satisfies(v -> { + Assertions.assertThat(v.getSingle("title_vec")).isNotEmpty(); + Assertions.assertThat(v.getSingle("author_vec")).isNotEmpty(); + Assertions.assertThat(v.getSingle("title_vec")).isNotEqualTo(v.getSingle("author_vec")); + }); + + // Assert that for ABC we have generated same vectors + var gotAbc = books.query.fetchObjectById(abc.uuid(), FetchObjectById.Builder::includeVector); + Assertions.assertThat(gotAbc).get() + .extracting(WeaviateObject::vectors) + .satisfies(v -> { + Assertions.assertThat(v.getSingle("title_vec")).isNotEmpty(); + Assertions.assertThat(v.getSingle("author_vec")).isNotEmpty(); + Assertions.assertThat(v.getSingle("title_vec")).isEqualTo(v.getSingle("author_vec")); + }); + } + + @Test + public void testQueryProfile() throws Exception { + Version.V136.orSkip(); + + var things = client.collections.use(COLLECTION); + var resp = things.query.nearVector(searchVector, + opt -> opt.distance(10f) + .returnMetadata(Metadata.QUERY_PROFILE)); + + Assertions.assertThat(resp) + .extracting(QueryResponse::queryProfile).isNotNull() + .extracting(QueryProfile::shards, InstanceOfAssertFactories.list(QueryProfile.ShardProfile.class)) + .hasSize(1) + .allSatisfy(shardProfile -> Assertions.assertThat(shardProfile) + .extracting(QueryProfile.ShardProfile::searches, + InstanceOfAssertFactories.map(String.class, String.class)) + .isNotEmpty()); + } + + @Test + @Ignore("v1.36.9 does not support query profiles for grouped queries") + public void testQueryProfile_groupBy() throws Exception { + Version.V136.orSkip(); + + var things = client.collections.use(COLLECTION); + var resp = things.query.nearVector(searchVector, + opt -> opt.distance(10f) + .returnMetadata(Metadata.QUERY_PROFILE), + GroupBy.property("category", 2, 5)); + + Assertions.assertThat(resp) + .extracting(QueryResponseGrouped::queryProfile).isNotNull() + .extracting(QueryProfile::shards, + InstanceOfAssertFactories.list(QueryProfile.ShardProfile.class)) + .hasSize(1) + .allSatisfy(shardProfile -> Assertions.assertThat(shardProfile) + .extracting(QueryProfile.ShardProfile::searches, + InstanceOfAssertFactories.map(String.class, String.class)) + .isNotEmpty()); + } } diff --git a/src/it/java/io/weaviate/integration/VectorizersITest.java b/src/it/java/io/weaviate/integration/VectorizersITest.java deleted file mode 100644 index 69c6e50a1..000000000 --- a/src/it/java/io/weaviate/integration/VectorizersITest.java +++ /dev/null @@ -1,81 +0,0 @@ -package io.weaviate.integration; - -import java.io.IOException; -import java.util.Map; - -import org.junit.ClassRule; -import org.junit.Test; -import org.junit.rules.TestRule; - -import io.weaviate.ConcurrentTest; -import io.weaviate.client6.v1.api.WeaviateClient; -import io.weaviate.client6.v1.api.collections.Property; -import io.weaviate.client6.v1.api.collections.VectorConfig; -import io.weaviate.client6.v1.api.collections.WeaviateObject; -import io.weaviate.client6.v1.api.collections.query.FetchObjectById; -import io.weaviate.containers.Container; -import io.weaviate.containers.Model2Vec; -import io.weaviate.containers.Weaviate; - -import static org.assertj.core.api.Assertions.assertThat; - -public class VectorizersITest extends ConcurrentTest { - private static final Container.ContainerGroup compose = Container.compose( - Weaviate.custom() - .withModel2VecUrl(Model2Vec.URL) - .build(), - 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(); - - @Test - public void testVectorizerModel2VecPropeties() throws IOException { - var collectionName = ns("Model2Vec2NamedVectors"); - client.collections.create(collectionName, - col -> col - .properties(Property.text("name"), Property.text("author")) - .vectorConfig( - VectorConfig.text2vecModel2Vec("name", v -> v.sourceProperties("name")), - VectorConfig.text2vecModel2Vec("author", v -> v.sourceProperties("author")) - ) - ); - - var model2vec = client.collections.use(collectionName); - assertThat(model2vec).isNotNull(); - - String uuid1 = "00000000-0000-0000-0000-000000000001"; - WeaviateObject> obj1 = WeaviateObject.of(o -> - o.properties(Map.of("name", "Dune", "author", "Frank Herbert")).uuid(uuid1) - ); - String uuid2 = "00000000-0000-0000-0000-000000000002"; - WeaviateObject> obj2 = WeaviateObject.of(o -> - o.properties(Map.of("name", "same content", "author", "same content")).uuid(uuid2) - ); - - var resp = model2vec.data.insertMany(obj1, obj2); - assertThat(resp).isNotNull().satisfies(s -> { - assertThat(s.errors()).isEmpty(); - }); - - var o1 = model2vec.query.fetchObjectById(uuid1, FetchObjectById.Builder::includeVector); - // Assert that for object1 we have generated 2 different vectors - assertThat(o1).get() - .extracting(WeaviateObject::vectors) - .satisfies(v -> { - assertThat(v.getSingle("name")).isNotEmpty(); - assertThat(v.getSingle("author")).isNotEmpty(); - assertThat(v.getSingle("name")).isNotEqualTo(v.getSingle("author")); - }); - - var o2 = model2vec.query.fetchObjectById(uuid2, FetchObjectById.Builder::includeVector); - // Assert that for object2 we have generated same vectors - assertThat(o2).get() - .extracting(WeaviateObject::vectors) - .satisfies(v -> { - assertThat(v.getSingle("name")).isNotEmpty(); - assertThat(v.getSingle("author")).isNotEmpty(); - assertThat(v.getSingle("name")).isEqualTo(v.getSingle("author")); - }); - } -} diff --git a/src/main/java/io/weaviate/client6/v1/api/Authentication.java b/src/main/java/io/weaviate/client6/v1/api/Authentication.java index 1c8776c1c..eb6a83ec6 100644 --- a/src/main/java/io/weaviate/client6/v1/api/Authentication.java +++ b/src/main/java/io/weaviate/client6/v1/api/Authentication.java @@ -56,6 +56,26 @@ public static Authentication resourceOwnerPassword(String username, String passw }; } + /** + * Authenticate using Resource Owner Password Credentials authorization grant. + * + * @param clientSecret Client secret. + * @param username Resource owner username. + * @param password Resource owner password. + * @param scopes Client scopes. + * + * @return Authentication provider. + * @throws WeaviateOAuthException if an error occurred at any point of the token + * exchange process. + */ + public static Authentication resourceOwnerPasswordCredentials(String clientSecret, String username, String password, + List scopes) { + return transport -> { + OidcConfig oidc = OidcUtils.getConfig(transport).withScopes(scopes).withScopes("offline_access"); + return TokenProvider.resourceOwnerPasswordCredentials(oidc, clientSecret, username, password); + }; + } + /** * Authenticate using Client Credentials authorization grant. * diff --git a/src/main/java/io/weaviate/client6/v1/api/Config.java b/src/main/java/io/weaviate/client6/v1/api/Config.java index b52b37066..c3c16623e 100644 --- a/src/main/java/io/weaviate/client6/v1/api/Config.java +++ b/src/main/java/io/weaviate/client6/v1/api/Config.java @@ -9,8 +9,10 @@ import io.weaviate.client6.v1.internal.BuildInfo; import io.weaviate.client6.v1.internal.ObjectBuilder; +import io.weaviate.client6.v1.internal.Proxy; import io.weaviate.client6.v1.internal.Timeout; import io.weaviate.client6.v1.internal.TokenProvider; +import io.weaviate.client6.v1.internal.TransportOptions; import io.weaviate.client6.v1.internal.grpc.GrpcChannelOptions; import io.weaviate.client6.v1.internal.rest.RestTransportOptions; @@ -23,7 +25,8 @@ public record Config( Map headers, Authentication authentication, TrustManagerFactory trustManagerFactory, - Timeout timeout) { + Timeout timeout, + Proxy proxy) { public static Config of(Function> fn) { return fn.apply(new Custom()).build(); @@ -39,7 +42,8 @@ private Config(Builder builder) { builder.headers, builder.authentication, builder.trustManagerFactory, - builder.timeout); + builder.timeout, + builder.proxy); } RestTransportOptions restTransportOptions() { @@ -47,7 +51,7 @@ RestTransportOptions restTransportOptions() { } RestTransportOptions restTransportOptions(TokenProvider tokenProvider) { - return new RestTransportOptions(scheme, httpHost, httpPort, headers, tokenProvider, trustManagerFactory, timeout); + return new RestTransportOptions(scheme, httpHost, httpPort, headers, tokenProvider, trustManagerFactory, timeout, proxy); } GrpcChannelOptions grpcTransportOptions() { @@ -55,7 +59,7 @@ GrpcChannelOptions grpcTransportOptions() { } GrpcChannelOptions grpcTransportOptions(TokenProvider tokenProvider) { - return new GrpcChannelOptions(scheme, grpcHost, grpcPort, headers, tokenProvider, trustManagerFactory, timeout); + return new GrpcChannelOptions(scheme, grpcHost, grpcPort, headers, tokenProvider, trustManagerFactory, timeout, proxy); } private abstract static class Builder> implements ObjectBuilder { @@ -69,6 +73,7 @@ private abstract static class Builder> implements O protected TrustManagerFactory trustManagerFactory; protected Timeout timeout = new Timeout(); protected Map headers = new HashMap<>(); + protected Proxy proxy; /** * Set URL scheme. Subclasses may increase the visibility of this method to @@ -174,6 +179,15 @@ public SelfT timeout(int initSeconds, int querySeconds, int insertSeconds) { return (SelfT) this; } + /** + * Set proxy for all requests. + */ + @SuppressWarnings("unchecked") + public SelfT proxy(Proxy proxy) { + this.proxy = proxy; + return (SelfT) this; + } + /** * Weaviate will use the URL in this header to call Weaviate Embeddings * Service if an appropriate vectorizer is configured for collection. @@ -181,26 +195,15 @@ public SelfT timeout(int initSeconds, int querySeconds, int insertSeconds) { private static final String HEADER_X_WEAVIATE_CLUSTER_URL = "X-Weaviate-Cluster-URL"; private static final String HEADER_X_WEAVIATE_CLIENT = "X-Weaviate-Client"; - /** - * isWeaviateDomain returns true if the host matches weaviate.io, - * semi.technology, or weaviate.cloud domain. - */ - private static boolean isWeaviateDomain(String host) { - var lower = host.toLowerCase(); - return lower.contains("weaviate.io") || - lower.contains("semi.technology") || - lower.contains("weaviate.cloud"); - } - private static final String VERSION = "weaviate-client-java/" - + ((!BuildInfo.TAGS.isBlank() && BuildInfo.TAGS != "unknown") ? BuildInfo.TAGS - : (BuildInfo.BRANCH + "-" + BuildInfo.COMMIT_ID_ABBREV)); + + ((!BuildInfo.TAGS.isBlank() && BuildInfo.TAGS != "unknown") ? BuildInfo.TAGS + : (BuildInfo.BRANCH + "-" + BuildInfo.COMMIT_ID_ABBREV)); @Override public Config build() { // For clusters hosted on Weaviate Cloud, Weaviate Embedding Service // will be available under the same domain. - if (isWeaviateDomain(httpHost) && authentication != null) { + if (TransportOptions.isWeaviateDomain(httpHost) && authentication != null) { setHeader(HEADER_X_WEAVIATE_CLUSTER_URL, "https://" + httpHost + ":" + httpPort); } setHeader(HEADER_X_WEAVIATE_CLIENT, VERSION); diff --git a/src/main/java/io/weaviate/client6/v1/api/WeaviateClient.java b/src/main/java/io/weaviate/client6/v1/api/WeaviateClient.java index 63e14c3bf..6150ab4d5 100644 --- a/src/main/java/io/weaviate/client6/v1/api/WeaviateClient.java +++ b/src/main/java/io/weaviate/client6/v1/api/WeaviateClient.java @@ -63,14 +63,13 @@ public class WeaviateClient implements AutoCloseable { public final WeaviateClusterClient cluster; public WeaviateClient(Config config) { - RestTransportOptions restOpt; + RestTransportOptions restOpt = config.restTransportOptions(); GrpcChannelOptions grpcOpt; if (config.authentication() == null) { - restOpt = config.restTransportOptions(); grpcOpt = config.grpcTransportOptions(); } else { TokenProvider tokenProvider; - try (final var noAuthRest = new DefaultRestTransport(config.restTransportOptions())) { + try (final var noAuthRest = new DefaultRestTransport(restOpt)) { tokenProvider = config.authentication().getTokenProvider(noAuthRest); } catch (Exception e) { // Generally exceptions are caught in TokenProvider internals. @@ -126,6 +125,10 @@ public WeaviateClient(Config config) { this.config = config; } + public Config getConfig() { + return config; + } + /** * Create {@link WeaviateClientAsync} with identical configurations. * It is a shorthand for: diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/CollectionHandle.java b/src/main/java/io/weaviate/client6/v1/api/collections/CollectionHandle.java index 7af8ed549..b49ec987a 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/CollectionHandle.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/CollectionHandle.java @@ -1,9 +1,11 @@ package io.weaviate.client6.v1.api.collections; import java.util.Collection; +import java.util.Optional; import java.util.function.Function; import io.weaviate.client6.v1.api.collections.aggregate.WeaviateAggregateClient; +import io.weaviate.client6.v1.api.collections.batch.WeaviateBatchClient; import io.weaviate.client6.v1.api.collections.config.WeaviateConfigClient; import io.weaviate.client6.v1.api.collections.data.WeaviateDataClient; import io.weaviate.client6.v1.api.collections.generate.WeaviateGenerateClient; @@ -23,6 +25,7 @@ public class CollectionHandle { public final WeaviateAggregateClient aggregate; public final WeaviateGenerateClient generate; public final WeaviateTenantsClient tenants; + public final WeaviateBatchClient batch; private final CollectionHandleDefaults defaults; @@ -36,6 +39,7 @@ public CollectionHandle( this.query = new WeaviateQueryClient<>(collection, grpcTransport, defaults); this.generate = new WeaviateGenerateClient<>(collection, grpcTransport, defaults); this.data = new WeaviateDataClient<>(collection, restTransport, grpcTransport, defaults); + this.batch = new WeaviateBatchClient<>(grpcTransport, collection, defaults); this.defaults = defaults; this.tenants = new WeaviateTenantsClient(collection, restTransport, grpcTransport); @@ -48,6 +52,7 @@ private CollectionHandle(CollectionHandle c, CollectionHandleDefaul this.query = new WeaviateQueryClient<>(c.query, defaults); this.generate = new WeaviateGenerateClient<>(c.generate, defaults); this.data = new WeaviateDataClient<>(c.data, defaults); + this.batch = new WeaviateBatchClient<>(c.batch, defaults); this.defaults = defaults; this.tenants = c.tenants; @@ -112,7 +117,7 @@ public long size() { } /** Default consistency level for requests. */ - public ConsistencyLevel consistencyLevel() { + public Optional consistencyLevel() { return defaults.consistencyLevel(); } @@ -122,7 +127,7 @@ public CollectionHandle withConsistencyLevel(ConsistencyLevel consi } /** Default tenant for requests. */ - public String tenant() { + public Optional tenant() { return defaults.tenant(); } diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/CollectionHandleAsync.java b/src/main/java/io/weaviate/client6/v1/api/collections/CollectionHandleAsync.java index 83d18ed2f..14c551d18 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/CollectionHandleAsync.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/CollectionHandleAsync.java @@ -1,6 +1,7 @@ package io.weaviate.client6.v1.api.collections; import java.util.Collection; +import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.function.Function; @@ -90,7 +91,7 @@ public CompletableFuture size() { } /** Default consistency level for requests. */ - public ConsistencyLevel consistencyLevel() { + public Optional consistencyLevel() { return defaults.consistencyLevel(); } @@ -101,7 +102,7 @@ public CollectionHandleAsync withConsistencyLevel(ConsistencyLevel } /** Default tenant for requests. */ - public String tenant() { + public Optional tenant() { return defaults.tenant(); } diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/CollectionHandleDefaults.java b/src/main/java/io/weaviate/client6/v1/api/collections/CollectionHandleDefaults.java index c7952222a..47ee0dcba 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/CollectionHandleDefaults.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/CollectionHandleDefaults.java @@ -1,14 +1,17 @@ package io.weaviate.client6.v1.api.collections; +import static java.util.Objects.requireNonNull; + import java.util.Collections; import java.util.HashMap; import java.util.Map; +import java.util.Optional; import java.util.function.Function; import io.weaviate.client6.v1.api.collections.query.ConsistencyLevel; import io.weaviate.client6.v1.internal.ObjectBuilder; -public record CollectionHandleDefaults(ConsistencyLevel consistencyLevel, String tenant) { +public record CollectionHandleDefaults(Optional consistencyLevel, Optional tenant) { /** * Set default values for query / aggregation requests. * @@ -28,8 +31,12 @@ public static Function> none() return ObjectBuilder.identity(); } + public CollectionHandleDefaults { + requireNonNull(consistencyLevel, "consistencyLevel is null"); + } + public CollectionHandleDefaults(Builder builder) { - this(builder.consistencyLevel, builder.tenant); + this(Optional.ofNullable(builder.consistencyLevel), Optional.ofNullable(builder.tenant)); } public static final class Builder implements ObjectBuilder { @@ -56,16 +63,12 @@ public CollectionHandleDefaults build() { /** Serialize default values to a URL query. */ public Map queryParameters() { - if (consistencyLevel == null && tenant == null) { + if (consistencyLevel.isEmpty() && tenant.isEmpty()) { return Collections.emptyMap(); } - var query = new HashMap(); - if (consistencyLevel != null) { - query.put("consistency_level", consistencyLevel); - } - if (tenant != null) { - query.put("tenant", tenant); - } + Map query = new HashMap(); + consistencyLevel.ifPresent(v -> query.put("consistency_level", v)); + tenant.ifPresent(v -> query.put("tenant", v)); return query; } } diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/InvertedIndex.java b/src/main/java/io/weaviate/client6/v1/api/collections/InvertedIndex.java index a350f3de0..ff49621c5 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/InvertedIndex.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/InvertedIndex.java @@ -1,5 +1,6 @@ package io.weaviate.client6.v1.api.collections; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.function.Function; @@ -92,8 +93,8 @@ public Stopwords(Builder builder) { public static class Builder implements ObjectBuilder { private String preset; - private List additions; - private List removals; + private final List additions = new ArrayList<>(); + private final List removals = new ArrayList<>(); /** Select a preset to use for a particular language. */ public Builder preset(String preset) { diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/VectorConfig.java b/src/main/java/io/weaviate/client6/v1/api/collections/VectorConfig.java index 045313a16..cae805373 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/VectorConfig.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/VectorConfig.java @@ -17,6 +17,7 @@ import io.weaviate.client6.v1.api.collections.vectorizers.Img2VecNeuralVectorizer; import io.weaviate.client6.v1.api.collections.vectorizers.Multi2MultiVecJinaAiVectorizer; +import io.weaviate.client6.v1.api.collections.vectorizers.Multi2MultiVecWeaviateVectorizer; import io.weaviate.client6.v1.api.collections.vectorizers.Multi2VecAwsVectorizer; import io.weaviate.client6.v1.api.collections.vectorizers.Multi2VecBindVectorizer; import io.weaviate.client6.v1.api.collections.vectorizers.Multi2VecClipVectorizer; @@ -78,7 +79,8 @@ public enum Kind implements JsonEnum { MULTI2VEC_NVIDIA("multi2vec-nvidia"), MULTI2VEC_VOYAGEAI("multi2vec-voyageai"), TEXT2MULTIVEC_JINAAI("text2multivec-jinaai"), - MULTI2MULTIVEC_JINAAI("multi2multivec-jinaai"); + MULTI2MULTIVEC_JINAAI("multi2multivec-jinaai"), + MULTI2MULTIVEC_WEAVIATE("multi2multivec-weaviate"); private static final Map jsonValueMap = JsonEnum.collectNames(Kind.values()); private final String jsonValue; @@ -208,6 +210,43 @@ public static Map.Entry multi2multivecJinaai(String vector return Map.entry(vectorName, Multi2MultiVecJinaAiVectorizer.of(fn)); } + /** Create a vector index with an {@code multi2multivec-weaviate} vectorizer. */ + public static Map.Entry multi2multivecWeaviate() { + return multi2multivecWeaviate(VectorIndex.DEFAULT_VECTOR_NAME); + } + + /** + * Create a vector index with an {@code multi2multivec-weaviate} vectorizer. + * + * @param fn Lambda expression for optional parameters. + */ + public static Map.Entry multi2multivecWeaviate( + Function> fn) { + return multi2multivecWeaviate(VectorIndex.DEFAULT_VECTOR_NAME, fn); + } + + /** + * Create a named vector index with an {@code multi2multivec-weaviate} + * vectorizer. + * + * @param vectorName Vector name. + */ + public static Map.Entry multi2multivecWeaviate(String vectorName) { + return Map.entry(vectorName, Multi2MultiVecWeaviateVectorizer.of()); + } + + /** + * Create a named vector index with an {@code multi2multivec-weaviate} + * vectorizer. + * + * @param vectorName Vector name. + * @param fn Lambda expression for optional parameters. + */ + public static Map.Entry multi2multivecWeaviate(String vectorName, + Function> fn) { + return Map.entry(vectorName, Multi2MultiVecWeaviateVectorizer.of(fn)); + } + /** Create a vector index with an {@code multi2vec-aws} vectorizer. */ public static Map.Entry multi2vecAws() { return multi2vecAws(VectorIndex.DEFAULT_VECTOR_NAME); @@ -352,9 +391,20 @@ public static Map.Entry multi2vecCohere(String vectorName, * Create a vector index with an {@code multi2vec-google} vectorizer. * * @param location Geographic region the Google Cloud model runs in. + * @deprecated Use {@link #multi2vecGoogleVertex}. */ + @Deprecated(forRemoval = true) public static Map.Entry multi2vecGoogle(String projectId, String location) { - return multi2vecGoogle(VectorIndex.DEFAULT_VECTOR_NAME, projectId, location); + return multi2vecGoogleVertex(projectId, location); + } + + /** + * Create a vector index with an {@code multi2vec-google} vectorizer. + * + * @param location Geographic region the Google Cloud model runs in. + */ + public static Map.Entry multi2vecGoogleVertex(String projectId, String location) { + return multi2vecGoogleVertex(VectorIndex.DEFAULT_VECTOR_NAME, projectId, location); } /** @@ -362,12 +412,27 @@ public static Map.Entry multi2vecGoogle(String projectId, * * @param location Geographic region the Google Cloud model runs in. * @param fn Lambda expression for optional parameters. + * @deprecated Use {@link #multi2vecGoogleVertex}. */ + @Deprecated(forRemoval = true) public static Map.Entry multi2vecGoogle( String projectId, String location, - Function> fn) { - return multi2vecGoogle(VectorIndex.DEFAULT_VECTOR_NAME, projectId, location, fn); + Function> fn) { + return multi2vecGoogleVertex(projectId, location, fn); + } + + /** + * Create a vector index with an {@code multi2vec-google} vectorizer. + * + * @param location Geographic region the Google Cloud model runs in. + * @param fn Lambda expression for optional parameters. + */ + public static Map.Entry multi2vecGoogleVertex( + String projectId, + String location, + Function> fn) { + return multi2vecGoogleVertex(VectorIndex.DEFAULT_VECTOR_NAME, projectId, location, fn); } /** @@ -375,9 +440,22 @@ public static Map.Entry multi2vecGoogle( * * @param vectorName Vector name. * @param location Geographic region the Google Cloud model runs in. + * @deprecated Use {@link #multi2vecGoogleVertex}. */ + @Deprecated(forRemoval = true) public static Map.Entry multi2vecGoogle(String vectorName, String projectId, String location) { - return Map.entry(vectorName, Multi2VecGoogleVectorizer.of(projectId, location)); + return multi2vecGoogleVertex(vectorName, projectId, location); + } + + /** + * Create a named vector index with an {@code multi2vec-google} vectorizer. + * + * @param vectorName Vector name. + * @param location Geographic region the Google Cloud model runs in. + */ + public static Map.Entry multi2vecGoogleVertex(String vectorName, String projectId, + String location) { + return Map.entry(vectorName, Multi2VecGoogleVectorizer.vertex(projectId, location)); } /** @@ -386,11 +464,63 @@ public static Map.Entry multi2vecGoogle(String vectorName, * @param vectorName Vector name. * @param location Geographic region the Google Cloud model runs in. * @param fn Lambda expression for optional parameters. + * @deprecated Use {@link #multi2vecGoogleVertex}. */ + @Deprecated(forRemoval = true) public static Map.Entry multi2vecGoogle(String vectorName, String projectId, String location, - Function> fn) { - return Map.entry(vectorName, Multi2VecGoogleVectorizer.of(projectId, location, fn)); + Function> fn) { + return multi2vecGoogleVertex(vectorName, projectId, location, fn); + } + + /** + * Create a named vector index with an {@code multi2vec-google} vectorizer. + * + * @param vectorName Vector name. + * @param location Geographic region the Google Cloud model runs in. + * @param fn Lambda expression for optional parameters. + */ + public static Map.Entry multi2vecGoogleVertex(String vectorName, + String projectId, String location, + Function> fn) { + return Map.entry(vectorName, Multi2VecGoogleVectorizer.vertex(projectId, location, fn)); + } + + /** + * Create a vector index with an {@code multi2vec-google} vectorizer. + */ + public static Map.Entry multi2vecGoogleGemini() { + return multi2vecGoogleGemini(VectorIndex.DEFAULT_VECTOR_NAME); + } + + /** + * Create a vector index with an {@code multi2vec-google} vectorizer. + * + * @param fn Lambda expression for optional parameters. + */ + public static Map.Entry multi2vecGoogleGemini( + Function> fn) { + return multi2vecGoogleGemini(VectorIndex.DEFAULT_VECTOR_NAME, fn); + } + + /** + * Create a named vector index with an {@code multi2vec-google} vectorizer. + * + * @param vectorName Vector name. + */ + public static Map.Entry multi2vecGoogleGemini(String vectorName) { + return Map.entry(vectorName, Multi2VecGoogleVectorizer.gemini()); + } + + /** + * Create a named vector index with an {@code multi2vec-google} vectorizer. + * + * @param vectorName Vector name. + * @param fn Lambda expression for optional parameters. + */ + public static Map.Entry multi2vecGoogleGemini(String vectorName, + Function> fn) { + return Map.entry(vectorName, Multi2VecGoogleVectorizer.gemini(fn)); } /** Create a vector index with an {@code multi2vec-jinaai} vectorizer. */ @@ -1559,6 +1689,7 @@ private final void init(Gson gson) { addAdapter(gson, VectorConfig.Kind.MULTI2VEC_VOYAGEAI, Multi2VecVoyageAiVectorizer.class); addAdapter(gson, VectorConfig.Kind.TEXT2MULTIVEC_JINAAI, Text2MultiVecJinaAiVectorizer.class); addAdapter(gson, VectorConfig.Kind.MULTI2MULTIVEC_JINAAI, Multi2MultiVecJinaAiVectorizer.class); + addAdapter(gson, VectorConfig.Kind.MULTI2MULTIVEC_WEAVIATE, Multi2MultiVecWeaviateVectorizer.class); } @SuppressWarnings("unchecked") @@ -1604,7 +1735,12 @@ public void write(JsonWriter out, VectorConfig value) throws IOException { @Override public VectorConfig read(JsonReader in) throws IOException { var jsonObject = JsonParser.parseReader(in).getAsJsonObject(); - var vectorIndexConfig = jsonObject.get("vectorIndexConfig").getAsJsonObject(); + JsonObject vectorIndexConfig = new JsonObject(); + if (jsonObject.has("vectorIndexConfig")) { + // If the vector index has been dropped it will still be present in the + // response, but won't contain "vectorIndexConfig" and "vectorIndexType" fields. + vectorIndexConfig = jsonObject.get("vectorIndexConfig").getAsJsonObject(); + } String quantizationKind = null; for (var kind : new String[] { diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/VectorIndex.java b/src/main/java/io/weaviate/client6/v1/api/collections/VectorIndex.java index 6535c1d6c..7fb697830 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/VectorIndex.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/VectorIndex.java @@ -5,6 +5,7 @@ import java.util.Map; import com.google.gson.Gson; +import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; @@ -28,7 +29,8 @@ enum Kind implements JsonEnum { HNSW("hnsw"), FLAT("flat"), DYNAMIC("dynamic"), - HFRESH("hfresh"); + HFRESH("hfresh"), + NONE("none"); private static final Map jsonValueMap = JsonEnum.collectNames(Kind.values()); private final String jsonValue; @@ -87,6 +89,11 @@ default HFresh asHFresh() { return _as(VectorIndex.Kind.HFRESH); } + /** Is this a "none" vector index? */ + default boolean isNone() { + return _is(VectorIndex.Kind.NONE); + } + static enum CustomTypeAdapterFactory implements TypeAdapterFactory { INSTANCE; @@ -102,6 +109,7 @@ private final void init(Gson gson) { addAdapter(gson, VectorIndex.Kind.FLAT, Flat.class); addAdapter(gson, VectorIndex.Kind.DYNAMIC, Dynamic.class); addAdapter(gson, VectorIndex.Kind.HFRESH, HFresh.class); + addAdapter(gson, VectorIndex.Kind.NONE, NoneVectorIndex.class); } @SuppressWarnings("unchecked") @@ -137,8 +145,22 @@ public void write(JsonWriter out, VectorIndex value) throws IOException { public VectorIndex read(JsonReader in) throws IOException { var jsonObject = JsonParser.parseReader(in).getAsJsonObject(); + var vectorIndexType = jsonObject.get("vectorIndexType"); + if (vectorIndexType == null || vectorIndexType.isJsonNull()) { + // VectorConfig.CustomTypeAdapterFactory cannot provide this + // value for vector indexes that have been dropped. + return null; + } + + var vectorIndexConfig = jsonObject.get("vectorIndexConfig"); + if (vectorIndexConfig == null || vectorIndexConfig.isJsonNull()) { + // VectorConfig.CustomTypeAdapterFactory cannot provide this + // value for vector indexes that have been dropped. + vectorIndexConfig = new JsonObject(); + } + VectorIndex.Kind kind; - var kindString = jsonObject.get("vectorIndexType").getAsString(); + var kindString = vectorIndexType.getAsString(); try { kind = VectorIndex.Kind.valueOfJson(kindString); } catch (IllegalArgumentException e) { @@ -150,10 +172,28 @@ public VectorIndex read(JsonReader in) throws IOException { return null; } - var config = jsonObject.get("vectorIndexConfig").getAsJsonObject(); + var config = vectorIndexConfig.getAsJsonObject(); return adapter.fromJsonTree(config); } }.nullSafe(); } + + /** + * NoneVectorIndex is a special kind of vector index config + * used for an index that has been deleted. It is not possible + * to create an vector index with "none" config, so it stays + * private to it's parent {@link CustomTypeAdapterFactory}. + */ + private record NoneVectorIndex() implements VectorIndex { + @Override + public VectorIndex.Kind _kind() { + return VectorIndex.Kind.NONE; + } + + @Override + public Object _self() { + return this; + } + } } } diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateCollectionsClient.java b/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateCollectionsClient.java index c0fca9bbc..e6101f682 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateCollectionsClient.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateCollectionsClient.java @@ -75,7 +75,7 @@ public CollectionHandle> use( return use(CollectionDescriptor.ofMap(collectionName), fn); } - private CollectionHandle use(CollectionDescriptor collection, + public CollectionHandle use(CollectionDescriptor collection, Function> fn) { return new CollectionHandle<>(restTransport, grpcTransport, collection, CollectionHandleDefaults.of(fn)); } diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateObject.java b/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateObject.java index 7faf0e20b..5cc03b470 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateObject.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/WeaviateObject.java @@ -43,6 +43,10 @@ public WeaviateObject> asWeaviateObject() { return (WeaviateObject>) this; } + public static WeaviateObject of() { + return of(ObjectBuilder.identity()); + } + public static WeaviateObject of( Function, ObjectBuilder>> fn) { return fn.apply(new Builder<>()).build(); diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/aggregate/AggregateRequest.java b/src/main/java/io/weaviate/client6/v1/api/collections/aggregate/AggregateRequest.java index fa8290f64..7d048937a 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/aggregate/AggregateRequest.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/aggregate/AggregateRequest.java @@ -25,9 +25,7 @@ static Rpc { diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/batch/Batch.java b/src/main/java/io/weaviate/client6/v1/api/collections/batch/Batch.java new file mode 100644 index 000000000..e83a1340a --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/batch/Batch.java @@ -0,0 +1,372 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import static java.util.Objects.requireNonNull; + +import java.time.Instant; +import java.util.Collection; +import java.util.Comparator; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.ListIterator; +import java.util.OptionalInt; +import java.util.Set; +import java.util.TreeSet; + +import javax.annotation.concurrent.GuardedBy; +import javax.annotation.concurrent.ThreadSafe; + +import io.weaviate.client6.v1.api.collections.batch.Event.Backoff; +import io.weaviate.client6.v1.internal.grpc.GrpcChannelOptions; + +/** + * Batch can be in either of 2 states: + *
    + *
  • Open batch accepts new items and can be resized. + *
  • In-flight batch is sealed: it rejects new items and + * avoids otherwise modifying the {@link #buffer} until it's cleared. + *
+ * + *

Class invariants

+ * + * {@link #maxSize} and {@link #maxSizeBytes} MUST be positive. + * A batch with {@code cap=0} is not useful.
+ * {@link #buffer} size and {@link #sizeBytes} MUST be non-negative.
+ * {@link #buffer} size MUST NOT exceed {@link #maxSize}.
+ * {@link #sizeBytes} MUST NOT exceed {@link #maxSize}.
+ * {@link #sizeBytes} MUST be 0 if the buffer is full.
+ * {@link #backlog} MAY only contain items when {@link #buffer} is full. In the + * {@link #pendingMaxSize} is empty for an open batch.
+ * edge-case + * + * + * @see #inFlight + * @see #isFull + * @see #clear + * @see #checkInvariants + */ +@ThreadSafe +final class Batch { + /** Backlog MUST be confined to the "receiver" thread. */ + private final TreeSet backlog = new TreeSet<>(BacklogItem.comparator()); + + /** + * Items stored in this batch. + */ + @GuardedBy("this") + private final LinkedHashMap buffer; + + /** + * Maximum number of items that can be added to the request. + * Must be greater that zero. + * + *

+ * This is determined by the server's {@link Backoff} instruction. + */ + @GuardedBy("this") + private int maxSize; + + /** + * Maximum size of the serialized message in bytes. + * Must be greater that zero. + * + *

+ * This is determined by the {@link GrpcChannelOptions#maxMessageSize()}. + */ + @GuardedBy("this") + private final int maxSizeBytes; + + /** Total serialized size of the items in the {@link #buffer}. */ + @GuardedBy("this") + private long sizeBytes; + + /** An in-flight batch is unmodifiable. */ + @GuardedBy("this") + private boolean inFlight = false; + + /** + * Pending update to the {@link #maxSize}. + * + * The value is non-empty when {@link #setMaxSize} is called + * while the batch is {@link #inFlight}. + */ + @GuardedBy("this") + private OptionalInt pendingMaxSize = OptionalInt.empty(); + + Batch(int maxSize, int maxSizeBytes) { + assert maxSize > 0 : "non-positive maxSize"; + + this.maxSizeBytes = MessageSizeUtil.maxSizeBytes(maxSizeBytes); + this.maxSize = maxSize; + this.buffer = new LinkedHashMap<>(maxSize); // LinkedHashMap preserves insertion order. + + checkInvariants(); + } + + /** + * Returns true if batch has reached its capacity, either in terms + * of the item count or the batch's estimated size in bytes. + */ + synchronized boolean isFull() { + return buffer.size() == maxSize || sizeBytes == maxSizeBytes; + } + + /** + * Returns true if the batch's internal buffer is empty. + * If it's primary buffer is empty, its backlog is guaranteed + * to be empty as well. + */ + synchronized boolean isEmpty() { + return buffer.isEmpty(); // sizeBytes == 0 is guaranteed by class invariant. + } + + /** + * Prepare a request to be sent. After calling this method, this batch becomes + * "in-flight": an attempt to {@link #add} more items to it will be rejected + * with an exception. + */ + synchronized Message prepare() { + checkInvariants(); + + inFlight = true; + return builder -> { + buffer.forEach((__, data) -> { + data.appendTo(builder); + }); + }; + } + + /** + * Set the new {@link #maxSize} for this buffer. + * + *

+ * How the size is applied depends on the buffer's current state: + *

    + *
  • When the batch is in-flight, the new limit is stored in + * {@link #pendingMaxSize} and will be applied once the batch is cleared. + *
  • While the batch is still open, the new limit is applied immediately and + * the {@link #pendingMaxSize} is set back to {@link OptionalInt#empty}. If + * the current buffer size exceeds the new limit, the overflow items are moved + * to the {@link #backlog}. + *
+ * + * @param maxSizeNew New batch size limit. + * + * @see #clear + */ + synchronized void setMaxSize(int maxSizeNew) { + // We do not checkInvariants() here, because setMaxSize may + // be called from clear() at the time when the batch is already + // open but before pendingMaxSize is set to OptionalInt.empty(). + + try { + // In-flight batch cannot be modified. + // Store the requested maxSize for later; + // it will be applied on the next ack. + if (inFlight) { + pendingMaxSize = OptionalInt.of(maxSizeNew); + return; + } + + maxSize = maxSizeNew; + pendingMaxSize = OptionalInt.empty(); + + // Buffer still fits under the new limit. + if (buffer.size() <= maxSize) { + return; + } + + // Buffer exceeds the new limit. Move extra items to the backlog (LIFO). + ListIterator extra = List.copyOf(buffer.keySet()).listIterator(buffer.size()); + while (extra.hasPrevious() && buffer.size() > maxSize) { + addBacklog(buffer.remove(extra.previous())); + } + } finally { + checkInvariants(); + } + } + + /** + * Add a data item to the batch. + * + *

+ * We want to guarantee that, once a work item has been taken from the queue, + * it's going to be eventually executed. Because we cannot know if an item + * will overflow the batch before it's removed from the queue, the simplest + * and safest way to deal with it is to allow {@link Batch} to put + * the overflowing item in the {@link #backlog}. The batch is considered + * full after that. + * + * @throws DataTooBigException If the data exceeds the maximum + * possible batch size. + * @throws IllegalStateException If called on an "in-flight" batch. + * @see #prepare + * @see #inFlight + * @see #clear + */ + synchronized void add(Data data) throws IllegalStateException, DataTooBigException { + requireNonNull(data, "data is null"); + checkInvariants(); + + try { + if (inFlight) { + throw new IllegalStateException("Batch is in-flight"); + } + if (data.sizeBytes() > maxSizeBytes) { + throw new DataTooBigException(data, maxSizeBytes); + } + + long remainingBytes = maxSizeBytes - sizeBytes; + if (data.sizeBytes() <= remainingBytes && buffer.size() < maxSize) { + addSafe(data); + return; + } + // One of the class's invariants is that the backlog must not contain + // any items unless the buffer is full. In case this item overflows + // the buffer, we put it in the backlog, but pretend the maxSizeBytes + // has been reached to satisfy the invariant. + // This doubles as a safeguard to ensure the caller cannot add any + // more items to the batch before flushing it. + addBacklog(data); + sizeBytes += remainingBytes; + assert isFull() : "batch must be full after an overflow"; + } finally { + checkInvariants(); + } + } + + /** + * Add a data item to the batch. + * + * This method does not check {@link Data#sizeBytes()}, so the caller + * must ensure that this item will not overflow the batch. + */ + private synchronized void addSafe(Data data) { + buffer.put(data.id(), data); + sizeBytes += data.sizeBytes(); + } + + /** Add a data item to the {@link #backlog}. */ + private synchronized void addBacklog(Data data) { + backlog.add(new BacklogItem(data)); + } + + /** + * Clear this batch's internal buffer. + * + *

+ * Once the buffer is pruned, it is re-populated from the backlog + * until the former is full or the latter is exhausted. + * If {@link #pendingMaxSize} is not empty, it is applied + * before re-populating the buffer. + * + * @return IDs removed from the buffer. + */ + synchronized Collection clear() { + checkInvariants(); + + try { + inFlight = false; + + Set removed = Set.copyOf(buffer.keySet()); + buffer.clear(); + sizeBytes = 0; + + if (pendingMaxSize.isPresent()) { + setMaxSize(pendingMaxSize.getAsInt()); + } + + // Populate internal buffer from the backlog. + // We don't need to check the return value of .add(), + // as all items in the backlog are guaranteed to not + // exceed maxSizeBytes. + Iterator backlogIterator = backlog.iterator(); + while (backlogIterator.hasNext() && !isFull()) { + addSafe(backlogIterator.next().data()); + backlogIterator.remove(); + } + + return removed; + } finally { + checkInvariants(); + } + } + + private static record BacklogItem(Data data, Instant createdAt) { + public BacklogItem { + requireNonNull(data, "data is null"); + requireNonNull(createdAt, "createdAt is null"); + } + + /** + * This constructor sets {@link #createdAt} automatically. + * It is not important that this timestamp is different from + * the one in {@link TaskHandle}, as longs as the order is correct. + */ + public BacklogItem(Data data) { + this(data, Instant.now()); + } + + /** Comparator sorts BacklogItems by their creation time. */ + private static Comparator comparator() { + return new Comparator() { + + @Override + public int compare(BacklogItem a, BacklogItem b) { + if (a.equals(b)) { + return 0; + } + + int cmpInstant = a.createdAt.compareTo(b.createdAt); + boolean sameInstant = cmpInstant == 0; + if (sameInstant) { + // We cannot return 0 for two items with different + // contents, as it may result in data loss. + // If they were somehow created in the same instant, + // let them be sorted lexicographically. + return a.data.id().compareTo(b.data.id()); + } + return cmpInstant; + } + }; + } + } + + /** Get total number of items in the batch. */ + synchronized int size() { + return buffer.size() + backlog.size(); + } + + /** Get current size of the batch in bytes. */ + synchronized long sizeBytes() { + return sizeBytes; + } + + synchronized int maxSizeBytes() { + return maxSizeBytes; + } + + synchronized int maxSize() { + return maxSize; + } + + /** Asserts the invariants of this class. */ + private synchronized void checkInvariants() { + assert maxSize > 0 : "non-positive maxSize"; + assert maxSizeBytes > 0 : "non-positive maxSizeBytes"; + assert sizeBytes >= 0 : "negative sizeBytes"; + assert buffer.size() <= maxSize : "buffer exceeds maxSize"; + assert sizeBytes <= maxSizeBytes : "message exceeds maxSizeBytes"; + if (!isFull()) { + assert backlog.isEmpty() : "backlog not empty when buffer not full"; + } + if (buffer.isEmpty()) { + assert sizeBytes == 0 : "sizeBytes must be 0 when buffer is empty"; + } + + requireNonNull(pendingMaxSize, "pendingMaxSize is null"); + if (!inFlight) { + assert pendingMaxSize.isEmpty() : "open batch has pending maxSize"; + } + } +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/batch/BatchContext.java b/src/main/java/io/weaviate/client6/v1/api/collections/batch/BatchContext.java new file mode 100644 index 000000000..27b035064 --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/batch/BatchContext.java @@ -0,0 +1,1340 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import static java.util.Objects.requireNonNull; + +import java.io.Closeable; +import java.io.IOException; +import java.util.Arrays; +import java.util.Collection; +import java.util.EnumSet; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.CancellationException; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; +import java.util.function.Predicate; + +import javax.annotation.concurrent.GuardedBy; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import io.grpc.Status; +import io.grpc.stub.StreamObserver; +import io.weaviate.client6.v1.api.collections.CollectionHandleDefaults; +import io.weaviate.client6.v1.api.collections.WeaviateObject; +import io.weaviate.client6.v1.api.collections.batch.Event.ClientError; +import io.weaviate.client6.v1.api.collections.batch.Event.StreamHangup; +import io.weaviate.client6.v1.api.collections.data.BatchReference; +import io.weaviate.client6.v1.api.collections.data.InsertManyRequest; +import io.weaviate.client6.v1.internal.ObjectBuilder; +import io.weaviate.client6.v1.internal.orm.CollectionDescriptor; + +/** + * BatchContext stores the state of an active batch process + * and controls its lifecycle. + * + *

Lifecycle

+ * + * The SSB implementation is based on gRPC bidi-streams, which are modeled as a + * pair of "observers" that define callbacks for inbound and outbound messages. + * We'll refer to them as "sender" (sending messages to the server) and "recv" + * (receiving and handing server-side events). + * + *

+ * When the context is started, the client exchanges a "recv" for a "sender", + * then stores in {@link #messages}. A {@link Send} process is started in the + * {@link #sendService} -- it will continue to run until the context is closed + * either gracefully via {@link #close} or abruptly via {@link #shutdownNow}. + * + *

+ * A "recv" always runs on some internal gRPC thread. The "recv" process is + * expected to exit whenever server closes its half of the stream, and will + * be re-created if the stream is re-opened. {@link Recv} delegates most + * of the operations to its parent BatchContext. + * + *

+ * {@link #send} and {@link #recv} futures track completion of the "sender" + * and "recv" routines. + * + *

State

+ * + * BatchContext organized client-side work using the + * State + * pattern. These states are defined: + * + *
    + *
  • {@code null} -- context hasn't been {@link #start}ed yet. The context + * SHOULD NOT be used in this state, as it will likely result in an NPE. + *
  • AwaitStarted -- client's opened the stream, sent Start, + * and is now awaiting the server to respond with Started. + *
  • Active -- the server is ready to accept the next Data message. + *
  • InFlight -- the latest batch has been sent, awaiting Acks. + *
  • OOM -- server has OOM'ed and will not accept any more data. + *
  • ServerShuttingDown -- server's begun a graceful shutdown. + *
  • Reconnecting -- server's closed it's half of the stream; the client + * will try to reconnect to another instance up to {@link #maxReconnectRetries} + * times. + *
+ * + *

Cancellation policy

+ * BatchContext does not rely on timing heuristics advance its state. + * Threads coordinate via {@link #stateChanged} conditional variable + * and interrupts, when appropriate. + * + *

Graceful shutdown

+ * When {@link #close()} is called, the context will stop accepting + * new items and start draining the remaining items in the {@link #queue} + * and {@link #batch} backlog. The client will then continue processing + * server-side events until stream's EOF. By the time context is closed + * all submitted tasks are expected to be completed successfully or otherwise. + * + *
+ * N.B.: This may take an arbitrarily long amount time, as the client will + * continue to re-connect to other instances and re-submit WIP tasks in + * case the current stream is hung up or the server shuts down prematurely. + * + *

Abrupt termination

+ * In the event of an internal client error (e.g. in the "sender" or "recv" + * threads), the client's half of the stream is closed immediately, and the + * "sender" processed is cancelled. A subsequent call to {@link #close()} will + * re-throw the causing exception as {@link IOException}. The stream can be + * terminated at any time, including during a graceful shutdown. + * In case the context if terminated before a graceful shutdown begins, + * the parent thread is also interrupted to prevent {@link #add} from blocking + * indefinitely, "sender" will not be there to pop items from the task queue). + * + *

+ * To prevent data loss, re-submit all incomplete tasks + * to the next batch context. + * + * @param the shape of properties for inserted objects. + * + * @see StreamObserver + * @see State + * @see #shutdownNow + * @see TaskHandle#done() + * + * @author Dyma Solovei + */ +public final class BatchContext implements Closeable { + private static final Logger log = LoggerFactory.getLogger(BatchContext.class); + + private final CollectionDescriptor collectionDescriptor; + private final CollectionHandleDefaults collectionHandleDefaults; + + /** + * Tally of the failed items. This value is only written to from + * {@link #retryService} thread, which processes the incoming + * {@link Event.Results}; making it {@code volatile} is sufficient. + */ + private volatile int numberOfErrors; + + /** + * Internal execution service. Its lifecycle is bound to that of the + * BatchContext: it's started when the context is initialized + * and shutdown on {@link #close}. + * + *

+ * In the event of abrupt stream termination ({@link Recv#onError} is called), + * the "recv" thread MAY shutdown this service in order to interrupt the "send" + * thread; the latter may be blocked on {@link State#awaitCanSend} or + * {@link State#awaitCanPrepareNext}. + */ + private final ExecutorService sendService = Executors.newSingleThreadExecutor(); + + /** + * Scheduled thread pool for delayed tasks. + * + * @see Oom + * @see Reconnecting + */ + private final ScheduledExecutorService scheduledService = Executors.newScheduledThreadPool(1); + + /** Executor for processing {@link Event.Results} and enqueing retried items. */ + private final ExecutorService retryService = Executors.newSingleThreadExecutor(); + + /** The thread that created the context. */ + private final Thread parent = Thread.currentThread(); + + /** Stream factory creates new streams. */ + private final StreamFactory streamFactory; + + /** + * Queue publishes insert tasks from the main thread to the "sender". + * + *

+ * Send {@link TaskHandle#POISON} to gracefully shut down the "sender" + * thread. The same queue may be re-used with a different "sender", + * e.g. after {@link #reconnect}, but only when the new thread is known + * to have started. Otherwise, the thread trying to put an item on + * the queue will block indefinitely. + */ + private final BlockingQueue queue; + + /** + * Work-in-progress items. + * + *

+ * An item is added to the wip map after the "sender" successfully + * adds it to the {@link #batch} and is removed once the server reports + * back the result (whether success of failure). + */ + private final ConcurrentMap wip = new ConcurrentHashMap<>(); + + /** + * Current batch. + * + *

+ * An item is added to the batch after the "sender" pulls it + * from the queue and remains there until it's Ack'ed. + */ + private final Batch batch; + + /** + * State encapsulates state-dependent behavior of the {@link BatchContext}. + * Before reading state, a thread MUST acquire {@link #lock}. + */ + @GuardedBy("lock") + private State state; + + /** lock synchronizes access to {@link #state}. */ + private final Lock lock = new ReentrantLock(); + + /** stateChanged notifies threads about a state transition. */ + private final Condition stateChanged = lock.newCondition(); + + /** + * Client-side part of the current stream, created on {@link #start}. + * Other threads MAY use stream but MUST NOT update this field on their own. + */ + private volatile StreamObserver messages; + + /** + * Handle for the "sender" routine. + * Cancel this future to interrupt the "sender". + */ + private volatile Future send; + + /** + * Indicates completion of the "recv" routine. + * Canceling this future will have no effect. + */ + private volatile CompletableFuture recv; + + /** + * Retry policy controls if and how many times + * a {@link RetriableTask} can be retried. + */ + private final RetryPolicy retryPolicy; + + /** + * Maximum number of times the client will attempt to re-open the stream + * before terminating the context. + */ + private final int maxReconnectRetries; + + /** closing completes the stream. */ + private final CompletableFuture closing = new CompletableFuture<>(); + + /** Executor for performing graceful shutdown sequence. */ + private final ExecutorService shutdownService = Executors.newSingleThreadExecutor(); + + /** Lightweight check to ensure users cannot send on a closed context. */ + private volatile boolean closed; + + BatchContext( + StreamFactory streamFactory, + int maxSizeBytes, + CollectionDescriptor collectionDescriptor, + CollectionHandleDefaults collectionHandleDefaults, + RetryPolicy retryPolicy, + int batchSize, + int queueSize, + int maxReconnectRetries) { + this.collectionDescriptor = requireNonNull(collectionDescriptor, "collectionDescriptor is null"); + this.collectionHandleDefaults = requireNonNull(collectionHandleDefaults, "collectionHandleDefaults is null"); + this.retryPolicy = requireNonNull(retryPolicy, "retryPolicy is null"); + this.streamFactory = requireNonNull(streamFactory, "streamFactory is null"); + + this.queue = new ArrayBlockingQueue<>(queueSize); + this.batch = new Batch(batchSize, maxSizeBytes); + this.maxReconnectRetries = maxReconnectRetries; + + setState(AWAIT_STARTED); + } + + private BatchContext(Builder builder) { + this( + builder.streamFactory, + builder.maxSizeBytes, + builder.collectionDescriptor, + builder.collectionHandleDefaults, + builder.retryPolicy, + builder.batchSize, + builder.queueSize, + builder.maxReconnectRetries); + } + + /** Add {@link WeaviateObject} to the batch. */ + public TaskHandle add(WeaviateObject object) throws InterruptedException { + TaskHandle handle = new TaskHandle( + object, + InsertManyRequest.buildObject(object, collectionDescriptor, collectionHandleDefaults), + retryPolicy, this::retry); + return add(handle); + } + + /** Add {@link BatchReference} to the batch. */ + public TaskHandle add(BatchReference reference) throws InterruptedException { + TaskHandle handle = new TaskHandle( + reference, + InsertManyRequest.buildReference(reference, collectionHandleDefaults.tenant()), + retryPolicy, this::retry); + return add(handle); + } + + private TaskHandle add(final TaskHandle taskHandle) throws InterruptedException { + if (closed) { + throw new IllegalStateException("context is closed"); + } + requireNonNull(taskHandle, "taskHandle is null"); + + TaskHandle existing = wip.get(taskHandle.id()); + if (existing != null) { + throw new DuplicateTaskException(taskHandle, existing); + } + + // Remove the task from the WIP list as soon as it completes, + // successfully or otherwise. Note, that TaskHandle::done future + // only completes exceptionally after all retries have been exhausted. + taskHandle.done().whenComplete((__, t) -> { + if (t != null) { + numberOfErrors++; + } + wip.remove(taskHandle.id()); + }); + + queue.put(taskHandle); + return taskHandle; + } + + /** + * Get the current tally of failed tasks. + * An object is only considered failed if it can no longer be retried. + */ + public int numberOfErrors() { + return numberOfErrors; + } + + void start() { + if (closed) { + throw new IllegalStateException("context is closed"); + } + openStream(); + send = sendService.submit(new Send()); + } + + /** + * Reconnect re-creates the stream and renews the {@link #recv} future. + * + *

+ * Unlike {@link #start} it does not trigger a state transition, and + * {@link Reconnecting} will should continue to handle events until + * the stream is renewed successfully or {@link #maxReconnectRetries} + * is reached. + */ + void reconnect() throws InterruptedException, ExecutionException { + // The "sender" survives reconnects and will not call countDown + // until it's interrupted or the context is closed. + // The "recv" thread is guaranteed to have already exited, because + // the context can only transition into the Reconnecting state + // after the server half of the stream is closed (EOF or hangup). + recv.get(); + openStream(); + } + + /** + * Retry a task. + * + *

+ * BatchContext does not impose any limit on the number of times a task can + * be retried -- it is up to the user to select an appropriate retry policy. + * + * @see TaskHandle#timesRetried + * @see RetryPolicy + */ + private void retry(String id) { + try { + requireNonNull(id, "id is null"); + + TaskHandle taskHandle = wip.get(id); + assert taskHandle != null : taskHandle + " is not wip"; + + // Put the handle back on the queue directly, circumventing + // the checks closed- and duplicate items checks we do for + // public methods. The retried task is guaranteed to be present + // in the WIP list and may be retried well after the context + // is closed to the user. + queue.put(taskHandle); + } catch (InterruptedException e) { + // Preserve interrupted state without throwing the exception. + Thread.currentThread().interrupt(); + } + } + + /** + * Close attempts to drain the queue and send all remaining items. + * Calling any of BatchContext's public methods afterwards will + * result in an {@link IllegalStateException}. + * + * @throws IOException Propagates an exception + * if one has occurred in the meantime. + */ + @Override + public void close() throws IOException { + boolean closedBefore = closed; + + // Update the value atomically to make sure shutdownNow + // does not unnecessarily interrupt this thread. + synchronized (this) { + closed = true; + } + + // If we'd been interrupted by shutdownNow, closing would've been + // completed exceptionally prior to that. If that's not the case + // but the current thread is interrupted, then we must propagate + // the interrupt. But first, we should dispose of the services. + if (Thread.interrupted() && !closing.isCompletedExceptionally()) { + shutdownExecutors(); + Thread.currentThread().interrupt(); + } + + log.atDebug() + .addKeyValue("closed_before", closedBefore) + .log("Close context"); + + if (!closedBefore) { + shutdown(); + } + + try { + closing.get(); + } catch (InterruptedException | ExecutionException e) { + if (e instanceof InterruptedException || + e.getCause() instanceof InterruptedException) { + log.atInfo().addKeyValue("thread", Thread::currentThread).log("Interrupted"); + Thread.currentThread().interrupt(); + } + throw new IOException(e.getCause()); + } finally { + shutdownExecutors(); + } + } + + /** Start a graceful context shutdown. */ + private void shutdown() { + log.atInfo() + .addKeyValue("wip_tasks", wip::size) + .addKeyValue("queued_tasks", queue::size) + .log("Initiate graceful shutdown"); + + shutdownService.execute(() -> { + try { + // Poison the queue -- this will signal "send" to drain the remaining + // items in the batch and in the backlog and exit. + // + // If shutdownNow has been called previously and the "send" routine + // has been interrupted, this would block indefinitely. + // Luckily, shutdownNow resolves the `closing` future as well. + log.debug("Poison the queue"); + queue.put(TaskHandle.POISON); + + // Wait for both "send" to exit; "send" will not exit until "recv" completes. + if (send != null) { + send.get(); + } + closing.complete(null); + } catch (Exception e) { + closing.completeExceptionally(e); + } + }); + } + + /** Emit exception as {@link Event.ClientError}. */ + private void throwInternal(Exception e) { + onEvent(new Event.ClientError(e)); + } + + /** Terminate context abruptly. */ + private void shutdownNow(Exception e) { + log.atInfo() + .addKeyValue("thread", Thread::currentThread) + .log("Initiate immediate shutdown"); + + // Now report this error to the server and terminate the stream. + closing.completeExceptionally(e); + messages.onError(Status.INTERNAL.withCause(e).asRuntimeException()); + + // Interrupt the "send" routine. + if (send != null) { + log.debug("Interrupt 'send' routine"); + send.cancel(true); + } + + // Since shutdownNow is never triggered by the "main" thread, + // it may be blocked on trying to add to the queue. While batch + // context is active, we own this thread and may interrupt it. + // We must be able to guarantee that shutdownNow never interrupts + // an in-progress close and we also don't want to potentially block + // the gRPC thread on which shutdownNow may be executing; we use + // the doubly-checked locking pattern to helps us achieve that. + if (closed) { + return; + } + synchronized (this) { + if (!closed) { + log.atDebug() + .addKeyValue("thread", Thread::currentThread) + .addKeyValue("closed", closed) + .log("Interrupt parent thread"); + parent.interrupt(); + } + } + + } + + private void shutdownExecutors() { + sendService.shutdownNow(); + scheduledService.shutdownNow(); + retryService.shutdownNow(); + shutdownService.shutdownNow(); + scheduledReconnectService.shutdownNow(); + } + + /** Set the new state and notify awaiting threads. */ + void setState(State nextState) { + requireNonNull(nextState, "nextState is null"); + + lock.lock(); + try { + log.atDebug() + .addKeyValue("thread", Thread::currentThread) + .addKeyValue("prev_state", state) + .addKeyValue("next_state", nextState) + .log("set next state"); + + State prev = state; + state = nextState; + state.onEnter(prev); + stateChanged.signalAll(); + } finally { + lock.unlock(); + } + } + + /** + * Blocks until a change in {@link #state} causes the predicate to be true. + * + *

+ * It is safe to acquire {@link #lock} before calling awaitState. + * If a state that satisfies the predicate need to be awaited, + * the {@link #stateChanged} will release the lock to let another + * thread update the state. + * + * @param predicate Determines if condition is satisfied. + * @param desc Short description of the predicate for debug logs. + */ + private void awaitState(Predicate predicate, String desc) throws InterruptedException { + requireNonNull(predicate, "predicate is null"); + + log.atDebug() + .addKeyValue("thread", Thread::currentThread) + .addKeyValue("predicate", desc) + .log("entered"); + + lock.lock(); + try { + while (!predicate.test(state)) { + stateChanged.await(); + } + } finally { + lock.unlock(); + + log.atDebug() + .addKeyValue("thread", Thread::currentThread) + .addKeyValue("predicate", desc) + .log("fulfilled"); + } + } + + /** Open a new batching stream. */ + void openStream() { + Recv events = new Recv(this); + recv = events; + messages = streamFactory.createStream(events); + messages.onNext(Message.start(collectionHandleDefaults.consistencyLevel())); + } + + /** Close the client half of the stream. */ + void closeStream() { + log.atDebug() + .addKeyValue("thread", Thread::currentThread) + .log("Close client half of the stream"); + + log.atTrace() + .addKeyValue("thread", Thread::currentThread) + .log("Send STOP"); + messages.onNext(Message.stop()); + + log.atTrace() + .addKeyValue("thread", Thread::currentThread) + .log("Close client half of the stream"); + messages.onCompleted(); + } + + /** + * onEvent delegates event handling to {@link #state}. + * + *

+ * Be mindful that most of the time this callback will run in a hot path + * on a gRPC thread. {@link State} implementations SHOULD offload any + * blocking operations to one of the provided executors. Because onEvent + * will hold the {@link #lock}, no state changes are guaranteed to happen + * until {@link State#onEvent} returns. + * + * @see #scheduledService + */ + private void onEvent(Event event) { + requireNonNull(event, "event is null"); + + lock.lock(); + try { + log.atDebug() + .addKeyValue("thread", Thread::currentThread) + .addKeyValue("state", state) + .addKeyValue("event", event) + .log("Incoming server message"); + + state.onEvent(event); + } finally { + lock.unlock(); + } + } + + private final class Send implements Runnable { + + @Override + public void run() { + String threadName = Thread.currentThread().getName(); + Thread.currentThread().setName("sender"); + try { + trySend(); + } finally { + Thread.currentThread().setName(threadName); + } + } + + /** + * trySend consumes {@link #queue} tasks and sends them in batches until it + * encounters a {@link TaskHandle#POISON} or is otherwise interrupted. + */ + private void trySend() { + try { + awaitState(State::canPrepareNext, "can prepare next"); + + while (!Thread.currentThread().isInterrupted()) { + send(); // Only sends if the batch is full. + + TaskHandle task = queue.take(); + + if (task == TaskHandle.END_RESULTS) { + // This marker is only relevant when sent after POISON, + // as we process retried items in drainWip. + continue; + } else if (task == TaskHandle.POISON) { + assert closed : "queue poisoned before the context is closed"; + + log.debug("Took poison"); + + drainWip(); + assert wip.isEmpty() : "wip is not empty after drainWip"; + + closeStream(); + + // The SSB protocol requires the client to continue reading the stream + // until EOF. In the happy case, the server will close its half having + // processed all previous requests; the WIP buffer is empty in that case. + // + // It is possible that the server will be restarted or the stream will be + // hung up before client receives all Results, in which case we might need + // to re-submit the items remaining in the WIP buffer. + // + // N.B.: By its nature, drainWip ensures that we've received all results. + // Awaiting recv is a show of good faith and ensures correct shutdown sequence. + recv.get(); + + log.info("All tasks completed, no more data to send"); + return; + } + + batch.add(task.data()); + + // Retried tasks already exist in the WIP list, replacing them is redundant. + wip.putIfAbsent(task.id(), task); + } + } catch (InterruptedException ignored) { + Thread.currentThread().interrupt(); + } catch (Exception e) { + throwInternal(e); + } + } + + /** + * Send the current portion of batch items. After this method returns, the batch + * is guaranteed to have space for at least one the next item (not full). + * + *

+ * Calling this on a non-full batch is a no-op; the side-effect of the condition + * in the while-loop is that nothing is sent unless the batch is full. + */ + private void send() throws InterruptedException { + // Continue flushing until we get the batch to not a "not full" state. + // This is to account for the backlog, which might re-fill the batch + // after .clear(). + while (batch.isFull()) { + log.atInfo() + .addKeyValue("batch_size_items", batch::size) + .addKeyValue("batch_size_total_bytes", batch::sizeBytes) + .log("Send next batch"); + flush(); + } + assert !batch.isFull() : "batch is full after send"; + } + + /** + * Send all remainign items in the batch. Then continue processing any + * retried tasks until {@link #wip} is empty. + */ + private void drainWip() throws InterruptedException { + drain(); + assert batch.isEmpty() : "batch not empty after drain"; + + // At this point we are certain that the queue will only be populated + // by failed items from previous batches scheduled for retry. Unlike + // user-supplied items, these will arrive in batches, as the server + // returns results for the previously sent items, i.e. via Event.Results. + // + // A single Results message might not have enough failed items to fill up + // the entire batch. To avoid sending half-empty batches, we will continue + // accumulating items until the batch is full or the WIP list is empty. + while (!wip.isEmpty()) { + log.atTrace() + .addKeyValue("batch_size_total_items", batch::size) + .addKeyValue("wip_tasks", wip::size) + .log("Await Results"); + + TaskHandle task; + while ((task = queue.take()) != TaskHandle.END_RESULTS) { + batch.add(task.data()); + } + + assert batch.size() <= wip.size() : "batch has more items than wip"; + + if (batch.size() == wip.size()) { + // This means the batch already contains all items in WIP, + // and no more tasks will be added to the queue until the + // current ones are sent. + drain(); + } else { + // Only sends if the batch is full. If the batch is not full, + // then we can keep accumulating items from the failed tasks. + send(); + } + } + } + + /** + * Send all remaining items in the batch. After this method returns, the batch + * is guaranteed to be empty. + */ + private void drain() throws InterruptedException { + log.atInfo() + .addKeyValue("batch_size_total_items", batch::size) + .addKeyValue("message_size_max_items", batch::maxSize) + .addKeyValue("message_size_max_bytes", batch::maxSizeBytes) + .log("Flush remaining items"); + + // To correctly drain the batch, we flush repeatedly + // until the batch becomes empty, as clearing a batch + // after an ACK might re-populate it from its internal backlog. + while (!batch.isEmpty()) { + flush(); + } + assert batch.isEmpty() : "batch not empty after drain"; + } + + /** + * Block until the current state allows {@link State#canSendNext}, + * then prepare the batch, send it, and set InFlight state. + * Block until the current state allows {@link State#canPrepareNext}. + * + *
+ * Depending on the BatchContext lifecycle, the semantics of + * "await can prepare next" can be one of "message is ACK'ed" + * "the stream has started", or, more generally, + * "it is safe to take a next item from the queue and add it to the batch". + * + * @see Batch#prepare + * @see #IN_FLIGHT + */ + private void flush() throws InterruptedException { + lock.lock(); + try { + awaitState(State::canSendNext, "can send next"); + + // Send and transition to IN_FLIGHT MUST be done atomically. + // + // Without synchronization, there's a potential race + // where the server Acks the next batch _before_ IN_FLIGHT state + // is set, so when finally set it may block forever. This will most + // likely only manifest in tests, where batches are acked instantly, + // but it's good to have the extra safety layer. + log.atTrace() + .addKeyValue("message_size_max_items", batch::maxSize) + .addKeyValue("batch_size_total_bytes", batch::sizeBytes) + .log("Prepare and send next batch"); + messages.onNext(batch.prepare()); + setState(IN_FLIGHT); + } finally { + lock.unlock(); + } + + awaitState(State::canPrepareNext, "can prepare next"); + } + + } + + private static final class Recv extends CompletableFuture implements StreamObserver { + private final BatchContext context; + + private Recv(BatchContext context) { + this.context = context; + } + + @Override + public void onNext(Event event) { + try { + if (event == Event.EOF) { + // Handle synthetic EOF which the Oom state can send to initiate a shutdown. + onCompleted(); + } else { + context.onEvent(event); + } + } catch (Exception e) { + context.onEvent(new Event.ClientError(e)); + } + } + + /** + * EOF for the server-side stream. + * By the time this is called, the client-side of the stream had been closed + * and the "send" thread has either exited or is on its way there. + */ + @Override + public void onCompleted() { + try { + context.onEvent(Event.EOF); + } finally { + complete(null); + } + } + + /** An exception occurred either on our end or in the channel internals. */ + @Override + public void onError(Throwable t) { + try { + context.onEvent(Event.StreamHangup.fromThrowable(t)); + } finally { + complete(null); + } + } + } + + private final State AWAIT_STARTED = new BaseState("AWAIT_STARTED", BaseState.Action.PREPARE_NEXT); + private final State ACTIVE = new BaseState("ACTIVE", BaseState.Action.PREPARE_NEXT, BaseState.Action.SEND_NEXT); + private final State IN_FLIGHT = new BaseState("IN_FLIGHT"); + + /** BaseState implements default handlers for all {@link Event} subclasses. */ + private class BaseState implements State { + /** State's display name for logging. */ + private final String name; + /** Actions permitted in this state. */ + private final EnumSet permitted; + + enum Action { + /** + * Thy system is allowed to accept new items from the user + * and populate the next batch. + */ + PREPARE_NEXT, + + /** The system is allowed to send the next batch once it's ready. */ + SEND_NEXT; + } + + /** + * @param name Display name. + * @param permitted Actions permitted in this state. + */ + protected BaseState(String name, Action... permitted) { + this.name = name; + this.permitted = requireNonNull(permitted, "actions is null").length == 0 + ? EnumSet.noneOf(Action.class) + : EnumSet.copyOf(Arrays.asList(permitted)); + } + + @Override + public void onEnter(State prev) { + } + + @Override + public boolean canSendNext() { + return permitted.contains(Action.SEND_NEXT); + } + + @Override + public boolean canPrepareNext() { + return permitted.contains(Action.PREPARE_NEXT); + } + + @Override + public void onEvent(Event event) { + if (event == Event.STARTED) { + onStarted(); + } else if (event instanceof Event.Acks acks) { + onAcks(acks); + } else if (event instanceof Event.Oom oom) { + onOom(oom); + } else if (event instanceof Event.Results results) { + onResults(results); + } else if (event instanceof Event.Backoff backoff) { + onBackoff(backoff); + } else if (event == Event.SHUTTING_DOWN) { + onShuttingDown(); + } else if (event instanceof Event.StreamHangup || event == Event.EOF) { + onStreamClosed(event); + } else if (event instanceof Event.ClientError error) { + onClientError(error); + } else { + throw new AssertionError("unreachable with event " + event); + } + } + + private void onStarted() { + setState(ACTIVE); + } + + private void onAcks(Event.Acks acks) { + log.atInfo() + .addKeyValue("count_acks", acks.acked().size()) + .addKeyValue("wip_tasks", wip::size) + .log("Received Acks"); + + Collection removed = batch.clear(); + if (!acks.acked().containsAll(removed)) { + throwInternal(ProtocolViolationException.incompleteAcks(List.copyOf(removed))); + } + setState(ACTIVE); + } + + private void onResults(Event.Results results) { + log.atInfo() + .addKeyValue("count_success", results.successful().size()) + .addKeyValue("count_errors", results.errors().size()) + .addKeyValue("wip_tasks", wip::size) + .log("Received Results"); + + // Scheduling items to be retried may block temporarily if the queue is not + // adequately sized. Offload the next step to a different thread to avoid + // blocking the internal gRPC thread on which this callback is running. + retryService.execute(() -> { + // Mark successfully completed tasks in the WIP list. + // The whenComplete hook added in .add() will remove them from WIP. + results.successful().stream() + .map(wip::get).filter(Objects::nonNull) + .forEach(TaskHandle::setSuccess); + + // Report errors for failed tasks. Do NOT remove them from the WIP list. + results.errors().keySet().stream() + .map(wip::get).filter(Objects::nonNull) + .forEach(taskHandle -> taskHandle.setError( + new ServerException(results.errors().get(taskHandle.id())))); + + try { + queue.put(TaskHandle.END_RESULTS); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + }); + } + + private void onBackoff(Event.Backoff backoff) { + log.atInfo() + .addKeyValue("prev_max_size", batch::maxSize) + .addKeyValue("next_max_size", backoff::maxSize) + .log("Received Backoff"); + + batch.setMaxSize(backoff.maxSize()); + } + + private void onOom(Event.Oom oom) { + log.atInfo() + .addKeyValue("wip_tasks", wip::size) + .log("Server is out of memory"); + + setState(new Oom(oom.delaySeconds())); + } + + private void onShuttingDown() { + setState(new ServerShuttingDown(this)); + } + + private void onStreamClosed(Event event) { + log.info("Server closed its half of the stream"); + + if (event instanceof Event.StreamHangup hangup) { + log.atWarn() + .addKeyValue("cause", hangup::exception) + .log("Stream hangup"); + } + + log.atDebug() + .addKeyValue("closed", closed) + .addKeyValue("wip_tasks", wip::size) + .log("Client will reconnect if any tasks are pending"); + + // The only time we should not try to reconnect is if the context + // is gracefully shutting down after a call to close() and the server + // has returned Results for all previous batches. + if (closed && wip.isEmpty()) { + log.info("All tasks completed, no more events are expected"); + return; + } + setState(new Reconnecting(maxReconnectRetries)); + } + + private void onClientError(Event.ClientError error) { + log.atError() + .addKeyValue("cause", error::exception) + .log("Internal error, context will be terminated"); + + shutdownNow(error.exception()); + } + + @Override + public String toString() { + return name; + } + } + + /** + * Oom waits for {@link Event#SHUTTING_DOWN} up to a specified amount of time, + * after which it will force stream termination by imitating server shutdown. + */ + private final class Oom extends BaseState { + private final long shutdownAfterSeconds; + private ScheduledFuture shutdown; + + private Oom(long shutdownAfterSeconds) { + super("OOM"); + this.shutdownAfterSeconds = shutdownAfterSeconds; + + log.atDebug() + .addKeyValue("grace_period", shutdownAfterSeconds) + .log("Server is out of memory"); + } + + @Override + public void onEnter(State prev) { + shutdown = scheduledService.schedule(this::initiateShutdown, shutdownAfterSeconds, TimeUnit.SECONDS); + } + + /** Imitate server shutdown sequence. */ + private void initiateShutdown() { + log.info("No update from the server after {}s, context will be forcibly restarted", shutdownAfterSeconds); + + // We cannot route event handling via normal BatchContext#onEvent, because + // it delegates to the current state, which is Oom. If Oom#onEvent were to + // receive an Event.SHUTTING_DOWN, it would cancel this execution of this + // very sequence. Instead, we delegate to our parent BaseState which normally + // handles these events. + final Recv events = (Recv) recv; + if (!Thread.currentThread().isInterrupted()) { + events.onNext(Event.SHUTTING_DOWN); + } + if (!Thread.currentThread().isInterrupted()) { + events.onNext(Event.EOF); + } + } + + @Override + public void onEvent(Event event) { + if (event instanceof StreamHangup || + event instanceof ClientError) { + shutdown.cancel(true); + try { + shutdown.get(); + } catch (CancellationException ignored) { + log.atDebug().addKeyValue("thread", Thread::currentThread).log("Canceled"); + } catch (InterruptedException ignored) { + // "recv" is running on a thread from gRPC's internal thread pool, + // so, while onEvent allows InterruptedException to stay responsive, + // in practice this thread will only be interrupted by the thread pool, + // which already knows it's being shut down. + log.atDebug().addKeyValue("thread", Thread::currentThread).log("Interrupted"); + } catch (ExecutionException e) { + throwInternal(e); + } + } + super.onEvent(event); + } + } + + /** + * ServerShuttingDown allows preparing the next batch + * unless the server's OOM'ed on the previous one. + * Once set, the state will shutdown {@link BatchContext#sendService} + * to instruct the "send" thread to close our part of the stream. + */ + private final class ServerShuttingDown extends BaseState { + private final boolean canPrepareNext; + + private ServerShuttingDown(State prev) { + super("SERVER_SHUTTING_DOWN"); + this.canPrepareNext = prev == null || !Oom.class.isAssignableFrom(prev.getClass()); + + log.atDebug() + .addKeyValue("prev_state", prev) + .addKeyValue("can_prepare_next", canPrepareNext) + .log("Server is shutting down"); + } + + @Override + public boolean canPrepareNext() { + return canPrepareNext; + } + + @Override + public boolean canSendNext() { + return false; + } + + @Override + public void onEnter(State prev) { + closeStream(); + } + } + + /** + * Reconnecting state is entered either by the server finishing a shutdown + * and closing its end of the stream or an unexpected stream hangup. + * + * @see Recv#onCompleted graceful server shutdown + * @see Recv#onError stream hangup + */ + private final class Reconnecting extends BaseState { + private final int maxRetries; + private int retries = 0; + + private Reconnecting(int maxRetries) { + super("RECONNECTING", Action.PREPARE_NEXT); + this.maxRetries = maxRetries; + } + + @Override + public void onEnter(State prev) { + log.atInfo() + .addKeyValue("prev_state", prev) + .addKeyValue("max_retries", maxRetries) + .log("Trying to reconnect"); + + if (!ServerShuttingDown.class.isAssignableFrom(prev.getClass())) { + // This is NOT an orderly shutdown, we're reconnecting after a stream hangup. + // Assume all WIP items have been lost and re-submit everything. + // All items in the batch are contained in WIP, so it is safe to discard the + // batch entirely and re-populate from WIP. + while (!batch.isEmpty()) { + batch.clear(); + } + + // Unlike during normal operation, we will not stop when batch.isFull(). + // Batch#add guarantees that data will not be discarded in the event of + // an overflow -- all extra items are placed into the backlog, which is + // unbounded. + wip.values().forEach(task -> batch.add(task.data())); + } + + reconnectNow(); + } + + @Override + public void onEvent(Event event) { + assert retries <= maxRetries : "maxRetries exceeded"; + + if (event == Event.STARTED) { + log.info("Reconnected after {} retries", retries); + + setState(ACTIVE); + } else if (event instanceof Event.StreamHangup) { + + if (retries == maxRetries) { + throwInternal(new IOException("Server unavailable")); + return; + } + + long nextDelay = (long) Math.pow(2, retries); + log.atInfo() + .addKeyValue("max_retries", maxRetries) + .addKeyValue("remaining_retries", maxRetries - retries) + .log("Retry after {}s", nextDelay); + + reconnectAfter(nextDelay); + + } else if (event == Event.EOF) { + throwInternal(ProtocolViolationException.illegalStateTransition(this, event)); + } else { + super.onEvent(event); + } + + assert retries <= maxRetries : "maxRetries exceeded"; + } + + /** Reconnect with no delay. */ + private void reconnectNow() { + reconnectAfter(0); + } + + /** + * Schedule a task to {@link #reconnect} after a delay. + * + *

+ * The task is scheduled on {@link #scheduledService} even if + * {@code delaySeconds == 0} to avoid blocking gRPC worker + * thread, + * where the {@link BatchContext#onEvent} callback runs. + * + * @param delaySeconds Delay in seconds. + */ + private void reconnectAfter(long delaySeconds) { + retries++; + + scheduledService.schedule(() -> { + try { + reconnect(); + } catch (InterruptedException e) { + log.atDebug().addKeyValue("thread", Thread::currentThread).log("Interrupted"); + Thread.currentThread().interrupt(); + } catch (ExecutionException e) { + throwInternal(e); + } + }, delaySeconds, TimeUnit.SECONDS); + } + } + + // -------------------------------------------------------------------------- + + private final ScheduledExecutorService scheduledReconnectService = Executors.newScheduledThreadPool(1); + + void scheduleReconnect(int reconnectIntervalSeconds) { + log.atDebug() + .addKeyValue("interval_seconds", reconnectIntervalSeconds) + .log("Scheduled regular context reconnects"); + + scheduledReconnectService.scheduleWithFixedDelay(() -> { + log.debug("Imitating server shutdown"); + + final Recv events = (Recv) recv; + + if (!Thread.currentThread().isInterrupted()) { + log.trace("Send synthetic SHUTTING_DOWN"); + events.onNext(Event.SHUTTING_DOWN); + } + + if (!Thread.currentThread().isInterrupted()) { + log.trace("Send synthetic EOF"); + events.onNext(Event.EOF); + } + + // We want to count down from the moment we re-opened the stream, + // not from the moment we initialized the sequence. + try { + awaitState(ACTIVE::equals, "ACTIVE"); + } catch (InterruptedException ignored) { + // Let the process exit normally. + log.atDebug().addKeyValue("thread", Thread::currentThread).log("Interrupted"); + } + }, reconnectIntervalSeconds, reconnectIntervalSeconds, TimeUnit.SECONDS); + } + + public static class Builder implements ObjectBuilder> { + private final StreamFactory streamFactory; + private final int maxSizeBytes; + private final CollectionDescriptor collectionDescriptor; + private final CollectionHandleDefaults collectionHandleDefaults; + + Builder( + StreamFactory streamFactory, + int maxSizeBytes, + CollectionDescriptor collectionDescriptor, + CollectionHandleDefaults collectionHandleDefaults) { + this.streamFactory = streamFactory; + this.maxSizeBytes = maxSizeBytes; + this.collectionDescriptor = collectionDescriptor; + this.collectionHandleDefaults = collectionHandleDefaults; + } + + private RetryPolicy retryPolicy = RetryPolicy.never(); + private int batchSize = 1_000; + private int queueSize = 1_000; + private int maxReconnectRetries = 5; + + public Builder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + public Builder batchSize(int batchSize) { + this.batchSize = batchSize; + return this; + } + + public Builder queueSize(int queueSize) { + this.queueSize = queueSize; + return this; + } + + public Builder maxReconnectRetries(int maxReconnectRetries) { + this.maxReconnectRetries = maxReconnectRetries; + return this; + } + + @Override + public BatchContext build() { + return new BatchContext<>(this); + } + } +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/batch/BatchServerException.java b/src/main/java/io/weaviate/client6/v1/api/collections/batch/BatchServerException.java new file mode 100644 index 000000000..53ec860cb --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/batch/BatchServerException.java @@ -0,0 +1,10 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import io.weaviate.client6.v1.api.WeaviateException; + +public class BatchServerException extends WeaviateException { + + public BatchServerException(String message) { + super(message); + } +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/batch/Data.java b/src/main/java/io/weaviate/client6/v1/api/collections/batch/Data.java new file mode 100644 index 000000000..dba9e79ad --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/batch/Data.java @@ -0,0 +1,94 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import static java.util.Objects.requireNonNull; + +import javax.annotation.concurrent.Immutable; + +import com.google.protobuf.GeneratedMessage; +import com.google.protobuf.GeneratedMessageV3; + +import io.weaviate.client6.v1.api.collections.WeaviateObject; +import io.weaviate.client6.v1.api.collections.data.ObjectReference; +import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch; + +@Immutable +@SuppressWarnings("deprecation") // protoc uses GeneratedMessageV3 +class Data implements Message { + + /** + * Raw input value, as passed by the user. + */ + private final Object raw; + + /** + * Task ID. Depending on the underlying object, this will either be + * {@link WeaviateObject#uuid} or {@link ObjectReference#beacon}. + * + * Since UUIDs and beacons cannot clash, ID does not encode any + * information about the underlying data type. + */ + private final String id; + + /** + * Serialized representation of the {@link #raw}. This valus is immutable + * for the entire lifecycle of the handle. + */ + private final GeneratedMessage.ExtendableMessage message; + + /** Estimated size of the {@link #message} when serialized. */ + private final int sizeBytes; + + enum Type { + OBJECT(WeaviateProtoBatch.BatchStreamRequest.Data.OBJECTS_FIELD_NUMBER), + REFERENCE(WeaviateProtoBatch.BatchStreamRequest.Data.REFERENCES_FIELD_NUMBER); + + private final int fieldNumber; + + private Type(int fieldNumber) { + this.fieldNumber = fieldNumber; + } + + public int fieldNumber() { + return fieldNumber; + } + } + + private Data(Object raw, String id, GeneratedMessage.ExtendableMessage message, int sizeBytes) { + this.raw = requireNonNull(raw, "raw is null"); + this.id = requireNonNull(id, "id is null"); + this.message = requireNonNull(message, "message is null"); + + assert sizeBytes >= 0; + this.sizeBytes = sizeBytes; + } + + Data(Object raw, String id, GeneratedMessage.ExtendableMessage message, + Type type) { + this(raw, id, message, MessageSizeUtil.ofDataField(message, type)); + } + + String id() { + return id; + } + + /** Serialized data size in bytes. */ + int sizeBytes() { + return sizeBytes; + } + + @Override + public void appendTo(WeaviateProtoBatch.BatchStreamRequest.Builder builder) { + WeaviateProtoBatch.BatchStreamRequest.Data.Builder data = requireNonNull(builder, "builder is null") + .getDataBuilder(); + if (message instanceof WeaviateProtoBatch.BatchObject object) { + data.getObjectsBuilder().addValues(object); + } else if (message instanceof WeaviateProtoBatch.BatchReference ref) { + data.getReferencesBuilder().addValues(ref); + } + } + + @Override + public String toString() { + return "%s (%s)".formatted(raw.getClass().getSimpleName(), id); + } +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/batch/DataTooBigException.java b/src/main/java/io/weaviate/client6/v1/api/collections/batch/DataTooBigException.java new file mode 100644 index 000000000..5160bd27c --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/batch/DataTooBigException.java @@ -0,0 +1,16 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import static java.util.Objects.requireNonNull; + +import io.weaviate.client6.v1.api.WeaviateException; + +/** + * DataTooBigException is thrown when a single object exceeds + * the maximum size of a gRPC message. + */ +public class DataTooBigException extends WeaviateException { + DataTooBigException(Data data, long maxSizeBytes) { + super("%s with size=%dB exceeds maximum message size %dB".formatted( + requireNonNull(data, "data is null"), data.sizeBytes(), maxSizeBytes)); + } +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/batch/DuplicateTaskException.java b/src/main/java/io/weaviate/client6/v1/api/collections/batch/DuplicateTaskException.java new file mode 100644 index 000000000..31fb923c0 --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/batch/DuplicateTaskException.java @@ -0,0 +1,23 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import io.weaviate.client6.v1.api.WeaviateException; + +/** + * DuplicateTaskException is thrown if task is submitted to the batch + * while another task with the same ID is in progress. + */ +public class DuplicateTaskException extends WeaviateException { + private final TaskHandle existing; + + DuplicateTaskException(TaskHandle duplicate, TaskHandle existing) { + super(duplicate + " cannot be added to the batch while another task with the same ID is in progress"); + this.existing = existing; + } + + /** + * Get the currently in-progress handle that's a duplicate of the one submitted. + */ + public TaskHandle getExisting() { + return existing; + } +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/batch/Event.java b/src/main/java/io/weaviate/client6/v1/api/collections/batch/Event.java new file mode 100644 index 000000000..ba3f6b208 --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/batch/Event.java @@ -0,0 +1,162 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import static java.util.Objects.requireNonNull; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +import io.grpc.Status; +import io.weaviate.client6.v1.api.collections.batch.Event.Acks; +import io.weaviate.client6.v1.api.collections.batch.Event.Backoff; +import io.weaviate.client6.v1.api.collections.batch.Event.ClientError; +import io.weaviate.client6.v1.api.collections.batch.Event.Oom; +import io.weaviate.client6.v1.api.collections.batch.Event.Results; +import io.weaviate.client6.v1.api.collections.batch.Event.Started; +import io.weaviate.client6.v1.api.collections.batch.Event.StreamHangup; +import io.weaviate.client6.v1.api.collections.batch.Event.TerminationEvent; + +sealed interface Event + permits Started, Acks, Results, Backoff, Oom, TerminationEvent, StreamHangup, ClientError { + + final static Event STARTED = new Started(); + final static Event SHUTTING_DOWN = TerminationEvent.SHUTTING_DOWN; + final static Event EOF = TerminationEvent.EOF; + + /** + * The server has acknowledged our Start message and is ready to receive data. + */ + record Started() implements Event { + } + + /** + * The server has added items from the previous message to its internal + * work queue, client MAY send the next batch. + * + *

+ * The protocol guarantess that {@link Acks} will contain IDs for all + * items sent in the previous batch. + */ + record Acks(Collection acked) implements Event { + public Acks { + acked = List.copyOf(requireNonNull(acked, "acked is null")); + } + + @Override + public String toString() { + return "Acks"; + } + } + + /** + * Results for the insertion of a previous batches. + * + *

+ * We assume that the server may return partial results, or return + * results out of the order of inserting messages. + */ + record Results(Collection successful, Map errors) implements Event { + public Results { + successful = List.copyOf(requireNonNull(successful, "successful is null")); + errors = Map.copyOf(requireNonNull(errors, "errors is null")); + } + + @Override + public String toString() { + return "Results"; + } + } + + /** + * Backoff communicates the optimal batch size (number of objects) + * with respect to the current load on the server. + * + *

+ * Backoff is an instruction, not a recommendation. + * On receiving this message, the client must ensure that + * all messages it produces, including the one being prepared, + * do not exceed the size limit indicated by {@link #maxSize} + * until the server sends another Backoff message. The limit + * MUST also be respected after a {@link BatchContext#reconnect}. + * + *

+ * The client MAY use the latest {@link #maxSize} as the default + * message limit in a new {@link BatchContext}, but is not required to. + */ + record Backoff(int maxSize) implements Event { + + @Override + public String toString() { + return "Backoff"; + } + } + + /** + * Out-Of-Memory. + * + *

+ * Items sent in the previous request cannot be accepted, + * as inserting them may exhaust server's available disk space. + * On receiving this message, the client MUST stop producing + * messages immediately and await {@link #SHUTTING_DOWN} event. + * + *

+ * Oom is the sibling of {@link Acks} with the opposite effect. + * The protocol guarantees that the server will respond with either of + * the two, but never both. + */ + record Oom(int delaySeconds) implements Event { + } + + /** Events that are part of the server's graceful shutdown strategy. */ + enum TerminationEvent implements Event { + /** + * Server shutdown in progress. + * + *

+ * The server began the process of gracefull shutdown, due to a + * scale-up event (if it previously reported {@link #OOM}) or + * some other external event. + * On receiving this message, the client MUST stop producing + * messages immediately, close it's side of the stream, and + * continue readings server's messages until {@link #EOF}. + */ + SHUTTING_DOWN, + + /** + * Stream EOF. + * + *

+ * The server has will not receive any messages. If the client + * has more data to send, it SHOULD re-connect to another instance + * by re-opening the stream and continue processing the batch. + * If the client has previously sent {@link Message#STOP}, it can + * safely exit. + */ + EOF; + } + + /** + * StreamHangup means the RPC is "dead": the stream is closed + * and using it will result in an {@link IllegalStateException}. + */ + record StreamHangup(Exception exception) implements Event { + static StreamHangup fromThrowable(Throwable t) { + Status status = Status.fromThrowable(t); + return new StreamHangup(status.asException()); + } + } + + /** + * ClientError means a client-side exception has happened, + * and is meant primarily for the "send" thread to propagate + * any exception it might catch. + * + *

+ * This MUST be treated as an irrecoverable condition, because + * it is likely caused by an internal issue (an NPE) or a bad + * input ({@link DataTooBigException}). + */ + record ClientError(Exception exception) implements Event { + } +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/batch/Message.java b/src/main/java/io/weaviate/client6/v1/api/collections/batch/Message.java new file mode 100644 index 000000000..9d387d1b1 --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/batch/Message.java @@ -0,0 +1,32 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import static java.util.Objects.requireNonNull; + +import java.util.Optional; + +import io.weaviate.client6.v1.api.collections.query.ConsistencyLevel; +import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch; + +@FunctionalInterface +interface Message { + void appendTo(WeaviateProtoBatch.BatchStreamRequest.Builder builder); + + /** Create a Start message. */ + static Message start(Optional consistencyLevel) { + requireNonNull(consistencyLevel, "consistencyLevel is null"); + + final WeaviateProtoBatch.BatchStreamRequest.Start.Builder start = WeaviateProtoBatch.BatchStreamRequest.Start + .newBuilder(); + consistencyLevel.ifPresent(value -> value.appendTo(start)); + return builder -> builder.setStart(start); + } + + /** Create a Stop message. */ + static Message stop() { + return STOP; + } + + static final Message STOP = builder -> builder + .setStop(WeaviateProtoBatch.BatchStreamRequest.Stop.getDefaultInstance()); + +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/batch/MessageSizeUtil.java b/src/main/java/io/weaviate/client6/v1/api/collections/batch/MessageSizeUtil.java new file mode 100644 index 000000000..69835d642 --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/batch/MessageSizeUtil.java @@ -0,0 +1,50 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import static java.util.Objects.requireNonNull; + +import com.google.protobuf.CodedOutputStream; +import com.google.protobuf.GeneratedMessage; +import com.google.protobuf.GeneratedMessageV3; + +import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch; + +final class MessageSizeUtil { + /** + * Safety margin of 1KB to allow for the overhead of surrounding Data field tags + * and the encoded length of the final payload. + * + *

+ * Package-private for testing. + */ + static final int SAFETY_MARGIN = 1024; + + private MessageSizeUtil() { + } + + /** + * Adjust batch byte-size limit to account for the + * {@link WeaviateProtoBatch.BatchStreamRequest.Data} container. + * + *

+ * A protobuf field has layout {@code [tag][lenght(payload)][payload]}, + * so to estimate the batch size correctly we must account for "tag" + * and "length", not just the raw payload. + */ + static int maxSizeBytes(int maxSizeBytes) { + if (maxSizeBytes <= SAFETY_MARGIN) { + throw new IllegalArgumentException("Maximum batch size must be at least %dB".formatted(SAFETY_MARGIN)); + } + return maxSizeBytes - SAFETY_MARGIN; + } + + /** + * Calculate the size of a serialized + * {@link WeaviateProtoBatch.BatchStreamRequest.Data} field. + */ + @SuppressWarnings("deprecation") // protoc uses GeneratedMessageV3 + static int ofDataField(GeneratedMessage.ExtendableMessage message, Data.Type type) { + requireNonNull(type, "type is null"); + requireNonNull(message, "message is null"); + return CodedOutputStream.computeMessageSize(type.fieldNumber(), message); + } +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/batch/ProtocolViolationException.java b/src/main/java/io/weaviate/client6/v1/api/collections/batch/ProtocolViolationException.java new file mode 100644 index 000000000..e9a90da47 --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/batch/ProtocolViolationException.java @@ -0,0 +1,47 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import static java.util.Objects.requireNonNull; + +import java.util.List; + +import io.weaviate.client6.v1.api.WeaviateException; + +/** + * ProtocolViolationException describes unexpected server behavior in violation + * of the SSB protocol. + * + *

+ * This exception cannot be handled in a meaningful way and should be reported + * to the upstream Weaviate + * project. + */ +public class ProtocolViolationException extends WeaviateException { + ProtocolViolationException(String message) { + super(message); + } + + /** + * Protocol violated because an event arrived while the client is in a state + * which doesn't expect to handle this event. + * + * @param current Current {@link BatchContext} state. + * @param event Server-side event. + * @return ProtocolViolationException with a formatted message. + */ + static ProtocolViolationException illegalStateTransition(State current, Event event) { + return new ProtocolViolationException("%s arrived in %s state".formatted(event, current)); + } + + /** + * Protocol violated because some tasks from the previous Data message + * are not present in the Acks message. + * + * @param remaining IDs of the tasks that weren't ack'ed. MUST be non-empty. + * @return ProtocolViolationException with a formatted message. + */ + static ProtocolViolationException incompleteAcks(List remaining) { + requireNonNull(remaining, "remaining is null"); + return new ProtocolViolationException("IDs from previous Data message missing in Acks: '%s', ... (%d more)" + .formatted(remaining.get(0), remaining.size() - 1)); + } +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/batch/RetriableTask.java b/src/main/java/io/weaviate/client6/v1/api/collections/batch/RetriableTask.java new file mode 100644 index 000000000..c5b451542 --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/batch/RetriableTask.java @@ -0,0 +1,80 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import static java.util.Objects.requireNonNull; + +import java.util.concurrent.CompletableFuture; +import java.util.function.Consumer; + +abstract class RetriableTask { + private final String id; + private final CompletableFuture root; + + private volatile CompletableFuture current = new CompletableFuture<>(); + private volatile int retries = 0; + + protected RetriableTask(String id, RetryPolicy retryPolicy, Consumer onRetry) { + this.id = requireNonNull(id, "id is null"); + this.root = retry(current, retryPolicy, onRetry); + } + + private final CompletableFuture retry( + CompletableFuture f, + RetryPolicy retryPolicy, + Consumer onRetry) { + requireNonNull(f, "f is null"); + requireNonNull(retryPolicy, "retryPolicy is null"); + requireNonNull(onRetry, "onRetry is null"); + + return f.exceptionallyCompose(t -> { + if (!retryPolicy.canRetry(this, t)) { + return CompletableFuture.failedFuture(t); + } + retries++; + current = new CompletableFuture<>(); + onRetry.accept(id); + return retry(current, retryPolicy, onRetry); + }); + } + + /** Number of times this task has been retried. */ + public final int timesRetried() { + return retries; + } + + /** Retrieve the ID of this task. */ + public final String id() { + return id; + } + + /** + * Mark the task successful. This status cannot be changed, so calling + * {@link #setError} afterwards will have no effect. + */ + public final boolean setSuccess() { + return current.complete(null); + } + + /** + * Mark the task failed. This status cannot be changed, so calling + * {@link #setSuccess} afterwards will have no effect. + * + * @param t Error message. Null values are tolerated, but are only expected + * to occur due to a server's mistake. + * Do not use {@code setError(null)} if the server reports success + * status for the task; prefer {@link #setSuccess} in that case. + */ + public final boolean setError(Throwable t) { + return current.completeExceptionally(t); + } + + /** + * Track completion of this task. + * + * @return A future which completes when the server reports success + * for this tasks or the applied {@link RetryPolicy} + * no longer permits retrying the task. + */ + public final CompletableFuture done() { + return root; + } +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/batch/RetryPolicy.java b/src/main/java/io/weaviate/client6/v1/api/collections/batch/RetryPolicy.java new file mode 100644 index 000000000..717129734 --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/batch/RetryPolicy.java @@ -0,0 +1,43 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import static java.util.Objects.requireNonNull; + +import java.util.function.Predicate; + +public class RetryPolicy { + /** Create a retry policy that never permits retrying a task. */ + static RetryPolicy never() { + return new RetryPolicy(__ -> false); + } + + private final Predicate retry; + + /** + * Construct a simple RetryPolicy that retries up to a certain number of times. + * + * @param maxRetries Maximum number of retries. + */ + public RetryPolicy(int maxRetries) { + this(task -> task.timesRetried() < maxRetries); + } + + /** + * Construct a RetryPolicy with a custom predicate. + * + * @param retry Predicate that returns true if the task should be retried. + */ + public RetryPolicy(Predicate retry) { + this.retry = requireNonNull(retry, "retry is null"); + } + + /** + * Override this method to control which exceptions are considered retriable. + */ + protected boolean canRetryThrowable(Throwable t) { + return t instanceof ServerException; + } + + boolean canRetry(RetriableTask task, Throwable t) { + return canRetryThrowable(t) && retry.test(task); + } +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/batch/ServerException.java b/src/main/java/io/weaviate/client6/v1/api/collections/batch/ServerException.java new file mode 100644 index 000000000..55807aa01 --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/batch/ServerException.java @@ -0,0 +1,13 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import io.weaviate.client6.v1.api.WeaviateException; + +/** + * ServerException carries an error message the server returns in + * {@link Event.Results}. This is a retriable exception. + */ +public class ServerException extends WeaviateException { + ServerException(String message) { + super(message); + } +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/batch/State.java b/src/main/java/io/weaviate/client6/v1/api/collections/batch/State.java new file mode 100644 index 000000000..d58b4ac26 --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/batch/State.java @@ -0,0 +1,42 @@ +package io.weaviate.client6.v1.api.collections.batch; + +interface State { + /** + * canSend returns a boolean indicating if sending + * an "insert" message is allowed in this state. + */ + boolean canSendNext(); + + /** + * canPrepareNext returns a boolean indicating if accepting + * more items into the batch is allowed in this state. + */ + boolean canPrepareNext(); + + /** + * Lifecycle hook that's called after the state is set. + * + *

+ *
+ * This hook MUST be called exactly once. + *
+ * The next state MUST NOT be set until onEnter returns. + * + * @param prev Previous state or null. + */ + void onEnter(State prev); + + /** + * onEvent handles incoming events; these can be generated by the server + * or by a different part of the program -- the {@link State} MUST NOT + * make any assumptions about the event's origin. + * + *

+ * How the event is handled is up to the concrete implementation. + * It may modify {@link BatchContext} internal state, via one of it's + * package-private methods, including transitioning the context to a + * different state via {@link BatchContext#setState(State)}, or start + * a separate process, e.g. the OOM timer. + */ + void onEvent(Event event); +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/batch/StreamFactory.java b/src/main/java/io/weaviate/client6/v1/api/collections/batch/StreamFactory.java new file mode 100644 index 000000000..c50eec6ee --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/batch/StreamFactory.java @@ -0,0 +1,13 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import io.grpc.stub.StreamObserver; + +/** + * @param the type of the object sent down the stream. + * @param the type of the object received from the stream. + */ +@FunctionalInterface +interface StreamFactory { + /** Create a new stream for the send-recv observer pair. */ + StreamObserver createStream(StreamObserver recv); +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/batch/TaskHandle.java b/src/main/java/io/weaviate/client6/v1/api/collections/batch/TaskHandle.java new file mode 100644 index 000000000..17c0f136e --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/batch/TaskHandle.java @@ -0,0 +1,94 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import static java.util.Objects.requireNonNull; + +import java.time.Instant; +import java.util.function.Consumer; + +import javax.annotation.concurrent.ThreadSafe; + +import com.google.protobuf.GeneratedMessage; +import com.google.protobuf.GeneratedMessageV3; + +import io.weaviate.client6.v1.api.collections.WeaviateObject; +import io.weaviate.client6.v1.api.collections.data.BatchReference; + +@ThreadSafe +@SuppressWarnings("deprecation") // protoc uses GeneratedMessageV3 +public final class TaskHandle extends RetriableTask { + /** + * Poison pill informs the "sender" that the batch is closed + * and no more user-supplied items will be incoming. + */ + static final TaskHandle POISON = new TaskHandle("POISON"); + /** + * Break pill informs the "sender" that the event handler has finished + * processing an incoming {@link Event.Results} message and no more retry items + * will be added to the queue until the next message arrives. + */ + static final TaskHandle END_RESULTS = new TaskHandle("END_RESULTS"); + + /** + * Input value as passed by the user. + * + *

+ * Changes in the {@link Data}'s underlying value will not be reflected + * in the {@link TaskHandle} (e.g. the serialized version is not updated), + * so users SHOULD treat items passed to and retrieved from {@link TaskHandle} + * as effectively unmodifiable. + */ + private final Data data; + + /** Task creation timestamp. */ + private final Instant createdAt = Instant.now(); + + /** Constructor for {@link WeaviateObject}. */ + TaskHandle( + WeaviateObject object, + GeneratedMessage.ExtendableMessage data, + RetryPolicy retryPolicy, Consumer onRetry) { + this(new Data(object, object.uuid(), data, Data.Type.OBJECT), + retryPolicy, onRetry); + } + + /** Constructor for {@link BatchReference}. */ + TaskHandle( + BatchReference reference, + GeneratedMessage.ExtendableMessage data, + RetryPolicy retryPolicy, Consumer onRetry) { + this(new Data(reference, reference.target().beacon(), data, Data.Type.REFERENCE), + retryPolicy, onRetry); + } + + private TaskHandle(Data data, RetryPolicy retryPolicy, Consumer onRetry) { + super(requireNonNull(data, "data is null").id(), retryPolicy, onRetry); + this.data = requireNonNull(data, "data is null"); + } + + /** + * Poison / Break pill constructor. + * + *

+ * A handle created with this constructor should not be + * used for anything other that direct comparison using {@code ==} operator; + * calling any method on a poison pill is likely to result in a + * {@link NullPointerException} being thrown. + */ + private TaskHandle(String name) { + super(name, RetryPolicy.never(), __ -> { + }); + this.data = null; + } + + Data data() { + return data; + } + + @Override + public String toString() { + if (this == POISON || this == END_RESULTS) { + return "TaskHandle<%s>".formatted(id()); + } + return "TaskHandle".formatted(id(), timesRetried(), createdAt); + } +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/batch/TranslatingStreamFactory.java b/src/main/java/io/weaviate/client6/v1/api/collections/batch/TranslatingStreamFactory.java new file mode 100644 index 000000000..cca4848bc --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/batch/TranslatingStreamFactory.java @@ -0,0 +1,143 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import static java.util.Objects.requireNonNull; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import io.grpc.stub.StreamObserver; +import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateGrpc; +import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch; +import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply; + +/** + * TranslatingStreamFactory is an adaptor for the + * {@link WeaviateGrpc.WeaviateStub#batchStream} factory. The returned stream + * translates client-side messages into protobuf requests and server-side + * replies into events. + * + * @see Message + * @see Event + */ +class TranslatingStreamFactory implements StreamFactory { + private final StreamFactory protoFactory; + + TranslatingStreamFactory( + StreamFactory protoFactory) { + this.protoFactory = requireNonNull(protoFactory, "protoFactory is null"); + } + + @Override + public StreamObserver createStream(StreamObserver recv) { + return new Messenger(protoFactory.createStream(new Eventer(recv))); + } + + /** + * DelegatingStreamObserver delegates {@link #onCompleted} and {@link #onError} + * to another observer and translates the messages in {@link #onNext}. + * + * @param the type of the incoming message. + * @param the type of the message handed to the delegate. + */ + private abstract class DelegatingStreamObserver implements StreamObserver { + protected final StreamObserver delegate; + + protected DelegatingStreamObserver(StreamObserver delegate) { + this.delegate = delegate; + } + + @Override + public void onCompleted() { + delegate.onCompleted(); + } + + @Override + public void onError(Throwable t) { + delegate.onError(t); + } + } + + /** + * Messeger translates client's messages into batch stream requests. + * + * @see Message + */ + private final class Messenger extends DelegatingStreamObserver { + private Messenger(StreamObserver delegate) { + super(delegate); + } + + @Override + public void onNext(Message message) { + WeaviateProtoBatch.BatchStreamRequest.Builder builder = WeaviateProtoBatch.BatchStreamRequest.newBuilder(); + message.appendTo(builder); + delegate.onNext(builder.build()); + } + } + + /** + * Eventer translates server replies into events. + * + * @see Event + */ + private final class Eventer extends DelegatingStreamObserver { + private Eventer(StreamObserver delegate) { + super(delegate); + } + + @Override + public void onNext(BatchStreamReply reply) { + Event event = null; + switch (reply.getMessageCase()) { + case STARTED: + event = Event.STARTED; + break; + case SHUTTING_DOWN: + event = Event.SHUTTING_DOWN; + break; + case OUT_OF_MEMORY: + event = new Event.Oom(reply.getOutOfMemory().getWaitTime()); + break; + case BACKOFF: + event = new Event.Backoff(reply.getBackoff().getBatchSize()); + break; + case ACKS: + Stream uuids = reply.getAcks().getUuidsList().stream(); + Stream beacons = reply.getAcks().getBeaconsList().stream(); + event = new Event.Acks(Stream.concat(uuids, beacons).toList()); + break; + case RESULTS: + List successful = reply.getResults().getSuccessesList().stream() + .map(detail -> { + if (detail.hasUuid()) { + return detail.getUuid(); + } else if (detail.hasBeacon()) { + return detail.getBeacon(); + } + throw new IllegalArgumentException("Result has neither UUID nor a beacon"); + }) + .toList(); + + Map errors = reply.getResults().getErrorsList().stream() + .map(detail -> { + String error = requireNonNull(detail.getError(), "error is null"); + if (detail.hasUuid()) { + return Map.entry(detail.getUuid(), error); + } else if (detail.hasBeacon()) { + return Map.entry(detail.getBeacon(), error); + } + throw new IllegalArgumentException("Result has neither UUID nor a beacon"); + }) + .collect(Collectors.toUnmodifiableMap(Map.Entry::getKey, Map.Entry::getValue)); + event = new Event.Results(successful, errors); + break; + case MESSAGE_NOT_SET: + throw new ProtocolViolationException("Message not set"); + } + + delegate.onNext(event); + } + } +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/batch/WeaviateBatchClient.java b/src/main/java/io/weaviate/client6/v1/api/collections/batch/WeaviateBatchClient.java new file mode 100644 index 000000000..86528370e --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/batch/WeaviateBatchClient.java @@ -0,0 +1,81 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import static java.util.Objects.requireNonNull; + +import java.util.OptionalInt; +import java.util.function.Function; + +import io.weaviate.client6.v1.api.collections.CollectionHandleDefaults; +import io.weaviate.client6.v1.internal.ObjectBuilder; +import io.weaviate.client6.v1.internal.TransportOptions; +import io.weaviate.client6.v1.internal.grpc.GrpcTransport; +import io.weaviate.client6.v1.internal.orm.CollectionDescriptor; + +public class WeaviateBatchClient { + private final CollectionHandleDefaults defaults; + private final CollectionDescriptor collectionDescriptor; + private final GrpcTransport grpcTransport; + + public WeaviateBatchClient( + GrpcTransport grpcTransport, + CollectionDescriptor collectionDescriptor, + CollectionHandleDefaults defaults) { + this.defaults = requireNonNull(defaults, "defaults is null"); + this.collectionDescriptor = requireNonNull(collectionDescriptor, "collectionDescriptor is null"); + this.grpcTransport = requireNonNull(grpcTransport, "grpcTransport is null"); + } + + /** Copy constructor with new defaults. */ + public WeaviateBatchClient(WeaviateBatchClient c, CollectionHandleDefaults defaults) { + this.defaults = requireNonNull(defaults, "defaults is null"); + this.collectionDescriptor = c.collectionDescriptor; + this.grpcTransport = c.grpcTransport; + } + + public BatchContext start( + Function, ObjectBuilder>> fn) { + OptionalInt maxSizeBytes = grpcTransport.maxMessageSizeBytes(); + if (maxSizeBytes.isEmpty()) { + throw new IllegalStateException("Server must have grpcMaxMessageSize configured to use server-side batching"); + } + + StreamFactory streamFactory = new TranslatingStreamFactory(grpcTransport::createStream); + BatchContext.Builder builder = new BatchContext.Builder<>( + streamFactory, maxSizeBytes.getAsInt(), collectionDescriptor, defaults); + BatchContext context = fn.apply(builder).build(); + + if (isWeaviateCloudOnGoogleCloud(grpcTransport.host())) { + context.scheduleReconnect(GCP_RECONNECT_INTERVAL_SECONDS); + } + + context.start(); + return context; + } + + public BatchContext start() { + OptionalInt maxSizeBytes = grpcTransport.maxMessageSizeBytes(); + if (maxSizeBytes.isEmpty()) { + throw new IllegalStateException("Server must have grpcMaxMessageSize configured to use server-side batching"); + } + + StreamFactory streamFactory = new TranslatingStreamFactory(grpcTransport::createStream); + BatchContext context = new BatchContext.Builder<>( + streamFactory, + maxSizeBytes.getAsInt(), + collectionDescriptor, + defaults).build(); + + if (isWeaviateCloudOnGoogleCloud(grpcTransport.host())) { + context.scheduleReconnect(GCP_RECONNECT_INTERVAL_SECONDS); + } + + context.start(); + return context; + } + + private static final int GCP_RECONNECT_INTERVAL_SECONDS = 160; + + private static boolean isWeaviateCloudOnGoogleCloud(String host) { + return TransportOptions.isWeaviateDomain(host) && TransportOptions.isGoogleCloudDomain(host); + } +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/config/DeleteVectorIndexRequest.java b/src/main/java/io/weaviate/client6/v1/api/collections/config/DeleteVectorIndexRequest.java new file mode 100644 index 000000000..7b737c198 --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/config/DeleteVectorIndexRequest.java @@ -0,0 +1,13 @@ +package io.weaviate.client6.v1.api.collections.config; + +import java.util.Collections; + +import io.weaviate.client6.v1.internal.rest.Endpoint; +import io.weaviate.client6.v1.internal.rest.SimpleEndpoint; + +public record DeleteVectorIndexRequest(String collectionName, String vectorName) { + public static final Endpoint _ENDPOINT = SimpleEndpoint.sideEffect( + request -> "DELETE", + request -> "/schema/" + request.collectionName + "/vectors/" + request.vectorName + "/index", + request -> Collections.emptyMap()); +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/config/GetShardsRequest.java b/src/main/java/io/weaviate/client6/v1/api/collections/config/GetShardsRequest.java index 5237fed26..c27c13aa7 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/config/GetShardsRequest.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/config/GetShardsRequest.java @@ -21,8 +21,8 @@ public static final Endpoint> endpoint( return SimpleEndpoint.noBody( request -> "GET", request -> "/schema/" + collection.collectionName() + "/shards", - request -> defaults.tenant() != null - ? Map.of("tenant", defaults.tenant()) + request -> defaults.tenant().isPresent() + ? Map.of("tenant", defaults.tenant().get()) : Collections.emptyMap(), (statusCode, response) -> (List) JSON.deserialize(response, TypeToken.getParameterized( List.class, Shard.class))); diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/config/WeaviateConfigClient.java b/src/main/java/io/weaviate/client6/v1/api/collections/config/WeaviateConfigClient.java index f4a4ee980..87bfc2c92 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/config/WeaviateConfigClient.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/config/WeaviateConfigClient.java @@ -58,6 +58,12 @@ public void dropPropertyIndex(String propertyName, PropertyIndexType indexType) DeletePropertyIndexRequest._ENDPOINT); } + public void dropVectorIndex(String vectorName) throws IOException { + this.restTransport.performRequest( + new DeleteVectorIndexRequest(collection.collectionName(), vectorName), + DeleteVectorIndexRequest._ENDPOINT); + } + public void addReference(String propertyName, String... dataTypes) throws IOException { this.addProperty(ReferenceProperty.to(propertyName, dataTypes).toProperty()); } diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/config/WeaviateConfigClientAsync.java b/src/main/java/io/weaviate/client6/v1/api/collections/config/WeaviateConfigClientAsync.java index 7c0cfd0c3..d0d8de936 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/config/WeaviateConfigClientAsync.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/config/WeaviateConfigClientAsync.java @@ -59,6 +59,12 @@ public CompletableFuture dropPropertyIndex(String propertyName, PropertyIn DeletePropertyIndexRequest._ENDPOINT); } + public CompletableFuture dropVectorIndex(String vectorName) throws IOException { + return this.restTransport.performRequestAsync( + new DeleteVectorIndexRequest(collection.collectionName(), vectorName), + DeleteVectorIndexRequest._ENDPOINT); + } + public CompletableFuture addReference(String name, String... dataTypes) throws IOException { return this.addProperty(ReferenceProperty.to(name, dataTypes).toProperty()); } diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/data/BatchReference.java b/src/main/java/io/weaviate/client6/v1/api/collections/data/BatchReference.java index a83652be5..503ec59d1 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/data/BatchReference.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/data/BatchReference.java @@ -1,5 +1,7 @@ package io.weaviate.client6.v1.api.collections.data; +import static java.util.Objects.requireNonNull; + import java.io.IOException; import java.util.Arrays; @@ -9,7 +11,14 @@ import io.weaviate.client6.v1.api.collections.WeaviateObject; -public record BatchReference(String fromCollection, String fromProperty, String fromUuid, ObjectReference reference) { +public record BatchReference(String fromCollection, String fromProperty, String fromUuid, ObjectReference target) { + + public BatchReference { + requireNonNull(fromCollection, "fromCollection is null"); + requireNonNull(fromProperty, "fromProperty is null"); + requireNonNull(fromUuid, "fromUuid is null"); + requireNonNull(target, "target is null"); + } public static BatchReference[] objects(WeaviateObject fromObject, String fromProperty, WeaviateObject... toObjects) { @@ -39,7 +48,7 @@ public void write(JsonWriter out, BatchReference value) throws IOException { out.value(ObjectReference.toBeacon(value.fromCollection, value.fromProperty, value.fromUuid)); out.name("to"); - out.value(ObjectReference.toBeacon(value.reference.collection(), value.reference.uuid())); + out.value(ObjectReference.toBeacon(value.target.collection(), value.target.uuid())); out.endObject(); } diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/data/DeleteManyRequest.java b/src/main/java/io/weaviate/client6/v1/api/collections/data/DeleteManyRequest.java index 2fff8681a..e60133957 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/data/DeleteManyRequest.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/data/DeleteManyRequest.java @@ -29,11 +29,9 @@ public static Rpc Rpc, WeaviateProtoBat request -> { var message = WeaviateProtoBatch.BatchObjectsRequest.newBuilder(); - var batch = request.objects.stream().map(obj -> { - var batchObject = WeaviateProtoBatch.BatchObject.newBuilder(); - buildObject(batchObject, obj, collection, defaults); - return batchObject.build(); - }).toList(); - + var batch = request.objects.stream() + .map(obj -> buildObject(obj, collection, defaults)) + .toList(); message.addAllObjects(batch); - if (defaults.consistencyLevel() != null) { - defaults.consistencyLevel().appendTo(message); + if (defaults.consistencyLevel().isPresent()) { + defaults.consistencyLevel().get().appendTo(message); } + var m = message.build(); + m.getSerializedSize(); return message.build(); }, response -> { @@ -92,10 +94,11 @@ public static Rpc, WeaviateProtoBat () -> WeaviateFutureStub::batchObjects); } - public static void buildObject(WeaviateProtoBatch.BatchObject.Builder object, + public static WeaviateProtoBatch.BatchObject buildObject( WeaviateObject insert, CollectionDescriptor collection, CollectionHandleDefaults defaults) { + var object = WeaviateProtoBatch.BatchObject.newBuilder(); object.setCollection(collection.collectionName()); if (insert.uuid() != null) { @@ -121,9 +124,7 @@ public static void buildObject(WeaviateProtoBatch.BatchObject.Builder object }).toList(); object.addAllVectors(vectors); } - if (defaults.tenant() != null) { - object.setTenant(defaults.tenant()); - } + defaults.tenant().ifPresent(object::setTenant); var singleRef = new ArrayList(); var multiRef = new ArrayList(); @@ -158,6 +159,7 @@ public static void buildObject(WeaviateProtoBatch.BatchObject.Builder object properties.setNonRefProperties(nonRef); } object.setProperties(properties); + return object.build(); } @SuppressWarnings("unchecked") @@ -330,4 +332,20 @@ private static com.google.protobuf.Struct marshalStruct(Map prop }); return struct.build(); } + + public static WeaviateProtoBatch.BatchReference buildReference(BatchReference reference, Optional tenant) { + requireNonNull(reference, "reference is null"); + WeaviateProtoBatch.BatchReference.Builder builder = WeaviateProtoBatch.BatchReference.newBuilder(); + builder + .setName(reference.fromProperty()) + .setFromCollection(reference.fromCollection()) + .setFromUuid(reference.fromUuid()) + .setToUuid(reference.target().uuid()); + + if (reference.target().collection() != null) { + builder.setToCollection(reference.target().collection()); + } + tenant.ifPresent(t -> builder.setTenant(t)); + return builder.build(); + } } diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/data/InsertObjectRequest.java b/src/main/java/io/weaviate/client6/v1/api/collections/data/InsertObjectRequest.java index 8588eb760..bf4a25273 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/data/InsertObjectRequest.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/data/InsertObjectRequest.java @@ -27,14 +27,14 @@ public static final Endpoint, Wea return new SimpleEndpoint<>( request -> "POST", request -> "/objects/", - request -> defaults.consistencyLevel() != null - ? Map.of("consistency_level", defaults.consistencyLevel()) + request -> defaults.consistencyLevel().isPresent() + ? Map.of("consistency_level", defaults.consistencyLevel().get()) : Collections.emptyMap(), request -> JSON.serialize( new WeaviateObject<>( request.object.uuid(), collection.collectionName(), - defaults.tenant(), + defaults.tenant().orElse(null), request.object.properties(), request.object.vectors(), request.object.createdAt(), diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/data/ObjectReference.java b/src/main/java/io/weaviate/client6/v1/api/collections/data/ObjectReference.java index bb6a0f27e..822c5f54d 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/data/ObjectReference.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/data/ObjectReference.java @@ -67,6 +67,10 @@ public static ObjectReference[] collection(String collection, String... uuids) { .toArray(ObjectReference[]::new); } + public String beacon() { + return toBeacon(collection, uuid); + } + public static String toBeacon(String collection, String uuid) { return toBeacon(collection, null, uuid); } diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/data/ReferenceAddManyRequest.java b/src/main/java/io/weaviate/client6/v1/api/collections/data/ReferenceAddManyRequest.java index 284688daa..752e94adc 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/data/ReferenceAddManyRequest.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/data/ReferenceAddManyRequest.java @@ -31,5 +31,4 @@ public static final Endpoint return new ReferenceAddManyResponse(errors); }); } - } diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/data/ReplaceObjectRequest.java b/src/main/java/io/weaviate/client6/v1/api/collections/data/ReplaceObjectRequest.java index 13a1afacb..dee59f5df 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/data/ReplaceObjectRequest.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/data/ReplaceObjectRequest.java @@ -26,14 +26,14 @@ static final Endpoint, Void> end return SimpleEndpoint.sideEffect( request -> "PUT", request -> "/objects/" + collection.collectionName() + "/" + request.object.uuid(), - request -> defaults.consistencyLevel() != null - ? Map.of("consistency_level", defaults.consistencyLevel()) + request -> defaults.consistencyLevel().isPresent() + ? Map.of("consistency_level", defaults.consistencyLevel().get()) : Collections.emptyMap(), request -> JSON.serialize( new WeaviateObject<>( request.object.uuid(), collection.collectionName(), - defaults.tenant(), + defaults.tenant().orElse(null), request.object.properties(), request.object.vectors(), request.object.createdAt(), diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/data/UpdateObjectRequest.java b/src/main/java/io/weaviate/client6/v1/api/collections/data/UpdateObjectRequest.java index 6157a1cc8..e401ade85 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/data/UpdateObjectRequest.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/data/UpdateObjectRequest.java @@ -26,14 +26,14 @@ static final Endpoint, Void> endp return SimpleEndpoint.sideEffect( request -> "PATCH", request -> "/objects/" + collection.collectionName() + "/" + request.object.uuid(), - request -> defaults.consistencyLevel() != null - ? Map.of("consistency_level", defaults.consistencyLevel()) + request -> defaults.consistencyLevel().isPresent() + ? Map.of("consistency_level", defaults.consistencyLevel().get()) : Collections.emptyMap(), request -> JSON.serialize( new WeaviateObject<>( request.object.uuid(), collection.collectionName(), - defaults.tenant(), + defaults.tenant().orElse(null), request.object.properties(), request.object.vectors(), request.object.createdAt(), diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/data/WeaviateDataClient.java b/src/main/java/io/weaviate/client6/v1/api/collections/data/WeaviateDataClient.java index c7497ec64..19613dff2 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/data/WeaviateDataClient.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/data/WeaviateDataClient.java @@ -35,7 +35,7 @@ public WeaviateDataClient( this.defaults = defaults; } - /** Copy constructor that updates the {@link #query} to use new defaults. */ + /** Copy constructor with new defaults. */ public WeaviateDataClient(WeaviateDataClient c, CollectionHandleDefaults defaults) { this.restTransport = c.restTransport; this.grpcTransport = c.grpcTransport; diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/ConsistencyLevel.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/ConsistencyLevel.java index 326609d2e..fc688cd41 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/query/ConsistencyLevel.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/ConsistencyLevel.java @@ -43,6 +43,10 @@ public final void appendTo(WeaviateProtoBatch.BatchObjectsRequest.Builder req) { req.setConsistencyLevel(consistencyLevel); } + public final void appendTo(WeaviateProtoBatch.BatchStreamRequest.Start.Builder req) { + req.setConsistencyLevel(consistencyLevel); + } + @Override public String toString() { return queryParameter; diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/Hybrid.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/Hybrid.java index 6f284c5a5..a91ff04c5 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/query/Hybrid.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/Hybrid.java @@ -175,6 +175,7 @@ private WeaviateProtoBaseSearch.Hybrid.Builder protoBuilder() { if (alpha != null) { hybrid.setAlpha(alpha); + hybrid.setAlphaParam(alpha); } if (fusionType != null) { diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/Metadata.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/Metadata.java index 0c9e7bd4e..c4414bb3a 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/query/Metadata.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/Metadata.java @@ -11,7 +11,13 @@ public interface Metadata { void appendTo(WeaviateProtoSearchGet.MetadataRequest.Builder metadata); - /** Include metadata in the metadata response. */ + /** + * Include all metadata in the metadata response. + * + *

+ * Collecting {@link #QUERY_PROFILE} involves significant overhead on the + * server side, so it is excluded from ALL and must be requested explicitly. + */ public static final Metadata ALL = MetadataField.ALL; /** Include object creation time in the metadata response. */ public static final Metadata CREATION_TIME_UNIX = MetadataField.CREATION_TIME_UNIX; @@ -64,6 +70,13 @@ public interface Metadata { */ public static final Metadata EXPLAIN_SCORE = MetadataField.EXPLAIN_SCORE; + /** + * Include a per-shard execution timing breakdowns for search queries. + * + * @see QueryProfile + */ + public static final Metadata QUERY_PROFILE = MetadataField.QUERY_PROFILE; + /** * MetadataField are collection properties that can be requested for any object. */ @@ -76,13 +89,15 @@ enum MetadataField implements Metadata { DISTANCE, CERTAINTY, SCORE, - EXPLAIN_SCORE; + EXPLAIN_SCORE, + QUERY_PROFILE; public void appendTo(WeaviateProtoSearchGet.MetadataRequest.Builder metadata) { switch (this) { case ALL: for (final var f : MetadataField.values()) { - if (f != ALL) { + // QUERY_PROFILE is expensive, require an explicit opt-in. + if (f != ALL && f != QUERY_PROFILE) { f.appendTo(metadata); } } @@ -111,6 +126,8 @@ public void appendTo(WeaviateProtoSearchGet.MetadataRequest.Builder metadata) { case SCORE: metadata.setScore(true); break; + case QUERY_PROFILE: + metadata.setQueryProfile(true); } } } diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryProfile.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryProfile.java new file mode 100644 index 000000000..f14ab82ea --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryProfile.java @@ -0,0 +1,44 @@ +package io.weaviate.client6.v1.api.collections.query; + +import java.util.List; +import java.util.Map; + +/** Per-shard execution timing breakdowns for search queries. */ +public record QueryProfile(List shards) { + /** + * Search profiling samples keyed by shard name. + *

+ * Vector searches: + * + *

    + *
  • {@code vector_search_took}: time in the vector index + *
  • {@code hnsw_flat_search}: "true" / "false", whether flat search was used + *
  • {@code knn_search_layer_N_took}: per-layer HNSW traversal time + *
  • {@code knn_search_rescore_took}: PQ/BQ rescore time + *
  • {@code flat_search_iteration_took}, {@code flat_search_rescore_took} + *
+ * + *

+ * Keyword (BM25) searches: + * + *

    + *
  • {@code kwd_method}, {@code kwd_time}, {@code kwd_filter_size} + *
  • {@code kwd_1_tok_time}: tokenization time + *
  • {@code kwd_3_term_time}: term lookup time + *
  • {@code kwd_4_wand_time / kwd_4_bmw_time}: scoring algorithm time + *
  • {@code kwd_5_objects_time}: object fetch time + *
  • {@code kwd_6_res_count}: result count + *
+ * + *

+ * Filtered searches (any type): + * + *

    + *
  • {@code filters_build_allow_list_took}: filter evaluation time + *
  • {@code filters_ids_matched}: number of IDs matching the filter + *
  • {@code sort_took}, objects_took + *
+ */ + public static record ShardProfile(Map> searches) { + } +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryRequest.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryRequest.java index 625dde30d..9b031ddc2 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryRequest.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryRequest.java @@ -1,6 +1,7 @@ package io.weaviate.client6.v1.api.collections.query; import io.weaviate.client6.v1.api.collections.CollectionHandleDefaults; +import io.weaviate.client6.v1.internal.Debug; import io.weaviate.client6.v1.internal.grpc.Rpc; import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateGrpc.WeaviateBlockingStub; import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateGrpc.WeaviateFutureStub; @@ -37,11 +38,9 @@ public static WeaviateProtoSearchGet.SearchRequest marshal( } request.operator.appendTo(message); - if (defaults.tenant() != null) { - message.setTenant(defaults.tenant()); - } - if (defaults.consistencyLevel() != null) { - defaults.consistencyLevel().appendTo(message); + defaults.tenant().ifPresent(message::setTenant); + if (defaults.consistencyLevel().isPresent()) { + defaults.consistencyLevel().get().appendTo(message); } if (request.groupBy != null) { diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryResponse.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryResponse.java index b1bc7369e..25313d2f6 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryResponse.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryResponse.java @@ -5,6 +5,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; +import java.util.stream.Collectors; import java.util.stream.Stream; import io.weaviate.client6.v1.api.collections.GeoCoordinates; @@ -20,7 +21,8 @@ import io.weaviate.client6.v1.internal.orm.PropertiesBuilder; public record QueryResponse( - List> objects) { + List> objects, + QueryProfile queryProfile) { static QueryResponse unmarshal(WeaviateProtoSearchGet.SearchReply reply, CollectionDescriptor collection) { @@ -30,7 +32,22 @@ static QueryResponse unmarshal(WeaviateProtoSearchGet .map(obj -> QueryResponse.unmarshalResultObject( obj.getProperties(), obj.getMetadata(), collection)) .toList(); - return new QueryResponse<>(objects); + return new QueryResponse<>(objects, unmarshalQueryProfile(reply.getQueryProfile())); + } + + static QueryProfile unmarshalQueryProfile(WeaviateProtoSearchGet.QueryProfile queryProfile) { + return new QueryProfile(queryProfile + .getShardsList() + .stream() + .map(shard -> new QueryProfile.ShardProfile( + shard + .getSearchesMap() + .entrySet() + .stream() + .collect(Collectors.toMap( + Map.Entry::getKey, + entry -> entry.getValue().getDetailsMap())))) + .toList()); } public static WeaviateObject unmarshalResultObject( @@ -92,20 +109,9 @@ static WeaviateObject unmarshalWithReferences( (map, ref) -> { var refObjects = ref.getPropertiesList().stream() .map(property -> { - var reference = unmarshalWithReferences( + return (Reference) unmarshalWithReferences( property, property.getMetadata(), CollectionDescriptor.ofMap(property.getTargetCollection())); - return (Reference) new WeaviateObject<>( - reference.uuid(), - reference.collection(), - // TODO(dyma): we can get tenant from CollectionHandle - null, // tenant is not returned in the query - (Map) reference.properties(), - reference.vectors(), - reference.createdAt(), - reference.lastUpdatedAt(), - reference.queryMetadata(), - reference.references()); }) .toList(); diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryResponseGrouped.java b/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryResponseGrouped.java index 587be10ac..bd23738c4 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryResponseGrouped.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/query/QueryResponseGrouped.java @@ -14,7 +14,8 @@ public record QueryResponseGrouped( /** All objects retrieved in the query. */ List> objects, /** Grouped response objects. */ - Map> groups) { + Map> groups, + QueryProfile queryProfile) { static QueryResponseGrouped unmarshal( WeaviateProtoSearchGet.SearchReply reply, @@ -47,6 +48,8 @@ static QueryResponseGrouped unmarshal( // about the server's response. .collect(Collectors.toMap(QueryResponseGroup::name, Function.identity())); - return new QueryResponseGrouped(allObjects, groups); + return new QueryResponseGrouped( + allObjects, groups, + QueryResponse.unmarshalQueryProfile(reply.getQueryProfile())); } } diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/rerankers/CohereReranker.java b/src/main/java/io/weaviate/client6/v1/api/collections/rerankers/CohereReranker.java index 5cdf60c16..e762b3174 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/rerankers/CohereReranker.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/rerankers/CohereReranker.java @@ -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"; @@ -32,12 +33,18 @@ public static CohereReranker of(Function> } public CohereReranker(Builder builder) { - this(builder.model); + this(builder.baseUrl, builder.model); } public static class Builder implements ObjectBuilder { + 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; diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Multi2MultiVecWeaviateVectorizer.java b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Multi2MultiVecWeaviateVectorizer.java new file mode 100644 index 000000000..5cb07c921 --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Multi2MultiVecWeaviateVectorizer.java @@ -0,0 +1,109 @@ +package io.weaviate.client6.v1.api.collections.vectorizers; + +import java.util.Arrays; +import java.util.List; +import java.util.function.Function; + +import com.google.gson.annotations.SerializedName; + +import io.weaviate.client6.v1.api.collections.Quantization; +import io.weaviate.client6.v1.api.collections.VectorConfig; +import io.weaviate.client6.v1.api.collections.VectorIndex; +import io.weaviate.client6.v1.internal.ObjectBuilder; + +public record Multi2MultiVecWeaviateVectorizer( + /** Base URL of the embedding service. */ + @SerializedName("baseURL") String baseUrl, + /** Inference model to use. */ + @SerializedName("model") String model, + /** BLOB properties included in the embedding. */ + @SerializedName("imageFields") List imageFields, + /** Vector index configuration. */ + VectorIndex vectorIndex, + /** Vector quantization method. */ + Quantization quantization) implements VectorConfig { + + @Override + public VectorConfig.Kind _kind() { + return VectorConfig.Kind.MULTI2MULTIVEC_WEAVIATE; + } + + @Override + public Object _self() { + return this; + } + + /** ColBERT-family model available in the Weaviate Embedding Service. */ + public static String MODERNVBERT_COLMODERNVBERT = "ModernVBERT/colmodernvbert"; + + public static Multi2MultiVecWeaviateVectorizer of() { + return of(ObjectBuilder.identity()); + } + + public static Multi2MultiVecWeaviateVectorizer of( + Function> fn) { + return fn.apply(new Builder()).build(); + } + + public Multi2MultiVecWeaviateVectorizer(Builder builder) { + this( + builder.baseUrl, + builder.model, + builder.imageFields, + builder.vectorIndex, + builder.quantization); + } + + public static class Builder implements ObjectBuilder { + private VectorIndex vectorIndex = VectorIndex.DEFAULT_VECTOR_INDEX; + private Quantization quantization; + + private String baseUrl; + private String model; + + private List imageFields; + + public Builder baseUrl(String baseUrl) { + this.baseUrl = baseUrl; + return this; + } + + public Builder model(String model) { + this.model = model; + return this; + } + + /** Add BLOB properties to include in the embedding. */ + public Builder imageFields(List fields) { + imageFields = fields; + return this; + } + + /** Add BLOB properties to include in the embedding. */ + public Builder imageFields(String... fields) { + return imageFields(Arrays.asList(fields)); + } + + /** + * Override default vector index configuration. + * + * HNSW + * is the default vector index. + */ + public Builder vectorIndex(VectorIndex vectorIndex) { + this.vectorIndex = vectorIndex; + return this; + } + + public Builder quantization(Quantization quantization) { + this.quantization = quantization; + return this; + } + + @Override + public Multi2MultiVecWeaviateVectorizer build() { + return new Multi2MultiVecWeaviateVectorizer(this); + } + } +} diff --git a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Multi2VecGoogleVectorizer.java b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Multi2VecGoogleVectorizer.java index c22b7b4a3..ce08af701 100644 --- a/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Multi2VecGoogleVectorizer.java +++ b/src/main/java/io/weaviate/client6/v1/api/collections/vectorizers/Multi2VecGoogleVectorizer.java @@ -15,6 +15,7 @@ public record Multi2VecGoogleVectorizer( @SerializedName("projectId") String projectId, @SerializedName("model") String model, + @SerializedName("apiEndpoint") String apiEndpoint, @SerializedName("dimensions") Integer dimensions, @SerializedName("location") String location, @SerializedName("videoIntervalSeconds") Integer videoIntervalSeconds, @@ -22,6 +23,8 @@ public record Multi2VecGoogleVectorizer( @SerializedName("imageFields") List imageFields, /** BLOB video properties included in the embedding. */ @SerializedName("videoFields") List videoFields, + /** BLOB audio properties included in the embedding. */ + @SerializedName("audioFields") List audioFields, /** TEXT properties included in the embedding. */ @SerializedName("textFields") List textFields, /** Weights of the included properties. */ @@ -42,6 +45,11 @@ private static record Weights( * corresponding property names in {@code videoFields}. */ @SerializedName("videoWeights") List videoWeights, + /** + * Weights of the BLOB audio properties. Values appear in the same order as the + * corresponding property names in {@code audioFields}. + */ + @SerializedName("audioWeights") List audioWeights, /** * Weights of the TEXT properties. Values appear in the same order as the * corresponding property names in {@code textFields}. @@ -59,37 +67,62 @@ public Object _self() { return this; } + @Deprecated(forRemoval = true) public static Multi2VecGoogleVectorizer of(String projectId, String location) { return of(projectId, location, ObjectBuilder.identity()); } + @Deprecated(forRemoval = true) public static Multi2VecGoogleVectorizer of( String projectId, String location, Function> fn) { - return fn.apply(new Builder(projectId, location)).build(); + return fn.apply(new VertexBuilder(projectId, location)).build(); + } + + public static Multi2VecGoogleVectorizer vertex(String projectId, String location) { + return vertex(projectId, location, ObjectBuilder.identity()); + } + + public static Multi2VecGoogleVectorizer vertex( + String projectId, + String location, + Function> fn) { + return fn.apply(new VertexBuilder(projectId, location)).build(); + } + + public static Multi2VecGoogleVectorizer gemini() { + return gemini(ObjectBuilder.identity()); + } + + public static Multi2VecGoogleVectorizer gemini(Function> fn) { + return fn.apply(new GeminiBuilder()).build(); } public Multi2VecGoogleVectorizer( String projectId, String model, + String apiEndpoint, Integer dimensions, String location, Integer videoIntervalSeconds, List imageFields, List videoFields, + List audioFields, List textFields, Weights weights, VectorIndex vectorIndex, Quantization quantization) { this.projectId = projectId; + this.apiEndpoint = apiEndpoint; this.model = model; this.dimensions = dimensions; this.location = location; this.videoIntervalSeconds = videoIntervalSeconds; this.imageFields = imageFields; this.videoFields = videoFields; + this.audioFields = audioFields; this.textFields = textFields; this.weights = weights; this.vectorIndex = vectorIndex; @@ -100,11 +133,13 @@ public Multi2VecGoogleVectorizer(Builder builder) { this( builder.projectId, builder.model, + builder.apiEndpoint, builder.dimensions, builder.location, builder.videoIntervalSeconds, builder.imageFields, builder.videoFields, + builder.audioFields, builder.textFields, builder.getWeights(), builder.vectorIndex, @@ -118,26 +153,39 @@ public static class Builder implements ObjectBuilder private List imageFields; private List imageWeights; private List videoFields; + private List audioFields; private List videoWeights; + private List audioWeights; private List textFields; private List textWeights; - private final String projectId; + private String projectId; + private String apiEndpoint; private String model; private String location; private Integer dimensions; private Integer videoIntervalSeconds; + @Deprecated(forRemoval = true) public Builder(String projectId, String location) { this.projectId = projectId; this.location = location; } + protected Builder(String apiEndpoint) { + this.apiEndpoint = apiEndpoint; + } + public Builder model(String model) { this.model = model; return this; } + protected Builder apiEndpoint(String apiEndpoint) { + this.apiEndpoint = apiEndpoint; + return this; + } + public Builder dimensions(int dimensions) { this.dimensions = dimensions; return this; @@ -206,6 +254,35 @@ public Builder videoField(String field, float weight) { return this; } + /** Add BLOB audio properties to include in the embedding. */ + public Builder audioFields(List fields) { + this.audioFields = fields; + return this; + } + + /** Add BLOB audio properties to include in the embedding. */ + public Builder audioFields(String... fields) { + return audioFields(Arrays.asList(fields)); + } + + /** + * Add BLOB audio property to include in the embedding. + * + * @param field Property name. + * @param weight Custom weight between 0.0 and 1.0. + */ + public Builder audioField(String field, float weight) { + if (this.audioFields == null) { + this.audioFields = new ArrayList<>(); + } + if (this.audioWeights == null) { + this.audioWeights = new ArrayList<>(); + } + this.audioFields.add(field); + this.audioWeights.add(weight); + return this; + } + /** Add TEXT properties to include in the embedding. */ public Builder textFields(List fields) { this.textFields = fields; @@ -236,8 +313,9 @@ public Builder textField(String field, float weight) { } protected Weights getWeights() { - if (this.textWeights != null || this.imageWeights != null || this.videoWeights != null) { - return new Weights(this.imageWeights, this.videoWeights, this.textWeights); + if (this.textWeights != null || this.imageWeights != null || this.videoWeights != null + || this.audioWeights != null) { + return new Weights(this.imageWeights, this.videoWeights, this.audioWeights, this.textWeights); } return null; } @@ -264,4 +342,24 @@ public Multi2VecGoogleVectorizer build() { return new Multi2VecGoogleVectorizer(this); } } + + public static class GeminiBuilder extends Builder { + public static final String BASE_URL = "generativelanguage.googleapis.com"; + + public GeminiBuilder() { + super(BASE_URL); + } + } + + public static class VertexBuilder extends Builder { + + public VertexBuilder(String projectId, String location) { + super(projectId, location); + } + + public VertexBuilder apiEndpoint(String apiEndpoint) { + super.apiEndpoint(apiEndpoint); + return this; + } + } } diff --git a/src/main/java/io/weaviate/client6/v1/api/rbac/McpPermission.java b/src/main/java/io/weaviate/client6/v1/api/rbac/McpPermission.java new file mode 100644 index 000000000..133c2b7ee --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/api/rbac/McpPermission.java @@ -0,0 +1,46 @@ +package io.weaviate.client6.v1.api.rbac; + +import java.util.Arrays; +import java.util.List; + +import com.google.gson.annotations.SerializedName; + +public record McpPermission( + @SerializedName("actions") List actions) implements Permission { + + public McpPermission(Action... actions) { + this(Arrays.asList(actions)); + } + + @Override + public Permission.Kind _kind() { + return Permission.Kind.MCP; + } + + @Override + public Object self() { + return this; + } + + public enum Action implements RbacAction { + @SerializedName("create_mcp") + CREATE("create_mcp"), + + @SerializedName("read_mcp") + READ("read_mcp"), + + @SerializedName("update_mcp") + UPDATE("update_mcp"); + + private final String jsonValue; + + private Action(String jsonValue) { + this.jsonValue = jsonValue; + } + + @Override + public String jsonValue() { + return jsonValue; + } + } +} diff --git a/src/main/java/io/weaviate/client6/v1/api/rbac/Permission.java b/src/main/java/io/weaviate/client6/v1/api/rbac/Permission.java index 9374c4e35..573a2fed6 100644 --- a/src/main/java/io/weaviate/client6/v1/api/rbac/Permission.java +++ b/src/main/java/io/weaviate/client6/v1/api/rbac/Permission.java @@ -41,7 +41,8 @@ enum Kind implements JsonEnum { USERS("users"), // Fake permission kinds: Weaviate does not use those. - CLUSTER("cluster"); + CLUSTER("cluster"), + MCP("mcp"); private static final Map jsonValueMap = JsonEnum.collectNames(Kind.values()); private final String jsonValue; @@ -153,6 +154,14 @@ public static UsersPermission users(String userId, UsersPermission.Action... act return new UsersPermission(userId, actions); } + /** + * Create {@link McpPermission}. + */ + public static McpPermission mcp(McpPermission.Action... actions) { + checkDeprecation(actions); + return new McpPermission(actions); + } + /** * Create {@link ReplicatePermission}. * @@ -222,6 +231,7 @@ private final void init(Gson gson) { addAdapter(gson, Permission.Kind.ROLES, RolesPermission.class); addAdapter(gson, Permission.Kind.NODES, NodesPermission.class); addAdapter(gson, Permission.Kind.TENANTS, TenantsPermission.class); + addAdapter(gson, Permission.Kind.MCP, McpPermission.class); addAdapter(gson, Permission.Kind.REPLICATE, ReplicatePermission.class); addAdapter(gson, Permission.Kind.USERS, UsersPermission.class); addAdapter(gson, Permission.Kind.CLUSTER, ClusterPermission.class); @@ -283,6 +293,8 @@ public Permission read(JsonReader in) throws IOException { var actionString = action.getAsString(); if (actionString.endsWith("_cluster")) { kind = Permission.Kind.CLUSTER; + } else if (actionString.endsWith("_mcp")) { + kind = Permission.Kind.MCP; } else { throw new IllegalArgumentException("unknown RBAC action " + actionString); } diff --git a/src/main/java/io/weaviate/client6/v1/internal/Proxy.java b/src/main/java/io/weaviate/client6/v1/internal/Proxy.java new file mode 100644 index 000000000..5637cfeae --- /dev/null +++ b/src/main/java/io/weaviate/client6/v1/internal/Proxy.java @@ -0,0 +1,15 @@ +package io.weaviate.client6.v1.internal; + +import javax.annotation.Nullable; + +public record Proxy( + String scheme, + String host, + int port, + @Nullable String username, + @Nullable String password +) { + public Proxy(String host, int port) { + this("http", host, port, null, null); + } +} diff --git a/src/main/java/io/weaviate/client6/v1/internal/TokenProvider.java b/src/main/java/io/weaviate/client6/v1/internal/TokenProvider.java index 7b28a5e7a..e88f48563 100644 --- a/src/main/java/io/weaviate/client6/v1/internal/TokenProvider.java +++ b/src/main/java/io/weaviate/client6/v1/internal/TokenProvider.java @@ -141,6 +141,24 @@ public static TokenProvider resourceOwnerPassword(OidcConfig oidc, String userna return background(reuse(null, exchange(oidc, passwordGrant), DEFAULT_EARLY_EXPIRY)); } + /** + * Create a TokenProvider that uses Resource Owner Password Credentials authorization grant. + * + * @param oidc OIDC config. + * @param clientSecret Client secret. + * @param username Resource owner username. + * @param password Resource owner password. + * + * @return Internal TokenProvider implementation. + * @throws WeaviateOAuthException if an error occurred at any point of the token + * exchange process. + */ + public static TokenProvider resourceOwnerPasswordCredentials(OidcConfig oidc, String clientSecret, String username, + String password) { + final var passwordGrant = NimbusTokenProvider.resouceOwnerPasswordCredentials(oidc, clientSecret, username, password); + return background(reuse(null, exchange(oidc, passwordGrant), DEFAULT_EARLY_EXPIRY)); + } + /** * Create a TokenProvider that uses Client Credentials authorization grant. * diff --git a/src/main/java/io/weaviate/client6/v1/internal/TransportOptions.java b/src/main/java/io/weaviate/client6/v1/internal/TransportOptions.java index 897bb28cd..670fe1bc9 100644 --- a/src/main/java/io/weaviate/client6/v1/internal/TransportOptions.java +++ b/src/main/java/io/weaviate/client6/v1/internal/TransportOptions.java @@ -11,9 +11,10 @@ public abstract class TransportOptions { protected final H headers; protected final TrustManagerFactory trustManagerFactory; protected final Timeout timeout; + protected final Proxy proxy; protected TransportOptions(String scheme, String host, int port, H headers, TokenProvider tokenProvider, - TrustManagerFactory tmf, Timeout timeout) { + TrustManagerFactory tmf, Timeout timeout, Proxy proxy) { this.scheme = scheme; this.host = host; this.port = port; @@ -21,6 +22,7 @@ protected TransportOptions(String scheme, String host, int port, H headers, Toke this.headers = headers; this.timeout = timeout; this.trustManagerFactory = tmf; + this.proxy = proxy; } public boolean isSecure() { @@ -57,4 +59,25 @@ public H headers() { public TrustManagerFactory trustManagerFactory() { return this.trustManagerFactory; } + + @Nullable + public Proxy proxy() { + return this.proxy; + } + + /** + * isWeaviateDomain returns true if the host matches weaviate.io, + * semi.technology, or weaviate.cloud domain. + */ + public static boolean isWeaviateDomain(String host) { + var lower = host.toLowerCase(); + return lower.contains("weaviate.io") || + lower.contains("semi.technology") || + lower.contains("weaviate.cloud"); + } + + public static boolean isGoogleCloudDomain(String host) { + var lower = host.toLowerCase(); + return lower.contains("gcp"); + } } diff --git a/src/main/java/io/weaviate/client6/v1/internal/grpc/DefaultGrpcTransport.java b/src/main/java/io/weaviate/client6/v1/internal/grpc/DefaultGrpcTransport.java index d12255d22..7ae6ba8f6 100644 --- a/src/main/java/io/weaviate/client6/v1/internal/grpc/DefaultGrpcTransport.java +++ b/src/main/java/io/weaviate/client6/v1/internal/grpc/DefaultGrpcTransport.java @@ -1,6 +1,10 @@ package io.weaviate.client6.v1.internal.grpc; +import static java.util.Objects.requireNonNull; + +import java.util.OptionalInt; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executor; import java.util.concurrent.TimeUnit; import javax.net.ssl.SSLException; @@ -8,7 +12,7 @@ import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; - +import io.grpc.HttpConnectProxiedSocketAddress; import io.grpc.ManagedChannel; import io.grpc.StatusRuntimeException; import io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts; @@ -16,57 +20,64 @@ import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext; import io.grpc.stub.AbstractStub; import io.grpc.stub.MetadataUtils; +import io.grpc.stub.StreamObserver; import io.weaviate.client6.v1.api.WeaviateApiException; +import io.weaviate.client6.v1.internal.Proxy; import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateGrpc; import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateGrpc.WeaviateBlockingStub; import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateGrpc.WeaviateFutureStub; +import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply; +import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamRequest; + +import javax.net.ssl.SSLException; +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; public final class DefaultGrpcTransport implements GrpcTransport { + /** + * ListenableFuture callbacks are executed + * in the same thread they are called from. + */ + private static final Executor FUTURE_CALLBACK_EXECUTOR = Runnable::run; + + private final GrpcChannelOptions transportOptions; private final ManagedChannel channel; private final WeaviateBlockingStub blockingStub; private final WeaviateFutureStub futureStub; - private final GrpcChannelOptions transportOptions; - private TokenCallCredentials callCredentials; public DefaultGrpcTransport(GrpcChannelOptions transportOptions) { - this.transportOptions = transportOptions; - this.channel = buildChannel(transportOptions); - - var blockingStub = WeaviateGrpc.newBlockingStub(channel) - .withInterceptors(MetadataUtils.newAttachHeadersInterceptor(transportOptions.headers())); - - var futureStub = WeaviateGrpc.newFutureStub(channel) - .withInterceptors(MetadataUtils.newAttachHeadersInterceptor(transportOptions.headers())); - - if (transportOptions.maxMessageSize() != null) { - var max = transportOptions.maxMessageSize(); - blockingStub = blockingStub.withMaxInboundMessageSize(max).withMaxOutboundMessageSize(max); - futureStub = futureStub.withMaxInboundMessageSize(max).withMaxOutboundMessageSize(max); - } + requireNonNull(transportOptions, "transportOptions is null"); + this.transportOptions = transportOptions; if (transportOptions.tokenProvider() != null) { this.callCredentials = new TokenCallCredentials(transportOptions.tokenProvider()); - blockingStub = blockingStub.withCallCredentials(callCredentials); - futureStub = futureStub.withCallCredentials(callCredentials); } - this.blockingStub = blockingStub; - this.futureStub = futureStub; + this.channel = buildChannel(transportOptions); + this.blockingStub = configure(WeaviateGrpc.newBlockingStub(channel)); + this.futureStub = configure(WeaviateGrpc.newFutureStub(channel)); } private > StubT applyTimeout(StubT stub, Rpc rpc) { if (transportOptions.timeout() == null) { return stub; } - var timeout = rpc.isInsert() + int timeout = rpc.isInsert() ? transportOptions.timeout().insertSeconds() : transportOptions.timeout().querySeconds(); return stub.withDeadlineAfter(timeout, TimeUnit.SECONDS); } + @Override + public OptionalInt maxMessageSizeBytes() { + return transportOptions.maxMessageSize(); + } + @Override public ResponseT performRequest(RequestT request, Rpc rpc) { @@ -88,7 +99,7 @@ public CompletableFuture perf var method = rpc.methodAsync(); var stub = applyTimeout(futureStub, rpc); var reply = method.apply(stub, message); - return toCompletableFuture(reply).thenApply(r -> rpc.unmarshal(r)); + return toCompletableFuture(reply).thenApply(rpc::unmarshal); } /** @@ -96,7 +107,9 @@ public CompletableFuture perf * reusing the thread in which the original future is completed. */ private static final CompletableFuture toCompletableFuture(ListenableFuture listenable) { - var completable = new CompletableFuture(); + requireNonNull(listenable, "listenable is null"); + + CompletableFuture completable = new CompletableFuture<>(); Futures.addCallback(listenable, new FutureCallback() { @Override @@ -113,13 +126,14 @@ public void onFailure(Throwable t) { completable.completeExceptionally(t); } - }, Runnable::run); + }, FUTURE_CALLBACK_EXECUTOR); return completable; } private static ManagedChannel buildChannel(GrpcChannelOptions transportOptions) { - var channel = NettyChannelBuilder.forAddress(transportOptions.host(), transportOptions.port()); + requireNonNull(transportOptions, "transportOptions is null"); + NettyChannelBuilder channel = NettyChannelBuilder.forAddress(transportOptions.host(), transportOptions.port()); if (transportOptions.isSecure()) { channel.useTransportSecurity(); } else { @@ -139,11 +153,51 @@ private static ManagedChannel buildChannel(GrpcChannelOptions transportOptions) channel.sslContext(sslCtx); } - channel.intercept(MetadataUtils.newAttachHeadersInterceptor(transportOptions.headers())); + if (transportOptions.proxy() != null) { + Proxy proxy = transportOptions.proxy(); + if ("http".equals(proxy.scheme()) || "https".equals(proxy.scheme())) { + final SocketAddress proxyAddress = new InetSocketAddress(proxy.host(), proxy.port()); + channel.proxyDetector(targetAddress -> { + if (targetAddress instanceof InetSocketAddress) { + HttpConnectProxiedSocketAddress.Builder builder = HttpConnectProxiedSocketAddress.newBuilder() + .setProxyAddress(proxyAddress) + .setTargetAddress((InetSocketAddress) targetAddress); + + if (proxy.username() != null && proxy.password() != null) { + builder.setUsername(proxy.username()); + builder.setPassword(proxy.password()); + } + return builder.build(); + } + return null; + }); + } + } + channel.intercept(MetadataUtils.newAttachHeadersInterceptor(transportOptions.headers())); return channel.build(); } + @Override + public StreamObserver createStream(StreamObserver recv) { + return configure(WeaviateGrpc.newStub(channel)).batchStream(recv); + } + + /** Apply common configuration to a stub. */ + private > S configure(S stub) { + requireNonNull(stub, "stub is null"); + + stub = stub.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(transportOptions.headers())); + if (transportOptions.maxMessageSize().isPresent()) { + int max = transportOptions.maxMessageSize().getAsInt(); + stub = stub.withMaxInboundMessageSize(max).withMaxOutboundMessageSize(max); + } + if (callCredentials != null) { + stub = stub.withCallCredentials(callCredentials); + } + return stub; + } + @Override public void close() throws Exception { channel.shutdown(); @@ -151,4 +205,9 @@ public void close() throws Exception { callCredentials.close(); } } + + @Override + public String host() { + return transportOptions.host(); + } } diff --git a/src/main/java/io/weaviate/client6/v1/internal/grpc/GrpcChannelOptions.java b/src/main/java/io/weaviate/client6/v1/internal/grpc/GrpcChannelOptions.java index 5e4453d7f..69553a858 100644 --- a/src/main/java/io/weaviate/client6/v1/internal/grpc/GrpcChannelOptions.java +++ b/src/main/java/io/weaviate/client6/v1/internal/grpc/GrpcChannelOptions.java @@ -1,34 +1,36 @@ package io.weaviate.client6.v1.internal.grpc; import java.util.Map; +import java.util.OptionalInt; import javax.net.ssl.TrustManagerFactory; import io.grpc.Metadata; +import io.weaviate.client6.v1.internal.Proxy; import io.weaviate.client6.v1.internal.Timeout; import io.weaviate.client6.v1.internal.TokenProvider; import io.weaviate.client6.v1.internal.TransportOptions; public class GrpcChannelOptions extends TransportOptions { - private final Integer maxMessageSize; + private final OptionalInt maxMessageSize; public GrpcChannelOptions(String scheme, String host, int port, Map headers, - TokenProvider tokenProvider, TrustManagerFactory tmf, Timeout timeout) { - this(scheme, host, port, buildMetadata(headers), tokenProvider, tmf, null, timeout); + TokenProvider tokenProvider, TrustManagerFactory tmf, Timeout timeout, Proxy proxy) { + this(scheme, host, port, buildMetadata(headers), tokenProvider, tmf, OptionalInt.empty(), timeout, proxy); } private GrpcChannelOptions(String scheme, String host, int port, Metadata headers, - TokenProvider tokenProvider, TrustManagerFactory tmf, Integer maxMessageSize, Timeout timeout) { - super(scheme, host, port, headers, tokenProvider, tmf, timeout); + TokenProvider tokenProvider, TrustManagerFactory tmf, OptionalInt maxMessageSize, Timeout timeout, Proxy proxy) { + super(scheme, host, port, headers, tokenProvider, tmf, timeout, proxy); this.maxMessageSize = maxMessageSize; } public GrpcChannelOptions withMaxMessageSize(int maxMessageSize) { - return new GrpcChannelOptions(scheme, host, port, headers, tokenProvider, trustManagerFactory, maxMessageSize, - timeout); + return new GrpcChannelOptions(scheme, host, port, headers, tokenProvider, trustManagerFactory, + OptionalInt.of(maxMessageSize), timeout, proxy); } - public Integer maxMessageSize() { + public OptionalInt maxMessageSize() { return maxMessageSize; } diff --git a/src/main/java/io/weaviate/client6/v1/internal/grpc/GrpcTransport.java b/src/main/java/io/weaviate/client6/v1/internal/grpc/GrpcTransport.java index cad58257b..6bdc888a3 100644 --- a/src/main/java/io/weaviate/client6/v1/internal/grpc/GrpcTransport.java +++ b/src/main/java/io/weaviate/client6/v1/internal/grpc/GrpcTransport.java @@ -1,11 +1,33 @@ package io.weaviate.client6.v1.internal.grpc; +import java.util.OptionalInt; import java.util.concurrent.CompletableFuture; +import io.grpc.stub.StreamObserver; +import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch; + public interface GrpcTransport extends AutoCloseable { - ResponseT performRequest(RequestT request, - Rpc rpc); + ResponseT performRequest(RequestT request, + Rpc rpc); + + CompletableFuture performRequestAsync(RequestT request, + Rpc rpc); + + /** + * Create stream for batch insertion. + * + *

+ * Batch insertion is presently the only operation performed over a + * StreamStream connection, which is why we do not parametrize this + * method. + */ + StreamObserver createStream( + StreamObserver recv); + + String host(); - CompletableFuture performRequestAsync(RequestT request, - Rpc rpc); + /** + * Maximum inbound/outbound message size supported by the underlying channel. + */ + OptionalInt maxMessageSizeBytes(); } diff --git a/src/main/java/io/weaviate/client6/v1/internal/grpc/protocol/FileReplicationServiceGrpc.java b/src/main/java/io/weaviate/client6/v1/internal/grpc/protocol/FileReplicationServiceGrpc.java deleted file mode 100644 index 1db25a027..000000000 --- a/src/main/java/io/weaviate/client6/v1/internal/grpc/protocol/FileReplicationServiceGrpc.java +++ /dev/null @@ -1,557 +0,0 @@ -package io.weaviate.client6.v1.internal.grpc.protocol; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - */ -@javax.annotation.Generated( - value = "by gRPC proto compiler (version 1.58.0)", - comments = "Source: v1/file_replication.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class FileReplicationServiceGrpc { - - private FileReplicationServiceGrpc() {} - - public static final java.lang.String SERVICE_NAME = "weaviate.v1.FileReplicationService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getPauseFileActivityMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "PauseFileActivity", - requestType = io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.PauseFileActivityRequest.class, - responseType = io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.PauseFileActivityResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getPauseFileActivityMethod() { - io.grpc.MethodDescriptor getPauseFileActivityMethod; - if ((getPauseFileActivityMethod = FileReplicationServiceGrpc.getPauseFileActivityMethod) == null) { - synchronized (FileReplicationServiceGrpc.class) { - if ((getPauseFileActivityMethod = FileReplicationServiceGrpc.getPauseFileActivityMethod) == null) { - FileReplicationServiceGrpc.getPauseFileActivityMethod = getPauseFileActivityMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PauseFileActivity")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.PauseFileActivityRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.PauseFileActivityResponse.getDefaultInstance())) - .setSchemaDescriptor(new FileReplicationServiceMethodDescriptorSupplier("PauseFileActivity")) - .build(); - } - } - } - return getPauseFileActivityMethod; - } - - private static volatile io.grpc.MethodDescriptor getResumeFileActivityMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ResumeFileActivity", - requestType = io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ResumeFileActivityRequest.class, - responseType = io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ResumeFileActivityResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getResumeFileActivityMethod() { - io.grpc.MethodDescriptor getResumeFileActivityMethod; - if ((getResumeFileActivityMethod = FileReplicationServiceGrpc.getResumeFileActivityMethod) == null) { - synchronized (FileReplicationServiceGrpc.class) { - if ((getResumeFileActivityMethod = FileReplicationServiceGrpc.getResumeFileActivityMethod) == null) { - FileReplicationServiceGrpc.getResumeFileActivityMethod = getResumeFileActivityMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ResumeFileActivity")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ResumeFileActivityRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ResumeFileActivityResponse.getDefaultInstance())) - .setSchemaDescriptor(new FileReplicationServiceMethodDescriptorSupplier("ResumeFileActivity")) - .build(); - } - } - } - return getResumeFileActivityMethod; - } - - private static volatile io.grpc.MethodDescriptor getListFilesMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListFiles", - requestType = io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ListFilesRequest.class, - responseType = io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ListFilesResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getListFilesMethod() { - io.grpc.MethodDescriptor getListFilesMethod; - if ((getListFilesMethod = FileReplicationServiceGrpc.getListFilesMethod) == null) { - synchronized (FileReplicationServiceGrpc.class) { - if ((getListFilesMethod = FileReplicationServiceGrpc.getListFilesMethod) == null) { - FileReplicationServiceGrpc.getListFilesMethod = getListFilesMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListFiles")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ListFilesRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ListFilesResponse.getDefaultInstance())) - .setSchemaDescriptor(new FileReplicationServiceMethodDescriptorSupplier("ListFiles")) - .build(); - } - } - } - return getListFilesMethod; - } - - private static volatile io.grpc.MethodDescriptor getGetFileMetadataMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetFileMetadata", - requestType = io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.GetFileMetadataRequest.class, - responseType = io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.FileMetadata.class, - methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - public static io.grpc.MethodDescriptor getGetFileMetadataMethod() { - io.grpc.MethodDescriptor getGetFileMetadataMethod; - if ((getGetFileMetadataMethod = FileReplicationServiceGrpc.getGetFileMetadataMethod) == null) { - synchronized (FileReplicationServiceGrpc.class) { - if ((getGetFileMetadataMethod = FileReplicationServiceGrpc.getGetFileMetadataMethod) == null) { - FileReplicationServiceGrpc.getGetFileMetadataMethod = getGetFileMetadataMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetFileMetadata")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.GetFileMetadataRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.FileMetadata.getDefaultInstance())) - .setSchemaDescriptor(new FileReplicationServiceMethodDescriptorSupplier("GetFileMetadata")) - .build(); - } - } - } - return getGetFileMetadataMethod; - } - - private static volatile io.grpc.MethodDescriptor getGetFileMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetFile", - requestType = io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.GetFileRequest.class, - responseType = io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.FileChunk.class, - methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - public static io.grpc.MethodDescriptor getGetFileMethod() { - io.grpc.MethodDescriptor getGetFileMethod; - if ((getGetFileMethod = FileReplicationServiceGrpc.getGetFileMethod) == null) { - synchronized (FileReplicationServiceGrpc.class) { - if ((getGetFileMethod = FileReplicationServiceGrpc.getGetFileMethod) == null) { - FileReplicationServiceGrpc.getGetFileMethod = getGetFileMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetFile")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.GetFileRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.FileChunk.getDefaultInstance())) - .setSchemaDescriptor(new FileReplicationServiceMethodDescriptorSupplier("GetFile")) - .build(); - } - } - } - return getGetFileMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static FileReplicationServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public FileReplicationServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new FileReplicationServiceStub(channel, callOptions); - } - }; - return FileReplicationServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static FileReplicationServiceBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public FileReplicationServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new FileReplicationServiceBlockingStub(channel, callOptions); - } - }; - return FileReplicationServiceBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static FileReplicationServiceFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public FileReplicationServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new FileReplicationServiceFutureStub(channel, callOptions); - } - }; - return FileReplicationServiceFutureStub.newStub(factory, channel); - } - - /** - */ - public interface AsyncService { - - /** - */ - default void pauseFileActivity(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.PauseFileActivityRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPauseFileActivityMethod(), responseObserver); - } - - /** - */ - default void resumeFileActivity(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ResumeFileActivityRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getResumeFileActivityMethod(), responseObserver); - } - - /** - */ - default void listFiles(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ListFilesRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListFilesMethod(), responseObserver); - } - - /** - */ - default io.grpc.stub.StreamObserver getFileMetadata( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getGetFileMetadataMethod(), responseObserver); - } - - /** - */ - default io.grpc.stub.StreamObserver getFile( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getGetFileMethod(), responseObserver); - } - } - - /** - * Base class for the server implementation of the service FileReplicationService. - */ - public static abstract class FileReplicationServiceImplBase - implements io.grpc.BindableService, AsyncService { - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return FileReplicationServiceGrpc.bindService(this); - } - } - - /** - * A stub to allow clients to do asynchronous rpc calls to service FileReplicationService. - */ - public static final class FileReplicationServiceStub - extends io.grpc.stub.AbstractAsyncStub { - private FileReplicationServiceStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected FileReplicationServiceStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new FileReplicationServiceStub(channel, callOptions); - } - - /** - */ - public void pauseFileActivity(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.PauseFileActivityRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getPauseFileActivityMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void resumeFileActivity(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ResumeFileActivityRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getResumeFileActivityMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void listFiles(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ListFilesRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListFilesMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public io.grpc.stub.StreamObserver getFileMetadata( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( - getChannel().newCall(getGetFileMetadataMethod(), getCallOptions()), responseObserver); - } - - /** - */ - public io.grpc.stub.StreamObserver getFile( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( - getChannel().newCall(getGetFileMethod(), getCallOptions()), responseObserver); - } - } - - /** - * A stub to allow clients to do synchronous rpc calls to service FileReplicationService. - */ - public static final class FileReplicationServiceBlockingStub - extends io.grpc.stub.AbstractBlockingStub { - private FileReplicationServiceBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected FileReplicationServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new FileReplicationServiceBlockingStub(channel, callOptions); - } - - /** - */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.PauseFileActivityResponse pauseFileActivity(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.PauseFileActivityRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getPauseFileActivityMethod(), getCallOptions(), request); - } - - /** - */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ResumeFileActivityResponse resumeFileActivity(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ResumeFileActivityRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getResumeFileActivityMethod(), getCallOptions(), request); - } - - /** - */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ListFilesResponse listFiles(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ListFilesRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListFilesMethod(), getCallOptions(), request); - } - } - - /** - * A stub to allow clients to do ListenableFuture-style rpc calls to service FileReplicationService. - */ - public static final class FileReplicationServiceFutureStub - extends io.grpc.stub.AbstractFutureStub { - private FileReplicationServiceFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected FileReplicationServiceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new FileReplicationServiceFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture pauseFileActivity( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.PauseFileActivityRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getPauseFileActivityMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture resumeFileActivity( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ResumeFileActivityRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getResumeFileActivityMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture listFiles( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ListFilesRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListFilesMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_PAUSE_FILE_ACTIVITY = 0; - private static final int METHODID_RESUME_FILE_ACTIVITY = 1; - private static final int METHODID_LIST_FILES = 2; - private static final int METHODID_GET_FILE_METADATA = 3; - private static final int METHODID_GET_FILE = 4; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final AsyncService serviceImpl; - private final int methodId; - - MethodHandlers(AsyncService serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_PAUSE_FILE_ACTIVITY: - serviceImpl.pauseFileActivity((io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.PauseFileActivityRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_RESUME_FILE_ACTIVITY: - serviceImpl.resumeFileActivity((io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ResumeFileActivityRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_LIST_FILES: - serviceImpl.listFiles((io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ListFilesRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_GET_FILE_METADATA: - return (io.grpc.stub.StreamObserver) serviceImpl.getFileMetadata( - (io.grpc.stub.StreamObserver) responseObserver); - case METHODID_GET_FILE: - return (io.grpc.stub.StreamObserver) serviceImpl.getFile( - (io.grpc.stub.StreamObserver) responseObserver); - default: - throw new AssertionError(); - } - } - } - - public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getPauseFileActivityMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.PauseFileActivityRequest, - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.PauseFileActivityResponse>( - service, METHODID_PAUSE_FILE_ACTIVITY))) - .addMethod( - getResumeFileActivityMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ResumeFileActivityRequest, - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ResumeFileActivityResponse>( - service, METHODID_RESUME_FILE_ACTIVITY))) - .addMethod( - getListFilesMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ListFilesRequest, - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.ListFilesResponse>( - service, METHODID_LIST_FILES))) - .addMethod( - getGetFileMetadataMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.GetFileMetadataRequest, - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.FileMetadata>( - service, METHODID_GET_FILE_METADATA))) - .addMethod( - getGetFileMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.GetFileRequest, - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.FileChunk>( - service, METHODID_GET_FILE))) - .build(); - } - - private static abstract class FileReplicationServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - FileReplicationServiceBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoFileReplication.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("FileReplicationService"); - } - } - - private static final class FileReplicationServiceFileDescriptorSupplier - extends FileReplicationServiceBaseDescriptorSupplier { - FileReplicationServiceFileDescriptorSupplier() {} - } - - private static final class FileReplicationServiceMethodDescriptorSupplier - extends FileReplicationServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final java.lang.String methodName; - - FileReplicationServiceMethodDescriptorSupplier(java.lang.String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (FileReplicationServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new FileReplicationServiceFileDescriptorSupplier()) - .addMethod(getPauseFileActivityMethod()) - .addMethod(getResumeFileActivityMethod()) - .addMethod(getListFilesMethod()) - .addMethod(getGetFileMetadataMethod()) - .addMethod(getGetFileMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/src/main/java/io/weaviate/client6/v1/internal/grpc/protocol/WeaviateProtoBaseSearch.java b/src/main/java/io/weaviate/client6/v1/internal/grpc/protocol/WeaviateProtoBaseSearch.java index 18fd8c2cf..0941aadd5 100644 --- a/src/main/java/io/weaviate/client6/v1/internal/grpc/protocol/WeaviateProtoBaseSearch.java +++ b/src/main/java/io/weaviate/client6/v1/internal/grpc/protocol/WeaviateProtoBaseSearch.java @@ -2918,6 +2918,1317 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Vec } + public interface SelectionOrBuilder extends + // @@protoc_insertion_point(interface_extends:weaviate.v1.Selection) + com.google.protobuf.MessageOrBuilder { + + /** + * .weaviate.v1.Selection.MMR mmr = 1; + * @return Whether the mmr field is set. + */ + boolean hasMmr(); + /** + * .weaviate.v1.Selection.MMR mmr = 1; + * @return The mmr. + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR getMmr(); + /** + * .weaviate.v1.Selection.MMR mmr = 1; + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMROrBuilder getMmrOrBuilder(); + + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.SelectionCase getSelectionCase(); + } + /** + * Protobuf type {@code weaviate.v1.Selection} + */ + public static final class Selection extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:weaviate.v1.Selection) + SelectionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Selection.newBuilder() to construct. + private Selection(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Selection() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Selection(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.internal_static_weaviate_v1_Selection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.internal_static_weaviate_v1_Selection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.class, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder.class); + } + + public interface MMROrBuilder extends + // @@protoc_insertion_point(interface_extends:weaviate.v1.Selection.MMR) + com.google.protobuf.MessageOrBuilder { + + /** + * optional uint32 limit = 1; + * @return Whether the limit field is set. + */ + boolean hasLimit(); + /** + * optional uint32 limit = 1; + * @return The limit. + */ + int getLimit(); + + /** + * optional float balance = 2; + * @return Whether the balance field is set. + */ + boolean hasBalance(); + /** + * optional float balance = 2; + * @return The balance. + */ + float getBalance(); + } + /** + * Protobuf type {@code weaviate.v1.Selection.MMR} + */ + public static final class MMR extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:weaviate.v1.Selection.MMR) + MMROrBuilder { + private static final long serialVersionUID = 0L; + // Use MMR.newBuilder() to construct. + private MMR(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private MMR() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new MMR(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.internal_static_weaviate_v1_Selection_MMR_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.internal_static_weaviate_v1_Selection_MMR_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR.class, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR.Builder.class); + } + + private int bitField0_; + public static final int LIMIT_FIELD_NUMBER = 1; + private int limit_ = 0; + /** + * optional uint32 limit = 1; + * @return Whether the limit field is set. + */ + @java.lang.Override + public boolean hasLimit() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional uint32 limit = 1; + * @return The limit. + */ + @java.lang.Override + public int getLimit() { + return limit_; + } + + public static final int BALANCE_FIELD_NUMBER = 2; + private float balance_ = 0F; + /** + * optional float balance = 2; + * @return Whether the balance field is set. + */ + @java.lang.Override + public boolean hasBalance() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional float balance = 2; + * @return The balance. + */ + @java.lang.Override + public float getBalance() { + return balance_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeUInt32(1, limit_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeFloat(2, balance_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, limit_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, balance_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR)) { + return super.equals(obj); + } + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR other = (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR) obj; + + if (hasLimit() != other.hasLimit()) return false; + if (hasLimit()) { + if (getLimit() + != other.getLimit()) return false; + } + if (hasBalance() != other.hasBalance()) return false; + if (hasBalance()) { + if (java.lang.Float.floatToIntBits(getBalance()) + != java.lang.Float.floatToIntBits( + other.getBalance())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasLimit()) { + hash = (37 * hash) + LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getLimit(); + } + if (hasBalance()) { + hash = (37 * hash) + BALANCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getBalance()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code weaviate.v1.Selection.MMR} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:weaviate.v1.Selection.MMR) + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMROrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.internal_static_weaviate_v1_Selection_MMR_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.internal_static_weaviate_v1_Selection_MMR_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR.class, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR.Builder.class); + } + + // Construct using io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + limit_ = 0; + balance_ = 0F; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.internal_static_weaviate_v1_Selection_MMR_descriptor; + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR getDefaultInstanceForType() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR.getDefaultInstance(); + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR build() { + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR buildPartial() { + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR result = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.limit_ = limit_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.balance_ = balance_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR) { + return mergeFrom((io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR other) { + if (other == io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR.getDefaultInstance()) return this; + if (other.hasLimit()) { + setLimit(other.getLimit()); + } + if (other.hasBalance()) { + setBalance(other.getBalance()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + limit_ = input.readUInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 21: { + balance_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int limit_ ; + /** + * optional uint32 limit = 1; + * @return Whether the limit field is set. + */ + @java.lang.Override + public boolean hasLimit() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional uint32 limit = 1; + * @return The limit. + */ + @java.lang.Override + public int getLimit() { + return limit_; + } + /** + * optional uint32 limit = 1; + * @param value The limit to set. + * @return This builder for chaining. + */ + public Builder setLimit(int value) { + + limit_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional uint32 limit = 1; + * @return This builder for chaining. + */ + public Builder clearLimit() { + bitField0_ = (bitField0_ & ~0x00000001); + limit_ = 0; + onChanged(); + return this; + } + + private float balance_ ; + /** + * optional float balance = 2; + * @return Whether the balance field is set. + */ + @java.lang.Override + public boolean hasBalance() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional float balance = 2; + * @return The balance. + */ + @java.lang.Override + public float getBalance() { + return balance_; + } + /** + * optional float balance = 2; + * @param value The balance to set. + * @return This builder for chaining. + */ + public Builder setBalance(float value) { + + balance_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * optional float balance = 2; + * @return This builder for chaining. + */ + public Builder clearBalance() { + bitField0_ = (bitField0_ & ~0x00000002); + balance_ = 0F; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:weaviate.v1.Selection.MMR) + } + + // @@protoc_insertion_point(class_scope:weaviate.v1.Selection.MMR) + private static final io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR(); + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MMR parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int selectionCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object selection_; + public enum SelectionCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MMR(1), + SELECTION_NOT_SET(0); + private final int value; + private SelectionCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SelectionCase valueOf(int value) { + return forNumber(value); + } + + public static SelectionCase forNumber(int value) { + switch (value) { + case 1: return MMR; + case 0: return SELECTION_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public SelectionCase + getSelectionCase() { + return SelectionCase.forNumber( + selectionCase_); + } + + public static final int MMR_FIELD_NUMBER = 1; + /** + * .weaviate.v1.Selection.MMR mmr = 1; + * @return Whether the mmr field is set. + */ + @java.lang.Override + public boolean hasMmr() { + return selectionCase_ == 1; + } + /** + * .weaviate.v1.Selection.MMR mmr = 1; + * @return The mmr. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR getMmr() { + if (selectionCase_ == 1) { + return (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR) selection_; + } + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR.getDefaultInstance(); + } + /** + * .weaviate.v1.Selection.MMR mmr = 1; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMROrBuilder getMmrOrBuilder() { + if (selectionCase_ == 1) { + return (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR) selection_; + } + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (selectionCase_ == 1) { + output.writeMessage(1, (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR) selection_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (selectionCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR) selection_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection)) { + return super.equals(obj); + } + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection other = (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection) obj; + + if (!getSelectionCase().equals(other.getSelectionCase())) return false; + switch (selectionCase_) { + case 1: + if (!getMmr() + .equals(other.getMmr())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (selectionCase_) { + case 1: + hash = (37 * hash) + MMR_FIELD_NUMBER; + hash = (53 * hash) + getMmr().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code weaviate.v1.Selection} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:weaviate.v1.Selection) + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.internal_static_weaviate_v1_Selection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.internal_static_weaviate_v1_Selection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.class, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder.class); + } + + // Construct using io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (mmrBuilder_ != null) { + mmrBuilder_.clear(); + } + selectionCase_ = 0; + selection_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.internal_static_weaviate_v1_Selection_descriptor; + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getDefaultInstanceForType() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance(); + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection build() { + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection buildPartial() { + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection result = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection result) { + result.selectionCase_ = selectionCase_; + result.selection_ = this.selection_; + if (selectionCase_ == 1 && + mmrBuilder_ != null) { + result.selection_ = mmrBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection) { + return mergeFrom((io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection other) { + if (other == io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance()) return this; + switch (other.getSelectionCase()) { + case MMR: { + mergeMmr(other.getMmr()); + break; + } + case SELECTION_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getMmrFieldBuilder().getBuilder(), + extensionRegistry); + selectionCase_ = 1; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int selectionCase_ = 0; + private java.lang.Object selection_; + public SelectionCase + getSelectionCase() { + return SelectionCase.forNumber( + selectionCase_); + } + + public Builder clearSelection() { + selectionCase_ = 0; + selection_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMROrBuilder> mmrBuilder_; + /** + * .weaviate.v1.Selection.MMR mmr = 1; + * @return Whether the mmr field is set. + */ + @java.lang.Override + public boolean hasMmr() { + return selectionCase_ == 1; + } + /** + * .weaviate.v1.Selection.MMR mmr = 1; + * @return The mmr. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR getMmr() { + if (mmrBuilder_ == null) { + if (selectionCase_ == 1) { + return (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR) selection_; + } + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR.getDefaultInstance(); + } else { + if (selectionCase_ == 1) { + return mmrBuilder_.getMessage(); + } + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR.getDefaultInstance(); + } + } + /** + * .weaviate.v1.Selection.MMR mmr = 1; + */ + public Builder setMmr(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR value) { + if (mmrBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + selection_ = value; + onChanged(); + } else { + mmrBuilder_.setMessage(value); + } + selectionCase_ = 1; + return this; + } + /** + * .weaviate.v1.Selection.MMR mmr = 1; + */ + public Builder setMmr( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR.Builder builderForValue) { + if (mmrBuilder_ == null) { + selection_ = builderForValue.build(); + onChanged(); + } else { + mmrBuilder_.setMessage(builderForValue.build()); + } + selectionCase_ = 1; + return this; + } + /** + * .weaviate.v1.Selection.MMR mmr = 1; + */ + public Builder mergeMmr(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR value) { + if (mmrBuilder_ == null) { + if (selectionCase_ == 1 && + selection_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR.getDefaultInstance()) { + selection_ = io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR.newBuilder((io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR) selection_) + .mergeFrom(value).buildPartial(); + } else { + selection_ = value; + } + onChanged(); + } else { + if (selectionCase_ == 1) { + mmrBuilder_.mergeFrom(value); + } else { + mmrBuilder_.setMessage(value); + } + } + selectionCase_ = 1; + return this; + } + /** + * .weaviate.v1.Selection.MMR mmr = 1; + */ + public Builder clearMmr() { + if (mmrBuilder_ == null) { + if (selectionCase_ == 1) { + selectionCase_ = 0; + selection_ = null; + onChanged(); + } + } else { + if (selectionCase_ == 1) { + selectionCase_ = 0; + selection_ = null; + } + mmrBuilder_.clear(); + } + return this; + } + /** + * .weaviate.v1.Selection.MMR mmr = 1; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR.Builder getMmrBuilder() { + return getMmrFieldBuilder().getBuilder(); + } + /** + * .weaviate.v1.Selection.MMR mmr = 1; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMROrBuilder getMmrOrBuilder() { + if ((selectionCase_ == 1) && (mmrBuilder_ != null)) { + return mmrBuilder_.getMessageOrBuilder(); + } else { + if (selectionCase_ == 1) { + return (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR) selection_; + } + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR.getDefaultInstance(); + } + } + /** + * .weaviate.v1.Selection.MMR mmr = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMROrBuilder> + getMmrFieldBuilder() { + if (mmrBuilder_ == null) { + if (!(selectionCase_ == 1)) { + selection_ = io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR.getDefaultInstance(); + } + mmrBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMROrBuilder>( + (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.MMR) selection_, + getParentForChildren(), + isClean()); + selection_ = null; + } + selectionCase_ = 1; + onChanged(); + return mmrBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:weaviate.v1.Selection) + } + + // @@protoc_insertion_point(class_scope:weaviate.v1.Selection) + private static final io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection(); + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Selection parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + public interface SearchOperatorOptionsOrBuilder extends // @@protoc_insertion_point(interface_extends:weaviate.v1.SearchOperatorOptions) com.google.protobuf.MessageOrBuilder { @@ -3694,7 +5005,7 @@ public interface HybridOrBuilder extends * * repeated float vector = 3 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.vector is deprecated. - * See v1/base_search.proto;l=51 + * See v1/base_search.proto;l=60 * @return A list containing the vector. */ @java.lang.Deprecated java.util.List getVectorList(); @@ -3705,7 +5016,7 @@ public interface HybridOrBuilder extends * * repeated float vector = 3 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.vector is deprecated. - * See v1/base_search.proto;l=51 + * See v1/base_search.proto;l=60 * @return The count of vector. */ @java.lang.Deprecated int getVectorCount(); @@ -3716,17 +5027,23 @@ public interface HybridOrBuilder extends * * repeated float vector = 3 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.vector is deprecated. - * See v1/base_search.proto;l=51 + * See v1/base_search.proto;l=60 * @param index The index of the element to return. * @return The vector at the given index. */ @java.lang.Deprecated float getVector(int index); /** - * float alpha = 4; + *

+     * deprecated in 1.36.0 - use alpha_param
+     * 
+ * + * float alpha = 4 [deprecated = true]; + * @deprecated weaviate.v1.Hybrid.alpha is deprecated. + * See v1/base_search.proto;l=61 * @return The alpha. */ - float getAlpha(); + @java.lang.Deprecated float getAlpha(); /** * .weaviate.v1.Hybrid.FusionType fusion_type = 5; @@ -3746,7 +5063,7 @@ public interface HybridOrBuilder extends * * bytes vector_bytes = 6 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.vector_bytes is deprecated. - * See v1/base_search.proto;l=60 + * See v1/base_search.proto;l=68 * @return The vectorBytes. */ @java.lang.Deprecated com.google.protobuf.ByteString getVectorBytes(); @@ -3758,7 +5075,7 @@ public interface HybridOrBuilder extends * * repeated string target_vectors = 7 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.target_vectors is deprecated. - * See v1/base_search.proto;l=62 + * See v1/base_search.proto;l=69 * @return A list containing the targetVectors. */ @java.lang.Deprecated java.util.List @@ -3770,7 +5087,7 @@ public interface HybridOrBuilder extends * * repeated string target_vectors = 7 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.target_vectors is deprecated. - * See v1/base_search.proto;l=62 + * See v1/base_search.proto;l=69 * @return The count of targetVectors. */ @java.lang.Deprecated int getTargetVectorsCount(); @@ -3781,7 +5098,7 @@ public interface HybridOrBuilder extends * * repeated string target_vectors = 7 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.target_vectors is deprecated. - * See v1/base_search.proto;l=62 + * See v1/base_search.proto;l=69 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -3793,7 +5110,7 @@ public interface HybridOrBuilder extends * * repeated string target_vectors = 7 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.target_vectors is deprecated. - * See v1/base_search.proto;l=62 + * See v1/base_search.proto;l=69 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -3884,6 +5201,43 @@ public interface HybridOrBuilder extends */ io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SearchOperatorOptionsOrBuilder getBm25SearchOperatorOrBuilder(); + /** + * optional float alpha_param = 12; + * @return Whether the alphaParam field is set. + */ + boolean hasAlphaParam(); + /** + * optional float alpha_param = 12; + * @return The alphaParam. + */ + float getAlphaParam(); + + /** + *
+     * if true, alpha_param is used instead of alpha.
+     * This is for backward compatibility, as alpha was used before alpha_param was introduced.
+     * 
+ * + * bool use_alpha_param = 13; + * @return The useAlphaParam. + */ + boolean getUseAlphaParam(); + + /** + * optional .weaviate.v1.Selection selection = 14; + * @return Whether the selection field is set. + */ + boolean hasSelection(); + /** + * optional .weaviate.v1.Selection selection = 14; + * @return The selection. + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection(); + /** + * optional .weaviate.v1.Selection selection = 14; + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder(); + /** * float vector_distance = 20; * @return Whether the vectorDistance field is set. @@ -4210,7 +5564,7 @@ public java.lang.String getProperties(int index) { * * repeated float vector = 3 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.vector is deprecated. - * See v1/base_search.proto;l=51 + * See v1/base_search.proto;l=60 * @return A list containing the vector. */ @java.lang.Override @@ -4225,7 +5579,7 @@ public java.lang.String getProperties(int index) { * * repeated float vector = 3 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.vector is deprecated. - * See v1/base_search.proto;l=51 + * See v1/base_search.proto;l=60 * @return The count of vector. */ @java.lang.Deprecated public int getVectorCount() { @@ -4238,7 +5592,7 @@ public java.lang.String getProperties(int index) { * * repeated float vector = 3 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.vector is deprecated. - * See v1/base_search.proto;l=51 + * See v1/base_search.proto;l=60 * @param index The index of the element to return. * @return The vector at the given index. */ @@ -4250,11 +5604,17 @@ public java.lang.String getProperties(int index) { public static final int ALPHA_FIELD_NUMBER = 4; private float alpha_ = 0F; /** - * float alpha = 4; + *
+     * deprecated in 1.36.0 - use alpha_param
+     * 
+ * + * float alpha = 4 [deprecated = true]; + * @deprecated weaviate.v1.Hybrid.alpha is deprecated. + * See v1/base_search.proto;l=61 * @return The alpha. */ @java.lang.Override - public float getAlpha() { + @java.lang.Deprecated public float getAlpha() { return alpha_; } @@ -4285,7 +5645,7 @@ public float getAlpha() { * * bytes vector_bytes = 6 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.vector_bytes is deprecated. - * See v1/base_search.proto;l=60 + * See v1/base_search.proto;l=68 * @return The vectorBytes. */ @java.lang.Override @@ -4304,7 +5664,7 @@ public float getAlpha() { * * repeated string target_vectors = 7 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.target_vectors is deprecated. - * See v1/base_search.proto;l=62 + * See v1/base_search.proto;l=69 * @return A list containing the targetVectors. */ @java.lang.Deprecated public com.google.protobuf.ProtocolStringList @@ -4318,7 +5678,7 @@ public float getAlpha() { * * repeated string target_vectors = 7 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.target_vectors is deprecated. - * See v1/base_search.proto;l=62 + * See v1/base_search.proto;l=69 * @return The count of targetVectors. */ @java.lang.Deprecated public int getTargetVectorsCount() { @@ -4331,7 +5691,7 @@ public float getAlpha() { * * repeated string target_vectors = 7 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.target_vectors is deprecated. - * See v1/base_search.proto;l=62 + * See v1/base_search.proto;l=69 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -4345,7 +5705,7 @@ public float getAlpha() { * * repeated string target_vectors = 7 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.target_vectors is deprecated. - * See v1/base_search.proto;l=62 + * See v1/base_search.proto;l=69 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -4482,6 +5842,67 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Sea return bm25SearchOperator_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SearchOperatorOptions.getDefaultInstance() : bm25SearchOperator_; } + public static final int ALPHA_PARAM_FIELD_NUMBER = 12; + private float alphaParam_ = 0F; + /** + * optional float alpha_param = 12; + * @return Whether the alphaParam field is set. + */ + @java.lang.Override + public boolean hasAlphaParam() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * optional float alpha_param = 12; + * @return The alphaParam. + */ + @java.lang.Override + public float getAlphaParam() { + return alphaParam_; + } + + public static final int USE_ALPHA_PARAM_FIELD_NUMBER = 13; + private boolean useAlphaParam_ = false; + /** + *
+     * if true, alpha_param is used instead of alpha.
+     * This is for backward compatibility, as alpha was used before alpha_param was introduced.
+     * 
+ * + * bool use_alpha_param = 13; + * @return The useAlphaParam. + */ + @java.lang.Override + public boolean getUseAlphaParam() { + return useAlphaParam_; + } + + public static final int SELECTION_FIELD_NUMBER = 14; + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection selection_; + /** + * optional .weaviate.v1.Selection selection = 14; + * @return Whether the selection field is set. + */ + @java.lang.Override + public boolean hasSelection() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional .weaviate.v1.Selection selection = 14; + * @return The selection. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection() { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + /** + * optional .weaviate.v1.Selection selection = 14; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder() { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + public static final int VECTOR_DISTANCE_FIELD_NUMBER = 20; /** * float vector_distance = 20; @@ -4596,6 +6017,15 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000008) != 0)) { output.writeMessage(11, getBm25SearchOperator()); } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeFloat(12, alphaParam_); + } + if (useAlphaParam_ != false) { + output.writeBool(13, useAlphaParam_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(14, getSelection()); + } if (thresholdCase_ == 20) { output.writeFloat( 20, (float)((java.lang.Float) threshold_)); @@ -4670,6 +6100,18 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(11, getBm25SearchOperator()); } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(12, alphaParam_); + } + if (useAlphaParam_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(13, useAlphaParam_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(14, getSelection()); + } if (thresholdCase_ == 20) { size += com.google.protobuf.CodedOutputStream .computeFloatSize( @@ -4728,6 +6170,19 @@ public boolean equals(final java.lang.Object obj) { if (!getBm25SearchOperator() .equals(other.getBm25SearchOperator())) return false; } + if (hasAlphaParam() != other.hasAlphaParam()) return false; + if (hasAlphaParam()) { + if (java.lang.Float.floatToIntBits(getAlphaParam()) + != java.lang.Float.floatToIntBits( + other.getAlphaParam())) return false; + } + if (getUseAlphaParam() + != other.getUseAlphaParam()) return false; + if (hasSelection() != other.hasSelection()) return false; + if (hasSelection()) { + if (!getSelection() + .equals(other.getSelection())) return false; + } if (!getVectorsList() .equals(other.getVectorsList())) return false; if (!getThresholdCase().equals(other.getThresholdCase())) return false; @@ -4788,6 +6243,18 @@ public int hashCode() { hash = (37 * hash) + BM25_SEARCH_OPERATOR_FIELD_NUMBER; hash = (53 * hash) + getBm25SearchOperator().hashCode(); } + if (hasAlphaParam()) { + hash = (37 * hash) + ALPHA_PARAM_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getAlphaParam()); + } + hash = (37 * hash) + USE_ALPHA_PARAM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUseAlphaParam()); + if (hasSelection()) { + hash = (37 * hash) + SELECTION_FIELD_NUMBER; + hash = (53 * hash) + getSelection().hashCode(); + } if (getVectorsCount() > 0) { hash = (37 * hash) + VECTORS_FIELD_NUMBER; hash = (53 * hash) + getVectorsList().hashCode(); @@ -4935,6 +6402,7 @@ private void maybeForceBuilderInitialization() { getNearVectorFieldBuilder(); getTargetsFieldBuilder(); getBm25SearchOperatorFieldBuilder(); + getSelectionFieldBuilder(); getVectorsFieldBuilder(); } } @@ -4971,13 +6439,20 @@ public Builder clear() { bm25SearchOperatorBuilder_.dispose(); bm25SearchOperatorBuilder_ = null; } + alphaParam_ = 0F; + useAlphaParam_ = false; + selection_ = null; + if (selectionBuilder_ != null) { + selectionBuilder_.dispose(); + selectionBuilder_ = null; + } if (vectorsBuilder_ == null) { vectors_ = java.util.Collections.emptyList(); } else { vectors_ = null; vectorsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00001000); + bitField0_ = (bitField0_ & ~0x00008000); thresholdCase_ = 0; threshold_ = null; return this; @@ -5015,9 +6490,9 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Hyb private void buildPartialRepeatedFields(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Hybrid result) { if (vectorsBuilder_ == null) { - if (((bitField0_ & 0x00001000) != 0)) { + if (((bitField0_ & 0x00008000) != 0)) { vectors_ = java.util.Collections.unmodifiableList(vectors_); - bitField0_ = (bitField0_ & ~0x00001000); + bitField0_ = (bitField0_ & ~0x00008000); } result.vectors_ = vectors_; } else { @@ -5076,6 +6551,19 @@ private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.Weaviat : bm25SearchOperatorBuilder_.build(); to_bitField0_ |= 0x00000008; } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.alphaParam_ = alphaParam_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.useAlphaParam_ = useAlphaParam_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.selection_ = selectionBuilder_ == null + ? selection_ + : selectionBuilder_.build(); + to_bitField0_ |= 0x00000020; + } result.bitField0_ |= to_bitField0_; } @@ -5185,11 +6673,20 @@ public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateP if (other.hasBm25SearchOperator()) { mergeBm25SearchOperator(other.getBm25SearchOperator()); } + if (other.hasAlphaParam()) { + setAlphaParam(other.getAlphaParam()); + } + if (other.getUseAlphaParam() != false) { + setUseAlphaParam(other.getUseAlphaParam()); + } + if (other.hasSelection()) { + mergeSelection(other.getSelection()); + } if (vectorsBuilder_ == null) { if (!other.vectors_.isEmpty()) { if (vectors_.isEmpty()) { vectors_ = other.vectors_; - bitField0_ = (bitField0_ & ~0x00001000); + bitField0_ = (bitField0_ & ~0x00008000); } else { ensureVectorsIsMutable(); vectors_.addAll(other.vectors_); @@ -5202,7 +6699,7 @@ public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateP vectorsBuilder_.dispose(); vectorsBuilder_ = null; vectors_ = other.vectors_; - bitField0_ = (bitField0_ & ~0x00001000); + bitField0_ = (bitField0_ & ~0x00008000); vectorsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getVectorsFieldBuilder() : null; @@ -5323,6 +6820,23 @@ public Builder mergeFrom( bitField0_ |= 0x00000400; break; } // case 90 + case 101: { + alphaParam_ = input.readFloat(); + bitField0_ |= 0x00000800; + break; + } // case 101 + case 104: { + useAlphaParam_ = input.readBool(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 114: { + input.readMessage( + getSelectionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 114 case 165: { threshold_ = input.readFloat(); thresholdCase_ = 20; @@ -5576,7 +7090,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 3 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.vector is deprecated. - * See v1/base_search.proto;l=51 + * See v1/base_search.proto;l=60 * @return A list containing the vector. */ @java.lang.Deprecated public java.util.List @@ -5591,7 +7105,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 3 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.vector is deprecated. - * See v1/base_search.proto;l=51 + * See v1/base_search.proto;l=60 * @return The count of vector. */ @java.lang.Deprecated public int getVectorCount() { @@ -5604,7 +7118,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 3 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.vector is deprecated. - * See v1/base_search.proto;l=51 + * See v1/base_search.proto;l=60 * @param index The index of the element to return. * @return The vector at the given index. */ @@ -5618,7 +7132,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 3 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.vector is deprecated. - * See v1/base_search.proto;l=51 + * See v1/base_search.proto;l=60 * @param index The index to set the value at. * @param value The vector to set. * @return This builder for chaining. @@ -5639,7 +7153,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 3 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.vector is deprecated. - * See v1/base_search.proto;l=51 + * See v1/base_search.proto;l=60 * @param value The vector to add. * @return This builder for chaining. */ @@ -5658,7 +7172,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 3 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.vector is deprecated. - * See v1/base_search.proto;l=51 + * See v1/base_search.proto;l=60 * @param values The vector to add. * @return This builder for chaining. */ @@ -5678,7 +7192,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 3 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.vector is deprecated. - * See v1/base_search.proto;l=51 + * See v1/base_search.proto;l=60 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearVector() { @@ -5690,19 +7204,31 @@ private void ensureVectorIsMutable(int capacity) { private float alpha_ ; /** - * float alpha = 4; + *
+       * deprecated in 1.36.0 - use alpha_param
+       * 
+ * + * float alpha = 4 [deprecated = true]; + * @deprecated weaviate.v1.Hybrid.alpha is deprecated. + * See v1/base_search.proto;l=61 * @return The alpha. */ @java.lang.Override - public float getAlpha() { + @java.lang.Deprecated public float getAlpha() { return alpha_; } /** - * float alpha = 4; + *
+       * deprecated in 1.36.0 - use alpha_param
+       * 
+ * + * float alpha = 4 [deprecated = true]; + * @deprecated weaviate.v1.Hybrid.alpha is deprecated. + * See v1/base_search.proto;l=61 * @param value The alpha to set. * @return This builder for chaining. */ - public Builder setAlpha(float value) { + @java.lang.Deprecated public Builder setAlpha(float value) { alpha_ = value; bitField0_ |= 0x00000008; @@ -5710,10 +7236,16 @@ public Builder setAlpha(float value) { return this; } /** - * float alpha = 4; + *
+       * deprecated in 1.36.0 - use alpha_param
+       * 
+ * + * float alpha = 4 [deprecated = true]; + * @deprecated weaviate.v1.Hybrid.alpha is deprecated. + * See v1/base_search.proto;l=61 * @return This builder for chaining. */ - public Builder clearAlpha() { + @java.lang.Deprecated public Builder clearAlpha() { bitField0_ = (bitField0_ & ~0x00000008); alpha_ = 0F; onChanged(); @@ -5781,7 +7313,7 @@ public Builder clearFusionType() { * * bytes vector_bytes = 6 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.vector_bytes is deprecated. - * See v1/base_search.proto;l=60 + * See v1/base_search.proto;l=68 * @return The vectorBytes. */ @java.lang.Override @@ -5795,7 +7327,7 @@ public Builder clearFusionType() { * * bytes vector_bytes = 6 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.vector_bytes is deprecated. - * See v1/base_search.proto;l=60 + * See v1/base_search.proto;l=68 * @param value The vectorBytes to set. * @return This builder for chaining. */ @@ -5813,7 +7345,7 @@ public Builder clearFusionType() { * * bytes vector_bytes = 6 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.vector_bytes is deprecated. - * See v1/base_search.proto;l=60 + * See v1/base_search.proto;l=68 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearVectorBytes() { @@ -5838,7 +7370,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 7 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.target_vectors is deprecated. - * See v1/base_search.proto;l=62 + * See v1/base_search.proto;l=69 * @return A list containing the targetVectors. */ @java.lang.Deprecated public com.google.protobuf.ProtocolStringList @@ -5853,7 +7385,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 7 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.target_vectors is deprecated. - * See v1/base_search.proto;l=62 + * See v1/base_search.proto;l=69 * @return The count of targetVectors. */ @java.lang.Deprecated public int getTargetVectorsCount() { @@ -5866,7 +7398,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 7 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.target_vectors is deprecated. - * See v1/base_search.proto;l=62 + * See v1/base_search.proto;l=69 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -5880,7 +7412,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 7 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.target_vectors is deprecated. - * See v1/base_search.proto;l=62 + * See v1/base_search.proto;l=69 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -5895,7 +7427,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 7 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.target_vectors is deprecated. - * See v1/base_search.proto;l=62 + * See v1/base_search.proto;l=69 * @param index The index to set the value at. * @param value The targetVectors to set. * @return This builder for chaining. @@ -5916,7 +7448,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 7 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.target_vectors is deprecated. - * See v1/base_search.proto;l=62 + * See v1/base_search.proto;l=69 * @param value The targetVectors to add. * @return This builder for chaining. */ @@ -5936,7 +7468,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 7 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.target_vectors is deprecated. - * See v1/base_search.proto;l=62 + * See v1/base_search.proto;l=69 * @param values The targetVectors to add. * @return This builder for chaining. */ @@ -5956,7 +7488,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 7 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.target_vectors is deprecated. - * See v1/base_search.proto;l=62 + * See v1/base_search.proto;l=69 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearTargetVectors() { @@ -5973,7 +7505,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 7 [deprecated = true]; * @deprecated weaviate.v1.Hybrid.target_vectors is deprecated. - * See v1/base_search.proto;l=62 + * See v1/base_search.proto;l=69 * @param value The bytes of the targetVectors to add. * @return This builder for chaining. */ @@ -6544,6 +8076,214 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Sea return bm25SearchOperatorBuilder_; } + private float alphaParam_ ; + /** + * optional float alpha_param = 12; + * @return Whether the alphaParam field is set. + */ + @java.lang.Override + public boolean hasAlphaParam() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * optional float alpha_param = 12; + * @return The alphaParam. + */ + @java.lang.Override + public float getAlphaParam() { + return alphaParam_; + } + /** + * optional float alpha_param = 12; + * @param value The alphaParam to set. + * @return This builder for chaining. + */ + public Builder setAlphaParam(float value) { + + alphaParam_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * optional float alpha_param = 12; + * @return This builder for chaining. + */ + public Builder clearAlphaParam() { + bitField0_ = (bitField0_ & ~0x00000800); + alphaParam_ = 0F; + onChanged(); + return this; + } + + private boolean useAlphaParam_ ; + /** + *
+       * if true, alpha_param is used instead of alpha.
+       * This is for backward compatibility, as alpha was used before alpha_param was introduced.
+       * 
+ * + * bool use_alpha_param = 13; + * @return The useAlphaParam. + */ + @java.lang.Override + public boolean getUseAlphaParam() { + return useAlphaParam_; + } + /** + *
+       * if true, alpha_param is used instead of alpha.
+       * This is for backward compatibility, as alpha was used before alpha_param was introduced.
+       * 
+ * + * bool use_alpha_param = 13; + * @param value The useAlphaParam to set. + * @return This builder for chaining. + */ + public Builder setUseAlphaParam(boolean value) { + + useAlphaParam_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + *
+       * if true, alpha_param is used instead of alpha.
+       * This is for backward compatibility, as alpha was used before alpha_param was introduced.
+       * 
+ * + * bool use_alpha_param = 13; + * @return This builder for chaining. + */ + public Builder clearUseAlphaParam() { + bitField0_ = (bitField0_ & ~0x00001000); + useAlphaParam_ = false; + onChanged(); + return this; + } + + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection selection_; + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder> selectionBuilder_; + /** + * optional .weaviate.v1.Selection selection = 14; + * @return Whether the selection field is set. + */ + public boolean hasSelection() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * optional .weaviate.v1.Selection selection = 14; + * @return The selection. + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection() { + if (selectionBuilder_ == null) { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } else { + return selectionBuilder_.getMessage(); + } + } + /** + * optional .weaviate.v1.Selection selection = 14; + */ + public Builder setSelection(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection value) { + if (selectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + selection_ = value; + } else { + selectionBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 14; + */ + public Builder setSelection( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder builderForValue) { + if (selectionBuilder_ == null) { + selection_ = builderForValue.build(); + } else { + selectionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 14; + */ + public Builder mergeSelection(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection value) { + if (selectionBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) && + selection_ != null && + selection_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance()) { + getSelectionBuilder().mergeFrom(value); + } else { + selection_ = value; + } + } else { + selectionBuilder_.mergeFrom(value); + } + if (selection_ != null) { + bitField0_ |= 0x00002000; + onChanged(); + } + return this; + } + /** + * optional .weaviate.v1.Selection selection = 14; + */ + public Builder clearSelection() { + bitField0_ = (bitField0_ & ~0x00002000); + selection_ = null; + if (selectionBuilder_ != null) { + selectionBuilder_.dispose(); + selectionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 14; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder getSelectionBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getSelectionFieldBuilder().getBuilder(); + } + /** + * optional .weaviate.v1.Selection selection = 14; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder() { + if (selectionBuilder_ != null) { + return selectionBuilder_.getMessageOrBuilder(); + } else { + return selection_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + } + /** + * optional .weaviate.v1.Selection selection = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder> + getSelectionFieldBuilder() { + if (selectionBuilder_ == null) { + selectionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder>( + getSelection(), + getParentForChildren(), + isClean()); + selection_ = null; + } + return selectionBuilder_; + } + /** * float vector_distance = 20; * @return Whether the vectorDistance field is set. @@ -6589,9 +8329,9 @@ public Builder clearVectorDistance() { private java.util.List vectors_ = java.util.Collections.emptyList(); private void ensureVectorsIsMutable() { - if (!((bitField0_ & 0x00001000) != 0)) { + if (!((bitField0_ & 0x00008000) != 0)) { vectors_ = new java.util.ArrayList(vectors_); - bitField0_ |= 0x00001000; + bitField0_ |= 0x00008000; } } @@ -6741,7 +8481,7 @@ public Builder addAllVectors( public Builder clearVectors() { if (vectorsBuilder_ == null) { vectors_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00001000); + bitField0_ = (bitField0_ & ~0x00008000); onChanged(); } else { vectorsBuilder_.clear(); @@ -6818,7 +8558,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.Vectors.B vectorsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.Vectors, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.Vectors.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.VectorsOrBuilder>( vectors_, - ((bitField0_ & 0x00001000) != 0), + ((bitField0_ & 0x00008000) != 0), getParentForChildren(), isClean()); vectors_ = null; @@ -6900,7 +8640,7 @@ public interface NearVectorOrBuilder extends * * repeated float vector = 1 [deprecated = true]; * @deprecated weaviate.v1.NearVector.vector is deprecated. - * See v1/base_search.proto;l=79 + * See v1/base_search.proto;l=90 * @return A list containing the vector. */ @java.lang.Deprecated java.util.List getVectorList(); @@ -6911,7 +8651,7 @@ public interface NearVectorOrBuilder extends * * repeated float vector = 1 [deprecated = true]; * @deprecated weaviate.v1.NearVector.vector is deprecated. - * See v1/base_search.proto;l=79 + * See v1/base_search.proto;l=90 * @return The count of vector. */ @java.lang.Deprecated int getVectorCount(); @@ -6922,7 +8662,7 @@ public interface NearVectorOrBuilder extends * * repeated float vector = 1 [deprecated = true]; * @deprecated weaviate.v1.NearVector.vector is deprecated. - * See v1/base_search.proto;l=79 + * See v1/base_search.proto;l=90 * @param index The index of the element to return. * @return The vector at the given index. */ @@ -6957,7 +8697,7 @@ public interface NearVectorOrBuilder extends * * bytes vector_bytes = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVector.vector_bytes is deprecated. - * See v1/base_search.proto;l=83 + * See v1/base_search.proto;l=93 * @return The vectorBytes. */ @java.lang.Deprecated com.google.protobuf.ByteString getVectorBytes(); @@ -6969,7 +8709,7 @@ public interface NearVectorOrBuilder extends * * repeated string target_vectors = 5 [deprecated = true]; * @deprecated weaviate.v1.NearVector.target_vectors is deprecated. - * See v1/base_search.proto;l=85 + * See v1/base_search.proto;l=94 * @return A list containing the targetVectors. */ @java.lang.Deprecated java.util.List @@ -6981,7 +8721,7 @@ public interface NearVectorOrBuilder extends * * repeated string target_vectors = 5 [deprecated = true]; * @deprecated weaviate.v1.NearVector.target_vectors is deprecated. - * See v1/base_search.proto;l=85 + * See v1/base_search.proto;l=94 * @return The count of targetVectors. */ @java.lang.Deprecated int getTargetVectorsCount(); @@ -6992,7 +8732,7 @@ public interface NearVectorOrBuilder extends * * repeated string target_vectors = 5 [deprecated = true]; * @deprecated weaviate.v1.NearVector.target_vectors is deprecated. - * See v1/base_search.proto;l=85 + * See v1/base_search.proto;l=94 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -7004,7 +8744,7 @@ public interface NearVectorOrBuilder extends * * repeated string target_vectors = 5 [deprecated = true]; * @deprecated weaviate.v1.NearVector.target_vectors is deprecated. - * See v1/base_search.proto;l=85 + * See v1/base_search.proto;l=94 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -7127,6 +8867,21 @@ io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.VectorForT */ io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.VectorsOrBuilder getVectorsOrBuilder( int index); + + /** + * optional .weaviate.v1.Selection selection = 10; + * @return Whether the selection field is set. + */ + boolean hasSelection(); + /** + * optional .weaviate.v1.Selection selection = 10; + * @return The selection. + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection(); + /** + * optional .weaviate.v1.Selection selection = 10; + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder(); } /** * Protobuf type {@code weaviate.v1.NearVector} @@ -7193,7 +8948,7 @@ protected com.google.protobuf.MapField internalGetMapField( * * repeated float vector = 1 [deprecated = true]; * @deprecated weaviate.v1.NearVector.vector is deprecated. - * See v1/base_search.proto;l=79 + * See v1/base_search.proto;l=90 * @return A list containing the vector. */ @java.lang.Override @@ -7208,7 +8963,7 @@ protected com.google.protobuf.MapField internalGetMapField( * * repeated float vector = 1 [deprecated = true]; * @deprecated weaviate.v1.NearVector.vector is deprecated. - * See v1/base_search.proto;l=79 + * See v1/base_search.proto;l=90 * @return The count of vector. */ @java.lang.Deprecated public int getVectorCount() { @@ -7221,7 +8976,7 @@ protected com.google.protobuf.MapField internalGetMapField( * * repeated float vector = 1 [deprecated = true]; * @deprecated weaviate.v1.NearVector.vector is deprecated. - * See v1/base_search.proto;l=79 + * See v1/base_search.proto;l=90 * @param index The index of the element to return. * @return The vector at the given index. */ @@ -7277,7 +9032,7 @@ public double getDistance() { * * bytes vector_bytes = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVector.vector_bytes is deprecated. - * See v1/base_search.proto;l=83 + * See v1/base_search.proto;l=93 * @return The vectorBytes. */ @java.lang.Override @@ -7296,7 +9051,7 @@ public double getDistance() { * * repeated string target_vectors = 5 [deprecated = true]; * @deprecated weaviate.v1.NearVector.target_vectors is deprecated. - * See v1/base_search.proto;l=85 + * See v1/base_search.proto;l=94 * @return A list containing the targetVectors. */ @java.lang.Deprecated public com.google.protobuf.ProtocolStringList @@ -7310,7 +9065,7 @@ public double getDistance() { * * repeated string target_vectors = 5 [deprecated = true]; * @deprecated weaviate.v1.NearVector.target_vectors is deprecated. - * See v1/base_search.proto;l=85 + * See v1/base_search.proto;l=94 * @return The count of targetVectors. */ @java.lang.Deprecated public int getTargetVectorsCount() { @@ -7323,7 +9078,7 @@ public double getDistance() { * * repeated string target_vectors = 5 [deprecated = true]; * @deprecated weaviate.v1.NearVector.target_vectors is deprecated. - * See v1/base_search.proto;l=85 + * See v1/base_search.proto;l=94 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -7337,7 +9092,7 @@ public double getDistance() { * * repeated string target_vectors = 5 [deprecated = true]; * @deprecated weaviate.v1.NearVector.target_vectors is deprecated. - * See v1/base_search.proto;l=85 + * See v1/base_search.proto;l=94 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -7549,6 +9304,32 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.VectorsOr return vectors_.get(index); } + public static final int SELECTION_FIELD_NUMBER = 10; + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection selection_; + /** + * optional .weaviate.v1.Selection selection = 10; + * @return Whether the selection field is set. + */ + @java.lang.Override + public boolean hasSelection() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional .weaviate.v1.Selection selection = 10; + * @return The selection. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection() { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + /** + * optional .weaviate.v1.Selection selection = 10; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder() { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -7598,6 +9379,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) for (int i = 0; i < vectors_.size(); i++) { output.writeMessage(9, vectors_.get(i)); } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(10, getSelection()); + } getUnknownFields().writeTo(output); } @@ -7660,6 +9444,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(9, vectors_.get(i)); } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, getSelection()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -7704,6 +9492,11 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getVectorForTargetsList())) return false; if (!getVectorsList() .equals(other.getVectorsList())) return false; + if (hasSelection() != other.hasSelection()) return false; + if (hasSelection()) { + if (!getSelection() + .equals(other.getSelection())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -7751,6 +9544,10 @@ public int hashCode() { hash = (37 * hash) + VECTORS_FIELD_NUMBER; hash = (53 * hash) + getVectorsList().hashCode(); } + if (hasSelection()) { + hash = (37 * hash) + SELECTION_FIELD_NUMBER; + hash = (53 * hash) + getSelection().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -7906,6 +9703,7 @@ private void maybeForceBuilderInitialization() { getTargetsFieldBuilder(); getVectorForTargetsFieldBuilder(); getVectorsFieldBuilder(); + getSelectionFieldBuilder(); } } @java.lang.Override @@ -7938,6 +9736,11 @@ public Builder clear() { vectorsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000100); + selection_ = null; + if (selectionBuilder_ != null) { + selectionBuilder_.dispose(); + selectionBuilder_ = null; + } return this; } @@ -8023,6 +9826,12 @@ private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.Weaviat result.vectorPerTarget_ = internalGetVectorPerTarget(); result.vectorPerTarget_.makeImmutable(); } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.selection_ = selectionBuilder_ == null + ? selection_ + : selectionBuilder_.build(); + to_bitField0_ |= 0x00000008; + } result.bitField0_ |= to_bitField0_; } @@ -8158,6 +9967,9 @@ public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateP } } } + if (other.hasSelection()) { + mergeSelection(other.getSelection()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -8264,6 +10076,13 @@ public Builder mergeFrom( } break; } // case 74 + case 82: { + input.readMessage( + getSelectionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -8301,7 +10120,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 1 [deprecated = true]; * @deprecated weaviate.v1.NearVector.vector is deprecated. - * See v1/base_search.proto;l=79 + * See v1/base_search.proto;l=90 * @return A list containing the vector. */ @java.lang.Deprecated public java.util.List @@ -8316,7 +10135,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 1 [deprecated = true]; * @deprecated weaviate.v1.NearVector.vector is deprecated. - * See v1/base_search.proto;l=79 + * See v1/base_search.proto;l=90 * @return The count of vector. */ @java.lang.Deprecated public int getVectorCount() { @@ -8329,7 +10148,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 1 [deprecated = true]; * @deprecated weaviate.v1.NearVector.vector is deprecated. - * See v1/base_search.proto;l=79 + * See v1/base_search.proto;l=90 * @param index The index of the element to return. * @return The vector at the given index. */ @@ -8343,7 +10162,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 1 [deprecated = true]; * @deprecated weaviate.v1.NearVector.vector is deprecated. - * See v1/base_search.proto;l=79 + * See v1/base_search.proto;l=90 * @param index The index to set the value at. * @param value The vector to set. * @return This builder for chaining. @@ -8364,7 +10183,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 1 [deprecated = true]; * @deprecated weaviate.v1.NearVector.vector is deprecated. - * See v1/base_search.proto;l=79 + * See v1/base_search.proto;l=90 * @param value The vector to add. * @return This builder for chaining. */ @@ -8383,7 +10202,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 1 [deprecated = true]; * @deprecated weaviate.v1.NearVector.vector is deprecated. - * See v1/base_search.proto;l=79 + * See v1/base_search.proto;l=90 * @param values The vector to add. * @return This builder for chaining. */ @@ -8403,7 +10222,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 1 [deprecated = true]; * @deprecated weaviate.v1.NearVector.vector is deprecated. - * See v1/base_search.proto;l=79 + * See v1/base_search.proto;l=90 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearVector() { @@ -8501,7 +10320,7 @@ public Builder clearDistance() { * * bytes vector_bytes = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVector.vector_bytes is deprecated. - * See v1/base_search.proto;l=83 + * See v1/base_search.proto;l=93 * @return The vectorBytes. */ @java.lang.Override @@ -8515,7 +10334,7 @@ public Builder clearDistance() { * * bytes vector_bytes = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVector.vector_bytes is deprecated. - * See v1/base_search.proto;l=83 + * See v1/base_search.proto;l=93 * @param value The vectorBytes to set. * @return This builder for chaining. */ @@ -8533,7 +10352,7 @@ public Builder clearDistance() { * * bytes vector_bytes = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVector.vector_bytes is deprecated. - * See v1/base_search.proto;l=83 + * See v1/base_search.proto;l=93 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearVectorBytes() { @@ -8558,7 +10377,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 5 [deprecated = true]; * @deprecated weaviate.v1.NearVector.target_vectors is deprecated. - * See v1/base_search.proto;l=85 + * See v1/base_search.proto;l=94 * @return A list containing the targetVectors. */ @java.lang.Deprecated public com.google.protobuf.ProtocolStringList @@ -8573,7 +10392,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 5 [deprecated = true]; * @deprecated weaviate.v1.NearVector.target_vectors is deprecated. - * See v1/base_search.proto;l=85 + * See v1/base_search.proto;l=94 * @return The count of targetVectors. */ @java.lang.Deprecated public int getTargetVectorsCount() { @@ -8586,7 +10405,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 5 [deprecated = true]; * @deprecated weaviate.v1.NearVector.target_vectors is deprecated. - * See v1/base_search.proto;l=85 + * See v1/base_search.proto;l=94 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -8600,7 +10419,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 5 [deprecated = true]; * @deprecated weaviate.v1.NearVector.target_vectors is deprecated. - * See v1/base_search.proto;l=85 + * See v1/base_search.proto;l=94 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -8615,7 +10434,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 5 [deprecated = true]; * @deprecated weaviate.v1.NearVector.target_vectors is deprecated. - * See v1/base_search.proto;l=85 + * See v1/base_search.proto;l=94 * @param index The index to set the value at. * @param value The targetVectors to set. * @return This builder for chaining. @@ -8636,7 +10455,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 5 [deprecated = true]; * @deprecated weaviate.v1.NearVector.target_vectors is deprecated. - * See v1/base_search.proto;l=85 + * See v1/base_search.proto;l=94 * @param value The targetVectors to add. * @return This builder for chaining. */ @@ -8656,7 +10475,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 5 [deprecated = true]; * @deprecated weaviate.v1.NearVector.target_vectors is deprecated. - * See v1/base_search.proto;l=85 + * See v1/base_search.proto;l=94 * @param values The targetVectors to add. * @return This builder for chaining. */ @@ -8676,7 +10495,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 5 [deprecated = true]; * @deprecated weaviate.v1.NearVector.target_vectors is deprecated. - * See v1/base_search.proto;l=85 + * See v1/base_search.proto;l=94 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearTargetVectors() { @@ -8693,7 +10512,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 5 [deprecated = true]; * @deprecated weaviate.v1.NearVector.target_vectors is deprecated. - * See v1/base_search.proto;l=85 + * See v1/base_search.proto;l=94 * @param value The bytes of the targetVectors to add. * @return This builder for chaining. */ @@ -9428,40 +11247,161 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.VectorsOr } } /** - * repeated .weaviate.v1.Vectors vectors = 9; + * repeated .weaviate.v1.Vectors vectors = 9; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.Vectors.Builder addVectorsBuilder() { + return getVectorsFieldBuilder().addBuilder( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.Vectors.getDefaultInstance()); + } + /** + * repeated .weaviate.v1.Vectors vectors = 9; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.Vectors.Builder addVectorsBuilder( + int index) { + return getVectorsFieldBuilder().addBuilder( + index, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.Vectors.getDefaultInstance()); + } + /** + * repeated .weaviate.v1.Vectors vectors = 9; + */ + public java.util.List + getVectorsBuilderList() { + return getVectorsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.Vectors, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.Vectors.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.VectorsOrBuilder> + getVectorsFieldBuilder() { + if (vectorsBuilder_ == null) { + vectorsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.Vectors, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.Vectors.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.VectorsOrBuilder>( + vectors_, + ((bitField0_ & 0x00000100) != 0), + getParentForChildren(), + isClean()); + vectors_ = null; + } + return vectorsBuilder_; + } + + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection selection_; + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder> selectionBuilder_; + /** + * optional .weaviate.v1.Selection selection = 10; + * @return Whether the selection field is set. + */ + public boolean hasSelection() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * optional .weaviate.v1.Selection selection = 10; + * @return The selection. + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection() { + if (selectionBuilder_ == null) { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } else { + return selectionBuilder_.getMessage(); + } + } + /** + * optional .weaviate.v1.Selection selection = 10; + */ + public Builder setSelection(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection value) { + if (selectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + selection_ = value; + } else { + selectionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 10; + */ + public Builder setSelection( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder builderForValue) { + if (selectionBuilder_ == null) { + selection_ = builderForValue.build(); + } else { + selectionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 10; + */ + public Builder mergeSelection(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection value) { + if (selectionBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) && + selection_ != null && + selection_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance()) { + getSelectionBuilder().mergeFrom(value); + } else { + selection_ = value; + } + } else { + selectionBuilder_.mergeFrom(value); + } + if (selection_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + /** + * optional .weaviate.v1.Selection selection = 10; */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.Vectors.Builder addVectorsBuilder() { - return getVectorsFieldBuilder().addBuilder( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.Vectors.getDefaultInstance()); + public Builder clearSelection() { + bitField0_ = (bitField0_ & ~0x00000200); + selection_ = null; + if (selectionBuilder_ != null) { + selectionBuilder_.dispose(); + selectionBuilder_ = null; + } + onChanged(); + return this; } /** - * repeated .weaviate.v1.Vectors vectors = 9; + * optional .weaviate.v1.Selection selection = 10; */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.Vectors.Builder addVectorsBuilder( - int index) { - return getVectorsFieldBuilder().addBuilder( - index, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.Vectors.getDefaultInstance()); + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder getSelectionBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getSelectionFieldBuilder().getBuilder(); } /** - * repeated .weaviate.v1.Vectors vectors = 9; + * optional .weaviate.v1.Selection selection = 10; */ - public java.util.List - getVectorsBuilderList() { - return getVectorsFieldBuilder().getBuilderList(); + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder() { + if (selectionBuilder_ != null) { + return selectionBuilder_.getMessageOrBuilder(); + } else { + return selection_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } } - private com.google.protobuf.RepeatedFieldBuilderV3< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.Vectors, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.Vectors.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.VectorsOrBuilder> - getVectorsFieldBuilder() { - if (vectorsBuilder_ == null) { - vectorsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.Vectors, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.Vectors.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.VectorsOrBuilder>( - vectors_, - ((bitField0_ & 0x00000100) != 0), + /** + * optional .weaviate.v1.Selection selection = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder> + getSelectionFieldBuilder() { + if (selectionBuilder_ == null) { + selectionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder>( + getSelection(), getParentForChildren(), isClean()); - vectors_ = null; + selection_ = null; } - return vectorsBuilder_; + return selectionBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -9572,7 +11512,7 @@ public interface NearObjectOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearObject.target_vectors is deprecated. - * See v1/base_search.proto;l=98 + * See v1/base_search.proto;l=106 * @return A list containing the targetVectors. */ @java.lang.Deprecated java.util.List @@ -9584,7 +11524,7 @@ public interface NearObjectOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearObject.target_vectors is deprecated. - * See v1/base_search.proto;l=98 + * See v1/base_search.proto;l=106 * @return The count of targetVectors. */ @java.lang.Deprecated int getTargetVectorsCount(); @@ -9595,7 +11535,7 @@ public interface NearObjectOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearObject.target_vectors is deprecated. - * See v1/base_search.proto;l=98 + * See v1/base_search.proto;l=106 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -9607,7 +11547,7 @@ public interface NearObjectOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearObject.target_vectors is deprecated. - * See v1/base_search.proto;l=98 + * See v1/base_search.proto;l=106 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -9628,6 +11568,21 @@ public interface NearObjectOrBuilder extends * .weaviate.v1.Targets targets = 5; */ io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder getTargetsOrBuilder(); + + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + boolean hasSelection(); + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection(); + /** + * optional .weaviate.v1.Selection selection = 6; + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder(); } /** * Protobuf type {@code weaviate.v1.NearObject} @@ -9756,7 +11711,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearObject.target_vectors is deprecated. - * See v1/base_search.proto;l=98 + * See v1/base_search.proto;l=106 * @return A list containing the targetVectors. */ @java.lang.Deprecated public com.google.protobuf.ProtocolStringList @@ -9770,7 +11725,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearObject.target_vectors is deprecated. - * See v1/base_search.proto;l=98 + * See v1/base_search.proto;l=106 * @return The count of targetVectors. */ @java.lang.Deprecated public int getTargetVectorsCount() { @@ -9783,7 +11738,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearObject.target_vectors is deprecated. - * See v1/base_search.proto;l=98 + * See v1/base_search.proto;l=106 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -9797,7 +11752,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearObject.target_vectors is deprecated. - * See v1/base_search.proto;l=98 + * See v1/base_search.proto;l=106 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -9832,6 +11787,32 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Tar return targets_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.getDefaultInstance() : targets_; } + public static final int SELECTION_FIELD_NUMBER = 6; + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection selection_; + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + @java.lang.Override + public boolean hasSelection() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection() { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder() { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -9861,6 +11842,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(5, getTargets()); } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(6, getSelection()); + } getUnknownFields().writeTo(output); } @@ -9893,6 +11877,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, getTargets()); } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getSelection()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -9929,6 +11917,11 @@ public boolean equals(final java.lang.Object obj) { if (!getTargets() .equals(other.getTargets())) return false; } + if (hasSelection() != other.hasSelection()) return false; + if (hasSelection()) { + if (!getSelection() + .equals(other.getSelection())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -9960,6 +11953,10 @@ public int hashCode() { hash = (37 * hash) + TARGETS_FIELD_NUMBER; hash = (53 * hash) + getTargets().hashCode(); } + if (hasSelection()) { + hash = (37 * hash) + SELECTION_FIELD_NUMBER; + hash = (53 * hash) + getSelection().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -10091,6 +12088,7 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getTargetsFieldBuilder(); + getSelectionFieldBuilder(); } } @java.lang.Override @@ -10107,6 +12105,11 @@ public Builder clear() { targetsBuilder_.dispose(); targetsBuilder_ = null; } + selection_ = null; + if (selectionBuilder_ != null) { + selectionBuilder_.dispose(); + selectionBuilder_ = null; + } return this; } @@ -10162,6 +12165,12 @@ private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.Weaviat : targetsBuilder_.build(); to_bitField0_ |= 0x00000004; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.selection_ = selectionBuilder_ == null + ? selection_ + : selectionBuilder_.build(); + to_bitField0_ |= 0x00000008; + } result.bitField0_ |= to_bitField0_; } @@ -10233,6 +12242,9 @@ public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateP if (other.hasTargets()) { mergeTargets(other.getTargets()); } + if (other.hasSelection()) { + mergeSelection(other.getSelection()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -10287,6 +12299,13 @@ public Builder mergeFrom( bitField0_ |= 0x00000010; break; } // case 42 + case 50: { + input.readMessage( + getSelectionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -10471,7 +12490,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearObject.target_vectors is deprecated. - * See v1/base_search.proto;l=98 + * See v1/base_search.proto;l=106 * @return A list containing the targetVectors. */ @java.lang.Deprecated public com.google.protobuf.ProtocolStringList @@ -10486,7 +12505,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearObject.target_vectors is deprecated. - * See v1/base_search.proto;l=98 + * See v1/base_search.proto;l=106 * @return The count of targetVectors. */ @java.lang.Deprecated public int getTargetVectorsCount() { @@ -10499,7 +12518,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearObject.target_vectors is deprecated. - * See v1/base_search.proto;l=98 + * See v1/base_search.proto;l=106 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -10513,7 +12532,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearObject.target_vectors is deprecated. - * See v1/base_search.proto;l=98 + * See v1/base_search.proto;l=106 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -10528,7 +12547,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearObject.target_vectors is deprecated. - * See v1/base_search.proto;l=98 + * See v1/base_search.proto;l=106 * @param index The index to set the value at. * @param value The targetVectors to set. * @return This builder for chaining. @@ -10549,7 +12568,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearObject.target_vectors is deprecated. - * See v1/base_search.proto;l=98 + * See v1/base_search.proto;l=106 * @param value The targetVectors to add. * @return This builder for chaining. */ @@ -10569,7 +12588,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearObject.target_vectors is deprecated. - * See v1/base_search.proto;l=98 + * See v1/base_search.proto;l=106 * @param values The targetVectors to add. * @return This builder for chaining. */ @@ -10589,7 +12608,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearObject.target_vectors is deprecated. - * See v1/base_search.proto;l=98 + * See v1/base_search.proto;l=106 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearTargetVectors() { @@ -10606,7 +12625,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearObject.target_vectors is deprecated. - * See v1/base_search.proto;l=98 + * See v1/base_search.proto;l=106 * @param value The bytes of the targetVectors to add. * @return This builder for chaining. */ @@ -10741,6 +12760,127 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Tar } return targetsBuilder_; } + + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection selection_; + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder> selectionBuilder_; + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + public boolean hasSelection() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection() { + if (selectionBuilder_ == null) { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } else { + return selectionBuilder_.getMessage(); + } + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder setSelection(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection value) { + if (selectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + selection_ = value; + } else { + selectionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder setSelection( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder builderForValue) { + if (selectionBuilder_ == null) { + selection_ = builderForValue.build(); + } else { + selectionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder mergeSelection(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection value) { + if (selectionBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + selection_ != null && + selection_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance()) { + getSelectionBuilder().mergeFrom(value); + } else { + selection_ = value; + } + } else { + selectionBuilder_.mergeFrom(value); + } + if (selection_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder clearSelection() { + bitField0_ = (bitField0_ & ~0x00000020); + selection_ = null; + if (selectionBuilder_ != null) { + selectionBuilder_.dispose(); + selectionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder getSelectionBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getSelectionFieldBuilder().getBuilder(); + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder() { + if (selectionBuilder_ != null) { + return selectionBuilder_.getMessageOrBuilder(); + } else { + return selection_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder> + getSelectionFieldBuilder() { + if (selectionBuilder_ == null) { + selectionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder>( + getSelection(), + getParentForChildren(), + isClean()); + selection_ = null; + } + return selectionBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -10909,7 +13049,7 @@ public interface NearTextSearchOrBuilder extends * * repeated string target_vectors = 6 [deprecated = true]; * @deprecated weaviate.v1.NearTextSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=116 + * See v1/base_search.proto;l=124 * @return A list containing the targetVectors. */ @java.lang.Deprecated java.util.List @@ -10921,7 +13061,7 @@ public interface NearTextSearchOrBuilder extends * * repeated string target_vectors = 6 [deprecated = true]; * @deprecated weaviate.v1.NearTextSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=116 + * See v1/base_search.proto;l=124 * @return The count of targetVectors. */ @java.lang.Deprecated int getTargetVectorsCount(); @@ -10932,7 +13072,7 @@ public interface NearTextSearchOrBuilder extends * * repeated string target_vectors = 6 [deprecated = true]; * @deprecated weaviate.v1.NearTextSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=116 + * See v1/base_search.proto;l=124 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -10944,7 +13084,7 @@ public interface NearTextSearchOrBuilder extends * * repeated string target_vectors = 6 [deprecated = true]; * @deprecated weaviate.v1.NearTextSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=116 + * See v1/base_search.proto;l=124 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -10965,6 +13105,21 @@ public interface NearTextSearchOrBuilder extends * .weaviate.v1.Targets targets = 7; */ io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder getTargetsOrBuilder(); + + /** + * optional .weaviate.v1.Selection selection = 8; + * @return Whether the selection field is set. + */ + boolean hasSelection(); + /** + * optional .weaviate.v1.Selection selection = 8; + * @return The selection. + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection(); + /** + * optional .weaviate.v1.Selection selection = 8; + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder(); } /** * Protobuf type {@code weaviate.v1.NearTextSearch} @@ -12066,7 +14221,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Nea * * repeated string target_vectors = 6 [deprecated = true]; * @deprecated weaviate.v1.NearTextSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=116 + * See v1/base_search.proto;l=124 * @return A list containing the targetVectors. */ @java.lang.Deprecated public com.google.protobuf.ProtocolStringList @@ -12080,7 +14235,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Nea * * repeated string target_vectors = 6 [deprecated = true]; * @deprecated weaviate.v1.NearTextSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=116 + * See v1/base_search.proto;l=124 * @return The count of targetVectors. */ @java.lang.Deprecated public int getTargetVectorsCount() { @@ -12093,7 +14248,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Nea * * repeated string target_vectors = 6 [deprecated = true]; * @deprecated weaviate.v1.NearTextSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=116 + * See v1/base_search.proto;l=124 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -12107,7 +14262,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Nea * * repeated string target_vectors = 6 [deprecated = true]; * @deprecated weaviate.v1.NearTextSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=116 + * See v1/base_search.proto;l=124 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -12142,6 +14297,32 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Tar return targets_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.getDefaultInstance() : targets_; } + public static final int SELECTION_FIELD_NUMBER = 8; + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection selection_; + /** + * optional .weaviate.v1.Selection selection = 8; + * @return Whether the selection field is set. + */ + @java.lang.Override + public boolean hasSelection() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional .weaviate.v1.Selection selection = 8; + * @return The selection. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection() { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + /** + * optional .weaviate.v1.Selection selection = 8; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder() { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -12177,6 +14358,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000010) != 0)) { output.writeMessage(7, getTargets()); } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(8, getSelection()); + } getUnknownFields().writeTo(output); } @@ -12222,6 +14406,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(7, getTargets()); } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getSelection()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -12268,6 +14456,11 @@ public boolean equals(final java.lang.Object obj) { if (!getTargets() .equals(other.getTargets())) return false; } + if (hasSelection() != other.hasSelection()) return false; + if (hasSelection()) { + if (!getSelection() + .equals(other.getSelection())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -12309,6 +14502,10 @@ public int hashCode() { hash = (37 * hash) + TARGETS_FIELD_NUMBER; hash = (53 * hash) + getTargets().hashCode(); } + if (hasSelection()) { + hash = (37 * hash) + SELECTION_FIELD_NUMBER; + hash = (53 * hash) + getSelection().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -12442,6 +14639,7 @@ private void maybeForceBuilderInitialization() { getMoveToFieldBuilder(); getMoveAwayFieldBuilder(); getTargetsFieldBuilder(); + getSelectionFieldBuilder(); } } @java.lang.Override @@ -12469,6 +14667,11 @@ public Builder clear() { targetsBuilder_.dispose(); targetsBuilder_ = null; } + selection_ = null; + if (selectionBuilder_ != null) { + selectionBuilder_.dispose(); + selectionBuilder_ = null; + } return this; } @@ -12537,6 +14740,12 @@ private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.Weaviat : targetsBuilder_.build(); to_bitField0_ |= 0x00000010; } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.selection_ = selectionBuilder_ == null + ? selection_ + : selectionBuilder_.build(); + to_bitField0_ |= 0x00000020; + } result.bitField0_ |= to_bitField0_; } @@ -12619,6 +14828,9 @@ public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateP if (other.hasTargets()) { mergeTargets(other.getTargets()); } + if (other.hasSelection()) { + mergeSelection(other.getSelection()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -12688,6 +14900,13 @@ public Builder mergeFrom( bitField0_ |= 0x00000040; break; } // case 58 + case 66: { + input.readMessage( + getSelectionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -13189,7 +15408,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 6 [deprecated = true]; * @deprecated weaviate.v1.NearTextSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=116 + * See v1/base_search.proto;l=124 * @return A list containing the targetVectors. */ @java.lang.Deprecated public com.google.protobuf.ProtocolStringList @@ -13204,7 +15423,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 6 [deprecated = true]; * @deprecated weaviate.v1.NearTextSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=116 + * See v1/base_search.proto;l=124 * @return The count of targetVectors. */ @java.lang.Deprecated public int getTargetVectorsCount() { @@ -13217,7 +15436,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 6 [deprecated = true]; * @deprecated weaviate.v1.NearTextSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=116 + * See v1/base_search.proto;l=124 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -13231,7 +15450,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 6 [deprecated = true]; * @deprecated weaviate.v1.NearTextSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=116 + * See v1/base_search.proto;l=124 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -13246,7 +15465,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 6 [deprecated = true]; * @deprecated weaviate.v1.NearTextSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=116 + * See v1/base_search.proto;l=124 * @param index The index to set the value at. * @param value The targetVectors to set. * @return This builder for chaining. @@ -13267,7 +15486,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 6 [deprecated = true]; * @deprecated weaviate.v1.NearTextSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=116 + * See v1/base_search.proto;l=124 * @param value The targetVectors to add. * @return This builder for chaining. */ @@ -13287,7 +15506,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 6 [deprecated = true]; * @deprecated weaviate.v1.NearTextSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=116 + * See v1/base_search.proto;l=124 * @param values The targetVectors to add. * @return This builder for chaining. */ @@ -13307,7 +15526,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 6 [deprecated = true]; * @deprecated weaviate.v1.NearTextSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=116 + * See v1/base_search.proto;l=124 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearTargetVectors() { @@ -13324,7 +15543,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 6 [deprecated = true]; * @deprecated weaviate.v1.NearTextSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=116 + * See v1/base_search.proto;l=124 * @param value The bytes of the targetVectors to add. * @return This builder for chaining. */ @@ -13425,39 +15644,160 @@ public Builder clearTargets() { return this; } /** - * .weaviate.v1.Targets targets = 7; + * .weaviate.v1.Targets targets = 7; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.Builder getTargetsBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getTargetsFieldBuilder().getBuilder(); + } + /** + * .weaviate.v1.Targets targets = 7; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder getTargetsOrBuilder() { + if (targetsBuilder_ != null) { + return targetsBuilder_.getMessageOrBuilder(); + } else { + return targets_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.getDefaultInstance() : targets_; + } + } + /** + * .weaviate.v1.Targets targets = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder> + getTargetsFieldBuilder() { + if (targetsBuilder_ == null) { + targetsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder>( + getTargets(), + getParentForChildren(), + isClean()); + targets_ = null; + } + return targetsBuilder_; + } + + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection selection_; + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder> selectionBuilder_; + /** + * optional .weaviate.v1.Selection selection = 8; + * @return Whether the selection field is set. + */ + public boolean hasSelection() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * optional .weaviate.v1.Selection selection = 8; + * @return The selection. + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection() { + if (selectionBuilder_ == null) { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } else { + return selectionBuilder_.getMessage(); + } + } + /** + * optional .weaviate.v1.Selection selection = 8; + */ + public Builder setSelection(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection value) { + if (selectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + selection_ = value; + } else { + selectionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 8; + */ + public Builder setSelection( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder builderForValue) { + if (selectionBuilder_ == null) { + selection_ = builderForValue.build(); + } else { + selectionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 8; + */ + public Builder mergeSelection(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection value) { + if (selectionBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) && + selection_ != null && + selection_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance()) { + getSelectionBuilder().mergeFrom(value); + } else { + selection_ = value; + } + } else { + selectionBuilder_.mergeFrom(value); + } + if (selection_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + /** + * optional .weaviate.v1.Selection selection = 8; + */ + public Builder clearSelection() { + bitField0_ = (bitField0_ & ~0x00000080); + selection_ = null; + if (selectionBuilder_ != null) { + selectionBuilder_.dispose(); + selectionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 8; */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.Builder getTargetsBuilder() { - bitField0_ |= 0x00000040; + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder getSelectionBuilder() { + bitField0_ |= 0x00000080; onChanged(); - return getTargetsFieldBuilder().getBuilder(); + return getSelectionFieldBuilder().getBuilder(); } /** - * .weaviate.v1.Targets targets = 7; + * optional .weaviate.v1.Selection selection = 8; */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder getTargetsOrBuilder() { - if (targetsBuilder_ != null) { - return targetsBuilder_.getMessageOrBuilder(); + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder() { + if (selectionBuilder_ != null) { + return selectionBuilder_.getMessageOrBuilder(); } else { - return targets_ == null ? - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.getDefaultInstance() : targets_; + return selection_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; } } /** - * .weaviate.v1.Targets targets = 7; + * optional .weaviate.v1.Selection selection = 8; */ private com.google.protobuf.SingleFieldBuilderV3< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder> - getTargetsFieldBuilder() { - if (targetsBuilder_ == null) { - targetsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder>( - getTargets(), + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder> + getSelectionFieldBuilder() { + if (selectionBuilder_ == null) { + selectionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder>( + getSelection(), getParentForChildren(), isClean()); - targets_ = null; + selection_ = null; } - return targetsBuilder_; + return selectionBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -13568,7 +15908,7 @@ public interface NearImageSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearImageSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=125 + * See v1/base_search.proto;l=133 * @return A list containing the targetVectors. */ @java.lang.Deprecated java.util.List @@ -13580,7 +15920,7 @@ public interface NearImageSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearImageSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=125 + * See v1/base_search.proto;l=133 * @return The count of targetVectors. */ @java.lang.Deprecated int getTargetVectorsCount(); @@ -13591,7 +15931,7 @@ public interface NearImageSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearImageSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=125 + * See v1/base_search.proto;l=133 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -13603,7 +15943,7 @@ public interface NearImageSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearImageSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=125 + * See v1/base_search.proto;l=133 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -13624,6 +15964,21 @@ public interface NearImageSearchOrBuilder extends * .weaviate.v1.Targets targets = 5; */ io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder getTargetsOrBuilder(); + + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + boolean hasSelection(); + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection(); + /** + * optional .weaviate.v1.Selection selection = 6; + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder(); } /** * Protobuf type {@code weaviate.v1.NearImageSearch} @@ -13752,7 +16107,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearImageSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=125 + * See v1/base_search.proto;l=133 * @return A list containing the targetVectors. */ @java.lang.Deprecated public com.google.protobuf.ProtocolStringList @@ -13766,7 +16121,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearImageSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=125 + * See v1/base_search.proto;l=133 * @return The count of targetVectors. */ @java.lang.Deprecated public int getTargetVectorsCount() { @@ -13779,7 +16134,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearImageSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=125 + * See v1/base_search.proto;l=133 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -13793,7 +16148,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearImageSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=125 + * See v1/base_search.proto;l=133 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -13828,6 +16183,32 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Tar return targets_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.getDefaultInstance() : targets_; } + public static final int SELECTION_FIELD_NUMBER = 6; + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection selection_; + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + @java.lang.Override + public boolean hasSelection() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection() { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder() { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -13857,6 +16238,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(5, getTargets()); } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(6, getSelection()); + } getUnknownFields().writeTo(output); } @@ -13889,6 +16273,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, getTargets()); } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getSelection()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -13925,6 +16313,11 @@ public boolean equals(final java.lang.Object obj) { if (!getTargets() .equals(other.getTargets())) return false; } + if (hasSelection() != other.hasSelection()) return false; + if (hasSelection()) { + if (!getSelection() + .equals(other.getSelection())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -13956,6 +16349,10 @@ public int hashCode() { hash = (37 * hash) + TARGETS_FIELD_NUMBER; hash = (53 * hash) + getTargets().hashCode(); } + if (hasSelection()) { + hash = (37 * hash) + SELECTION_FIELD_NUMBER; + hash = (53 * hash) + getSelection().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -14087,6 +16484,7 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getTargetsFieldBuilder(); + getSelectionFieldBuilder(); } } @java.lang.Override @@ -14103,6 +16501,11 @@ public Builder clear() { targetsBuilder_.dispose(); targetsBuilder_ = null; } + selection_ = null; + if (selectionBuilder_ != null) { + selectionBuilder_.dispose(); + selectionBuilder_ = null; + } return this; } @@ -14158,6 +16561,12 @@ private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.Weaviat : targetsBuilder_.build(); to_bitField0_ |= 0x00000004; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.selection_ = selectionBuilder_ == null + ? selection_ + : selectionBuilder_.build(); + to_bitField0_ |= 0x00000008; + } result.bitField0_ |= to_bitField0_; } @@ -14229,6 +16638,9 @@ public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateP if (other.hasTargets()) { mergeTargets(other.getTargets()); } + if (other.hasSelection()) { + mergeSelection(other.getSelection()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -14283,6 +16695,13 @@ public Builder mergeFrom( bitField0_ |= 0x00000010; break; } // case 42 + case 50: { + input.readMessage( + getSelectionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -14467,7 +16886,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearImageSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=125 + * See v1/base_search.proto;l=133 * @return A list containing the targetVectors. */ @java.lang.Deprecated public com.google.protobuf.ProtocolStringList @@ -14482,7 +16901,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearImageSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=125 + * See v1/base_search.proto;l=133 * @return The count of targetVectors. */ @java.lang.Deprecated public int getTargetVectorsCount() { @@ -14495,7 +16914,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearImageSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=125 + * See v1/base_search.proto;l=133 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -14509,7 +16928,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearImageSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=125 + * See v1/base_search.proto;l=133 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -14524,7 +16943,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearImageSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=125 + * See v1/base_search.proto;l=133 * @param index The index to set the value at. * @param value The targetVectors to set. * @return This builder for chaining. @@ -14545,7 +16964,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearImageSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=125 + * See v1/base_search.proto;l=133 * @param value The targetVectors to add. * @return This builder for chaining. */ @@ -14565,7 +16984,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearImageSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=125 + * See v1/base_search.proto;l=133 * @param values The targetVectors to add. * @return This builder for chaining. */ @@ -14585,7 +17004,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearImageSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=125 + * See v1/base_search.proto;l=133 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearTargetVectors() { @@ -14602,7 +17021,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearImageSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=125 + * See v1/base_search.proto;l=133 * @param value The bytes of the targetVectors to add. * @return This builder for chaining. */ @@ -14737,6 +17156,127 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Tar } return targetsBuilder_; } + + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection selection_; + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder> selectionBuilder_; + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + public boolean hasSelection() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection() { + if (selectionBuilder_ == null) { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } else { + return selectionBuilder_.getMessage(); + } + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder setSelection(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection value) { + if (selectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + selection_ = value; + } else { + selectionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder setSelection( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder builderForValue) { + if (selectionBuilder_ == null) { + selection_ = builderForValue.build(); + } else { + selectionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder mergeSelection(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection value) { + if (selectionBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + selection_ != null && + selection_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance()) { + getSelectionBuilder().mergeFrom(value); + } else { + selection_ = value; + } + } else { + selectionBuilder_.mergeFrom(value); + } + if (selection_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder clearSelection() { + bitField0_ = (bitField0_ & ~0x00000020); + selection_ = null; + if (selectionBuilder_ != null) { + selectionBuilder_.dispose(); + selectionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder getSelectionBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getSelectionFieldBuilder().getBuilder(); + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder() { + if (selectionBuilder_ != null) { + return selectionBuilder_.getMessageOrBuilder(); + } else { + return selection_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder> + getSelectionFieldBuilder() { + if (selectionBuilder_ == null) { + selectionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder>( + getSelection(), + getParentForChildren(), + isClean()); + selection_ = null; + } + return selectionBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -14846,7 +17386,7 @@ public interface NearAudioSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearAudioSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=134 + * See v1/base_search.proto;l=142 * @return A list containing the targetVectors. */ @java.lang.Deprecated java.util.List @@ -14858,7 +17398,7 @@ public interface NearAudioSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearAudioSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=134 + * See v1/base_search.proto;l=142 * @return The count of targetVectors. */ @java.lang.Deprecated int getTargetVectorsCount(); @@ -14869,7 +17409,7 @@ public interface NearAudioSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearAudioSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=134 + * See v1/base_search.proto;l=142 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -14881,7 +17421,7 @@ public interface NearAudioSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearAudioSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=134 + * See v1/base_search.proto;l=142 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -14902,6 +17442,21 @@ public interface NearAudioSearchOrBuilder extends * .weaviate.v1.Targets targets = 5; */ io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder getTargetsOrBuilder(); + + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + boolean hasSelection(); + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection(); + /** + * optional .weaviate.v1.Selection selection = 6; + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder(); } /** * Protobuf type {@code weaviate.v1.NearAudioSearch} @@ -15030,7 +17585,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearAudioSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=134 + * See v1/base_search.proto;l=142 * @return A list containing the targetVectors. */ @java.lang.Deprecated public com.google.protobuf.ProtocolStringList @@ -15044,7 +17599,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearAudioSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=134 + * See v1/base_search.proto;l=142 * @return The count of targetVectors. */ @java.lang.Deprecated public int getTargetVectorsCount() { @@ -15057,7 +17612,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearAudioSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=134 + * See v1/base_search.proto;l=142 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -15071,7 +17626,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearAudioSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=134 + * See v1/base_search.proto;l=142 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -15106,6 +17661,32 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Tar return targets_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.getDefaultInstance() : targets_; } + public static final int SELECTION_FIELD_NUMBER = 6; + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection selection_; + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + @java.lang.Override + public boolean hasSelection() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection() { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder() { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -15135,6 +17716,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(5, getTargets()); } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(6, getSelection()); + } getUnknownFields().writeTo(output); } @@ -15167,6 +17751,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, getTargets()); } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getSelection()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -15203,6 +17791,11 @@ public boolean equals(final java.lang.Object obj) { if (!getTargets() .equals(other.getTargets())) return false; } + if (hasSelection() != other.hasSelection()) return false; + if (hasSelection()) { + if (!getSelection() + .equals(other.getSelection())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -15234,6 +17827,10 @@ public int hashCode() { hash = (37 * hash) + TARGETS_FIELD_NUMBER; hash = (53 * hash) + getTargets().hashCode(); } + if (hasSelection()) { + hash = (37 * hash) + SELECTION_FIELD_NUMBER; + hash = (53 * hash) + getSelection().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -15365,6 +17962,7 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getTargetsFieldBuilder(); + getSelectionFieldBuilder(); } } @java.lang.Override @@ -15381,6 +17979,11 @@ public Builder clear() { targetsBuilder_.dispose(); targetsBuilder_ = null; } + selection_ = null; + if (selectionBuilder_ != null) { + selectionBuilder_.dispose(); + selectionBuilder_ = null; + } return this; } @@ -15436,6 +18039,12 @@ private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.Weaviat : targetsBuilder_.build(); to_bitField0_ |= 0x00000004; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.selection_ = selectionBuilder_ == null + ? selection_ + : selectionBuilder_.build(); + to_bitField0_ |= 0x00000008; + } result.bitField0_ |= to_bitField0_; } @@ -15507,6 +18116,9 @@ public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateP if (other.hasTargets()) { mergeTargets(other.getTargets()); } + if (other.hasSelection()) { + mergeSelection(other.getSelection()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -15561,6 +18173,13 @@ public Builder mergeFrom( bitField0_ |= 0x00000010; break; } // case 42 + case 50: { + input.readMessage( + getSelectionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -15745,7 +18364,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearAudioSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=134 + * See v1/base_search.proto;l=142 * @return A list containing the targetVectors. */ @java.lang.Deprecated public com.google.protobuf.ProtocolStringList @@ -15760,7 +18379,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearAudioSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=134 + * See v1/base_search.proto;l=142 * @return The count of targetVectors. */ @java.lang.Deprecated public int getTargetVectorsCount() { @@ -15773,7 +18392,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearAudioSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=134 + * See v1/base_search.proto;l=142 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -15787,7 +18406,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearAudioSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=134 + * See v1/base_search.proto;l=142 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -15802,7 +18421,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearAudioSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=134 + * See v1/base_search.proto;l=142 * @param index The index to set the value at. * @param value The targetVectors to set. * @return This builder for chaining. @@ -15823,7 +18442,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearAudioSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=134 + * See v1/base_search.proto;l=142 * @param value The targetVectors to add. * @return This builder for chaining. */ @@ -15843,7 +18462,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearAudioSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=134 + * See v1/base_search.proto;l=142 * @param values The targetVectors to add. * @return This builder for chaining. */ @@ -15863,7 +18482,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearAudioSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=134 + * See v1/base_search.proto;l=142 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearTargetVectors() { @@ -15880,7 +18499,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearAudioSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=134 + * See v1/base_search.proto;l=142 * @param value The bytes of the targetVectors to add. * @return This builder for chaining. */ @@ -15956,64 +18575,185 @@ public Builder mergeTargets(io.weaviate.client6.v1.internal.grpc.protocol.Weavia targets_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.getDefaultInstance()) { getTargetsBuilder().mergeFrom(value); } else { - targets_ = value; + targets_ = value; + } + } else { + targetsBuilder_.mergeFrom(value); + } + if (targets_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * .weaviate.v1.Targets targets = 5; + */ + public Builder clearTargets() { + bitField0_ = (bitField0_ & ~0x00000010); + targets_ = null; + if (targetsBuilder_ != null) { + targetsBuilder_.dispose(); + targetsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .weaviate.v1.Targets targets = 5; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.Builder getTargetsBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getTargetsFieldBuilder().getBuilder(); + } + /** + * .weaviate.v1.Targets targets = 5; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder getTargetsOrBuilder() { + if (targetsBuilder_ != null) { + return targetsBuilder_.getMessageOrBuilder(); + } else { + return targets_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.getDefaultInstance() : targets_; + } + } + /** + * .weaviate.v1.Targets targets = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder> + getTargetsFieldBuilder() { + if (targetsBuilder_ == null) { + targetsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder>( + getTargets(), + getParentForChildren(), + isClean()); + targets_ = null; + } + return targetsBuilder_; + } + + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection selection_; + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder> selectionBuilder_; + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + public boolean hasSelection() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection() { + if (selectionBuilder_ == null) { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } else { + return selectionBuilder_.getMessage(); + } + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder setSelection(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection value) { + if (selectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + selection_ = value; + } else { + selectionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder setSelection( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder builderForValue) { + if (selectionBuilder_ == null) { + selection_ = builderForValue.build(); + } else { + selectionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder mergeSelection(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection value) { + if (selectionBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + selection_ != null && + selection_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance()) { + getSelectionBuilder().mergeFrom(value); + } else { + selection_ = value; } } else { - targetsBuilder_.mergeFrom(value); + selectionBuilder_.mergeFrom(value); } - if (targets_ != null) { - bitField0_ |= 0x00000010; + if (selection_ != null) { + bitField0_ |= 0x00000020; onChanged(); } return this; } /** - * .weaviate.v1.Targets targets = 5; + * optional .weaviate.v1.Selection selection = 6; */ - public Builder clearTargets() { - bitField0_ = (bitField0_ & ~0x00000010); - targets_ = null; - if (targetsBuilder_ != null) { - targetsBuilder_.dispose(); - targetsBuilder_ = null; + public Builder clearSelection() { + bitField0_ = (bitField0_ & ~0x00000020); + selection_ = null; + if (selectionBuilder_ != null) { + selectionBuilder_.dispose(); + selectionBuilder_ = null; } onChanged(); return this; } /** - * .weaviate.v1.Targets targets = 5; + * optional .weaviate.v1.Selection selection = 6; */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.Builder getTargetsBuilder() { - bitField0_ |= 0x00000010; + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder getSelectionBuilder() { + bitField0_ |= 0x00000020; onChanged(); - return getTargetsFieldBuilder().getBuilder(); + return getSelectionFieldBuilder().getBuilder(); } /** - * .weaviate.v1.Targets targets = 5; + * optional .weaviate.v1.Selection selection = 6; */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder getTargetsOrBuilder() { - if (targetsBuilder_ != null) { - return targetsBuilder_.getMessageOrBuilder(); + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder() { + if (selectionBuilder_ != null) { + return selectionBuilder_.getMessageOrBuilder(); } else { - return targets_ == null ? - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.getDefaultInstance() : targets_; + return selection_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; } } /** - * .weaviate.v1.Targets targets = 5; + * optional .weaviate.v1.Selection selection = 6; */ private com.google.protobuf.SingleFieldBuilderV3< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder> - getTargetsFieldBuilder() { - if (targetsBuilder_ == null) { - targetsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder>( - getTargets(), + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder> + getSelectionFieldBuilder() { + if (selectionBuilder_ == null) { + selectionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder>( + getSelection(), getParentForChildren(), isClean()); - targets_ = null; + selection_ = null; } - return targetsBuilder_; + return selectionBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -16124,7 +18864,7 @@ public interface NearVideoSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVideoSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=143 + * See v1/base_search.proto;l=151 * @return A list containing the targetVectors. */ @java.lang.Deprecated java.util.List @@ -16136,7 +18876,7 @@ public interface NearVideoSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVideoSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=143 + * See v1/base_search.proto;l=151 * @return The count of targetVectors. */ @java.lang.Deprecated int getTargetVectorsCount(); @@ -16147,7 +18887,7 @@ public interface NearVideoSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVideoSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=143 + * See v1/base_search.proto;l=151 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -16159,7 +18899,7 @@ public interface NearVideoSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVideoSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=143 + * See v1/base_search.proto;l=151 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -16180,6 +18920,21 @@ public interface NearVideoSearchOrBuilder extends * .weaviate.v1.Targets targets = 5; */ io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder getTargetsOrBuilder(); + + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + boolean hasSelection(); + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection(); + /** + * optional .weaviate.v1.Selection selection = 6; + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder(); } /** * Protobuf type {@code weaviate.v1.NearVideoSearch} @@ -16308,7 +19063,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVideoSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=143 + * See v1/base_search.proto;l=151 * @return A list containing the targetVectors. */ @java.lang.Deprecated public com.google.protobuf.ProtocolStringList @@ -16322,7 +19077,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVideoSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=143 + * See v1/base_search.proto;l=151 * @return The count of targetVectors. */ @java.lang.Deprecated public int getTargetVectorsCount() { @@ -16335,7 +19090,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVideoSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=143 + * See v1/base_search.proto;l=151 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -16349,7 +19104,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVideoSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=143 + * See v1/base_search.proto;l=151 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -16384,6 +19139,32 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Tar return targets_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.getDefaultInstance() : targets_; } + public static final int SELECTION_FIELD_NUMBER = 6; + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection selection_; + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + @java.lang.Override + public boolean hasSelection() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection() { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder() { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -16413,6 +19194,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(5, getTargets()); } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(6, getSelection()); + } getUnknownFields().writeTo(output); } @@ -16445,6 +19229,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, getTargets()); } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getSelection()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -16481,6 +19269,11 @@ public boolean equals(final java.lang.Object obj) { if (!getTargets() .equals(other.getTargets())) return false; } + if (hasSelection() != other.hasSelection()) return false; + if (hasSelection()) { + if (!getSelection() + .equals(other.getSelection())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -16512,6 +19305,10 @@ public int hashCode() { hash = (37 * hash) + TARGETS_FIELD_NUMBER; hash = (53 * hash) + getTargets().hashCode(); } + if (hasSelection()) { + hash = (37 * hash) + SELECTION_FIELD_NUMBER; + hash = (53 * hash) + getSelection().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -16643,6 +19440,7 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getTargetsFieldBuilder(); + getSelectionFieldBuilder(); } } @java.lang.Override @@ -16659,6 +19457,11 @@ public Builder clear() { targetsBuilder_.dispose(); targetsBuilder_ = null; } + selection_ = null; + if (selectionBuilder_ != null) { + selectionBuilder_.dispose(); + selectionBuilder_ = null; + } return this; } @@ -16714,6 +19517,12 @@ private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.Weaviat : targetsBuilder_.build(); to_bitField0_ |= 0x00000004; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.selection_ = selectionBuilder_ == null + ? selection_ + : selectionBuilder_.build(); + to_bitField0_ |= 0x00000008; + } result.bitField0_ |= to_bitField0_; } @@ -16785,6 +19594,9 @@ public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateP if (other.hasTargets()) { mergeTargets(other.getTargets()); } + if (other.hasSelection()) { + mergeSelection(other.getSelection()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -16839,6 +19651,13 @@ public Builder mergeFrom( bitField0_ |= 0x00000010; break; } // case 42 + case 50: { + input.readMessage( + getSelectionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -17023,7 +19842,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVideoSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=143 + * See v1/base_search.proto;l=151 * @return A list containing the targetVectors. */ @java.lang.Deprecated public com.google.protobuf.ProtocolStringList @@ -17038,7 +19857,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVideoSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=143 + * See v1/base_search.proto;l=151 * @return The count of targetVectors. */ @java.lang.Deprecated public int getTargetVectorsCount() { @@ -17051,7 +19870,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVideoSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=143 + * See v1/base_search.proto;l=151 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -17065,7 +19884,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVideoSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=143 + * See v1/base_search.proto;l=151 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -17080,7 +19899,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVideoSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=143 + * See v1/base_search.proto;l=151 * @param index The index to set the value at. * @param value The targetVectors to set. * @return This builder for chaining. @@ -17101,7 +19920,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVideoSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=143 + * See v1/base_search.proto;l=151 * @param value The targetVectors to add. * @return This builder for chaining. */ @@ -17121,7 +19940,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVideoSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=143 + * See v1/base_search.proto;l=151 * @param values The targetVectors to add. * @return This builder for chaining. */ @@ -17141,7 +19960,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVideoSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=143 + * See v1/base_search.proto;l=151 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearTargetVectors() { @@ -17158,7 +19977,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearVideoSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=143 + * See v1/base_search.proto;l=151 * @param value The bytes of the targetVectors to add. * @return This builder for chaining. */ @@ -17293,6 +20112,127 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Tar } return targetsBuilder_; } + + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection selection_; + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder> selectionBuilder_; + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + public boolean hasSelection() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection() { + if (selectionBuilder_ == null) { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } else { + return selectionBuilder_.getMessage(); + } + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder setSelection(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection value) { + if (selectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + selection_ = value; + } else { + selectionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder setSelection( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder builderForValue) { + if (selectionBuilder_ == null) { + selection_ = builderForValue.build(); + } else { + selectionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder mergeSelection(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection value) { + if (selectionBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + selection_ != null && + selection_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance()) { + getSelectionBuilder().mergeFrom(value); + } else { + selection_ = value; + } + } else { + selectionBuilder_.mergeFrom(value); + } + if (selection_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder clearSelection() { + bitField0_ = (bitField0_ & ~0x00000020); + selection_ = null; + if (selectionBuilder_ != null) { + selectionBuilder_.dispose(); + selectionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder getSelectionBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getSelectionFieldBuilder().getBuilder(); + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder() { + if (selectionBuilder_ != null) { + return selectionBuilder_.getMessageOrBuilder(); + } else { + return selection_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder> + getSelectionFieldBuilder() { + if (selectionBuilder_ == null) { + selectionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder>( + getSelection(), + getParentForChildren(), + isClean()); + selection_ = null; + } + return selectionBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -17402,7 +20342,7 @@ public interface NearDepthSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearDepthSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=152 + * See v1/base_search.proto;l=160 * @return A list containing the targetVectors. */ @java.lang.Deprecated java.util.List @@ -17414,7 +20354,7 @@ public interface NearDepthSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearDepthSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=152 + * See v1/base_search.proto;l=160 * @return The count of targetVectors. */ @java.lang.Deprecated int getTargetVectorsCount(); @@ -17425,7 +20365,7 @@ public interface NearDepthSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearDepthSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=152 + * See v1/base_search.proto;l=160 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -17437,7 +20377,7 @@ public interface NearDepthSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearDepthSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=152 + * See v1/base_search.proto;l=160 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -17458,6 +20398,21 @@ public interface NearDepthSearchOrBuilder extends * .weaviate.v1.Targets targets = 5; */ io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder getTargetsOrBuilder(); + + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + boolean hasSelection(); + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection(); + /** + * optional .weaviate.v1.Selection selection = 6; + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder(); } /** * Protobuf type {@code weaviate.v1.NearDepthSearch} @@ -17586,7 +20541,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearDepthSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=152 + * See v1/base_search.proto;l=160 * @return A list containing the targetVectors. */ @java.lang.Deprecated public com.google.protobuf.ProtocolStringList @@ -17600,7 +20555,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearDepthSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=152 + * See v1/base_search.proto;l=160 * @return The count of targetVectors. */ @java.lang.Deprecated public int getTargetVectorsCount() { @@ -17613,7 +20568,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearDepthSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=152 + * See v1/base_search.proto;l=160 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -17627,7 +20582,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearDepthSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=152 + * See v1/base_search.proto;l=160 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -17662,6 +20617,32 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Tar return targets_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.getDefaultInstance() : targets_; } + public static final int SELECTION_FIELD_NUMBER = 6; + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection selection_; + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + @java.lang.Override + public boolean hasSelection() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection() { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder() { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -17691,6 +20672,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(5, getTargets()); } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(6, getSelection()); + } getUnknownFields().writeTo(output); } @@ -17723,6 +20707,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, getTargets()); } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getSelection()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -17759,6 +20747,11 @@ public boolean equals(final java.lang.Object obj) { if (!getTargets() .equals(other.getTargets())) return false; } + if (hasSelection() != other.hasSelection()) return false; + if (hasSelection()) { + if (!getSelection() + .equals(other.getSelection())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -17790,6 +20783,10 @@ public int hashCode() { hash = (37 * hash) + TARGETS_FIELD_NUMBER; hash = (53 * hash) + getTargets().hashCode(); } + if (hasSelection()) { + hash = (37 * hash) + SELECTION_FIELD_NUMBER; + hash = (53 * hash) + getSelection().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -17921,6 +20918,7 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getTargetsFieldBuilder(); + getSelectionFieldBuilder(); } } @java.lang.Override @@ -17937,6 +20935,11 @@ public Builder clear() { targetsBuilder_.dispose(); targetsBuilder_ = null; } + selection_ = null; + if (selectionBuilder_ != null) { + selectionBuilder_.dispose(); + selectionBuilder_ = null; + } return this; } @@ -17992,6 +20995,12 @@ private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.Weaviat : targetsBuilder_.build(); to_bitField0_ |= 0x00000004; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.selection_ = selectionBuilder_ == null + ? selection_ + : selectionBuilder_.build(); + to_bitField0_ |= 0x00000008; + } result.bitField0_ |= to_bitField0_; } @@ -18063,6 +21072,9 @@ public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateP if (other.hasTargets()) { mergeTargets(other.getTargets()); } + if (other.hasSelection()) { + mergeSelection(other.getSelection()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -18117,6 +21129,13 @@ public Builder mergeFrom( bitField0_ |= 0x00000010; break; } // case 42 + case 50: { + input.readMessage( + getSelectionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -18301,7 +21320,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearDepthSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=152 + * See v1/base_search.proto;l=160 * @return A list containing the targetVectors. */ @java.lang.Deprecated public com.google.protobuf.ProtocolStringList @@ -18316,7 +21335,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearDepthSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=152 + * See v1/base_search.proto;l=160 * @return The count of targetVectors. */ @java.lang.Deprecated public int getTargetVectorsCount() { @@ -18329,7 +21348,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearDepthSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=152 + * See v1/base_search.proto;l=160 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -18343,7 +21362,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearDepthSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=152 + * See v1/base_search.proto;l=160 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -18358,7 +21377,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearDepthSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=152 + * See v1/base_search.proto;l=160 * @param index The index to set the value at. * @param value The targetVectors to set. * @return This builder for chaining. @@ -18379,7 +21398,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearDepthSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=152 + * See v1/base_search.proto;l=160 * @param value The targetVectors to add. * @return This builder for chaining. */ @@ -18399,7 +21418,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearDepthSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=152 + * See v1/base_search.proto;l=160 * @param values The targetVectors to add. * @return This builder for chaining. */ @@ -18419,7 +21438,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearDepthSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=152 + * See v1/base_search.proto;l=160 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearTargetVectors() { @@ -18436,7 +21455,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearDepthSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=152 + * See v1/base_search.proto;l=160 * @param value The bytes of the targetVectors to add. * @return This builder for chaining. */ @@ -18551,25 +21570,146 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Tar if (targetsBuilder_ != null) { return targetsBuilder_.getMessageOrBuilder(); } else { - return targets_ == null ? - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.getDefaultInstance() : targets_; + return targets_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.getDefaultInstance() : targets_; + } + } + /** + * .weaviate.v1.Targets targets = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder> + getTargetsFieldBuilder() { + if (targetsBuilder_ == null) { + targetsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder>( + getTargets(), + getParentForChildren(), + isClean()); + targets_ = null; + } + return targetsBuilder_; + } + + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection selection_; + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder> selectionBuilder_; + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + public boolean hasSelection() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection() { + if (selectionBuilder_ == null) { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } else { + return selectionBuilder_.getMessage(); + } + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder setSelection(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection value) { + if (selectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + selection_ = value; + } else { + selectionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder setSelection( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder builderForValue) { + if (selectionBuilder_ == null) { + selection_ = builderForValue.build(); + } else { + selectionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder mergeSelection(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection value) { + if (selectionBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + selection_ != null && + selection_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance()) { + getSelectionBuilder().mergeFrom(value); + } else { + selection_ = value; + } + } else { + selectionBuilder_.mergeFrom(value); + } + if (selection_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder clearSelection() { + bitField0_ = (bitField0_ & ~0x00000020); + selection_ = null; + if (selectionBuilder_ != null) { + selectionBuilder_.dispose(); + selectionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder getSelectionBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getSelectionFieldBuilder().getBuilder(); + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder() { + if (selectionBuilder_ != null) { + return selectionBuilder_.getMessageOrBuilder(); + } else { + return selection_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; } } /** - * .weaviate.v1.Targets targets = 5; + * optional .weaviate.v1.Selection selection = 6; */ private com.google.protobuf.SingleFieldBuilderV3< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder> - getTargetsFieldBuilder() { - if (targetsBuilder_ == null) { - targetsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder>( - getTargets(), + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder> + getSelectionFieldBuilder() { + if (selectionBuilder_ == null) { + selectionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder>( + getSelection(), getParentForChildren(), isClean()); - targets_ = null; + selection_ = null; } - return targetsBuilder_; + return selectionBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -18680,7 +21820,7 @@ public interface NearThermalSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearThermalSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=161 + * See v1/base_search.proto;l=169 * @return A list containing the targetVectors. */ @java.lang.Deprecated java.util.List @@ -18692,7 +21832,7 @@ public interface NearThermalSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearThermalSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=161 + * See v1/base_search.proto;l=169 * @return The count of targetVectors. */ @java.lang.Deprecated int getTargetVectorsCount(); @@ -18703,7 +21843,7 @@ public interface NearThermalSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearThermalSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=161 + * See v1/base_search.proto;l=169 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -18715,7 +21855,7 @@ public interface NearThermalSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearThermalSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=161 + * See v1/base_search.proto;l=169 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -18736,6 +21876,21 @@ public interface NearThermalSearchOrBuilder extends * .weaviate.v1.Targets targets = 5; */ io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder getTargetsOrBuilder(); + + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + boolean hasSelection(); + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection(); + /** + * optional .weaviate.v1.Selection selection = 6; + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder(); } /** * Protobuf type {@code weaviate.v1.NearThermalSearch} @@ -18864,7 +22019,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearThermalSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=161 + * See v1/base_search.proto;l=169 * @return A list containing the targetVectors. */ @java.lang.Deprecated public com.google.protobuf.ProtocolStringList @@ -18878,7 +22033,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearThermalSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=161 + * See v1/base_search.proto;l=169 * @return The count of targetVectors. */ @java.lang.Deprecated public int getTargetVectorsCount() { @@ -18891,7 +22046,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearThermalSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=161 + * See v1/base_search.proto;l=169 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -18905,7 +22060,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearThermalSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=161 + * See v1/base_search.proto;l=169 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -18940,6 +22095,32 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Tar return targets_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.getDefaultInstance() : targets_; } + public static final int SELECTION_FIELD_NUMBER = 6; + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection selection_; + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + @java.lang.Override + public boolean hasSelection() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection() { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder() { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -18969,6 +22150,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(5, getTargets()); } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(6, getSelection()); + } getUnknownFields().writeTo(output); } @@ -19001,6 +22185,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, getTargets()); } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getSelection()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -19037,6 +22225,11 @@ public boolean equals(final java.lang.Object obj) { if (!getTargets() .equals(other.getTargets())) return false; } + if (hasSelection() != other.hasSelection()) return false; + if (hasSelection()) { + if (!getSelection() + .equals(other.getSelection())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -19068,6 +22261,10 @@ public int hashCode() { hash = (37 * hash) + TARGETS_FIELD_NUMBER; hash = (53 * hash) + getTargets().hashCode(); } + if (hasSelection()) { + hash = (37 * hash) + SELECTION_FIELD_NUMBER; + hash = (53 * hash) + getSelection().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -19199,6 +22396,7 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getTargetsFieldBuilder(); + getSelectionFieldBuilder(); } } @java.lang.Override @@ -19215,6 +22413,11 @@ public Builder clear() { targetsBuilder_.dispose(); targetsBuilder_ = null; } + selection_ = null; + if (selectionBuilder_ != null) { + selectionBuilder_.dispose(); + selectionBuilder_ = null; + } return this; } @@ -19270,6 +22473,12 @@ private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.Weaviat : targetsBuilder_.build(); to_bitField0_ |= 0x00000004; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.selection_ = selectionBuilder_ == null + ? selection_ + : selectionBuilder_.build(); + to_bitField0_ |= 0x00000008; + } result.bitField0_ |= to_bitField0_; } @@ -19341,6 +22550,9 @@ public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateP if (other.hasTargets()) { mergeTargets(other.getTargets()); } + if (other.hasSelection()) { + mergeSelection(other.getSelection()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -19395,6 +22607,13 @@ public Builder mergeFrom( bitField0_ |= 0x00000010; break; } // case 42 + case 50: { + input.readMessage( + getSelectionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -19579,7 +22798,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearThermalSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=161 + * See v1/base_search.proto;l=169 * @return A list containing the targetVectors. */ @java.lang.Deprecated public com.google.protobuf.ProtocolStringList @@ -19594,7 +22813,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearThermalSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=161 + * See v1/base_search.proto;l=169 * @return The count of targetVectors. */ @java.lang.Deprecated public int getTargetVectorsCount() { @@ -19607,7 +22826,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearThermalSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=161 + * See v1/base_search.proto;l=169 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -19621,7 +22840,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearThermalSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=161 + * See v1/base_search.proto;l=169 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -19636,7 +22855,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearThermalSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=161 + * See v1/base_search.proto;l=169 * @param index The index to set the value at. * @param value The targetVectors to set. * @return This builder for chaining. @@ -19657,7 +22876,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearThermalSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=161 + * See v1/base_search.proto;l=169 * @param value The targetVectors to add. * @return This builder for chaining. */ @@ -19677,7 +22896,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearThermalSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=161 + * See v1/base_search.proto;l=169 * @param values The targetVectors to add. * @return This builder for chaining. */ @@ -19697,7 +22916,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearThermalSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=161 + * See v1/base_search.proto;l=169 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearTargetVectors() { @@ -19714,7 +22933,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearThermalSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=161 + * See v1/base_search.proto;l=169 * @param value The bytes of the targetVectors to add. * @return This builder for chaining. */ @@ -19849,6 +23068,127 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Tar } return targetsBuilder_; } + + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection selection_; + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder> selectionBuilder_; + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + public boolean hasSelection() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection() { + if (selectionBuilder_ == null) { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } else { + return selectionBuilder_.getMessage(); + } + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder setSelection(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection value) { + if (selectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + selection_ = value; + } else { + selectionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder setSelection( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder builderForValue) { + if (selectionBuilder_ == null) { + selection_ = builderForValue.build(); + } else { + selectionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder mergeSelection(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection value) { + if (selectionBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + selection_ != null && + selection_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance()) { + getSelectionBuilder().mergeFrom(value); + } else { + selection_ = value; + } + } else { + selectionBuilder_.mergeFrom(value); + } + if (selection_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder clearSelection() { + bitField0_ = (bitField0_ & ~0x00000020); + selection_ = null; + if (selectionBuilder_ != null) { + selectionBuilder_.dispose(); + selectionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder getSelectionBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getSelectionFieldBuilder().getBuilder(); + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder() { + if (selectionBuilder_ != null) { + return selectionBuilder_.getMessageOrBuilder(); + } else { + return selection_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder> + getSelectionFieldBuilder() { + if (selectionBuilder_ == null) { + selectionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder>( + getSelection(), + getParentForChildren(), + isClean()); + selection_ = null; + } + return selectionBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -19958,7 +23298,7 @@ public interface NearIMUSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearIMUSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=170 + * See v1/base_search.proto;l=178 * @return A list containing the targetVectors. */ @java.lang.Deprecated java.util.List @@ -19970,7 +23310,7 @@ public interface NearIMUSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearIMUSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=170 + * See v1/base_search.proto;l=178 * @return The count of targetVectors. */ @java.lang.Deprecated int getTargetVectorsCount(); @@ -19981,7 +23321,7 @@ public interface NearIMUSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearIMUSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=170 + * See v1/base_search.proto;l=178 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -19993,7 +23333,7 @@ public interface NearIMUSearchOrBuilder extends * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearIMUSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=170 + * See v1/base_search.proto;l=178 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -20014,6 +23354,21 @@ public interface NearIMUSearchOrBuilder extends * .weaviate.v1.Targets targets = 5; */ io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.TargetsOrBuilder getTargetsOrBuilder(); + + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + boolean hasSelection(); + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection(); + /** + * optional .weaviate.v1.Selection selection = 6; + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder(); } /** * Protobuf type {@code weaviate.v1.NearIMUSearch} @@ -20142,7 +23497,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearIMUSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=170 + * See v1/base_search.proto;l=178 * @return A list containing the targetVectors. */ @java.lang.Deprecated public com.google.protobuf.ProtocolStringList @@ -20156,7 +23511,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearIMUSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=170 + * See v1/base_search.proto;l=178 * @return The count of targetVectors. */ @java.lang.Deprecated public int getTargetVectorsCount() { @@ -20169,7 +23524,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearIMUSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=170 + * See v1/base_search.proto;l=178 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -20183,7 +23538,7 @@ public double getDistance() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearIMUSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=170 + * See v1/base_search.proto;l=178 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -20218,6 +23573,32 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Tar return targets_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Targets.getDefaultInstance() : targets_; } + public static final int SELECTION_FIELD_NUMBER = 6; + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection selection_; + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + @java.lang.Override + public boolean hasSelection() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection() { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder() { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -20247,6 +23628,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(5, getTargets()); } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(6, getSelection()); + } getUnknownFields().writeTo(output); } @@ -20279,6 +23663,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, getTargets()); } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getSelection()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -20315,6 +23703,11 @@ public boolean equals(final java.lang.Object obj) { if (!getTargets() .equals(other.getTargets())) return false; } + if (hasSelection() != other.hasSelection()) return false; + if (hasSelection()) { + if (!getSelection() + .equals(other.getSelection())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -20346,6 +23739,10 @@ public int hashCode() { hash = (37 * hash) + TARGETS_FIELD_NUMBER; hash = (53 * hash) + getTargets().hashCode(); } + if (hasSelection()) { + hash = (37 * hash) + SELECTION_FIELD_NUMBER; + hash = (53 * hash) + getSelection().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -20477,6 +23874,7 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getTargetsFieldBuilder(); + getSelectionFieldBuilder(); } } @java.lang.Override @@ -20493,6 +23891,11 @@ public Builder clear() { targetsBuilder_.dispose(); targetsBuilder_ = null; } + selection_ = null; + if (selectionBuilder_ != null) { + selectionBuilder_.dispose(); + selectionBuilder_ = null; + } return this; } @@ -20548,6 +23951,12 @@ private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.Weaviat : targetsBuilder_.build(); to_bitField0_ |= 0x00000004; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.selection_ = selectionBuilder_ == null + ? selection_ + : selectionBuilder_.build(); + to_bitField0_ |= 0x00000008; + } result.bitField0_ |= to_bitField0_; } @@ -20619,6 +24028,9 @@ public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateP if (other.hasTargets()) { mergeTargets(other.getTargets()); } + if (other.hasSelection()) { + mergeSelection(other.getSelection()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -20673,6 +24085,13 @@ public Builder mergeFrom( bitField0_ |= 0x00000010; break; } // case 42 + case 50: { + input.readMessage( + getSelectionFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -20857,7 +24276,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearIMUSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=170 + * See v1/base_search.proto;l=178 * @return A list containing the targetVectors. */ @java.lang.Deprecated public com.google.protobuf.ProtocolStringList @@ -20872,7 +24291,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearIMUSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=170 + * See v1/base_search.proto;l=178 * @return The count of targetVectors. */ @java.lang.Deprecated public int getTargetVectorsCount() { @@ -20885,7 +24304,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearIMUSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=170 + * See v1/base_search.proto;l=178 * @param index The index of the element to return. * @return The targetVectors at the given index. */ @@ -20899,7 +24318,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearIMUSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=170 + * See v1/base_search.proto;l=178 * @param index The index of the value to return. * @return The bytes of the targetVectors at the given index. */ @@ -20914,7 +24333,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearIMUSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=170 + * See v1/base_search.proto;l=178 * @param index The index to set the value at. * @param value The targetVectors to set. * @return This builder for chaining. @@ -20935,7 +24354,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearIMUSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=170 + * See v1/base_search.proto;l=178 * @param value The targetVectors to add. * @return This builder for chaining. */ @@ -20955,7 +24374,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearIMUSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=170 + * See v1/base_search.proto;l=178 * @param values The targetVectors to add. * @return This builder for chaining. */ @@ -20975,7 +24394,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearIMUSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=170 + * See v1/base_search.proto;l=178 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearTargetVectors() { @@ -20992,7 +24411,7 @@ private void ensureTargetVectorsIsMutable() { * * repeated string target_vectors = 4 [deprecated = true]; * @deprecated weaviate.v1.NearIMUSearch.target_vectors is deprecated. - * See v1/base_search.proto;l=170 + * See v1/base_search.proto;l=178 * @param value The bytes of the targetVectors to add. * @return This builder for chaining. */ @@ -21127,6 +24546,127 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Tar } return targetsBuilder_; } + + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection selection_; + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder> selectionBuilder_; + /** + * optional .weaviate.v1.Selection selection = 6; + * @return Whether the selection field is set. + */ + public boolean hasSelection() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional .weaviate.v1.Selection selection = 6; + * @return The selection. + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection getSelection() { + if (selectionBuilder_ == null) { + return selection_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } else { + return selectionBuilder_.getMessage(); + } + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder setSelection(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection value) { + if (selectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + selection_ = value; + } else { + selectionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder setSelection( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder builderForValue) { + if (selectionBuilder_ == null) { + selection_ = builderForValue.build(); + } else { + selectionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder mergeSelection(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection value) { + if (selectionBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + selection_ != null && + selection_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance()) { + getSelectionBuilder().mergeFrom(value); + } else { + selection_ = value; + } + } else { + selectionBuilder_.mergeFrom(value); + } + if (selection_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public Builder clearSelection() { + bitField0_ = (bitField0_ & ~0x00000020); + selection_ = null; + if (selectionBuilder_ != null) { + selectionBuilder_.dispose(); + selectionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder getSelectionBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getSelectionFieldBuilder().getBuilder(); + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder getSelectionOrBuilder() { + if (selectionBuilder_ != null) { + return selectionBuilder_.getMessageOrBuilder(); + } else { + return selection_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.getDefaultInstance() : selection_; + } + } + /** + * optional .weaviate.v1.Selection selection = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder> + getSelectionFieldBuilder() { + if (selectionBuilder_ == null) { + selectionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.Selection.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.SelectionOrBuilder>( + getSelection(), + getParentForChildren(), + isClean()); + selection_ = null; + } + return selectionBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -22180,6 +25720,16 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.BM2 private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_weaviate_v1_VectorForTarget_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_weaviate_v1_Selection_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_weaviate_v1_Selection_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_weaviate_v1_Selection_MMR_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_weaviate_v1_Selection_MMR_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_weaviate_v1_SearchOperatorOptions_descriptor; private static final @@ -22267,90 +25817,111 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.BM2 "ts_for_targets\030\004 \003(\0132\035.weaviate.v1.Weigh" + "tsForTargetJ\004\010\003\020\004\"`\n\017VectorForTarget\022\014\n\004" + "name\030\001 \001(\t\022\030\n\014vector_bytes\030\002 \001(\014B\002\030\001\022%\n\007" + - "vectors\030\003 \003(\0132\024.weaviate.v1.Vectors\"\341\001\n\025" + - "SearchOperatorOptions\022=\n\010operator\030\001 \001(\0162" + - "+.weaviate.v1.SearchOperatorOptions.Oper" + - "ator\022$\n\027minimum_or_tokens_match\030\002 \001(\005H\000\210" + - "\001\001\"G\n\010Operator\022\030\n\024OPERATOR_UNSPECIFIED\020\000" + - "\022\017\n\013OPERATOR_OR\020\001\022\020\n\014OPERATOR_AND\020\002B\032\n\030_" + - "minimum_or_tokens_match\"\320\004\n\006Hybrid\022\r\n\005qu" + - "ery\030\001 \001(\t\022\022\n\nproperties\030\002 \003(\t\022\022\n\006vector\030" + - "\003 \003(\002B\002\030\001\022\r\n\005alpha\030\004 \001(\002\0223\n\013fusion_type\030" + - "\005 \001(\0162\036.weaviate.v1.Hybrid.FusionType\022\030\n" + - "\014vector_bytes\030\006 \001(\014B\002\030\001\022\032\n\016target_vector" + - "s\030\007 \003(\tB\002\030\001\022.\n\tnear_text\030\010 \001(\0132\033.weaviat" + - "e.v1.NearTextSearch\022,\n\013near_vector\030\t \001(\013" + - "2\027.weaviate.v1.NearVector\022%\n\007targets\030\n \001" + - "(\0132\024.weaviate.v1.Targets\022E\n\024bm25_search_" + - "operator\030\013 \001(\0132\".weaviate.v1.SearchOpera" + - "torOptionsH\001\210\001\001\022\031\n\017vector_distance\030\024 \001(\002" + - "H\000\022%\n\007vectors\030\025 \003(\0132\024.weaviate.v1.Vector" + - "s\"a\n\nFusionType\022\033\n\027FUSION_TYPE_UNSPECIFI" + - "ED\020\000\022\026\n\022FUSION_TYPE_RANKED\020\001\022\036\n\032FUSION_T" + - "YPE_RELATIVE_SCORE\020\002B\013\n\tthresholdB\027\n\025_bm" + - "25_search_operator\"\255\003\n\nNearVector\022\022\n\006vec" + - "tor\030\001 \003(\002B\002\030\001\022\026\n\tcertainty\030\002 \001(\001H\000\210\001\001\022\025\n" + - "\010distance\030\003 \001(\001H\001\210\001\001\022\030\n\014vector_bytes\030\004 \001" + - "(\014B\002\030\001\022\032\n\016target_vectors\030\005 \003(\tB\002\030\001\022%\n\007ta" + - "rgets\030\006 \001(\0132\024.weaviate.v1.Targets\022K\n\021vec" + - "tor_per_target\030\007 \003(\0132,.weaviate.v1.NearV" + - "ector.VectorPerTargetEntryB\002\030\001\0228\n\022vector" + - "_for_targets\030\010 \003(\0132\034.weaviate.v1.VectorF" + - "orTarget\022%\n\007vectors\030\t \003(\0132\024.weaviate.v1." + - "Vectors\0326\n\024VectorPerTargetEntry\022\013\n\003key\030\001" + - " \001(\t\022\r\n\005value\030\002 \001(\014:\0028\001B\014\n\n_certaintyB\013\n" + - "\t_distance\"\245\001\n\nNearObject\022\n\n\002id\030\001 \001(\t\022\026\n" + - "\tcertainty\030\002 \001(\001H\000\210\001\001\022\025\n\010distance\030\003 \001(\001H" + - "\001\210\001\001\022\032\n\016target_vectors\030\004 \003(\tB\002\030\001\022%\n\007targ" + - "ets\030\005 \001(\0132\024.weaviate.v1.TargetsB\014\n\n_cert" + - "aintyB\013\n\t_distance\"\360\002\n\016NearTextSearch\022\r\n" + - "\005query\030\001 \003(\t\022\026\n\tcertainty\030\002 \001(\001H\000\210\001\001\022\025\n\010" + - "distance\030\003 \001(\001H\001\210\001\001\0226\n\007move_to\030\004 \001(\0132 .w" + - "eaviate.v1.NearTextSearch.MoveH\002\210\001\001\0228\n\tm" + - "ove_away\030\005 \001(\0132 .weaviate.v1.NearTextSea" + - "rch.MoveH\003\210\001\001\022\032\n\016target_vectors\030\006 \003(\tB\002\030" + - "\001\022%\n\007targets\030\007 \001(\0132\024.weaviate.v1.Targets" + - "\0326\n\004Move\022\r\n\005force\030\001 \001(\002\022\020\n\010concepts\030\002 \003(" + - "\t\022\r\n\005uuids\030\003 \003(\tB\014\n\n_certaintyB\013\n\t_dista" + - "nceB\n\n\010_move_toB\014\n\n_move_away\"\255\001\n\017NearIm" + - "ageSearch\022\r\n\005image\030\001 \001(\t\022\026\n\tcertainty\030\002 " + - "\001(\001H\000\210\001\001\022\025\n\010distance\030\003 \001(\001H\001\210\001\001\022\032\n\016targe" + - "t_vectors\030\004 \003(\tB\002\030\001\022%\n\007targets\030\005 \001(\0132\024.w" + - "eaviate.v1.TargetsB\014\n\n_certaintyB\013\n\t_dis" + - "tance\"\255\001\n\017NearAudioSearch\022\r\n\005audio\030\001 \001(\t" + + "vectors\030\003 \003(\0132\024.weaviate.v1.Vectors\"\212\001\n\t" + + "Selection\022)\n\003mmr\030\001 \001(\0132\032.weaviate.v1.Sel" + + "ection.MMRH\000\032E\n\003MMR\022\022\n\005limit\030\001 \001(\rH\000\210\001\001\022" + + "\024\n\007balance\030\002 \001(\002H\001\210\001\001B\010\n\006_limitB\n\n\010_bala" + + "nceB\013\n\tselection\"\341\001\n\025SearchOperatorOptio" + + "ns\022=\n\010operator\030\001 \001(\0162+.weaviate.v1.Searc" + + "hOperatorOptions.Operator\022$\n\027minimum_or_" + + "tokens_match\030\002 \001(\005H\000\210\001\001\"G\n\010Operator\022\030\n\024O" + + "PERATOR_UNSPECIFIED\020\000\022\017\n\013OPERATOR_OR\020\001\022\020" + + "\n\014OPERATOR_AND\020\002B\032\n\030_minimum_or_tokens_m" + + "atch\"\325\005\n\006Hybrid\022\r\n\005query\030\001 \001(\t\022\022\n\nproper" + + "ties\030\002 \003(\t\022\022\n\006vector\030\003 \003(\002B\002\030\001\022\021\n\005alpha\030" + + "\004 \001(\002B\002\030\001\0223\n\013fusion_type\030\005 \001(\0162\036.weaviat" + + "e.v1.Hybrid.FusionType\022\030\n\014vector_bytes\030\006" + + " \001(\014B\002\030\001\022\032\n\016target_vectors\030\007 \003(\tB\002\030\001\022.\n\t" + + "near_text\030\010 \001(\0132\033.weaviate.v1.NearTextSe" + + "arch\022,\n\013near_vector\030\t \001(\0132\027.weaviate.v1." + + "NearVector\022%\n\007targets\030\n \001(\0132\024.weaviate.v" + + "1.Targets\022E\n\024bm25_search_operator\030\013 \001(\0132" + + "\".weaviate.v1.SearchOperatorOptionsH\001\210\001\001" + + "\022\030\n\013alpha_param\030\014 \001(\002H\002\210\001\001\022\027\n\017use_alpha_" + + "param\030\r \001(\010\022.\n\tselection\030\016 \001(\0132\026.weaviat" + + "e.v1.SelectionH\003\210\001\001\022\031\n\017vector_distance\030\024" + + " \001(\002H\000\022%\n\007vectors\030\025 \003(\0132\024.weaviate.v1.Ve" + + "ctors\"a\n\nFusionType\022\033\n\027FUSION_TYPE_UNSPE" + + "CIFIED\020\000\022\026\n\022FUSION_TYPE_RANKED\020\001\022\036\n\032FUSI" + + "ON_TYPE_RELATIVE_SCORE\020\002B\013\n\tthresholdB\027\n" + + "\025_bm25_search_operatorB\016\n\014_alpha_paramB\014" + + "\n\n_selection\"\353\003\n\nNearVector\022\022\n\006vector\030\001 " + + "\003(\002B\002\030\001\022\026\n\tcertainty\030\002 \001(\001H\000\210\001\001\022\025\n\010dista" + + "nce\030\003 \001(\001H\001\210\001\001\022\030\n\014vector_bytes\030\004 \001(\014B\002\030\001" + + "\022\032\n\016target_vectors\030\005 \003(\tB\002\030\001\022%\n\007targets\030" + + "\006 \001(\0132\024.weaviate.v1.Targets\022K\n\021vector_pe" + + "r_target\030\007 \003(\0132,.weaviate.v1.NearVector." + + "VectorPerTargetEntryB\002\030\001\0228\n\022vector_for_t" + + "argets\030\010 \003(\0132\034.weaviate.v1.VectorForTarg" + + "et\022%\n\007vectors\030\t \003(\0132\024.weaviate.v1.Vector" + + "s\022.\n\tselection\030\n \001(\0132\026.weaviate.v1.Selec" + + "tionH\002\210\001\001\0326\n\024VectorPerTargetEntry\022\013\n\003key" + + "\030\001 \001(\t\022\r\n\005value\030\002 \001(\014:\0028\001B\014\n\n_certaintyB" + + "\013\n\t_distanceB\014\n\n_selection\"\343\001\n\nNearObjec" + + "t\022\n\n\002id\030\001 \001(\t\022\026\n\tcertainty\030\002 \001(\001H\000\210\001\001\022\025\n" + + "\010distance\030\003 \001(\001H\001\210\001\001\022\032\n\016target_vectors\030\004" + + " \003(\tB\002\030\001\022%\n\007targets\030\005 \001(\0132\024.weaviate.v1." + + "Targets\022.\n\tselection\030\006 \001(\0132\026.weaviate.v1" + + ".SelectionH\002\210\001\001B\014\n\n_certaintyB\013\n\t_distan" + + "ceB\014\n\n_selection\"\256\003\n\016NearTextSearch\022\r\n\005q" + + "uery\030\001 \003(\t\022\026\n\tcertainty\030\002 \001(\001H\000\210\001\001\022\025\n\010di" + + "stance\030\003 \001(\001H\001\210\001\001\0226\n\007move_to\030\004 \001(\0132 .wea" + + "viate.v1.NearTextSearch.MoveH\002\210\001\001\0228\n\tmov" + + "e_away\030\005 \001(\0132 .weaviate.v1.NearTextSearc" + + "h.MoveH\003\210\001\001\022\032\n\016target_vectors\030\006 \003(\tB\002\030\001\022" + + "%\n\007targets\030\007 \001(\0132\024.weaviate.v1.Targets\022." + + "\n\tselection\030\010 \001(\0132\026.weaviate.v1.Selectio" + + "nH\004\210\001\001\0326\n\004Move\022\r\n\005force\030\001 \001(\002\022\020\n\010concept" + + "s\030\002 \003(\t\022\r\n\005uuids\030\003 \003(\tB\014\n\n_certaintyB\013\n\t" + + "_distanceB\n\n\010_move_toB\014\n\n_move_awayB\014\n\n_" + + "selection\"\353\001\n\017NearImageSearch\022\r\n\005image\030\001" + + " \001(\t\022\026\n\tcertainty\030\002 \001(\001H\000\210\001\001\022\025\n\010distance" + + "\030\003 \001(\001H\001\210\001\001\022\032\n\016target_vectors\030\004 \003(\tB\002\030\001\022" + + "%\n\007targets\030\005 \001(\0132\024.weaviate.v1.Targets\022." + + "\n\tselection\030\006 \001(\0132\026.weaviate.v1.Selectio" + + "nH\002\210\001\001B\014\n\n_certaintyB\013\n\t_distanceB\014\n\n_se" + + "lection\"\353\001\n\017NearAudioSearch\022\r\n\005audio\030\001 \001" + + "(\t\022\026\n\tcertainty\030\002 \001(\001H\000\210\001\001\022\025\n\010distance\030\003" + + " \001(\001H\001\210\001\001\022\032\n\016target_vectors\030\004 \003(\tB\002\030\001\022%\n" + + "\007targets\030\005 \001(\0132\024.weaviate.v1.Targets\022.\n\t" + + "selection\030\006 \001(\0132\026.weaviate.v1.SelectionH" + + "\002\210\001\001B\014\n\n_certaintyB\013\n\t_distanceB\014\n\n_sele" + + "ction\"\353\001\n\017NearVideoSearch\022\r\n\005video\030\001 \001(\t" + "\022\026\n\tcertainty\030\002 \001(\001H\000\210\001\001\022\025\n\010distance\030\003 \001" + "(\001H\001\210\001\001\022\032\n\016target_vectors\030\004 \003(\tB\002\030\001\022%\n\007t" + - "argets\030\005 \001(\0132\024.weaviate.v1.TargetsB\014\n\n_c" + - "ertaintyB\013\n\t_distance\"\255\001\n\017NearVideoSearc" + - "h\022\r\n\005video\030\001 \001(\t\022\026\n\tcertainty\030\002 \001(\001H\000\210\001\001" + - "\022\025\n\010distance\030\003 \001(\001H\001\210\001\001\022\032\n\016target_vector" + - "s\030\004 \003(\tB\002\030\001\022%\n\007targets\030\005 \001(\0132\024.weaviate." + - "v1.TargetsB\014\n\n_certaintyB\013\n\t_distance\"\255\001" + - "\n\017NearDepthSearch\022\r\n\005depth\030\001 \001(\t\022\026\n\tcert" + - "ainty\030\002 \001(\001H\000\210\001\001\022\025\n\010distance\030\003 \001(\001H\001\210\001\001\022" + - "\032\n\016target_vectors\030\004 \003(\tB\002\030\001\022%\n\007targets\030\005" + - " \001(\0132\024.weaviate.v1.TargetsB\014\n\n_certainty" + - "B\013\n\t_distance\"\261\001\n\021NearThermalSearch\022\017\n\007t" + - "hermal\030\001 \001(\t\022\026\n\tcertainty\030\002 \001(\001H\000\210\001\001\022\025\n\010" + - "distance\030\003 \001(\001H\001\210\001\001\022\032\n\016target_vectors\030\004 " + - "\003(\tB\002\030\001\022%\n\007targets\030\005 \001(\0132\024.weaviate.v1.T" + - "argetsB\014\n\n_certaintyB\013\n\t_distance\"\251\001\n\rNe" + - "arIMUSearch\022\013\n\003imu\030\001 \001(\t\022\026\n\tcertainty\030\002 " + - "\001(\001H\000\210\001\001\022\025\n\010distance\030\003 \001(\001H\001\210\001\001\022\032\n\016targe" + - "t_vectors\030\004 \003(\tB\002\030\001\022%\n\007targets\030\005 \001(\0132\024.w" + - "eaviate.v1.TargetsB\014\n\n_certaintyB\013\n\t_dis" + - "tance\"\177\n\004BM25\022\r\n\005query\030\001 \001(\t\022\022\n\nproperti" + - "es\030\002 \003(\t\022@\n\017search_operator\030\003 \001(\0132\".weav" + - "iate.v1.SearchOperatorOptionsH\000\210\001\001B\022\n\020_s" + - "earch_operator*\356\001\n\021CombinationMethod\022\"\n\036" + - "COMBINATION_METHOD_UNSPECIFIED\020\000\022\037\n\033COMB" + - "INATION_METHOD_TYPE_SUM\020\001\022\037\n\033COMBINATION" + - "_METHOD_TYPE_MIN\020\002\022#\n\037COMBINATION_METHOD" + - "_TYPE_AVERAGE\020\003\022*\n&COMBINATION_METHOD_TY" + - "PE_RELATIVE_SCORE\020\004\022\"\n\036COMBINATION_METHO" + - "D_TYPE_MANUAL\020\005BH\n-io.weaviate.client6.v" + - "1.internal.grpc.protocolB\027WeaviateProtoB" + - "aseSearchb\006proto3" + "argets\030\005 \001(\0132\024.weaviate.v1.Targets\022.\n\tse" + + "lection\030\006 \001(\0132\026.weaviate.v1.SelectionH\002\210" + + "\001\001B\014\n\n_certaintyB\013\n\t_distanceB\014\n\n_select" + + "ion\"\353\001\n\017NearDepthSearch\022\r\n\005depth\030\001 \001(\t\022\026" + + "\n\tcertainty\030\002 \001(\001H\000\210\001\001\022\025\n\010distance\030\003 \001(\001" + + "H\001\210\001\001\022\032\n\016target_vectors\030\004 \003(\tB\002\030\001\022%\n\007tar" + + "gets\030\005 \001(\0132\024.weaviate.v1.Targets\022.\n\tsele" + + "ction\030\006 \001(\0132\026.weaviate.v1.SelectionH\002\210\001\001" + + "B\014\n\n_certaintyB\013\n\t_distanceB\014\n\n_selectio" + + "n\"\357\001\n\021NearThermalSearch\022\017\n\007thermal\030\001 \001(\t" + + "\022\026\n\tcertainty\030\002 \001(\001H\000\210\001\001\022\025\n\010distance\030\003 \001" + + "(\001H\001\210\001\001\022\032\n\016target_vectors\030\004 \003(\tB\002\030\001\022%\n\007t" + + "argets\030\005 \001(\0132\024.weaviate.v1.Targets\022.\n\tse" + + "lection\030\006 \001(\0132\026.weaviate.v1.SelectionH\002\210" + + "\001\001B\014\n\n_certaintyB\013\n\t_distanceB\014\n\n_select" + + "ion\"\347\001\n\rNearIMUSearch\022\013\n\003imu\030\001 \001(\t\022\026\n\tce" + + "rtainty\030\002 \001(\001H\000\210\001\001\022\025\n\010distance\030\003 \001(\001H\001\210\001" + + "\001\022\032\n\016target_vectors\030\004 \003(\tB\002\030\001\022%\n\007targets" + + "\030\005 \001(\0132\024.weaviate.v1.Targets\022.\n\tselectio" + + "n\030\006 \001(\0132\026.weaviate.v1.SelectionH\002\210\001\001B\014\n\n" + + "_certaintyB\013\n\t_distanceB\014\n\n_selection\"\177\n" + + "\004BM25\022\r\n\005query\030\001 \001(\t\022\022\n\nproperties\030\002 \003(\t" + + "\022@\n\017search_operator\030\003 \001(\0132\".weaviate.v1." + + "SearchOperatorOptionsH\000\210\001\001B\022\n\020_search_op" + + "erator*\356\001\n\021CombinationMethod\022\"\n\036COMBINAT" + + "ION_METHOD_UNSPECIFIED\020\000\022\037\n\033COMBINATION_" + + "METHOD_TYPE_SUM\020\001\022\037\n\033COMBINATION_METHOD_" + + "TYPE_MIN\020\002\022#\n\037COMBINATION_METHOD_TYPE_AV" + + "ERAGE\020\003\022*\n&COMBINATION_METHOD_TYPE_RELAT" + + "IVE_SCORE\020\004\022\"\n\036COMBINATION_METHOD_TYPE_M" + + "ANUAL\020\005BH\n-io.weaviate.client6.v1.intern" + + "al.grpc.protocolB\027WeaviateProtoBaseSearc" + + "hb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -22375,24 +25946,36 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.BM2 com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_VectorForTarget_descriptor, new java.lang.String[] { "Name", "VectorBytes", "Vectors", }); - internal_static_weaviate_v1_SearchOperatorOptions_descriptor = + internal_static_weaviate_v1_Selection_descriptor = getDescriptor().getMessageTypes().get(3); + internal_static_weaviate_v1_Selection_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_weaviate_v1_Selection_descriptor, + new java.lang.String[] { "Mmr", "Selection", }); + internal_static_weaviate_v1_Selection_MMR_descriptor = + internal_static_weaviate_v1_Selection_descriptor.getNestedTypes().get(0); + internal_static_weaviate_v1_Selection_MMR_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_weaviate_v1_Selection_MMR_descriptor, + new java.lang.String[] { "Limit", "Balance", "Limit", "Balance", }); + internal_static_weaviate_v1_SearchOperatorOptions_descriptor = + getDescriptor().getMessageTypes().get(4); internal_static_weaviate_v1_SearchOperatorOptions_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_SearchOperatorOptions_descriptor, new java.lang.String[] { "Operator", "MinimumOrTokensMatch", "MinimumOrTokensMatch", }); internal_static_weaviate_v1_Hybrid_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(5); internal_static_weaviate_v1_Hybrid_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_Hybrid_descriptor, - new java.lang.String[] { "Query", "Properties", "Vector", "Alpha", "FusionType", "VectorBytes", "TargetVectors", "NearText", "NearVector", "Targets", "Bm25SearchOperator", "VectorDistance", "Vectors", "Threshold", "Bm25SearchOperator", }); + new java.lang.String[] { "Query", "Properties", "Vector", "Alpha", "FusionType", "VectorBytes", "TargetVectors", "NearText", "NearVector", "Targets", "Bm25SearchOperator", "AlphaParam", "UseAlphaParam", "Selection", "VectorDistance", "Vectors", "Threshold", "Bm25SearchOperator", "AlphaParam", "Selection", }); internal_static_weaviate_v1_NearVector_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(6); internal_static_weaviate_v1_NearVector_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_NearVector_descriptor, - new java.lang.String[] { "Vector", "Certainty", "Distance", "VectorBytes", "TargetVectors", "Targets", "VectorPerTarget", "VectorForTargets", "Vectors", "Certainty", "Distance", }); + new java.lang.String[] { "Vector", "Certainty", "Distance", "VectorBytes", "TargetVectors", "Targets", "VectorPerTarget", "VectorForTargets", "Vectors", "Selection", "Certainty", "Distance", "Selection", }); internal_static_weaviate_v1_NearVector_VectorPerTargetEntry_descriptor = internal_static_weaviate_v1_NearVector_descriptor.getNestedTypes().get(0); internal_static_weaviate_v1_NearVector_VectorPerTargetEntry_fieldAccessorTable = new @@ -22400,17 +25983,17 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.BM2 internal_static_weaviate_v1_NearVector_VectorPerTargetEntry_descriptor, new java.lang.String[] { "Key", "Value", }); internal_static_weaviate_v1_NearObject_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(7); internal_static_weaviate_v1_NearObject_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_NearObject_descriptor, - new java.lang.String[] { "Id", "Certainty", "Distance", "TargetVectors", "Targets", "Certainty", "Distance", }); + new java.lang.String[] { "Id", "Certainty", "Distance", "TargetVectors", "Targets", "Selection", "Certainty", "Distance", "Selection", }); internal_static_weaviate_v1_NearTextSearch_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageTypes().get(8); internal_static_weaviate_v1_NearTextSearch_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_NearTextSearch_descriptor, - new java.lang.String[] { "Query", "Certainty", "Distance", "MoveTo", "MoveAway", "TargetVectors", "Targets", "Certainty", "Distance", "MoveTo", "MoveAway", }); + new java.lang.String[] { "Query", "Certainty", "Distance", "MoveTo", "MoveAway", "TargetVectors", "Targets", "Selection", "Certainty", "Distance", "MoveTo", "MoveAway", "Selection", }); internal_static_weaviate_v1_NearTextSearch_Move_descriptor = internal_static_weaviate_v1_NearTextSearch_descriptor.getNestedTypes().get(0); internal_static_weaviate_v1_NearTextSearch_Move_fieldAccessorTable = new @@ -22418,43 +26001,43 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBaseSearch.BM2 internal_static_weaviate_v1_NearTextSearch_Move_descriptor, new java.lang.String[] { "Force", "Concepts", "Uuids", }); internal_static_weaviate_v1_NearImageSearch_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(9); internal_static_weaviate_v1_NearImageSearch_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_NearImageSearch_descriptor, - new java.lang.String[] { "Image", "Certainty", "Distance", "TargetVectors", "Targets", "Certainty", "Distance", }); + new java.lang.String[] { "Image", "Certainty", "Distance", "TargetVectors", "Targets", "Selection", "Certainty", "Distance", "Selection", }); internal_static_weaviate_v1_NearAudioSearch_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(10); internal_static_weaviate_v1_NearAudioSearch_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_NearAudioSearch_descriptor, - new java.lang.String[] { "Audio", "Certainty", "Distance", "TargetVectors", "Targets", "Certainty", "Distance", }); + new java.lang.String[] { "Audio", "Certainty", "Distance", "TargetVectors", "Targets", "Selection", "Certainty", "Distance", "Selection", }); internal_static_weaviate_v1_NearVideoSearch_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(11); internal_static_weaviate_v1_NearVideoSearch_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_NearVideoSearch_descriptor, - new java.lang.String[] { "Video", "Certainty", "Distance", "TargetVectors", "Targets", "Certainty", "Distance", }); + new java.lang.String[] { "Video", "Certainty", "Distance", "TargetVectors", "Targets", "Selection", "Certainty", "Distance", "Selection", }); internal_static_weaviate_v1_NearDepthSearch_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(12); internal_static_weaviate_v1_NearDepthSearch_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_NearDepthSearch_descriptor, - new java.lang.String[] { "Depth", "Certainty", "Distance", "TargetVectors", "Targets", "Certainty", "Distance", }); + new java.lang.String[] { "Depth", "Certainty", "Distance", "TargetVectors", "Targets", "Selection", "Certainty", "Distance", "Selection", }); internal_static_weaviate_v1_NearThermalSearch_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(13); internal_static_weaviate_v1_NearThermalSearch_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_NearThermalSearch_descriptor, - new java.lang.String[] { "Thermal", "Certainty", "Distance", "TargetVectors", "Targets", "Certainty", "Distance", }); + new java.lang.String[] { "Thermal", "Certainty", "Distance", "TargetVectors", "Targets", "Selection", "Certainty", "Distance", "Selection", }); internal_static_weaviate_v1_NearIMUSearch_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(14); internal_static_weaviate_v1_NearIMUSearch_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_NearIMUSearch_descriptor, - new java.lang.String[] { "Imu", "Certainty", "Distance", "TargetVectors", "Targets", "Certainty", "Distance", }); + new java.lang.String[] { "Imu", "Certainty", "Distance", "TargetVectors", "Targets", "Selection", "Certainty", "Distance", "Selection", }); internal_static_weaviate_v1_BM25_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(15); internal_static_weaviate_v1_BM25_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_BM25_descriptor, diff --git a/src/main/java/io/weaviate/client6/v1/internal/grpc/protocol/WeaviateProtoBatch.java b/src/main/java/io/weaviate/client6/v1/internal/grpc/protocol/WeaviateProtoBatch.java index 1c1007a32..af7173b0c 100644 --- a/src/main/java/io/weaviate/client6/v1/internal/grpc/protocol/WeaviateProtoBatch.java +++ b/src/main/java/io/weaviate/client6/v1/internal/grpc/protocol/WeaviateProtoBatch.java @@ -6338,21 +6338,6 @@ public interface BatchStreamReplyOrBuilder extends */ io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDownOrBuilder getShuttingDownOrBuilder(); - /** - * .weaviate.v1.BatchStreamReply.Shutdown shutdown = 3; - * @return Whether the shutdown field is set. - */ - boolean hasShutdown(); - /** - * .weaviate.v1.BatchStreamReply.Shutdown shutdown = 3; - * @return The shutdown. - */ - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown getShutdown(); - /** - * .weaviate.v1.BatchStreamReply.Shutdown shutdown = 3; - */ - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShutdownOrBuilder getShutdownOrBuilder(); - /** * .weaviate.v1.BatchStreamReply.Started started = 4; * @return Whether the started field is set. @@ -6836,451 +6821,54 @@ public static com.google.protobuf.Parser parser() { } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Started getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface ShuttingDownOrBuilder extends - // @@protoc_insertion_point(interface_extends:weaviate.v1.BatchStreamReply.ShuttingDown) - com.google.protobuf.MessageOrBuilder { - } - /** - * Protobuf type {@code weaviate.v1.BatchStreamReply.ShuttingDown} - */ - public static final class ShuttingDown extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:weaviate.v1.BatchStreamReply.ShuttingDown) - ShuttingDownOrBuilder { - private static final long serialVersionUID = 0L; - // Use ShuttingDown.newBuilder() to construct. - private ShuttingDown(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ShuttingDown() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ShuttingDown(); - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.internal_static_weaviate_v1_BatchStreamReply_ShuttingDown_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.internal_static_weaviate_v1_BatchStreamReply_ShuttingDown_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown.class, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown.Builder.class); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown)) { - return super.equals(obj); - } - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown other = (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown) obj; - - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code weaviate.v1.BatchStreamReply.ShuttingDown} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:weaviate.v1.BatchStreamReply.ShuttingDown) - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDownOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.internal_static_weaviate_v1_BatchStreamReply_ShuttingDown_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.internal_static_weaviate_v1_BatchStreamReply_ShuttingDown_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown.class, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown.Builder.class); - } - - // Construct using io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - - } - @java.lang.Override - public Builder clear() { - super.clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.internal_static_weaviate_v1_BatchStreamReply_ShuttingDown_descriptor; - } - - @java.lang.Override - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown getDefaultInstanceForType() { - return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown.getDefaultInstance(); - } - - @java.lang.Override - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown build() { - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown buildPartial() { - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown result = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown(this); - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown) { - return mergeFrom((io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown other) { - if (other == io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown.getDefaultInstance()) return this; - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:weaviate.v1.BatchStreamReply.ShuttingDown) - } - - // @@protoc_insertion_point(class_scope:weaviate.v1.BatchStreamReply.ShuttingDown) - private static final io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown(); - } - - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ShuttingDown parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown getDefaultInstanceForType() { + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Started getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ShutdownOrBuilder extends - // @@protoc_insertion_point(interface_extends:weaviate.v1.BatchStreamReply.Shutdown) + public interface ShuttingDownOrBuilder extends + // @@protoc_insertion_point(interface_extends:weaviate.v1.BatchStreamReply.ShuttingDown) com.google.protobuf.MessageOrBuilder { } /** - * Protobuf type {@code weaviate.v1.BatchStreamReply.Shutdown} + * Protobuf type {@code weaviate.v1.BatchStreamReply.ShuttingDown} */ - public static final class Shutdown extends + public static final class ShuttingDown extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:weaviate.v1.BatchStreamReply.Shutdown) - ShutdownOrBuilder { + // @@protoc_insertion_point(message_implements:weaviate.v1.BatchStreamReply.ShuttingDown) + ShuttingDownOrBuilder { private static final long serialVersionUID = 0L; - // Use Shutdown.newBuilder() to construct. - private Shutdown(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ShuttingDown.newBuilder() to construct. + private ShuttingDown(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private Shutdown() { + private ShuttingDown() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new Shutdown(); + return new ShuttingDown(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.internal_static_weaviate_v1_BatchStreamReply_Shutdown_descriptor; + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.internal_static_weaviate_v1_BatchStreamReply_ShuttingDown_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.internal_static_weaviate_v1_BatchStreamReply_Shutdown_fieldAccessorTable + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.internal_static_weaviate_v1_BatchStreamReply_ShuttingDown_fieldAccessorTable .ensureFieldAccessorsInitialized( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown.class, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown.Builder.class); + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown.class, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown.Builder.class); } private byte memoizedIsInitialized = -1; @@ -7316,10 +6904,10 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown)) { + if (!(obj instanceof io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown)) { return super.equals(obj); } - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown other = (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown) obj; + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown other = (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown) obj; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; @@ -7337,44 +6925,44 @@ public int hashCode() { return hash; } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown parseFrom( + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown parseFrom( + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown parseFrom( + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown parseFrom( + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown parseFrom(byte[] data) + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown parseFrom( + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown parseFrom(java.io.InputStream input) + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown parseFrom( + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -7382,26 +6970,26 @@ public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.B .parseWithIOException(PARSER, input, extensionRegistry); } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown parseDelimitedFrom(java.io.InputStream input) + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown parseDelimitedFrom( + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown parseFrom( + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown parseFrom( + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -7414,7 +7002,7 @@ public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.B public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown prototype) { + public static Builder newBuilder(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -7430,26 +7018,26 @@ protected Builder newBuilderForType( return builder; } /** - * Protobuf type {@code weaviate.v1.BatchStreamReply.Shutdown} + * Protobuf type {@code weaviate.v1.BatchStreamReply.ShuttingDown} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:weaviate.v1.BatchStreamReply.Shutdown) - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShutdownOrBuilder { + // @@protoc_insertion_point(builder_implements:weaviate.v1.BatchStreamReply.ShuttingDown) + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDownOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.internal_static_weaviate_v1_BatchStreamReply_Shutdown_descriptor; + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.internal_static_weaviate_v1_BatchStreamReply_ShuttingDown_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.internal_static_weaviate_v1_BatchStreamReply_Shutdown_fieldAccessorTable + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.internal_static_weaviate_v1_BatchStreamReply_ShuttingDown_fieldAccessorTable .ensureFieldAccessorsInitialized( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown.class, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown.Builder.class); + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown.class, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown.Builder.class); } - // Construct using io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown.newBuilder() + // Construct using io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown.newBuilder() private Builder() { } @@ -7468,17 +7056,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.internal_static_weaviate_v1_BatchStreamReply_Shutdown_descriptor; + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.internal_static_weaviate_v1_BatchStreamReply_ShuttingDown_descriptor; } @java.lang.Override - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown getDefaultInstanceForType() { - return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown.getDefaultInstance(); + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown getDefaultInstanceForType() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown.getDefaultInstance(); } @java.lang.Override - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown build() { - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown result = buildPartial(); + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown build() { + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -7486,8 +7074,8 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStr } @java.lang.Override - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown buildPartial() { - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown result = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown(this); + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown buildPartial() { + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown result = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown(this); onBuilt(); return result; } @@ -7526,16 +7114,16 @@ public Builder addRepeatedField( } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown) { - return mergeFrom((io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown)other); + if (other instanceof io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown) { + return mergeFrom((io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown other) { - if (other == io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown.getDefaultInstance()) return this; + public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown other) { + if (other == io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown.getDefaultInstance()) return this; this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -7590,23 +7178,23 @@ public final Builder mergeUnknownFields( } - // @@protoc_insertion_point(builder_scope:weaviate.v1.BatchStreamReply.Shutdown) + // @@protoc_insertion_point(builder_scope:weaviate.v1.BatchStreamReply.ShuttingDown) } - // @@protoc_insertion_point(class_scope:weaviate.v1.BatchStreamReply.Shutdown) - private static final io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:weaviate.v1.BatchStreamReply.ShuttingDown) + private static final io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown(); + DEFAULT_INSTANCE = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown(); } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown getDefaultInstance() { + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public Shutdown parsePartialFrom( + public ShuttingDown parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -7625,17 +7213,17 @@ public Shutdown parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown getDefaultInstanceForType() { + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -7694,6 +7282,17 @@ public interface OutOfMemoryOrBuilder extends */ com.google.protobuf.ByteString getBeaconsBytes(int index); + + /** + *
+       * How long to wait until ShuttingDown is sent, in seconds
+       * If ShuttingDown is not set by this time, the client should exit the stream
+       * 
+ * + * int32 wait_time = 3; + * @return The waitTime. + */ + int getWaitTime(); } /** * Protobuf type {@code weaviate.v1.BatchStreamReply.OutOfMemory} @@ -7808,6 +7407,22 @@ public java.lang.String getBeacons(int index) { return beacons_.getByteString(index); } + public static final int WAIT_TIME_FIELD_NUMBER = 3; + private int waitTime_ = 0; + /** + *
+       * How long to wait until ShuttingDown is sent, in seconds
+       * If ShuttingDown is not set by this time, the client should exit the stream
+       * 
+ * + * int32 wait_time = 3; + * @return The waitTime. + */ + @java.lang.Override + public int getWaitTime() { + return waitTime_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -7828,6 +7443,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) for (int i = 0; i < beacons_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, beacons_.getRaw(i)); } + if (waitTime_ != 0) { + output.writeInt32(3, waitTime_); + } getUnknownFields().writeTo(output); } @@ -7853,6 +7471,10 @@ public int getSerializedSize() { size += dataSize; size += 1 * getBeaconsList().size(); } + if (waitTime_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, waitTime_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -7872,6 +7494,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getUuidsList())) return false; if (!getBeaconsList() .equals(other.getBeaconsList())) return false; + if (getWaitTime() + != other.getWaitTime()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -7891,6 +7515,8 @@ public int hashCode() { hash = (37 * hash) + BEACONS_FIELD_NUMBER; hash = (53 * hash) + getBeaconsList().hashCode(); } + hash = (37 * hash) + WAIT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getWaitTime(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -8026,6 +7652,7 @@ public Builder clear() { com.google.protobuf.LazyStringArrayList.emptyList(); beacons_ = com.google.protobuf.LazyStringArrayList.emptyList(); + waitTime_ = 0; return this; } @@ -8067,6 +7694,9 @@ private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.Weaviat beacons_.makeImmutable(); result.beacons_ = beacons_; } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.waitTime_ = waitTime_; + } } @java.lang.Override @@ -8133,6 +7763,9 @@ public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateP } onChanged(); } + if (other.getWaitTime() != 0) { + setWaitTime(other.getWaitTime()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -8171,6 +7804,11 @@ public Builder mergeFrom( beacons_.add(s); break; } // case 18 + case 24: { + waitTime_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -8409,6 +8047,53 @@ public Builder addBeaconsBytes( onChanged(); return this; } + + private int waitTime_ ; + /** + *
+         * How long to wait until ShuttingDown is sent, in seconds
+         * If ShuttingDown is not set by this time, the client should exit the stream
+         * 
+ * + * int32 wait_time = 3; + * @return The waitTime. + */ + @java.lang.Override + public int getWaitTime() { + return waitTime_; + } + /** + *
+         * How long to wait until ShuttingDown is sent, in seconds
+         * If ShuttingDown is not set by this time, the client should exit the stream
+         * 
+ * + * int32 wait_time = 3; + * @param value The waitTime to set. + * @return This builder for chaining. + */ + public Builder setWaitTime(int value) { + + waitTime_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+         * How long to wait until ShuttingDown is sent, in seconds
+         * If ShuttingDown is not set by this time, the client should exit the stream
+         * 
+ * + * int32 wait_time = 3; + * @return This builder for chaining. + */ + public Builder clearWaitTime() { + bitField0_ = (bitField0_ & ~0x00000004); + waitTime_ = 0; + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -12815,7 +12500,6 @@ public enum MessageCase com.google.protobuf.AbstractMessage.InternalOneOfEnum { RESULTS(1), SHUTTING_DOWN(2), - SHUTDOWN(3), STARTED(4), BACKOFF(5), ACKS(6), @@ -12839,7 +12523,6 @@ public static MessageCase forNumber(int value) { switch (value) { case 1: return RESULTS; case 2: return SHUTTING_DOWN; - case 3: return SHUTDOWN; case 4: return STARTED; case 5: return BACKOFF; case 6: return ACKS; @@ -12921,37 +12604,6 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStr return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown.getDefaultInstance(); } - public static final int SHUTDOWN_FIELD_NUMBER = 3; - /** - * .weaviate.v1.BatchStreamReply.Shutdown shutdown = 3; - * @return Whether the shutdown field is set. - */ - @java.lang.Override - public boolean hasShutdown() { - return messageCase_ == 3; - } - /** - * .weaviate.v1.BatchStreamReply.Shutdown shutdown = 3; - * @return The shutdown. - */ - @java.lang.Override - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown getShutdown() { - if (messageCase_ == 3) { - return (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown) message_; - } - return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown.getDefaultInstance(); - } - /** - * .weaviate.v1.BatchStreamReply.Shutdown shutdown = 3; - */ - @java.lang.Override - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShutdownOrBuilder getShutdownOrBuilder() { - if (messageCase_ == 3) { - return (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown) message_; - } - return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown.getDefaultInstance(); - } - public static final int STARTED_FIELD_NUMBER = 4; /** * .weaviate.v1.BatchStreamReply.Started started = 4; @@ -13096,9 +12748,6 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (messageCase_ == 2) { output.writeMessage(2, (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown) message_); } - if (messageCase_ == 3) { - output.writeMessage(3, (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown) message_); - } if (messageCase_ == 4) { output.writeMessage(4, (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Started) message_); } @@ -13128,10 +12777,6 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShuttingDown) message_); } - if (messageCase_ == 3) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown) message_); - } if (messageCase_ == 4) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(4, (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Started) message_); @@ -13173,10 +12818,6 @@ public boolean equals(final java.lang.Object obj) { if (!getShuttingDown() .equals(other.getShuttingDown())) return false; break; - case 3: - if (!getShutdown() - .equals(other.getShutdown())) return false; - break; case 4: if (!getStarted() .equals(other.getStarted())) return false; @@ -13216,10 +12857,6 @@ public int hashCode() { hash = (37 * hash) + SHUTTING_DOWN_FIELD_NUMBER; hash = (53 * hash) + getShuttingDown().hashCode(); break; - case 3: - hash = (37 * hash) + SHUTDOWN_FIELD_NUMBER; - hash = (53 * hash) + getShutdown().hashCode(); - break; case 4: hash = (37 * hash) + STARTED_FIELD_NUMBER; hash = (53 * hash) + getStarted().hashCode(); @@ -13376,9 +13013,6 @@ public Builder clear() { if (shuttingDownBuilder_ != null) { shuttingDownBuilder_.clear(); } - if (shutdownBuilder_ != null) { - shutdownBuilder_.clear(); - } if (startedBuilder_ != null) { startedBuilder_.clear(); } @@ -13440,10 +13074,6 @@ private void buildPartialOneofs(io.weaviate.client6.v1.internal.grpc.protocol.We shuttingDownBuilder_ != null) { result.message_ = shuttingDownBuilder_.build(); } - if (messageCase_ == 3 && - shutdownBuilder_ != null) { - result.message_ = shutdownBuilder_.build(); - } if (messageCase_ == 4 && startedBuilder_ != null) { result.message_ = startedBuilder_.build(); @@ -13515,10 +13145,6 @@ public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateP mergeShuttingDown(other.getShuttingDown()); break; } - case SHUTDOWN: { - mergeShutdown(other.getShutdown()); - break; - } case STARTED: { mergeStarted(other.getStarted()); break; @@ -13579,13 +13205,6 @@ public Builder mergeFrom( messageCase_ = 2; break; } // case 18 - case 26: { - input.readMessage( - getShutdownFieldBuilder().getBuilder(), - extensionRegistry); - messageCase_ = 3; - break; - } // case 26 case 34: { input.readMessage( getStartedFieldBuilder().getBuilder(), @@ -13930,148 +13549,6 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStr return shuttingDownBuilder_; } - private com.google.protobuf.SingleFieldBuilderV3< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShutdownOrBuilder> shutdownBuilder_; - /** - * .weaviate.v1.BatchStreamReply.Shutdown shutdown = 3; - * @return Whether the shutdown field is set. - */ - @java.lang.Override - public boolean hasShutdown() { - return messageCase_ == 3; - } - /** - * .weaviate.v1.BatchStreamReply.Shutdown shutdown = 3; - * @return The shutdown. - */ - @java.lang.Override - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown getShutdown() { - if (shutdownBuilder_ == null) { - if (messageCase_ == 3) { - return (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown) message_; - } - return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown.getDefaultInstance(); - } else { - if (messageCase_ == 3) { - return shutdownBuilder_.getMessage(); - } - return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown.getDefaultInstance(); - } - } - /** - * .weaviate.v1.BatchStreamReply.Shutdown shutdown = 3; - */ - public Builder setShutdown(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown value) { - if (shutdownBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - message_ = value; - onChanged(); - } else { - shutdownBuilder_.setMessage(value); - } - messageCase_ = 3; - return this; - } - /** - * .weaviate.v1.BatchStreamReply.Shutdown shutdown = 3; - */ - public Builder setShutdown( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown.Builder builderForValue) { - if (shutdownBuilder_ == null) { - message_ = builderForValue.build(); - onChanged(); - } else { - shutdownBuilder_.setMessage(builderForValue.build()); - } - messageCase_ = 3; - return this; - } - /** - * .weaviate.v1.BatchStreamReply.Shutdown shutdown = 3; - */ - public Builder mergeShutdown(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown value) { - if (shutdownBuilder_ == null) { - if (messageCase_ == 3 && - message_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown.getDefaultInstance()) { - message_ = io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown.newBuilder((io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown) message_) - .mergeFrom(value).buildPartial(); - } else { - message_ = value; - } - onChanged(); - } else { - if (messageCase_ == 3) { - shutdownBuilder_.mergeFrom(value); - } else { - shutdownBuilder_.setMessage(value); - } - } - messageCase_ = 3; - return this; - } - /** - * .weaviate.v1.BatchStreamReply.Shutdown shutdown = 3; - */ - public Builder clearShutdown() { - if (shutdownBuilder_ == null) { - if (messageCase_ == 3) { - messageCase_ = 0; - message_ = null; - onChanged(); - } - } else { - if (messageCase_ == 3) { - messageCase_ = 0; - message_ = null; - } - shutdownBuilder_.clear(); - } - return this; - } - /** - * .weaviate.v1.BatchStreamReply.Shutdown shutdown = 3; - */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown.Builder getShutdownBuilder() { - return getShutdownFieldBuilder().getBuilder(); - } - /** - * .weaviate.v1.BatchStreamReply.Shutdown shutdown = 3; - */ - @java.lang.Override - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShutdownOrBuilder getShutdownOrBuilder() { - if ((messageCase_ == 3) && (shutdownBuilder_ != null)) { - return shutdownBuilder_.getMessageOrBuilder(); - } else { - if (messageCase_ == 3) { - return (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown) message_; - } - return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown.getDefaultInstance(); - } - } - /** - * .weaviate.v1.BatchStreamReply.Shutdown shutdown = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShutdownOrBuilder> - getShutdownFieldBuilder() { - if (shutdownBuilder_ == null) { - if (!(messageCase_ == 3)) { - message_ = io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown.getDefaultInstance(); - } - shutdownBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.ShutdownOrBuilder>( - (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Shutdown) message_, - getParentForChildren(), - isClean()); - message_ = null; - } - messageCase_ = 3; - onChanged(); - return shutdownBuilder_; - } - private com.google.protobuf.SingleFieldBuilderV3< io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Started, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.Started.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply.StartedOrBuilder> startedBuilder_; /** @@ -14726,7 +14203,7 @@ public interface BatchObjectOrBuilder extends * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.BatchObject.vector is deprecated. - * See v1/batch.proto;l=118 + * See v1/batch.proto;l=120 * @return A list containing the vector. */ @java.lang.Deprecated java.util.List getVectorList(); @@ -14737,7 +14214,7 @@ public interface BatchObjectOrBuilder extends * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.BatchObject.vector is deprecated. - * See v1/batch.proto;l=118 + * See v1/batch.proto;l=120 * @return The count of vector. */ @java.lang.Deprecated int getVectorCount(); @@ -14748,7 +14225,7 @@ public interface BatchObjectOrBuilder extends * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.BatchObject.vector is deprecated. - * See v1/batch.proto;l=118 + * See v1/batch.proto;l=120 * @param index The index of the element to return. * @return The vector at the given index. */ @@ -20530,7 +20007,7 @@ public java.lang.String getUuid() { * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.BatchObject.vector is deprecated. - * See v1/batch.proto;l=118 + * See v1/batch.proto;l=120 * @return A list containing the vector. */ @java.lang.Override @@ -20545,7 +20022,7 @@ public java.lang.String getUuid() { * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.BatchObject.vector is deprecated. - * See v1/batch.proto;l=118 + * See v1/batch.proto;l=120 * @return The count of vector. */ @java.lang.Deprecated public int getVectorCount() { @@ -20558,7 +20035,7 @@ public java.lang.String getUuid() { * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.BatchObject.vector is deprecated. - * See v1/batch.proto;l=118 + * See v1/batch.proto;l=120 * @param index The index of the element to return. * @return The vector at the given index. */ @@ -21408,7 +20885,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.BatchObject.vector is deprecated. - * See v1/batch.proto;l=118 + * See v1/batch.proto;l=120 * @return A list containing the vector. */ @java.lang.Deprecated public java.util.List @@ -21423,7 +20900,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.BatchObject.vector is deprecated. - * See v1/batch.proto;l=118 + * See v1/batch.proto;l=120 * @return The count of vector. */ @java.lang.Deprecated public int getVectorCount() { @@ -21436,7 +20913,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.BatchObject.vector is deprecated. - * See v1/batch.proto;l=118 + * See v1/batch.proto;l=120 * @param index The index of the element to return. * @return The vector at the given index. */ @@ -21450,7 +20927,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.BatchObject.vector is deprecated. - * See v1/batch.proto;l=118 + * See v1/batch.proto;l=120 * @param index The index to set the value at. * @param value The vector to set. * @return This builder for chaining. @@ -21471,7 +20948,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.BatchObject.vector is deprecated. - * See v1/batch.proto;l=118 + * See v1/batch.proto;l=120 * @param value The vector to add. * @return This builder for chaining. */ @@ -21490,7 +20967,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.BatchObject.vector is deprecated. - * See v1/batch.proto;l=118 + * See v1/batch.proto;l=120 * @param values The vector to add. * @return This builder for chaining. */ @@ -21510,7 +20987,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.BatchObject.vector is deprecated. - * See v1/batch.proto;l=118 + * See v1/batch.proto;l=120 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearVector() { @@ -26528,11 +26005,6 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchRef private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_weaviate_v1_BatchStreamReply_ShuttingDown_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_weaviate_v1_BatchStreamReply_Shutdown_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_weaviate_v1_BatchStreamReply_Shutdown_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_weaviate_v1_BatchStreamReply_OutOfMemory_descriptor; private static final @@ -26640,67 +26112,66 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchRef "t.Data.References\0323\n\007Objects\022(\n\006values\030\001" + " \003(\0132\030.weaviate.v1.BatchObject\0329\n\nRefere" + "nces\022+\n\006values\030\001 \003(\0132\033.weaviate.v1.Batch" + - "ReferenceB\t\n\007message\"\347\006\n\020BatchStreamRepl" + + "ReferenceB\t\n\007message\"\302\006\n\020BatchStreamRepl" + "y\0228\n\007results\030\001 \001(\0132%.weaviate.v1.BatchSt" + "reamReply.ResultsH\000\022C\n\rshutting_down\030\002 \001" + "(\0132*.weaviate.v1.BatchStreamReply.Shutti" + - "ngDownH\000\022:\n\010shutdown\030\003 \001(\0132&.weaviate.v1" + - ".BatchStreamReply.ShutdownH\000\0228\n\007started\030" + - "\004 \001(\0132%.weaviate.v1.BatchStreamReply.Sta" + - "rtedH\000\0228\n\007backoff\030\005 \001(\0132%.weaviate.v1.Ba" + - "tchStreamReply.BackoffH\000\0222\n\004acks\030\006 \001(\0132\"" + - ".weaviate.v1.BatchStreamReply.AcksH\000\022B\n\r" + - "out_of_memory\030\007 \001(\0132).weaviate.v1.BatchS" + - "treamReply.OutOfMemoryH\000\032\t\n\007Started\032\016\n\014S" + - "huttingDown\032\n\n\010Shutdown\032-\n\013OutOfMemory\022\r" + - "\n\005uuids\030\001 \003(\t\022\017\n\007beacons\030\002 \003(\t\032\035\n\007Backof" + - "f\022\022\n\nbatch_size\030\001 \001(\005\032&\n\004Acks\022\r\n\005uuids\030\001" + - " \003(\t\022\017\n\007beacons\030\002 \003(\t\032\203\002\n\007Results\022;\n\006err" + - "ors\030\001 \003(\0132+.weaviate.v1.BatchStreamReply" + - ".Results.Error\022@\n\tsuccesses\030\002 \003(\0132-.weav" + - "iate.v1.BatchStreamReply.Results.Success" + - "\032B\n\005Error\022\r\n\005error\030\001 \001(\t\022\016\n\004uuid\030\002 \001(\tH\000" + - "\022\020\n\006beacon\030\003 \001(\tH\000B\010\n\006detail\0325\n\007Success\022" + - "\016\n\004uuid\030\002 \001(\tH\000\022\020\n\006beacon\030\003 \001(\tH\000B\010\n\006det" + - "ailB\t\n\007message\"\336\007\n\013BatchObject\022\014\n\004uuid\030\001" + - " \001(\t\022\022\n\006vector\030\002 \003(\002B\002\030\001\0227\n\nproperties\030\003" + - " \001(\0132#.weaviate.v1.BatchObject.Propertie" + - "s\022\022\n\ncollection\030\004 \001(\t\022\016\n\006tenant\030\005 \001(\t\022\024\n" + - "\014vector_bytes\030\006 \001(\014\022%\n\007vectors\030\027 \003(\0132\024.w" + - "eaviate.v1.Vectors\032\204\005\n\nProperties\0223\n\022non" + - "_ref_properties\030\001 \001(\0132\027.google.protobuf." + - "Struct\022N\n\027single_target_ref_props\030\002 \003(\0132" + - "-.weaviate.v1.BatchObject.SingleTargetRe" + - "fProps\022L\n\026multi_target_ref_props\030\003 \003(\0132," + - ".weaviate.v1.BatchObject.MultiTargetRefP" + - "rops\022C\n\027number_array_properties\030\004 \003(\0132\"." + - "weaviate.v1.NumberArrayProperties\022=\n\024int" + - "_array_properties\030\005 \003(\0132\037.weaviate.v1.In" + - "tArrayProperties\022?\n\025text_array_propertie" + - "s\030\006 \003(\0132 .weaviate.v1.TextArrayPropertie" + - "s\022E\n\030boolean_array_properties\030\007 \003(\0132#.we" + - "aviate.v1.BooleanArrayProperties\0228\n\021obje" + - "ct_properties\030\010 \003(\0132\035.weaviate.v1.Object" + - "Properties\022C\n\027object_array_properties\030\t " + - "\003(\0132\".weaviate.v1.ObjectArrayProperties\022" + - "\030\n\020empty_list_props\030\n \003(\t\0328\n\024SingleTarge" + - "tRefProps\022\r\n\005uuids\030\001 \003(\t\022\021\n\tprop_name\030\002 " + - "\001(\t\032R\n\023MultiTargetRefProps\022\r\n\005uuids\030\001 \003(" + - "\t\022\021\n\tprop_name\030\002 \001(\t\022\031\n\021target_collectio" + - "n\030\003 \001(\t\"\231\001\n\016BatchReference\022\014\n\004name\030\001 \001(\t" + - "\022\027\n\017from_collection\030\002 \001(\t\022\021\n\tfrom_uuid\030\003" + - " \001(\t\022\032\n\rto_collection\030\004 \001(\tH\000\210\001\001\022\017\n\007to_u" + - "uid\030\005 \001(\t\022\016\n\006tenant\030\006 \001(\tB\020\n\016_to_collect" + - "ion\"\210\001\n\021BatchObjectsReply\022\014\n\004took\030\001 \001(\002\022" + - "9\n\006errors\030\002 \003(\0132).weaviate.v1.BatchObjec" + - "tsReply.BatchError\032*\n\nBatchError\022\r\n\005inde" + - "x\030\001 \001(\005\022\r\n\005error\030\002 \001(\t\"\216\001\n\024BatchReferenc" + - "esReply\022\014\n\004took\030\001 \001(\002\022<\n\006errors\030\002 \003(\0132,." + - "weaviate.v1.BatchReferencesReply.BatchEr" + - "ror\032*\n\nBatchError\022\r\n\005index\030\001 \001(\005\022\r\n\005erro" + - "r\030\002 \001(\tBC\n-io.weaviate.client6.v1.intern" + - "al.grpc.protocolB\022WeaviateProtoBatchb\006pr" + - "oto3" + "ngDownH\000\0228\n\007started\030\004 \001(\0132%.weaviate.v1." + + "BatchStreamReply.StartedH\000\0228\n\007backoff\030\005 " + + "\001(\0132%.weaviate.v1.BatchStreamReply.Backo" + + "ffH\000\0222\n\004acks\030\006 \001(\0132\".weaviate.v1.BatchSt" + + "reamReply.AcksH\000\022B\n\rout_of_memory\030\007 \001(\0132" + + ").weaviate.v1.BatchStreamReply.OutOfMemo" + + "ryH\000\032\t\n\007Started\032\016\n\014ShuttingDown\032@\n\013OutOf" + + "Memory\022\r\n\005uuids\030\001 \003(\t\022\017\n\007beacons\030\002 \003(\t\022\021" + + "\n\twait_time\030\003 \001(\005\032\035\n\007Backoff\022\022\n\nbatch_si" + + "ze\030\001 \001(\005\032&\n\004Acks\022\r\n\005uuids\030\001 \003(\t\022\017\n\007beaco" + + "ns\030\002 \003(\t\032\203\002\n\007Results\022;\n\006errors\030\001 \003(\0132+.w" + + "eaviate.v1.BatchStreamReply.Results.Erro" + + "r\022@\n\tsuccesses\030\002 \003(\0132-.weaviate.v1.Batch" + + "StreamReply.Results.Success\032B\n\005Error\022\r\n\005" + + "error\030\001 \001(\t\022\016\n\004uuid\030\002 \001(\tH\000\022\020\n\006beacon\030\003 " + + "\001(\tH\000B\010\n\006detail\0325\n\007Success\022\016\n\004uuid\030\002 \001(\t" + + "H\000\022\020\n\006beacon\030\003 \001(\tH\000B\010\n\006detailB\t\n\007messag" + + "eJ\004\010\003\020\004R\010shutdown\"\336\007\n\013BatchObject\022\014\n\004uui" + + "d\030\001 \001(\t\022\022\n\006vector\030\002 \003(\002B\002\030\001\0227\n\npropertie" + + "s\030\003 \001(\0132#.weaviate.v1.BatchObject.Proper" + + "ties\022\022\n\ncollection\030\004 \001(\t\022\016\n\006tenant\030\005 \001(\t" + + "\022\024\n\014vector_bytes\030\006 \001(\014\022%\n\007vectors\030\027 \003(\0132" + + "\024.weaviate.v1.Vectors\032\204\005\n\nProperties\0223\n\022" + + "non_ref_properties\030\001 \001(\0132\027.google.protob" + + "uf.Struct\022N\n\027single_target_ref_props\030\002 \003" + + "(\0132-.weaviate.v1.BatchObject.SingleTarge" + + "tRefProps\022L\n\026multi_target_ref_props\030\003 \003(" + + "\0132,.weaviate.v1.BatchObject.MultiTargetR" + + "efProps\022C\n\027number_array_properties\030\004 \003(\013" + + "2\".weaviate.v1.NumberArrayProperties\022=\n\024" + + "int_array_properties\030\005 \003(\0132\037.weaviate.v1" + + ".IntArrayProperties\022?\n\025text_array_proper" + + "ties\030\006 \003(\0132 .weaviate.v1.TextArrayProper" + + "ties\022E\n\030boolean_array_properties\030\007 \003(\0132#" + + ".weaviate.v1.BooleanArrayProperties\0228\n\021o" + + "bject_properties\030\010 \003(\0132\035.weaviate.v1.Obj" + + "ectProperties\022C\n\027object_array_properties" + + "\030\t \003(\0132\".weaviate.v1.ObjectArrayProperti" + + "es\022\030\n\020empty_list_props\030\n \003(\t\0328\n\024SingleTa" + + "rgetRefProps\022\r\n\005uuids\030\001 \003(\t\022\021\n\tprop_name" + + "\030\002 \001(\t\032R\n\023MultiTargetRefProps\022\r\n\005uuids\030\001" + + " \003(\t\022\021\n\tprop_name\030\002 \001(\t\022\031\n\021target_collec" + + "tion\030\003 \001(\t\"\231\001\n\016BatchReference\022\014\n\004name\030\001 " + + "\001(\t\022\027\n\017from_collection\030\002 \001(\t\022\021\n\tfrom_uui" + + "d\030\003 \001(\t\022\032\n\rto_collection\030\004 \001(\tH\000\210\001\001\022\017\n\007t" + + "o_uuid\030\005 \001(\t\022\016\n\006tenant\030\006 \001(\tB\020\n\016_to_coll" + + "ection\"\210\001\n\021BatchObjectsReply\022\014\n\004took\030\001 \001" + + "(\002\0229\n\006errors\030\002 \003(\0132).weaviate.v1.BatchOb" + + "jectsReply.BatchError\032*\n\nBatchError\022\r\n\005i" + + "ndex\030\001 \001(\005\022\r\n\005error\030\002 \001(\t\"\216\001\n\024BatchRefer" + + "encesReply\022\014\n\004took\030\001 \001(\002\022<\n\006errors\030\002 \003(\013" + + "2,.weaviate.v1.BatchReferencesReply.Batc" + + "hError\032*\n\nBatchError\022\r\n\005index\030\001 \001(\005\022\r\n\005e" + + "rror\030\002 \001(\tBC\n-io.weaviate.client6.v1.int" + + "ernal.grpc.protocolB\022WeaviateProtoBatchb" + + "\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -26761,7 +26232,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchRef internal_static_weaviate_v1_BatchStreamReply_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_BatchStreamReply_descriptor, - new java.lang.String[] { "Results", "ShuttingDown", "Shutdown", "Started", "Backoff", "Acks", "OutOfMemory", "Message", }); + new java.lang.String[] { "Results", "ShuttingDown", "Started", "Backoff", "Acks", "OutOfMemory", "Message", }); internal_static_weaviate_v1_BatchStreamReply_Started_descriptor = internal_static_weaviate_v1_BatchStreamReply_descriptor.getNestedTypes().get(0); internal_static_weaviate_v1_BatchStreamReply_Started_fieldAccessorTable = new @@ -26774,32 +26245,26 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchRef com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_BatchStreamReply_ShuttingDown_descriptor, new java.lang.String[] { }); - internal_static_weaviate_v1_BatchStreamReply_Shutdown_descriptor = - internal_static_weaviate_v1_BatchStreamReply_descriptor.getNestedTypes().get(2); - internal_static_weaviate_v1_BatchStreamReply_Shutdown_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_weaviate_v1_BatchStreamReply_Shutdown_descriptor, - new java.lang.String[] { }); internal_static_weaviate_v1_BatchStreamReply_OutOfMemory_descriptor = - internal_static_weaviate_v1_BatchStreamReply_descriptor.getNestedTypes().get(3); + internal_static_weaviate_v1_BatchStreamReply_descriptor.getNestedTypes().get(2); internal_static_weaviate_v1_BatchStreamReply_OutOfMemory_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_BatchStreamReply_OutOfMemory_descriptor, - new java.lang.String[] { "Uuids", "Beacons", }); + new java.lang.String[] { "Uuids", "Beacons", "WaitTime", }); internal_static_weaviate_v1_BatchStreamReply_Backoff_descriptor = - internal_static_weaviate_v1_BatchStreamReply_descriptor.getNestedTypes().get(4); + internal_static_weaviate_v1_BatchStreamReply_descriptor.getNestedTypes().get(3); internal_static_weaviate_v1_BatchStreamReply_Backoff_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_BatchStreamReply_Backoff_descriptor, new java.lang.String[] { "BatchSize", }); internal_static_weaviate_v1_BatchStreamReply_Acks_descriptor = - internal_static_weaviate_v1_BatchStreamReply_descriptor.getNestedTypes().get(5); + internal_static_weaviate_v1_BatchStreamReply_descriptor.getNestedTypes().get(4); internal_static_weaviate_v1_BatchStreamReply_Acks_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_BatchStreamReply_Acks_descriptor, new java.lang.String[] { "Uuids", "Beacons", }); internal_static_weaviate_v1_BatchStreamReply_Results_descriptor = - internal_static_weaviate_v1_BatchStreamReply_descriptor.getNestedTypes().get(6); + internal_static_weaviate_v1_BatchStreamReply_descriptor.getNestedTypes().get(5); internal_static_weaviate_v1_BatchStreamReply_Results_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_BatchStreamReply_Results_descriptor, diff --git a/src/main/java/io/weaviate/client6/v1/internal/grpc/protocol/WeaviateProtoGenerative.java b/src/main/java/io/weaviate/client6/v1/internal/grpc/protocol/WeaviateProtoGenerative.java index 7b35c27ec..d10174fc1 100644 --- a/src/main/java/io/weaviate/client6/v1/internal/grpc/protocol/WeaviateProtoGenerative.java +++ b/src/main/java/io/weaviate/client6/v1/internal/grpc/protocol/WeaviateProtoGenerative.java @@ -4050,6 +4050,21 @@ public interface GenerativeProviderOrBuilder extends */ io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeXAIOrBuilder getXaiOrBuilder(); + /** + * .weaviate.v1.GenerativeContextualAI contextualai = 15; + * @return Whether the contextualai field is set. + */ + boolean hasContextualai(); + /** + * .weaviate.v1.GenerativeContextualAI contextualai = 15; + * @return The contextualai. + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI getContextualai(); + /** + * .weaviate.v1.GenerativeContextualAI contextualai = 15; + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAIOrBuilder getContextualaiOrBuilder(); + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeProvider.KindCase getKindCase(); } /** @@ -4106,6 +4121,7 @@ public enum KindCase FRIENDLIAI(12), NVIDIA(13), XAI(14), + CONTEXTUALAI(15), KIND_NOT_SET(0); private final int value; private KindCase(int value) { @@ -4136,6 +4152,7 @@ public static KindCase forNumber(int value) { case 12: return FRIENDLIAI; case 13: return NVIDIA; case 14: return XAI; + case 15: return CONTEXTUALAI; case 0: return KIND_NOT_SET; default: return null; } @@ -4565,6 +4582,37 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.Gen return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeXAI.getDefaultInstance(); } + public static final int CONTEXTUALAI_FIELD_NUMBER = 15; + /** + * .weaviate.v1.GenerativeContextualAI contextualai = 15; + * @return Whether the contextualai field is set. + */ + @java.lang.Override + public boolean hasContextualai() { + return kindCase_ == 15; + } + /** + * .weaviate.v1.GenerativeContextualAI contextualai = 15; + * @return The contextualai. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI getContextualai() { + if (kindCase_ == 15) { + return (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI) kind_; + } + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI.getDefaultInstance(); + } + /** + * .weaviate.v1.GenerativeContextualAI contextualai = 15; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAIOrBuilder getContextualaiOrBuilder() { + if (kindCase_ == 15) { + return (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI) kind_; + } + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -4621,6 +4669,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (kindCase_ == 14) { output.writeMessage(14, (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeXAI) kind_); } + if (kindCase_ == 15) { + output.writeMessage(15, (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI) kind_); + } getUnknownFields().writeTo(output); } @@ -4686,6 +4737,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(14, (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeXAI) kind_); } + if (kindCase_ == 15) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(15, (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI) kind_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -4757,6 +4812,10 @@ public boolean equals(final java.lang.Object obj) { if (!getXai() .equals(other.getXai())) return false; break; + case 15: + if (!getContextualai() + .equals(other.getContextualai())) return false; + break; case 0: default: } @@ -4827,6 +4886,10 @@ public int hashCode() { hash = (37 * hash) + XAI_FIELD_NUMBER; hash = (53 * hash) + getXai().hashCode(); break; + case 15: + hash = (37 * hash) + CONTEXTUALAI_FIELD_NUMBER; + hash = (53 * hash) + getContextualai().hashCode(); + break; case 0: default: } @@ -5001,6 +5064,9 @@ public Builder clear() { if (xaiBuilder_ != null) { xaiBuilder_.clear(); } + if (contextualaiBuilder_ != null) { + contextualaiBuilder_.clear(); + } kindCase_ = 0; kind_ = null; return this; @@ -5097,6 +5163,10 @@ private void buildPartialOneofs(io.weaviate.client6.v1.internal.grpc.protocol.We xaiBuilder_ != null) { result.kind_ = xaiBuilder_.build(); } + if (kindCase_ == 15 && + contextualaiBuilder_ != null) { + result.kind_ = contextualaiBuilder_.build(); + } } @java.lang.Override @@ -5199,6 +5269,10 @@ public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateP mergeXai(other.getXai()); break; } + case CONTEXTUALAI: { + mergeContextualai(other.getContextualai()); + break; + } case KIND_NOT_SET: { break; } @@ -5325,6 +5399,13 @@ public Builder mergeFrom( kindCase_ = 14; break; } // case 114 + case 122: { + input.readMessage( + getContextualaiFieldBuilder().getBuilder(), + extensionRegistry); + kindCase_ = 15; + break; + } // case 122 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -7234,6 +7315,148 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.Gen onChanged(); return xaiBuilder_; } + + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAIOrBuilder> contextualaiBuilder_; + /** + * .weaviate.v1.GenerativeContextualAI contextualai = 15; + * @return Whether the contextualai field is set. + */ + @java.lang.Override + public boolean hasContextualai() { + return kindCase_ == 15; + } + /** + * .weaviate.v1.GenerativeContextualAI contextualai = 15; + * @return The contextualai. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI getContextualai() { + if (contextualaiBuilder_ == null) { + if (kindCase_ == 15) { + return (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI) kind_; + } + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI.getDefaultInstance(); + } else { + if (kindCase_ == 15) { + return contextualaiBuilder_.getMessage(); + } + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI.getDefaultInstance(); + } + } + /** + * .weaviate.v1.GenerativeContextualAI contextualai = 15; + */ + public Builder setContextualai(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI value) { + if (contextualaiBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + contextualaiBuilder_.setMessage(value); + } + kindCase_ = 15; + return this; + } + /** + * .weaviate.v1.GenerativeContextualAI contextualai = 15; + */ + public Builder setContextualai( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI.Builder builderForValue) { + if (contextualaiBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + contextualaiBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 15; + return this; + } + /** + * .weaviate.v1.GenerativeContextualAI contextualai = 15; + */ + public Builder mergeContextualai(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI value) { + if (contextualaiBuilder_ == null) { + if (kindCase_ == 15 && + kind_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI.getDefaultInstance()) { + kind_ = io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI.newBuilder((io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI) kind_) + .mergeFrom(value).buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 15) { + contextualaiBuilder_.mergeFrom(value); + } else { + contextualaiBuilder_.setMessage(value); + } + } + kindCase_ = 15; + return this; + } + /** + * .weaviate.v1.GenerativeContextualAI contextualai = 15; + */ + public Builder clearContextualai() { + if (contextualaiBuilder_ == null) { + if (kindCase_ == 15) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 15) { + kindCase_ = 0; + kind_ = null; + } + contextualaiBuilder_.clear(); + } + return this; + } + /** + * .weaviate.v1.GenerativeContextualAI contextualai = 15; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI.Builder getContextualaiBuilder() { + return getContextualaiFieldBuilder().getBuilder(); + } + /** + * .weaviate.v1.GenerativeContextualAI contextualai = 15; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAIOrBuilder getContextualaiOrBuilder() { + if ((kindCase_ == 15) && (contextualaiBuilder_ != null)) { + return contextualaiBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 15) { + return (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI) kind_; + } + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI.getDefaultInstance(); + } + } + /** + * .weaviate.v1.GenerativeContextualAI contextualai = 15; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAIOrBuilder> + getContextualaiFieldBuilder() { + if (contextualaiBuilder_ == null) { + if (!(kindCase_ == 15)) { + kind_ = io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI.getDefaultInstance(); + } + contextualaiBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAIOrBuilder>( + (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 15; + onChanged(); + return contextualaiBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -10062,6 +10285,32 @@ public interface GenerativeAWSOrBuilder extends * optional .weaviate.v1.TextArray image_properties = 15; */ io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder getImagePropertiesOrBuilder(); + + /** + * optional int64 max_tokens = 16; + * @return Whether the maxTokens field is set. + */ + boolean hasMaxTokens(); + /** + * optional int64 max_tokens = 16; + * @return The maxTokens. + */ + long getMaxTokens(); + + /** + * optional .weaviate.v1.TextArray stop_sequences = 17; + * @return Whether the stopSequences field is set. + */ + boolean hasStopSequences(); + /** + * optional .weaviate.v1.TextArray stop_sequences = 17; + * @return The stopSequences. + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray getStopSequences(); + /** + * optional .weaviate.v1.TextArray stop_sequences = 17; + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder getStopSequencesOrBuilder(); } /** * Protobuf type {@code weaviate.v1.GenerativeAWS} @@ -10458,6 +10707,51 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray return imageProperties_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : imageProperties_; } + public static final int MAX_TOKENS_FIELD_NUMBER = 16; + private long maxTokens_ = 0L; + /** + * optional int64 max_tokens = 16; + * @return Whether the maxTokens field is set. + */ + @java.lang.Override + public boolean hasMaxTokens() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * optional int64 max_tokens = 16; + * @return The maxTokens. + */ + @java.lang.Override + public long getMaxTokens() { + return maxTokens_; + } + + public static final int STOP_SEQUENCES_FIELD_NUMBER = 17; + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray stopSequences_; + /** + * optional .weaviate.v1.TextArray stop_sequences = 17; + * @return Whether the stopSequences field is set. + */ + @java.lang.Override + public boolean hasStopSequences() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * optional .weaviate.v1.TextArray stop_sequences = 17; + * @return The stopSequences. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray getStopSequences() { + return stopSequences_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : stopSequences_; + } + /** + * optional .weaviate.v1.TextArray stop_sequences = 17; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder getStopSequencesOrBuilder() { + return stopSequences_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : stopSequences_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -10499,6 +10793,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000100) != 0)) { output.writeMessage(15, getImageProperties()); } + if (((bitField0_ & 0x00000200) != 0)) { + output.writeInt64(16, maxTokens_); + } + if (((bitField0_ & 0x00000400) != 0)) { + output.writeMessage(17, getStopSequences()); + } getUnknownFields().writeTo(output); } @@ -10538,6 +10838,14 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(15, getImageProperties()); } + if (((bitField0_ & 0x00000200) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(16, maxTokens_); + } + if (((bitField0_ & 0x00000400) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(17, getStopSequences()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -10599,6 +10907,16 @@ public boolean equals(final java.lang.Object obj) { if (!getImageProperties() .equals(other.getImageProperties())) return false; } + if (hasMaxTokens() != other.hasMaxTokens()) return false; + if (hasMaxTokens()) { + if (getMaxTokens() + != other.getMaxTokens()) return false; + } + if (hasStopSequences() != other.hasStopSequences()) return false; + if (hasStopSequences()) { + if (!getStopSequences() + .equals(other.getStopSequences())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -10647,6 +10965,15 @@ public int hashCode() { hash = (37 * hash) + IMAGE_PROPERTIES_FIELD_NUMBER; hash = (53 * hash) + getImageProperties().hashCode(); } + if (hasMaxTokens()) { + hash = (37 * hash) + MAX_TOKENS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMaxTokens()); + } + if (hasStopSequences()) { + hash = (37 * hash) + STOP_SEQUENCES_FIELD_NUMBER; + hash = (53 * hash) + getStopSequences().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -10779,6 +11106,7 @@ private void maybeForceBuilderInitialization() { .alwaysUseFieldBuilders) { getImagesFieldBuilder(); getImagePropertiesFieldBuilder(); + getStopSequencesFieldBuilder(); } } @java.lang.Override @@ -10802,6 +11130,12 @@ public Builder clear() { imagePropertiesBuilder_.dispose(); imagePropertiesBuilder_ = null; } + maxTokens_ = 0L; + stopSequences_ = null; + if (stopSequencesBuilder_ != null) { + stopSequencesBuilder_.dispose(); + stopSequencesBuilder_ = null; + } return this; } @@ -10876,6 +11210,16 @@ private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.Weaviat : imagePropertiesBuilder_.build(); to_bitField0_ |= 0x00000100; } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.maxTokens_ = maxTokens_; + to_bitField0_ |= 0x00000200; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.stopSequences_ = stopSequencesBuilder_ == null + ? stopSequences_ + : stopSequencesBuilder_.build(); + to_bitField0_ |= 0x00000400; + } result.bitField0_ |= to_bitField0_; } @@ -10962,6 +11306,12 @@ public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateP if (other.hasImageProperties()) { mergeImageProperties(other.getImageProperties()); } + if (other.hasMaxTokens()) { + setMaxTokens(other.getMaxTokens()); + } + if (other.hasStopSequences()) { + mergeStopSequences(other.getStopSequences()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -11037,6 +11387,18 @@ public Builder mergeFrom( bitField0_ |= 0x00000100; break; } // case 122 + case 128: { + maxTokens_ = input.readInt64(); + bitField0_ |= 0x00000200; + break; + } // case 128 + case 138: { + input.readMessage( + getStopSequencesFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 138 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -11809,6 +12171,167 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray } return imagePropertiesBuilder_; } + + private long maxTokens_ ; + /** + * optional int64 max_tokens = 16; + * @return Whether the maxTokens field is set. + */ + @java.lang.Override + public boolean hasMaxTokens() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * optional int64 max_tokens = 16; + * @return The maxTokens. + */ + @java.lang.Override + public long getMaxTokens() { + return maxTokens_; + } + /** + * optional int64 max_tokens = 16; + * @param value The maxTokens to set. + * @return This builder for chaining. + */ + public Builder setMaxTokens(long value) { + + maxTokens_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * optional int64 max_tokens = 16; + * @return This builder for chaining. + */ + public Builder clearMaxTokens() { + bitField0_ = (bitField0_ & ~0x00000200); + maxTokens_ = 0L; + onChanged(); + return this; + } + + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray stopSequences_; + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder> stopSequencesBuilder_; + /** + * optional .weaviate.v1.TextArray stop_sequences = 17; + * @return Whether the stopSequences field is set. + */ + public boolean hasStopSequences() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * optional .weaviate.v1.TextArray stop_sequences = 17; + * @return The stopSequences. + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray getStopSequences() { + if (stopSequencesBuilder_ == null) { + return stopSequences_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : stopSequences_; + } else { + return stopSequencesBuilder_.getMessage(); + } + } + /** + * optional .weaviate.v1.TextArray stop_sequences = 17; + */ + public Builder setStopSequences(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray value) { + if (stopSequencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stopSequences_ = value; + } else { + stopSequencesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.TextArray stop_sequences = 17; + */ + public Builder setStopSequences( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder builderForValue) { + if (stopSequencesBuilder_ == null) { + stopSequences_ = builderForValue.build(); + } else { + stopSequencesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.TextArray stop_sequences = 17; + */ + public Builder mergeStopSequences(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray value) { + if (stopSequencesBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) && + stopSequences_ != null && + stopSequences_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance()) { + getStopSequencesBuilder().mergeFrom(value); + } else { + stopSequences_ = value; + } + } else { + stopSequencesBuilder_.mergeFrom(value); + } + if (stopSequences_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } + return this; + } + /** + * optional .weaviate.v1.TextArray stop_sequences = 17; + */ + public Builder clearStopSequences() { + bitField0_ = (bitField0_ & ~0x00000400); + stopSequences_ = null; + if (stopSequencesBuilder_ != null) { + stopSequencesBuilder_.dispose(); + stopSequencesBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .weaviate.v1.TextArray stop_sequences = 17; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder getStopSequencesBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getStopSequencesFieldBuilder().getBuilder(); + } + /** + * optional .weaviate.v1.TextArray stop_sequences = 17; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder getStopSequencesOrBuilder() { + if (stopSequencesBuilder_ != null) { + return stopSequencesBuilder_.getMessageOrBuilder(); + } else { + return stopSequences_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : stopSequences_; + } + } + /** + * optional .weaviate.v1.TextArray stop_sequences = 17; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder> + getStopSequencesFieldBuilder() { + if (stopSequencesBuilder_ == null) { + stopSequencesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder>( + getStopSequences(), + getParentForChildren(), + isClean()); + stopSequences_ = null; + } + return stopSequencesBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -11991,6 +12514,36 @@ public interface GenerativeCohereOrBuilder extends * @return The temperature. */ double getTemperature(); + + /** + * optional .weaviate.v1.TextArray images = 10; + * @return Whether the images field is set. + */ + boolean hasImages(); + /** + * optional .weaviate.v1.TextArray images = 10; + * @return The images. + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray getImages(); + /** + * optional .weaviate.v1.TextArray images = 10; + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder getImagesOrBuilder(); + + /** + * optional .weaviate.v1.TextArray image_properties = 11; + * @return Whether the imageProperties field is set. + */ + boolean hasImageProperties(); + /** + * optional .weaviate.v1.TextArray image_properties = 11; + * @return The imageProperties. + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray getImageProperties(); + /** + * optional .weaviate.v1.TextArray image_properties = 11; + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder getImagePropertiesOrBuilder(); } /** * Protobuf type {@code weaviate.v1.GenerativeCohere} @@ -12264,6 +12817,58 @@ public double getTemperature() { return temperature_; } + public static final int IMAGES_FIELD_NUMBER = 10; + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray images_; + /** + * optional .weaviate.v1.TextArray images = 10; + * @return Whether the images field is set. + */ + @java.lang.Override + public boolean hasImages() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * optional .weaviate.v1.TextArray images = 10; + * @return The images. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray getImages() { + return images_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : images_; + } + /** + * optional .weaviate.v1.TextArray images = 10; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder getImagesOrBuilder() { + return images_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : images_; + } + + public static final int IMAGE_PROPERTIES_FIELD_NUMBER = 11; + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray imageProperties_; + /** + * optional .weaviate.v1.TextArray image_properties = 11; + * @return Whether the imageProperties field is set. + */ + @java.lang.Override + public boolean hasImageProperties() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * optional .weaviate.v1.TextArray image_properties = 11; + * @return The imageProperties. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray getImageProperties() { + return imageProperties_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : imageProperties_; + } + /** + * optional .weaviate.v1.TextArray image_properties = 11; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder getImagePropertiesOrBuilder() { + return imageProperties_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : imageProperties_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -12305,6 +12910,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000100) != 0)) { output.writeDouble(9, temperature_); } + if (((bitField0_ & 0x00000200) != 0)) { + output.writeMessage(10, getImages()); + } + if (((bitField0_ & 0x00000400) != 0)) { + output.writeMessage(11, getImageProperties()); + } getUnknownFields().writeTo(output); } @@ -12348,6 +12959,14 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeDoubleSize(9, temperature_); } + if (((bitField0_ & 0x00000200) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, getImages()); + } + if (((bitField0_ & 0x00000400) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, getImageProperties()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -12412,6 +13031,16 @@ public boolean equals(final java.lang.Object obj) { != java.lang.Double.doubleToLongBits( other.getTemperature())) return false; } + if (hasImages() != other.hasImages()) return false; + if (hasImages()) { + if (!getImages() + .equals(other.getImages())) return false; + } + if (hasImageProperties() != other.hasImageProperties()) return false; + if (hasImageProperties()) { + if (!getImageProperties() + .equals(other.getImageProperties())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -12465,6 +13094,14 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashLong( java.lang.Double.doubleToLongBits(getTemperature())); } + if (hasImages()) { + hash = (37 * hash) + IMAGES_FIELD_NUMBER; + hash = (53 * hash) + getImages().hashCode(); + } + if (hasImageProperties()) { + hash = (37 * hash) + IMAGE_PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + getImageProperties().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -12596,6 +13233,8 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getStopSequencesFieldBuilder(); + getImagesFieldBuilder(); + getImagePropertiesFieldBuilder(); } } @java.lang.Override @@ -12615,6 +13254,16 @@ public Builder clear() { stopSequencesBuilder_ = null; } temperature_ = 0D; + images_ = null; + if (imagesBuilder_ != null) { + imagesBuilder_.dispose(); + imagesBuilder_ = null; + } + imageProperties_ = null; + if (imagePropertiesBuilder_ != null) { + imagePropertiesBuilder_.dispose(); + imagePropertiesBuilder_ = null; + } return this; } @@ -12687,6 +13336,18 @@ private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.Weaviat result.temperature_ = temperature_; to_bitField0_ |= 0x00000100; } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.images_ = imagesBuilder_ == null + ? images_ + : imagesBuilder_.build(); + to_bitField0_ |= 0x00000200; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.imageProperties_ = imagePropertiesBuilder_ == null + ? imageProperties_ + : imagePropertiesBuilder_.build(); + to_bitField0_ |= 0x00000400; + } result.bitField0_ |= to_bitField0_; } @@ -12765,6 +13426,12 @@ public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateP if (other.hasTemperature()) { setTemperature(other.getTemperature()); } + if (other.hasImages()) { + mergeImages(other.getImages()); + } + if (other.hasImageProperties()) { + mergeImageProperties(other.getImageProperties()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -12838,6 +13505,20 @@ public Builder mergeFrom( bitField0_ |= 0x00000100; break; } // case 73 + case 82: { + input.readMessage( + getImagesFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: { + input.readMessage( + getImagePropertiesFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 90 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -13373,6 +14054,248 @@ public Builder clearTemperature() { onChanged(); return this; } + + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray images_; + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder> imagesBuilder_; + /** + * optional .weaviate.v1.TextArray images = 10; + * @return Whether the images field is set. + */ + public boolean hasImages() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * optional .weaviate.v1.TextArray images = 10; + * @return The images. + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray getImages() { + if (imagesBuilder_ == null) { + return images_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : images_; + } else { + return imagesBuilder_.getMessage(); + } + } + /** + * optional .weaviate.v1.TextArray images = 10; + */ + public Builder setImages(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray value) { + if (imagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + images_ = value; + } else { + imagesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.TextArray images = 10; + */ + public Builder setImages( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder builderForValue) { + if (imagesBuilder_ == null) { + images_ = builderForValue.build(); + } else { + imagesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.TextArray images = 10; + */ + public Builder mergeImages(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray value) { + if (imagesBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) && + images_ != null && + images_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance()) { + getImagesBuilder().mergeFrom(value); + } else { + images_ = value; + } + } else { + imagesBuilder_.mergeFrom(value); + } + if (images_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + /** + * optional .weaviate.v1.TextArray images = 10; + */ + public Builder clearImages() { + bitField0_ = (bitField0_ & ~0x00000200); + images_ = null; + if (imagesBuilder_ != null) { + imagesBuilder_.dispose(); + imagesBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .weaviate.v1.TextArray images = 10; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder getImagesBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getImagesFieldBuilder().getBuilder(); + } + /** + * optional .weaviate.v1.TextArray images = 10; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder getImagesOrBuilder() { + if (imagesBuilder_ != null) { + return imagesBuilder_.getMessageOrBuilder(); + } else { + return images_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : images_; + } + } + /** + * optional .weaviate.v1.TextArray images = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder> + getImagesFieldBuilder() { + if (imagesBuilder_ == null) { + imagesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder>( + getImages(), + getParentForChildren(), + isClean()); + images_ = null; + } + return imagesBuilder_; + } + + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray imageProperties_; + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder> imagePropertiesBuilder_; + /** + * optional .weaviate.v1.TextArray image_properties = 11; + * @return Whether the imageProperties field is set. + */ + public boolean hasImageProperties() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * optional .weaviate.v1.TextArray image_properties = 11; + * @return The imageProperties. + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray getImageProperties() { + if (imagePropertiesBuilder_ == null) { + return imageProperties_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : imageProperties_; + } else { + return imagePropertiesBuilder_.getMessage(); + } + } + /** + * optional .weaviate.v1.TextArray image_properties = 11; + */ + public Builder setImageProperties(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray value) { + if (imagePropertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + imageProperties_ = value; + } else { + imagePropertiesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.TextArray image_properties = 11; + */ + public Builder setImageProperties( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder builderForValue) { + if (imagePropertiesBuilder_ == null) { + imageProperties_ = builderForValue.build(); + } else { + imagePropertiesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.TextArray image_properties = 11; + */ + public Builder mergeImageProperties(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray value) { + if (imagePropertiesBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) && + imageProperties_ != null && + imageProperties_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance()) { + getImagePropertiesBuilder().mergeFrom(value); + } else { + imageProperties_ = value; + } + } else { + imagePropertiesBuilder_.mergeFrom(value); + } + if (imageProperties_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } + return this; + } + /** + * optional .weaviate.v1.TextArray image_properties = 11; + */ + public Builder clearImageProperties() { + bitField0_ = (bitField0_ & ~0x00000400); + imageProperties_ = null; + if (imagePropertiesBuilder_ != null) { + imagePropertiesBuilder_.dispose(); + imagePropertiesBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .weaviate.v1.TextArray image_properties = 11; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder getImagePropertiesBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getImagePropertiesFieldBuilder().getBuilder(); + } + /** + * optional .weaviate.v1.TextArray image_properties = 11; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder getImagePropertiesOrBuilder() { + if (imagePropertiesBuilder_ != null) { + return imagePropertiesBuilder_.getMessageOrBuilder(); + } else { + return imageProperties_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : imageProperties_; + } + } + /** + * optional .weaviate.v1.TextArray image_properties = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder> + getImagePropertiesFieldBuilder() { + if (imagePropertiesBuilder_ == null) { + imagePropertiesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder>( + getImageProperties(), + getParentForChildren(), + isClean()); + imageProperties_ = null; + } + return imagePropertiesBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -16362,6 +17285,38 @@ public interface GenerativeOpenAIOrBuilder extends * optional .weaviate.v1.TextArray image_properties = 15; */ io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder getImagePropertiesOrBuilder(); + + /** + * optional .weaviate.v1.GenerativeOpenAI.ReasoningEffort reasoning_effort = 16; + * @return Whether the reasoningEffort field is set. + */ + boolean hasReasoningEffort(); + /** + * optional .weaviate.v1.GenerativeOpenAI.ReasoningEffort reasoning_effort = 16; + * @return The enum numeric value on the wire for reasoningEffort. + */ + int getReasoningEffortValue(); + /** + * optional .weaviate.v1.GenerativeOpenAI.ReasoningEffort reasoning_effort = 16; + * @return The reasoningEffort. + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.ReasoningEffort getReasoningEffort(); + + /** + * optional .weaviate.v1.GenerativeOpenAI.Verbosity verbosity = 17; + * @return Whether the verbosity field is set. + */ + boolean hasVerbosity(); + /** + * optional .weaviate.v1.GenerativeOpenAI.Verbosity verbosity = 17; + * @return The enum numeric value on the wire for verbosity. + */ + int getVerbosityValue(); + /** + * optional .weaviate.v1.GenerativeOpenAI.Verbosity verbosity = 17; + * @return The verbosity. + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.Verbosity getVerbosity(); } /** * Protobuf type {@code weaviate.v1.GenerativeOpenAI} @@ -16381,6 +17336,8 @@ private GenerativeOpenAI() { apiVersion_ = ""; resourceName_ = ""; deploymentId_ = ""; + reasoningEffort_ = 0; + verbosity_ = 0; } @java.lang.Override @@ -16403,6 +17360,267 @@ protected java.lang.Object newInstance( io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.class, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.Builder.class); } + /** + * Protobuf enum {@code weaviate.v1.GenerativeOpenAI.ReasoningEffort} + */ + public enum ReasoningEffort + implements com.google.protobuf.ProtocolMessageEnum { + /** + * REASONING_EFFORT_UNSPECIFIED = 0; + */ + REASONING_EFFORT_UNSPECIFIED(0), + /** + * REASONING_EFFORT_MINIMAL = 1; + */ + REASONING_EFFORT_MINIMAL(1), + /** + * REASONING_EFFORT_LOW = 2; + */ + REASONING_EFFORT_LOW(2), + /** + * REASONING_EFFORT_MEDIUM = 3; + */ + REASONING_EFFORT_MEDIUM(3), + /** + * REASONING_EFFORT_HIGH = 4; + */ + REASONING_EFFORT_HIGH(4), + UNRECOGNIZED(-1), + ; + + /** + * REASONING_EFFORT_UNSPECIFIED = 0; + */ + public static final int REASONING_EFFORT_UNSPECIFIED_VALUE = 0; + /** + * REASONING_EFFORT_MINIMAL = 1; + */ + public static final int REASONING_EFFORT_MINIMAL_VALUE = 1; + /** + * REASONING_EFFORT_LOW = 2; + */ + public static final int REASONING_EFFORT_LOW_VALUE = 2; + /** + * REASONING_EFFORT_MEDIUM = 3; + */ + public static final int REASONING_EFFORT_MEDIUM_VALUE = 3; + /** + * REASONING_EFFORT_HIGH = 4; + */ + public static final int REASONING_EFFORT_HIGH_VALUE = 4; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ReasoningEffort valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ReasoningEffort forNumber(int value) { + switch (value) { + case 0: return REASONING_EFFORT_UNSPECIFIED; + case 1: return REASONING_EFFORT_MINIMAL; + case 2: return REASONING_EFFORT_LOW; + case 3: return REASONING_EFFORT_MEDIUM; + case 4: return REASONING_EFFORT_HIGH; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ReasoningEffort> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ReasoningEffort findValueByNumber(int number) { + return ReasoningEffort.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.getDescriptor().getEnumTypes().get(0); + } + + private static final ReasoningEffort[] VALUES = values(); + + public static ReasoningEffort valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ReasoningEffort(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:weaviate.v1.GenerativeOpenAI.ReasoningEffort) + } + + /** + * Protobuf enum {@code weaviate.v1.GenerativeOpenAI.Verbosity} + */ + public enum Verbosity + implements com.google.protobuf.ProtocolMessageEnum { + /** + * VERBOSITY_UNSPECIFIED = 0; + */ + VERBOSITY_UNSPECIFIED(0), + /** + * VERBOSITY_LOW = 1; + */ + VERBOSITY_LOW(1), + /** + * VERBOSITY_MEDIUM = 2; + */ + VERBOSITY_MEDIUM(2), + /** + * VERBOSITY_HIGH = 3; + */ + VERBOSITY_HIGH(3), + UNRECOGNIZED(-1), + ; + + /** + * VERBOSITY_UNSPECIFIED = 0; + */ + public static final int VERBOSITY_UNSPECIFIED_VALUE = 0; + /** + * VERBOSITY_LOW = 1; + */ + public static final int VERBOSITY_LOW_VALUE = 1; + /** + * VERBOSITY_MEDIUM = 2; + */ + public static final int VERBOSITY_MEDIUM_VALUE = 2; + /** + * VERBOSITY_HIGH = 3; + */ + public static final int VERBOSITY_HIGH_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Verbosity valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Verbosity forNumber(int value) { + switch (value) { + case 0: return VERBOSITY_UNSPECIFIED; + case 1: return VERBOSITY_LOW; + case 2: return VERBOSITY_MEDIUM; + case 3: return VERBOSITY_HIGH; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Verbosity> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Verbosity findValueByNumber(int number) { + return Verbosity.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.getDescriptor().getEnumTypes().get(1); + } + + private static final Verbosity[] VALUES = values(); + + public static Verbosity valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Verbosity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:weaviate.v1.GenerativeOpenAI.Verbosity) + } + private int bitField0_; public static final int FREQUENCY_PENALTY_FIELD_NUMBER = 1; private double frequencyPenalty_ = 0D; @@ -16850,6 +18068,56 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray return imageProperties_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : imageProperties_; } + public static final int REASONING_EFFORT_FIELD_NUMBER = 16; + private int reasoningEffort_ = 0; + /** + * optional .weaviate.v1.GenerativeOpenAI.ReasoningEffort reasoning_effort = 16; + * @return Whether the reasoningEffort field is set. + */ + @java.lang.Override public boolean hasReasoningEffort() { + return ((bitField0_ & 0x00008000) != 0); + } + /** + * optional .weaviate.v1.GenerativeOpenAI.ReasoningEffort reasoning_effort = 16; + * @return The enum numeric value on the wire for reasoningEffort. + */ + @java.lang.Override public int getReasoningEffortValue() { + return reasoningEffort_; + } + /** + * optional .weaviate.v1.GenerativeOpenAI.ReasoningEffort reasoning_effort = 16; + * @return The reasoningEffort. + */ + @java.lang.Override public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.ReasoningEffort getReasoningEffort() { + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.ReasoningEffort result = io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.ReasoningEffort.forNumber(reasoningEffort_); + return result == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.ReasoningEffort.UNRECOGNIZED : result; + } + + public static final int VERBOSITY_FIELD_NUMBER = 17; + private int verbosity_ = 0; + /** + * optional .weaviate.v1.GenerativeOpenAI.Verbosity verbosity = 17; + * @return Whether the verbosity field is set. + */ + @java.lang.Override public boolean hasVerbosity() { + return ((bitField0_ & 0x00010000) != 0); + } + /** + * optional .weaviate.v1.GenerativeOpenAI.Verbosity verbosity = 17; + * @return The enum numeric value on the wire for verbosity. + */ + @java.lang.Override public int getVerbosityValue() { + return verbosity_; + } + /** + * optional .weaviate.v1.GenerativeOpenAI.Verbosity verbosity = 17; + * @return The verbosity. + */ + @java.lang.Override public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.Verbosity getVerbosity() { + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.Verbosity result = io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.Verbosity.forNumber(verbosity_); + return result == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.Verbosity.UNRECOGNIZED : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -16909,6 +18177,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00004000) != 0)) { output.writeMessage(15, getImageProperties()); } + if (((bitField0_ & 0x00008000) != 0)) { + output.writeEnum(16, reasoningEffort_); + } + if (((bitField0_ & 0x00010000) != 0)) { + output.writeEnum(17, verbosity_); + } getUnknownFields().writeTo(output); } @@ -16973,6 +18247,14 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(15, getImageProperties()); } + if (((bitField0_ & 0x00008000) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(16, reasoningEffort_); + } + if (((bitField0_ & 0x00010000) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(17, verbosity_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -17067,6 +18349,14 @@ public boolean equals(final java.lang.Object obj) { if (!getImageProperties() .equals(other.getImageProperties())) return false; } + if (hasReasoningEffort() != other.hasReasoningEffort()) return false; + if (hasReasoningEffort()) { + if (reasoningEffort_ != other.reasoningEffort_) return false; + } + if (hasVerbosity() != other.hasVerbosity()) return false; + if (hasVerbosity()) { + if (verbosity_ != other.verbosity_) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -17145,6 +18435,14 @@ public int hashCode() { hash = (37 * hash) + IMAGE_PROPERTIES_FIELD_NUMBER; hash = (53 * hash) + getImageProperties().hashCode(); } + if (hasReasoningEffort()) { + hash = (37 * hash) + REASONING_EFFORT_FIELD_NUMBER; + hash = (53 * hash) + reasoningEffort_; + } + if (hasVerbosity()) { + hash = (37 * hash) + VERBOSITY_FIELD_NUMBER; + hash = (53 * hash) + verbosity_; + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -17311,6 +18609,8 @@ public Builder clear() { imagePropertiesBuilder_.dispose(); imagePropertiesBuilder_ = null; } + reasoningEffort_ = 0; + verbosity_ = 0; return this; } @@ -17411,6 +18711,14 @@ private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.Weaviat : imagePropertiesBuilder_.build(); to_bitField0_ |= 0x00004000; } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.reasoningEffort_ = reasoningEffort_; + to_bitField0_ |= 0x00008000; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.verbosity_ = verbosity_; + to_bitField0_ |= 0x00010000; + } result.bitField0_ |= to_bitField0_; } @@ -17513,6 +18821,12 @@ public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateP if (other.hasImageProperties()) { mergeImageProperties(other.getImageProperties()); } + if (other.hasReasoningEffort()) { + setReasoningEffort(other.getReasoningEffort()); + } + if (other.hasVerbosity()) { + setVerbosity(other.getVerbosity()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -17620,6 +18934,16 @@ public Builder mergeFrom( bitField0_ |= 0x00004000; break; } // case 122 + case 128: { + reasoningEffort_ = input.readEnum(); + bitField0_ |= 0x00008000; + break; + } // case 128 + case 136: { + verbosity_ = input.readEnum(); + bitField0_ |= 0x00010000; + break; + } // case 136 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -18674,6 +19998,126 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray } return imagePropertiesBuilder_; } + + private int reasoningEffort_ = 0; + /** + * optional .weaviate.v1.GenerativeOpenAI.ReasoningEffort reasoning_effort = 16; + * @return Whether the reasoningEffort field is set. + */ + @java.lang.Override public boolean hasReasoningEffort() { + return ((bitField0_ & 0x00008000) != 0); + } + /** + * optional .weaviate.v1.GenerativeOpenAI.ReasoningEffort reasoning_effort = 16; + * @return The enum numeric value on the wire for reasoningEffort. + */ + @java.lang.Override public int getReasoningEffortValue() { + return reasoningEffort_; + } + /** + * optional .weaviate.v1.GenerativeOpenAI.ReasoningEffort reasoning_effort = 16; + * @param value The enum numeric value on the wire for reasoningEffort to set. + * @return This builder for chaining. + */ + public Builder setReasoningEffortValue(int value) { + reasoningEffort_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.GenerativeOpenAI.ReasoningEffort reasoning_effort = 16; + * @return The reasoningEffort. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.ReasoningEffort getReasoningEffort() { + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.ReasoningEffort result = io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.ReasoningEffort.forNumber(reasoningEffort_); + return result == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.ReasoningEffort.UNRECOGNIZED : result; + } + /** + * optional .weaviate.v1.GenerativeOpenAI.ReasoningEffort reasoning_effort = 16; + * @param value The reasoningEffort to set. + * @return This builder for chaining. + */ + public Builder setReasoningEffort(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.ReasoningEffort value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00008000; + reasoningEffort_ = value.getNumber(); + onChanged(); + return this; + } + /** + * optional .weaviate.v1.GenerativeOpenAI.ReasoningEffort reasoning_effort = 16; + * @return This builder for chaining. + */ + public Builder clearReasoningEffort() { + bitField0_ = (bitField0_ & ~0x00008000); + reasoningEffort_ = 0; + onChanged(); + return this; + } + + private int verbosity_ = 0; + /** + * optional .weaviate.v1.GenerativeOpenAI.Verbosity verbosity = 17; + * @return Whether the verbosity field is set. + */ + @java.lang.Override public boolean hasVerbosity() { + return ((bitField0_ & 0x00010000) != 0); + } + /** + * optional .weaviate.v1.GenerativeOpenAI.Verbosity verbosity = 17; + * @return The enum numeric value on the wire for verbosity. + */ + @java.lang.Override public int getVerbosityValue() { + return verbosity_; + } + /** + * optional .weaviate.v1.GenerativeOpenAI.Verbosity verbosity = 17; + * @param value The enum numeric value on the wire for verbosity to set. + * @return This builder for chaining. + */ + public Builder setVerbosityValue(int value) { + verbosity_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.GenerativeOpenAI.Verbosity verbosity = 17; + * @return The verbosity. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.Verbosity getVerbosity() { + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.Verbosity result = io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.Verbosity.forNumber(verbosity_); + return result == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.Verbosity.UNRECOGNIZED : result; + } + /** + * optional .weaviate.v1.GenerativeOpenAI.Verbosity verbosity = 17; + * @param value The verbosity to set. + * @return This builder for chaining. + */ + public Builder setVerbosity(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeOpenAI.Verbosity value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00010000; + verbosity_ = value.getNumber(); + onChanged(); + return this; + } + /** + * optional .weaviate.v1.GenerativeOpenAI.Verbosity verbosity = 17; + * @return This builder for chaining. + */ + public Builder clearVerbosity() { + bitField0_ = (bitField0_ & ~0x00010000); + verbosity_ = 0; + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -26026,40 +27470,1483 @@ public Builder mergeFrom( done = true; break; case 10: { - baseUrl_ = input.readStringRequireUtf8(); + baseUrl_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + model_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 25: { + temperature_ = input.readDouble(); + bitField0_ |= 0x00000004; + break; + } // case 25 + case 33: { + topP_ = input.readDouble(); + bitField0_ |= 0x00000008; + break; + } // case 33 + case 40: { + maxTokens_ = input.readInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: { + input.readMessage( + getImagesFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: { + input.readMessage( + getImagePropertiesFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object baseUrl_ = ""; + /** + * optional string base_url = 1; + * @return Whether the baseUrl field is set. + */ + public boolean hasBaseUrl() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string base_url = 1; + * @return The baseUrl. + */ + public java.lang.String getBaseUrl() { + java.lang.Object ref = baseUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + baseUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string base_url = 1; + * @return The bytes for baseUrl. + */ + public com.google.protobuf.ByteString + getBaseUrlBytes() { + java.lang.Object ref = baseUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + baseUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string base_url = 1; + * @param value The baseUrl to set. + * @return This builder for chaining. + */ + public Builder setBaseUrl( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + baseUrl_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional string base_url = 1; + * @return This builder for chaining. + */ + public Builder clearBaseUrl() { + baseUrl_ = getDefaultInstance().getBaseUrl(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * optional string base_url = 1; + * @param value The bytes for baseUrl to set. + * @return This builder for chaining. + */ + public Builder setBaseUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + baseUrl_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object model_ = ""; + /** + * optional string model = 2; + * @return Whether the model field is set. + */ + public boolean hasModel() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional string model = 2; + * @return The model. + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string model = 2; + * @return The bytes for model. + */ + public com.google.protobuf.ByteString + getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string model = 2; + * @param value The model to set. + * @return This builder for chaining. + */ + public Builder setModel( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + model_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * optional string model = 2; + * @return This builder for chaining. + */ + public Builder clearModel() { + model_ = getDefaultInstance().getModel(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * optional string model = 2; + * @param value The bytes for model to set. + * @return This builder for chaining. + */ + public Builder setModelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + model_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private double temperature_ ; + /** + * optional double temperature = 3; + * @return Whether the temperature field is set. + */ + @java.lang.Override + public boolean hasTemperature() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional double temperature = 3; + * @return The temperature. + */ + @java.lang.Override + public double getTemperature() { + return temperature_; + } + /** + * optional double temperature = 3; + * @param value The temperature to set. + * @return This builder for chaining. + */ + public Builder setTemperature(double value) { + + temperature_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * optional double temperature = 3; + * @return This builder for chaining. + */ + public Builder clearTemperature() { + bitField0_ = (bitField0_ & ~0x00000004); + temperature_ = 0D; + onChanged(); + return this; + } + + private double topP_ ; + /** + * optional double top_p = 4; + * @return Whether the topP field is set. + */ + @java.lang.Override + public boolean hasTopP() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional double top_p = 4; + * @return The topP. + */ + @java.lang.Override + public double getTopP() { + return topP_; + } + /** + * optional double top_p = 4; + * @param value The topP to set. + * @return This builder for chaining. + */ + public Builder setTopP(double value) { + + topP_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * optional double top_p = 4; + * @return This builder for chaining. + */ + public Builder clearTopP() { + bitField0_ = (bitField0_ & ~0x00000008); + topP_ = 0D; + onChanged(); + return this; + } + + private long maxTokens_ ; + /** + * optional int64 max_tokens = 5; + * @return Whether the maxTokens field is set. + */ + @java.lang.Override + public boolean hasMaxTokens() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * optional int64 max_tokens = 5; + * @return The maxTokens. + */ + @java.lang.Override + public long getMaxTokens() { + return maxTokens_; + } + /** + * optional int64 max_tokens = 5; + * @param value The maxTokens to set. + * @return This builder for chaining. + */ + public Builder setMaxTokens(long value) { + + maxTokens_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * optional int64 max_tokens = 5; + * @return This builder for chaining. + */ + public Builder clearMaxTokens() { + bitField0_ = (bitField0_ & ~0x00000010); + maxTokens_ = 0L; + onChanged(); + return this; + } + + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray images_; + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder> imagesBuilder_; + /** + * optional .weaviate.v1.TextArray images = 6; + * @return Whether the images field is set. + */ + public boolean hasImages() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional .weaviate.v1.TextArray images = 6; + * @return The images. + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray getImages() { + if (imagesBuilder_ == null) { + return images_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : images_; + } else { + return imagesBuilder_.getMessage(); + } + } + /** + * optional .weaviate.v1.TextArray images = 6; + */ + public Builder setImages(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray value) { + if (imagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + images_ = value; + } else { + imagesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.TextArray images = 6; + */ + public Builder setImages( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder builderForValue) { + if (imagesBuilder_ == null) { + images_ = builderForValue.build(); + } else { + imagesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.TextArray images = 6; + */ + public Builder mergeImages(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray value) { + if (imagesBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + images_ != null && + images_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance()) { + getImagesBuilder().mergeFrom(value); + } else { + images_ = value; + } + } else { + imagesBuilder_.mergeFrom(value); + } + if (images_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * optional .weaviate.v1.TextArray images = 6; + */ + public Builder clearImages() { + bitField0_ = (bitField0_ & ~0x00000020); + images_ = null; + if (imagesBuilder_ != null) { + imagesBuilder_.dispose(); + imagesBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .weaviate.v1.TextArray images = 6; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder getImagesBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getImagesFieldBuilder().getBuilder(); + } + /** + * optional .weaviate.v1.TextArray images = 6; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder getImagesOrBuilder() { + if (imagesBuilder_ != null) { + return imagesBuilder_.getMessageOrBuilder(); + } else { + return images_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : images_; + } + } + /** + * optional .weaviate.v1.TextArray images = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder> + getImagesFieldBuilder() { + if (imagesBuilder_ == null) { + imagesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder>( + getImages(), + getParentForChildren(), + isClean()); + images_ = null; + } + return imagesBuilder_; + } + + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray imageProperties_; + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder> imagePropertiesBuilder_; + /** + * optional .weaviate.v1.TextArray image_properties = 7; + * @return Whether the imageProperties field is set. + */ + public boolean hasImageProperties() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * optional .weaviate.v1.TextArray image_properties = 7; + * @return The imageProperties. + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray getImageProperties() { + if (imagePropertiesBuilder_ == null) { + return imageProperties_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : imageProperties_; + } else { + return imagePropertiesBuilder_.getMessage(); + } + } + /** + * optional .weaviate.v1.TextArray image_properties = 7; + */ + public Builder setImageProperties(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray value) { + if (imagePropertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + imageProperties_ = value; + } else { + imagePropertiesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.TextArray image_properties = 7; + */ + public Builder setImageProperties( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder builderForValue) { + if (imagePropertiesBuilder_ == null) { + imageProperties_ = builderForValue.build(); + } else { + imagePropertiesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.TextArray image_properties = 7; + */ + public Builder mergeImageProperties(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray value) { + if (imagePropertiesBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) && + imageProperties_ != null && + imageProperties_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance()) { + getImagePropertiesBuilder().mergeFrom(value); + } else { + imageProperties_ = value; + } + } else { + imagePropertiesBuilder_.mergeFrom(value); + } + if (imageProperties_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * optional .weaviate.v1.TextArray image_properties = 7; + */ + public Builder clearImageProperties() { + bitField0_ = (bitField0_ & ~0x00000040); + imageProperties_ = null; + if (imagePropertiesBuilder_ != null) { + imagePropertiesBuilder_.dispose(); + imagePropertiesBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .weaviate.v1.TextArray image_properties = 7; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder getImagePropertiesBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getImagePropertiesFieldBuilder().getBuilder(); + } + /** + * optional .weaviate.v1.TextArray image_properties = 7; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder getImagePropertiesOrBuilder() { + if (imagePropertiesBuilder_ != null) { + return imagePropertiesBuilder_.getMessageOrBuilder(); + } else { + return imageProperties_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : imageProperties_; + } + } + /** + * optional .weaviate.v1.TextArray image_properties = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder> + getImagePropertiesFieldBuilder() { + if (imagePropertiesBuilder_ == null) { + imagePropertiesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder>( + getImageProperties(), + getParentForChildren(), + isClean()); + imageProperties_ = null; + } + return imagePropertiesBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:weaviate.v1.GenerativeXAI) + } + + // @@protoc_insertion_point(class_scope:weaviate.v1.GenerativeXAI) + private static final io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeXAI DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeXAI(); + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeXAI getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerativeXAI parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeXAI getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GenerativeContextualAIOrBuilder extends + // @@protoc_insertion_point(interface_extends:weaviate.v1.GenerativeContextualAI) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string model = 1; + * @return Whether the model field is set. + */ + boolean hasModel(); + /** + * optional string model = 1; + * @return The model. + */ + java.lang.String getModel(); + /** + * optional string model = 1; + * @return The bytes for model. + */ + com.google.protobuf.ByteString + getModelBytes(); + + /** + * optional double temperature = 2; + * @return Whether the temperature field is set. + */ + boolean hasTemperature(); + /** + * optional double temperature = 2; + * @return The temperature. + */ + double getTemperature(); + + /** + * optional double top_p = 3; + * @return Whether the topP field is set. + */ + boolean hasTopP(); + /** + * optional double top_p = 3; + * @return The topP. + */ + double getTopP(); + + /** + * optional int64 max_new_tokens = 4; + * @return Whether the maxNewTokens field is set. + */ + boolean hasMaxNewTokens(); + /** + * optional int64 max_new_tokens = 4; + * @return The maxNewTokens. + */ + long getMaxNewTokens(); + + /** + * optional string system_prompt = 5; + * @return Whether the systemPrompt field is set. + */ + boolean hasSystemPrompt(); + /** + * optional string system_prompt = 5; + * @return The systemPrompt. + */ + java.lang.String getSystemPrompt(); + /** + * optional string system_prompt = 5; + * @return The bytes for systemPrompt. + */ + com.google.protobuf.ByteString + getSystemPromptBytes(); + + /** + * optional bool avoid_commentary = 6; + * @return Whether the avoidCommentary field is set. + */ + boolean hasAvoidCommentary(); + /** + * optional bool avoid_commentary = 6; + * @return The avoidCommentary. + */ + boolean getAvoidCommentary(); + + /** + * optional .weaviate.v1.TextArray knowledge = 7; + * @return Whether the knowledge field is set. + */ + boolean hasKnowledge(); + /** + * optional .weaviate.v1.TextArray knowledge = 7; + * @return The knowledge. + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray getKnowledge(); + /** + * optional .weaviate.v1.TextArray knowledge = 7; + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder getKnowledgeOrBuilder(); + } + /** + * Protobuf type {@code weaviate.v1.GenerativeContextualAI} + */ + public static final class GenerativeContextualAI extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:weaviate.v1.GenerativeContextualAI) + GenerativeContextualAIOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerativeContextualAI.newBuilder() to construct. + private GenerativeContextualAI(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GenerativeContextualAI() { + model_ = ""; + systemPrompt_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GenerativeContextualAI(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.internal_static_weaviate_v1_GenerativeContextualAI_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.internal_static_weaviate_v1_GenerativeContextualAI_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI.class, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI.Builder.class); + } + + private int bitField0_; + public static final int MODEL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object model_ = ""; + /** + * optional string model = 1; + * @return Whether the model field is set. + */ + @java.lang.Override + public boolean hasModel() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string model = 1; + * @return The model. + */ + @java.lang.Override + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } + } + /** + * optional string model = 1; + * @return The bytes for model. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TEMPERATURE_FIELD_NUMBER = 2; + private double temperature_ = 0D; + /** + * optional double temperature = 2; + * @return Whether the temperature field is set. + */ + @java.lang.Override + public boolean hasTemperature() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional double temperature = 2; + * @return The temperature. + */ + @java.lang.Override + public double getTemperature() { + return temperature_; + } + + public static final int TOP_P_FIELD_NUMBER = 3; + private double topP_ = 0D; + /** + * optional double top_p = 3; + * @return Whether the topP field is set. + */ + @java.lang.Override + public boolean hasTopP() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional double top_p = 3; + * @return The topP. + */ + @java.lang.Override + public double getTopP() { + return topP_; + } + + public static final int MAX_NEW_TOKENS_FIELD_NUMBER = 4; + private long maxNewTokens_ = 0L; + /** + * optional int64 max_new_tokens = 4; + * @return Whether the maxNewTokens field is set. + */ + @java.lang.Override + public boolean hasMaxNewTokens() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional int64 max_new_tokens = 4; + * @return The maxNewTokens. + */ + @java.lang.Override + public long getMaxNewTokens() { + return maxNewTokens_; + } + + public static final int SYSTEM_PROMPT_FIELD_NUMBER = 5; + @SuppressWarnings("serial") + private volatile java.lang.Object systemPrompt_ = ""; + /** + * optional string system_prompt = 5; + * @return Whether the systemPrompt field is set. + */ + @java.lang.Override + public boolean hasSystemPrompt() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * optional string system_prompt = 5; + * @return The systemPrompt. + */ + @java.lang.Override + public java.lang.String getSystemPrompt() { + java.lang.Object ref = systemPrompt_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + systemPrompt_ = s; + return s; + } + } + /** + * optional string system_prompt = 5; + * @return The bytes for systemPrompt. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSystemPromptBytes() { + java.lang.Object ref = systemPrompt_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + systemPrompt_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AVOID_COMMENTARY_FIELD_NUMBER = 6; + private boolean avoidCommentary_ = false; + /** + * optional bool avoid_commentary = 6; + * @return Whether the avoidCommentary field is set. + */ + @java.lang.Override + public boolean hasAvoidCommentary() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional bool avoid_commentary = 6; + * @return The avoidCommentary. + */ + @java.lang.Override + public boolean getAvoidCommentary() { + return avoidCommentary_; + } + + public static final int KNOWLEDGE_FIELD_NUMBER = 7; + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray knowledge_; + /** + * optional .weaviate.v1.TextArray knowledge = 7; + * @return Whether the knowledge field is set. + */ + @java.lang.Override + public boolean hasKnowledge() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * optional .weaviate.v1.TextArray knowledge = 7; + * @return The knowledge. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray getKnowledge() { + return knowledge_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : knowledge_; + } + /** + * optional .weaviate.v1.TextArray knowledge = 7; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder getKnowledgeOrBuilder() { + return knowledge_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : knowledge_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, model_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeDouble(2, temperature_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeDouble(3, topP_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeInt64(4, maxNewTokens_); + } + if (((bitField0_ & 0x00000010) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, systemPrompt_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeBool(6, avoidCommentary_); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(7, getKnowledge()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, model_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(2, temperature_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(3, topP_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, maxNewTokens_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, systemPrompt_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(6, avoidCommentary_); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getKnowledge()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI)) { + return super.equals(obj); + } + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI other = (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI) obj; + + if (hasModel() != other.hasModel()) return false; + if (hasModel()) { + if (!getModel() + .equals(other.getModel())) return false; + } + if (hasTemperature() != other.hasTemperature()) return false; + if (hasTemperature()) { + if (java.lang.Double.doubleToLongBits(getTemperature()) + != java.lang.Double.doubleToLongBits( + other.getTemperature())) return false; + } + if (hasTopP() != other.hasTopP()) return false; + if (hasTopP()) { + if (java.lang.Double.doubleToLongBits(getTopP()) + != java.lang.Double.doubleToLongBits( + other.getTopP())) return false; + } + if (hasMaxNewTokens() != other.hasMaxNewTokens()) return false; + if (hasMaxNewTokens()) { + if (getMaxNewTokens() + != other.getMaxNewTokens()) return false; + } + if (hasSystemPrompt() != other.hasSystemPrompt()) return false; + if (hasSystemPrompt()) { + if (!getSystemPrompt() + .equals(other.getSystemPrompt())) return false; + } + if (hasAvoidCommentary() != other.hasAvoidCommentary()) return false; + if (hasAvoidCommentary()) { + if (getAvoidCommentary() + != other.getAvoidCommentary()) return false; + } + if (hasKnowledge() != other.hasKnowledge()) return false; + if (hasKnowledge()) { + if (!getKnowledge() + .equals(other.getKnowledge())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasModel()) { + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + } + if (hasTemperature()) { + hash = (37 * hash) + TEMPERATURE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getTemperature())); + } + if (hasTopP()) { + hash = (37 * hash) + TOP_P_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getTopP())); + } + if (hasMaxNewTokens()) { + hash = (37 * hash) + MAX_NEW_TOKENS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMaxNewTokens()); + } + if (hasSystemPrompt()) { + hash = (37 * hash) + SYSTEM_PROMPT_FIELD_NUMBER; + hash = (53 * hash) + getSystemPrompt().hashCode(); + } + if (hasAvoidCommentary()) { + hash = (37 * hash) + AVOID_COMMENTARY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAvoidCommentary()); + } + if (hasKnowledge()) { + hash = (37 * hash) + KNOWLEDGE_FIELD_NUMBER; + hash = (53 * hash) + getKnowledge().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code weaviate.v1.GenerativeContextualAI} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:weaviate.v1.GenerativeContextualAI) + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAIOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.internal_static_weaviate_v1_GenerativeContextualAI_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.internal_static_weaviate_v1_GenerativeContextualAI_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI.class, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI.Builder.class); + } + + // Construct using io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getKnowledgeFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + model_ = ""; + temperature_ = 0D; + topP_ = 0D; + maxNewTokens_ = 0L; + systemPrompt_ = ""; + avoidCommentary_ = false; + knowledge_ = null; + if (knowledgeBuilder_ != null) { + knowledgeBuilder_.dispose(); + knowledgeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.internal_static_weaviate_v1_GenerativeContextualAI_descriptor; + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI getDefaultInstanceForType() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI.getDefaultInstance(); + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI build() { + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI buildPartial() { + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI result = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.model_ = model_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.temperature_ = temperature_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.topP_ = topP_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.maxNewTokens_ = maxNewTokens_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.systemPrompt_ = systemPrompt_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.avoidCommentary_ = avoidCommentary_; + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.knowledge_ = knowledgeBuilder_ == null + ? knowledge_ + : knowledgeBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI) { + return mergeFrom((io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI other) { + if (other == io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI.getDefaultInstance()) return this; + if (other.hasModel()) { + model_ = other.model_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasTemperature()) { + setTemperature(other.getTemperature()); + } + if (other.hasTopP()) { + setTopP(other.getTopP()); + } + if (other.hasMaxNewTokens()) { + setMaxNewTokens(other.getMaxNewTokens()); + } + if (other.hasSystemPrompt()) { + systemPrompt_ = other.systemPrompt_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasAvoidCommentary()) { + setAvoidCommentary(other.getAvoidCommentary()); + } + if (other.hasKnowledge()) { + mergeKnowledge(other.getKnowledge()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + model_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000001; break; } // case 10 - case 18: { - model_ = input.readStringRequireUtf8(); + case 17: { + temperature_ = input.readDouble(); bitField0_ |= 0x00000002; break; - } // case 18 + } // case 17 case 25: { - temperature_ = input.readDouble(); + topP_ = input.readDouble(); bitField0_ |= 0x00000004; break; } // case 25 - case 33: { - topP_ = input.readDouble(); + case 32: { + maxNewTokens_ = input.readInt64(); bitField0_ |= 0x00000008; break; - } // case 33 - case 40: { - maxTokens_ = input.readInt64(); + } // case 32 + case 42: { + systemPrompt_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000010; break; - } // case 40 - case 50: { - input.readMessage( - getImagesFieldBuilder().getBuilder(), - extensionRegistry); + } // case 42 + case 48: { + avoidCommentary_ = input.readBool(); bitField0_ |= 0x00000020; break; - } // case 50 + } // case 48 case 58: { input.readMessage( - getImagePropertiesFieldBuilder().getBuilder(), + getKnowledgeFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000040; break; @@ -26081,95 +28968,16 @@ public Builder mergeFrom( } private int bitField0_; - private java.lang.Object baseUrl_ = ""; - /** - * optional string base_url = 1; - * @return Whether the baseUrl field is set. - */ - public boolean hasBaseUrl() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * optional string base_url = 1; - * @return The baseUrl. - */ - public java.lang.String getBaseUrl() { - java.lang.Object ref = baseUrl_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - baseUrl_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string base_url = 1; - * @return The bytes for baseUrl. - */ - public com.google.protobuf.ByteString - getBaseUrlBytes() { - java.lang.Object ref = baseUrl_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - baseUrl_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string base_url = 1; - * @param value The baseUrl to set. - * @return This builder for chaining. - */ - public Builder setBaseUrl( - java.lang.String value) { - if (value == null) { throw new NullPointerException(); } - baseUrl_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * optional string base_url = 1; - * @return This builder for chaining. - */ - public Builder clearBaseUrl() { - baseUrl_ = getDefaultInstance().getBaseUrl(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * optional string base_url = 1; - * @param value The bytes for baseUrl to set. - * @return This builder for chaining. - */ - public Builder setBaseUrlBytes( - com.google.protobuf.ByteString value) { - if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - baseUrl_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - private java.lang.Object model_ = ""; /** - * optional string model = 2; + * optional string model = 1; * @return Whether the model field is set. */ public boolean hasModel() { - return ((bitField0_ & 0x00000002) != 0); + return ((bitField0_ & 0x00000001) != 0); } /** - * optional string model = 2; + * optional string model = 1; * @return The model. */ public java.lang.String getModel() { @@ -26185,7 +28993,7 @@ public java.lang.String getModel() { } } /** - * optional string model = 2; + * optional string model = 1; * @return The bytes for model. */ public com.google.protobuf.ByteString @@ -26202,7 +29010,7 @@ public java.lang.String getModel() { } } /** - * optional string model = 2; + * optional string model = 1; * @param value The model to set. * @return This builder for chaining. */ @@ -26210,22 +29018,22 @@ public Builder setModel( java.lang.String value) { if (value == null) { throw new NullPointerException(); } model_ = value; - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000001; onChanged(); return this; } /** - * optional string model = 2; + * optional string model = 1; * @return This builder for chaining. */ public Builder clearModel() { model_ = getDefaultInstance().getModel(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** - * optional string model = 2; + * optional string model = 1; * @param value The bytes for model to set. * @return This builder for chaining. */ @@ -26234,22 +29042,22 @@ public Builder setModelBytes( if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); model_ = value; - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000001; onChanged(); return this; } private double temperature_ ; /** - * optional double temperature = 3; + * optional double temperature = 2; * @return Whether the temperature field is set. */ @java.lang.Override public boolean hasTemperature() { - return ((bitField0_ & 0x00000004) != 0); + return ((bitField0_ & 0x00000002) != 0); } /** - * optional double temperature = 3; + * optional double temperature = 2; * @return The temperature. */ @java.lang.Override @@ -26257,23 +29065,23 @@ public double getTemperature() { return temperature_; } /** - * optional double temperature = 3; + * optional double temperature = 2; * @param value The temperature to set. * @return This builder for chaining. */ public Builder setTemperature(double value) { temperature_ = value; - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000002; onChanged(); return this; } /** - * optional double temperature = 3; + * optional double temperature = 2; * @return This builder for chaining. */ public Builder clearTemperature() { - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000002); temperature_ = 0D; onChanged(); return this; @@ -26281,15 +29089,15 @@ public Builder clearTemperature() { private double topP_ ; /** - * optional double top_p = 4; + * optional double top_p = 3; * @return Whether the topP field is set. */ @java.lang.Override public boolean hasTopP() { - return ((bitField0_ & 0x00000008) != 0); + return ((bitField0_ & 0x00000004) != 0); } /** - * optional double top_p = 4; + * optional double top_p = 3; * @return The topP. */ @java.lang.Override @@ -26297,308 +29105,306 @@ public double getTopP() { return topP_; } /** - * optional double top_p = 4; + * optional double top_p = 3; * @param value The topP to set. * @return This builder for chaining. */ public Builder setTopP(double value) { topP_ = value; - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000004; onChanged(); return this; } /** - * optional double top_p = 4; + * optional double top_p = 3; * @return This builder for chaining. */ public Builder clearTopP() { - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000004); topP_ = 0D; onChanged(); return this; } - private long maxTokens_ ; + private long maxNewTokens_ ; /** - * optional int64 max_tokens = 5; - * @return Whether the maxTokens field is set. + * optional int64 max_new_tokens = 4; + * @return Whether the maxNewTokens field is set. */ @java.lang.Override - public boolean hasMaxTokens() { - return ((bitField0_ & 0x00000010) != 0); + public boolean hasMaxNewTokens() { + return ((bitField0_ & 0x00000008) != 0); } /** - * optional int64 max_tokens = 5; - * @return The maxTokens. + * optional int64 max_new_tokens = 4; + * @return The maxNewTokens. */ @java.lang.Override - public long getMaxTokens() { - return maxTokens_; + public long getMaxNewTokens() { + return maxNewTokens_; } /** - * optional int64 max_tokens = 5; - * @param value The maxTokens to set. + * optional int64 max_new_tokens = 4; + * @param value The maxNewTokens to set. * @return This builder for chaining. */ - public Builder setMaxTokens(long value) { + public Builder setMaxNewTokens(long value) { - maxTokens_ = value; - bitField0_ |= 0x00000010; + maxNewTokens_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } /** - * optional int64 max_tokens = 5; + * optional int64 max_new_tokens = 4; * @return This builder for chaining. */ - public Builder clearMaxTokens() { - bitField0_ = (bitField0_ & ~0x00000010); - maxTokens_ = 0L; + public Builder clearMaxNewTokens() { + bitField0_ = (bitField0_ & ~0x00000008); + maxNewTokens_ = 0L; onChanged(); return this; } - private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray images_; - private com.google.protobuf.SingleFieldBuilderV3< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder> imagesBuilder_; + private java.lang.Object systemPrompt_ = ""; /** - * optional .weaviate.v1.TextArray images = 6; - * @return Whether the images field is set. + * optional string system_prompt = 5; + * @return Whether the systemPrompt field is set. */ - public boolean hasImages() { - return ((bitField0_ & 0x00000020) != 0); + public boolean hasSystemPrompt() { + return ((bitField0_ & 0x00000010) != 0); } /** - * optional .weaviate.v1.TextArray images = 6; - * @return The images. + * optional string system_prompt = 5; + * @return The systemPrompt. */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray getImages() { - if (imagesBuilder_ == null) { - return images_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : images_; + public java.lang.String getSystemPrompt() { + java.lang.Object ref = systemPrompt_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + systemPrompt_ = s; + return s; } else { - return imagesBuilder_.getMessage(); + return (java.lang.String) ref; } } /** - * optional .weaviate.v1.TextArray images = 6; + * optional string system_prompt = 5; + * @return The bytes for systemPrompt. */ - public Builder setImages(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray value) { - if (imagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - images_ = value; + public com.google.protobuf.ByteString + getSystemPromptBytes() { + java.lang.Object ref = systemPrompt_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + systemPrompt_ = b; + return b; } else { - imagesBuilder_.setMessage(value); + return (com.google.protobuf.ByteString) ref; } - bitField0_ |= 0x00000020; - onChanged(); - return this; } /** - * optional .weaviate.v1.TextArray images = 6; + * optional string system_prompt = 5; + * @param value The systemPrompt to set. + * @return This builder for chaining. */ - public Builder setImages( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder builderForValue) { - if (imagesBuilder_ == null) { - images_ = builderForValue.build(); - } else { - imagesBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000020; + public Builder setSystemPrompt( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + systemPrompt_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } /** - * optional .weaviate.v1.TextArray images = 6; + * optional string system_prompt = 5; + * @return This builder for chaining. */ - public Builder mergeImages(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray value) { - if (imagesBuilder_ == null) { - if (((bitField0_ & 0x00000020) != 0) && - images_ != null && - images_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance()) { - getImagesBuilder().mergeFrom(value); - } else { - images_ = value; - } - } else { - imagesBuilder_.mergeFrom(value); - } - if (images_ != null) { - bitField0_ |= 0x00000020; - onChanged(); - } + public Builder clearSystemPrompt() { + systemPrompt_ = getDefaultInstance().getSystemPrompt(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); return this; } /** - * optional .weaviate.v1.TextArray images = 6; + * optional string system_prompt = 5; + * @param value The bytes for systemPrompt to set. + * @return This builder for chaining. */ - public Builder clearImages() { - bitField0_ = (bitField0_ & ~0x00000020); - images_ = null; - if (imagesBuilder_ != null) { - imagesBuilder_.dispose(); - imagesBuilder_ = null; - } + public Builder setSystemPromptBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + systemPrompt_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } + + private boolean avoidCommentary_ ; /** - * optional .weaviate.v1.TextArray images = 6; + * optional bool avoid_commentary = 6; + * @return Whether the avoidCommentary field is set. */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder getImagesBuilder() { - bitField0_ |= 0x00000020; - onChanged(); - return getImagesFieldBuilder().getBuilder(); + @java.lang.Override + public boolean hasAvoidCommentary() { + return ((bitField0_ & 0x00000020) != 0); } /** - * optional .weaviate.v1.TextArray images = 6; + * optional bool avoid_commentary = 6; + * @return The avoidCommentary. */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder getImagesOrBuilder() { - if (imagesBuilder_ != null) { - return imagesBuilder_.getMessageOrBuilder(); - } else { - return images_ == null ? - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : images_; - } + @java.lang.Override + public boolean getAvoidCommentary() { + return avoidCommentary_; } /** - * optional .weaviate.v1.TextArray images = 6; + * optional bool avoid_commentary = 6; + * @param value The avoidCommentary to set. + * @return This builder for chaining. */ - private com.google.protobuf.SingleFieldBuilderV3< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder> - getImagesFieldBuilder() { - if (imagesBuilder_ == null) { - imagesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder>( - getImages(), - getParentForChildren(), - isClean()); - images_ = null; - } - return imagesBuilder_; + public Builder setAvoidCommentary(boolean value) { + + avoidCommentary_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional bool avoid_commentary = 6; + * @return This builder for chaining. + */ + public Builder clearAvoidCommentary() { + bitField0_ = (bitField0_ & ~0x00000020); + avoidCommentary_ = false; + onChanged(); + return this; } - private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray imageProperties_; + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray knowledge_; private com.google.protobuf.SingleFieldBuilderV3< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder> imagePropertiesBuilder_; + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder> knowledgeBuilder_; /** - * optional .weaviate.v1.TextArray image_properties = 7; - * @return Whether the imageProperties field is set. + * optional .weaviate.v1.TextArray knowledge = 7; + * @return Whether the knowledge field is set. */ - public boolean hasImageProperties() { + public boolean hasKnowledge() { return ((bitField0_ & 0x00000040) != 0); } /** - * optional .weaviate.v1.TextArray image_properties = 7; - * @return The imageProperties. + * optional .weaviate.v1.TextArray knowledge = 7; + * @return The knowledge. */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray getImageProperties() { - if (imagePropertiesBuilder_ == null) { - return imageProperties_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : imageProperties_; + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray getKnowledge() { + if (knowledgeBuilder_ == null) { + return knowledge_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : knowledge_; } else { - return imagePropertiesBuilder_.getMessage(); + return knowledgeBuilder_.getMessage(); } } /** - * optional .weaviate.v1.TextArray image_properties = 7; + * optional .weaviate.v1.TextArray knowledge = 7; */ - public Builder setImageProperties(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray value) { - if (imagePropertiesBuilder_ == null) { + public Builder setKnowledge(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray value) { + if (knowledgeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - imageProperties_ = value; + knowledge_ = value; } else { - imagePropertiesBuilder_.setMessage(value); + knowledgeBuilder_.setMessage(value); } bitField0_ |= 0x00000040; onChanged(); return this; } /** - * optional .weaviate.v1.TextArray image_properties = 7; + * optional .weaviate.v1.TextArray knowledge = 7; */ - public Builder setImageProperties( + public Builder setKnowledge( io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder builderForValue) { - if (imagePropertiesBuilder_ == null) { - imageProperties_ = builderForValue.build(); + if (knowledgeBuilder_ == null) { + knowledge_ = builderForValue.build(); } else { - imagePropertiesBuilder_.setMessage(builderForValue.build()); + knowledgeBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000040; onChanged(); return this; } /** - * optional .weaviate.v1.TextArray image_properties = 7; + * optional .weaviate.v1.TextArray knowledge = 7; */ - public Builder mergeImageProperties(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray value) { - if (imagePropertiesBuilder_ == null) { + public Builder mergeKnowledge(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray value) { + if (knowledgeBuilder_ == null) { if (((bitField0_ & 0x00000040) != 0) && - imageProperties_ != null && - imageProperties_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance()) { - getImagePropertiesBuilder().mergeFrom(value); + knowledge_ != null && + knowledge_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance()) { + getKnowledgeBuilder().mergeFrom(value); } else { - imageProperties_ = value; + knowledge_ = value; } } else { - imagePropertiesBuilder_.mergeFrom(value); + knowledgeBuilder_.mergeFrom(value); } - if (imageProperties_ != null) { + if (knowledge_ != null) { bitField0_ |= 0x00000040; onChanged(); } return this; } /** - * optional .weaviate.v1.TextArray image_properties = 7; + * optional .weaviate.v1.TextArray knowledge = 7; */ - public Builder clearImageProperties() { + public Builder clearKnowledge() { bitField0_ = (bitField0_ & ~0x00000040); - imageProperties_ = null; - if (imagePropertiesBuilder_ != null) { - imagePropertiesBuilder_.dispose(); - imagePropertiesBuilder_ = null; + knowledge_ = null; + if (knowledgeBuilder_ != null) { + knowledgeBuilder_.dispose(); + knowledgeBuilder_ = null; } onChanged(); return this; } /** - * optional .weaviate.v1.TextArray image_properties = 7; + * optional .weaviate.v1.TextArray knowledge = 7; */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder getImagePropertiesBuilder() { + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder getKnowledgeBuilder() { bitField0_ |= 0x00000040; onChanged(); - return getImagePropertiesFieldBuilder().getBuilder(); + return getKnowledgeFieldBuilder().getBuilder(); } /** - * optional .weaviate.v1.TextArray image_properties = 7; + * optional .weaviate.v1.TextArray knowledge = 7; */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder getImagePropertiesOrBuilder() { - if (imagePropertiesBuilder_ != null) { - return imagePropertiesBuilder_.getMessageOrBuilder(); + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder getKnowledgeOrBuilder() { + if (knowledgeBuilder_ != null) { + return knowledgeBuilder_.getMessageOrBuilder(); } else { - return imageProperties_ == null ? - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : imageProperties_; + return knowledge_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.getDefaultInstance() : knowledge_; } } /** - * optional .weaviate.v1.TextArray image_properties = 7; + * optional .weaviate.v1.TextArray knowledge = 7; */ private com.google.protobuf.SingleFieldBuilderV3< io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder> - getImagePropertiesFieldBuilder() { - if (imagePropertiesBuilder_ == null) { - imagePropertiesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + getKnowledgeFieldBuilder() { + if (knowledgeBuilder_ == null) { + knowledgeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArray.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase.TextArrayOrBuilder>( - getImageProperties(), + getKnowledge(), getParentForChildren(), isClean()); - imageProperties_ = null; + knowledge_ = null; } - return imagePropertiesBuilder_; + return knowledgeBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -26613,23 +29419,23 @@ public final Builder mergeUnknownFields( } - // @@protoc_insertion_point(builder_scope:weaviate.v1.GenerativeXAI) + // @@protoc_insertion_point(builder_scope:weaviate.v1.GenerativeContextualAI) } - // @@protoc_insertion_point(class_scope:weaviate.v1.GenerativeXAI) - private static final io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeXAI DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:weaviate.v1.GenerativeContextualAI) + private static final io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeXAI(); + DEFAULT_INSTANCE = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI(); } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeXAI getDefaultInstance() { + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public GenerativeXAI parsePartialFrom( + public GenerativeContextualAI parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -26648,17 +29454,17 @@ public GenerativeXAI parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeXAI getDefaultInstanceForType() { + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeContextualAI getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -50079,6 +52885,11 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.Gen private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_weaviate_v1_GenerativeXAI_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_weaviate_v1_GenerativeContextualAI_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_weaviate_v1_GenerativeContextualAI_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_weaviate_v1_GenerativeAnthropicMetadata_descriptor; private static final @@ -50256,7 +53067,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.Gen "\022/\n\nproperties\030\002 \001(\0132\026.weaviate.v1.TextA" + "rrayH\000\210\001\001\0220\n\007queries\030\003 \003(\0132\037.weaviate.v1" + ".GenerativeProvider\022\r\n\005debug\030\004 \001(\010B\r\n\013_p" + - "roperties\"\300\005\n\022GenerativeProvider\022\027\n\017retu" + + "roperties\"\375\005\n\022GenerativeProvider\022\027\n\017retu" + "rn_metadata\030\001 \001(\010\0225\n\tanthropic\030\002 \001(\0132 .w" + "eaviate.v1.GenerativeAnthropicH\000\0223\n\010anys" + "cale\030\003 \001(\0132\037.weaviate.v1.GenerativeAnysc" + @@ -50273,234 +53084,261 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.Gen "7\n\nfriendliai\030\014 \001(\0132!.weaviate.v1.Genera" + "tiveFriendliAIH\000\022/\n\006nvidia\030\r \001(\0132\035.weavi" + "ate.v1.GenerativeNvidiaH\000\022)\n\003xai\030\016 \001(\0132\032" + - ".weaviate.v1.GenerativeXAIH\000B\006\n\004kind\"\261\003\n" + - "\023GenerativeAnthropic\022\025\n\010base_url\030\001 \001(\tH\000" + - "\210\001\001\022\027\n\nmax_tokens\030\002 \001(\003H\001\210\001\001\022\022\n\005model\030\003 " + - "\001(\tH\002\210\001\001\022\030\n\013temperature\030\004 \001(\001H\003\210\001\001\022\022\n\005to" + - "p_k\030\005 \001(\003H\004\210\001\001\022\022\n\005top_p\030\006 \001(\001H\005\210\001\001\0223\n\016st" + - "op_sequences\030\007 \001(\0132\026.weaviate.v1.TextArr" + - "ayH\006\210\001\001\022+\n\006images\030\010 \001(\0132\026.weaviate.v1.Te" + - "xtArrayH\007\210\001\001\0225\n\020image_properties\030\t \001(\0132\026" + - ".weaviate.v1.TextArrayH\010\210\001\001B\013\n\t_base_url" + - "B\r\n\013_max_tokensB\010\n\006_modelB\016\n\014_temperatur" + - "eB\010\n\006_top_kB\010\n\006_top_pB\021\n\017_stop_sequences" + - "B\t\n\007_imagesB\023\n\021_image_properties\"\200\001\n\022Gen" + - "erativeAnyscale\022\025\n\010base_url\030\001 \001(\tH\000\210\001\001\022\022" + - "\n\005model\030\002 \001(\tH\001\210\001\001\022\030\n\013temperature\030\003 \001(\001H" + - "\002\210\001\001B\013\n\t_base_urlB\010\n\006_modelB\016\n\014_temperat" + - "ure\"\235\003\n\rGenerativeAWS\022\022\n\005model\030\003 \001(\tH\000\210\001" + - "\001\022\030\n\013temperature\030\010 \001(\001H\001\210\001\001\022\024\n\007service\030\t" + - " \001(\tH\002\210\001\001\022\023\n\006region\030\n \001(\tH\003\210\001\001\022\025\n\010endpoi" + - "nt\030\013 \001(\tH\004\210\001\001\022\031\n\014target_model\030\014 \001(\tH\005\210\001\001" + - "\022\033\n\016target_variant\030\r \001(\tH\006\210\001\001\022+\n\006images\030" + - "\016 \001(\0132\026.weaviate.v1.TextArrayH\007\210\001\001\0225\n\020im" + - "age_properties\030\017 \001(\0132\026.weaviate.v1.TextA" + - "rrayH\010\210\001\001B\010\n\006_modelB\016\n\014_temperatureB\n\n\010_" + - "serviceB\t\n\007_regionB\013\n\t_endpointB\017\n\r_targ" + - "et_modelB\021\n\017_target_variantB\t\n\007_imagesB\023" + - "\n\021_image_properties\"\204\003\n\020GenerativeCohere" + - "\022\025\n\010base_url\030\001 \001(\tH\000\210\001\001\022\036\n\021frequency_pen" + - "alty\030\002 \001(\001H\001\210\001\001\022\027\n\nmax_tokens\030\003 \001(\003H\002\210\001\001" + - "\022\022\n\005model\030\004 \001(\tH\003\210\001\001\022\016\n\001k\030\005 \001(\003H\004\210\001\001\022\016\n\001" + - "p\030\006 \001(\001H\005\210\001\001\022\035\n\020presence_penalty\030\007 \001(\001H\006" + - "\210\001\001\0223\n\016stop_sequences\030\010 \001(\0132\026.weaviate.v" + - "1.TextArrayH\007\210\001\001\022\030\n\013temperature\030\t \001(\001H\010\210" + - "\001\001B\013\n\t_base_urlB\024\n\022_frequency_penaltyB\r\n" + - "\013_max_tokensB\010\n\006_modelB\004\n\002_kB\004\n\002_pB\023\n\021_p" + - "resence_penaltyB\021\n\017_stop_sequencesB\016\n\014_t" + - "emperature\"\021\n\017GenerativeDummy\"\305\001\n\021Genera" + - "tiveMistral\022\025\n\010base_url\030\001 \001(\tH\000\210\001\001\022\027\n\nma" + - "x_tokens\030\002 \001(\003H\001\210\001\001\022\022\n\005model\030\003 \001(\tH\002\210\001\001\022" + - "\030\n\013temperature\030\004 \001(\001H\003\210\001\001\022\022\n\005top_p\030\005 \001(\001" + - "H\004\210\001\001B\013\n\t_base_urlB\r\n\013_max_tokensB\010\n\006_mo" + - "delB\016\n\014_temperatureB\010\n\006_top_p\"\212\002\n\020Genera" + - "tiveOllama\022\031\n\014api_endpoint\030\001 \001(\tH\000\210\001\001\022\022\n" + - "\005model\030\002 \001(\tH\001\210\001\001\022\030\n\013temperature\030\003 \001(\001H\002" + - "\210\001\001\022+\n\006images\030\004 \001(\0132\026.weaviate.v1.TextAr" + - "rayH\003\210\001\001\0225\n\020image_properties\030\005 \001(\0132\026.wea" + - "viate.v1.TextArrayH\004\210\001\001B\017\n\r_api_endpoint" + - "B\010\n\006_modelB\016\n\014_temperatureB\t\n\007_imagesB\023\n" + - "\021_image_properties\"\246\005\n\020GenerativeOpenAI\022" + - "\036\n\021frequency_penalty\030\001 \001(\001H\000\210\001\001\022\027\n\nmax_t" + - "okens\030\002 \001(\003H\001\210\001\001\022\022\n\005model\030\003 \001(\tH\002\210\001\001\022\016\n\001" + - "n\030\004 \001(\003H\003\210\001\001\022\035\n\020presence_penalty\030\005 \001(\001H\004" + - "\210\001\001\022)\n\004stop\030\006 \001(\0132\026.weaviate.v1.TextArra" + - "yH\005\210\001\001\022\030\n\013temperature\030\007 \001(\001H\006\210\001\001\022\022\n\005top_" + - "p\030\010 \001(\001H\007\210\001\001\022\025\n\010base_url\030\t \001(\tH\010\210\001\001\022\030\n\013a" + - "pi_version\030\n \001(\tH\t\210\001\001\022\032\n\rresource_name\030\013" + - " \001(\tH\n\210\001\001\022\032\n\rdeployment_id\030\014 \001(\tH\013\210\001\001\022\025\n" + - "\010is_azure\030\r \001(\010H\014\210\001\001\022+\n\006images\030\016 \001(\0132\026.w" + - "eaviate.v1.TextArrayH\r\210\001\001\0225\n\020image_prope" + - "rties\030\017 \001(\0132\026.weaviate.v1.TextArrayH\016\210\001\001" + - "B\024\n\022_frequency_penaltyB\r\n\013_max_tokensB\010\n" + - "\006_modelB\004\n\002_nB\023\n\021_presence_penaltyB\007\n\005_s" + - "topB\016\n\014_temperatureB\010\n\006_top_pB\013\n\t_base_u" + - "rlB\016\n\014_api_versionB\020\n\016_resource_nameB\020\n\016" + - "_deployment_idB\013\n\t_is_azureB\t\n\007_imagesB\023" + - "\n\021_image_properties\"\222\005\n\020GenerativeGoogle" + - "\022\036\n\021frequency_penalty\030\001 \001(\001H\000\210\001\001\022\027\n\nmax_" + - "tokens\030\002 \001(\003H\001\210\001\001\022\022\n\005model\030\003 \001(\tH\002\210\001\001\022\035\n" + - "\020presence_penalty\030\004 \001(\001H\003\210\001\001\022\030\n\013temperat" + - "ure\030\005 \001(\001H\004\210\001\001\022\022\n\005top_k\030\006 \001(\003H\005\210\001\001\022\022\n\005to" + - "p_p\030\007 \001(\001H\006\210\001\001\0223\n\016stop_sequences\030\010 \001(\0132\026" + - ".weaviate.v1.TextArrayH\007\210\001\001\022\031\n\014api_endpo" + - "int\030\t \001(\tH\010\210\001\001\022\027\n\nproject_id\030\n \001(\tH\t\210\001\001\022" + - "\030\n\013endpoint_id\030\013 \001(\tH\n\210\001\001\022\023\n\006region\030\014 \001(" + - "\tH\013\210\001\001\022+\n\006images\030\r \001(\0132\026.weaviate.v1.Tex" + - "tArrayH\014\210\001\001\0225\n\020image_properties\030\016 \001(\0132\026." + - "weaviate.v1.TextArrayH\r\210\001\001B\024\n\022_frequency" + - "_penaltyB\r\n\013_max_tokensB\010\n\006_modelB\023\n\021_pr" + - "esence_penaltyB\016\n\014_temperatureB\010\n\006_top_k" + - "B\010\n\006_top_pB\021\n\017_stop_sequencesB\017\n\r_api_en" + - "dpointB\r\n\013_project_idB\016\n\014_endpoint_idB\t\n" + - "\007_regionB\t\n\007_imagesB\023\n\021_image_properties" + - "\"\320\003\n\024GenerativeDatabricks\022\025\n\010endpoint\030\001 " + - "\001(\tH\000\210\001\001\022\022\n\005model\030\002 \001(\tH\001\210\001\001\022\036\n\021frequenc" + - "y_penalty\030\003 \001(\001H\002\210\001\001\022\026\n\tlog_probs\030\004 \001(\010H" + - "\003\210\001\001\022\032\n\rtop_log_probs\030\005 \001(\003H\004\210\001\001\022\027\n\nmax_" + - "tokens\030\006 \001(\003H\005\210\001\001\022\016\n\001n\030\007 \001(\003H\006\210\001\001\022\035\n\020pre" + - "sence_penalty\030\010 \001(\001H\007\210\001\001\022)\n\004stop\030\t \001(\0132\026" + - ".weaviate.v1.TextArrayH\010\210\001\001\022\030\n\013temperatu" + - "re\030\n \001(\001H\t\210\001\001\022\022\n\005top_p\030\013 \001(\001H\n\210\001\001B\013\n\t_en" + - "dpointB\010\n\006_modelB\024\n\022_frequency_penaltyB\014" + - "\n\n_log_probsB\020\n\016_top_log_probsB\r\n\013_max_t" + - "okensB\004\n\002_nB\023\n\021_presence_penaltyB\007\n\005_sto" + - "pB\016\n\014_temperatureB\010\n\006_top_p\"\336\001\n\024Generati" + - "veFriendliAI\022\025\n\010base_url\030\001 \001(\tH\000\210\001\001\022\022\n\005m" + - "odel\030\002 \001(\tH\001\210\001\001\022\027\n\nmax_tokens\030\003 \001(\003H\002\210\001\001" + - "\022\030\n\013temperature\030\004 \001(\001H\003\210\001\001\022\016\n\001n\030\005 \001(\003H\004\210" + - "\001\001\022\022\n\005top_p\030\006 \001(\001H\005\210\001\001B\013\n\t_base_urlB\010\n\006_" + - "modelB\r\n\013_max_tokensB\016\n\014_temperatureB\004\n\002" + - "_nB\010\n\006_top_p\"\304\001\n\020GenerativeNvidia\022\025\n\010bas" + - "e_url\030\001 \001(\tH\000\210\001\001\022\022\n\005model\030\002 \001(\tH\001\210\001\001\022\030\n\013" + - "temperature\030\003 \001(\001H\002\210\001\001\022\022\n\005top_p\030\004 \001(\001H\003\210" + - "\001\001\022\027\n\nmax_tokens\030\005 \001(\003H\004\210\001\001B\013\n\t_base_url" + - "B\010\n\006_modelB\016\n\014_temperatureB\010\n\006_top_pB\r\n\013" + - "_max_tokens\"\305\002\n\rGenerativeXAI\022\025\n\010base_ur" + - "l\030\001 \001(\tH\000\210\001\001\022\022\n\005model\030\002 \001(\tH\001\210\001\001\022\030\n\013temp" + - "erature\030\003 \001(\001H\002\210\001\001\022\022\n\005top_p\030\004 \001(\001H\003\210\001\001\022\027" + - "\n\nmax_tokens\030\005 \001(\003H\004\210\001\001\022+\n\006images\030\006 \001(\0132" + - "\026.weaviate.v1.TextArrayH\005\210\001\001\0225\n\020image_pr" + - "operties\030\007 \001(\0132\026.weaviate.v1.TextArrayH\006" + - "\210\001\001B\013\n\t_base_urlB\010\n\006_modelB\016\n\014_temperatu" + - "reB\010\n\006_top_pB\r\n\013_max_tokensB\t\n\007_imagesB\023" + - "\n\021_image_properties\"\222\001\n\033GenerativeAnthro" + - "picMetadata\022=\n\005usage\030\001 \001(\0132..weaviate.v1" + - ".GenerativeAnthropicMetadata.Usage\0324\n\005Us" + - "age\022\024\n\014input_tokens\030\001 \001(\003\022\025\n\routput_toke" + - "ns\030\002 \001(\003\"\034\n\032GenerativeAnyscaleMetadata\"\027" + - "\n\025GenerativeAWSMetadata\"\234\006\n\030GenerativeCo" + - "hereMetadata\022J\n\013api_version\030\001 \001(\01320.weav" + - "iate.v1.GenerativeCohereMetadata.ApiVers" + - "ionH\000\210\001\001\022L\n\014billed_units\030\002 \001(\01321.weaviat" + - "e.v1.GenerativeCohereMetadata.BilledUnit" + - "sH\001\210\001\001\022A\n\006tokens\030\003 \001(\0132,.weaviate.v1.Gen" + - "erativeCohereMetadata.TokensH\002\210\001\001\022-\n\010war" + - "nings\030\004 \001(\0132\026.weaviate.v1.TextArrayH\003\210\001\001" + - "\032\216\001\n\nApiVersion\022\024\n\007version\030\001 \001(\tH\000\210\001\001\022\032\n" + - "\ris_deprecated\030\002 \001(\010H\001\210\001\001\022\034\n\017is_experime" + - "ntal\030\003 \001(\010H\002\210\001\001B\n\n\010_versionB\020\n\016_is_depre" + - "catedB\022\n\020_is_experimental\032\305\001\n\013BilledUnit" + - "s\022\031\n\014input_tokens\030\001 \001(\001H\000\210\001\001\022\032\n\routput_t" + - "okens\030\002 \001(\001H\001\210\001\001\022\031\n\014search_units\030\003 \001(\001H\002" + - "\210\001\001\022\034\n\017classifications\030\004 \001(\001H\003\210\001\001B\017\n\r_in" + - "put_tokensB\020\n\016_output_tokensB\017\n\r_search_" + - "unitsB\022\n\020_classifications\032b\n\006Tokens\022\031\n\014i" + - "nput_tokens\030\001 \001(\001H\000\210\001\001\022\032\n\routput_tokens\030" + - "\002 \001(\001H\001\210\001\001B\017\n\r_input_tokensB\020\n\016_output_t" + - "okensB\016\n\014_api_versionB\017\n\r_billed_unitsB\t" + - "\n\007_tokensB\013\n\t_warnings\"\031\n\027GenerativeDumm" + - "yMetadata\"\201\002\n\031GenerativeMistralMetadata\022" + - "@\n\005usage\030\001 \001(\0132,.weaviate.v1.GenerativeM" + - "istralMetadata.UsageH\000\210\001\001\032\227\001\n\005Usage\022\032\n\rp" + - "rompt_tokens\030\001 \001(\003H\000\210\001\001\022\036\n\021completion_to" + - "kens\030\002 \001(\003H\001\210\001\001\022\031\n\014total_tokens\030\003 \001(\003H\002\210" + - "\001\001B\020\n\016_prompt_tokensB\024\n\022_completion_toke" + - "nsB\017\n\r_total_tokensB\010\n\006_usage\"\032\n\030Generat" + - "iveOllamaMetadata\"\377\001\n\030GenerativeOpenAIMe" + - "tadata\022?\n\005usage\030\001 \001(\0132+.weaviate.v1.Gene" + - "rativeOpenAIMetadata.UsageH\000\210\001\001\032\227\001\n\005Usag" + - "e\022\032\n\rprompt_tokens\030\001 \001(\003H\000\210\001\001\022\036\n\021complet" + - "ion_tokens\030\002 \001(\003H\001\210\001\001\022\031\n\014total_tokens\030\003 " + - "\001(\003H\002\210\001\001B\020\n\016_prompt_tokensB\024\n\022_completio" + - "n_tokensB\017\n\r_total_tokensB\010\n\006_usage\"\350\006\n\030" + - "GenerativeGoogleMetadata\022E\n\010metadata\030\001 \001" + - "(\0132..weaviate.v1.GenerativeGoogleMetadat" + - "a.MetadataH\000\210\001\001\022P\n\016usage_metadata\030\002 \001(\0132" + - "3.weaviate.v1.GenerativeGoogleMetadata.U" + - "sageMetadataH\001\210\001\001\032~\n\nTokenCount\022&\n\031total" + - "_billable_characters\030\001 \001(\003H\000\210\001\001\022\031\n\014total" + - "_tokens\030\002 \001(\003H\001\210\001\001B\034\n\032_total_billable_ch" + - "aractersB\017\n\r_total_tokens\032\341\001\n\rTokenMetad" + - "ata\022P\n\021input_token_count\030\001 \001(\01320.weaviat" + - "e.v1.GenerativeGoogleMetadata.TokenCount" + - "H\000\210\001\001\022Q\n\022output_token_count\030\002 \001(\01320.weav" + - "iate.v1.GenerativeGoogleMetadata.TokenCo" + - "untH\001\210\001\001B\024\n\022_input_token_countB\025\n\023_outpu" + - "t_token_count\032o\n\010Metadata\022P\n\016token_metad" + - "ata\030\001 \001(\01323.weaviate.v1.GenerativeGoogle" + - "Metadata.TokenMetadataH\000\210\001\001B\021\n\017_token_me" + - "tadata\032\275\001\n\rUsageMetadata\022\037\n\022prompt_token" + - "_count\030\001 \001(\003H\000\210\001\001\022#\n\026candidates_token_co" + - "unt\030\002 \001(\003H\001\210\001\001\022\036\n\021total_token_count\030\003 \001(" + - "\003H\002\210\001\001B\025\n\023_prompt_token_countB\031\n\027_candid" + - "ates_token_countB\024\n\022_total_token_countB\013" + - "\n\t_metadataB\021\n\017_usage_metadata\"\207\002\n\034Gener" + - "ativeDatabricksMetadata\022C\n\005usage\030\001 \001(\0132/" + - ".weaviate.v1.GenerativeDatabricksMetadat" + - "a.UsageH\000\210\001\001\032\227\001\n\005Usage\022\032\n\rprompt_tokens\030" + - "\001 \001(\003H\000\210\001\001\022\036\n\021completion_tokens\030\002 \001(\003H\001\210" + - "\001\001\022\031\n\014total_tokens\030\003 \001(\003H\002\210\001\001B\020\n\016_prompt" + - "_tokensB\024\n\022_completion_tokensB\017\n\r_total_" + - "tokensB\010\n\006_usage\"\207\002\n\034GenerativeFriendliA" + - "IMetadata\022C\n\005usage\030\001 \001(\0132/.weaviate.v1.G" + - "enerativeFriendliAIMetadata.UsageH\000\210\001\001\032\227" + + ".weaviate.v1.GenerativeXAIH\000\022;\n\014contextu" + + "alai\030\017 \001(\0132#.weaviate.v1.GenerativeConte" + + "xtualAIH\000B\006\n\004kind\"\261\003\n\023GenerativeAnthropi" + + "c\022\025\n\010base_url\030\001 \001(\tH\000\210\001\001\022\027\n\nmax_tokens\030\002" + + " \001(\003H\001\210\001\001\022\022\n\005model\030\003 \001(\tH\002\210\001\001\022\030\n\013tempera" + + "ture\030\004 \001(\001H\003\210\001\001\022\022\n\005top_k\030\005 \001(\003H\004\210\001\001\022\022\n\005t" + + "op_p\030\006 \001(\001H\005\210\001\001\0223\n\016stop_sequences\030\007 \001(\0132" + + "\026.weaviate.v1.TextArrayH\006\210\001\001\022+\n\006images\030\010" + + " \001(\0132\026.weaviate.v1.TextArrayH\007\210\001\001\0225\n\020ima" + + "ge_properties\030\t \001(\0132\026.weaviate.v1.TextAr" + + "rayH\010\210\001\001B\013\n\t_base_urlB\r\n\013_max_tokensB\010\n\006" + + "_modelB\016\n\014_temperatureB\010\n\006_top_kB\010\n\006_top" + + "_pB\021\n\017_stop_sequencesB\t\n\007_imagesB\023\n\021_ima" + + "ge_properties\"\200\001\n\022GenerativeAnyscale\022\025\n\010" + + "base_url\030\001 \001(\tH\000\210\001\001\022\022\n\005model\030\002 \001(\tH\001\210\001\001\022" + + "\030\n\013temperature\030\003 \001(\001H\002\210\001\001B\013\n\t_base_urlB\010" + + "\n\006_modelB\016\n\014_temperature\"\215\004\n\rGenerativeA" + + "WS\022\022\n\005model\030\003 \001(\tH\000\210\001\001\022\030\n\013temperature\030\010 " + + "\001(\001H\001\210\001\001\022\024\n\007service\030\t \001(\tH\002\210\001\001\022\023\n\006region" + + "\030\n \001(\tH\003\210\001\001\022\025\n\010endpoint\030\013 \001(\tH\004\210\001\001\022\031\n\014ta" + + "rget_model\030\014 \001(\tH\005\210\001\001\022\033\n\016target_variant\030" + + "\r \001(\tH\006\210\001\001\022+\n\006images\030\016 \001(\0132\026.weaviate.v1" + + ".TextArrayH\007\210\001\001\0225\n\020image_properties\030\017 \001(" + + "\0132\026.weaviate.v1.TextArrayH\010\210\001\001\022\027\n\nmax_to" + + "kens\030\020 \001(\003H\t\210\001\001\0223\n\016stop_sequences\030\021 \001(\0132" + + "\026.weaviate.v1.TextArrayH\n\210\001\001B\010\n\006_modelB\016" + + "\n\014_temperatureB\n\n\010_serviceB\t\n\007_regionB\013\n" + + "\t_endpointB\017\n\r_target_modelB\021\n\017_target_v" + + "ariantB\t\n\007_imagesB\023\n\021_image_propertiesB\r" + + "\n\013_max_tokensB\021\n\017_stop_sequences\"\210\004\n\020Gen" + + "erativeCohere\022\025\n\010base_url\030\001 \001(\tH\000\210\001\001\022\036\n\021" + + "frequency_penalty\030\002 \001(\001H\001\210\001\001\022\027\n\nmax_toke" + + "ns\030\003 \001(\003H\002\210\001\001\022\022\n\005model\030\004 \001(\tH\003\210\001\001\022\016\n\001k\030\005" + + " \001(\003H\004\210\001\001\022\016\n\001p\030\006 \001(\001H\005\210\001\001\022\035\n\020presence_pe" + + "nalty\030\007 \001(\001H\006\210\001\001\0223\n\016stop_sequences\030\010 \001(\013" + + "2\026.weaviate.v1.TextArrayH\007\210\001\001\022\030\n\013tempera" + + "ture\030\t \001(\001H\010\210\001\001\022+\n\006images\030\n \001(\0132\026.weavia" + + "te.v1.TextArrayH\t\210\001\001\0225\n\020image_properties" + + "\030\013 \001(\0132\026.weaviate.v1.TextArrayH\n\210\001\001B\013\n\t_" + + "base_urlB\024\n\022_frequency_penaltyB\r\n\013_max_t" + + "okensB\010\n\006_modelB\004\n\002_kB\004\n\002_pB\023\n\021_presence" + + "_penaltyB\021\n\017_stop_sequencesB\016\n\014_temperat" + + "ureB\t\n\007_imagesB\023\n\021_image_properties\"\021\n\017G" + + "enerativeDummy\"\305\001\n\021GenerativeMistral\022\025\n\010" + + "base_url\030\001 \001(\tH\000\210\001\001\022\027\n\nmax_tokens\030\002 \001(\003H" + + "\001\210\001\001\022\022\n\005model\030\003 \001(\tH\002\210\001\001\022\030\n\013temperature\030" + + "\004 \001(\001H\003\210\001\001\022\022\n\005top_p\030\005 \001(\001H\004\210\001\001B\013\n\t_base_" + + "urlB\r\n\013_max_tokensB\010\n\006_modelB\016\n\014_tempera" + + "tureB\010\n\006_top_p\"\212\002\n\020GenerativeOllama\022\031\n\014a" + + "pi_endpoint\030\001 \001(\tH\000\210\001\001\022\022\n\005model\030\002 \001(\tH\001\210" + + "\001\001\022\030\n\013temperature\030\003 \001(\001H\002\210\001\001\022+\n\006images\030\004" + + " \001(\0132\026.weaviate.v1.TextArrayH\003\210\001\001\0225\n\020ima" + + "ge_properties\030\005 \001(\0132\026.weaviate.v1.TextAr" + + "rayH\004\210\001\001B\017\n\r_api_endpointB\010\n\006_modelB\016\n\014_" + + "temperatureB\t\n\007_imagesB\023\n\021_image_propert" + + "ies\"\343\010\n\020GenerativeOpenAI\022\036\n\021frequency_pe" + + "nalty\030\001 \001(\001H\000\210\001\001\022\027\n\nmax_tokens\030\002 \001(\003H\001\210\001" + + "\001\022\022\n\005model\030\003 \001(\tH\002\210\001\001\022\016\n\001n\030\004 \001(\003H\003\210\001\001\022\035\n" + + "\020presence_penalty\030\005 \001(\001H\004\210\001\001\022)\n\004stop\030\006 \001" + + "(\0132\026.weaviate.v1.TextArrayH\005\210\001\001\022\030\n\013tempe" + + "rature\030\007 \001(\001H\006\210\001\001\022\022\n\005top_p\030\010 \001(\001H\007\210\001\001\022\025\n" + + "\010base_url\030\t \001(\tH\010\210\001\001\022\030\n\013api_version\030\n \001(" + + "\tH\t\210\001\001\022\032\n\rresource_name\030\013 \001(\tH\n\210\001\001\022\032\n\rde" + + "ployment_id\030\014 \001(\tH\013\210\001\001\022\025\n\010is_azure\030\r \001(\010" + + "H\014\210\001\001\022+\n\006images\030\016 \001(\0132\026.weaviate.v1.Text" + + "ArrayH\r\210\001\001\0225\n\020image_properties\030\017 \001(\0132\026.w" + + "eaviate.v1.TextArrayH\016\210\001\001\022L\n\020reasoning_e" + + "ffort\030\020 \001(\0162-.weaviate.v1.GenerativeOpen" + + "AI.ReasoningEffortH\017\210\001\001\022?\n\tverbosity\030\021 \001" + + "(\0162\'.weaviate.v1.GenerativeOpenAI.Verbos" + + "ityH\020\210\001\001\"\243\001\n\017ReasoningEffort\022 \n\034REASONIN" + + "G_EFFORT_UNSPECIFIED\020\000\022\034\n\030REASONING_EFFO" + + "RT_MINIMAL\020\001\022\030\n\024REASONING_EFFORT_LOW\020\002\022\033" + + "\n\027REASONING_EFFORT_MEDIUM\020\003\022\031\n\025REASONING" + + "_EFFORT_HIGH\020\004\"c\n\tVerbosity\022\031\n\025VERBOSITY" + + "_UNSPECIFIED\020\000\022\021\n\rVERBOSITY_LOW\020\001\022\024\n\020VER" + + "BOSITY_MEDIUM\020\002\022\022\n\016VERBOSITY_HIGH\020\003B\024\n\022_" + + "frequency_penaltyB\r\n\013_max_tokensB\010\n\006_mod" + + "elB\004\n\002_nB\023\n\021_presence_penaltyB\007\n\005_stopB\016" + + "\n\014_temperatureB\010\n\006_top_pB\013\n\t_base_urlB\016\n" + + "\014_api_versionB\020\n\016_resource_nameB\020\n\016_depl" + + "oyment_idB\013\n\t_is_azureB\t\n\007_imagesB\023\n\021_im" + + "age_propertiesB\023\n\021_reasoning_effortB\014\n\n_" + + "verbosity\"\222\005\n\020GenerativeGoogle\022\036\n\021freque" + + "ncy_penalty\030\001 \001(\001H\000\210\001\001\022\027\n\nmax_tokens\030\002 \001" + + "(\003H\001\210\001\001\022\022\n\005model\030\003 \001(\tH\002\210\001\001\022\035\n\020presence_" + + "penalty\030\004 \001(\001H\003\210\001\001\022\030\n\013temperature\030\005 \001(\001H" + + "\004\210\001\001\022\022\n\005top_k\030\006 \001(\003H\005\210\001\001\022\022\n\005top_p\030\007 \001(\001H" + + "\006\210\001\001\0223\n\016stop_sequences\030\010 \001(\0132\026.weaviate." + + "v1.TextArrayH\007\210\001\001\022\031\n\014api_endpoint\030\t \001(\tH" + + "\010\210\001\001\022\027\n\nproject_id\030\n \001(\tH\t\210\001\001\022\030\n\013endpoin" + + "t_id\030\013 \001(\tH\n\210\001\001\022\023\n\006region\030\014 \001(\tH\013\210\001\001\022+\n\006" + + "images\030\r \001(\0132\026.weaviate.v1.TextArrayH\014\210\001" + + "\001\0225\n\020image_properties\030\016 \001(\0132\026.weaviate.v" + + "1.TextArrayH\r\210\001\001B\024\n\022_frequency_penaltyB\r" + + "\n\013_max_tokensB\010\n\006_modelB\023\n\021_presence_pen" + + "altyB\016\n\014_temperatureB\010\n\006_top_kB\010\n\006_top_p" + + "B\021\n\017_stop_sequencesB\017\n\r_api_endpointB\r\n\013" + + "_project_idB\016\n\014_endpoint_idB\t\n\007_regionB\t" + + "\n\007_imagesB\023\n\021_image_properties\"\320\003\n\024Gener" + + "ativeDatabricks\022\025\n\010endpoint\030\001 \001(\tH\000\210\001\001\022\022" + + "\n\005model\030\002 \001(\tH\001\210\001\001\022\036\n\021frequency_penalty\030" + + "\003 \001(\001H\002\210\001\001\022\026\n\tlog_probs\030\004 \001(\010H\003\210\001\001\022\032\n\rto" + + "p_log_probs\030\005 \001(\003H\004\210\001\001\022\027\n\nmax_tokens\030\006 \001" + + "(\003H\005\210\001\001\022\016\n\001n\030\007 \001(\003H\006\210\001\001\022\035\n\020presence_pena" + + "lty\030\010 \001(\001H\007\210\001\001\022)\n\004stop\030\t \001(\0132\026.weaviate." + + "v1.TextArrayH\010\210\001\001\022\030\n\013temperature\030\n \001(\001H\t" + + "\210\001\001\022\022\n\005top_p\030\013 \001(\001H\n\210\001\001B\013\n\t_endpointB\010\n\006" + + "_modelB\024\n\022_frequency_penaltyB\014\n\n_log_pro" + + "bsB\020\n\016_top_log_probsB\r\n\013_max_tokensB\004\n\002_" + + "nB\023\n\021_presence_penaltyB\007\n\005_stopB\016\n\014_temp" + + "eratureB\010\n\006_top_p\"\336\001\n\024GenerativeFriendli" + + "AI\022\025\n\010base_url\030\001 \001(\tH\000\210\001\001\022\022\n\005model\030\002 \001(\t" + + "H\001\210\001\001\022\027\n\nmax_tokens\030\003 \001(\003H\002\210\001\001\022\030\n\013temper" + + "ature\030\004 \001(\001H\003\210\001\001\022\016\n\001n\030\005 \001(\003H\004\210\001\001\022\022\n\005top_" + + "p\030\006 \001(\001H\005\210\001\001B\013\n\t_base_urlB\010\n\006_modelB\r\n\013_" + + "max_tokensB\016\n\014_temperatureB\004\n\002_nB\010\n\006_top" + + "_p\"\304\001\n\020GenerativeNvidia\022\025\n\010base_url\030\001 \001(" + + "\tH\000\210\001\001\022\022\n\005model\030\002 \001(\tH\001\210\001\001\022\030\n\013temperatur" + + "e\030\003 \001(\001H\002\210\001\001\022\022\n\005top_p\030\004 \001(\001H\003\210\001\001\022\027\n\nmax_" + + "tokens\030\005 \001(\003H\004\210\001\001B\013\n\t_base_urlB\010\n\006_model" + + "B\016\n\014_temperatureB\010\n\006_top_pB\r\n\013_max_token" + + "s\"\305\002\n\rGenerativeXAI\022\025\n\010base_url\030\001 \001(\tH\000\210" + + "\001\001\022\022\n\005model\030\002 \001(\tH\001\210\001\001\022\030\n\013temperature\030\003 " + + "\001(\001H\002\210\001\001\022\022\n\005top_p\030\004 \001(\001H\003\210\001\001\022\027\n\nmax_toke" + + "ns\030\005 \001(\003H\004\210\001\001\022+\n\006images\030\006 \001(\0132\026.weaviate" + + ".v1.TextArrayH\005\210\001\001\0225\n\020image_properties\030\007" + + " \001(\0132\026.weaviate.v1.TextArrayH\006\210\001\001B\013\n\t_ba" + + "se_urlB\010\n\006_modelB\016\n\014_temperatureB\010\n\006_top" + + "_pB\r\n\013_max_tokensB\t\n\007_imagesB\023\n\021_image_p" + + "roperties\"\316\002\n\026GenerativeContextualAI\022\022\n\005" + + "model\030\001 \001(\tH\000\210\001\001\022\030\n\013temperature\030\002 \001(\001H\001\210" + + "\001\001\022\022\n\005top_p\030\003 \001(\001H\002\210\001\001\022\033\n\016max_new_tokens" + + "\030\004 \001(\003H\003\210\001\001\022\032\n\rsystem_prompt\030\005 \001(\tH\004\210\001\001\022" + + "\035\n\020avoid_commentary\030\006 \001(\010H\005\210\001\001\022.\n\tknowle" + + "dge\030\007 \001(\0132\026.weaviate.v1.TextArrayH\006\210\001\001B\010" + + "\n\006_modelB\016\n\014_temperatureB\010\n\006_top_pB\021\n\017_m" + + "ax_new_tokensB\020\n\016_system_promptB\023\n\021_avoi" + + "d_commentaryB\014\n\n_knowledge\"\222\001\n\033Generativ" + + "eAnthropicMetadata\022=\n\005usage\030\001 \001(\0132..weav" + + "iate.v1.GenerativeAnthropicMetadata.Usag" + + "e\0324\n\005Usage\022\024\n\014input_tokens\030\001 \001(\003\022\025\n\routp" + + "ut_tokens\030\002 \001(\003\"\034\n\032GenerativeAnyscaleMet" + + "adata\"\027\n\025GenerativeAWSMetadata\"\234\006\n\030Gener" + + "ativeCohereMetadata\022J\n\013api_version\030\001 \001(\013" + + "20.weaviate.v1.GenerativeCohereMetadata." + + "ApiVersionH\000\210\001\001\022L\n\014billed_units\030\002 \001(\01321." + + "weaviate.v1.GenerativeCohereMetadata.Bil" + + "ledUnitsH\001\210\001\001\022A\n\006tokens\030\003 \001(\0132,.weaviate" + + ".v1.GenerativeCohereMetadata.TokensH\002\210\001\001" + + "\022-\n\010warnings\030\004 \001(\0132\026.weaviate.v1.TextArr" + + "ayH\003\210\001\001\032\216\001\n\nApiVersion\022\024\n\007version\030\001 \001(\tH" + + "\000\210\001\001\022\032\n\ris_deprecated\030\002 \001(\010H\001\210\001\001\022\034\n\017is_e" + + "xperimental\030\003 \001(\010H\002\210\001\001B\n\n\010_versionB\020\n\016_i" + + "s_deprecatedB\022\n\020_is_experimental\032\305\001\n\013Bil" + + "ledUnits\022\031\n\014input_tokens\030\001 \001(\001H\000\210\001\001\022\032\n\ro" + + "utput_tokens\030\002 \001(\001H\001\210\001\001\022\031\n\014search_units\030" + + "\003 \001(\001H\002\210\001\001\022\034\n\017classifications\030\004 \001(\001H\003\210\001\001" + + "B\017\n\r_input_tokensB\020\n\016_output_tokensB\017\n\r_" + + "search_unitsB\022\n\020_classifications\032b\n\006Toke" + + "ns\022\031\n\014input_tokens\030\001 \001(\001H\000\210\001\001\022\032\n\routput_" + + "tokens\030\002 \001(\001H\001\210\001\001B\017\n\r_input_tokensB\020\n\016_o" + + "utput_tokensB\016\n\014_api_versionB\017\n\r_billed_" + + "unitsB\t\n\007_tokensB\013\n\t_warnings\"\031\n\027Generat" + + "iveDummyMetadata\"\201\002\n\031GenerativeMistralMe" + + "tadata\022@\n\005usage\030\001 \001(\0132,.weaviate.v1.Gene" + + "rativeMistralMetadata.UsageH\000\210\001\001\032\227\001\n\005Usa" + + "ge\022\032\n\rprompt_tokens\030\001 \001(\003H\000\210\001\001\022\036\n\021comple" + + "tion_tokens\030\002 \001(\003H\001\210\001\001\022\031\n\014total_tokens\030\003" + + " \001(\003H\002\210\001\001B\020\n\016_prompt_tokensB\024\n\022_completi" + + "on_tokensB\017\n\r_total_tokensB\010\n\006_usage\"\032\n\030" + + "GenerativeOllamaMetadata\"\377\001\n\030GenerativeO" + + "penAIMetadata\022?\n\005usage\030\001 \001(\0132+.weaviate." + + "v1.GenerativeOpenAIMetadata.UsageH\000\210\001\001\032\227" + "\001\n\005Usage\022\032\n\rprompt_tokens\030\001 \001(\003H\000\210\001\001\022\036\n\021" + "completion_tokens\030\002 \001(\003H\001\210\001\001\022\031\n\014total_to" + "kens\030\003 \001(\003H\002\210\001\001B\020\n\016_prompt_tokensB\024\n\022_co" + "mpletion_tokensB\017\n\r_total_tokensB\010\n\006_usa" + - "ge\"\377\001\n\030GenerativeNvidiaMetadata\022?\n\005usage" + - "\030\001 \001(\0132+.weaviate.v1.GenerativeNvidiaMet" + - "adata.UsageH\000\210\001\001\032\227\001\n\005Usage\022\032\n\rprompt_tok" + - "ens\030\001 \001(\003H\000\210\001\001\022\036\n\021completion_tokens\030\002 \001(" + - "\003H\001\210\001\001\022\031\n\014total_tokens\030\003 \001(\003H\002\210\001\001B\020\n\016_pr" + - "ompt_tokensB\024\n\022_completion_tokensB\017\n\r_to" + - "tal_tokensB\010\n\006_usage\"\371\001\n\025GenerativeXAIMe" + - "tadata\022<\n\005usage\030\001 \001(\0132(.weaviate.v1.Gene" + - "rativeXAIMetadata.UsageH\000\210\001\001\032\227\001\n\005Usage\022\032" + - "\n\rprompt_tokens\030\001 \001(\003H\000\210\001\001\022\036\n\021completion" + - "_tokens\030\002 \001(\003H\001\210\001\001\022\031\n\014total_tokens\030\003 \001(\003" + - "H\002\210\001\001B\020\n\016_prompt_tokensB\024\n\022_completion_t" + - "okensB\017\n\r_total_tokensB\010\n\006_usage\"\217\006\n\022Gen" + - "erativeMetadata\022=\n\tanthropic\030\001 \001(\0132(.wea" + - "viate.v1.GenerativeAnthropicMetadataH\000\022;" + - "\n\010anyscale\030\002 \001(\0132\'.weaviate.v1.Generativ" + - "eAnyscaleMetadataH\000\0221\n\003aws\030\003 \001(\0132\".weavi" + - "ate.v1.GenerativeAWSMetadataH\000\0227\n\006cohere" + - "\030\004 \001(\0132%.weaviate.v1.GenerativeCohereMet" + - "adataH\000\0225\n\005dummy\030\005 \001(\0132$.weaviate.v1.Gen" + - "erativeDummyMetadataH\000\0229\n\007mistral\030\006 \001(\0132" + - "&.weaviate.v1.GenerativeMistralMetadataH" + - "\000\0227\n\006ollama\030\007 \001(\0132%.weaviate.v1.Generati" + - "veOllamaMetadataH\000\0227\n\006openai\030\010 \001(\0132%.wea" + - "viate.v1.GenerativeOpenAIMetadataH\000\0227\n\006g" + - "oogle\030\t \001(\0132%.weaviate.v1.GenerativeGoog" + - "leMetadataH\000\022?\n\ndatabricks\030\n \001(\0132).weavi" + - "ate.v1.GenerativeDatabricksMetadataH\000\022?\n" + - "\nfriendliai\030\013 \001(\0132).weaviate.v1.Generati" + - "veFriendliAIMetadataH\000\0227\n\006nvidia\030\014 \001(\0132%" + - ".weaviate.v1.GenerativeNvidiaMetadataH\000\022" + - "1\n\003xai\030\r \001(\0132\".weaviate.v1.GenerativeXAI" + - "MetadataH\000B\006\n\004kind\"\242\001\n\017GenerativeReply\022\016" + - "\n\006result\030\001 \001(\t\0220\n\005debug\030\002 \001(\0132\034.weaviate" + - ".v1.GenerativeDebugH\000\210\001\001\0226\n\010metadata\030\003 \001" + - "(\0132\037.weaviate.v1.GenerativeMetadataH\001\210\001\001" + - "B\010\n\006_debugB\013\n\t_metadata\"@\n\020GenerativeRes" + - "ult\022,\n\006values\030\001 \003(\0132\034.weaviate.v1.Genera" + - "tiveReply\";\n\017GenerativeDebug\022\030\n\013full_pro" + - "mpt\030\001 \001(\tH\000\210\001\001B\016\n\014_full_promptBH\n-io.wea" + - "viate.client6.v1.internal.grpc.protocolB" + - "\027WeaviateProtoGenerativeb\006proto3" + "ge\"\350\006\n\030GenerativeGoogleMetadata\022E\n\010metad" + + "ata\030\001 \001(\0132..weaviate.v1.GenerativeGoogle" + + "Metadata.MetadataH\000\210\001\001\022P\n\016usage_metadata" + + "\030\002 \001(\01323.weaviate.v1.GenerativeGoogleMet" + + "adata.UsageMetadataH\001\210\001\001\032~\n\nTokenCount\022&" + + "\n\031total_billable_characters\030\001 \001(\003H\000\210\001\001\022\031" + + "\n\014total_tokens\030\002 \001(\003H\001\210\001\001B\034\n\032_total_bill" + + "able_charactersB\017\n\r_total_tokens\032\341\001\n\rTok" + + "enMetadata\022P\n\021input_token_count\030\001 \001(\01320." + + "weaviate.v1.GenerativeGoogleMetadata.Tok" + + "enCountH\000\210\001\001\022Q\n\022output_token_count\030\002 \001(\013" + + "20.weaviate.v1.GenerativeGoogleMetadata." + + "TokenCountH\001\210\001\001B\024\n\022_input_token_countB\025\n" + + "\023_output_token_count\032o\n\010Metadata\022P\n\016toke" + + "n_metadata\030\001 \001(\01323.weaviate.v1.Generativ" + + "eGoogleMetadata.TokenMetadataH\000\210\001\001B\021\n\017_t" + + "oken_metadata\032\275\001\n\rUsageMetadata\022\037\n\022promp" + + "t_token_count\030\001 \001(\003H\000\210\001\001\022#\n\026candidates_t" + + "oken_count\030\002 \001(\003H\001\210\001\001\022\036\n\021total_token_cou" + + "nt\030\003 \001(\003H\002\210\001\001B\025\n\023_prompt_token_countB\031\n\027" + + "_candidates_token_countB\024\n\022_total_token_" + + "countB\013\n\t_metadataB\021\n\017_usage_metadata\"\207\002" + + "\n\034GenerativeDatabricksMetadata\022C\n\005usage\030" + + "\001 \001(\0132/.weaviate.v1.GenerativeDatabricks" + + "Metadata.UsageH\000\210\001\001\032\227\001\n\005Usage\022\032\n\rprompt_" + + "tokens\030\001 \001(\003H\000\210\001\001\022\036\n\021completion_tokens\030\002" + + " \001(\003H\001\210\001\001\022\031\n\014total_tokens\030\003 \001(\003H\002\210\001\001B\020\n\016" + + "_prompt_tokensB\024\n\022_completion_tokensB\017\n\r" + + "_total_tokensB\010\n\006_usage\"\207\002\n\034GenerativeFr" + + "iendliAIMetadata\022C\n\005usage\030\001 \001(\0132/.weavia" + + "te.v1.GenerativeFriendliAIMetadata.Usage" + + "H\000\210\001\001\032\227\001\n\005Usage\022\032\n\rprompt_tokens\030\001 \001(\003H\000" + + "\210\001\001\022\036\n\021completion_tokens\030\002 \001(\003H\001\210\001\001\022\031\n\014t" + + "otal_tokens\030\003 \001(\003H\002\210\001\001B\020\n\016_prompt_tokens" + + "B\024\n\022_completion_tokensB\017\n\r_total_tokensB" + + "\010\n\006_usage\"\377\001\n\030GenerativeNvidiaMetadata\022?" + + "\n\005usage\030\001 \001(\0132+.weaviate.v1.GenerativeNv" + + "idiaMetadata.UsageH\000\210\001\001\032\227\001\n\005Usage\022\032\n\rpro" + + "mpt_tokens\030\001 \001(\003H\000\210\001\001\022\036\n\021completion_toke" + + "ns\030\002 \001(\003H\001\210\001\001\022\031\n\014total_tokens\030\003 \001(\003H\002\210\001\001" + + "B\020\n\016_prompt_tokensB\024\n\022_completion_tokens" + + "B\017\n\r_total_tokensB\010\n\006_usage\"\371\001\n\025Generati" + + "veXAIMetadata\022<\n\005usage\030\001 \001(\0132(.weaviate." + + "v1.GenerativeXAIMetadata.UsageH\000\210\001\001\032\227\001\n\005" + + "Usage\022\032\n\rprompt_tokens\030\001 \001(\003H\000\210\001\001\022\036\n\021com" + + "pletion_tokens\030\002 \001(\003H\001\210\001\001\022\031\n\014total_token" + + "s\030\003 \001(\003H\002\210\001\001B\020\n\016_prompt_tokensB\024\n\022_compl" + + "etion_tokensB\017\n\r_total_tokensB\010\n\006_usage\"" + + "\217\006\n\022GenerativeMetadata\022=\n\tanthropic\030\001 \001(" + + "\0132(.weaviate.v1.GenerativeAnthropicMetad" + + "ataH\000\022;\n\010anyscale\030\002 \001(\0132\'.weaviate.v1.Ge" + + "nerativeAnyscaleMetadataH\000\0221\n\003aws\030\003 \001(\0132" + + "\".weaviate.v1.GenerativeAWSMetadataH\000\0227\n" + + "\006cohere\030\004 \001(\0132%.weaviate.v1.GenerativeCo" + + "hereMetadataH\000\0225\n\005dummy\030\005 \001(\0132$.weaviate" + + ".v1.GenerativeDummyMetadataH\000\0229\n\007mistral" + + "\030\006 \001(\0132&.weaviate.v1.GenerativeMistralMe" + + "tadataH\000\0227\n\006ollama\030\007 \001(\0132%.weaviate.v1.G" + + "enerativeOllamaMetadataH\000\0227\n\006openai\030\010 \001(" + + "\0132%.weaviate.v1.GenerativeOpenAIMetadata" + + "H\000\0227\n\006google\030\t \001(\0132%.weaviate.v1.Generat" + + "iveGoogleMetadataH\000\022?\n\ndatabricks\030\n \001(\0132" + + ").weaviate.v1.GenerativeDatabricksMetada" + + "taH\000\022?\n\nfriendliai\030\013 \001(\0132).weaviate.v1.G" + + "enerativeFriendliAIMetadataH\000\0227\n\006nvidia\030" + + "\014 \001(\0132%.weaviate.v1.GenerativeNvidiaMeta" + + "dataH\000\0221\n\003xai\030\r \001(\0132\".weaviate.v1.Genera" + + "tiveXAIMetadataH\000B\006\n\004kind\"\242\001\n\017Generative" + + "Reply\022\016\n\006result\030\001 \001(\t\0220\n\005debug\030\002 \001(\0132\034.w" + + "eaviate.v1.GenerativeDebugH\000\210\001\001\0226\n\010metad" + + "ata\030\003 \001(\0132\037.weaviate.v1.GenerativeMetada" + + "taH\001\210\001\001B\010\n\006_debugB\013\n\t_metadata\"@\n\020Genera" + + "tiveResult\022,\n\006values\030\001 \003(\0132\034.weaviate.v1" + + ".GenerativeReply\";\n\017GenerativeDebug\022\030\n\013f" + + "ull_prompt\030\001 \001(\tH\000\210\001\001B\016\n\014_full_promptBH\n" + + "-io.weaviate.client6.v1.internal.grpc.pr" + + "otocolB\027WeaviateProtoGenerativeb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -50530,7 +53368,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.Gen internal_static_weaviate_v1_GenerativeProvider_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeProvider_descriptor, - new java.lang.String[] { "ReturnMetadata", "Anthropic", "Anyscale", "Aws", "Cohere", "Dummy", "Mistral", "Ollama", "Openai", "Google", "Databricks", "Friendliai", "Nvidia", "Xai", "Kind", }); + new java.lang.String[] { "ReturnMetadata", "Anthropic", "Anyscale", "Aws", "Cohere", "Dummy", "Mistral", "Ollama", "Openai", "Google", "Databricks", "Friendliai", "Nvidia", "Xai", "Contextualai", "Kind", }); internal_static_weaviate_v1_GenerativeAnthropic_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_weaviate_v1_GenerativeAnthropic_fieldAccessorTable = new @@ -50548,13 +53386,13 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.Gen internal_static_weaviate_v1_GenerativeAWS_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeAWS_descriptor, - new java.lang.String[] { "Model", "Temperature", "Service", "Region", "Endpoint", "TargetModel", "TargetVariant", "Images", "ImageProperties", "Model", "Temperature", "Service", "Region", "Endpoint", "TargetModel", "TargetVariant", "Images", "ImageProperties", }); + new java.lang.String[] { "Model", "Temperature", "Service", "Region", "Endpoint", "TargetModel", "TargetVariant", "Images", "ImageProperties", "MaxTokens", "StopSequences", "Model", "Temperature", "Service", "Region", "Endpoint", "TargetModel", "TargetVariant", "Images", "ImageProperties", "MaxTokens", "StopSequences", }); internal_static_weaviate_v1_GenerativeCohere_descriptor = getDescriptor().getMessageTypes().get(5); internal_static_weaviate_v1_GenerativeCohere_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeCohere_descriptor, - new java.lang.String[] { "BaseUrl", "FrequencyPenalty", "MaxTokens", "Model", "K", "P", "PresencePenalty", "StopSequences", "Temperature", "BaseUrl", "FrequencyPenalty", "MaxTokens", "Model", "K", "P", "PresencePenalty", "StopSequences", "Temperature", }); + new java.lang.String[] { "BaseUrl", "FrequencyPenalty", "MaxTokens", "Model", "K", "P", "PresencePenalty", "StopSequences", "Temperature", "Images", "ImageProperties", "BaseUrl", "FrequencyPenalty", "MaxTokens", "Model", "K", "P", "PresencePenalty", "StopSequences", "Temperature", "Images", "ImageProperties", }); internal_static_weaviate_v1_GenerativeDummy_descriptor = getDescriptor().getMessageTypes().get(6); internal_static_weaviate_v1_GenerativeDummy_fieldAccessorTable = new @@ -50578,7 +53416,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.Gen internal_static_weaviate_v1_GenerativeOpenAI_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeOpenAI_descriptor, - new java.lang.String[] { "FrequencyPenalty", "MaxTokens", "Model", "N", "PresencePenalty", "Stop", "Temperature", "TopP", "BaseUrl", "ApiVersion", "ResourceName", "DeploymentId", "IsAzure", "Images", "ImageProperties", "FrequencyPenalty", "MaxTokens", "Model", "N", "PresencePenalty", "Stop", "Temperature", "TopP", "BaseUrl", "ApiVersion", "ResourceName", "DeploymentId", "IsAzure", "Images", "ImageProperties", }); + new java.lang.String[] { "FrequencyPenalty", "MaxTokens", "Model", "N", "PresencePenalty", "Stop", "Temperature", "TopP", "BaseUrl", "ApiVersion", "ResourceName", "DeploymentId", "IsAzure", "Images", "ImageProperties", "ReasoningEffort", "Verbosity", "FrequencyPenalty", "MaxTokens", "Model", "N", "PresencePenalty", "Stop", "Temperature", "TopP", "BaseUrl", "ApiVersion", "ResourceName", "DeploymentId", "IsAzure", "Images", "ImageProperties", "ReasoningEffort", "Verbosity", }); internal_static_weaviate_v1_GenerativeGoogle_descriptor = getDescriptor().getMessageTypes().get(10); internal_static_weaviate_v1_GenerativeGoogle_fieldAccessorTable = new @@ -50609,8 +53447,14 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.Gen com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeXAI_descriptor, new java.lang.String[] { "BaseUrl", "Model", "Temperature", "TopP", "MaxTokens", "Images", "ImageProperties", "BaseUrl", "Model", "Temperature", "TopP", "MaxTokens", "Images", "ImageProperties", }); - internal_static_weaviate_v1_GenerativeAnthropicMetadata_descriptor = + internal_static_weaviate_v1_GenerativeContextualAI_descriptor = getDescriptor().getMessageTypes().get(15); + internal_static_weaviate_v1_GenerativeContextualAI_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_weaviate_v1_GenerativeContextualAI_descriptor, + new java.lang.String[] { "Model", "Temperature", "TopP", "MaxNewTokens", "SystemPrompt", "AvoidCommentary", "Knowledge", "Model", "Temperature", "TopP", "MaxNewTokens", "SystemPrompt", "AvoidCommentary", "Knowledge", }); + internal_static_weaviate_v1_GenerativeAnthropicMetadata_descriptor = + getDescriptor().getMessageTypes().get(16); internal_static_weaviate_v1_GenerativeAnthropicMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeAnthropicMetadata_descriptor, @@ -50622,19 +53466,19 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.Gen internal_static_weaviate_v1_GenerativeAnthropicMetadata_Usage_descriptor, new java.lang.String[] { "InputTokens", "OutputTokens", }); internal_static_weaviate_v1_GenerativeAnyscaleMetadata_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(17); internal_static_weaviate_v1_GenerativeAnyscaleMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeAnyscaleMetadata_descriptor, new java.lang.String[] { }); internal_static_weaviate_v1_GenerativeAWSMetadata_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(18); internal_static_weaviate_v1_GenerativeAWSMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeAWSMetadata_descriptor, new java.lang.String[] { }); internal_static_weaviate_v1_GenerativeCohereMetadata_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(19); internal_static_weaviate_v1_GenerativeCohereMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeCohereMetadata_descriptor, @@ -50658,13 +53502,13 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.Gen internal_static_weaviate_v1_GenerativeCohereMetadata_Tokens_descriptor, new java.lang.String[] { "InputTokens", "OutputTokens", "InputTokens", "OutputTokens", }); internal_static_weaviate_v1_GenerativeDummyMetadata_descriptor = - getDescriptor().getMessageTypes().get(19); + getDescriptor().getMessageTypes().get(20); internal_static_weaviate_v1_GenerativeDummyMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeDummyMetadata_descriptor, new java.lang.String[] { }); internal_static_weaviate_v1_GenerativeMistralMetadata_descriptor = - getDescriptor().getMessageTypes().get(20); + getDescriptor().getMessageTypes().get(21); internal_static_weaviate_v1_GenerativeMistralMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeMistralMetadata_descriptor, @@ -50676,13 +53520,13 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.Gen internal_static_weaviate_v1_GenerativeMistralMetadata_Usage_descriptor, new java.lang.String[] { "PromptTokens", "CompletionTokens", "TotalTokens", "PromptTokens", "CompletionTokens", "TotalTokens", }); internal_static_weaviate_v1_GenerativeOllamaMetadata_descriptor = - getDescriptor().getMessageTypes().get(21); + getDescriptor().getMessageTypes().get(22); internal_static_weaviate_v1_GenerativeOllamaMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeOllamaMetadata_descriptor, new java.lang.String[] { }); internal_static_weaviate_v1_GenerativeOpenAIMetadata_descriptor = - getDescriptor().getMessageTypes().get(22); + getDescriptor().getMessageTypes().get(23); internal_static_weaviate_v1_GenerativeOpenAIMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeOpenAIMetadata_descriptor, @@ -50694,7 +53538,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.Gen internal_static_weaviate_v1_GenerativeOpenAIMetadata_Usage_descriptor, new java.lang.String[] { "PromptTokens", "CompletionTokens", "TotalTokens", "PromptTokens", "CompletionTokens", "TotalTokens", }); internal_static_weaviate_v1_GenerativeGoogleMetadata_descriptor = - getDescriptor().getMessageTypes().get(23); + getDescriptor().getMessageTypes().get(24); internal_static_weaviate_v1_GenerativeGoogleMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeGoogleMetadata_descriptor, @@ -50724,7 +53568,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.Gen internal_static_weaviate_v1_GenerativeGoogleMetadata_UsageMetadata_descriptor, new java.lang.String[] { "PromptTokenCount", "CandidatesTokenCount", "TotalTokenCount", "PromptTokenCount", "CandidatesTokenCount", "TotalTokenCount", }); internal_static_weaviate_v1_GenerativeDatabricksMetadata_descriptor = - getDescriptor().getMessageTypes().get(24); + getDescriptor().getMessageTypes().get(25); internal_static_weaviate_v1_GenerativeDatabricksMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeDatabricksMetadata_descriptor, @@ -50736,7 +53580,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.Gen internal_static_weaviate_v1_GenerativeDatabricksMetadata_Usage_descriptor, new java.lang.String[] { "PromptTokens", "CompletionTokens", "TotalTokens", "PromptTokens", "CompletionTokens", "TotalTokens", }); internal_static_weaviate_v1_GenerativeFriendliAIMetadata_descriptor = - getDescriptor().getMessageTypes().get(25); + getDescriptor().getMessageTypes().get(26); internal_static_weaviate_v1_GenerativeFriendliAIMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeFriendliAIMetadata_descriptor, @@ -50748,7 +53592,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.Gen internal_static_weaviate_v1_GenerativeFriendliAIMetadata_Usage_descriptor, new java.lang.String[] { "PromptTokens", "CompletionTokens", "TotalTokens", "PromptTokens", "CompletionTokens", "TotalTokens", }); internal_static_weaviate_v1_GenerativeNvidiaMetadata_descriptor = - getDescriptor().getMessageTypes().get(26); + getDescriptor().getMessageTypes().get(27); internal_static_weaviate_v1_GenerativeNvidiaMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeNvidiaMetadata_descriptor, @@ -50760,7 +53604,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.Gen internal_static_weaviate_v1_GenerativeNvidiaMetadata_Usage_descriptor, new java.lang.String[] { "PromptTokens", "CompletionTokens", "TotalTokens", "PromptTokens", "CompletionTokens", "TotalTokens", }); internal_static_weaviate_v1_GenerativeXAIMetadata_descriptor = - getDescriptor().getMessageTypes().get(27); + getDescriptor().getMessageTypes().get(28); internal_static_weaviate_v1_GenerativeXAIMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeXAIMetadata_descriptor, @@ -50772,25 +53616,25 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.Gen internal_static_weaviate_v1_GenerativeXAIMetadata_Usage_descriptor, new java.lang.String[] { "PromptTokens", "CompletionTokens", "TotalTokens", "PromptTokens", "CompletionTokens", "TotalTokens", }); internal_static_weaviate_v1_GenerativeMetadata_descriptor = - getDescriptor().getMessageTypes().get(28); + getDescriptor().getMessageTypes().get(29); internal_static_weaviate_v1_GenerativeMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeMetadata_descriptor, new java.lang.String[] { "Anthropic", "Anyscale", "Aws", "Cohere", "Dummy", "Mistral", "Ollama", "Openai", "Google", "Databricks", "Friendliai", "Nvidia", "Xai", "Kind", }); internal_static_weaviate_v1_GenerativeReply_descriptor = - getDescriptor().getMessageTypes().get(29); + getDescriptor().getMessageTypes().get(30); internal_static_weaviate_v1_GenerativeReply_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeReply_descriptor, new java.lang.String[] { "Result", "Debug", "Metadata", "Debug", "Metadata", }); internal_static_weaviate_v1_GenerativeResult_descriptor = - getDescriptor().getMessageTypes().get(30); + getDescriptor().getMessageTypes().get(31); internal_static_weaviate_v1_GenerativeResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeResult_descriptor, new java.lang.String[] { "Values", }); internal_static_weaviate_v1_GenerativeDebug_descriptor = - getDescriptor().getMessageTypes().get(31); + getDescriptor().getMessageTypes().get(32); internal_static_weaviate_v1_GenerativeDebug_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GenerativeDebug_descriptor, diff --git a/src/main/java/io/weaviate/client6/v1/internal/grpc/protocol/WeaviateProtoSearchGet.java b/src/main/java/io/weaviate/client6/v1/internal/grpc/protocol/WeaviateProtoSearchGet.java index 326ede844..17ee86c45 100644 --- a/src/main/java/io/weaviate/client6/v1/internal/grpc/protocol/WeaviateProtoSearchGet.java +++ b/src/main/java/io/weaviate/client6/v1/internal/grpc/protocol/WeaviateProtoSearchGet.java @@ -7314,6 +7314,17 @@ public interface MetadataRequestOrBuilder extends */ com.google.protobuf.ByteString getVectorsBytes(int index); + + /** + *
+     * query_profile enables per-shard query profiling. When true, the response includes
+     * timing breakdowns for each shard and search type.
+     * 
+ * + * bool query_profile = 11; + * @return The queryProfile. + */ + boolean getQueryProfile(); } /** * Protobuf type {@code weaviate.v1.MetadataRequest} @@ -7488,6 +7499,22 @@ public java.lang.String getVectors(int index) { return vectors_.getByteString(index); } + public static final int QUERY_PROFILE_FIELD_NUMBER = 11; + private boolean queryProfile_ = false; + /** + *
+     * query_profile enables per-shard query profiling. When true, the response includes
+     * timing breakdowns for each shard and search type.
+     * 
+ * + * bool query_profile = 11; + * @return The queryProfile. + */ + @java.lang.Override + public boolean getQueryProfile() { + return queryProfile_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -7532,6 +7559,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) for (int i = 0; i < vectors_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 10, vectors_.getRaw(i)); } + if (queryProfile_ != false) { + output.writeBool(11, queryProfile_); + } getUnknownFields().writeTo(output); } @@ -7585,6 +7615,10 @@ public int getSerializedSize() { size += dataSize; size += 1 * getVectorsList().size(); } + if (queryProfile_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(11, queryProfile_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -7620,6 +7654,8 @@ public boolean equals(final java.lang.Object obj) { != other.getIsConsistent()) return false; if (!getVectorsList() .equals(other.getVectorsList())) return false; + if (getQueryProfile() + != other.getQueryProfile()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -7662,6 +7698,9 @@ public int hashCode() { hash = (37 * hash) + VECTORS_FIELD_NUMBER; hash = (53 * hash) + getVectorsList().hashCode(); } + hash = (37 * hash) + QUERY_PROFILE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getQueryProfile()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -7804,6 +7843,7 @@ public Builder clear() { isConsistent_ = false; vectors_ = com.google.protobuf.LazyStringArrayList.emptyList(); + queryProfile_ = false; return this; } @@ -7868,6 +7908,9 @@ private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.Weaviat vectors_.makeImmutable(); result.vectors_ = vectors_; } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.queryProfile_ = queryProfile_; + } } @java.lang.Override @@ -7951,6 +7994,9 @@ public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateP } onChanged(); } + if (other.getQueryProfile() != false) { + setQueryProfile(other.getQueryProfile()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -8028,6 +8074,11 @@ public Builder mergeFrom( vectors_.add(s); break; } // case 82 + case 88: { + queryProfile_ = input.readBool(); + bitField0_ |= 0x00000400; + break; + } // case 88 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -8443,6 +8494,53 @@ public Builder addVectorsBytes( onChanged(); return this; } + + private boolean queryProfile_ ; + /** + *
+       * query_profile enables per-shard query profiling. When true, the response includes
+       * timing breakdowns for each shard and search type.
+       * 
+ * + * bool query_profile = 11; + * @return The queryProfile. + */ + @java.lang.Override + public boolean getQueryProfile() { + return queryProfile_; + } + /** + *
+       * query_profile enables per-shard query profiling. When true, the response includes
+       * timing breakdowns for each shard and search type.
+       * 
+ * + * bool query_profile = 11; + * @param value The queryProfile to set. + * @return This builder for chaining. + */ + public Builder setQueryProfile(boolean value) { + + queryProfile_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
+       * query_profile enables per-shard query profiling. When true, the response includes
+       * timing breakdowns for each shard and search type.
+       * 
+ * + * bool query_profile = 11; + * @return This builder for chaining. + */ + public Builder clearQueryProfile() { + bitField0_ = (bitField0_ & ~0x00000400); + queryProfile_ = false; + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -12968,21 +13066,21 @@ io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.SearchResul /** * optional string generative_grouped_result = 3 [deprecated = true]; * @deprecated weaviate.v1.SearchReply.generative_grouped_result is deprecated. - * See v1/search_get.proto;l=114 + * See v1/search_get.proto;l=117 * @return Whether the generativeGroupedResult field is set. */ @java.lang.Deprecated boolean hasGenerativeGroupedResult(); /** * optional string generative_grouped_result = 3 [deprecated = true]; * @deprecated weaviate.v1.SearchReply.generative_grouped_result is deprecated. - * See v1/search_get.proto;l=114 + * See v1/search_get.proto;l=117 * @return The generativeGroupedResult. */ @java.lang.Deprecated java.lang.String getGenerativeGroupedResult(); /** * optional string generative_grouped_result = 3 [deprecated = true]; * @deprecated weaviate.v1.SearchReply.generative_grouped_result is deprecated. - * See v1/search_get.proto;l=114 + * See v1/search_get.proto;l=117 * @return The bytes for generativeGroupedResult. */ @java.lang.Deprecated com.google.protobuf.ByteString @@ -13026,6 +13124,21 @@ io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResu * optional .weaviate.v1.GenerativeResult generative_grouped_results = 5; */ io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResultOrBuilder getGenerativeGroupedResultsOrBuilder(); + + /** + * optional .weaviate.v1.QueryProfile query_profile = 6; + * @return Whether the queryProfile field is set. + */ + boolean hasQueryProfile(); + /** + * optional .weaviate.v1.QueryProfile query_profile = 6; + * @return The queryProfile. + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile getQueryProfile(); + /** + * optional .weaviate.v1.QueryProfile query_profile = 6; + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfileOrBuilder getQueryProfileOrBuilder(); } /** * Protobuf type {@code weaviate.v1.SearchReply} @@ -13124,7 +13237,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.Sear /** * optional string generative_grouped_result = 3 [deprecated = true]; * @deprecated weaviate.v1.SearchReply.generative_grouped_result is deprecated. - * See v1/search_get.proto;l=114 + * See v1/search_get.proto;l=117 * @return Whether the generativeGroupedResult field is set. */ @java.lang.Override @@ -13134,7 +13247,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.Sear /** * optional string generative_grouped_result = 3 [deprecated = true]; * @deprecated weaviate.v1.SearchReply.generative_grouped_result is deprecated. - * See v1/search_get.proto;l=114 + * See v1/search_get.proto;l=117 * @return The generativeGroupedResult. */ @java.lang.Override @@ -13153,7 +13266,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.Sear /** * optional string generative_grouped_result = 3 [deprecated = true]; * @deprecated weaviate.v1.SearchReply.generative_grouped_result is deprecated. - * See v1/search_get.proto;l=114 + * See v1/search_get.proto;l=117 * @return The bytes for generativeGroupedResult. */ @java.lang.Override @@ -13238,6 +13351,32 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.Gen return generativeGroupedResults_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult.getDefaultInstance() : generativeGroupedResults_; } + public static final int QUERY_PROFILE_FIELD_NUMBER = 6; + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile queryProfile_; + /** + * optional .weaviate.v1.QueryProfile query_profile = 6; + * @return Whether the queryProfile field is set. + */ + @java.lang.Override + public boolean hasQueryProfile() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional .weaviate.v1.QueryProfile query_profile = 6; + * @return The queryProfile. + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile getQueryProfile() { + return queryProfile_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.getDefaultInstance() : queryProfile_; + } + /** + * optional .weaviate.v1.QueryProfile query_profile = 6; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfileOrBuilder getQueryProfileOrBuilder() { + return queryProfile_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.getDefaultInstance() : queryProfile_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -13267,6 +13406,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(5, getGenerativeGroupedResults()); } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(6, getQueryProfile()); + } getUnknownFields().writeTo(output); } @@ -13295,6 +13437,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, getGenerativeGroupedResults()); } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getQueryProfile()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -13327,6 +13473,11 @@ public boolean equals(final java.lang.Object obj) { if (!getGenerativeGroupedResults() .equals(other.getGenerativeGroupedResults())) return false; } + if (hasQueryProfile() != other.hasQueryProfile()) return false; + if (hasQueryProfile()) { + if (!getQueryProfile() + .equals(other.getQueryProfile())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -13357,6 +13508,10 @@ public int hashCode() { hash = (37 * hash) + GENERATIVE_GROUPED_RESULTS_FIELD_NUMBER; hash = (53 * hash) + getGenerativeGroupedResults().hashCode(); } + if (hasQueryProfile()) { + hash = (37 * hash) + QUERY_PROFILE_FIELD_NUMBER; + hash = (53 * hash) + getQueryProfile().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -13490,6 +13645,7 @@ private void maybeForceBuilderInitialization() { getResultsFieldBuilder(); getGroupByResultsFieldBuilder(); getGenerativeGroupedResultsFieldBuilder(); + getQueryProfileFieldBuilder(); } } @java.lang.Override @@ -13517,6 +13673,11 @@ public Builder clear() { generativeGroupedResultsBuilder_.dispose(); generativeGroupedResultsBuilder_ = null; } + queryProfile_ = null; + if (queryProfileBuilder_ != null) { + queryProfileBuilder_.dispose(); + queryProfileBuilder_ = null; + } return this; } @@ -13586,6 +13747,12 @@ private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.Weaviat : generativeGroupedResultsBuilder_.build(); to_bitField0_ |= 0x00000002; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.queryProfile_ = queryProfileBuilder_ == null + ? queryProfile_ + : queryProfileBuilder_.build(); + to_bitField0_ |= 0x00000004; + } result.bitField0_ |= to_bitField0_; } @@ -13696,6 +13863,9 @@ public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateP if (other.hasGenerativeGroupedResults()) { mergeGenerativeGroupedResults(other.getGenerativeGroupedResults()); } + if (other.hasQueryProfile()) { + mergeQueryProfile(other.getQueryProfile()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -13765,6 +13935,13 @@ public Builder mergeFrom( bitField0_ |= 0x00000010; break; } // case 42 + case 50: { + input.readMessage( + getQueryProfileFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -14058,7 +14235,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.Sear /** * optional string generative_grouped_result = 3 [deprecated = true]; * @deprecated weaviate.v1.SearchReply.generative_grouped_result is deprecated. - * See v1/search_get.proto;l=114 + * See v1/search_get.proto;l=117 * @return Whether the generativeGroupedResult field is set. */ @java.lang.Deprecated public boolean hasGenerativeGroupedResult() { @@ -14067,7 +14244,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.Sear /** * optional string generative_grouped_result = 3 [deprecated = true]; * @deprecated weaviate.v1.SearchReply.generative_grouped_result is deprecated. - * See v1/search_get.proto;l=114 + * See v1/search_get.proto;l=117 * @return The generativeGroupedResult. */ @java.lang.Deprecated public java.lang.String getGenerativeGroupedResult() { @@ -14085,7 +14262,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.Sear /** * optional string generative_grouped_result = 3 [deprecated = true]; * @deprecated weaviate.v1.SearchReply.generative_grouped_result is deprecated. - * See v1/search_get.proto;l=114 + * See v1/search_get.proto;l=117 * @return The bytes for generativeGroupedResult. */ @java.lang.Deprecated public com.google.protobuf.ByteString @@ -14104,7 +14281,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.Sear /** * optional string generative_grouped_result = 3 [deprecated = true]; * @deprecated weaviate.v1.SearchReply.generative_grouped_result is deprecated. - * See v1/search_get.proto;l=114 + * See v1/search_get.proto;l=117 * @param value The generativeGroupedResult to set. * @return This builder for chaining. */ @@ -14119,7 +14296,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.Sear /** * optional string generative_grouped_result = 3 [deprecated = true]; * @deprecated weaviate.v1.SearchReply.generative_grouped_result is deprecated. - * See v1/search_get.proto;l=114 + * See v1/search_get.proto;l=117 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearGenerativeGroupedResult() { @@ -14131,7 +14308,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.Sear /** * optional string generative_grouped_result = 3 [deprecated = true]; * @deprecated weaviate.v1.SearchReply.generative_grouped_result is deprecated. - * See v1/search_get.proto;l=114 + * See v1/search_get.proto;l=117 * @param value The bytes for generativeGroupedResult to set. * @return This builder for chaining. */ @@ -14200,310 +14377,3169 @@ public Builder setGroupByResults( groupByResults_.set(index, value); onChanged(); } else { - groupByResultsBuilder_.setMessage(index, value); + groupByResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .weaviate.v1.GroupByResult group_by_results = 4; + */ + public Builder setGroupByResults( + int index, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult.Builder builderForValue) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + groupByResults_.set(index, builderForValue.build()); + onChanged(); + } else { + groupByResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .weaviate.v1.GroupByResult group_by_results = 4; + */ + public Builder addGroupByResults(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult value) { + if (groupByResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupByResultsIsMutable(); + groupByResults_.add(value); + onChanged(); + } else { + groupByResultsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .weaviate.v1.GroupByResult group_by_results = 4; + */ + public Builder addGroupByResults( + int index, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult value) { + if (groupByResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupByResultsIsMutable(); + groupByResults_.add(index, value); + onChanged(); + } else { + groupByResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .weaviate.v1.GroupByResult group_by_results = 4; + */ + public Builder addGroupByResults( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult.Builder builderForValue) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + groupByResults_.add(builderForValue.build()); + onChanged(); + } else { + groupByResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .weaviate.v1.GroupByResult group_by_results = 4; + */ + public Builder addGroupByResults( + int index, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult.Builder builderForValue) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + groupByResults_.add(index, builderForValue.build()); + onChanged(); + } else { + groupByResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .weaviate.v1.GroupByResult group_by_results = 4; + */ + public Builder addAllGroupByResults( + java.lang.Iterable values) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, groupByResults_); + onChanged(); + } else { + groupByResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .weaviate.v1.GroupByResult group_by_results = 4; + */ + public Builder clearGroupByResults() { + if (groupByResultsBuilder_ == null) { + groupByResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + groupByResultsBuilder_.clear(); + } + return this; + } + /** + * repeated .weaviate.v1.GroupByResult group_by_results = 4; + */ + public Builder removeGroupByResults(int index) { + if (groupByResultsBuilder_ == null) { + ensureGroupByResultsIsMutable(); + groupByResults_.remove(index); + onChanged(); + } else { + groupByResultsBuilder_.remove(index); + } + return this; + } + /** + * repeated .weaviate.v1.GroupByResult group_by_results = 4; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult.Builder getGroupByResultsBuilder( + int index) { + return getGroupByResultsFieldBuilder().getBuilder(index); + } + /** + * repeated .weaviate.v1.GroupByResult group_by_results = 4; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResultOrBuilder getGroupByResultsOrBuilder( + int index) { + if (groupByResultsBuilder_ == null) { + return groupByResults_.get(index); } else { + return groupByResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .weaviate.v1.GroupByResult group_by_results = 4; + */ + public java.util.List + getGroupByResultsOrBuilderList() { + if (groupByResultsBuilder_ != null) { + return groupByResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(groupByResults_); + } + } + /** + * repeated .weaviate.v1.GroupByResult group_by_results = 4; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult.Builder addGroupByResultsBuilder() { + return getGroupByResultsFieldBuilder().addBuilder( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult.getDefaultInstance()); + } + /** + * repeated .weaviate.v1.GroupByResult group_by_results = 4; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult.Builder addGroupByResultsBuilder( + int index) { + return getGroupByResultsFieldBuilder().addBuilder( + index, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult.getDefaultInstance()); + } + /** + * repeated .weaviate.v1.GroupByResult group_by_results = 4; + */ + public java.util.List + getGroupByResultsBuilderList() { + return getGroupByResultsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResultOrBuilder> + getGroupByResultsFieldBuilder() { + if (groupByResultsBuilder_ == null) { + groupByResultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResultOrBuilder>( + groupByResults_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + groupByResults_ = null; + } + return groupByResultsBuilder_; + } + + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult generativeGroupedResults_; + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResultOrBuilder> generativeGroupedResultsBuilder_; + /** + * optional .weaviate.v1.GenerativeResult generative_grouped_results = 5; + * @return Whether the generativeGroupedResults field is set. + */ + public boolean hasGenerativeGroupedResults() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * optional .weaviate.v1.GenerativeResult generative_grouped_results = 5; + * @return The generativeGroupedResults. + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult getGenerativeGroupedResults() { + if (generativeGroupedResultsBuilder_ == null) { + return generativeGroupedResults_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult.getDefaultInstance() : generativeGroupedResults_; + } else { + return generativeGroupedResultsBuilder_.getMessage(); + } + } + /** + * optional .weaviate.v1.GenerativeResult generative_grouped_results = 5; + */ + public Builder setGenerativeGroupedResults(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult value) { + if (generativeGroupedResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + generativeGroupedResults_ = value; + } else { + generativeGroupedResultsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.GenerativeResult generative_grouped_results = 5; + */ + public Builder setGenerativeGroupedResults( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult.Builder builderForValue) { + if (generativeGroupedResultsBuilder_ == null) { + generativeGroupedResults_ = builderForValue.build(); + } else { + generativeGroupedResultsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.GenerativeResult generative_grouped_results = 5; + */ + public Builder mergeGenerativeGroupedResults(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult value) { + if (generativeGroupedResultsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) && + generativeGroupedResults_ != null && + generativeGroupedResults_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult.getDefaultInstance()) { + getGenerativeGroupedResultsBuilder().mergeFrom(value); + } else { + generativeGroupedResults_ = value; + } + } else { + generativeGroupedResultsBuilder_.mergeFrom(value); + } + if (generativeGroupedResults_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * optional .weaviate.v1.GenerativeResult generative_grouped_results = 5; + */ + public Builder clearGenerativeGroupedResults() { + bitField0_ = (bitField0_ & ~0x00000010); + generativeGroupedResults_ = null; + if (generativeGroupedResultsBuilder_ != null) { + generativeGroupedResultsBuilder_.dispose(); + generativeGroupedResultsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .weaviate.v1.GenerativeResult generative_grouped_results = 5; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult.Builder getGenerativeGroupedResultsBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getGenerativeGroupedResultsFieldBuilder().getBuilder(); + } + /** + * optional .weaviate.v1.GenerativeResult generative_grouped_results = 5; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResultOrBuilder getGenerativeGroupedResultsOrBuilder() { + if (generativeGroupedResultsBuilder_ != null) { + return generativeGroupedResultsBuilder_.getMessageOrBuilder(); + } else { + return generativeGroupedResults_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult.getDefaultInstance() : generativeGroupedResults_; + } + } + /** + * optional .weaviate.v1.GenerativeResult generative_grouped_results = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResultOrBuilder> + getGenerativeGroupedResultsFieldBuilder() { + if (generativeGroupedResultsBuilder_ == null) { + generativeGroupedResultsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResultOrBuilder>( + getGenerativeGroupedResults(), + getParentForChildren(), + isClean()); + generativeGroupedResults_ = null; + } + return generativeGroupedResultsBuilder_; + } + + private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile queryProfile_; + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfileOrBuilder> queryProfileBuilder_; + /** + * optional .weaviate.v1.QueryProfile query_profile = 6; + * @return Whether the queryProfile field is set. + */ + public boolean hasQueryProfile() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional .weaviate.v1.QueryProfile query_profile = 6; + * @return The queryProfile. + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile getQueryProfile() { + if (queryProfileBuilder_ == null) { + return queryProfile_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.getDefaultInstance() : queryProfile_; + } else { + return queryProfileBuilder_.getMessage(); + } + } + /** + * optional .weaviate.v1.QueryProfile query_profile = 6; + */ + public Builder setQueryProfile(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile value) { + if (queryProfileBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryProfile_ = value; + } else { + queryProfileBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.QueryProfile query_profile = 6; + */ + public Builder setQueryProfile( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.Builder builderForValue) { + if (queryProfileBuilder_ == null) { + queryProfile_ = builderForValue.build(); + } else { + queryProfileBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .weaviate.v1.QueryProfile query_profile = 6; + */ + public Builder mergeQueryProfile(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile value) { + if (queryProfileBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) && + queryProfile_ != null && + queryProfile_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.getDefaultInstance()) { + getQueryProfileBuilder().mergeFrom(value); + } else { + queryProfile_ = value; + } + } else { + queryProfileBuilder_.mergeFrom(value); + } + if (queryProfile_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * optional .weaviate.v1.QueryProfile query_profile = 6; + */ + public Builder clearQueryProfile() { + bitField0_ = (bitField0_ & ~0x00000020); + queryProfile_ = null; + if (queryProfileBuilder_ != null) { + queryProfileBuilder_.dispose(); + queryProfileBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .weaviate.v1.QueryProfile query_profile = 6; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.Builder getQueryProfileBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getQueryProfileFieldBuilder().getBuilder(); + } + /** + * optional .weaviate.v1.QueryProfile query_profile = 6; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfileOrBuilder getQueryProfileOrBuilder() { + if (queryProfileBuilder_ != null) { + return queryProfileBuilder_.getMessageOrBuilder(); + } else { + return queryProfile_ == null ? + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.getDefaultInstance() : queryProfile_; + } + } + /** + * optional .weaviate.v1.QueryProfile query_profile = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfileOrBuilder> + getQueryProfileFieldBuilder() { + if (queryProfileBuilder_ == null) { + queryProfileBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfileOrBuilder>( + getQueryProfile(), + getParentForChildren(), + isClean()); + queryProfile_ = null; + } + return queryProfileBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:weaviate.v1.SearchReply) + } + + // @@protoc_insertion_point(class_scope:weaviate.v1.SearchReply) + private static final io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.SearchReply DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.SearchReply(); + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.SearchReply getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchReply parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.SearchReply getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface QueryProfileOrBuilder extends + // @@protoc_insertion_point(interface_extends:weaviate.v1.QueryProfile) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; + */ + java.util.List + getShardsList(); + /** + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile getShards(int index); + /** + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; + */ + int getShardsCount(); + /** + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; + */ + java.util.List + getShardsOrBuilderList(); + /** + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfileOrBuilder getShardsOrBuilder( + int index); + } + /** + *
+   * QueryProfile contains per-shard profiling data for a search query.
+   * Only populated when MetadataRequest.profile is true.
+   * 
+ * + * Protobuf type {@code weaviate.v1.QueryProfile} + */ + public static final class QueryProfile extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:weaviate.v1.QueryProfile) + QueryProfileOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryProfile.newBuilder() to construct. + private QueryProfile(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private QueryProfile() { + shards_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new QueryProfile(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.internal_static_weaviate_v1_QueryProfile_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.internal_static_weaviate_v1_QueryProfile_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.class, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.Builder.class); + } + + public interface SearchProfileOrBuilder extends + // @@protoc_insertion_point(interface_extends:weaviate.v1.QueryProfile.SearchProfile) + com.google.protobuf.MessageOrBuilder { + + /** + *
+       * details contains human-readable profiling metrics keyed by metric name.
+       * 
+ * + * map<string, string> details = 1; + */ + int getDetailsCount(); + /** + *
+       * details contains human-readable profiling metrics keyed by metric name.
+       * 
+ * + * map<string, string> details = 1; + */ + boolean containsDetails( + java.lang.String key); + /** + * Use {@link #getDetailsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getDetails(); + /** + *
+       * details contains human-readable profiling metrics keyed by metric name.
+       * 
+ * + * map<string, string> details = 1; + */ + java.util.Map + getDetailsMap(); + /** + *
+       * details contains human-readable profiling metrics keyed by metric name.
+       * 
+ * + * map<string, string> details = 1; + */ + /* nullable */ +java.lang.String getDetailsOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); + /** + *
+       * details contains human-readable profiling metrics keyed by metric name.
+       * 
+ * + * map<string, string> details = 1; + */ + java.lang.String getDetailsOrThrow( + java.lang.String key); + } + /** + *
+     * SearchProfile holds the profiling details for a single search type within a shard.
+     * 
+ * + * Protobuf type {@code weaviate.v1.QueryProfile.SearchProfile} + */ + public static final class SearchProfile extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:weaviate.v1.QueryProfile.SearchProfile) + SearchProfileOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchProfile.newBuilder() to construct. + private SearchProfile(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SearchProfile() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SearchProfile(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.internal_static_weaviate_v1_QueryProfile_SearchProfile_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetDetails(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.internal_static_weaviate_v1_QueryProfile_SearchProfile_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile.class, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile.Builder.class); + } + + public static final int DETAILS_FIELD_NUMBER = 1; + private static final class DetailsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.internal_static_weaviate_v1_QueryProfile_SearchProfile_DetailsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> details_; + private com.google.protobuf.MapField + internalGetDetails() { + if (details_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DetailsDefaultEntryHolder.defaultEntry); + } + return details_; + } + public int getDetailsCount() { + return internalGetDetails().getMap().size(); + } + /** + *
+       * details contains human-readable profiling metrics keyed by metric name.
+       * 
+ * + * map<string, string> details = 1; + */ + @java.lang.Override + public boolean containsDetails( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetDetails().getMap().containsKey(key); + } + /** + * Use {@link #getDetailsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDetails() { + return getDetailsMap(); + } + /** + *
+       * details contains human-readable profiling metrics keyed by metric name.
+       * 
+ * + * map<string, string> details = 1; + */ + @java.lang.Override + public java.util.Map getDetailsMap() { + return internalGetDetails().getMap(); + } + /** + *
+       * details contains human-readable profiling metrics keyed by metric name.
+       * 
+ * + * map<string, string> details = 1; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getDetailsOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetDetails().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * details contains human-readable profiling metrics keyed by metric name.
+       * 
+ * + * map<string, string> details = 1; + */ + @java.lang.Override + public java.lang.String getDetailsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetDetails().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetDetails(), + DetailsDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetDetails().getMap().entrySet()) { + com.google.protobuf.MapEntry + details__ = DetailsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, details__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile)) { + return super.equals(obj); + } + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile other = (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile) obj; + + if (!internalGetDetails().equals( + other.internalGetDetails())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetDetails().getMap().isEmpty()) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + internalGetDetails().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+       * SearchProfile holds the profiling details for a single search type within a shard.
+       * 
+ * + * Protobuf type {@code weaviate.v1.QueryProfile.SearchProfile} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:weaviate.v1.QueryProfile.SearchProfile) + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfileOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.internal_static_weaviate_v1_QueryProfile_SearchProfile_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetDetails(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableDetails(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.internal_static_weaviate_v1_QueryProfile_SearchProfile_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile.class, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile.Builder.class); + } + + // Construct using io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableDetails().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.internal_static_weaviate_v1_QueryProfile_SearchProfile_descriptor; + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile getDefaultInstanceForType() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile.getDefaultInstance(); + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile build() { + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile buildPartial() { + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile result = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.details_ = internalGetDetails(); + result.details_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile) { + return mergeFrom((io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile other) { + if (other == io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile.getDefaultInstance()) return this; + internalGetMutableDetails().mergeFrom( + other.internalGetDetails()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + details__ = input.readMessage( + DetailsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableDetails().getMutableMap().put( + details__.getKey(), details__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> details_; + private com.google.protobuf.MapField + internalGetDetails() { + if (details_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DetailsDefaultEntryHolder.defaultEntry); + } + return details_; + } + private com.google.protobuf.MapField + internalGetMutableDetails() { + if (details_ == null) { + details_ = com.google.protobuf.MapField.newMapField( + DetailsDefaultEntryHolder.defaultEntry); + } + if (!details_.isMutable()) { + details_ = details_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return details_; + } + public int getDetailsCount() { + return internalGetDetails().getMap().size(); + } + /** + *
+         * details contains human-readable profiling metrics keyed by metric name.
+         * 
+ * + * map<string, string> details = 1; + */ + @java.lang.Override + public boolean containsDetails( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetDetails().getMap().containsKey(key); + } + /** + * Use {@link #getDetailsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDetails() { + return getDetailsMap(); + } + /** + *
+         * details contains human-readable profiling metrics keyed by metric name.
+         * 
+ * + * map<string, string> details = 1; + */ + @java.lang.Override + public java.util.Map getDetailsMap() { + return internalGetDetails().getMap(); + } + /** + *
+         * details contains human-readable profiling metrics keyed by metric name.
+         * 
+ * + * map<string, string> details = 1; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getDetailsOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetDetails().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+         * details contains human-readable profiling metrics keyed by metric name.
+         * 
+ * + * map<string, string> details = 1; + */ + @java.lang.Override + public java.lang.String getDetailsOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetDetails().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearDetails() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableDetails().getMutableMap() + .clear(); + return this; + } + /** + *
+         * details contains human-readable profiling metrics keyed by metric name.
+         * 
+ * + * map<string, string> details = 1; + */ + public Builder removeDetails( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableDetails().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableDetails() { + bitField0_ |= 0x00000001; + return internalGetMutableDetails().getMutableMap(); + } + /** + *
+         * details contains human-readable profiling metrics keyed by metric name.
+         * 
+ * + * map<string, string> details = 1; + */ + public Builder putDetails( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableDetails().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + *
+         * details contains human-readable profiling metrics keyed by metric name.
+         * 
+ * + * map<string, string> details = 1; + */ + public Builder putAllDetails( + java.util.Map values) { + internalGetMutableDetails().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:weaviate.v1.QueryProfile.SearchProfile) + } + + // @@protoc_insertion_point(class_scope:weaviate.v1.QueryProfile.SearchProfile) + private static final io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile(); + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchProfile parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ShardProfileOrBuilder extends + // @@protoc_insertion_point(interface_extends:weaviate.v1.QueryProfile.ShardProfile) + com.google.protobuf.MessageOrBuilder { + + /** + *
+       * name is the identifier of the shard that was searched.
+       * 
+ * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
+       * name is the identifier of the shard that was searched.
+       * 
+ * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+       * node is the name of the cluster node that executed this shard search.
+       * 
+ * + * string node = 2; + * @return The node. + */ + java.lang.String getNode(); + /** + *
+       * node is the name of the cluster node that executed this shard search.
+       * 
+ * + * string node = 2; + * @return The bytes for node. + */ + com.google.protobuf.ByteString + getNodeBytes(); + + /** + *
+       * searches maps search type (e.g., "vector", "keyword") to its profiling details.
+       * 
+ * + * map<string, .weaviate.v1.QueryProfile.SearchProfile> searches = 3; + */ + int getSearchesCount(); + /** + *
+       * searches maps search type (e.g., "vector", "keyword") to its profiling details.
+       * 
+ * + * map<string, .weaviate.v1.QueryProfile.SearchProfile> searches = 3; + */ + boolean containsSearches( + java.lang.String key); + /** + * Use {@link #getSearchesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getSearches(); + /** + *
+       * searches maps search type (e.g., "vector", "keyword") to its profiling details.
+       * 
+ * + * map<string, .weaviate.v1.QueryProfile.SearchProfile> searches = 3; + */ + java.util.Map + getSearchesMap(); + /** + *
+       * searches maps search type (e.g., "vector", "keyword") to its profiling details.
+       * 
+ * + * map<string, .weaviate.v1.QueryProfile.SearchProfile> searches = 3; + */ + /* nullable */ +io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile getSearchesOrDefault( + java.lang.String key, + /* nullable */ +io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile defaultValue); + /** + *
+       * searches maps search type (e.g., "vector", "keyword") to its profiling details.
+       * 
+ * + * map<string, .weaviate.v1.QueryProfile.SearchProfile> searches = 3; + */ + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile getSearchesOrThrow( + java.lang.String key); + } + /** + *
+     * ShardProfile holds profiling data for a single shard's contribution to a search query.
+     * 
+ * + * Protobuf type {@code weaviate.v1.QueryProfile.ShardProfile} + */ + public static final class ShardProfile extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:weaviate.v1.QueryProfile.ShardProfile) + ShardProfileOrBuilder { + private static final long serialVersionUID = 0L; + // Use ShardProfile.newBuilder() to construct. + private ShardProfile(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ShardProfile() { + name_ = ""; + node_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ShardProfile(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.internal_static_weaviate_v1_QueryProfile_ShardProfile_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetSearches(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.internal_static_weaviate_v1_QueryProfile_ShardProfile_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile.class, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + *
+       * name is the identifier of the shard that was searched.
+       * 
+ * + * string name = 1; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+       * name is the identifier of the shard that was searched.
+       * 
+ * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NODE_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private volatile java.lang.Object node_ = ""; + /** + *
+       * node is the name of the cluster node that executed this shard search.
+       * 
+ * + * string node = 2; + * @return The node. + */ + @java.lang.Override + public java.lang.String getNode() { + java.lang.Object ref = node_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + node_ = s; + return s; + } + } + /** + *
+       * node is the name of the cluster node that executed this shard search.
+       * 
+ * + * string node = 2; + * @return The bytes for node. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNodeBytes() { + java.lang.Object ref = node_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + node_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SEARCHES_FIELD_NUMBER = 3; + private static final class SearchesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.internal_static_weaviate_v1_QueryProfile_ShardProfile_SearchesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile.getDefaultInstance()); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile> searches_; + private com.google.protobuf.MapField + internalGetSearches() { + if (searches_ == null) { + return com.google.protobuf.MapField.emptyMapField( + SearchesDefaultEntryHolder.defaultEntry); + } + return searches_; + } + public int getSearchesCount() { + return internalGetSearches().getMap().size(); + } + /** + *
+       * searches maps search type (e.g., "vector", "keyword") to its profiling details.
+       * 
+ * + * map<string, .weaviate.v1.QueryProfile.SearchProfile> searches = 3; + */ + @java.lang.Override + public boolean containsSearches( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetSearches().getMap().containsKey(key); + } + /** + * Use {@link #getSearchesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getSearches() { + return getSearchesMap(); + } + /** + *
+       * searches maps search type (e.g., "vector", "keyword") to its profiling details.
+       * 
+ * + * map<string, .weaviate.v1.QueryProfile.SearchProfile> searches = 3; + */ + @java.lang.Override + public java.util.Map getSearchesMap() { + return internalGetSearches().getMap(); + } + /** + *
+       * searches maps search type (e.g., "vector", "keyword") to its profiling details.
+       * 
+ * + * map<string, .weaviate.v1.QueryProfile.SearchProfile> searches = 3; + */ + @java.lang.Override + public /* nullable */ +io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile getSearchesOrDefault( + java.lang.String key, + /* nullable */ +io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetSearches().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * searches maps search type (e.g., "vector", "keyword") to its profiling details.
+       * 
+ * + * map<string, .weaviate.v1.QueryProfile.SearchProfile> searches = 3; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile getSearchesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetSearches().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(node_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, node_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetSearches(), + SearchesDefaultEntryHolder.defaultEntry, + 3); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(node_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, node_); + } + for (java.util.Map.Entry entry + : internalGetSearches().getMap().entrySet()) { + com.google.protobuf.MapEntry + searches__ = SearchesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, searches__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile)) { + return super.equals(obj); + } + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile other = (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getNode() + .equals(other.getNode())) return false; + if (!internalGetSearches().equals( + other.internalGetSearches())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + NODE_FIELD_NUMBER; + hash = (53 * hash) + getNode().hashCode(); + if (!internalGetSearches().getMap().isEmpty()) { + hash = (37 * hash) + SEARCHES_FIELD_NUMBER; + hash = (53 * hash) + internalGetSearches().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+       * ShardProfile holds profiling data for a single shard's contribution to a search query.
+       * 
+ * + * Protobuf type {@code weaviate.v1.QueryProfile.ShardProfile} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:weaviate.v1.QueryProfile.ShardProfile) + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfileOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.internal_static_weaviate_v1_QueryProfile_ShardProfile_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetSearches(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 3: + return internalGetMutableSearches(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.internal_static_weaviate_v1_QueryProfile_ShardProfile_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile.class, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile.Builder.class); + } + + // Construct using io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + node_ = ""; + internalGetMutableSearches().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.internal_static_weaviate_v1_QueryProfile_ShardProfile_descriptor; + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile getDefaultInstanceForType() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile.getDefaultInstance(); + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile build() { + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile buildPartial() { + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile result = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.node_ = node_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.searches_ = internalGetSearches(); + result.searches_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile) { + return mergeFrom((io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile other) { + if (other == io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getNode().isEmpty()) { + node_ = other.node_; + bitField0_ |= 0x00000002; + onChanged(); + } + internalGetMutableSearches().mergeFrom( + other.internalGetSearches()); + bitField0_ |= 0x00000004; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + node_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: { + com.google.protobuf.MapEntry + searches__ = input.readMessage( + SearchesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableSearches().getMutableMap().put( + searches__.getKey(), searches__.getValue()); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+         * name is the identifier of the shard that was searched.
+         * 
+ * + * string name = 1; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+         * name is the identifier of the shard that was searched.
+         * 
+ * + * string name = 1; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+         * name is the identifier of the shard that was searched.
+         * 
+ * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+         * name is the identifier of the shard that was searched.
+         * 
+ * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+         * name is the identifier of the shard that was searched.
+         * 
+ * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object node_ = ""; + /** + *
+         * node is the name of the cluster node that executed this shard search.
+         * 
+ * + * string node = 2; + * @return The node. + */ + public java.lang.String getNode() { + java.lang.Object ref = node_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + node_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+         * node is the name of the cluster node that executed this shard search.
+         * 
+ * + * string node = 2; + * @return The bytes for node. + */ + public com.google.protobuf.ByteString + getNodeBytes() { + java.lang.Object ref = node_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + node_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+         * node is the name of the cluster node that executed this shard search.
+         * 
+ * + * string node = 2; + * @param value The node to set. + * @return This builder for chaining. + */ + public Builder setNode( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + node_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+         * node is the name of the cluster node that executed this shard search.
+         * 
+ * + * string node = 2; + * @return This builder for chaining. + */ + public Builder clearNode() { + node_ = getDefaultInstance().getNode(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+         * node is the name of the cluster node that executed this shard search.
+         * 
+ * + * string node = 2; + * @param value The bytes for node to set. + * @return This builder for chaining. + */ + public Builder setNodeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + node_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile> searches_; + private com.google.protobuf.MapField + internalGetSearches() { + if (searches_ == null) { + return com.google.protobuf.MapField.emptyMapField( + SearchesDefaultEntryHolder.defaultEntry); + } + return searches_; + } + private com.google.protobuf.MapField + internalGetMutableSearches() { + if (searches_ == null) { + searches_ = com.google.protobuf.MapField.newMapField( + SearchesDefaultEntryHolder.defaultEntry); + } + if (!searches_.isMutable()) { + searches_ = searches_.copy(); + } + bitField0_ |= 0x00000004; + onChanged(); + return searches_; + } + public int getSearchesCount() { + return internalGetSearches().getMap().size(); + } + /** + *
+         * searches maps search type (e.g., "vector", "keyword") to its profiling details.
+         * 
+ * + * map<string, .weaviate.v1.QueryProfile.SearchProfile> searches = 3; + */ + @java.lang.Override + public boolean containsSearches( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetSearches().getMap().containsKey(key); + } + /** + * Use {@link #getSearchesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getSearches() { + return getSearchesMap(); + } + /** + *
+         * searches maps search type (e.g., "vector", "keyword") to its profiling details.
+         * 
+ * + * map<string, .weaviate.v1.QueryProfile.SearchProfile> searches = 3; + */ + @java.lang.Override + public java.util.Map getSearchesMap() { + return internalGetSearches().getMap(); + } + /** + *
+         * searches maps search type (e.g., "vector", "keyword") to its profiling details.
+         * 
+ * + * map<string, .weaviate.v1.QueryProfile.SearchProfile> searches = 3; + */ + @java.lang.Override + public /* nullable */ +io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile getSearchesOrDefault( + java.lang.String key, + /* nullable */ +io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetSearches().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+         * searches maps search type (e.g., "vector", "keyword") to its profiling details.
+         * 
+ * + * map<string, .weaviate.v1.QueryProfile.SearchProfile> searches = 3; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile getSearchesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetSearches().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearSearches() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableSearches().getMutableMap() + .clear(); + return this; + } + /** + *
+         * searches maps search type (e.g., "vector", "keyword") to its profiling details.
+         * 
+ * + * map<string, .weaviate.v1.QueryProfile.SearchProfile> searches = 3; + */ + public Builder removeSearches( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableSearches().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableSearches() { + bitField0_ |= 0x00000004; + return internalGetMutableSearches().getMutableMap(); + } + /** + *
+         * searches maps search type (e.g., "vector", "keyword") to its profiling details.
+         * 
+ * + * map<string, .weaviate.v1.QueryProfile.SearchProfile> searches = 3; + */ + public Builder putSearches( + java.lang.String key, + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.SearchProfile value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableSearches().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000004; + return this; + } + /** + *
+         * searches maps search type (e.g., "vector", "keyword") to its profiling details.
+         * 
+ * + * map<string, .weaviate.v1.QueryProfile.SearchProfile> searches = 3; + */ + public Builder putAllSearches( + java.util.Map values) { + internalGetMutableSearches().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000004; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:weaviate.v1.QueryProfile.ShardProfile) + } + + // @@protoc_insertion_point(class_scope:weaviate.v1.QueryProfile.ShardProfile) + private static final io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile(); + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ShardProfile parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int SHARDS_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List shards_; + /** + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; + */ + @java.lang.Override + public java.util.List getShardsList() { + return shards_; + } + /** + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; + */ + @java.lang.Override + public java.util.List + getShardsOrBuilderList() { + return shards_; + } + /** + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; + */ + @java.lang.Override + public int getShardsCount() { + return shards_.size(); + } + /** + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile getShards(int index) { + return shards_.get(index); + } + /** + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; + */ + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfileOrBuilder getShardsOrBuilder( + int index) { + return shards_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < shards_.size(); i++) { + output.writeMessage(1, shards_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < shards_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, shards_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile)) { + return super.equals(obj); + } + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile other = (io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile) obj; + + if (!getShardsList() + .equals(other.getShardsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getShardsCount() > 0) { + hash = (37 * hash) + SHARDS_FIELD_NUMBER; + hash = (53 * hash) + getShardsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * QueryProfile contains per-shard profiling data for a search query.
+     * Only populated when MetadataRequest.profile is true.
+     * 
+ * + * Protobuf type {@code weaviate.v1.QueryProfile} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:weaviate.v1.QueryProfile) + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfileOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.internal_static_weaviate_v1_QueryProfile_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.internal_static_weaviate_v1_QueryProfile_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.class, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.Builder.class); + } + + // Construct using io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (shardsBuilder_ == null) { + shards_ = java.util.Collections.emptyList(); + } else { + shards_ = null; + shardsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.internal_static_weaviate_v1_QueryProfile_descriptor; + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile getDefaultInstanceForType() { + return io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.getDefaultInstance(); + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile build() { + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile buildPartial() { + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile result = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile result) { + if (shardsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + shards_ = java.util.Collections.unmodifiableList(shards_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.shards_ = shards_; + } else { + result.shards_ = shardsBuilder_.build(); + } + } + + private void buildPartial0(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile) { + return mergeFrom((io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile other) { + if (other == io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.getDefaultInstance()) return this; + if (shardsBuilder_ == null) { + if (!other.shards_.isEmpty()) { + if (shards_.isEmpty()) { + shards_ = other.shards_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureShardsIsMutable(); + shards_.addAll(other.shards_); + } + onChanged(); + } + } else { + if (!other.shards_.isEmpty()) { + if (shardsBuilder_.isEmpty()) { + shardsBuilder_.dispose(); + shardsBuilder_ = null; + shards_ = other.shards_; + bitField0_ = (bitField0_ & ~0x00000001); + shardsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getShardsFieldBuilder() : null; + } else { + shardsBuilder_.addAllMessages(other.shards_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile m = + input.readMessage( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile.parser(), + extensionRegistry); + if (shardsBuilder_ == null) { + ensureShardsIsMutable(); + shards_.add(m); + } else { + shardsBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List shards_ = + java.util.Collections.emptyList(); + private void ensureShardsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + shards_ = new java.util.ArrayList(shards_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfileOrBuilder> shardsBuilder_; + + /** + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; + */ + public java.util.List getShardsList() { + if (shardsBuilder_ == null) { + return java.util.Collections.unmodifiableList(shards_); + } else { + return shardsBuilder_.getMessageList(); + } + } + /** + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; + */ + public int getShardsCount() { + if (shardsBuilder_ == null) { + return shards_.size(); + } else { + return shardsBuilder_.getCount(); + } + } + /** + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; + */ + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile getShards(int index) { + if (shardsBuilder_ == null) { + return shards_.get(index); + } else { + return shardsBuilder_.getMessage(index); + } + } + /** + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; + */ + public Builder setShards( + int index, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile value) { + if (shardsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureShardsIsMutable(); + shards_.set(index, value); + onChanged(); + } else { + shardsBuilder_.setMessage(index, value); } return this; } /** - * repeated .weaviate.v1.GroupByResult group_by_results = 4; + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; */ - public Builder setGroupByResults( - int index, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult.Builder builderForValue) { - if (groupByResultsBuilder_ == null) { - ensureGroupByResultsIsMutable(); - groupByResults_.set(index, builderForValue.build()); + public Builder setShards( + int index, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile.Builder builderForValue) { + if (shardsBuilder_ == null) { + ensureShardsIsMutable(); + shards_.set(index, builderForValue.build()); onChanged(); } else { - groupByResultsBuilder_.setMessage(index, builderForValue.build()); + shardsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * repeated .weaviate.v1.GroupByResult group_by_results = 4; + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; */ - public Builder addGroupByResults(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult value) { - if (groupByResultsBuilder_ == null) { + public Builder addShards(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile value) { + if (shardsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureGroupByResultsIsMutable(); - groupByResults_.add(value); + ensureShardsIsMutable(); + shards_.add(value); onChanged(); } else { - groupByResultsBuilder_.addMessage(value); + shardsBuilder_.addMessage(value); } return this; } /** - * repeated .weaviate.v1.GroupByResult group_by_results = 4; + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; */ - public Builder addGroupByResults( - int index, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult value) { - if (groupByResultsBuilder_ == null) { + public Builder addShards( + int index, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile value) { + if (shardsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureGroupByResultsIsMutable(); - groupByResults_.add(index, value); + ensureShardsIsMutable(); + shards_.add(index, value); onChanged(); } else { - groupByResultsBuilder_.addMessage(index, value); + shardsBuilder_.addMessage(index, value); } return this; } /** - * repeated .weaviate.v1.GroupByResult group_by_results = 4; + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; */ - public Builder addGroupByResults( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult.Builder builderForValue) { - if (groupByResultsBuilder_ == null) { - ensureGroupByResultsIsMutable(); - groupByResults_.add(builderForValue.build()); + public Builder addShards( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile.Builder builderForValue) { + if (shardsBuilder_ == null) { + ensureShardsIsMutable(); + shards_.add(builderForValue.build()); onChanged(); } else { - groupByResultsBuilder_.addMessage(builderForValue.build()); + shardsBuilder_.addMessage(builderForValue.build()); } return this; } /** - * repeated .weaviate.v1.GroupByResult group_by_results = 4; + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; */ - public Builder addGroupByResults( - int index, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult.Builder builderForValue) { - if (groupByResultsBuilder_ == null) { - ensureGroupByResultsIsMutable(); - groupByResults_.add(index, builderForValue.build()); + public Builder addShards( + int index, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile.Builder builderForValue) { + if (shardsBuilder_ == null) { + ensureShardsIsMutable(); + shards_.add(index, builderForValue.build()); onChanged(); } else { - groupByResultsBuilder_.addMessage(index, builderForValue.build()); + shardsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * repeated .weaviate.v1.GroupByResult group_by_results = 4; + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; */ - public Builder addAllGroupByResults( - java.lang.Iterable values) { - if (groupByResultsBuilder_ == null) { - ensureGroupByResultsIsMutable(); + public Builder addAllShards( + java.lang.Iterable values) { + if (shardsBuilder_ == null) { + ensureShardsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, groupByResults_); + values, shards_); onChanged(); } else { - groupByResultsBuilder_.addAllMessages(values); + shardsBuilder_.addAllMessages(values); } return this; } /** - * repeated .weaviate.v1.GroupByResult group_by_results = 4; + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; */ - public Builder clearGroupByResults() { - if (groupByResultsBuilder_ == null) { - groupByResults_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + public Builder clearShards() { + if (shardsBuilder_ == null) { + shards_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - groupByResultsBuilder_.clear(); + shardsBuilder_.clear(); } return this; } /** - * repeated .weaviate.v1.GroupByResult group_by_results = 4; + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; */ - public Builder removeGroupByResults(int index) { - if (groupByResultsBuilder_ == null) { - ensureGroupByResultsIsMutable(); - groupByResults_.remove(index); + public Builder removeShards(int index) { + if (shardsBuilder_ == null) { + ensureShardsIsMutable(); + shards_.remove(index); onChanged(); } else { - groupByResultsBuilder_.remove(index); + shardsBuilder_.remove(index); } return this; } /** - * repeated .weaviate.v1.GroupByResult group_by_results = 4; + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult.Builder getGroupByResultsBuilder( + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile.Builder getShardsBuilder( int index) { - return getGroupByResultsFieldBuilder().getBuilder(index); + return getShardsFieldBuilder().getBuilder(index); } /** - * repeated .weaviate.v1.GroupByResult group_by_results = 4; + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResultOrBuilder getGroupByResultsOrBuilder( + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfileOrBuilder getShardsOrBuilder( int index) { - if (groupByResultsBuilder_ == null) { - return groupByResults_.get(index); } else { - return groupByResultsBuilder_.getMessageOrBuilder(index); + if (shardsBuilder_ == null) { + return shards_.get(index); } else { + return shardsBuilder_.getMessageOrBuilder(index); } } /** - * repeated .weaviate.v1.GroupByResult group_by_results = 4; + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; */ - public java.util.List - getGroupByResultsOrBuilderList() { - if (groupByResultsBuilder_ != null) { - return groupByResultsBuilder_.getMessageOrBuilderList(); + public java.util.List + getShardsOrBuilderList() { + if (shardsBuilder_ != null) { + return shardsBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(groupByResults_); + return java.util.Collections.unmodifiableList(shards_); } } /** - * repeated .weaviate.v1.GroupByResult group_by_results = 4; + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult.Builder addGroupByResultsBuilder() { - return getGroupByResultsFieldBuilder().addBuilder( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult.getDefaultInstance()); + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile.Builder addShardsBuilder() { + return getShardsFieldBuilder().addBuilder( + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile.getDefaultInstance()); } /** - * repeated .weaviate.v1.GroupByResult group_by_results = 4; + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult.Builder addGroupByResultsBuilder( + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile.Builder addShardsBuilder( int index) { - return getGroupByResultsFieldBuilder().addBuilder( - index, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult.getDefaultInstance()); + return getShardsFieldBuilder().addBuilder( + index, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile.getDefaultInstance()); } /** - * repeated .weaviate.v1.GroupByResult group_by_results = 4; + * repeated .weaviate.v1.QueryProfile.ShardProfile shards = 1; */ - public java.util.List - getGroupByResultsBuilderList() { - return getGroupByResultsFieldBuilder().getBuilderList(); + public java.util.List + getShardsBuilderList() { + return getShardsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResultOrBuilder> - getGroupByResultsFieldBuilder() { - if (groupByResultsBuilder_ == null) { - groupByResultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResult.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.GroupByResultOrBuilder>( - groupByResults_, - ((bitField0_ & 0x00000008) != 0), - getParentForChildren(), - isClean()); - groupByResults_ = null; - } - return groupByResultsBuilder_; - } - - private io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult generativeGroupedResults_; - private com.google.protobuf.SingleFieldBuilderV3< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResultOrBuilder> generativeGroupedResultsBuilder_; - /** - * optional .weaviate.v1.GenerativeResult generative_grouped_results = 5; - * @return Whether the generativeGroupedResults field is set. - */ - public boolean hasGenerativeGroupedResults() { - return ((bitField0_ & 0x00000010) != 0); - } - /** - * optional .weaviate.v1.GenerativeResult generative_grouped_results = 5; - * @return The generativeGroupedResults. - */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult getGenerativeGroupedResults() { - if (generativeGroupedResultsBuilder_ == null) { - return generativeGroupedResults_ == null ? io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult.getDefaultInstance() : generativeGroupedResults_; - } else { - return generativeGroupedResultsBuilder_.getMessage(); - } - } - /** - * optional .weaviate.v1.GenerativeResult generative_grouped_results = 5; - */ - public Builder setGenerativeGroupedResults(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult value) { - if (generativeGroupedResultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - generativeGroupedResults_ = value; - } else { - generativeGroupedResultsBuilder_.setMessage(value); - } - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - * optional .weaviate.v1.GenerativeResult generative_grouped_results = 5; - */ - public Builder setGenerativeGroupedResults( - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult.Builder builderForValue) { - if (generativeGroupedResultsBuilder_ == null) { - generativeGroupedResults_ = builderForValue.build(); - } else { - generativeGroupedResultsBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - * optional .weaviate.v1.GenerativeResult generative_grouped_results = 5; - */ - public Builder mergeGenerativeGroupedResults(io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult value) { - if (generativeGroupedResultsBuilder_ == null) { - if (((bitField0_ & 0x00000010) != 0) && - generativeGroupedResults_ != null && - generativeGroupedResults_ != io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult.getDefaultInstance()) { - getGenerativeGroupedResultsBuilder().mergeFrom(value); - } else { - generativeGroupedResults_ = value; - } - } else { - generativeGroupedResultsBuilder_.mergeFrom(value); - } - if (generativeGroupedResults_ != null) { - bitField0_ |= 0x00000010; - onChanged(); - } - return this; - } - /** - * optional .weaviate.v1.GenerativeResult generative_grouped_results = 5; - */ - public Builder clearGenerativeGroupedResults() { - bitField0_ = (bitField0_ & ~0x00000010); - generativeGroupedResults_ = null; - if (generativeGroupedResultsBuilder_ != null) { - generativeGroupedResultsBuilder_.dispose(); - generativeGroupedResultsBuilder_ = null; - } - onChanged(); - return this; - } - /** - * optional .weaviate.v1.GenerativeResult generative_grouped_results = 5; - */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult.Builder getGenerativeGroupedResultsBuilder() { - bitField0_ |= 0x00000010; - onChanged(); - return getGenerativeGroupedResultsFieldBuilder().getBuilder(); - } - /** - * optional .weaviate.v1.GenerativeResult generative_grouped_results = 5; - */ - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResultOrBuilder getGenerativeGroupedResultsOrBuilder() { - if (generativeGroupedResultsBuilder_ != null) { - return generativeGroupedResultsBuilder_.getMessageOrBuilder(); - } else { - return generativeGroupedResults_ == null ? - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult.getDefaultInstance() : generativeGroupedResults_; - } - } - /** - * optional .weaviate.v1.GenerativeResult generative_grouped_results = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResultOrBuilder> - getGenerativeGroupedResultsFieldBuilder() { - if (generativeGroupedResultsBuilder_ == null) { - generativeGroupedResultsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResult.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeResultOrBuilder>( - getGenerativeGroupedResults(), + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfileOrBuilder> + getShardsFieldBuilder() { + if (shardsBuilder_ == null) { + shardsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfile.Builder, io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile.ShardProfileOrBuilder>( + shards_, + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - generativeGroupedResults_ = null; + shards_ = null; } - return generativeGroupedResultsBuilder_; + return shardsBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -14518,23 +17554,23 @@ public final Builder mergeUnknownFields( } - // @@protoc_insertion_point(builder_scope:weaviate.v1.SearchReply) + // @@protoc_insertion_point(builder_scope:weaviate.v1.QueryProfile) } - // @@protoc_insertion_point(class_scope:weaviate.v1.SearchReply) - private static final io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.SearchReply DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:weaviate.v1.QueryProfile) + private static final io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.SearchReply(); + DEFAULT_INSTANCE = new io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile(); } - public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.SearchReply getDefaultInstance() { + public static io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public SearchReply parsePartialFrom( + public QueryProfile parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -14553,17 +17589,17 @@ public SearchReply parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.SearchReply getDefaultInstanceForType() { + public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.QueryProfile getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -15123,14 +18159,14 @@ io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.SearchResul /** * optional .weaviate.v1.GenerativeReply generative = 7 [deprecated = true]; * @deprecated weaviate.v1.GroupByResult.generative is deprecated. - * See v1/search_get.proto;l=130 + * See v1/search_get.proto;l=156 * @return Whether the generative field is set. */ @java.lang.Deprecated boolean hasGenerative(); /** * optional .weaviate.v1.GenerativeReply generative = 7 [deprecated = true]; * @deprecated weaviate.v1.GroupByResult.generative is deprecated. - * See v1/search_get.proto;l=130 + * See v1/search_get.proto;l=156 * @return The generative. */ @java.lang.Deprecated io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeReply getGenerative(); @@ -15336,7 +18372,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.Rera /** * optional .weaviate.v1.GenerativeReply generative = 7 [deprecated = true]; * @deprecated weaviate.v1.GroupByResult.generative is deprecated. - * See v1/search_get.proto;l=130 + * See v1/search_get.proto;l=156 * @return Whether the generative field is set. */ @java.lang.Override @@ -15346,7 +18382,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.Rera /** * optional .weaviate.v1.GenerativeReply generative = 7 [deprecated = true]; * @deprecated weaviate.v1.GroupByResult.generative is deprecated. - * See v1/search_get.proto;l=130 + * See v1/search_get.proto;l=156 * @return The generative. */ @java.lang.Override @@ -16516,7 +19552,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.Rera /** * optional .weaviate.v1.GenerativeReply generative = 7 [deprecated = true]; * @deprecated weaviate.v1.GroupByResult.generative is deprecated. - * See v1/search_get.proto;l=130 + * See v1/search_get.proto;l=156 * @return Whether the generative field is set. */ @java.lang.Deprecated public boolean hasGenerative() { @@ -16525,7 +19561,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.Rera /** * optional .weaviate.v1.GenerativeReply generative = 7 [deprecated = true]; * @deprecated weaviate.v1.GroupByResult.generative is deprecated. - * See v1/search_get.proto;l=130 + * See v1/search_get.proto;l=156 * @return The generative. */ @java.lang.Deprecated public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoGenerative.GenerativeReply getGenerative() { @@ -17854,7 +20890,7 @@ public interface MetadataResultOrBuilder extends * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.vector is deprecated. - * See v1/search_get.proto;l=144 + * See v1/search_get.proto;l=170 * @return A list containing the vector. */ @java.lang.Deprecated java.util.List getVectorList(); @@ -17865,7 +20901,7 @@ public interface MetadataResultOrBuilder extends * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.vector is deprecated. - * See v1/search_get.proto;l=144 + * See v1/search_get.proto;l=170 * @return The count of vector. */ @java.lang.Deprecated int getVectorCount(); @@ -17876,7 +20912,7 @@ public interface MetadataResultOrBuilder extends * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.vector is deprecated. - * See v1/search_get.proto;l=144 + * See v1/search_get.proto;l=170 * @param index The index of the element to return. * @return The vector at the given index. */ @@ -17974,14 +21010,14 @@ public interface MetadataResultOrBuilder extends /** * string generative = 16 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.generative is deprecated. - * See v1/search_get.proto;l=158 + * See v1/search_get.proto;l=184 * @return The generative. */ @java.lang.Deprecated java.lang.String getGenerative(); /** * string generative = 16 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.generative is deprecated. - * See v1/search_get.proto;l=158 + * See v1/search_get.proto;l=184 * @return The bytes for generative. */ @java.lang.Deprecated com.google.protobuf.ByteString @@ -17990,7 +21026,7 @@ public interface MetadataResultOrBuilder extends /** * bool generative_present = 17 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.generative_present is deprecated. - * See v1/search_get.proto;l=159 + * See v1/search_get.proto;l=185 * @return The generativePresent. */ @java.lang.Deprecated boolean getGenerativePresent(); @@ -18142,7 +21178,7 @@ public java.lang.String getId() { * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.vector is deprecated. - * See v1/search_get.proto;l=144 + * See v1/search_get.proto;l=170 * @return A list containing the vector. */ @java.lang.Override @@ -18157,7 +21193,7 @@ public java.lang.String getId() { * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.vector is deprecated. - * See v1/search_get.proto;l=144 + * See v1/search_get.proto;l=170 * @return The count of vector. */ @java.lang.Deprecated public int getVectorCount() { @@ -18170,7 +21206,7 @@ public java.lang.String getId() { * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.vector is deprecated. - * See v1/search_get.proto;l=144 + * See v1/search_get.proto;l=170 * @param index The index of the element to return. * @return The vector at the given index. */ @@ -18364,7 +21400,7 @@ public boolean getIsConsistent() { /** * string generative = 16 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.generative is deprecated. - * See v1/search_get.proto;l=158 + * See v1/search_get.proto;l=184 * @return The generative. */ @java.lang.Override @@ -18383,7 +21419,7 @@ public boolean getIsConsistent() { /** * string generative = 16 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.generative is deprecated. - * See v1/search_get.proto;l=158 + * See v1/search_get.proto;l=184 * @return The bytes for generative. */ @java.lang.Override @@ -18406,7 +21442,7 @@ public boolean getIsConsistent() { /** * bool generative_present = 17 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.generative_present is deprecated. - * See v1/search_get.proto;l=159 + * See v1/search_get.proto;l=185 * @return The generativePresent. */ @java.lang.Override @@ -19548,7 +22584,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.vector is deprecated. - * See v1/search_get.proto;l=144 + * See v1/search_get.proto;l=170 * @return A list containing the vector. */ @java.lang.Deprecated public java.util.List @@ -19563,7 +22599,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.vector is deprecated. - * See v1/search_get.proto;l=144 + * See v1/search_get.proto;l=170 * @return The count of vector. */ @java.lang.Deprecated public int getVectorCount() { @@ -19576,7 +22612,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.vector is deprecated. - * See v1/search_get.proto;l=144 + * See v1/search_get.proto;l=170 * @param index The index of the element to return. * @return The vector at the given index. */ @@ -19590,7 +22626,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.vector is deprecated. - * See v1/search_get.proto;l=144 + * See v1/search_get.proto;l=170 * @param index The index to set the value at. * @param value The vector to set. * @return This builder for chaining. @@ -19611,7 +22647,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.vector is deprecated. - * See v1/search_get.proto;l=144 + * See v1/search_get.proto;l=170 * @param value The vector to add. * @return This builder for chaining. */ @@ -19630,7 +22666,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.vector is deprecated. - * See v1/search_get.proto;l=144 + * See v1/search_get.proto;l=170 * @param values The vector to add. * @return This builder for chaining. */ @@ -19650,7 +22686,7 @@ private void ensureVectorIsMutable(int capacity) { * * repeated float vector = 2 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.vector is deprecated. - * See v1/search_get.proto;l=144 + * See v1/search_get.proto;l=170 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearVector() { @@ -20128,7 +23164,7 @@ public Builder clearIsConsistent() { /** * string generative = 16 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.generative is deprecated. - * See v1/search_get.proto;l=158 + * See v1/search_get.proto;l=184 * @return The generative. */ @java.lang.Deprecated public java.lang.String getGenerative() { @@ -20146,7 +23182,7 @@ public Builder clearIsConsistent() { /** * string generative = 16 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.generative is deprecated. - * See v1/search_get.proto;l=158 + * See v1/search_get.proto;l=184 * @return The bytes for generative. */ @java.lang.Deprecated public com.google.protobuf.ByteString @@ -20165,7 +23201,7 @@ public Builder clearIsConsistent() { /** * string generative = 16 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.generative is deprecated. - * See v1/search_get.proto;l=158 + * See v1/search_get.proto;l=184 * @param value The generative to set. * @return This builder for chaining. */ @@ -20180,7 +23216,7 @@ public Builder clearIsConsistent() { /** * string generative = 16 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.generative is deprecated. - * See v1/search_get.proto;l=158 + * See v1/search_get.proto;l=184 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearGenerative() { @@ -20192,7 +23228,7 @@ public Builder clearIsConsistent() { /** * string generative = 16 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.generative is deprecated. - * See v1/search_get.proto;l=158 + * See v1/search_get.proto;l=184 * @param value The bytes for generative to set. * @return This builder for chaining. */ @@ -20210,7 +23246,7 @@ public Builder clearIsConsistent() { /** * bool generative_present = 17 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.generative_present is deprecated. - * See v1/search_get.proto;l=159 + * See v1/search_get.proto;l=185 * @return The generativePresent. */ @java.lang.Override @@ -20220,7 +23256,7 @@ public Builder clearIsConsistent() { /** * bool generative_present = 17 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.generative_present is deprecated. - * See v1/search_get.proto;l=159 + * See v1/search_get.proto;l=185 * @param value The generativePresent to set. * @return This builder for chaining. */ @@ -20234,7 +23270,7 @@ public Builder clearIsConsistent() { /** * bool generative_present = 17 [deprecated = true]; * @deprecated weaviate.v1.MetadataResult.generative_present is deprecated. - * See v1/search_get.proto;l=159 + * See v1/search_get.proto;l=185 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearGenerativePresent() { @@ -23094,6 +26130,31 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.RefP private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_weaviate_v1_SearchReply_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_weaviate_v1_QueryProfile_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_weaviate_v1_QueryProfile_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_weaviate_v1_QueryProfile_SearchProfile_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_weaviate_v1_QueryProfile_SearchProfile_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_weaviate_v1_QueryProfile_SearchProfile_DetailsEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_weaviate_v1_QueryProfile_SearchProfile_DetailsEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_weaviate_v1_QueryProfile_ShardProfile_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_weaviate_v1_QueryProfile_ShardProfile_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_weaviate_v1_QueryProfile_ShardProfile_SearchesEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_weaviate_v1_QueryProfile_ShardProfile_SearchesEntry_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_weaviate_v1_RerankReply_descriptor; private static final @@ -23174,77 +26235,90 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.RefP "ar_imuB\r\n\013_generativeB\t\n\007_rerank\"L\n\007Grou" + "pBy\022\014\n\004path\030\001 \003(\t\022\030\n\020number_of_groups\030\002 " + "\001(\005\022\031\n\021objects_per_group\030\003 \001(\005\")\n\006SortBy" + - "\022\021\n\tascending\030\001 \001(\010\022\014\n\004path\030\002 \003(\t\"\335\001\n\017Me" + + "\022\021\n\tascending\030\001 \001(\010\022\014\n\004path\030\002 \003(\t\"\364\001\n\017Me" + "tadataRequest\022\014\n\004uuid\030\001 \001(\010\022\016\n\006vector\030\002 " + "\001(\010\022\032\n\022creation_time_unix\030\003 \001(\010\022\035\n\025last_" + "update_time_unix\030\004 \001(\010\022\020\n\010distance\030\005 \001(\010" + "\022\021\n\tcertainty\030\006 \001(\010\022\r\n\005score\030\007 \001(\010\022\025\n\rex" + "plain_score\030\010 \001(\010\022\025\n\ris_consistent\030\t \001(\010" + - "\022\017\n\007vectors\030\n \003(\t\"\321\001\n\021PropertiesRequest\022" + - "\032\n\022non_ref_properties\030\001 \003(\t\0229\n\016ref_prope" + - "rties\030\002 \003(\0132!.weaviate.v1.RefPropertiesR" + - "equest\022?\n\021object_properties\030\003 \003(\0132$.weav" + - "iate.v1.ObjectPropertiesRequest\022$\n\034retur" + - "n_all_nonref_properties\030\013 \001(\010\"\213\001\n\027Object" + - "PropertiesRequest\022\021\n\tprop_name\030\001 \001(\t\022\034\n\024" + - "primitive_properties\030\002 \003(\t\022?\n\021object_pro" + - "perties\030\003 \003(\0132$.weaviate.v1.ObjectProper" + - "tiesRequest\"\261\001\n\024RefPropertiesRequest\022\032\n\022" + - "reference_property\030\001 \001(\t\0222\n\nproperties\030\002" + - " \001(\0132\036.weaviate.v1.PropertiesRequest\022.\n\010" + - "metadata\030\003 \001(\0132\034.weaviate.v1.MetadataReq" + - "uest\022\031\n\021target_collection\030\004 \001(\t\"8\n\006Reran" + - "k\022\020\n\010property\030\001 \001(\t\022\022\n\005query\030\002 \001(\tH\000\210\001\001B" + - "\010\n\006_query\"\256\002\n\013SearchReply\022\014\n\004took\030\001 \001(\002\022" + - "*\n\007results\030\002 \003(\0132\031.weaviate.v1.SearchRes" + - "ult\022*\n\031generative_grouped_result\030\003 \001(\tB\002" + - "\030\001H\000\210\001\001\0224\n\020group_by_results\030\004 \003(\0132\032.weav" + - "iate.v1.GroupByResult\022F\n\032generative_grou" + - "ped_results\030\005 \001(\0132\035.weaviate.v1.Generati" + - "veResultH\001\210\001\001B\034\n\032_generative_grouped_res" + - "ultB\035\n\033_generative_grouped_results\"\034\n\013Re" + - "rankReply\022\r\n\005score\030\001 \001(\001\"\351\002\n\rGroupByResu" + - "lt\022\014\n\004name\030\001 \001(\t\022\024\n\014min_distance\030\002 \001(\002\022\024" + - "\n\014max_distance\030\003 \001(\002\022\031\n\021number_of_object" + - "s\030\004 \001(\003\022*\n\007objects\030\005 \003(\0132\031.weaviate.v1.S" + - "earchResult\022-\n\006rerank\030\006 \001(\0132\030.weaviate.v" + - "1.RerankReplyH\000\210\001\001\0229\n\ngenerative\030\007 \001(\0132\034" + - ".weaviate.v1.GenerativeReplyB\002\030\001H\001\210\001\001\022=\n" + - "\021generative_result\030\010 \001(\0132\035.weaviate.v1.G" + - "enerativeResultH\002\210\001\001B\t\n\007_rerankB\r\n\013_gene" + - "rativeB\024\n\022_generative_result\"\267\001\n\014SearchR" + - "esult\0221\n\nproperties\030\001 \001(\0132\035.weaviate.v1." + - "PropertiesResult\022-\n\010metadata\030\002 \001(\0132\033.wea" + - "viate.v1.MetadataResult\0226\n\ngenerative\030\003 " + - "\001(\0132\035.weaviate.v1.GenerativeResultH\000\210\001\001B" + - "\r\n\013_generative\"\367\004\n\016MetadataResult\022\n\n\002id\030" + - "\001 \001(\t\022\022\n\006vector\030\002 \003(\002B\002\030\001\022\032\n\022creation_ti" + - "me_unix\030\003 \001(\003\022\"\n\032creation_time_unix_pres" + - "ent\030\004 \001(\010\022\035\n\025last_update_time_unix\030\005 \001(\003" + - "\022%\n\035last_update_time_unix_present\030\006 \001(\010\022" + - "\020\n\010distance\030\007 \001(\002\022\030\n\020distance_present\030\010 " + - "\001(\010\022\021\n\tcertainty\030\t \001(\002\022\031\n\021certainty_pres" + - "ent\030\n \001(\010\022\r\n\005score\030\013 \001(\002\022\025\n\rscore_presen" + - "t\030\014 \001(\010\022\025\n\rexplain_score\030\r \001(\t\022\035\n\025explai" + - "n_score_present\030\016 \001(\010\022\032\n\ris_consistent\030\017" + - " \001(\010H\000\210\001\001\022\026\n\ngenerative\030\020 \001(\tB\002\030\001\022\036\n\022gen" + - "erative_present\030\021 \001(\010B\002\030\001\022\035\n\025is_consiste" + - "nt_present\030\022 \001(\010\022\024\n\014vector_bytes\030\023 \001(\014\022\023" + - "\n\013id_as_bytes\030\024 \001(\014\022\024\n\014rerank_score\030\025 \001(" + - "\001\022\034\n\024rerank_score_present\030\026 \001(\010\022%\n\007vecto" + - "rs\030\027 \003(\0132\024.weaviate.v1.VectorsB\020\n\016_is_co" + - "nsistent\"\210\002\n\020PropertiesResult\0223\n\tref_pro" + - "ps\030\002 \003(\0132 .weaviate.v1.RefPropertiesResu" + - "lt\022\031\n\021target_collection\030\003 \001(\t\022-\n\010metadat" + - "a\030\004 \001(\0132\033.weaviate.v1.MetadataResult\022.\n\r" + - "non_ref_props\030\013 \001(\0132\027.weaviate.v1.Proper" + - "ties\022\033\n\023ref_props_requested\030\014 \001(\010J\004\010\001\020\002J" + - "\004\010\005\020\006J\004\010\006\020\007J\004\010\007\020\010J\004\010\010\020\tJ\004\010\t\020\nJ\004\010\n\020\013\"[\n\023R" + - "efPropertiesResult\0221\n\nproperties\030\001 \003(\0132\035" + - ".weaviate.v1.PropertiesResult\022\021\n\tprop_na" + - "me\030\002 \001(\tBG\n-io.weaviate.client6.v1.inter" + - "nal.grpc.protocolB\026WeaviateProtoSearchGe" + - "tb\006proto3" + "\022\017\n\007vectors\030\n \003(\t\022\025\n\rquery_profile\030\013 \001(\010" + + "\"\321\001\n\021PropertiesRequest\022\032\n\022non_ref_proper" + + "ties\030\001 \003(\t\0229\n\016ref_properties\030\002 \003(\0132!.wea" + + "viate.v1.RefPropertiesRequest\022?\n\021object_" + + "properties\030\003 \003(\0132$.weaviate.v1.ObjectPro" + + "pertiesRequest\022$\n\034return_all_nonref_prop" + + "erties\030\013 \001(\010\"\213\001\n\027ObjectPropertiesRequest" + + "\022\021\n\tprop_name\030\001 \001(\t\022\034\n\024primitive_propert" + + "ies\030\002 \003(\t\022?\n\021object_properties\030\003 \003(\0132$.w" + + "eaviate.v1.ObjectPropertiesRequest\"\261\001\n\024R" + + "efPropertiesRequest\022\032\n\022reference_propert" + + "y\030\001 \001(\t\0222\n\nproperties\030\002 \001(\0132\036.weaviate.v" + + "1.PropertiesRequest\022.\n\010metadata\030\003 \001(\0132\034." + + "weaviate.v1.MetadataRequest\022\031\n\021target_co" + + "llection\030\004 \001(\t\"8\n\006Rerank\022\020\n\010property\030\001 \001" + + "(\t\022\022\n\005query\030\002 \001(\tH\000\210\001\001B\010\n\006_query\"\367\002\n\013Sea" + + "rchReply\022\014\n\004took\030\001 \001(\002\022*\n\007results\030\002 \003(\0132" + + "\031.weaviate.v1.SearchResult\022*\n\031generative" + + "_grouped_result\030\003 \001(\tB\002\030\001H\000\210\001\001\0224\n\020group_" + + "by_results\030\004 \003(\0132\032.weaviate.v1.GroupByRe" + + "sult\022F\n\032generative_grouped_results\030\005 \001(\013" + + "2\035.weaviate.v1.GenerativeResultH\001\210\001\001\0225\n\r" + + "query_profile\030\006 \001(\0132\031.weaviate.v1.QueryP" + + "rofileH\002\210\001\001B\034\n\032_generative_grouped_resul" + + "tB\035\n\033_generative_grouped_resultsB\020\n\016_que" + + "ry_profile\"\236\003\n\014QueryProfile\0226\n\006shards\030\001 " + + "\003(\0132&.weaviate.v1.QueryProfile.ShardProf" + + "ile\032\206\001\n\rSearchProfile\022E\n\007details\030\001 \003(\01324" + + ".weaviate.v1.QueryProfile.SearchProfile." + + "DetailsEntry\032.\n\014DetailsEntry\022\013\n\003key\030\001 \001(" + + "\t\022\r\n\005value\030\002 \001(\t:\0028\001\032\314\001\n\014ShardProfile\022\014\n" + + "\004name\030\001 \001(\t\022\014\n\004node\030\002 \001(\t\022F\n\010searches\030\003 " + + "\003(\01324.weaviate.v1.QueryProfile.ShardProf" + + "ile.SearchesEntry\032X\n\rSearchesEntry\022\013\n\003ke" + + "y\030\001 \001(\t\0226\n\005value\030\002 \001(\0132\'.weaviate.v1.Que" + + "ryProfile.SearchProfile:\0028\001\"\034\n\013RerankRep" + + "ly\022\r\n\005score\030\001 \001(\001\"\351\002\n\rGroupByResult\022\014\n\004n" + + "ame\030\001 \001(\t\022\024\n\014min_distance\030\002 \001(\002\022\024\n\014max_d" + + "istance\030\003 \001(\002\022\031\n\021number_of_objects\030\004 \001(\003" + + "\022*\n\007objects\030\005 \003(\0132\031.weaviate.v1.SearchRe" + + "sult\022-\n\006rerank\030\006 \001(\0132\030.weaviate.v1.Reran" + + "kReplyH\000\210\001\001\0229\n\ngenerative\030\007 \001(\0132\034.weavia" + + "te.v1.GenerativeReplyB\002\030\001H\001\210\001\001\022=\n\021genera" + + "tive_result\030\010 \001(\0132\035.weaviate.v1.Generati" + + "veResultH\002\210\001\001B\t\n\007_rerankB\r\n\013_generativeB" + + "\024\n\022_generative_result\"\267\001\n\014SearchResult\0221" + + "\n\nproperties\030\001 \001(\0132\035.weaviate.v1.Propert" + + "iesResult\022-\n\010metadata\030\002 \001(\0132\033.weaviate.v" + + "1.MetadataResult\0226\n\ngenerative\030\003 \001(\0132\035.w" + + "eaviate.v1.GenerativeResultH\000\210\001\001B\r\n\013_gen" + + "erative\"\367\004\n\016MetadataResult\022\n\n\002id\030\001 \001(\t\022\022" + + "\n\006vector\030\002 \003(\002B\002\030\001\022\032\n\022creation_time_unix" + + "\030\003 \001(\003\022\"\n\032creation_time_unix_present\030\004 \001" + + "(\010\022\035\n\025last_update_time_unix\030\005 \001(\003\022%\n\035las" + + "t_update_time_unix_present\030\006 \001(\010\022\020\n\010dist" + + "ance\030\007 \001(\002\022\030\n\020distance_present\030\010 \001(\010\022\021\n\t" + + "certainty\030\t \001(\002\022\031\n\021certainty_present\030\n \001" + + "(\010\022\r\n\005score\030\013 \001(\002\022\025\n\rscore_present\030\014 \001(\010" + + "\022\025\n\rexplain_score\030\r \001(\t\022\035\n\025explain_score" + + "_present\030\016 \001(\010\022\032\n\ris_consistent\030\017 \001(\010H\000\210" + + "\001\001\022\026\n\ngenerative\030\020 \001(\tB\002\030\001\022\036\n\022generative" + + "_present\030\021 \001(\010B\002\030\001\022\035\n\025is_consistent_pres" + + "ent\030\022 \001(\010\022\024\n\014vector_bytes\030\023 \001(\014\022\023\n\013id_as" + + "_bytes\030\024 \001(\014\022\024\n\014rerank_score\030\025 \001(\001\022\034\n\024re" + + "rank_score_present\030\026 \001(\010\022%\n\007vectors\030\027 \003(" + + "\0132\024.weaviate.v1.VectorsB\020\n\016_is_consisten" + + "t\"\210\002\n\020PropertiesResult\0223\n\tref_props\030\002 \003(" + + "\0132 .weaviate.v1.RefPropertiesResult\022\031\n\021t" + + "arget_collection\030\003 \001(\t\022-\n\010metadata\030\004 \001(\013" + + "2\033.weaviate.v1.MetadataResult\022.\n\rnon_ref" + + "_props\030\013 \001(\0132\027.weaviate.v1.Properties\022\033\n" + + "\023ref_props_requested\030\014 \001(\010J\004\010\001\020\002J\004\010\005\020\006J\004" + + "\010\006\020\007J\004\010\007\020\010J\004\010\010\020\tJ\004\010\t\020\nJ\004\010\n\020\013\"[\n\023RefPrope" + + "rtiesResult\0221\n\nproperties\030\001 \003(\0132\035.weavia" + + "te.v1.PropertiesResult\022\021\n\tprop_name\030\002 \001(" + + "\tBG\n-io.weaviate.client6.v1.internal.grp" + + "c.protocolB\026WeaviateProtoSearchGetb\006prot" + + "o3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -23277,7 +26351,7 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.RefP internal_static_weaviate_v1_MetadataRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_MetadataRequest_descriptor, - new java.lang.String[] { "Uuid", "Vector", "CreationTimeUnix", "LastUpdateTimeUnix", "Distance", "Certainty", "Score", "ExplainScore", "IsConsistent", "Vectors", }); + new java.lang.String[] { "Uuid", "Vector", "CreationTimeUnix", "LastUpdateTimeUnix", "Distance", "Certainty", "Score", "ExplainScore", "IsConsistent", "Vectors", "QueryProfile", }); internal_static_weaviate_v1_PropertiesRequest_descriptor = getDescriptor().getMessageTypes().get(4); internal_static_weaviate_v1_PropertiesRequest_fieldAccessorTable = new @@ -23307,39 +26381,69 @@ public io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoSearchGet.RefP internal_static_weaviate_v1_SearchReply_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_SearchReply_descriptor, - new java.lang.String[] { "Took", "Results", "GenerativeGroupedResult", "GroupByResults", "GenerativeGroupedResults", "GenerativeGroupedResult", "GenerativeGroupedResults", }); - internal_static_weaviate_v1_RerankReply_descriptor = + new java.lang.String[] { "Took", "Results", "GenerativeGroupedResult", "GroupByResults", "GenerativeGroupedResults", "QueryProfile", "GenerativeGroupedResult", "GenerativeGroupedResults", "QueryProfile", }); + internal_static_weaviate_v1_QueryProfile_descriptor = getDescriptor().getMessageTypes().get(9); + internal_static_weaviate_v1_QueryProfile_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_weaviate_v1_QueryProfile_descriptor, + new java.lang.String[] { "Shards", }); + internal_static_weaviate_v1_QueryProfile_SearchProfile_descriptor = + internal_static_weaviate_v1_QueryProfile_descriptor.getNestedTypes().get(0); + internal_static_weaviate_v1_QueryProfile_SearchProfile_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_weaviate_v1_QueryProfile_SearchProfile_descriptor, + new java.lang.String[] { "Details", }); + internal_static_weaviate_v1_QueryProfile_SearchProfile_DetailsEntry_descriptor = + internal_static_weaviate_v1_QueryProfile_SearchProfile_descriptor.getNestedTypes().get(0); + internal_static_weaviate_v1_QueryProfile_SearchProfile_DetailsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_weaviate_v1_QueryProfile_SearchProfile_DetailsEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_weaviate_v1_QueryProfile_ShardProfile_descriptor = + internal_static_weaviate_v1_QueryProfile_descriptor.getNestedTypes().get(1); + internal_static_weaviate_v1_QueryProfile_ShardProfile_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_weaviate_v1_QueryProfile_ShardProfile_descriptor, + new java.lang.String[] { "Name", "Node", "Searches", }); + internal_static_weaviate_v1_QueryProfile_ShardProfile_SearchesEntry_descriptor = + internal_static_weaviate_v1_QueryProfile_ShardProfile_descriptor.getNestedTypes().get(0); + internal_static_weaviate_v1_QueryProfile_ShardProfile_SearchesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_weaviate_v1_QueryProfile_ShardProfile_SearchesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_weaviate_v1_RerankReply_descriptor = + getDescriptor().getMessageTypes().get(10); internal_static_weaviate_v1_RerankReply_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_RerankReply_descriptor, new java.lang.String[] { "Score", }); internal_static_weaviate_v1_GroupByResult_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(11); internal_static_weaviate_v1_GroupByResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_GroupByResult_descriptor, new java.lang.String[] { "Name", "MinDistance", "MaxDistance", "NumberOfObjects", "Objects", "Rerank", "Generative", "GenerativeResult", "Rerank", "Generative", "GenerativeResult", }); internal_static_weaviate_v1_SearchResult_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(12); internal_static_weaviate_v1_SearchResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_SearchResult_descriptor, new java.lang.String[] { "Properties", "Metadata", "Generative", "Generative", }); internal_static_weaviate_v1_MetadataResult_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(13); internal_static_weaviate_v1_MetadataResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_MetadataResult_descriptor, new java.lang.String[] { "Id", "Vector", "CreationTimeUnix", "CreationTimeUnixPresent", "LastUpdateTimeUnix", "LastUpdateTimeUnixPresent", "Distance", "DistancePresent", "Certainty", "CertaintyPresent", "Score", "ScorePresent", "ExplainScore", "ExplainScorePresent", "IsConsistent", "Generative", "GenerativePresent", "IsConsistentPresent", "VectorBytes", "IdAsBytes", "RerankScore", "RerankScorePresent", "Vectors", "IsConsistent", }); internal_static_weaviate_v1_PropertiesResult_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(14); internal_static_weaviate_v1_PropertiesResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_PropertiesResult_descriptor, new java.lang.String[] { "RefProps", "TargetCollection", "Metadata", "NonRefProps", "RefPropsRequested", }); internal_static_weaviate_v1_RefPropertiesResult_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(15); internal_static_weaviate_v1_RefPropertiesResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_weaviate_v1_RefPropertiesResult_descriptor, diff --git a/src/main/java/io/weaviate/client6/v1/internal/oidc/OidcConfig.java b/src/main/java/io/weaviate/client6/v1/internal/oidc/OidcConfig.java index 858fd4d82..75e22a4a6 100644 --- a/src/main/java/io/weaviate/client6/v1/internal/oidc/OidcConfig.java +++ b/src/main/java/io/weaviate/client6/v1/internal/oidc/OidcConfig.java @@ -1,5 +1,7 @@ package io.weaviate.client6.v1.internal.oidc; +import io.weaviate.client6.v1.internal.Proxy; + import java.util.Arrays; import java.util.Collections; import java.util.HashSet; @@ -11,16 +13,26 @@ public record OidcConfig( String clientId, String providerMetadata, - Set scopes) { + Set scopes, + Proxy proxy) { - public OidcConfig(String clientId, String providerMetadata, Set scopes) { + public OidcConfig(String clientId, String providerMetadata, Set scopes, Proxy proxy) { this.clientId = clientId; this.providerMetadata = providerMetadata; this.scopes = scopes != null ? Set.copyOf(scopes) : Collections.emptySet(); + this.proxy = proxy; + } + + public OidcConfig(String clientId, String providerMetadata, Set scopes) { + this(clientId, providerMetadata, scopes, null); } public OidcConfig(String clientId, String providerMetadata, List scopes) { - this(clientId, providerMetadata, scopes == null ? null : new HashSet<>(scopes)); + this(clientId, providerMetadata, scopes == null ? null : new HashSet<>(scopes), null); + } + + public OidcConfig(String clientId, String providerMetadata, List scopes, Proxy proxy) { + this(clientId, providerMetadata, scopes == null ? null : new HashSet<>(scopes), proxy); } /** Create a new OIDC config with extended scopes. */ @@ -31,6 +43,6 @@ public OidcConfig withScopes(String... scopes) { /** Create a new OIDC config with extended scopes. */ public OidcConfig withScopes(List scopes) { var newScopes = Stream.concat(this.scopes.stream(), scopes.stream()).collect(Collectors.toSet()); - return new OidcConfig(clientId, providerMetadata, newScopes); + return new OidcConfig(clientId, providerMetadata, newScopes, proxy); } } diff --git a/src/main/java/io/weaviate/client6/v1/internal/oidc/OidcUtils.java b/src/main/java/io/weaviate/client6/v1/internal/oidc/OidcUtils.java index cafcc1289..027ea60c5 100644 --- a/src/main/java/io/weaviate/client6/v1/internal/oidc/OidcUtils.java +++ b/src/main/java/io/weaviate/client6/v1/internal/oidc/OidcUtils.java @@ -1,17 +1,16 @@ package io.weaviate.client6.v1.internal.oidc; -import java.io.IOException; -import java.util.Collections; -import java.util.List; - import com.google.gson.annotations.SerializedName; - import io.weaviate.client6.v1.api.WeaviateOAuthException; import io.weaviate.client6.v1.internal.rest.Endpoint; import io.weaviate.client6.v1.internal.rest.ExternalEndpoint; import io.weaviate.client6.v1.internal.rest.RestTransport; import io.weaviate.client6.v1.internal.rest.SimpleEndpoint; +import java.io.IOException; +import java.util.Collections; +import java.util.List; + public final class OidcUtils { /** Prevents public initialization. */ private OidcUtils() { @@ -28,7 +27,7 @@ private OidcUtils() { private static final Endpoint GET_PROVIDER_METADATA_ENDPOINT = new ExternalEndpoint<>( request -> "GET", request -> request, // URL is the request body. - requesf -> Collections.emptyMap(), + request -> Collections.emptyMap(), request -> null, (__, response) -> response); @@ -54,6 +53,6 @@ public static final OidcConfig getConfig(RestTransport transport) { throw new WeaviateOAuthException("fetch provider metadata", e); } - return new OidcConfig(openid.clientId(), providerMetadata, openid.scopes()); + return new OidcConfig(openid.clientId(), providerMetadata, openid.scopes(), transport.getProxy()); } } diff --git a/src/main/java/io/weaviate/client6/v1/internal/oidc/nimbus/Flow.java b/src/main/java/io/weaviate/client6/v1/internal/oidc/nimbus/Flow.java index ad12561ff..4d0c3c32f 100644 --- a/src/main/java/io/weaviate/client6/v1/internal/oidc/nimbus/Flow.java +++ b/src/main/java/io/weaviate/client6/v1/internal/oidc/nimbus/Flow.java @@ -27,6 +27,21 @@ static Flow resourceOwnerPassword(String username, String password) { return () -> grant; // Reuse cached authorization grant } + static Flow resourceOwnerPasswordCredentials(String clientId, String clientSecret, String username, String password) { + return new Flow() { + private final AuthorizationGrant GRANT = new ResourceOwnerPasswordCredentialsGrant(username, new Secret(password)); + @Override + public AuthorizationGrant getAuthorizationGrant() { + return GRANT; + } + + @Override + public ClientAuthentication getClientAuthentication() { + return new ClientSecretPost(new ClientID(clientId), new Secret(clientSecret)); + } + }; + } + static Flow clientCredentials(String clientId, String clientSecret) { return new Flow() { private static final AuthorizationGrant GRANT = new ClientCredentialsGrant(); diff --git a/src/main/java/io/weaviate/client6/v1/internal/oidc/nimbus/NimbusTokenProvider.java b/src/main/java/io/weaviate/client6/v1/internal/oidc/nimbus/NimbusTokenProvider.java index 4bef50e71..5c240e4f2 100644 --- a/src/main/java/io/weaviate/client6/v1/internal/oidc/nimbus/NimbusTokenProvider.java +++ b/src/main/java/io/weaviate/client6/v1/internal/oidc/nimbus/NimbusTokenProvider.java @@ -1,6 +1,7 @@ package io.weaviate.client6.v1.internal.oidc.nimbus; import java.io.IOException; +import java.net.Proxy; import javax.annotation.concurrent.NotThreadSafe; @@ -8,7 +9,7 @@ import com.nimbusds.oauth2.sdk.Scope; import com.nimbusds.oauth2.sdk.TokenRequest; import com.nimbusds.oauth2.sdk.id.ClientID; -import com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata; +import com.nimbusds.oauth2.sdk.as.AuthorizationServerMetadata; import com.nimbusds.openid.connect.sdk.token.OIDCTokens; import io.weaviate.client6.v1.api.WeaviateOAuthException; @@ -17,10 +18,11 @@ @NotThreadSafe public final class NimbusTokenProvider implements TokenProvider { - private final OIDCProviderMetadata metadata; + private final AuthorizationServerMetadata metadata; private final ClientID clientId; private final Scope scope; private final Flow flow; + private Proxy proxy; /** * Create a TokenProvider that uses Refresh Token authorization grant. @@ -51,6 +53,23 @@ public static NimbusTokenProvider resourceOwnerPassword(OidcConfig oidc, String return new NimbusTokenProvider(oidc, Flow.resourceOwnerPassword(username, password)); } + /** + * Create a TokenProvider that uses Resource Owner Password Credentials authorization grant. + * + * @param oidc OIDC config. + * @param clientSecret Client secret. + * @param username Resource owner username. + * @param password Resource owner password. + * + * @return A new instance of NimbusTokenProvider. Instances are never cached. + * @throws WeaviateOAuthException if an error occured at any point of the + * exchange process. + */ + public static NimbusTokenProvider resouceOwnerPasswordCredentials(OidcConfig oidc, String clientSecret, String username, + String password) { + return new NimbusTokenProvider(oidc, Flow.resourceOwnerPasswordCredentials(oidc.clientId(), clientSecret, username, password)); + } + /** * Create a TokenProvider that uses Client Credentials authorization grant. * @@ -70,6 +89,10 @@ private NimbusTokenProvider(OidcConfig oidc, Flow flow) { this.clientId = new ClientID(oidc.clientId()); this.scope = new Scope(oidc.scopes().toArray(String[]::new)); this.flow = flow; + var proxy = oidc.proxy(); + if (proxy != null) { + this.proxy = new java.net.Proxy(java.net.Proxy.Type.HTTP, new java.net.InetSocketAddress(proxy.host(), proxy.port())); + } } @Override @@ -83,6 +106,10 @@ public Token getToken() { : new TokenRequest(uri, clientAuth, grant, scope); var request = tokenRequest.toHTTPRequest(); + if (proxy != null) { + request.setProxy(proxy); + } + OIDCTokens tokens; try { var response = request.send(); @@ -116,9 +143,9 @@ public static ProviderMetadata parseProviderMetadata(String providerMetadata) { return new ProviderMetadata(metadata.getTokenEndpointURI()); } - private static OIDCProviderMetadata _parseProviderMetadata(String providerMetadata) { + private static AuthorizationServerMetadata _parseProviderMetadata(String providerMetadata) { try { - return OIDCProviderMetadata.parse(providerMetadata); + return AuthorizationServerMetadata.parse(providerMetadata); } catch (ParseException ex) { throw new WeaviateOAuthException("parse provider metadata: ", ex); } diff --git a/src/main/java/io/weaviate/client6/v1/internal/rest/DefaultRestTransport.java b/src/main/java/io/weaviate/client6/v1/internal/rest/DefaultRestTransport.java index a77d9da29..b80880841 100644 --- a/src/main/java/io/weaviate/client6/v1/internal/rest/DefaultRestTransport.java +++ b/src/main/java/io/weaviate/client6/v1/internal/rest/DefaultRestTransport.java @@ -8,6 +8,7 @@ import javax.net.ssl.SSLContext; +import org.apache.hc.core5.http.HttpHost; import org.apache.hc.client5.http.async.methods.SimpleHttpRequest; import org.apache.hc.client5.http.async.methods.SimpleHttpResponse; import org.apache.hc.client5.http.config.RequestConfig; @@ -31,6 +32,7 @@ import io.weaviate.client6.v1.api.WeaviateApiException; import io.weaviate.client6.v1.api.WeaviateTransportException; +import io.weaviate.client6.v1.internal.Proxy; public class DefaultRestTransport implements RestTransport { private final CloseableHttpClient httpClient; @@ -43,9 +45,9 @@ public DefaultRestTransport(RestTransportOptions transportOptions) { this.transportOptions = transportOptions; // TODO: doesn't make sense to spin up both? - var httpClient = HttpClients.custom() + var httpClient = HttpClients.custom().useSystemProperties() .setDefaultHeaders(transportOptions.headers()); - var httpClientAsync = HttpAsyncClients.custom() + var httpClientAsync = HttpAsyncClients.custom().useSystemProperties() .setDefaultHeaders(transportOptions.headers()); // Apply custom SSL context @@ -68,6 +70,13 @@ public DefaultRestTransport(RestTransportOptions transportOptions) { httpClientAsync.setConnectionManager(asyncManager); } + if (transportOptions.proxy() != null) { + Proxy proxy = transportOptions.proxy(); + HttpHost proxyHost = new HttpHost(proxy.scheme(), proxy.host(), proxy.port()); + httpClient.setProxy(proxyHost); + httpClientAsync.setProxy(proxyHost); + } + if (transportOptions.timeout() != null) { var config = RequestConfig.custom() .setResponseTimeout(transportOptions.timeout().querySeconds(), TimeUnit.SECONDS) @@ -111,8 +120,6 @@ private ClassicHttpRequest prepareClassicRequest(RequestT if (body != null) { req.setEntity(body, ContentType.APPLICATION_JSON); } - if (true) { - } return req.build(); } @@ -196,6 +203,10 @@ private ResponseT _handleResponse(Endpoint endpoint, S throw new WeaviateTransportException("Unhandled endpoint type " + endpoint.getClass().getSimpleName()); } + public Proxy getProxy() { + return transportOptions.proxy(); + } + @Override public void close() throws Exception { httpClient.close(); diff --git a/src/main/java/io/weaviate/client6/v1/internal/rest/RestTransport.java b/src/main/java/io/weaviate/client6/v1/internal/rest/RestTransport.java index da26c9f12..62f20871c 100644 --- a/src/main/java/io/weaviate/client6/v1/internal/rest/RestTransport.java +++ b/src/main/java/io/weaviate/client6/v1/internal/rest/RestTransport.java @@ -3,6 +3,8 @@ import java.io.IOException; import java.util.concurrent.CompletableFuture; +import io.weaviate.client6.v1.internal.Proxy; + public interface RestTransport extends AutoCloseable { ResponseT performRequest(RequestT request, Endpoint endpoint) @@ -10,4 +12,6 @@ ResponseT performRequest(RequestT request, CompletableFuture performRequestAsync(RequestT request, Endpoint endpoint); + + Proxy getProxy(); } diff --git a/src/main/java/io/weaviate/client6/v1/internal/rest/RestTransportOptions.java b/src/main/java/io/weaviate/client6/v1/internal/rest/RestTransportOptions.java index 5da4cdd5f..4635a9368 100644 --- a/src/main/java/io/weaviate/client6/v1/internal/rest/RestTransportOptions.java +++ b/src/main/java/io/weaviate/client6/v1/internal/rest/RestTransportOptions.java @@ -8,6 +8,7 @@ import org.apache.hc.core5.http.message.BasicHeader; +import io.weaviate.client6.v1.internal.Proxy; import io.weaviate.client6.v1.internal.Timeout; import io.weaviate.client6.v1.internal.TokenProvider; import io.weaviate.client6.v1.internal.TransportOptions; @@ -16,17 +17,21 @@ public final class RestTransportOptions extends TransportOptions headers, - TokenProvider tokenProvider, TrustManagerFactory trust, Timeout timeout) { - super(scheme, host, port, buildHeaders(headers), tokenProvider, trust, timeout); + TokenProvider tokenProvider, TrustManagerFactory trust, Timeout timeout, Proxy proxy) { + super(scheme, host, port, buildHeaders(headers), tokenProvider, trust, timeout, proxy); } private RestTransportOptions(String scheme, String host, int port, Collection headers, - TokenProvider tokenProvider, TrustManagerFactory trust, Timeout timeout) { - super(scheme, host, port, headers, tokenProvider, trust, timeout); + TokenProvider tokenProvider, TrustManagerFactory trust, Timeout timeout, Proxy proxy) { + super(scheme, host, port, headers, tokenProvider, trust, timeout, proxy); + } + + public RestTransportOptions(String http, String localhost, Integer localPort, Map headers, Object tokenProvider, Object trust, Timeout timeout) { + super(http, localhost, localPort, buildHeaders(headers), (TokenProvider) tokenProvider, (TrustManagerFactory) trust, timeout, null); } public final RestTransportOptions withTimeout(Timeout timeout) { - return new RestTransportOptions(scheme, host, port, headers, tokenProvider, trustManagerFactory, timeout); + return new RestTransportOptions(scheme, host, port, headers, tokenProvider, trustManagerFactory, timeout, proxy); } private static final Collection buildHeaders(Map headers) { diff --git a/src/main/proto/v1/base_search.proto b/src/main/proto/v1/base_search.proto index f1b241b91..b4399050d 100644 --- a/src/main/proto/v1/base_search.proto +++ b/src/main/proto/v1/base_search.proto @@ -30,11 +30,20 @@ message Targets { message VectorForTarget { string name = 1; - bytes vector_bytes = 2 - [ deprecated = true ]; // deprecated in 1.29.0 - use vectors + bytes vector_bytes = 2 [deprecated = true]; // deprecated in 1.29.0 - use vectors repeated Vectors vectors = 3; } +message Selection { + message MMR { + optional uint32 limit = 1; + optional float balance = 2; + } + oneof selection { + MMR mmr = 1; + } +} + message SearchOperatorOptions { enum Operator { OPERATOR_UNSPECIFIED = 0; @@ -49,56 +58,55 @@ message Hybrid { string query = 1; repeated string properties = 2; // protolint:disable:next REPEATED_FIELD_NAMES_PLURALIZED - repeated float vector = 3 - [ deprecated = true ]; // will be removed in the future, use vectors - float alpha = 4; + repeated float vector = 3 [deprecated = true]; // will be removed in the future, use vectors + float alpha = 4 [deprecated = true]; // deprecated in 1.36.0 - use alpha_param enum FusionType { FUSION_TYPE_UNSPECIFIED = 0; FUSION_TYPE_RANKED = 1; FUSION_TYPE_RELATIVE_SCORE = 2; } FusionType fusion_type = 5; - bytes vector_bytes = 6 - [ deprecated = true ]; // deprecated in 1.29.0 - use vectors - repeated string target_vectors = 7 - [ deprecated = true ]; // deprecated in 1.26 - use targets - NearTextSearch near_text = - 8; // targets in msg is ignored and should not be set for hybrid - NearVector near_vector = - 9; // same as above. Use the target vector in the hybrid message + bytes vector_bytes = 6 [deprecated = true]; // deprecated in 1.29.0 - use vectors + repeated string target_vectors = 7 [deprecated = true]; // deprecated in 1.26 - use targets + NearTextSearch near_text = 8; // targets in msg is ignored and should not be set for hybrid + NearVector near_vector = 9; // same as above. Use the target vector in the hybrid message Targets targets = 10; optional SearchOperatorOptions bm25_search_operator = 11; + optional float alpha_param = 12; + // if true, alpha_param is used instead of alpha. + // This is for backward compatibility, as alpha was used before alpha_param was introduced. + bool use_alpha_param = 13; + optional Selection selection = 14; // only vector distance, but keep it extendable - oneof threshold { float vector_distance = 20; }; + oneof threshold { + float vector_distance = 20; + }; repeated Vectors vectors = 21; } message NearVector { // protolint:disable:next REPEATED_FIELD_NAMES_PLURALIZED - repeated float vector = 1 - [ deprecated = true ]; // will be removed in the future, use vectors + repeated float vector = 1 [deprecated = true]; // will be removed in the future, use vectors optional double certainty = 2; optional double distance = 3; - bytes vector_bytes = 4 - [ deprecated = true ]; // deprecated in 1.29.0 - use vectors - repeated string target_vectors = 5 - [ deprecated = true ]; // deprecated in 1.26 - use targets + bytes vector_bytes = 4 [deprecated = true]; // deprecated in 1.29.0 - use vectors + repeated string target_vectors = 5 [deprecated = true]; // deprecated in 1.26 - use targets Targets targets = 6; - map vector_per_target = 7 - [ deprecated = true ]; // deprecated in 1.26.2 - use vector_for_targets + map vector_per_target = 7 [deprecated = true]; // deprecated in 1.26.2 - use vector_for_targets repeated VectorForTarget vector_for_targets = 8; repeated Vectors vectors = 9; + optional Selection selection = 10; } message NearObject { string id = 1; optional double certainty = 2; optional double distance = 3; - repeated string target_vectors = 4 - [ deprecated = true ]; // deprecated in 1.26 - use targets + repeated string target_vectors = 4 [deprecated = true]; // deprecated in 1.26 - use targets Targets targets = 5; + optional Selection selection = 6; } message NearTextSearch { @@ -114,63 +122,63 @@ message NearTextSearch { optional double distance = 3; optional Move move_to = 4; optional Move move_away = 5; - repeated string target_vectors = 6 - [ deprecated = true ]; // deprecated in 1.26 - use targets + repeated string target_vectors = 6 [deprecated = true]; // deprecated in 1.26 - use targets Targets targets = 7; + optional Selection selection = 8; }; message NearImageSearch { string image = 1; optional double certainty = 2; optional double distance = 3; - repeated string target_vectors = 4 - [ deprecated = true ]; // deprecated in 1.26 - use targets + repeated string target_vectors = 4 [deprecated = true]; // deprecated in 1.26 - use targets Targets targets = 5; + optional Selection selection = 6; }; message NearAudioSearch { string audio = 1; optional double certainty = 2; optional double distance = 3; - repeated string target_vectors = 4 - [ deprecated = true ]; // deprecated in 1.26 - use targets + repeated string target_vectors = 4 [deprecated = true]; // deprecated in 1.26 - use targets Targets targets = 5; + optional Selection selection = 6; }; message NearVideoSearch { string video = 1; optional double certainty = 2; optional double distance = 3; - repeated string target_vectors = 4 - [ deprecated = true ]; // deprecated in 1.26 - use targets + repeated string target_vectors = 4 [deprecated = true]; // deprecated in 1.26 - use targets Targets targets = 5; + optional Selection selection = 6; }; message NearDepthSearch { string depth = 1; optional double certainty = 2; optional double distance = 3; - repeated string target_vectors = 4 - [ deprecated = true ]; // deprecated in 1.26 - use targets + repeated string target_vectors = 4 [deprecated = true]; // deprecated in 1.26 - use targets Targets targets = 5; + optional Selection selection = 6; } message NearThermalSearch { string thermal = 1; optional double certainty = 2; optional double distance = 3; - repeated string target_vectors = 4 - [ deprecated = true ]; // deprecated in 1.26 - use targets + repeated string target_vectors = 4 [deprecated = true]; // deprecated in 1.26 - use targets Targets targets = 5; + optional Selection selection = 6; } message NearIMUSearch { string imu = 1; optional double certainty = 2; optional double distance = 3; - repeated string target_vectors = 4 - [ deprecated = true ]; // deprecated in 1.26 - use targets + repeated string target_vectors = 4 [deprecated = true]; // deprecated in 1.26 - use targets Targets targets = 5; + optional Selection selection = 6; } message BM25 { diff --git a/src/main/proto/v1/batch.proto b/src/main/proto/v1/batch.proto index 282ad7bc8..d5aee84cb 100644 --- a/src/main/proto/v1/batch.proto +++ b/src/main/proto/v1/batch.proto @@ -46,11 +46,12 @@ message BatchStreamReply { } message ShuttingDown { } - message Shutdown { - } message OutOfMemory{ repeated string uuids = 1; repeated string beacons = 2; + // How long to wait until ShuttingDown is sent, in seconds + // If ShuttingDown is not set by this time, the client should exit the stream + int32 wait_time = 3; } message Backoff { int32 batch_size = 1; @@ -79,12 +80,13 @@ message BatchStreamReply { oneof message { Results results = 1; ShuttingDown shutting_down = 2; - Shutdown shutdown = 3; Started started = 4; Backoff backoff = 5; Acks acks = 6; OutOfMemory out_of_memory = 7; } + reserved 3; // was shutdown + reserved "shutdown"; } message BatchObject { diff --git a/src/main/proto/v1/generative.proto b/src/main/proto/v1/generative.proto index fb3deda67..2ef04e788 100644 --- a/src/main/proto/v1/generative.proto +++ b/src/main/proto/v1/generative.proto @@ -23,9 +23,9 @@ message GenerativeSearch { bool debug = 4; } - string single_response_prompt = 1 [ deprecated = true ]; - string grouped_response_task = 2 [ deprecated = true ]; - repeated string grouped_properties = 3 [ deprecated = true ]; + string single_response_prompt = 1 [deprecated = true]; + string grouped_response_task = 2 [deprecated = true]; + repeated string grouped_properties = 3 [deprecated = true]; Single single = 4; Grouped grouped = 5; } @@ -46,10 +46,11 @@ message GenerativeProvider { GenerativeFriendliAI friendliai = 12; GenerativeNvidia nvidia = 13; GenerativeXAI xai = 14; + GenerativeContextualAI contextualai = 15; } } -message GenerativeAnthropic { +message GenerativeAnthropic{ optional string base_url = 1; optional int64 max_tokens = 2; optional string model = 3; @@ -61,13 +62,13 @@ message GenerativeAnthropic { optional TextArray image_properties = 9; } -message GenerativeAnyscale { +message GenerativeAnyscale{ optional string base_url = 1; optional string model = 2; optional double temperature = 3; } -message GenerativeAWS { +message GenerativeAWS{ optional string model = 3; optional double temperature = 8; optional string service = 9; @@ -77,9 +78,11 @@ message GenerativeAWS { optional string target_variant = 13; optional TextArray images = 14; optional TextArray image_properties = 15; + optional int64 max_tokens = 16; + optional TextArray stop_sequences = 17; } -message GenerativeCohere { +message GenerativeCohere{ optional string base_url = 1; optional double frequency_penalty = 2; optional int64 max_tokens = 3; @@ -89,11 +92,14 @@ message GenerativeCohere { optional double presence_penalty = 7; optional TextArray stop_sequences = 8; optional double temperature = 9; + optional TextArray images = 10; + optional TextArray image_properties = 11; } -message GenerativeDummy {} +message GenerativeDummy{ +} -message GenerativeMistral { +message GenerativeMistral{ optional string base_url = 1; optional int64 max_tokens = 2; optional string model = 3; @@ -101,7 +107,7 @@ message GenerativeMistral { optional double top_p = 5; } -message GenerativeOllama { +message GenerativeOllama{ optional string api_endpoint = 1; optional string model = 2; optional double temperature = 3; @@ -109,7 +115,20 @@ message GenerativeOllama { optional TextArray image_properties = 5; } -message GenerativeOpenAI { +message GenerativeOpenAI{ + enum ReasoningEffort { + REASONING_EFFORT_UNSPECIFIED = 0; + REASONING_EFFORT_MINIMAL = 1; + REASONING_EFFORT_LOW = 2; + REASONING_EFFORT_MEDIUM = 3; + REASONING_EFFORT_HIGH = 4; + } + enum Verbosity { + VERBOSITY_UNSPECIFIED = 0; + VERBOSITY_LOW = 1; + VERBOSITY_MEDIUM = 2; + VERBOSITY_HIGH = 3; + } optional double frequency_penalty = 1; optional int64 max_tokens = 2; optional string model = 3; @@ -125,9 +144,11 @@ message GenerativeOpenAI { optional bool is_azure = 13; optional TextArray images = 14; optional TextArray image_properties = 15; + optional ReasoningEffort reasoning_effort = 16; + optional Verbosity verbosity = 17; } -message GenerativeGoogle { +message GenerativeGoogle{ optional double frequency_penalty = 1; optional int64 max_tokens = 2; optional string model = 3; @@ -144,7 +165,7 @@ message GenerativeGoogle { optional TextArray image_properties = 14; } -message GenerativeDatabricks { +message GenerativeDatabricks{ optional string endpoint = 1; optional string model = 2; optional double frequency_penalty = 3; @@ -158,7 +179,7 @@ message GenerativeDatabricks { optional double top_p = 11; } -message GenerativeFriendliAI { +message GenerativeFriendliAI{ optional string base_url = 1; optional string model = 2; optional int64 max_tokens = 3; @@ -167,7 +188,7 @@ message GenerativeFriendliAI { optional double top_p = 6; } -message GenerativeNvidia { +message GenerativeNvidia{ optional string base_url = 1; optional string model = 2; optional double temperature = 3; @@ -175,7 +196,7 @@ message GenerativeNvidia { optional int64 max_tokens = 5; } -message GenerativeXAI { +message GenerativeXAI{ optional string base_url = 1; optional string model = 2; optional double temperature = 3; @@ -185,6 +206,16 @@ message GenerativeXAI { optional TextArray image_properties = 7; } +message GenerativeContextualAI{ + optional string model = 1; + optional double temperature = 2; + optional double top_p = 3; + optional int64 max_new_tokens = 4; + optional string system_prompt = 5; + optional bool avoid_commentary = 6; + optional TextArray knowledge = 7; +} + message GenerativeAnthropicMetadata { message Usage { int64 input_tokens = 1; @@ -193,9 +224,11 @@ message GenerativeAnthropicMetadata { Usage usage = 1; } -message GenerativeAnyscaleMetadata {} +message GenerativeAnyscaleMetadata { +} -message GenerativeAWSMetadata {} +message GenerativeAWSMetadata { +} message GenerativeCohereMetadata { message ApiVersion { @@ -219,7 +252,8 @@ message GenerativeCohereMetadata { optional TextArray warnings = 4; } -message GenerativeDummyMetadata {} +message GenerativeDummyMetadata { +} message GenerativeMistralMetadata { message Usage { @@ -230,7 +264,8 @@ message GenerativeMistralMetadata { optional Usage usage = 1; } -message GenerativeOllamaMetadata {} +message GenerativeOllamaMetadata { +} message GenerativeOpenAIMetadata { message Usage { @@ -250,7 +285,9 @@ message GenerativeGoogleMetadata { optional TokenCount input_token_count = 1; optional TokenCount output_token_count = 2; } - message Metadata { optional TokenMetadata token_metadata = 1; } + message Metadata { + optional TokenMetadata token_metadata = 1; + } message UsageMetadata { optional int64 prompt_token_count = 1; optional int64 candidates_token_count = 2; @@ -320,6 +357,10 @@ message GenerativeReply { optional GenerativeMetadata metadata = 3; } -message GenerativeResult { repeated GenerativeReply values = 1; } +message GenerativeResult { + repeated GenerativeReply values = 1; +} -message GenerativeDebug { optional string full_prompt = 1; } +message GenerativeDebug { + optional string full_prompt = 1; +} diff --git a/src/main/proto/v1/search_get.proto b/src/main/proto/v1/search_get.proto index e3ac192b0..45b9c928d 100644 --- a/src/main/proto/v1/search_get.proto +++ b/src/main/proto/v1/search_get.proto @@ -50,7 +50,7 @@ message SearchRequest { bool uses_123_api = 100 [deprecated = true]; bool uses_125_api = 101 [deprecated = true]; - bool uses_127_api = 102; + bool uses_127_api = 102; } message GroupBy { @@ -82,6 +82,9 @@ message MetadataRequest { bool explain_score = 8; bool is_consistent = 9; repeated string vectors = 10; + // query_profile enables per-shard query profiling. When true, the response includes + // timing breakdowns for each shard and search type. + bool query_profile = 11; } message PropertiesRequest { @@ -115,6 +118,29 @@ message SearchReply { optional string generative_grouped_result = 3 [deprecated = true]; repeated GroupByResult group_by_results = 4; optional GenerativeResult generative_grouped_results = 5; + optional QueryProfile query_profile = 6; +} + +// QueryProfile contains per-shard profiling data for a search query. +// Only populated when MetadataRequest.profile is true. +message QueryProfile { + // SearchProfile holds the profiling details for a single search type within a shard. + message SearchProfile { + // details contains human-readable profiling metrics keyed by metric name. + map details = 1; + } + + // ShardProfile holds profiling data for a single shard's contribution to a search query. + message ShardProfile { + // name is the identifier of the shard that was searched. + string name = 1; + // node is the name of the cluster node that executed this shard search. + string node = 2; + // searches maps search type (e.g., "vector", "keyword") to its profiling details. + map searches = 3; + } + + repeated ShardProfile shards = 1; } message RerankReply { diff --git a/src/test/java/io/weaviate/client6/v1/api/AuthenticationTest.java b/src/test/java/io/weaviate/client6/v1/api/AuthenticationTest.java index 54472875e..124789280 100644 --- a/src/test/java/io/weaviate/client6/v1/api/AuthenticationTest.java +++ b/src/test/java/io/weaviate/client6/v1/api/AuthenticationTest.java @@ -60,6 +60,81 @@ public void testAuthentication_apiKey() throws Exception { .withHeader("Authorization", "Bearer my-api-key")); } + @Test + public void testAuthentication_resourceOwnerPasswordWithClientSecret() throws Exception { + // 1. Mock /.well-known/openid-configuration + mockServer.when( + HttpRequest.request() + .withMethod("GET") + .withPath("/v1/.well-known/openid-configuration") + ).respond( + org.mockserver.model.HttpResponse.response() + .withStatusCode(200) + .withHeader("Content-Type", "application/json") + .withBody("{\"clientId\": \"my-client-id\", \"href\": \"http://localhost:" + mockServer.getLocalPort() + "/oidc-provider\"}") + ); + + // 2. Mock OIDC provider metadata + mockServer.when( + HttpRequest.request() + .withMethod("GET") + .withPath("/oidc-provider") + ).respond( + org.mockserver.model.HttpResponse.response() + .withStatusCode(200) + .withHeader("Content-Type", "application/json") + .withBody("{\"issuer\": \"http://localhost:" + mockServer.getLocalPort() + "\", \"token_endpoint\": \"http://localhost:" + mockServer.getLocalPort() + "/token\"}") + ); + + // 3. Mock Token Endpoint + mockServer.when( + HttpRequest.request() + .withMethod("POST") + .withPath("/token") + ).respond( + org.mockserver.model.HttpResponse.response() + .withStatusCode(200) + .withHeader("Content-Type", "application/json") + .withBody("{\"access_token\": \"secret-token\", \"token_type\": \"Bearer\", \"expires_in\": 3600}") + ); + + var authz = Authentication.resourceOwnerPasswordCredentials("my-client-secret", "my-user", "my-pass", Collections.emptyList()); + var transportOptions = new RestTransportOptions( + "http", "localhost", mockServer.getLocalPort(), + Collections.emptyMap(), authz.getTokenProvider(noAuthTransport), null, new Timeout()); + + try (final var restClient = new DefaultRestTransport(transportOptions)) { + restClient.performRequest(null, SimpleEndpoint.sideEffect( + request -> "GET", request -> "/", request -> null)); + } catch (WeaviateApiException ex) { + if (ex.httpStatusCode() != 404) { + Assertions.fail("unexpected error", ex); + } + } + + // Verify token request had both password grant and client authentication + mockServer.verify( + HttpRequest.request() + .withMethod("POST") + .withPath("/token") + .withBody(org.mockserver.model.ParameterBody.params( + org.mockserver.model.Parameter.param("grant_type", "password"), + org.mockserver.model.Parameter.param("username", "my-user"), + org.mockserver.model.Parameter.param("password", "my-pass"), + org.mockserver.model.Parameter.param("client_id", "my-client-id"), + org.mockserver.model.Parameter.param("client_secret", "my-client-secret"), + org.mockserver.model.Parameter.param("scope", "offline_access") + )) + ); + + // Verify the actual request used the obtained token + mockServer.verify( + HttpRequest.request() + .withMethod("GET") + .withPath("/v1/") + .withHeader("Authorization", "Bearer secret-token")); + } + @After public void stopMockServer() throws Exception { mockServer.stop(); diff --git a/src/test/java/io/weaviate/client6/v1/api/collections/CollectionHandleDefaultsTest.java b/src/test/java/io/weaviate/client6/v1/api/collections/CollectionHandleDefaultsTest.java index 4b420b3fd..c1bd40905 100644 --- a/src/test/java/io/weaviate/client6/v1/api/collections/CollectionHandleDefaultsTest.java +++ b/src/test/java/io/weaviate/client6/v1/api/collections/CollectionHandleDefaultsTest.java @@ -7,25 +7,32 @@ import io.weaviate.client6.v1.api.collections.query.ConsistencyLevel; import io.weaviate.client6.v1.internal.ObjectBuilder; +import io.weaviate.client6.v1.internal.grpc.GrpcTransport; import io.weaviate.client6.v1.internal.orm.CollectionDescriptor; +import io.weaviate.client6.v1.internal.rest.RestTransport; +import io.weaviate.testutil.transport.MockGrpcTransport; +import io.weaviate.testutil.transport.MockRestTransport; public class CollectionHandleDefaultsTest { private static final CollectionDescriptor> DESCRIPTOR = CollectionDescriptor.ofMap("Things"); private static final CollectionHandleDefaults NONE_DEFAULTS = CollectionHandleDefaults.of(ObjectBuilder.identity()); + private static final RestTransport REST = new MockRestTransport(); + private static final GrpcTransport GRPC = new MockGrpcTransport(); + /** CollectionHandle with no defaults. */ private static final CollectionHandle> HANDLE_NONE = new CollectionHandle<>( - null, null, DESCRIPTOR, NONE_DEFAULTS); + REST, GRPC, DESCRIPTOR, NONE_DEFAULTS); /** CollectionHandleAsync with no defaults. */ private static final CollectionHandleAsync> HANDLE_NONE_ASYNC = new CollectionHandleAsync<>( - null, null, DESCRIPTOR, NONE_DEFAULTS); + REST, GRPC, DESCRIPTOR, NONE_DEFAULTS); /** All defaults are {@code null} if none were set. */ @Test public void test_defaults() { - Assertions.assertThat(HANDLE_NONE.consistencyLevel()).as("default ConsistencyLevel").isNull(); - Assertions.assertThat(HANDLE_NONE.tenant()).as("default tenant").isNull(); + Assertions.assertThat(HANDLE_NONE.consistencyLevel()).as("default ConsistencyLevel").isEmpty(); + Assertions.assertThat(HANDLE_NONE.tenant()).as("default tenant").isEmpty(); } /** @@ -35,8 +42,8 @@ public void test_defaults() { @Test public void test_withConsistencyLevel() { var handle = HANDLE_NONE.withConsistencyLevel(ConsistencyLevel.QUORUM); - Assertions.assertThat(handle.consistencyLevel()).isEqualTo(ConsistencyLevel.QUORUM); - Assertions.assertThat(HANDLE_NONE.consistencyLevel()).isNull(); + Assertions.assertThat(handle.consistencyLevel()).get().isEqualTo(ConsistencyLevel.QUORUM); + Assertions.assertThat(HANDLE_NONE.consistencyLevel()).isEmpty(); } /** @@ -46,8 +53,8 @@ public void test_withConsistencyLevel() { @Test public void test_withConsistencyLevel_async() { var handle = HANDLE_NONE_ASYNC.withConsistencyLevel(ConsistencyLevel.QUORUM); - Assertions.assertThat(handle.consistencyLevel()).isEqualTo(ConsistencyLevel.QUORUM); - Assertions.assertThat(HANDLE_NONE_ASYNC.consistencyLevel()).isNull(); + Assertions.assertThat(handle.consistencyLevel()).get().isEqualTo(ConsistencyLevel.QUORUM); + Assertions.assertThat(HANDLE_NONE_ASYNC.consistencyLevel()).isEmpty(); } /** @@ -57,8 +64,8 @@ public void test_withConsistencyLevel_async() { @Test public void test_withTenant() { var handle = HANDLE_NONE.withTenant("john_doe"); - Assertions.assertThat(handle.tenant()).isEqualTo("john_doe"); - Assertions.assertThat(HANDLE_NONE.consistencyLevel()).isNull(); + Assertions.assertThat(handle.tenant()).get().isEqualTo("john_doe"); + Assertions.assertThat(HANDLE_NONE.consistencyLevel()).isEmpty(); } /** @@ -68,7 +75,7 @@ public void test_withTenant() { @Test public void test_withTenant_async() { var handle = HANDLE_NONE_ASYNC.withTenant("john_doe"); - Assertions.assertThat(handle.tenant()).isEqualTo("john_doe"); - Assertions.assertThat(HANDLE_NONE_ASYNC.consistencyLevel()).isNull(); + Assertions.assertThat(handle.tenant()).get().isEqualTo("john_doe"); + Assertions.assertThat(HANDLE_NONE_ASYNC.consistencyLevel()).isEmpty(); } } diff --git a/src/test/java/io/weaviate/client6/v1/api/collections/CollectionHandleTest.java b/src/test/java/io/weaviate/client6/v1/api/collections/CollectionHandleTest.java index 9cf1e99d9..50286503a 100644 --- a/src/test/java/io/weaviate/client6/v1/api/collections/CollectionHandleTest.java +++ b/src/test/java/io/weaviate/client6/v1/api/collections/CollectionHandleTest.java @@ -131,18 +131,18 @@ public void test_collectionHandleDefaults_rest(String __, rest.assertNext((method, requestUrl, body, query) -> { switch (clLoc) { case QUERY: - Assertions.assertThat(query).containsEntry("consistency_level", defaults.consistencyLevel()); + Assertions.assertThat(query).containsEntry("consistency_level", defaults.consistencyLevel().get()); break; case BODY: - assertJsonHasValue(body, "consistency_level", defaults.consistencyLevel()); + assertJsonHasValue(body, "consistency_level", defaults.consistencyLevel().get()); } switch (tenantLoc) { case QUERY: - Assertions.assertThat(query).containsEntry("tenant", defaults.tenant()); + Assertions.assertThat(query).containsEntry("tenant", defaults.tenant().get()); break; case BODY: - assertJsonHasValue(body, "tenant", defaults.tenant()); + assertJsonHasValue(body, "tenant", defaults.tenant().get()); } }); } @@ -219,7 +219,7 @@ public void test_defaultTenant_getShards() throws IOException { // Assert rest.assertNext((method, requestUrl, body, query) -> { - Assertions.assertThat(query).containsEntry("tenant", defaults.tenant()); + Assertions.assertThat(query).containsEntry("tenant", defaults.tenant().get()); }); } diff --git a/src/test/java/io/weaviate/client6/v1/api/collections/batch/BatchContextTest.java b/src/test/java/io/weaviate/client6/v1/api/collections/batch/BatchContextTest.java new file mode 100644 index 000000000..1205b18b5 --- /dev/null +++ b/src/test/java/io/weaviate/client6/v1/api/collections/batch/BatchContextTest.java @@ -0,0 +1,687 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executor; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.assertj.core.api.Assertions; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestName; +import org.junit.rules.TestWatcher; +import org.junit.runner.Description; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import io.grpc.stub.StreamObserver; +import io.weaviate.client6.v1.api.collections.CollectionHandleDefaults; +import io.weaviate.client6.v1.api.collections.WeaviateObject; +import io.weaviate.client6.v1.api.collections.query.ConsistencyLevel; +import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch; +import io.weaviate.client6.v1.internal.orm.CollectionDescriptor; + +public class BatchContextTest { + private static final Logger log = LoggerFactory.getLogger(BatchContextTest.class); + + private static final CollectionDescriptor> DESCRIPTOR = CollectionDescriptor + .ofMap("BatchContextTest"); + private static final CollectionHandleDefaults DEFAULTS = new CollectionHandleDefaults( + Optional.of(ConsistencyLevel.ONE), Optional.of("john_doe")); + + /** + * Maximum gRPC message size of 2KB . + * 1KB is {@link MessageSizeUtil#SAFETY_MARGIN}. + */ + private static final int MAX_SIZE_BYTES = 2 * 1024; + private static final int BATCH_SIZE = 10; + private static final int QUEUE_SIZE = 1; + private static final int MAX_RECONNECT_RETRIES = 1; + private static final RetryPolicy RETRY_POLICY = new RetryPolicy(1); + + /** + * This test models the client-side part of the stream as a blocking queue. + * All streams created by {@link #createStream} are backed by the same queue, + * which "survives" reconnects. The test code can listen on the same stream + * even if the batch client re-creates it. + */ + private final BlockingQueue REQUEST_QUEUE = new ArrayBlockingQueue<>(1); + + /** + * Dedicated executor for occasional asynchrony. + * + *

+ * Most of the time the "server", the "user", the "test" processes + * will run on the main thread, one at a time, when the logic permits. + * In some cases it is useful to put at least one of those processes + * onto a separate thread. E.g. when the batch is being drained, but + * the main thread is blocked by {@link BatchContext#close}. + */ + private ExecutorService backgroundThread; + + /** + * Server-side events must be emitted from a dedicated thread, to avoid + * deadlocks between the test code and the client side-effects we expect + * to take place and await. + */ + private ExecutorService eventThread; + + /** + * Batch context for the current test case. + * Only {@link #startContext()} should assign to context. + */ + private volatile BatchContext> context; + + /** Track if the context has already been closed inside of the test. */ + private boolean contextClosed; + + /** Server half of the stream. */ + private volatile OutboundStream out; + /** Client half of the stream. */ + private volatile InboundStream in; + + private StreamObserver createStream(StreamObserver recv) { + out = new OutboundStream(recv, eventThread); + in = new InboundStream(REQUEST_QUEUE, out); + return in; + } + + @Rule + public TestName currentTest = new TestName(); + + private boolean testFailed; + + @Rule + public TestWatcher __ = new TestWatcher() { + @Override + protected void failed(Throwable e, Description description) { + testFailed = true; + } + }; + + /** + * Create new unstarted context with default maxSizeBytes, collection + * descriptor, and collection handle defaults. + */ + @Before + public void startContext() throws InterruptedException { + log.debug("===================startContext=================="); + log.debug(currentTest.getMethodName()); + + assert !Thread.currentThread().isInterrupted() : "main thread interrupted"; + assert REQUEST_QUEUE.isEmpty() : "stream contains incoming message " + REQUEST_QUEUE.peek(); + + backgroundThread = Executors.newSingleThreadExecutor(); + eventThread = Executors.newSingleThreadExecutor(); + + context = new BatchContext.Builder<>(this::createStream, MAX_SIZE_BYTES, DESCRIPTOR, DEFAULTS) + .batchSize(BATCH_SIZE) + .queueSize(QUEUE_SIZE) + .maxReconnectRetries(MAX_RECONNECT_RETRIES) + .retryPolicy(RETRY_POLICY) + .build(); + context.start(); + + in.expectMessage(START); + out.emitEventAsync(Event.STARTED); + } + + @After + public void reset() throws Exception { + log.atDebug() + .addKeyValue("contextClosed", contextClosed) + .addKeyValue("testFailed", testFailed) + .log("Begin test cleanup"); + + // Do not attempt to close the context if it has been previously closed + // by the test or the test has failed. In the latter case closing the + // context may lead to a deadlock if the case hasn't scheduled Results + // for all submitted messages. + if (!contextClosed && !testFailed) { + closeContext(); + } + + context = null; + in = null; + out = null; + + // This resets the interrupted flag, allowing use to await the executors. + Thread.interrupted(); + + try { + backgroundThread.shutdownNow(); + backgroundThread.awaitTermination(10, TimeUnit.SECONDS); + + eventThread.shutdownNow(); + eventThread.awaitTermination(10, TimeUnit.SECONDS); + } catch (InterruptedException ignored) { + } + + REQUEST_QUEUE.clear(); + + log.debug("===================closeContext=================="); + } + + private static final WeaviateProtoBatch.BatchStreamRequest.MessageCase START = WeaviateProtoBatch.BatchStreamRequest.MessageCase.START; + private static final WeaviateProtoBatch.BatchStreamRequest.MessageCase STOP = WeaviateProtoBatch.BatchStreamRequest.MessageCase.STOP; + private static final WeaviateProtoBatch.BatchStreamRequest.MessageCase DATA = WeaviateProtoBatch.BatchStreamRequest.MessageCase.DATA; + + private void closeContext() throws Exception { + CompletableFuture eof = CompletableFuture.runAsync(() -> { + try { + in.expectMessage(STOP); + } catch (Exception e) { + throw new RuntimeException(e); + } + }, backgroundThread).thenCompose(__ -> out.eof(true)); + + try { + context.close(); + eof.get(5, TimeUnit.SECONDS); + } finally { + contextClosed = true; + } + } + + @Test + public void test_sendOneBatch() throws Exception { + List tasks = new ArrayList<>(); + for (int i = 0; i < BATCH_SIZE; i++) { + tasks.add(context.add(WeaviateObject.of())); + } + + // BatchContext should flush the current batch once it hits its limit. + // We will ack all items in the batch and send successful result for each one. + List received = recvDataAndAck(); + out.emitEventAsync(new Event.Results(received, Collections.emptyMap())); + + Assertions.assertThat(tasks) + .extracting(TaskHandle::id).containsExactlyInAnyOrderElementsOf(received); + + // Since MockServer runs in the same thread as this test, + // the context will be updated before the last emitEvent returns. + closeContext(); + + // By the time context.close() returns all tasks MUST have results set. + Assertions.assertThat(tasks).extracting(TaskHandle::done) + .allMatch(CompletableFuture::isDone) + .noneMatch(CompletableFuture::isCompletedExceptionally); + } + + @Test + public void test_drainOnClose() throws Exception { + List tasks = new ArrayList<>(); + for (int i = 0; i < BATCH_SIZE - 2; i++) { + tasks.add(context.add(WeaviateObject.of())); + } + + // Contrary the test above, we expect the objects to be sent + // only after context.close(), as the half-empty batch will + // be drained. Similarly, we want to ack everything as it arrives. + backgroundThread.submit(() -> { + try { + List received = recvDataAndAck(); + Assertions.assertThat(tasks).extracting(TaskHandle::id) + .containsExactlyInAnyOrderElementsOf(received); + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + + List submitted = tasks.stream().map(TaskHandle::id).toList(); + out.emitEventAsync(new Event.Results(submitted, Collections.emptyMap())); + + closeContext(); + + Assertions.assertThat(tasks).extracting(TaskHandle::done) + .allMatch(CompletableFuture::isDone) + .noneMatch(CompletableFuture::isCompletedExceptionally); + } + + @Test + public void test_backoff() throws Exception { + out.emitEvent(new Event.Backoff(BATCH_SIZE / 2)); + + List tasks = new ArrayList<>(); + Future backgroundAdd = backgroundThread.submit(() -> { + try { + for (int i = 0; i < BATCH_SIZE; i++) { + tasks.add(context.add(WeaviateObject.of())); + } + } catch (InterruptedException e) { + throw new RuntimeException("test user interrupted", e); + } + }); + + // BatchContext should flush the current batch once it hits the limit + // set by the Backoff message, i.e. BATCH_SIZE / 2. + List received = recvDataAndAck(); + Assertions.assertThat(received).hasSize(BATCH_SIZE / 2); + out.emitEventAsync(new Event.Results(received, Collections.emptyMap())); + + backgroundAdd.get(); // Finish populating batch context. + + // Since testUser will try and add BATCH_SIZE no. objects, + // we should expect there to be exactly 2 batches. + received = recvDataAndAck(); + Assertions.assertThat(received).hasSize(BATCH_SIZE / 2); + out.emitEventAsync(new Event.Results(received, Collections.emptyMap())); + + closeContext(); + + Assertions.assertThat(tasks).extracting(TaskHandle::done) + .allMatch(CompletableFuture::isDone) + .noneMatch(CompletableFuture::isCompletedExceptionally); + } + + @Test + public void test_backoffBacklog() throws Exception { + // Pre-fill the batch without triggering a flush (n-1). + List tasks = new ArrayList<>(); + for (int i = 0; i < BATCH_SIZE - 1; i++) { + tasks.add(context.add(WeaviateObject.of())); + } + + int batchSizeNew = BATCH_SIZE / 2; + + // Force the last BATCH_SIZE / 2 - 1 items to be transferred to the backlog. + // Await for this event to be processed before moving forward. + out.emitEvent(new Event.Backoff(batchSizeNew)); + + // The next item will go on the backlog and the trigger a flush, + // which will continue to send batches and re-populate from + // the backlog as long as the batch is full, so we should expect + // to see 2 batches of size BATCH_SIZE / 2 each. + List received; + tasks.add(context.add(WeaviateObject.of())); + + Assertions.assertThat(received = recvDataAndAck()).hasSize(batchSizeNew); + out.emitEventAsync(new Event.Results(received, Collections.emptyMap())); + + Assertions.assertThat(received = recvDataAndAck()).hasSize(batchSizeNew); + out.emitEventAsync(new Event.Results(received, Collections.emptyMap())); + + closeContext(); + + Assertions.assertThat(tasks).extracting(TaskHandle::done) + .allMatch(CompletableFuture::isDone) + .noneMatch(CompletableFuture::isCompletedExceptionally); + } + + @Test + public void test_reconnect_onShutdown() throws Exception { + out.emitEventAsync(Event.SHUTTING_DOWN); + in.expectMessage(STOP); + out.eof(true); + in.expectMessage(START); + + // Not strictly necessary -- we can close the context + // before a new connection is established. + out.emitEventAsync(Event.STARTED); + } + + @Test + public void test_reconnect_onOom() throws Exception { + List tasks = new ArrayList<>(); + + // OOM is the opposite of Ack -- trigger a flush first. + for (int i = 0; i < BATCH_SIZE; i++) { + tasks.add(context.add(WeaviateObject.of())); + } + + // Respond with OOM and wait for the client to close its end of the stream. + in.expectMessage(DATA); + out.emitEventAsync(new Event.Oom(0)); + + // Close the server's end of the stream. + in.expectMessage(STOP); + + // Allow the client to reconnect to another "instance" and Ack the batch. + in.expectMessage(START); + out.emitEventAsync(Event.STARTED); + recvDataAndAck(); + + List submitted = tasks.stream().map(TaskHandle::id).toList(); + out.emitEventAsync(new Event.Results(submitted, Collections.emptyMap())); + } + + @Test + public void test_reconnect_onStreamHangup() throws Exception { + List tasks = new ArrayList<>(); + // Trigger a flush. + for (int i = 0; i < BATCH_SIZE; i++) { + tasks.add(context.add(WeaviateObject.of())); + } + + // Expect a new batch to arrive. Hangup the stream before sending the Acks. + in.expectMessage(DATA); + out.hangup(); + + // The client should try to reconnect, because the context is still open. + in.expectMessage(START); + out.emitEventAsync(Event.STARTED); + + // The previous batch hasn't been acked, so we should expect to receive it + // again. + recvDataAndAck(); + + // After the last batch has been acked, the Sender waits to take the next + // item from the queue. Hangup the stream again, and add put another object + // in the queue to wake the sender up. + out.hangup(); + in.expectMessage(START); + out.emitEventAsync(Event.STARTED); + tasks.add(context.add(WeaviateObject.of())); + recvDataAndAck(); + + // Now fill up the rest of the batch to trigger a flush. Ack the incoming batch. + for (int i = 0; i < BATCH_SIZE - 1; i++) { + tasks.add(context.add(WeaviateObject.of())); + } + recvDataAndAck(); + + List submitted = tasks.stream().map(TaskHandle::id).toList(); + log.info("Will send results for {} items before EOF", submitted.size()); + out.emitEventAsync(new Event.Results(submitted, Collections.emptyMap())); + } + + @Test + public void test_reconnect_DrainAfterStreamHangup() throws Exception { + List tasks = new ArrayList<>(); + + // Trigger a flush. + for (int i = 0; i < BATCH_SIZE; i++) { + tasks.add(context.add(WeaviateObject.of())); + } + + // Expect a new batch to arrive. Ack the batch, and trigger another flush. + recvDataAndAck(); + for (int i = 0; i < BATCH_SIZE; i++) { + tasks.add(context.add(WeaviateObject.of())); + } + + // Ack the latest batch, but now Before sending back the results + // for either one, hang up the stream. + // On hangup, client should re-populate the batch from the WIP buffer. + // Add one more item to overflow, so that there are now 3 pending batches. + recvDataAndAck(); + out.hangup(); + tasks.add(context.add(WeaviateObject.of())); + + // The client will try to reconnect, because the context is still open. + // When the server starts accepting connections again, the client should + // drain the remaining BATCH_SIZE+1 objects as we close the context. + in.expectMessage(START); + out.emitEventAsync(Event.STARTED); + Future backgroundAcks = backgroundThread.submit(() -> { + try { + List received = new ArrayList<>(); + + received.addAll(recvDataAndAck()); + received.addAll(recvDataAndAck()); + received.addAll(recvDataAndAck()); + + out.emitEvent(new Event.Results(received, Collections.emptyMap())); + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + + closeContext(); + backgroundAcks.get(); + + Assertions.assertThat(tasks).extracting(TaskHandle::done) + .allMatch(CompletableFuture::isDone) + .noneMatch(CompletableFuture::isCompletedExceptionally); + } + + @Test + public void test_retryPolicy() throws Exception { + List tasks = new ArrayList<>(); + + // Trigger a flush. + for (int i = 0; i < BATCH_SIZE; i++) { + tasks.add(context.add(WeaviateObject.of())); + } + + // Expect a new batch to arrive. Ack the batch, and add BATCH_SIZE - 1 items. + recvDataAndAck(); + for (int i = 0; i < BATCH_SIZE - 1; i++) { + tasks.add(context.add(WeaviateObject.of())); + } + + // These will be arriving after the context starts to close. + backgroundThread.execute(() -> { + Assertions.assertThatCode(() -> { + // Expect the (BATCH_SIZE - 1) batch to arrive. + recvDataAndAck(); + + // Return success for the first (BATCH_SIZE - 1) items + // and errors for the next (BATCH_SIZE - 1) items. + List successful = tasks.subList(0, BATCH_SIZE - 1).stream() + .map(TaskHandle::id).toList(); + Map errors = tasks.subList(BATCH_SIZE - 1, (BATCH_SIZE - 1) * 2).stream() + .collect(Collectors.toMap(TaskHandle::id, __ -> "Whaam!")); + out.emitEventAsync(new Event.Results(successful, errors)); + + // Now WIP should contain exactly (BATCH_SIZE - 2) items + // and the batch (BATCH_SIZE - 1) retried items. + // Return another error an await a full batch of retried items to arrive. + TaskHandle lastTask = tasks.get(tasks.size() - 1); + out.emitEventAsync(new Event.Results(Collections.emptyList(), Map.of(lastTask.id(), "Whaam!"))); + + List retried = recvDataAndAck(); + + // Fail all retried tasks. After this context.close() should unblock. + errors = retried.stream().collect(Collectors.toMap(Function.identity(), __ -> "Whaam!")); + out.emitEventAsync(new Event.Results(Collections.emptyList(), errors)); + }).doesNotThrowAnyException(); + }); + + // Close the context. + closeContext(); + + Assertions.assertThat(tasks.subList(0, BATCH_SIZE - 1)) + .as("first %d tasks succeeded", BATCH_SIZE - 1) + .extracting(TaskHandle::done) + .allMatch(CompletableFuture::isDone) + .noneMatch(CompletableFuture::isCompletedExceptionally); + + Assertions.assertThat(tasks.subList(BATCH_SIZE - 1, BATCH_SIZE)) + .as("last %d tasks failed", BATCH_SIZE) + .extracting(TaskHandle::done) + .allMatch(CompletableFuture::isCompletedExceptionally); + + Assertions.assertThat(context.numberOfErrors()) + .as("number of errors") + .isEqualTo(BATCH_SIZE); + } + + @Test + public void test_closeAfterStreamHangup() throws Exception { + out.hangup(); + in.expectMessage(START); + out.emitEventAsync(Event.STARTED); + } + + @Test + public void test_maxReconnectRetries() throws Exception { + // Drop the connection several times until the client + // exhausts its reconnect attempts. + int retries = 0; + while (retries < MAX_RECONNECT_RETRIES) { + out.hangup(); + in.expectMessage(START); + retries++; + } + + out.hangup(); + Assertions.assertThatThrownBy(this::closeContext) + .isInstanceOf(IOException.class) + .hasMessageContaining("Server unavailable"); + } + + @Test(expected = IllegalStateException.class) + public void test_add_closed() throws Exception { + closeContext(); + context.add(WeaviateObject.of(o -> o.properties(Map.of()))); + } + + @Test(expected = IllegalStateException.class) + public void test_startAfterClose() throws Exception { + closeContext(); + context.start(); + } + + /** + * Read the next Data message from the stream and ACK it. + * This method does not wait for the server to process the Acks. + * + * @return IDs of tasks that were received. + */ + private List recvDataAndAck() throws InterruptedException { + List received = recvData(); + out.emitEventAsync(new Event.Acks(received)); + return received; + } + + /** + * Read the next Data message from the stream. + * + * @return IDs of tasks that were received. + */ + private List recvData() throws InterruptedException { + WeaviateProtoBatch.BatchStreamRequest.Data data = in.expectMessage(DATA).getData(); + return Stream.concat( + data.getObjects().getValuesList().stream().map(WeaviateProtoBatch.BatchObject::getUuid), + data.getReferences().getValuesList().stream().map(BatchContextTest::getBeacon)) + .toList(); + } + + static String getBeacon(WeaviateProtoBatch.BatchReference reference) { + return "weaviate://localhost/" + reference.getToCollection() + "/" + reference.getToUuid(); + } + + /** OutboundStream is a mock which dispatches server-side events. */ + private static final class OutboundStream { + private final StreamObserver stream; + private final Executor eventThread; + + OutboundStream(StreamObserver stream, Executor eventThread) { + this.stream = stream; + this.eventThread = eventThread; + } + + /** Emit event on the current thread. */ + void emitEvent(Event event) { + assert event != Event.EOF : "must not use synthetic EOF event"; + assert !(event instanceof Event.StreamHangup) : "must not use synthetic StreamHangup event"; + + stream.onNext(event); + } + + /** + * Emit event on the {@link #eventThread}. + */ + void emitEventAsync(Event event) { + assert event != Event.EOF : "must not use synthetic EOF event"; + assert !(event instanceof Event.StreamHangup) : "must not use synthetic StreamHangup event"; + + CompletableFuture.runAsync(() -> stream.onNext(event), eventThread); + } + + /** + * Terminate the server half of the stream abruptly. + */ + + void hangup() { + log.debug("Hang up server half of the stream"); + + CompletableFuture.runAsync(() -> stream.onError(new RuntimeException("whaam!")), eventThread); + } + + /** + * Close server half of the stream. + * + * @param ok Whether to emit {@link #pendingEvents}. Should only be false when + * stream is being hungup by the client, not by us. + */ + CompletableFuture eof(boolean ok) { + return CompletableFuture.runAsync(stream::onCompleted, eventThread); + } + } + + /** InboundStream is a spy which collects incoming messages in a queue. */ + private static final class InboundStream implements StreamObserver { + /** + * Block until the next message arrives on the stream. + * When it does, assert it's of the expected type. + * + * @see WeaviateProtoBatch.BatchStreamRequest.MessageCase + */ + WeaviateProtoBatch.BatchStreamRequest expectMessage( + WeaviateProtoBatch.BatchStreamRequest.MessageCase messageCase) throws InterruptedException { + WeaviateProtoBatch.BatchStreamRequest actual = stream.take(); + Assertions.assertThat(actual) + .extracting(WeaviateProtoBatch.BatchStreamRequest::getMessageCase) + .isEqualTo(messageCase); + return actual; + } + + final CompletableFuture done = new CompletableFuture<>(); + private final BlockingQueue stream; + private final OutboundStream outbound; + + InboundStream(BlockingQueue stream, OutboundStream outbound) { + this.stream = stream; + this.outbound = outbound; + } + + @Override + public void onCompleted() { + done.complete(null); + } + + @Override + public void onError(Throwable t) { + done.completeExceptionally(t); + outbound.eof(false); + } + + @Override + public void onNext(Message message) { + WeaviateProtoBatch.BatchStreamRequest req = asRequest(message); + try { + log.debug("Incoming message: {}", req.getMessageCase()); + + boolean accepted = stream.offer(req, 5, TimeUnit.SECONDS); + assert accepted : "message %s delivered before %s was consumed".formatted( + req.getMessageCase(), stream.peek().getMessageCase()); + } catch (InterruptedException e) { + log.debug("Interrupted"); + Thread.currentThread().interrupt(); + } + } + + private static WeaviateProtoBatch.BatchStreamRequest asRequest(Message message) { + var builder = WeaviateProtoBatch.BatchStreamRequest.newBuilder(); + message.appendTo(builder); + return builder.build(); + } + } +} diff --git a/src/test/java/io/weaviate/client6/v1/api/collections/batch/BatchTest.java b/src/test/java/io/weaviate/client6/v1/api/collections/batch/BatchTest.java new file mode 100644 index 000000000..4461c9536 --- /dev/null +++ b/src/test/java/io/weaviate/client6/v1/api/collections/batch/BatchTest.java @@ -0,0 +1,241 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import java.util.Collection; +import java.util.Map; +import java.util.Optional; +import java.util.Random; +import java.util.UUID; +import java.util.function.Function; + +import org.assertj.core.api.Assertions; +import org.junit.Test; + +import io.weaviate.client6.v1.api.collections.CollectionHandleDefaults; +import io.weaviate.client6.v1.api.collections.Vectors; +import io.weaviate.client6.v1.api.collections.WeaviateObject; +import io.weaviate.client6.v1.api.collections.data.InsertManyRequest; +import io.weaviate.client6.v1.api.collections.query.ConsistencyLevel; +import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch; +import io.weaviate.client6.v1.internal.orm.CollectionDescriptor; + +public class BatchTest { + + private static final int OBJECT_SIZE_BYTES = MessageSizeUtil.ofDataField( + newBatchObject(WeaviateObject.of(o -> o.uuid(UUID.randomUUID().toString()))), + Data.Type.OBJECT); + + @Test + public void test_isEmpty() { + Batch batch = new Batch(10, 4096); + Assertions.assertThat(batch.isEmpty()).as("batch is empty").isTrue(); + } + + @Test + public void test_isFull_sizeBytes() { + // Batch is bottlenecked by maxSizeBytes and will be full with 3 objects. + Batch batch = new Batch(10, 3 * OBJECT_SIZE_BYTES + MessageSizeUtil.SAFETY_MARGIN); + + addObject(batch); + + Assertions.assertThat(batch.isEmpty()).as("batch is empty").isFalse(); + Assertions.assertThat(batch.isFull()).as("batch is full").isFalse(); + + addObject(batch); + + Assertions.assertThat(batch.isEmpty()).as("batch is empty").isFalse(); + Assertions.assertThat(batch.isFull()).as("batch is full").isFalse(); + + addObject(batch); + + Assertions.assertThat(batch.isFull()).as("batch is full").isTrue(); + } + + @Test + public void test_isFull_size() { + // Batch is bottlenecked by maxSize and will be full with 2 objects. + Batch batch = new Batch(2, 3 * OBJECT_SIZE_BYTES + MessageSizeUtil.SAFETY_MARGIN); + + addObject(batch); + + Assertions.assertThat(batch.isEmpty()).as("batch is empty").isFalse(); + Assertions.assertThat(batch.isFull()).as("batch is full").isFalse(); + + addObject(batch); + + Assertions.assertThat(batch.isFull()).as("batch is full").isTrue(); + } + + @Test(expected = IllegalStateException.class) + public void test_add_inFlight() { + Batch batch = new Batch(10, 10 * OBJECT_SIZE_BYTES + MessageSizeUtil.SAFETY_MARGIN); + batch.prepare(); + addObject(batch); + } + + @Test + public void test_prepare() { + Batch batch = new Batch(3, 3 * OBJECT_SIZE_BYTES + MessageSizeUtil.SAFETY_MARGIN); + + addObject(batch); + addObject(batch); + addObject(batch); + + Message message = batch.prepare(); + + var builder = WeaviateProtoBatch.BatchStreamRequest.newBuilder(); + message.appendTo(builder); + WeaviateProtoBatch.BatchStreamRequest got = builder.build(); + + Assertions.assertThat(got) + .extracting(WeaviateProtoBatch.BatchStreamRequest::getData).as("data").isNotNull() + .extracting(WeaviateProtoBatch.BatchStreamRequest.Data::getObjects).as("objects").isNotNull() + .extracting(WeaviateProtoBatch.BatchStreamRequest.Data.Objects::getValuesCount).as("no. objects") + .isEqualTo(3); + } + + @Test(expected = DataTooBigException.class) + public void test_add_tooBig() { + int maxSizeBytes = 10 * OBJECT_SIZE_BYTES + MessageSizeUtil.SAFETY_MARGIN; + Batch batch = new Batch(10, maxSizeBytes); + + // The serialized message is important, raw and ID are not. + batch.add(new Data(new Object(), "id", bigBatchObject(maxSizeBytes + 10), Data.Type.OBJECT)); + } + + @Test + public void test_add_overflow() { + // Batch is just a little short on byte-space for 2 objects, + // so it should report isFull() after accepting the second one. + Batch batch = new Batch(3, 2 * OBJECT_SIZE_BYTES + MessageSizeUtil.SAFETY_MARGIN - 1); + Assertions.assertThat(batch.isEmpty()).as("batch is empty").isTrue(); + + addObject(batch); + addObject(batch); + + Assertions.assertThat(batch.isFull()).as("batch is full after overflow").isTrue(); + + batch.clear(); + Assertions.assertThat(batch.isEmpty()).as("batch is not empty after overflow").isFalse(); + } + + @Test + public void test_clear() { + Batch batch = new Batch(5, 5 * OBJECT_SIZE_BYTES + MessageSizeUtil.SAFETY_MARGIN); + for (int i = 0; i < 5; i++) { + addObject(batch); + } + + Collection removed = batch.clear(); + Assertions.assertThat(removed).as("number of removed items").hasSize(5); + } + + @Test + public void test_backlog() { + Batch batch = new Batch(5, 10 * OBJECT_SIZE_BYTES + MessageSizeUtil.SAFETY_MARGIN); + + // Add 11 objects: that's 2 * maxSize + 1 + for (int i = 0; i < 11; i++) { + addObject(batch); + } + Assertions.assertThat(batch.isFull()).as("batch is full").isTrue(); + + // The batch is re-populated from the backlog. + batch.clear(); + Assertions.assertThat(batch.isFull()).as("batch is full").isTrue(); + + // The batch is re-populated from the backlog, but it only has 1 item now. + batch.clear(); + Assertions.assertThat(batch.isEmpty()).as("batch is empty").isFalse(); + Assertions.assertThat(batch.isFull()).as("batch is full").isFalse(); + } + + @Test + public void test_setMaxSize() { + // Batch has enough space for 50 objects. + Batch batch = new Batch(50, 50 * OBJECT_SIZE_BYTES + MessageSizeUtil.SAFETY_MARGIN); + + for (int i = 0; i < 20; i++) { + addObject(batch); + } + Assertions.assertThat(batch.isFull()) + .as("batch is full after %d objects", 20) + .isFalse(); + + batch.setMaxSize(40); + Assertions.assertThat(batch.isFull()) + .as("batch is full after setMaxSize(%d)", 40) + .isFalse(); + + batch.setMaxSize(10); + Assertions.assertThat(batch.isFull()) + .as("batch is full after setMaxSize(%d)", 10) + .isTrue(); + } + + @Test + public void test_setMaxSize_inFlight() { + // Batch has enough space for a 50 objects. + Batch batch = new Batch(50, 50 * OBJECT_SIZE_BYTES + MessageSizeUtil.SAFETY_MARGIN); + + for (int i = 0; i < 20; i++) { + addObject(batch); + } + Assertions.assertThat(batch.isFull()) + .as("batch is full after %d objects", 20) + .isFalse(); + + batch.prepare(); + batch.setMaxSize(10); + + // Even though we've technically lowered the limit to 10, + // it should not be applied until after the batch is cleared. + Assertions.assertThat(batch.isFull()) + .as("batch is full after in-flight resizing") + .isFalse(); + + batch.clear(); + + // After clear, the new limit is applied and the batch + // should be full after accepting 10 objects. + for (int i = 0; i < 10; i++) { + addObject(batch); + } + Assertions.assertThat(batch.isFull()) + .as("batch is full after applying pendingMaxSize") + .isTrue(); + } + + /** + * Add a WeaviateObject with random UUID to the batch. + * The size of the serialized object is always {@link OBJECT_SIZE_BYTES}. + */ + private static void addObject(Batch batch) { + WeaviateObject> object = WeaviateObject.of(); + batch.add(new Data(object, object.uuid(), newBatchObject(object), Data.Type.OBJECT)); + } + + private static WeaviateProtoBatch.BatchObject newBatchObject(WeaviateObject> object) { + return InsertManyRequest.buildObject(object, CollectionDescriptor.ofMap("Test"), + new CollectionHandleDefaults(Optional.of(ConsistencyLevel.ONE), Optional.of("john_doe"))); + } + + private static WeaviateProtoBatch.BatchObject bigBatchObject(int sizeBytes) { + Random random = new Random(); + Function object = vectors -> newBatchObject( + WeaviateObject.of(o -> o.vectors(vectors))); + + // Keep adding vectors to the object until we've hit the right size. + WeaviateProtoBatch.BatchObject out = null; + Vectors vectors = new Vectors(); + while ((out = object.apply(vectors)).getSerializedSize() < sizeBytes) { + float[] vector = new float[512]; + for (int i = 0; i < 512; i++) { + vector[i] = random.nextFloat(); + } + vectors = vectors.withVectors(Vectors.of(vector)); + } + + assert out.getSerializedSize() >= sizeBytes; + return out; + } +} diff --git a/src/test/java/io/weaviate/client6/v1/api/collections/batch/MessageSizeUtilTest.java b/src/test/java/io/weaviate/client6/v1/api/collections/batch/MessageSizeUtilTest.java new file mode 100644 index 000000000..659b5c145 --- /dev/null +++ b/src/test/java/io/weaviate/client6/v1/api/collections/batch/MessageSizeUtilTest.java @@ -0,0 +1,60 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import java.util.UUID; + +import org.assertj.core.api.Assertions; +import org.junit.Test; + +import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch; + +public class MessageSizeUtilTest { + private static WeaviateProtoBatch.BatchObject OBJECT = WeaviateProtoBatch.BatchObject.newBuilder() + .setUuid(UUID.randomUUID().toString()) + .setCollection("Test") + .build(); + private static WeaviateProtoBatch.BatchReference REFERENCE = WeaviateProtoBatch.BatchReference.newBuilder() + .setFromCollection("From") + .setFromUuid(UUID.randomUUID().toString()) + .build(); + + @Test + public void test_safety_margin() { + int got = 0; + + var objects = WeaviateProtoBatch.BatchStreamRequest.Data.Objects.newBuilder(); + for (int i = 0; i < 10_000; i++) { + objects.addValues(OBJECT); + got += MessageSizeUtil.ofDataField(OBJECT, Data.Type.OBJECT); + } + + var refernces = WeaviateProtoBatch.BatchStreamRequest.Data.References.newBuilder(); + for (int i = 0; i < 10_000; i++) { + refernces.addValues(REFERENCE); + got += MessageSizeUtil.ofDataField(REFERENCE, Data.Type.REFERENCE); + } + + var request = WeaviateProtoBatch.BatchStreamRequest.newBuilder() + .setData(WeaviateProtoBatch.BatchStreamRequest.Data.newBuilder() + .setObjects(objects) + .setReferences(refernces) + .build()) + .build(); + + int want = request.getSerializedSize(); + Assertions.assertThat(got).isLessThan(want); + Assertions.assertThat(want - got).isLessThan(MessageSizeUtil.SAFETY_MARGIN); + } + + @Test + public void test_maxSizeBytes_legal() { + int sizeBytes = 4096; + int want = sizeBytes - MessageSizeUtil.SAFETY_MARGIN; + int got = MessageSizeUtil.maxSizeBytes(sizeBytes); + Assertions.assertThat(got).isEqualTo(want); + } + + @Test(expected = IllegalArgumentException.class) + public void test_maxSizeBytes_illegal() { + MessageSizeUtil.maxSizeBytes(MessageSizeUtil.SAFETY_MARGIN); + } +} diff --git a/src/test/java/io/weaviate/client6/v1/api/collections/batch/TaskHandleTest.java b/src/test/java/io/weaviate/client6/v1/api/collections/batch/TaskHandleTest.java new file mode 100644 index 000000000..b5cda8cea --- /dev/null +++ b/src/test/java/io/weaviate/client6/v1/api/collections/batch/TaskHandleTest.java @@ -0,0 +1,123 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +import org.assertj.core.api.AbstractObjectAssert; +import org.assertj.core.api.Assertions; +import org.junit.Test; + +import com.google.protobuf.GeneratedMessage; +import com.google.protobuf.GeneratedMessageV3; + +import io.weaviate.client6.v1.api.collections.CollectionHandleDefaults; +import io.weaviate.client6.v1.api.collections.WeaviateObject; +import io.weaviate.client6.v1.api.collections.data.BatchReference; +import io.weaviate.client6.v1.api.collections.data.InsertManyRequest; +import io.weaviate.client6.v1.api.collections.data.ObjectReference; +import io.weaviate.client6.v1.internal.orm.CollectionDescriptor; + +public class TaskHandleTest { + private static final WeaviateObject> OBJECT = WeaviateObject.of(); + private static final BatchReference REFERENCE = new BatchReference( + "Songs", "hasAwards", "song-1", + ObjectReference.collection("GrammyAwards", "grammy-1")); + + private static final GeneratedMessage.ExtendableMessage REFERENCE_PROTO = InsertManyRequest + .buildReference(REFERENCE, Optional.empty()); + private static final GeneratedMessage.ExtendableMessage OBJECT_PROTO = InsertManyRequest + .buildObject(OBJECT, + CollectionDescriptor.ofMap("Songs"), + CollectionHandleDefaults.of(CollectionHandleDefaults.none())); + private static final RetryPolicy RETRY_POLICY = RetryPolicy.never(); + + @Test + public void test_success() { + RetriableTask task = new RetriableTask("ok", RetryPolicy.never(), AssertionError::new) { + }; + Assertions.assertThat(task.done()).isNotCompleted(); + + task.setSuccess(); + Assertions.assertThat(task.done()).isCompleted(); + } + + @Test + public void test_error() { + RetriableTask task = new RetriableTask("failed", RetryPolicy.never(), AssertionError::new) { + }; + Assertions.assertThat(task.done()).isNotCompleted(); + + task.setError(new ServerException("Whaam!")); + Assertions.assertThat(task.done()) + .isCompletedExceptionally() + .withFailMessage("Whaam!"); + } + + @Test + public void test_retryAndSucceed() { + RetryPolicy retryOnce = new RetryPolicy(1); + RetriableTask task = new RetriableTask( + "retry_me", + retryOnce, + id -> Assertions.assertThat(id).isEqualTo("retry_me")) { + }; + Assertions.assertThat(task.done()).isNotCompleted(); + + task.setError(new ServerException("Whaam!")); + Assertions.assertThat(task.done()).isNotCompleted(); + Assertions.assertThat(task.done()).isNotCompletedExceptionally(); + Assertions.assertThat(task.timesRetried()).isEqualTo(1); + + task.setSuccess(); + Assertions.assertThat(task.done()).isCompleted(); + } + + @Test + public void test_retryAndFail() { + RetryPolicy retryOnce = new RetryPolicy(1); + RetriableTask task = new RetriableTask( + "retry_me", + retryOnce, + id -> Assertions.assertThat(id).isEqualTo("retry_me")) { + }; + Assertions.assertThat(task.done()).isNotCompleted(); + + task.setError(new ServerException("Whaam-1!")); + Assertions.assertThat(task.done()).isNotCompleted(); + Assertions.assertThat(task.done()).isNotCompletedExceptionally(); + Assertions.assertThat(task.timesRetried()).isEqualTo(1); + + task.setError(new ServerException("Whaam-2!")); + Assertions.assertThat(task.timesRetried()).isEqualTo(1); + Assertions.assertThat(task.done()) + .isCompletedExceptionally() + .withFailMessage("Whaam-2!"); + } + + @Test + public void test_newTaskHandle_WeaviateObject() { + TaskHandle taskHandle = new TaskHandle(OBJECT, OBJECT_PROTO, RETRY_POLICY, AssertionError::new); + Assertions.assertThat(taskHandle).returns(OBJECT.uuid(), TaskHandle::id); + } + + @Test + public void test_newTaskHandle_BatchReference() { + TaskHandle taskHandle = new TaskHandle(REFERENCE, REFERENCE_PROTO, RETRY_POLICY, AssertionError::new); + Assertions.assertThat(taskHandle).returns(REFERENCE.target().beacon(), TaskHandle::id); + } + + @Test + public void test_toString_POISON() { + Assertions.assertThat(TaskHandle.POISON.toString()) + .isEqualTo("TaskHandle"); + } + + private AbstractObjectAssert> assertHasResult(TaskHandle taskHandle, + boolean expect) { + return Assertions.assertThat(taskHandle) + .extracting(TaskHandle::done) + .as("expect has result") + .returns(expect, CompletableFuture::isDone); + } +} diff --git a/src/test/java/io/weaviate/client6/v1/api/collections/batch/TranslatingStreamFactoryTest.java b/src/test/java/io/weaviate/client6/v1/api/collections/batch/TranslatingStreamFactoryTest.java new file mode 100644 index 000000000..0dfd02f00 --- /dev/null +++ b/src/test/java/io/weaviate/client6/v1/api/collections/batch/TranslatingStreamFactoryTest.java @@ -0,0 +1,237 @@ +package io.weaviate.client6.v1.api.collections.batch; + +import java.util.List; +import java.util.Optional; + +import org.assertj.core.api.Assertions; +import org.assertj.core.api.InstanceOfAssertFactories; +import org.junit.Before; +import org.junit.Test; + +import io.grpc.stub.StreamObserver; +import io.weaviate.client6.v1.api.collections.query.ConsistencyLevel; +import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBase; +import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch; + +public class TranslatingStreamFactoryTest { + private static final StreamObserver NOP_RECV = new StreamObserver() { + + @Override + public void onCompleted() { + throw new UnsupportedOperationException("Unimplemented method 'onCompleted'"); + } + + @Override + public void onError(Throwable t) { + throw new UnsupportedOperationException("Unimplemented method 'onError'"); + } + + @Override + public void onNext(Event reply) { + throw new UnsupportedOperationException("Unimplemented method 'onNext'"); + } + }; + + private static final SpyStreamObserver SPY_SEND; + private static final SpyStreamObserver SPY_RECV; + + // RECV cannot be final, because we will only assign it when createStream + // is called in the static constructor. + private static StreamObserver RECV; + private static final StreamObserver SEND; + + static { + SPY_SEND = new SpyStreamObserver<>(); + SPY_RECV = new SpyStreamObserver<>(); + + SEND = new TranslatingStreamFactory(recv -> { + RECV = recv; // capture the underlying observer + return SPY_SEND; + }).createStream(SPY_RECV); + } + + @Before + public void resetSpies() { + SPY_SEND.reset(); + SPY_RECV.reset(); + } + + @Test + public void testMessenger_onNext_start() { + SEND.onNext(Message.start(Optional.of(ConsistencyLevel.ONE))); + + Assertions.assertThat(SPY_SEND.getLast()) + .asInstanceOf(InstanceOfAssertFactories.type(WeaviateProtoBatch.BatchStreamRequest.class)) + .extracting(WeaviateProtoBatch.BatchStreamRequest::getStart).as("start").isNotNull() + .extracting(WeaviateProtoBatch.BatchStreamRequest.Start::getConsistencyLevel).as("consistency level") + .isEqualTo(WeaviateProtoBase.ConsistencyLevel.CONSISTENCY_LEVEL_ONE); + } + + @Test + public void testMessenger_onNext_stop() { + SEND.onNext(Message.stop()); + + Assertions.assertThat(SPY_SEND.getLast()) + .asInstanceOf(InstanceOfAssertFactories.type(WeaviateProtoBatch.BatchStreamRequest.class)) + .extracting(WeaviateProtoBatch.BatchStreamRequest::getStop).as("stop").isNotNull(); + } + + @Test + public void testMessenger_onNext_data() { + // This message sets BatchStreamRequest.Data so it's not null. + Message message = builder -> builder + .setData(WeaviateProtoBatch.BatchStreamRequest.Data.newBuilder().build()); + SEND.onNext(message); + + Assertions.assertThat(SPY_SEND.getLast()) + .asInstanceOf(InstanceOfAssertFactories.type(WeaviateProtoBatch.BatchStreamRequest.class)) + .extracting(WeaviateProtoBatch.BatchStreamRequest::getData).as("data").isNotNull(); + } + + @Test + public void testMessenger_onError() { + Throwable whaam = new Exception("Whaam!"); + SEND.onError(whaam); + Assertions.assertThat(SPY_SEND.getLast()).isEqualTo(whaam); + } + + @Test + public void testMessenger_onCompleted() { + SEND.onCompleted(); + Assertions.assertThat(SPY_SEND.getLast()).isEqualTo(SpyStreamObserver.COMPLETED); + } + + @Test + public void testEventer_onNext_started() { + RECV.onNext(WeaviateProtoBatch.BatchStreamReply.newBuilder() + .setStarted(WeaviateProtoBatch.BatchStreamReply.Started.newBuilder()).build()); + + Assertions.assertThat(SPY_RECV.getLast()).isEqualTo(Event.STARTED); + } + + @Test + public void testEventer_onNext_shuttingDown() { + RECV.onNext(WeaviateProtoBatch.BatchStreamReply.newBuilder() + .setShuttingDown(WeaviateProtoBatch.BatchStreamReply.ShuttingDown.newBuilder()).build()); + + Assertions.assertThat(SPY_RECV.getLast()).isEqualTo(Event.SHUTTING_DOWN); + } + + @Test + public void testEventer_onNext_oom() { + RECV.onNext(WeaviateProtoBatch.BatchStreamReply.newBuilder() + .setOutOfMemory(WeaviateProtoBatch.BatchStreamReply.OutOfMemory.newBuilder() + .setWaitTime(300)) + .build()); + + Assertions.assertThat(SPY_RECV.getLast()) + .asInstanceOf(InstanceOfAssertFactories.type(Event.Oom.class)) + .returns(300, Event.Oom::delaySeconds); + } + + @Test + public void testEventer_onNext_backoff() { + RECV.onNext(WeaviateProtoBatch.BatchStreamReply.newBuilder() + .setBackoff(WeaviateProtoBatch.BatchStreamReply.Backoff.newBuilder() + .setBatchSize(92)) + .build()); + + Assertions.assertThat(SPY_RECV.getLast()) + .asInstanceOf(InstanceOfAssertFactories.type(Event.Backoff.class)) + .returns(92, Event.Backoff::maxSize); + } + + @Test + public void testEventer_onNext_acks() { + RECV.onNext(WeaviateProtoBatch.BatchStreamReply.newBuilder() + .setAcks(WeaviateProtoBatch.BatchStreamReply.Acks.newBuilder() + .addAllUuids(List.of("uuid-1", "uuid-2")) + .addAllBeacons(List.of("beacon-1", "beacon-2"))) + .build()); + + Assertions.assertThat(SPY_RECV.getLast()) + .asInstanceOf(InstanceOfAssertFactories.type(Event.Acks.class)) + .extracting(Event.Acks::acked) + .asInstanceOf(InstanceOfAssertFactories.list(String.class)) + .containsOnly("uuid-1", "uuid-2", "beacon-1", "beacon-2"); + } + + @Test + public void testEventer_onNext_results() { + RECV.onNext(WeaviateProtoBatch.BatchStreamReply.newBuilder() + .setResults(WeaviateProtoBatch.BatchStreamReply.Results.newBuilder() + .addSuccesses(WeaviateProtoBatch.BatchStreamReply.Results.Success.newBuilder().setUuid("uuid-1")) + .addSuccesses(WeaviateProtoBatch.BatchStreamReply.Results.Success.newBuilder().setUuid("beacon-1")) + .addErrors(WeaviateProtoBatch.BatchStreamReply.Results.Error.newBuilder() + .setUuid("uuid-2").setError("bad uuid!")) + .addErrors(WeaviateProtoBatch.BatchStreamReply.Results.Error.newBuilder() + .setBeacon("beacon-2").setError("bad beacon!"))) + .build()); + + Event.Results results = Assertions.assertThat(SPY_RECV.getLast()) + .asInstanceOf(InstanceOfAssertFactories.type(Event.Results.class)) + .actual(); + + Assertions.assertThat(results) + .extracting(Event.Results::successful, InstanceOfAssertFactories.list(String.class)) + .containsOnly("uuid-1", "beacon-1"); + + Assertions.assertThat(results) + .extracting(Event.Results::errors, InstanceOfAssertFactories.map(String.class, String.class)) + .containsKeys("uuid-2", "beacon-2") + .containsValues("bad uuid!", "bad beacon!"); + } + + @Test(expected = ProtocolViolationException.class) + public void testEventer_onNext_notSet() { + RECV.onNext(WeaviateProtoBatch.BatchStreamReply.newBuilder().build()); + } + + @Test + public void testEventer_onError() { + Throwable whaam = new Exception("Whaam!"); + RECV.onError(whaam); + Assertions.assertThat(SPY_RECV.getLast()).isEqualTo(whaam); + } + + @Test + public void testEventer_onCompleted() { + RECV.onCompleted(); + Assertions.assertThat(SPY_RECV.getLast()).isEqualTo(SpyStreamObserver.COMPLETED); + } + + /** + * Test utility that recods the value that the last callback was called with. + */ + private static class SpyStreamObserver implements StreamObserver { + /** Well-known value for {@link #onCompleted} callback. */ + static final Object COMPLETED = new Object(); + + // Latest message delivered to this observer. + private Object last; + + Object getLast() { + return last; + } + + void reset() { + last = null; + } + + @Override + public void onNext(T req) { + last = req; + } + + @Override + public void onError(Throwable t) { + last = t; + } + + @Override + public void onCompleted() { + last = COMPLETED; + } + + } +} diff --git a/src/test/java/io/weaviate/client6/v1/internal/json/JSONTest.java b/src/test/java/io/weaviate/client6/v1/internal/json/JSONTest.java index 8a60831be..991fa937e 100644 --- a/src/test/java/io/weaviate/client6/v1/internal/json/JSONTest.java +++ b/src/test/java/io/weaviate/client6/v1/internal/json/JSONTest.java @@ -40,6 +40,7 @@ import io.weaviate.client6.v1.api.collections.vectorindex.MultiVector.Aggregation; import io.weaviate.client6.v1.api.collections.vectorizers.Img2VecNeuralVectorizer; import io.weaviate.client6.v1.api.collections.vectorizers.Multi2MultiVecJinaAiVectorizer; +import io.weaviate.client6.v1.api.collections.vectorizers.Multi2MultiVecWeaviateVectorizer; import io.weaviate.client6.v1.api.collections.vectorizers.Multi2VecAwsVectorizer; import io.weaviate.client6.v1.api.collections.vectorizers.Multi2VecClipVectorizer; import io.weaviate.client6.v1.api.collections.vectorizers.Multi2VecCohereVectorizer; @@ -66,6 +67,7 @@ import io.weaviate.client6.v1.api.rbac.AliasesPermission; import io.weaviate.client6.v1.api.rbac.BackupsPermission; import io.weaviate.client6.v1.api.rbac.ClusterPermission; +import io.weaviate.client6.v1.api.rbac.McpPermission; import io.weaviate.client6.v1.api.rbac.CollectionsPermission; import io.weaviate.client6.v1.api.rbac.DataPermission; import io.weaviate.client6.v1.api.rbac.GroupsPermission; @@ -78,7 +80,6 @@ import io.weaviate.client6.v1.api.rbac.UsersPermission; import io.weaviate.client6.v1.api.rbac.groups.GroupType; -/** Unit tests for custom POJO-to-JSON serialization. */ @RunWith(JParamsTestRunner.class) public class JSONTest { public static Object[][] testCases() { @@ -632,6 +633,39 @@ public static Object[][] testCases() { } """, }, + { + VectorConfig.class, + Multi2MultiVecWeaviateVectorizer.of(v -> v + .baseUrl("example.com") + .model(Multi2MultiVecWeaviateVectorizer.MODERNVBERT_COLMODERNVBERT) + .imageFields("a", "b")), + """ + { + "vectorIndexType": "hnsw", + "vectorIndexConfig": {}, + "vectorizer": { + "multi2multivec-weaviate": { + "baseURL": "example.com", + "model": "ModernVBERT/colmodernvbert", + "imageFields": ["a", "b"] + } + } + } + """, + }, + { + VectorConfig.class, + Multi2MultiVecWeaviateVectorizer.of(), + """ + { + "vectorIndexType": "hnsw", + "vectorIndexConfig": {}, + "vectorizer": { + "multi2multivec-weaviate": { } + } + } + """, + }, { VectorConfig.class, Multi2VecClipVectorizer.of(v -> v.imageFields("a", "b").textFields("c")), @@ -787,19 +821,26 @@ public static Object[][] testCases() { }, { VectorConfig.class, - Multi2VecGoogleVectorizer.of("project-id", "location", - v -> v.imageFields("a", "b").textFields("c").videoFields("d")), + Multi2VecGoogleVectorizer.vertex("project-id", "location", + m2v -> m2v + .apiEndpoint("example.com") + .imageFields("a", "b") + .textFields("c") + .videoFields("d") + .audioFields("f")), """ { "vectorIndexType": "hnsw", "vectorIndexConfig": {}, "vectorizer": { "multi2vec-google": { + "apiEndpoint": "example.com", "projectId": "project-id", "location": "location", "imageFields": ["a", "b"], "textFields": ["c"], - "videoFields": ["d"] + "videoFields": ["d"], + "audioFields": ["f"] } } } @@ -807,13 +848,17 @@ public static Object[][] testCases() { }, { VectorConfig.class, - Multi2VecGoogleVectorizer.of("project-id", "location", v -> v.imageFields("a")), + Multi2VecGoogleVectorizer.vertex("project-id", "location", + m2v -> m2v + .apiEndpoint("example.com") + .imageFields("a")), """ { "vectorIndexType": "hnsw", "vectorIndexConfig": {}, "vectorizer": { "multi2vec-google": { + "apiEndpoint": "example.com", "projectId": "project-id", "location": "location", "imageFields": ["a"] @@ -824,14 +869,20 @@ public static Object[][] testCases() { }, { VectorConfig.class, - Multi2VecGoogleVectorizer.of("project-id", "location", - v -> v.imageField("a", 0.1f).imageField("b", 0.1f).textField("c", 0.8f).videoField("d", 0.99f)), + Multi2VecGoogleVectorizer.vertex("project-id", "location", + m2v -> m2v + .apiEndpoint("example.com") + .imageField("a", 0.1f) + .imageField("b", 0.1f) + .textField("c", 0.8f) + .videoField("d", 0.99f)), """ { "vectorIndexType": "hnsw", "vectorIndexConfig": {}, "vectorizer": { "multi2vec-google": { + "apiEndpoint": "example.com", "projectId": "project-id", "location": "location", "imageFields": ["a", "b"], @@ -847,6 +898,37 @@ public static Object[][] testCases() { } """, }, + { + VectorConfig.class, + Multi2VecGoogleVectorizer.gemini(), + """ + { + "vectorIndexType": "hnsw", + "vectorIndexConfig": {}, + "vectorizer": { + "multi2vec-google": { + "apiEndpoint": "generativelanguage.googleapis.com" + } + } + } + """, + }, + { + VectorConfig.class, + Multi2VecGoogleVectorizer.gemini(m2v -> m2v.dimensions(768)), + """ + { + "vectorIndexType": "hnsw", + "vectorIndexConfig": {}, + "vectorizer": { + "multi2vec-google": { + "apiEndpoint": "generativelanguage.googleapis.com", + "dimensions": 768 + } + } + } + """, + }, { VectorConfig.class, Multi2VecJinaAiVectorizer.of(v -> v.imageFields("a", "b").textFields("c")), @@ -1314,10 +1396,12 @@ public static Object[][] testCases() { { Reranker.class, Reranker.cohere(rerank -> rerank + .baseUrl("example.com") .model(CohereReranker.RERANK_ENGLISH_V2)), """ { "reranker-cohere": { + "baseURL": "example.com", "model": "rerank-english-v2.0" } } @@ -1425,6 +1509,24 @@ public static Object[][] testCases() { } """ }, + { + Role.class, + new Role( + "rock-n-role", + List.of( + new McpPermission( + List.of(McpPermission.Action.CREATE, McpPermission.Action.READ, McpPermission.Action.UPDATE)))), + """ + { + "name": "rock-n-role", + "permissions": [ + { "action": "create_mcp" }, + { "action": "read_mcp" }, + { "action": "update_mcp" } + ] + } + """ + }, { Role.class, new Role( diff --git a/src/test/java/io/weaviate/client6/v1/internal/rest/ProxyTest.java b/src/test/java/io/weaviate/client6/v1/internal/rest/ProxyTest.java new file mode 100644 index 000000000..2a61e51e8 --- /dev/null +++ b/src/test/java/io/weaviate/client6/v1/internal/rest/ProxyTest.java @@ -0,0 +1,142 @@ +package io.weaviate.client6.v1.internal.rest; + +import io.weaviate.client6.v1.api.WeaviateApiException; +import io.weaviate.client6.v1.api.Config; +import io.weaviate.client6.v1.api.WeaviateClient; +import io.weaviate.client6.v1.internal.Proxy; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.mockserver.integration.ClientAndServer; +import org.mockserver.model.HttpRequest; +import org.mockserver.model.HttpResponse; + +import java.io.IOException; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.mockserver.model.HttpForward.forward; + +public class ProxyTest { + private ClientAndServer targetServer; + private ClientAndServer proxyServer; + private WeaviateClient client; + + @Before + public void setUp() { + targetServer = ClientAndServer.startClientAndServer(0); + proxyServer = ClientAndServer.startClientAndServer(0); + + // Set up target server to return a success response + targetServer.when( + HttpRequest.request() + .withMethod("GET") + .withPath("/v1/.well-known/live")) + .respond( + HttpResponse.response() + .withStatusCode(200)); + + targetServer.when( + HttpRequest.request() + .withMethod("GET") + .withPath("/v1/meta")) + .respond( + HttpResponse.response() + .withStatusCode(200) + .withBody("{\"version\": \"1.32.0\"}")); + + // Set up proxy server to forward requests to the target server + proxyServer.when( + HttpRequest.request()) + .forward( + forward() + .withHost("localhost") + .withPort(targetServer.getLocalPort()) + .withScheme(org.mockserver.model.HttpForward.Scheme.HTTP)); + + Config config = Config.of(c -> c + .scheme("http") + .httpHost("localhost") + .httpPort(targetServer.getLocalPort()) + .grpcHost("localhost") + .grpcPort(targetServer.getLocalPort()) + .proxy(new Proxy("localhost", proxyServer.getLocalPort())) + .timeout(5) + ); + + client = new WeaviateClient(config); + } + + @Test + public void testClientInitializationWithProxy() { + // This test verifies that the client can be successfully created. + // The WeaviateClient constructor performs REST calls to /v1/.well-known/live + // and /v1/meta to verify the connection and version support. + // If these calls fail, the constructor throws a WeaviateConnectException. + // Since setUp() already creates a client using the proxy, we just need to + // verify it was initialized correctly. + assertThat(client).isNotNull(); + + // Verify that the initialization calls went through the proxy + proxyServer.verify( + HttpRequest.request() + .withMethod("GET") + .withPath("/v1/.well-known/live")); + proxyServer.verify( + HttpRequest.request() + .withMethod("GET") + .withPath("/v1/meta")); + } + + @Test + public void testRestProxy() throws IOException { + // Perform a request that should go through the proxy + client.meta(); + + // Verify that the proxy server received the request + proxyServer.verify( + HttpRequest.request() + .withMethod("GET") + .withPath("/v1/meta")); + + // Verify that the target server also received the request (forwarded by proxy) + targetServer.verify( + HttpRequest.request() + .withMethod("GET") + .withPath("/v1/meta")); + } + + @Test + public void testProxyConfiguration() { + // In this test, we verify that the client has the proxy configured. + assertThat(client.getConfig().proxy()).isNotNull(); + assertThat(client.getConfig().proxy().port()).isEqualTo((long) proxyServer.getLocalPort()); + } + + @Test + public void testGrpcProxy() { + // gRPC proxying via HTTP CONNECT. + // DefaultGrpcTransport uses a custom ProxyDetector which returns a + // HttpConnectProxiedSocketAddress when a proxy is configured. + + // To verify that gRPC proxying is correctly set up, we check the configuration. + // Since actual CONNECT verification via MockServer is tricky in this setup, + // we focus on ensuring the client is correctly initialized with the proxy. + assertThatThrownBy(() -> client.collections.use("Test").size()) + .isInstanceOf(WeaviateApiException.class) + .hasMessageContaining("UNAVAILABLE: Network closed"); + } + + @After + public void tearDown() throws Exception { + if (client != null) { + client.close(); + } + if (proxyServer != null) { + proxyServer.stop(); + } + if (targetServer != null) { + targetServer.stop(); + } + } +} diff --git a/src/test/java/io/weaviate/testutil/transport/MockGrpcTransport.java b/src/test/java/io/weaviate/testutil/transport/MockGrpcTransport.java index ebea2fea7..416bd2bc6 100644 --- a/src/test/java/io/weaviate/testutil/transport/MockGrpcTransport.java +++ b/src/test/java/io/weaviate/testutil/transport/MockGrpcTransport.java @@ -3,16 +3,22 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import java.util.OptionalInt; import java.util.concurrent.CompletableFuture; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.MessageOrBuilder; import com.google.protobuf.util.JsonFormat; +import io.grpc.stub.StreamObserver; import io.weaviate.client6.v1.internal.grpc.GrpcTransport; import io.weaviate.client6.v1.internal.grpc.Rpc; +import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamReply; +import io.weaviate.client6.v1.internal.grpc.protocol.WeaviateProtoBatch.BatchStreamRequest; public class MockGrpcTransport implements GrpcTransport { + private final String host = "example.com"; + private final static int maxMessageSizeBytes = 10240; // 10KB @FunctionalInterface public interface AssertFunction { @@ -57,4 +63,19 @@ public CompletableFuture perf @Override public void close() throws IOException { } + + @Override + public StreamObserver createStream(StreamObserver recv) { + throw new UnsupportedOperationException("Unimplemented method 'createStream'"); + } + + @Override + public OptionalInt maxMessageSizeBytes() { + return OptionalInt.of(maxMessageSizeBytes); + } + + @Override + public String host() { + return host; + } } diff --git a/src/test/java/io/weaviate/testutil/transport/MockRestTransport.java b/src/test/java/io/weaviate/testutil/transport/MockRestTransport.java index 587cb2548..7991078cd 100644 --- a/src/test/java/io/weaviate/testutil/transport/MockRestTransport.java +++ b/src/test/java/io/weaviate/testutil/transport/MockRestTransport.java @@ -6,6 +6,7 @@ import java.util.Map; import java.util.concurrent.CompletableFuture; +import io.weaviate.client6.v1.internal.Proxy; import io.weaviate.client6.v1.internal.rest.BooleanEndpoint; import io.weaviate.client6.v1.internal.rest.Endpoint; import io.weaviate.client6.v1.internal.rest.RestTransport; @@ -25,7 +26,7 @@ public interface AssertFunction { void apply(String method, String requestUrl, String body, Map queryParameters); } - private List> requests = new ArrayList<>(); + private final List> requests = new ArrayList<>(); public void assertNext(AssertFunction... assertions) { var assertN = Math.min(assertions.length, requests.size()); @@ -60,4 +61,9 @@ public CompletableFuture performReq @Override public void close() throws IOException { } + + @Override + public Proxy getProxy() { + return null; + } } diff --git a/src/test/resources/logging.properties b/src/test/resources/logging.properties new file mode 100644 index 000000000..2c7d3e969 --- /dev/null +++ b/src/test/resources/logging.properties @@ -0,0 +1,9 @@ +.level=INFO + +handlers=java.util.logging.ConsoleHandler +java.util.logging.ConsoleHandler.level=FINEST +java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter +java.util.logging.SimpleFormatter.format=[%4$s] %1$tH:%1$tM:%1$tS.%1$tL %5$s%n + +io.weaviate.client6.level=FINE +io.weaviate.client6.v1.api.collections.batch.BatchContextTest.level=FINEST