Skip to content

Commit 3e081e5

Browse files
JojiiOfficialtimvisee
authored andcommitted
Update rust client for 1.18 (#278)
* [ai+manual] Update rust client for 1.18 * [ai] Add snippets * Regenerate Protos * Sync protos: Remove data-fit option
1 parent 489660f commit 3e081e5

22 files changed

Lines changed: 1410 additions & 41 deletions

proto/collections.proto

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
syntax = "proto3";
22
package qdrant;
33

4-
option csharp_namespace = "Qdrant.Client.Grpc";
5-
64
import "json_with_int.proto";
75
import "qdrant_common.proto";
86

7+
option csharp_namespace = "Qdrant.Client.Grpc";
8+
99
enum Datatype {
1010
Default = 0;
1111
Float32 = 1;
@@ -361,11 +361,24 @@ message BinaryQuantization {
361361
optional BinaryQuantizationQueryEncoding query_encoding = 3;
362362
}
363363

364+
message TurboQuantization{
365+
optional bool always_ram = 1;
366+
optional TurboQuantBitSize bits = 2;
367+
}
368+
369+
enum TurboQuantBitSize{
370+
Bits1 = 0;
371+
Bits1_5 = 1;
372+
Bits2 = 2;
373+
Bits4 = 3;
374+
}
375+
364376
message QuantizationConfig {
365377
oneof quantization {
366378
ScalarQuantization scalar = 1;
367379
ProductQuantization product = 2;
368380
BinaryQuantization binary = 3;
381+
TurboQuantization turboquant = 4;
369382
}
370383
}
371384

@@ -377,6 +390,7 @@ message QuantizationConfigDiff {
377390
ProductQuantization product = 2;
378391
Disabled disabled = 3;
379392
BinaryQuantization binary = 4;
393+
TurboQuantization turboquant = 5;
380394
}
381395
}
382396

@@ -406,6 +420,8 @@ message StrictModeConfig {
406420
optional float search_max_oversampling = 8;
407421
// Max batchsize when upserting
408422
optional uint64 upsert_max_batchsize = 9;
423+
// Max batchsize when searching
424+
optional uint64 search_max_batchsize = 20;
409425
// Max size of a collections vector storage in bytes, ignoring replicas.
410426
optional uint64 max_collection_vector_size_bytes = 10;
411427
// Max number of read operations per minute per replica
@@ -426,6 +442,9 @@ message StrictModeConfig {
426442
optional uint64 max_points_count = 18;
427443
// Max number of payload indexes in a collection
428444
optional uint64 max_payload_index_count = 19;
445+
// Reject memory-consuming update operations when process resident memory exceeds this percentage of total RAM (cgroup-aware, 1-100).
446+
// Delete-style operations are still allowed so memory can be freed.
447+
optional uint32 max_resident_memory_percent = 21;
429448
}
430449

431450
message StrictModeSparseConfig {
@@ -749,8 +768,11 @@ message PayloadSchemaInfo {
749768
}
750769

751770
message UpdateQueueInfo {
752-
// Number of elements in the queue
753-
uint64 length = 1;
771+
// Number of elements in the queue
772+
uint64 length = 1;
773+
774+
// Number of points that are deferred (i.e hidden from search as they're not yet optimized).
775+
optional uint64 deferred_points = 2;
754776
}
755777

756778
message CollectionInfo {

proto/points.proto

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,62 @@ message DeleteFieldIndexCollection {
352352
optional uint64 timeout = 5;
353353
}
354354

355+
// Dense vector creation parameters.
356+
// Only includes immutable properties that define the vector space.
357+
// Storage type, index, and quantization are configured separately.
358+
message DenseVectorCreationConfig {
359+
// Size/dimensionality of the vectors
360+
uint64 size = 1;
361+
// Distance function used for comparing vectors
362+
Distance distance = 2;
363+
// Configuration for multi-vector search (e.g., ColBERT)
364+
optional MultiVectorConfig multivector_config = 3;
365+
// Data type of the vectors (Float32, Float16, Uint8)
366+
optional Datatype datatype = 4;
367+
}
368+
369+
// Sparse vector creation parameters.
370+
// Only includes immutable properties that define the vector space.
371+
message SparseVectorCreationConfig {
372+
// If set - apply modifier to the vector values (e.g., IDF)
373+
optional Modifier modifier = 1;
374+
// Data type used to store weights in the index
375+
optional Datatype datatype = 2;
376+
}
377+
378+
message CreateVectorNameRequest {
379+
// Name of the collection
380+
string collection_name = 1;
381+
// Wait until the changes have been applied?
382+
optional bool wait = 2;
383+
// Name of the new vector
384+
string vector_name = 3;
385+
// Configuration for the new vector - either dense or sparse
386+
oneof vector_config {
387+
// Dense vector parameters
388+
DenseVectorCreationConfig dense_config = 4;
389+
// Sparse vector parameters
390+
SparseVectorCreationConfig sparse_config = 5;
391+
}
392+
// If set, overrides global timeout setting for this request. Unit is seconds.
393+
optional uint64 timeout = 6;
394+
// Write ordering guarantees
395+
optional WriteOrdering ordering = 7;
396+
}
397+
398+
message DeleteVectorNameRequest {
399+
// Name of the collection
400+
string collection_name = 1;
401+
// Wait until the changes have been applied?
402+
optional bool wait = 2;
403+
// Name of the vector to delete
404+
string vector_name = 3;
405+
// If set, overrides global timeout setting for this request. Unit is seconds.
406+
optional uint64 timeout = 4;
407+
// Write ordering guarantees
408+
optional WriteOrdering ordering = 5;
409+
}
410+
355411
message PayloadIncludeSelector {
356412
// List of payload keys to include into result
357413
repeated string fields = 1;
@@ -417,11 +473,11 @@ message QuantizationSearchParams {
417473

418474
// Oversampling factor for quantization.
419475
//
420-
// Defines how many extra vectors should be pre-selected using quantized index,
476+
// Defines how many extra vectors should be preselected using quantized index,
421477
// and then re-scored using original vectors.
422478
//
423479
// For example, if `oversampling` is 2.4 and `limit` is 100,
424-
// then 240 vectors will be pre-selected using quantized index,
480+
// then 240 vectors will be preselected using quantized index,
425481
// and then top-100 will be returned after re-scoring.
426482
optional double oversampling = 3;
427483
}

proto/points_service.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ service Points {
3131
// Delete field index for collection
3232
rpc DeleteFieldIndex(DeleteFieldIndexCollection)
3333
returns (PointsOperationResponse) {}
34+
// Create a new named vector on the collection
35+
rpc CreateVectorName(CreateVectorNameRequest) returns (PointsOperationResponse) {}
36+
// Delete a named vector from the collection
37+
rpc DeleteVectorName(DeleteVectorNameRequest) returns (PointsOperationResponse) {}
3438
// Retrieve closest points based on vector similarity and given filtering
3539
// conditions
3640
rpc Search(SearchPoints) returns (SearchResponse) {}

src/builder_ext.rs

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ use crate::qdrant::update_collection_cluster_setup_request::Operation;
44
use crate::qdrant::{
55
shard_key, AbortShardTransferBuilder, BinaryQuantizationBuilder, ClearPayloadPointsBuilder,
66
ContextExamplePair, CountPointsBuilder, CreateAliasBuilder, CreateCollectionBuilder,
7-
CreateFieldIndexCollectionBuilder, CreateShardKeyRequestBuilder, DeleteCollectionBuilder,
8-
DeleteFieldIndexCollectionBuilder, DeletePayloadPointsBuilder, DeletePointVectorsBuilder,
9-
DeletePointsBuilder, DeleteShardKey, DeleteShardKeyRequestBuilder,
10-
DeleteSnapshotRequestBuilder, DiscoverBatchPointsBuilder, DiscoverPoints,
7+
CreateFieldIndexCollectionBuilder, CreateShardKeyRequestBuilder,
8+
CreateVectorNameRequestBuilder, DeleteCollectionBuilder, DeleteFieldIndexCollectionBuilder,
9+
DeletePayloadPointsBuilder, DeletePointVectorsBuilder, DeletePointsBuilder, DeleteShardKey,
10+
DeleteShardKeyRequestBuilder, DeleteSnapshotRequestBuilder, DeleteVectorNameRequestBuilder,
11+
DenseVectorCreationConfigBuilder, DiscoverBatchPointsBuilder, DiscoverPoints,
1112
DiscoverPointsBuilder, Distance, FacetCountsBuilder, FieldType, GetPointsBuilder,
1213
LookupLocationBuilder, MoveShardBuilder, PayloadExcludeSelector, PayloadIncludeSelector,
1314
PointId, PointStruct, PointVectors, PointsUpdateOperation, ProductQuantizationBuilder,
@@ -16,9 +17,10 @@ use crate::qdrant::{
1617
RecommendPoints, RecommendPointsBuilder, RenameAliasBuilder, ReplicaBuilder,
1718
ReplicateShardBuilder, ScalarQuantizationBuilder, ScrollPointsBuilder,
1819
SearchBatchPointsBuilder, SearchMatrixPointsBuilder, SearchPointGroupsBuilder, SearchPoints,
19-
SearchPointsBuilder, SetPayloadPointsBuilder, ShardKey, UpdateBatchPointsBuilder,
20-
UpdateCollectionBuilder, UpdateCollectionClusterSetupRequestBuilder, UpdatePointVectorsBuilder,
21-
UpsertPointsBuilder, Value, VectorParamsBuilder, VectorsSelector, WithLookupBuilder,
20+
SearchPointsBuilder, SetPayloadPointsBuilder, ShardKey, SparseVectorCreationConfigBuilder,
21+
TurboQuantizationBuilder, UpdateBatchPointsBuilder, UpdateCollectionBuilder,
22+
UpdateCollectionClusterSetupRequestBuilder, UpdatePointVectorsBuilder, UpsertPointsBuilder,
23+
Value, VectorParamsBuilder, VectorsSelector, WithLookupBuilder,
2224
};
2325

2426
impl VectorParamsBuilder {
@@ -54,6 +56,12 @@ impl BinaryQuantizationBuilder {
5456
}
5557
}
5658

59+
impl TurboQuantizationBuilder {
60+
pub fn new() -> Self {
61+
Self::empty()
62+
}
63+
}
64+
5765
impl SearchPointsBuilder {
5866
pub fn new(
5967
collection_name: impl Into<String>,
@@ -307,6 +315,43 @@ impl DeleteFieldIndexCollectionBuilder {
307315
}
308316
}
309317

318+
impl DenseVectorCreationConfigBuilder {
319+
pub fn new(size: u64, distance: Distance) -> Self {
320+
let mut builder = Self::empty();
321+
builder.size = Some(size);
322+
builder.distance = Some(distance.into());
323+
builder
324+
}
325+
}
326+
327+
impl SparseVectorCreationConfigBuilder {
328+
pub fn new() -> Self {
329+
Self::empty()
330+
}
331+
}
332+
333+
impl CreateVectorNameRequestBuilder {
334+
pub fn new(
335+
collection_name: impl Into<String>,
336+
vector_name: impl Into<String>,
337+
vector_config: impl Into<crate::qdrant::create_vector_name_request::VectorConfig>,
338+
) -> Self {
339+
let mut builder = Self::empty();
340+
builder.collection_name = Some(collection_name.into());
341+
builder.vector_name = Some(vector_name.into());
342+
builder.vector_config(vector_config)
343+
}
344+
}
345+
346+
impl DeleteVectorNameRequestBuilder {
347+
pub fn new(collection_name: impl Into<String>, vector_name: impl Into<String>) -> Self {
348+
let mut builder = Self::empty();
349+
builder.collection_name = Some(collection_name.into());
350+
builder.vector_name = Some(vector_name.into());
351+
builder
352+
}
353+
}
354+
310355
impl UpdateCollectionClusterSetupRequestBuilder {
311356
pub fn new(collection_name: impl Into<String>, operation: impl Into<Operation>) -> Self {
312357
let mut builder = Self::empty();

0 commit comments

Comments
 (0)