Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V1.6.0 #50

Merged
merged 4 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/node-js-basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"author": "Qdrant Team",
"license": "Apache-2.0",
"dependencies": {
"@qdrant/qdrant-js": "^1.5.0"
"@qdrant/qdrant-js": "^1.6.0"
}
}
6 changes: 6 additions & 0 deletions packages/js-client-grpc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @qdrant/js-client-grpc

## 1.6.0

### Minor Changes

- Qdrant v1.6.0 API

## 1.5.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/js-client-grpc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qdrant/js-client-grpc",
"version": "1.5.0",
"version": "1.6.0",
"engines": {
"node": ">=18.0.0",
"pnpm": ">=8"
Expand Down
2 changes: 2 additions & 0 deletions packages/js-client-grpc/proto/collections.proto
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,14 @@ message CollectionParams {
optional VectorsConfig vectors_config = 5; // Configuration for vectors
optional uint32 replication_factor = 6; // Number of replicas of each shard that network tries to maintain
optional uint32 write_consistency_factor = 7; // How many replicas should apply the operation for us to consider it successful
optional uint32 read_fan_out_factor = 8; // Fan-out every read request to these many additional remote nodes (and return first available response)
}

message CollectionParamsDiff {
optional uint32 replication_factor = 1; // Number of replicas of each shard that network tries to maintain
optional uint32 write_consistency_factor = 2; // How many replicas should apply the operation for us to consider it successful
optional bool on_disk_payload = 3; // If true - point's payload will not be stored in memory
optional uint32 read_fan_out_factor = 4; // Fan-out every read request to these many additional remote nodes (and return first available response)
}

message CollectionConfig {
Expand Down
42 changes: 32 additions & 10 deletions packages/js-client-grpc/proto/points.proto
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ message QuantizationSearchParams {
optional bool ignore = 1;

/*
If true, use original vectors to re-score top-k results. Default is true.
If true, use original vectors to re-score top-k results. If ignored, qdrant decides automatically does rescore enabled or not.
*/
optional bool rescore = 2;

Expand Down Expand Up @@ -281,15 +281,27 @@ message ScrollPoints {
optional ReadConsistency read_consistency = 8; // Options for specifying read consistency guarantees
}

// How to use positive and negative vectors to find the results, default is `AverageVector`:
enum RecommendStrategy {
// Average positive and negative vectors and create a single query with the formula
// `query = avg_pos + avg_pos - avg_neg`. Then performs normal search.
AverageVector = 0;

// Uses custom search objective. Each candidate is compared against all
// examples, its score is then chosen from the `max(max_pos_score, max_neg_score)`.
// If the `max_neg_score` is chosen then it is squared and negated.
BestScore = 1;
}

message LookupLocation {
string collection_name = 1;
optional string vector_name = 2; // Which vector to use for search, if not specified - use default vector
}

message RecommendPoints {
string collection_name = 1; // name of the collection
repeated PointId positive = 2; // Look for vectors closest to those
repeated PointId negative = 3; // Try to avoid vectors like this
repeated PointId positive = 2; // Look for vectors closest to the vectors from these points
repeated PointId negative = 3; // Try to avoid vectors like the vector from these points
Filter filter = 4; // Filter conditions - return only those points that satisfy the specified conditions
uint64 limit = 5; // Max number of result
reserved 6; // deprecated "with_vector" field
Expand All @@ -301,6 +313,9 @@ message RecommendPoints {
optional WithVectorsSelector with_vectors = 12; // Options for specifying which vectors to include into response
optional LookupLocation lookup_from = 13; // Name of the collection to use for points lookup, if not specified - use current collection
optional ReadConsistency read_consistency = 14; // Options for specifying read consistency guarantees
optional RecommendStrategy strategy = 16; // How to use the example vectors to find the results
repeated Vector positive_vectors = 17; // Look for vectors closest to those
repeated Vector negative_vectors = 18; // Try to avoid vectors like this
}

message RecommendBatchPoints {
Expand All @@ -311,8 +326,8 @@ message RecommendBatchPoints {

message RecommendPointGroups {
string collection_name = 1; // Name of the collection
repeated PointId positive = 2; // Look for vectors closest to those
repeated PointId negative = 3; // Try to avoid vectors like this
repeated PointId positive = 2; // Look for vectors closest to the vectors from these points
repeated PointId negative = 3; // Try to avoid vectors like the vector from these points
Filter filter = 4; // Filter conditions - return only those points that satisfy the specified conditions
uint32 limit = 5; // Max number of groups in result
WithPayloadSelector with_payload = 6; // Options for specifying which payload to include or not
Expand All @@ -325,6 +340,9 @@ message RecommendPointGroups {
uint32 group_size = 13; // Maximum amount of points to return per group
optional ReadConsistency read_consistency = 14; // Options for specifying read consistency guarantees
optional WithLookup with_lookup = 15; // Options for specifying how to use the group id to lookup points in another collection
optional RecommendStrategy strategy = 17; // How to use the example vectors to find the results
repeated Vector positive_vectors = 18; // Look for vectors closest to those
repeated Vector negative_vectors = 19; // Try to avoid vectors like this
}

message CountPoints {
Expand Down Expand Up @@ -533,7 +551,7 @@ message FieldCondition {
GeoBoundingBox geo_bounding_box = 4; // Check if points geolocation lies in a given area
GeoRadius geo_radius = 5; // Check if geo point is within a given radius
ValuesCount values_count = 6; // Check number of values for a specific field
// GeoPolygon geo_polygon = 7; // Check if geo point is within a given polygon
GeoPolygon geo_polygon = 7; // Check if geo point is within a given polygon
}

message Match {
Expand Down Expand Up @@ -574,11 +592,15 @@ message GeoRadius {
float radius = 2; // In meters
}

message GeoLineString {
repeated GeoPoint points = 1; // Ordered sequence of GeoPoints representing the line
}

// For a valid GeoPolygon, both the exterior and interior GeoLineStrings must consist of a minimum of 4 points.
// Additionally, the first and last points of each GeoLineString must be the same.
message GeoPolygon {
// Ordered list of coordinates representing the vertices of a polygon.
// The minimum size is 4, and the first coordinate and the last coordinate
// should be the same to form a closed polygon.
repeated GeoPoint points = 1;
GeoLineString exterior = 1; // The exterior line bounds the surface
repeated GeoLineString interiors = 2; // Interior lines (if present) bound holes within the surface
}

message ValuesCount {
Expand Down
2 changes: 1 addition & 1 deletion packages/js-client-grpc/proto/points_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ service Points {
*/
rpc SearchGroups (SearchPointGroups) returns (SearchGroupsResponse) {}
/*
Iterate over all or filtered points points
Iterate over all or filtered points
*/
rpc Scroll (ScrollPoints) returns (ScrollResponse) {}
/*
Expand Down
2 changes: 2 additions & 0 deletions packages/js-client-grpc/scripts/generate-grpc-sources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ rm $CLIENT_DIR/points_internal_service.proto
rm $CLIENT_DIR/collections_internal_service.proto
rm $CLIENT_DIR/raft_service.proto
rm $CLIENT_DIR/qdrant_internal_service.proto
rm $CLIENT_DIR/health_check.proto
cat $CLIENT_DIR/qdrant.proto \
| grep -v 'collections_internal_service.proto' \
| grep -v 'points_internal_service.proto' \
| grep -v 'raft_service.proto' \
| grep -v 'qdrant_internal_service.proto' \
| grep -v 'health_check.proto' \
> $CLIENT_DIR/qdrant_tmp.proto
mv $CLIENT_DIR/qdrant_tmp.proto $CLIENT_DIR/qdrant.proto

Expand Down
16 changes: 16 additions & 0 deletions packages/js-client-grpc/src/proto/collections_pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1717,6 +1717,13 @@ export class CollectionParams extends Message<CollectionParams> {
*/
writeConsistencyFactor?: number;

/**
* Fan-out every read request to these many additional remote nodes (and return first available response)
*
* @generated from field: optional uint32 read_fan_out_factor = 8;
*/
readFanOutFactor?: number;

constructor(data?: PartialMessage<CollectionParams>) {
super();
proto3.util.initPartial(data, this);
Expand All @@ -1730,6 +1737,7 @@ export class CollectionParams extends Message<CollectionParams> {
{ no: 5, name: "vectors_config", kind: "message", T: VectorsConfig, opt: true },
{ no: 6, name: "replication_factor", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true },
{ no: 7, name: "write_consistency_factor", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true },
{ no: 8, name: "read_fan_out_factor", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true },
]);

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CollectionParams {
Expand Down Expand Up @@ -1774,6 +1782,13 @@ export class CollectionParamsDiff extends Message<CollectionParamsDiff> {
*/
onDiskPayload?: boolean;

/**
* Fan-out every read request to these many additional remote nodes (and return first available response)
*
* @generated from field: optional uint32 read_fan_out_factor = 4;
*/
readFanOutFactor?: number;

constructor(data?: PartialMessage<CollectionParamsDiff>) {
super();
proto3.util.initPartial(data, this);
Expand All @@ -1785,6 +1800,7 @@ export class CollectionParamsDiff extends Message<CollectionParamsDiff> {
{ no: 1, name: "replication_factor", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true },
{ no: 2, name: "write_consistency_factor", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true },
{ no: 3, name: "on_disk_payload", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
{ no: 4, name: "read_fan_out_factor", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true },
]);

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CollectionParamsDiff {
Expand Down
Loading