Skip to content

Commit

Permalink
v1.13.0 (#62)
Browse files Browse the repository at this point in the history
* v1.13.0

* test: point.getVectors() now returns VectorsOutput

Signed-off-by: Anush008 <[email protected]>

* feat: VectorInput, Condition helpers

Signed-off-by: Anush008 <[email protected]>

* Update src/main/java/io/qdrant/client/VectorInputFactory.java

Co-authored-by: Tim Visée <[email protected]>

* chore: Comment out new VectorInput variants

Signed-off-by: Anush008 <[email protected]>

* Update Docker image to 1.13

Co-authored-by: Anush  <[email protected]>

---------

Signed-off-by: Anush008 <[email protected]>
Co-authored-by: Anush008 <[email protected]>
Co-authored-by: Tim Visée <[email protected]>
  • Loading branch information
3 people authored Jan 17, 2025
1 parent 82584c0 commit cf17b88
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
uses: gradle/gradle-build-action@v2
with:
gradle-version: 8.5
arguments: test
arguments: test --info

- name: Test Results
uses: mikepenz/action-junit-report@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:
uses: gradle/gradle-build-action@v2
with:
gradle-version: 8.5
arguments: build
arguments: build --info

- name: Test
uses: gradle/gradle-build-action@v2
with:
gradle-version: 8.5
arguments: test
arguments: test --info
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ We love your input! We want to make contributing to this project as easy and tra

## We Develop with GitHub

We use github to host code, to track issues and feature requests, as well as accept pull requests.
We use GitHub to host code, to track issues and feature requests, as well as accept pull requests.

We Use [GitHub Flow](https://docs.github.com/en/get-started/quickstart/github-flow), so all code changes
happen through Pull Requests. Pull requests are the best way to propose changes to the codebase.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ To install the library, add the following lines to your build config file.
<dependency>
<groupId>io.qdrant</groupId>
<artifactId>client</artifactId>
<version>1.12.0</version>
<version>1.13.0</version>
</dependency>
```

#### SBT

```sbt
libraryDependencies += "io.qdrant" % "client" % "1.12.0"
libraryDependencies += "io.qdrant" % "client" % "1.13.0"
```

#### Gradle

```gradle
implementation 'io.qdrant:client:1.11.0'
implementation 'io.qdrant:client:1.13.0'
```

> [!NOTE]
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# The version of qdrant to use to download protos
qdrantProtosVersion=v1.12.0
qdrantProtosVersion=v1.13.0

# The version of qdrant docker image to run integration tests against
qdrantVersion=v1.12.0
qdrantVersion=v1.13.0

# The version of the client to generate
packageVersion=1.12.0
packageVersion=1.13.0
13 changes: 13 additions & 0 deletions src/main/java/io/qdrant/client/ConditionFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import io.qdrant.client.grpc.Points.GeoPolygon;
import io.qdrant.client.grpc.Points.GeoRadius;
import io.qdrant.client.grpc.Points.HasIdCondition;
import io.qdrant.client.grpc.Points.HasVectorCondition;
import io.qdrant.client.grpc.Points.IsEmptyCondition;
import io.qdrant.client.grpc.Points.IsNullCondition;
import io.qdrant.client.grpc.Points.Match;
Expand Down Expand Up @@ -391,4 +392,16 @@ public static Condition datetimeRange(String field, DatetimeRange datetimeRange)
.setField(FieldCondition.newBuilder().setKey(field).setDatetimeRange(datetimeRange).build())
.build();
}

/**
* Matches records where a value for the given vector is present.
*
* @param vector The name of the vector.
* @return a new instance of {@link Condition}
*/
public static Condition hasVector(String vector) {
return Condition.newBuilder()
.setHasVector(HasVectorCondition.newBuilder().setHasVector(vector).build())
.build();
}
}
37 changes: 35 additions & 2 deletions src/main/java/io/qdrant/client/VectorInputFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

import com.google.common.primitives.Floats;
import io.qdrant.client.grpc.Points.DenseVector;
import io.qdrant.client.grpc.Points.Document;
import io.qdrant.client.grpc.Points.Image;
import io.qdrant.client.grpc.Points.InferenceObject;
import io.qdrant.client.grpc.Points.MultiDenseVector;
import io.qdrant.client.grpc.Points.PointId;
import io.qdrant.client.grpc.Points.SparseVector;
Expand Down Expand Up @@ -97,7 +100,7 @@ public static VectorInput vectorInput(long id) {
/**
* Creates a {@link VectorInput} from a {@link UUID}
*
* @param id The pint id
* @param id The point id
* @return a new instance of {@link VectorInput}
*/
public static VectorInput vectorInput(UUID id) {
Expand All @@ -107,10 +110,40 @@ public static VectorInput vectorInput(UUID id) {
/**
* Creates a {@link VectorInput} from a {@link PointId}
*
* @param id The pint id
* @param id The point id
* @return a new instance of {@link VectorInput}
*/
public static VectorInput vectorInput(PointId id) {
return VectorInput.newBuilder().setId(id).build();
}

// /**
// * Creates a {@link VectorInput} from a {@link Document}
// *
// * @param document An instance of {@link Document}
// * @return a new instance of {@link VectorInput}
// */
// public static VectorInput vectorInput(Document document) {
// return VectorInput.newBuilder().setDocument(document).build();
// }

// /**
// * Creates a {@link VectorInput} from a an {@link Image}
// *
// * @param image An instance of {@link Image}
// * @return a new instance of {@link VectorInput}
// */
// public static VectorInput vectorInput(Image image) {
// return VectorInput.newBuilder().setImage(image).build();
// }

// /**
// * Creates a {@link VectorInput} from a {@link InferenceObject}
// *
// * @param object An instance of {@link InferenceObject}
// * @return a new instance of {@link VectorInput}
// */
// public static VectorInput vectorInput(InferenceObject object) {
// return VectorInput.newBuilder().setObject(object).build();
// }
}
7 changes: 4 additions & 3 deletions src/test/java/io/qdrant/client/PointsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
import io.qdrant.client.grpc.Points.SearchPoints;
import io.qdrant.client.grpc.Points.UpdateResult;
import io.qdrant.client.grpc.Points.UpdateStatus;
import io.qdrant.client.grpc.Points.Vectors;
import io.qdrant.client.grpc.Points.VectorsOutput;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ExecutionException;
Expand Down Expand Up @@ -111,7 +111,7 @@ public void retrieve() throws ExecutionException, InterruptedException {
assertEquals(ImmutableSet.of("foo", "bar", "date"), point.getPayloadMap().keySet());
assertEquals(value("goodbye"), point.getPayloadMap().get("foo"));
assertEquals(value(2), point.getPayloadMap().get("bar"));
assertEquals(Vectors.getDefaultInstance(), point.getVectors());
assertEquals(VectorsOutput.getDefaultInstance(), point.getVectors());
}

@Test
Expand All @@ -125,7 +125,8 @@ public void retrieve_with_vector_without_payload()
RetrievedPoint point = points.get(0);
assertEquals(id(8), point.getId());
assertTrue(point.getPayloadMap().isEmpty());
assertEquals(Vectors.VectorsOptionsCase.VECTOR, point.getVectors().getVectorsOptionsCase());
assertEquals(
VectorsOutput.VectorsOptionsCase.VECTOR, point.getVectors().getVectorsOptionsCase());
}

@Test
Expand Down

0 comments on commit cf17b88

Please sign in to comment.