Skip to content

Commit cf17b88

Browse files
agourlayAnush008timvisee
authored
v1.13.0 (#62)
* 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]>
1 parent 82584c0 commit cf17b88

File tree

8 files changed

+62
-15
lines changed

8 files changed

+62
-15
lines changed

.github/workflows/cd.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
uses: gradle/gradle-build-action@v2
3636
with:
3737
gradle-version: 8.5
38-
arguments: test
38+
arguments: test --info
3939

4040
- name: Test Results
4141
uses: mikepenz/action-junit-report@v4

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ jobs:
3131
uses: gradle/gradle-build-action@v2
3232
with:
3333
gradle-version: 8.5
34-
arguments: build
34+
arguments: build --info
3535

3636
- name: Test
3737
uses: gradle/gradle-build-action@v2
3838
with:
3939
gradle-version: 8.5
40-
arguments: test
40+
arguments: test --info

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ We love your input! We want to make contributing to this project as easy and tra
99

1010
## We Develop with GitHub
1111

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

1414
We Use [GitHub Flow](https://docs.github.com/en/get-started/quickstart/github-flow), so all code changes
1515
happen through Pull Requests. Pull requests are the best way to propose changes to the codebase.

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,20 @@ To install the library, add the following lines to your build config file.
3434
<dependency>
3535
<groupId>io.qdrant</groupId>
3636
<artifactId>client</artifactId>
37-
<version>1.12.0</version>
37+
<version>1.13.0</version>
3838
</dependency>
3939
```
4040

4141
#### SBT
4242

4343
```sbt
44-
libraryDependencies += "io.qdrant" % "client" % "1.12.0"
44+
libraryDependencies += "io.qdrant" % "client" % "1.13.0"
4545
```
4646

4747
#### Gradle
4848

4949
```gradle
50-
implementation 'io.qdrant:client:1.11.0'
50+
implementation 'io.qdrant:client:1.13.0'
5151
```
5252

5353
> [!NOTE]

gradle.properties

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# The version of qdrant to use to download protos
2-
qdrantProtosVersion=v1.12.0
2+
qdrantProtosVersion=v1.13.0
33

44
# The version of qdrant docker image to run integration tests against
5-
qdrantVersion=v1.12.0
5+
qdrantVersion=v1.13.0
66

77
# The version of the client to generate
8-
packageVersion=1.12.0
8+
packageVersion=1.13.0

src/main/java/io/qdrant/client/ConditionFactory.java

+13
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import io.qdrant.client.grpc.Points.GeoPolygon;
1111
import io.qdrant.client.grpc.Points.GeoRadius;
1212
import io.qdrant.client.grpc.Points.HasIdCondition;
13+
import io.qdrant.client.grpc.Points.HasVectorCondition;
1314
import io.qdrant.client.grpc.Points.IsEmptyCondition;
1415
import io.qdrant.client.grpc.Points.IsNullCondition;
1516
import io.qdrant.client.grpc.Points.Match;
@@ -391,4 +392,16 @@ public static Condition datetimeRange(String field, DatetimeRange datetimeRange)
391392
.setField(FieldCondition.newBuilder().setKey(field).setDatetimeRange(datetimeRange).build())
392393
.build();
393394
}
395+
396+
/**
397+
* Matches records where a value for the given vector is present.
398+
*
399+
* @param vector The name of the vector.
400+
* @return a new instance of {@link Condition}
401+
*/
402+
public static Condition hasVector(String vector) {
403+
return Condition.newBuilder()
404+
.setHasVector(HasVectorCondition.newBuilder().setHasVector(vector).build())
405+
.build();
406+
}
394407
}

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

+35-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
import com.google.common.primitives.Floats;
66
import io.qdrant.client.grpc.Points.DenseVector;
7+
import io.qdrant.client.grpc.Points.Document;
8+
import io.qdrant.client.grpc.Points.Image;
9+
import io.qdrant.client.grpc.Points.InferenceObject;
710
import io.qdrant.client.grpc.Points.MultiDenseVector;
811
import io.qdrant.client.grpc.Points.PointId;
912
import io.qdrant.client.grpc.Points.SparseVector;
@@ -97,7 +100,7 @@ public static VectorInput vectorInput(long id) {
97100
/**
98101
* Creates a {@link VectorInput} from a {@link UUID}
99102
*
100-
* @param id The pint id
103+
* @param id The point id
101104
* @return a new instance of {@link VectorInput}
102105
*/
103106
public static VectorInput vectorInput(UUID id) {
@@ -107,10 +110,40 @@ public static VectorInput vectorInput(UUID id) {
107110
/**
108111
* Creates a {@link VectorInput} from a {@link PointId}
109112
*
110-
* @param id The pint id
113+
* @param id The point id
111114
* @return a new instance of {@link VectorInput}
112115
*/
113116
public static VectorInput vectorInput(PointId id) {
114117
return VectorInput.newBuilder().setId(id).build();
115118
}
119+
120+
// /**
121+
// * Creates a {@link VectorInput} from a {@link Document}
122+
// *
123+
// * @param document An instance of {@link Document}
124+
// * @return a new instance of {@link VectorInput}
125+
// */
126+
// public static VectorInput vectorInput(Document document) {
127+
// return VectorInput.newBuilder().setDocument(document).build();
128+
// }
129+
130+
// /**
131+
// * Creates a {@link VectorInput} from a an {@link Image}
132+
// *
133+
// * @param image An instance of {@link Image}
134+
// * @return a new instance of {@link VectorInput}
135+
// */
136+
// public static VectorInput vectorInput(Image image) {
137+
// return VectorInput.newBuilder().setImage(image).build();
138+
// }
139+
140+
// /**
141+
// * Creates a {@link VectorInput} from a {@link InferenceObject}
142+
// *
143+
// * @param object An instance of {@link InferenceObject}
144+
// * @return a new instance of {@link VectorInput}
145+
// */
146+
// public static VectorInput vectorInput(InferenceObject object) {
147+
// return VectorInput.newBuilder().setObject(object).build();
148+
// }
116149
}

src/test/java/io/qdrant/client/PointsTest.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
import io.qdrant.client.grpc.Points.SearchPoints;
5353
import io.qdrant.client.grpc.Points.UpdateResult;
5454
import io.qdrant.client.grpc.Points.UpdateStatus;
55-
import io.qdrant.client.grpc.Points.Vectors;
55+
import io.qdrant.client.grpc.Points.VectorsOutput;
5656
import java.util.Arrays;
5757
import java.util.List;
5858
import java.util.concurrent.ExecutionException;
@@ -111,7 +111,7 @@ public void retrieve() throws ExecutionException, InterruptedException {
111111
assertEquals(ImmutableSet.of("foo", "bar", "date"), point.getPayloadMap().keySet());
112112
assertEquals(value("goodbye"), point.getPayloadMap().get("foo"));
113113
assertEquals(value(2), point.getPayloadMap().get("bar"));
114-
assertEquals(Vectors.getDefaultInstance(), point.getVectors());
114+
assertEquals(VectorsOutput.getDefaultInstance(), point.getVectors());
115115
}
116116

117117
@Test
@@ -125,7 +125,8 @@ public void retrieve_with_vector_without_payload()
125125
RetrievedPoint point = points.get(0);
126126
assertEquals(id(8), point.getId());
127127
assertTrue(point.getPayloadMap().isEmpty());
128-
assertEquals(Vectors.VectorsOptionsCase.VECTOR, point.getVectors().getVectorsOptionsCase());
128+
assertEquals(
129+
VectorsOutput.VectorsOptionsCase.VECTOR, point.getVectors().getVectorsOptionsCase());
129130
}
130131

131132
@Test

0 commit comments

Comments
 (0)