Skip to content

Commit

Permalink
chore: upadate namedVectors() to accept Map<String, Vector>
Browse files Browse the repository at this point in the history
  • Loading branch information
Anush008 committed Dec 29, 2023
1 parent ad7bf6b commit 5139936
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/io/qdrant/client/VectorsFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import static io.qdrant.client.VectorFactory.vector;
import static io.qdrant.client.grpc.Points.NamedVectors;
import io.qdrant.client.grpc.Points.Vector;
import static io.qdrant.client.grpc.Points.Vectors;

/**
Expand All @@ -18,13 +19,13 @@ private VectorsFactory() {

/**
* Creates named vectors
* @param values A map of vector names to values
* @param values A map of vector names to {@link Vector}
* @return a new instance of {@link Vectors}
*/
public static Vectors namedVectors(Map<String, List<Float>> values) {
public static Vectors namedVectors(Map<String, Vector> values) {
return Vectors.newBuilder()
.setVectors(NamedVectors.newBuilder()
.putAllVectors(Maps.transformValues(values, v -> vector(v)))
.putAllVectors(Maps.transformValues(values, v -> v))
)
.build();
}
Expand Down

0 comments on commit 5139936

Please sign in to comment.