Skip to content

Commit

Permalink
V1.12.0 (#85)
Browse files Browse the repository at this point in the history
* update grpc protos

* rest api

* version up

* apply api updates

* make api names consistent with other clients

* Update container version to 1.12.0

---------

Co-authored-by: generall <[email protected]>
Co-authored-by: Tim Visée <[email protected]>
  • Loading branch information
3 people authored Oct 8, 2024
1 parent 56676d1 commit c45d94b
Show file tree
Hide file tree
Showing 18 changed files with 1,238 additions and 41 deletions.
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.11.0"
"@qdrant/qdrant-js": "^1.12.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.12.0

### Minor Changes

- Qdrant v1.12.0 API

## 1.11.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.11.0",
"version": "1.12.0",
"engines": {
"node": ">=18.0.0",
"pnpm": ">=8"
Expand Down
20 changes: 18 additions & 2 deletions packages/js-client-grpc/proto/collections.proto
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,18 @@ enum ShardingMethod {
Custom = 1; // Shard by user-defined key
}

message StrictModeConfig {
optional bool enabled = 1;
optional uint32 max_query_limit = 2;
optional uint32 max_timeout = 3;
optional bool unindexed_filtering_retrieve = 4;
optional bool unindexed_filtering_update = 5;

optional uint32 search_max_hnsw_ef = 6;
optional bool search_allow_exact = 7;
optional float search_max_oversampling = 8;
}

message CreateCollection {
string collection_name = 1; // Name of the collection
reserved 2; // Deprecated
Expand All @@ -327,6 +339,7 @@ message CreateCollection {
optional QuantizationConfig quantization_config = 14; // Quantization configuration of vector
optional ShardingMethod sharding_method = 15; // Sharding method
optional SparseVectorConfig sparse_vectors_config = 16; // Configuration for sparse vectors
optional StrictModeConfig strict_mode_config = 17; // Configuration for strict mode
}

message UpdateCollection {
Expand Down Expand Up @@ -376,6 +389,7 @@ message CollectionConfig {
OptimizersConfigDiff optimizer_config = 3; // Configuration of the optimizers
WalConfigDiff wal_config = 4; // Configuration of the Write-Ahead-Log
optional QuantizationConfig quantization_config = 5; // Configuration of the vector quantization
optional StrictModeConfig strict_mode_config = 6; // Configuration of strict mode.
}

enum TokenizerType {
Expand All @@ -392,8 +406,8 @@ message KeywordIndexParams {
}

message IntegerIndexParams {
bool lookup = 1; // If true - support direct lookups.
bool range = 2; // If true - support ranges filters.
optional bool lookup = 1; // If true - support direct lookups.
optional bool range = 2; // If true - support ranges filters.
optional bool is_principal = 3; // If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests.
optional bool on_disk = 4; // If true - store index on disk.
}
Expand All @@ -404,13 +418,15 @@ message FloatIndexParams {
}

message GeoIndexParams {
optional bool on_disk = 1; // If true - store index on disk.
}

message TextIndexParams {
TokenizerType tokenizer = 1; // Tokenizer type
optional bool lowercase = 2; // If true - all tokens will be lowercase
optional uint64 min_token_len = 3; // Minimal token length
optional uint64 max_token_len = 4; // Maximal token length
optional bool on_disk = 5; // If true - store index on disk.
}

message BoolIndexParams {
Expand Down
59 changes: 58 additions & 1 deletion packages/js-client-grpc/proto/points.proto
Original file line number Diff line number Diff line change
Expand Up @@ -589,17 +589,59 @@ message QueryPointGroups {
optional ShardKeySelector shard_key_selector = 17; // Specify in which shards to look for the points, if not specified - look in all shards
}

message FacetCounts {
string collection_name = 1; // Name of the collection
string key = 2; // Payload key of the facet
optional Filter filter = 3; // Filter conditions - return only those points that satisfy the specified conditions.
optional uint64 limit = 4; // Max number of facets. Default is 10.
optional bool exact = 5; // If true, return exact counts, slower but useful for debugging purposes. Default is false.
optional uint64 timeout = 6; // If set, overrides global timeout setting for this request. Unit is seconds.
optional ReadConsistency read_consistency = 7; // Options for specifying read consistency guarantees
optional ShardKeySelector shard_key_selector = 8; // Specify in which shards to look for the points, if not specified - look in all shards
}

message FacetValue {
oneof variant {
string string_value = 1; // String value from the facet
int64 integer_value = 2; // Integer value from the facet
bool bool_value = 3; // Boolean value from the facet
}
}

message FacetValueHit {
message FacetHit {
FacetValue value = 1; // Value from the facet
uint64 count = 2; // Number of points with this value
}

message SearchMatrixPoints {
string collection_name = 1; // Name of the collection
optional Filter filter = 2; // Filter conditions - return only those points that satisfy the specified conditions.
optional uint64 sample = 3; // How many points to select and search within. Default is 10.
optional uint64 limit = 4; // How many neighbours per sample to find. Default is 3.
optional string using = 5; // Define which vector to use for querying. If missing, the default vector is is used.
optional uint64 timeout = 6; // If set, overrides global timeout setting for this request. Unit is seconds.
optional ReadConsistency read_consistency = 7; // Options for specifying read consistency guarantees
optional ShardKeySelector shard_key_selector = 8; // Specify in which shards to look for the points, if not specified - look in all shards
}

message SearchMatrixPairs {
repeated SearchMatrixPair pairs = 1; // List of pairs of points with scores
}

message SearchMatrixPair {
PointId a = 1; // first id of the pair
PointId b = 2; // second id of the pair
float score = 3; // score of the pair
}

message SearchMatrixOffsets {
repeated uint64 offsets_row = 1; // Row indices of the matrix
repeated uint64 offsets_col = 2; // Column indices of the matrix
repeated float scores = 3; // Scores associated with matrix coordinates
repeated PointId ids = 4; // Ids of the points in order
}


message PointsUpdateOperation {
message PointStructList {
repeated PointStruct points = 1;
Expand Down Expand Up @@ -814,6 +856,21 @@ message UpdateBatchResponse {
double time = 2; // Time spent to process
}

message FacetResponse {
repeated FacetHit hits = 1;
double time = 2; // Time spent to process
}

message SearchMatrixPairsResponse {
SearchMatrixPairs result = 1;
double time = 2; // Time spent to process
}

message SearchMatrixOffsetsResponse {
SearchMatrixOffsets result = 1;
double time = 2; // Time spent to process
}

// ---------------------------------------------
// ------------- Filter Conditions -------------
// ---------------------------------------------
Expand Down
12 changes: 12 additions & 0 deletions packages/js-client-grpc/proto/points_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,16 @@ service Points {
Universally query points in a group fashion. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries.
*/
rpc QueryGroups (QueryPointGroups) returns (QueryGroupsResponse) {}
/*
Perform facet counts. For each value in the field, count the number of points that have this value and match the conditions.
*/
rpc Facet (FacetCounts) returns (FacetResponse) {}
/*
Compute distance matrix for sampled points with a pair based output format
*/
rpc SearchMatrixPairs (SearchMatrixPoints) returns (SearchMatrixPairsResponse) {}
/*
Compute distance matrix for sampled points with an offset based output format
*/
rpc SearchMatrixOffsets (SearchMatrixPoints) returns (SearchMatrixOffsetsResponse) {}
}
123 changes: 117 additions & 6 deletions packages/js-client-grpc/src/proto/collections_pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1875,6 +1875,85 @@ export class QuantizationConfigDiff extends Message<QuantizationConfigDiff> {
}
}

/**
* @generated from message qdrant.StrictModeConfig
*/
export class StrictModeConfig extends Message<StrictModeConfig> {
/**
* @generated from field: optional bool enabled = 1;
*/
enabled?: boolean;

/**
* @generated from field: optional uint32 max_query_limit = 2;
*/
maxQueryLimit?: number;

/**
* @generated from field: optional uint32 max_timeout = 3;
*/
maxTimeout?: number;

/**
* @generated from field: optional bool unindexed_filtering_retrieve = 4;
*/
unindexedFilteringRetrieve?: boolean;

/**
* @generated from field: optional bool unindexed_filtering_update = 5;
*/
unindexedFilteringUpdate?: boolean;

/**
* @generated from field: optional uint32 search_max_hnsw_ef = 6;
*/
searchMaxHnswEf?: number;

/**
* @generated from field: optional bool search_allow_exact = 7;
*/
searchAllowExact?: boolean;

/**
* @generated from field: optional float search_max_oversampling = 8;
*/
searchMaxOversampling?: number;

constructor(data?: PartialMessage<StrictModeConfig>) {
super();
proto3.util.initPartial(data, this);
}

static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "qdrant.StrictModeConfig";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
{ no: 2, name: "max_query_limit", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true },
{ no: 3, name: "max_timeout", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true },
{ no: 4, name: "unindexed_filtering_retrieve", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
{ no: 5, name: "unindexed_filtering_update", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
{ no: 6, name: "search_max_hnsw_ef", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true },
{ no: 7, name: "search_allow_exact", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
{ no: 8, name: "search_max_oversampling", kind: "scalar", T: 2 /* ScalarType.FLOAT */, opt: true },
]);

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): StrictModeConfig {
return new StrictModeConfig().fromBinary(bytes, options);
}

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): StrictModeConfig {
return new StrictModeConfig().fromJson(jsonValue, options);
}

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): StrictModeConfig {
return new StrictModeConfig().fromJsonString(jsonString, options);
}

static equals(a: StrictModeConfig | PlainMessage<StrictModeConfig> | undefined, b: StrictModeConfig | PlainMessage<StrictModeConfig> | undefined): boolean {
return proto3.util.equals(StrictModeConfig, a, b);
}
}

/**
* @generated from message qdrant.CreateCollection
*/
Expand Down Expand Up @@ -1977,6 +2056,13 @@ export class CreateCollection extends Message<CreateCollection> {
*/
sparseVectorsConfig?: SparseVectorConfig;

/**
* Configuration for strict mode
*
* @generated from field: optional qdrant.StrictModeConfig strict_mode_config = 17;
*/
strictModeConfig?: StrictModeConfig;

constructor(data?: PartialMessage<CreateCollection>) {
super();
proto3.util.initPartial(data, this);
Expand All @@ -1999,6 +2085,7 @@ export class CreateCollection extends Message<CreateCollection> {
{ no: 14, name: "quantization_config", kind: "message", T: QuantizationConfig, opt: true },
{ no: 15, name: "sharding_method", kind: "enum", T: proto3.getEnumType(ShardingMethod), opt: true },
{ no: 16, name: "sparse_vectors_config", kind: "message", T: SparseVectorConfig, opt: true },
{ no: 17, name: "strict_mode_config", kind: "message", T: StrictModeConfig, opt: true },
]);

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CreateCollection {
Expand Down Expand Up @@ -2404,6 +2491,13 @@ export class CollectionConfig extends Message<CollectionConfig> {
*/
quantizationConfig?: QuantizationConfig;

/**
* Configuration of strict mode.
*
* @generated from field: optional qdrant.StrictModeConfig strict_mode_config = 6;
*/
strictModeConfig?: StrictModeConfig;

constructor(data?: PartialMessage<CollectionConfig>) {
super();
proto3.util.initPartial(data, this);
Expand All @@ -2417,6 +2511,7 @@ export class CollectionConfig extends Message<CollectionConfig> {
{ no: 3, name: "optimizer_config", kind: "message", T: OptimizersConfigDiff },
{ no: 4, name: "wal_config", kind: "message", T: WalConfigDiff },
{ no: 5, name: "quantization_config", kind: "message", T: QuantizationConfig, opt: true },
{ no: 6, name: "strict_mode_config", kind: "message", T: StrictModeConfig, opt: true },
]);

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CollectionConfig {
Expand Down Expand Up @@ -2490,16 +2585,16 @@ export class IntegerIndexParams extends Message<IntegerIndexParams> {
/**
* If true - support direct lookups.
*
* @generated from field: bool lookup = 1;
* @generated from field: optional bool lookup = 1;
*/
lookup = false;
lookup?: boolean;

/**
* If true - support ranges filters.
*
* @generated from field: bool range = 2;
* @generated from field: optional bool range = 2;
*/
range = false;
range?: boolean;

/**
* If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests.
Expand All @@ -2523,8 +2618,8 @@ export class IntegerIndexParams extends Message<IntegerIndexParams> {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "qdrant.IntegerIndexParams";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "lookup", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
{ no: 2, name: "range", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
{ no: 1, name: "lookup", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
{ no: 2, name: "range", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
{ no: 3, name: "is_principal", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
{ no: 4, name: "on_disk", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
]);
Expand Down Expand Up @@ -2597,6 +2692,13 @@ export class FloatIndexParams extends Message<FloatIndexParams> {
* @generated from message qdrant.GeoIndexParams
*/
export class GeoIndexParams extends Message<GeoIndexParams> {
/**
* If true - store index on disk.
*
* @generated from field: optional bool on_disk = 1;
*/
onDisk?: boolean;

constructor(data?: PartialMessage<GeoIndexParams>) {
super();
proto3.util.initPartial(data, this);
Expand All @@ -2605,6 +2707,7 @@ export class GeoIndexParams extends Message<GeoIndexParams> {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "qdrant.GeoIndexParams";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "on_disk", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
]);

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GeoIndexParams {
Expand Down Expand Up @@ -2656,6 +2759,13 @@ export class TextIndexParams extends Message<TextIndexParams> {
*/
maxTokenLen?: bigint;

/**
* If true - store index on disk.
*
* @generated from field: optional bool on_disk = 5;
*/
onDisk?: boolean;

constructor(data?: PartialMessage<TextIndexParams>) {
super();
proto3.util.initPartial(data, this);
Expand All @@ -2668,6 +2778,7 @@ export class TextIndexParams extends Message<TextIndexParams> {
{ no: 2, name: "lowercase", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
{ no: 3, name: "min_token_len", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true },
{ no: 4, name: "max_token_len", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true },
{ no: 5, name: "on_disk", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
]);

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

0 comments on commit c45d94b

Please sign in to comment.