diff --git a/examples/node-js-basic/package.json b/examples/node-js-basic/package.json index 47e0de9..cb48cb8 100644 --- a/examples/node-js-basic/package.json +++ b/examples/node-js-basic/package.json @@ -15,6 +15,6 @@ "author": "Qdrant Team", "license": "Apache-2.0", "dependencies": { - "@qdrant/qdrant-js": "^1.6.0" + "@qdrant/qdrant-js": "^1.7.0" } } diff --git a/packages/js-client-grpc/CHANGELOG.md b/packages/js-client-grpc/CHANGELOG.md index 4533758..42e2266 100644 --- a/packages/js-client-grpc/CHANGELOG.md +++ b/packages/js-client-grpc/CHANGELOG.md @@ -1,5 +1,12 @@ # @qdrant/js-client-grpc +## 1.7.0 + +### Minor Changes + +- Qdrant v1.7.0 API +- [#54](https://github.com/qdrant/qdrant-js/pull/54) Thanks [@Morad-m11](https://github.com/Morad-m11)! - recommendBatch mispell + ## 1.6.0 ### Minor Changes diff --git a/packages/js-client-grpc/package.json b/packages/js-client-grpc/package.json index 71b6f92..83d173c 100644 --- a/packages/js-client-grpc/package.json +++ b/packages/js-client-grpc/package.json @@ -1,6 +1,6 @@ { "name": "@qdrant/js-client-grpc", - "version": "1.6.0", + "version": "1.7.0", "engines": { "node": ">=18.0.0", "pnpm": ">=8" @@ -48,12 +48,12 @@ "codegen:grpc-typescript": "./scripts/generate-grpc-sources.sh" }, "dependencies": { - "@bufbuild/connect": "^0.9.1", - "@bufbuild/connect-node": "^0.9.1", + "@bufbuild/connect": "^0.10.0", + "@bufbuild/connect-node": "^0.10.0", "@bufbuild/protobuf": "^1.2.1" }, "devDependencies": { - "@bufbuild/protoc-gen-connect-es": "^0.9.1", + "@bufbuild/protoc-gen-connect-es": "^0.10.0", "@bufbuild/protoc-gen-es": "^1.2.1", "@protobuf-ts/protoc": "^2.9.0", "@sevinf/maybe": "^0.5.0", diff --git a/packages/js-client-grpc/proto/collections.proto b/packages/js-client-grpc/proto/collections.proto index 093a5a7..765ffcb 100644 --- a/packages/js-client-grpc/proto/collections.proto +++ b/packages/js-client-grpc/proto/collections.proto @@ -1,5 +1,6 @@ syntax = "proto3"; package qdrant; +option csharp_namespace = "Qdrant.Client.Grpc"; message VectorParams { uint64 size = 1; // Size of the vectors @@ -37,6 +38,14 @@ message VectorsConfigDiff { } } +message SparseVectorParams { + optional SparseIndexConfig index = 1; // Configuration of sparse index +} + +message SparseVectorConfig { + map map = 1; +} + message GetCollectionInfoRequest { string collection_name = 1; // Name of the collection } @@ -63,6 +72,7 @@ enum Distance { Cosine = 1; Euclid = 2; Dot = 3; + Manhattan = 4; } enum CollectionStatus { @@ -130,6 +140,18 @@ message HnswConfigDiff { optional uint64 payload_m = 6; } +message SparseIndexConfig { + /* + Prefer a full scan search upto (excluding) this number of vectors. + Note: this is number of vectors, not KiloBytes. + */ + optional uint64 full_scan_threshold = 1; + /* + Store inverted index on disk. If set to false, the index will be stored in RAM. + */ + optional bool on_disk = 2; +} + message WalConfigDiff { optional uint64 wal_capacity_mb = 1; // Size of a single WAL block file optional uint64 wal_segments_ahead = 2; // Number of segments to create in advance @@ -233,6 +255,11 @@ message QuantizationConfigDiff { } } +enum ShardingMethod { + Auto = 0; // Auto-sharding based on record ids + Custom = 1; // Shard by user-defined key +} + message CreateCollection { string collection_name = 1; // Name of the collection reserved 2; // Deprecated @@ -248,6 +275,8 @@ message CreateCollection { optional uint32 write_consistency_factor = 12; // How many replicas should apply the operation for us to consider it successful, default = 1 optional string init_from_collection = 13; // Specify name of the other collection to copy data from 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 } message UpdateCollection { @@ -258,6 +287,7 @@ message UpdateCollection { optional HnswConfigDiff hnsw_config = 5; // New HNSW parameters for the collection index optional VectorsConfigDiff vectors_config = 6; // New vector parameters optional QuantizationConfigDiff quantization_config = 7; // Quantization configuration of vector + optional SparseVectorConfig sparse_vectors_config = 8; // New sparse vector parameters } message DeleteCollection { @@ -279,6 +309,8 @@ message CollectionParams { 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) + optional ShardingMethod sharding_method = 9; // Sharding method + optional SparseVectorConfig sparse_vectors_config = 10; // Configuration for sparse vectors } message CollectionParamsDiff { @@ -326,14 +358,14 @@ message PayloadSchemaInfo { message CollectionInfo { CollectionStatus status = 1; // operating condition of the collection OptimizerStatus optimizer_status = 2; // status of collection optimizers - uint64 vectors_count = 3; // number of vectors in the collection + optional uint64 vectors_count = 3; // Approximate number of vectors in the collection uint64 segments_count = 4; // Number of independent segments reserved 5; // Deprecated reserved 6; // Deprecated CollectionConfig config = 7; // Configuration map payload_schema = 8; // Collection data types - uint64 points_count = 9; // number of points in the collection - optional uint64 indexed_vectors_count = 10; // number of indexed vectors in the collection. + optional uint64 points_count = 9; // Approximate number of points in the collection + optional uint64 indexed_vectors_count = 10; // Approximate number of indexed vectors in the collection. } message ChangeAliases { @@ -390,18 +422,28 @@ enum ReplicaState { Partial = 2; // The shard is partially loaded and is currently receiving data from other shards Initializing = 3; // Collection is being created Listener = 4; // A shard which receives data, but is not used for search; Useful for backup shards + PartialSnapshot = 5; // Snapshot shard transfer is in progress; Updates should not be sent to (and are ignored by) the shard +} + +message ShardKey { + oneof key { + string keyword = 1; // String key + uint64 number = 2; // Number key + } } message LocalShardInfo { uint32 shard_id = 1; // Local shard id uint64 points_count = 2; // Number of points in the shard ReplicaState state = 3; // Is replica active + optional ShardKey shard_key = 4; // User-defined shard key } message RemoteShardInfo { uint32 shard_id = 1; // Local shard id uint64 peer_id = 2; // Remote peer id ReplicaState state = 3; // Is replica active + optional ShardKey shard_key = 4; // User-defined shard key } message ShardTransferInfo { @@ -423,6 +465,12 @@ message MoveShard { uint32 shard_id = 1; // Local shard id uint64 from_peer_id = 2; uint64 to_peer_id = 3; + optional ShardTransferMethod method = 4; +} + +enum ShardTransferMethod { + StreamRecords = 0; + Snapshot = 1; } message Replica { @@ -430,6 +478,17 @@ message Replica { uint64 peer_id = 2; } +message CreateShardKey { + ShardKey shard_key = 1; // User-defined shard key + optional uint32 shards_number = 2; // Number of shards to create per shard key + optional uint32 replication_factor = 3; // Number of replicas of each shard to create + repeated uint64 placement = 4; // List of peer ids, allowed to create shards. If empty - all peers are allowed +} + +message DeleteShardKey { + ShardKey shard_key = 1; // Shard key to delete +} + message UpdateCollectionClusterSetupRequest { string collection_name = 1; // Name of the collection oneof operation { @@ -437,6 +496,8 @@ message UpdateCollectionClusterSetupRequest { MoveShard replicate_shard = 3; MoveShard abort_transfer = 4; Replica drop_replica = 5; + CreateShardKey create_shard_key = 7; + DeleteShardKey delete_shard_key = 8; } optional uint64 timeout = 6; // Wait timeout for operation commit in seconds, if not specified - default value will be supplied } @@ -444,3 +505,23 @@ message UpdateCollectionClusterSetupRequest { message UpdateCollectionClusterSetupResponse { bool result = 1; } + +message CreateShardKeyRequest { + string collection_name = 1; // Name of the collection + CreateShardKey request = 2; // Request to create shard key + optional uint64 timeout = 3; // Wait timeout for operation commit in seconds, if not specified - default value will be supplied +} + +message DeleteShardKeyRequest { + string collection_name = 1; // Name of the collection + DeleteShardKey request = 2; // Request to delete shard key + optional uint64 timeout = 3; // Wait timeout for operation commit in seconds, if not specified - default value will be supplied +} + +message CreateShardKeyResponse { + bool result = 1; +} + +message DeleteShardKeyResponse { + bool result = 1; +} diff --git a/packages/js-client-grpc/proto/collections_service.proto b/packages/js-client-grpc/proto/collections_service.proto index 2297027..723124e 100644 --- a/packages/js-client-grpc/proto/collections_service.proto +++ b/packages/js-client-grpc/proto/collections_service.proto @@ -3,6 +3,7 @@ syntax = "proto3"; import "collections.proto"; package qdrant; +option csharp_namespace = "Qdrant.Client.Grpc"; service Collections { /* @@ -45,4 +46,12 @@ service Collections { Update cluster setup for a collection */ rpc UpdateCollectionClusterSetup (UpdateCollectionClusterSetupRequest) returns (UpdateCollectionClusterSetupResponse) {} + /* + Create shard key + */ + rpc CreateShardKey (CreateShardKeyRequest) returns (CreateShardKeyResponse) {} + /* + Delete shard key + */ + rpc DeleteShardKey (DeleteShardKeyRequest) returns (DeleteShardKeyResponse) {} } diff --git a/packages/js-client-grpc/proto/json_with_int.proto b/packages/js-client-grpc/proto/json_with_int.proto index 3fc496e..283fdc3 100644 --- a/packages/js-client-grpc/proto/json_with_int.proto +++ b/packages/js-client-grpc/proto/json_with_int.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package qdrant; +option csharp_namespace = "Qdrant.Client.Grpc"; // `Struct` represents a structured data value, consisting of fields // which map to dynamically typed values. In some languages, `Struct` diff --git a/packages/js-client-grpc/proto/points.proto b/packages/js-client-grpc/proto/points.proto index 43a7e32..f95a4d3 100644 --- a/packages/js-client-grpc/proto/points.proto +++ b/packages/js-client-grpc/proto/points.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package qdrant; +option csharp_namespace = "Qdrant.Client.Grpc"; import "json_with_int.proto"; import "collections.proto"; @@ -40,10 +41,23 @@ message PointId { } } +message SparseIndices { + repeated uint32 data = 1; +} + message Vector { repeated float data = 1; + optional SparseIndices indices = 2; +} + +// --------------------------------------------- +// ----------------- ShardKeySelector ---------- +// --------------------------------------------- +message ShardKeySelector { + repeated ShardKey shard_keys = 1; // List of shard keys which should be used in the request } + // --------------------------------------------- // ---------------- RPC Requests --------------- // --------------------------------------------- @@ -53,6 +67,7 @@ message UpsertPoints { optional bool wait = 2; // Wait until the changes have been applied? repeated PointStruct points = 3; optional WriteOrdering ordering = 4; // Write ordering guarantees + optional ShardKeySelector shard_key_selector = 5; // Option for custom sharding to specify used shard keys } message DeletePoints { @@ -60,6 +75,7 @@ message DeletePoints { optional bool wait = 2; // Wait until the changes have been applied? PointsSelector points = 3; // Affected points optional WriteOrdering ordering = 4; // Write ordering guarantees + optional ShardKeySelector shard_key_selector = 5; // Option for custom sharding to specify used shard keys } message GetPoints { @@ -69,6 +85,7 @@ message GetPoints { WithPayloadSelector with_payload = 4; // Options for specifying which payload to include or not optional WithVectorsSelector with_vectors = 5; // Options for specifying which vectors to include into response optional ReadConsistency read_consistency = 6; // Options for specifying read consistency guarantees + optional ShardKeySelector shard_key_selector = 7; // Specify in which shards to look for the points, if not specified - look in all shards } message UpdatePointVectors { @@ -76,6 +93,7 @@ message UpdatePointVectors { optional bool wait = 2; // Wait until the changes have been applied? repeated PointVectors points = 3; // List of points and vectors to update optional WriteOrdering ordering = 4; // Write ordering guarantees + optional ShardKeySelector shard_key_selector = 5; // Option for custom sharding to specify used shard keys } message PointVectors { @@ -89,6 +107,7 @@ message DeletePointVectors { PointsSelector points_selector = 3; // Affected points VectorsSelector vectors = 4; // List of vector names to delete optional WriteOrdering ordering = 5; // Write ordering guarantees + optional ShardKeySelector shard_key_selector = 6; // Option for custom sharding to specify used shard keys } message SetPayloadPoints { @@ -98,6 +117,7 @@ message SetPayloadPoints { reserved 4; // List of point to modify, deprecated optional PointsSelector points_selector = 5; // Affected points optional WriteOrdering ordering = 6; // Write ordering guarantees + optional ShardKeySelector shard_key_selector = 7; // Option for custom sharding to specify used shard keys } message DeletePayloadPoints { @@ -107,6 +127,7 @@ message DeletePayloadPoints { reserved 4; // Affected points, deprecated optional PointsSelector points_selector = 5; // Affected points optional WriteOrdering ordering = 6; // Write ordering guarantees + optional ShardKeySelector shard_key_selector = 7; // Option for custom sharding to specify used shard keys } message ClearPayloadPoints { @@ -114,6 +135,7 @@ message ClearPayloadPoints { optional bool wait = 2; // Wait until the changes have been applied? PointsSelector points = 3; // Affected points optional WriteOrdering ordering = 4; // Write ordering guarantees + optional ShardKeySelector shard_key_selector = 5; // Option for custom sharding to specify used shard keys } enum FieldType { @@ -239,12 +261,16 @@ message SearchPoints { optional string vector_name = 10; // Which vector to use for search, if not specified - use default vector optional WithVectorsSelector with_vectors = 11; // Options for specifying which vectors to include into response optional ReadConsistency read_consistency = 12; // Options for specifying read consistency guarantees + optional uint64 timeout = 13; // If set, overrides global timeout setting for this request. Unit is seconds. + optional ShardKeySelector shard_key_selector = 14; // Specify in which shards to look for the points, if not specified - look in all shards + optional SparseIndices sparse_indices = 15; } message SearchBatchPoints { string collection_name = 1; // Name of the collection repeated SearchPoints search_points = 2; optional ReadConsistency read_consistency = 3; // Options for specifying read consistency guarantees + optional uint64 timeout = 4; // If set, overrides global timeout setting for this request. Unit is seconds. } message WithLookup { @@ -268,6 +294,9 @@ message SearchPointGroups { uint32 group_size = 11; // Maximum amount of points to return per group optional ReadConsistency read_consistency = 12; // Options for specifying read consistency guarantees optional WithLookup with_lookup = 13; // Options for specifying how to use the group id to lookup points in another collection + optional uint64 timeout = 14; // If set, overrides global timeout setting for this request. Unit is seconds. + optional ShardKeySelector shard_key_selector = 15; // Specify in which shards to look for the points, if not specified - look in all shards + optional SparseIndices sparse_indices = 16; } message ScrollPoints { @@ -279,6 +308,7 @@ message ScrollPoints { WithPayloadSelector with_payload = 6; // Options for specifying which payload to include or not optional WithVectorsSelector with_vectors = 7; // Options for specifying which vectors to include into response optional ReadConsistency read_consistency = 8; // Options for specifying read consistency guarantees + optional ShardKeySelector shard_key_selector = 9; // Specify in which shards to look for the points, if not specified - look in all shards } // How to use positive and negative vectors to find the results, default is `AverageVector`: @@ -296,6 +326,7 @@ enum RecommendStrategy { message LookupLocation { string collection_name = 1; optional string vector_name = 2; // Which vector to use for search, if not specified - use default vector + optional ShardKeySelector shard_key_selector = 3; // Specify in which shards to look for the points, if not specified - look in all shards } message RecommendPoints { @@ -316,12 +347,15 @@ message RecommendPoints { 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 + optional uint64 timeout = 19; // If set, overrides global timeout setting for this request. Unit is seconds. + optional ShardKeySelector shard_key_selector = 20; // Specify in which shards to look for the points, if not specified - look in all shards } message RecommendBatchPoints { string collection_name = 1; // Name of the collection repeated RecommendPoints recommend_points = 2; optional ReadConsistency read_consistency = 3; // Options for specifying read consistency guarantees + optional uint64 timeout = 4; // If set, overrides global timeout setting for this request. Unit is seconds. } message RecommendPointGroups { @@ -343,43 +377,106 @@ message RecommendPointGroups { 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 + optional uint64 timeout = 20; // If set, overrides global timeout setting for this request. Unit is seconds. + optional ShardKeySelector shard_key_selector = 21; // Specify in which shards to look for the points, if not specified - look in all shards +} + +message TargetVector { + oneof target { + VectorExample single = 1; + + // leaving extensibility for possibly adding multi-target + } +} + +message VectorExample { + oneof example { + PointId id = 1; + Vector vector = 2; + } +} + +message ContextExamplePair { + VectorExample positive = 1; + VectorExample negative = 2; +} + +message DiscoverPoints { + string collection_name = 1; // name of the collection + TargetVector target = 2; // Use this as the primary search objective + repeated ContextExamplePair context = 3; // Search will be constrained by these pairs of examples + Filter filter = 4; // Filter conditions - return only those points that satisfy the specified conditions + uint64 limit = 5; // Max number of result + WithPayloadSelector with_payload = 6; // Options for specifying which payload to include or not + SearchParams params = 7; // Search config + optional uint64 offset = 8; // Offset of the result + optional string using = 9; // Define which vector to use for recommendation, if not specified - default vector + optional WithVectorsSelector with_vectors = 10; // Options for specifying which vectors to include into response + optional LookupLocation lookup_from = 11; // Name of the collection to use for points lookup, if not specified - use current collection + optional ReadConsistency read_consistency = 12; // Options for specifying read consistency guarantees + optional uint64 timeout = 13; // If set, overrides global timeout setting for this request. Unit is seconds. + optional ShardKeySelector shard_key_selector = 14; // Specify in which shards to look for the points, if not specified - look in all shards +} + +message DiscoverBatchPoints { + string collection_name = 1; // Name of the collection + repeated DiscoverPoints discover_points = 2; + optional ReadConsistency read_consistency = 3; // Options for specifying read consistency guarantees + optional uint64 timeout = 4; // If set, overrides global timeout setting for this request. Unit is seconds. } message CountPoints { string collection_name = 1; // name of the collection Filter filter = 2; // Filter conditions - return only those points that satisfy the specified conditions optional bool exact = 3; // If `true` - return exact count, if `false` - return approximate count + optional ReadConsistency read_consistency = 4; // Options for specifying read consistency guarantees + optional ShardKeySelector shard_key_selector = 5; // Specify in which shards to look for the points, if not specified - look in all shards } message PointsUpdateOperation { message PointStructList { repeated PointStruct points = 1; + optional ShardKeySelector shard_key_selector = 2; // Option for custom sharding to specify used shard keys } message SetPayload { map payload = 1; optional PointsSelector points_selector = 2; // Affected points + optional ShardKeySelector shard_key_selector = 3; // Option for custom sharding to specify used shard keys } message DeletePayload { repeated string keys = 1; optional PointsSelector points_selector = 2; // Affected points + optional ShardKeySelector shard_key_selector = 3; // Option for custom sharding to specify used shard keys } message UpdateVectors { repeated PointVectors points = 1; // List of points and vectors to update + optional ShardKeySelector shard_key_selector = 2; // Option for custom sharding to specify used shard keys } message DeleteVectors { PointsSelector points_selector = 1; // Affected points VectorsSelector vectors = 2; // List of vector names to delete + optional ShardKeySelector shard_key_selector = 3; // Option for custom sharding to specify used shard keys + } + message DeletePoints { + PointsSelector points = 1; // Affected points + optional ShardKeySelector shard_key_selector = 2; // Option for custom sharding to specify used shard keys + } + message ClearPayload { + PointsSelector points = 1; // Affected points + optional ShardKeySelector shard_key_selector = 2; // Option for custom sharding to specify used shard keys } oneof operation { PointStructList upsert = 1; - PointsSelector delete = 2; + PointsSelector delete_deprecated = 2 [deprecated=true]; SetPayload set_payload = 3; SetPayload overwrite_payload = 4; DeletePayload delete_payload = 5; - PointsSelector clear_payload = 6; + PointsSelector clear_payload_deprecated = 6 [deprecated=true]; UpdateVectors update_vectors = 7; DeleteVectors delete_vectors = 8; + DeletePoints delete_points = 9; + ClearPayload clear_payload = 10; } } @@ -400,7 +497,7 @@ message PointsOperationResponse { } message UpdateResult { - uint64 operation_id = 1; // Number of operation + optional uint64 operation_id = 1; // Number of operation UpdateStatus status = 2; // Operation status } @@ -417,6 +514,7 @@ message ScoredPoint { reserved 4; // deprecated "vector" field uint64 version = 5; // Last update operation applied to this point optional Vectors vectors = 6; // Vectors to search + optional ShardKey shard_key = 7; // Shard key } message GroupId { @@ -479,6 +577,7 @@ message RetrievedPoint { map payload = 2; reserved 3; // deprecated "vector" field optional Vectors vectors = 4; + optional ShardKey shard_key = 5; // Shard key } message GetResponse { @@ -496,6 +595,16 @@ message RecommendBatchResponse { double time = 2; // Time spent to process } +message DiscoverResponse { + repeated ScoredPoint result = 1; + double time = 2; // Time spent to process +} + +message DiscoverBatchResponse { + repeated BatchResult result = 1; + double time = 2; // Time spent to process +} + message RecommendGroupsResponse { GroupsResult result = 1; double time = 2; // Time spent to process diff --git a/packages/js-client-grpc/proto/points_service.proto b/packages/js-client-grpc/proto/points_service.proto index 5921777..ddfdc62 100644 --- a/packages/js-client-grpc/proto/points_service.proto +++ b/packages/js-client-grpc/proto/points_service.proto @@ -3,8 +3,7 @@ syntax = "proto3"; import "points.proto"; package qdrant; - -import "google/protobuf/struct.proto"; +option csharp_namespace = "Qdrant.Client.Grpc"; service Points { /* @@ -75,10 +74,32 @@ service Points { Look for the points which are closer to stored positive examples and at the same time further to negative examples. */ rpc RecommendBatch (RecommendBatchPoints) returns (RecommendBatchResponse) {} - /* + /* Look for the points which are closer to stored positive examples and at the same time further to negative examples, grouped by a given field */ rpc RecommendGroups (RecommendPointGroups) returns (RecommendGroupsResponse) {} + /* + Use context and a target to find the most similar points to the target, constrained by the context. + + When using only the context (without a target), a special search - called context search - is performed where + pairs of points are used to generate a loss that guides the search towards the zone where + most positive examples overlap. This means that the score minimizes the scenario of + finding a point closer to a negative than to a positive part of a pair. + + Since the score of a context relates to loss, the maximum score a point can get is 0.0, + and it becomes normal that many points can have a score of 0.0. + + When using target (with or without context), the score behaves a little different: The + integer part of the score represents the rank with respect to the context, while the + decimal part of the score relates to the distance to the target. The context part of the score for + each pair is calculated +1 if the point is closer to a positive than to a negative part of a pair, + and -1 otherwise. + */ + rpc Discover (DiscoverPoints) returns (DiscoverResponse) {} + /* + Batch request points based on { positive, negative } pairs of examples, and/or a target + */ + rpc DiscoverBatch (DiscoverBatchPoints) returns (DiscoverBatchResponse) {} /* Count points in collection with given filtering conditions */ diff --git a/packages/js-client-grpc/proto/qdrant.proto b/packages/js-client-grpc/proto/qdrant.proto index ccbfa60..4f58399 100644 --- a/packages/js-client-grpc/proto/qdrant.proto +++ b/packages/js-client-grpc/proto/qdrant.proto @@ -5,6 +5,7 @@ import "points_service.proto"; import "snapshots_service.proto"; package qdrant; +option csharp_namespace = "Qdrant.Client.Grpc"; service Qdrant { rpc HealthCheck (HealthCheckRequest) returns (HealthCheckReply) {} diff --git a/packages/js-client-grpc/proto/snapshots_service.proto b/packages/js-client-grpc/proto/snapshots_service.proto index 5770268..5127b28 100644 --- a/packages/js-client-grpc/proto/snapshots_service.proto +++ b/packages/js-client-grpc/proto/snapshots_service.proto @@ -1,8 +1,8 @@ syntax = "proto3"; package qdrant; +option csharp_namespace = "Qdrant.Client.Grpc"; -import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; service Snapshots { @@ -15,7 +15,7 @@ service Snapshots { */ rpc List (ListSnapshotsRequest) returns (ListSnapshotsResponse) {} /* - Delete collection snapshots + Delete collection snapshot */ rpc Delete (DeleteSnapshotRequest) returns (DeleteSnapshotResponse) {} /* @@ -27,10 +27,9 @@ service Snapshots { */ rpc ListFull (ListFullSnapshotsRequest) returns (ListSnapshotsResponse) {} /* - List full storage snapshots + Delete full storage snapshot */ rpc DeleteFull (DeleteFullSnapshotRequest) returns (DeleteSnapshotResponse) {} - } message CreateFullSnapshotRequest {} diff --git a/packages/js-client-grpc/scripts/generate-grpc-sources.sh b/packages/js-client-grpc/scripts/generate-grpc-sources.sh index 7401f98..818c683 100755 --- a/packages/js-client-grpc/scripts/generate-grpc-sources.sh +++ b/packages/js-client-grpc/scripts/generate-grpc-sources.sh @@ -25,12 +25,14 @@ 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 +rm $CLIENT_DIR/shard_snapshots_service.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' \ + | grep -v 'shard_snapshots_service.proto' \ > $CLIENT_DIR/qdrant_tmp.proto mv $CLIENT_DIR/qdrant_tmp.proto $CLIENT_DIR/qdrant.proto diff --git a/packages/js-client-grpc/src/proto/collections_pb.ts b/packages/js-client-grpc/src/proto/collections_pb.ts index d8c4d49..9a9f556 100644 --- a/packages/js-client-grpc/src/proto/collections_pb.ts +++ b/packages/js-client-grpc/src/proto/collections_pb.ts @@ -29,6 +29,11 @@ export enum Distance { * @generated from enum value: Dot = 3; */ Dot = 3, + + /** + * @generated from enum value: Manhattan = 4; + */ + Manhattan = 4, } // Retrieve enum metadata with: proto3.getEnumType(Distance) proto3.util.setEnumType(Distance, "qdrant.Distance", [ @@ -36,6 +41,7 @@ proto3.util.setEnumType(Distance, "qdrant.Distance", [ { no: 1, name: "Cosine" }, { no: 2, name: "Euclid" }, { no: 3, name: "Dot" }, + { no: 4, name: "Manhattan" }, ]); /** @@ -184,6 +190,30 @@ proto3.util.setEnumType(CompressionRatio, "qdrant.CompressionRatio", [ { no: 4, name: "x64" }, ]); +/** + * @generated from enum qdrant.ShardingMethod + */ +export enum ShardingMethod { + /** + * Auto-sharding based on record ids + * + * @generated from enum value: Auto = 0; + */ + Auto = 0, + + /** + * Shard by user-defined key + * + * @generated from enum value: Custom = 1; + */ + Custom = 1, +} +// Retrieve enum metadata with: proto3.getEnumType(ShardingMethod) +proto3.util.setEnumType(ShardingMethod, "qdrant.ShardingMethod", [ + { no: 0, name: "Auto" }, + { no: 1, name: "Custom" }, +]); + /** * @generated from enum qdrant.TokenizerType */ @@ -260,6 +290,13 @@ export enum ReplicaState { * @generated from enum value: Listener = 4; */ Listener = 4, + + /** + * Snapshot shard transfer is in progress; Updates should not be sent to (and are ignored by) the shard + * + * @generated from enum value: PartialSnapshot = 5; + */ + PartialSnapshot = 5, } // Retrieve enum metadata with: proto3.getEnumType(ReplicaState) proto3.util.setEnumType(ReplicaState, "qdrant.ReplicaState", [ @@ -268,6 +305,27 @@ proto3.util.setEnumType(ReplicaState, "qdrant.ReplicaState", [ { no: 2, name: "Partial" }, { no: 3, name: "Initializing" }, { no: 4, name: "Listener" }, + { no: 5, name: "PartialSnapshot" }, +]); + +/** + * @generated from enum qdrant.ShardTransferMethod + */ +export enum ShardTransferMethod { + /** + * @generated from enum value: StreamRecords = 0; + */ + StreamRecords = 0, + + /** + * @generated from enum value: Snapshot = 1; + */ + Snapshot = 1, +} +// Retrieve enum metadata with: proto3.getEnumType(ShardTransferMethod) +proto3.util.setEnumType(ShardTransferMethod, "qdrant.ShardTransferMethod", [ + { no: 0, name: "StreamRecords" }, + { no: 1, name: "Snapshot" }, ]); /** @@ -570,6 +628,82 @@ export class VectorsConfigDiff extends Message { } } +/** + * @generated from message qdrant.SparseVectorParams + */ +export class SparseVectorParams extends Message { + /** + * Configuration of sparse index + * + * @generated from field: optional qdrant.SparseIndexConfig index = 1; + */ + index?: SparseIndexConfig; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.SparseVectorParams"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "index", kind: "message", T: SparseIndexConfig, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SparseVectorParams { + return new SparseVectorParams().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SparseVectorParams { + return new SparseVectorParams().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SparseVectorParams { + return new SparseVectorParams().fromJsonString(jsonString, options); + } + + static equals(a: SparseVectorParams | PlainMessage | undefined, b: SparseVectorParams | PlainMessage | undefined): boolean { + return proto3.util.equals(SparseVectorParams, a, b); + } +} + +/** + * @generated from message qdrant.SparseVectorConfig + */ +export class SparseVectorConfig extends Message { + /** + * @generated from field: map map = 1; + */ + map: { [key: string]: SparseVectorParams } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.SparseVectorConfig"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "map", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: SparseVectorParams} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SparseVectorConfig { + return new SparseVectorConfig().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SparseVectorConfig { + return new SparseVectorConfig().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SparseVectorConfig { + return new SparseVectorConfig().fromJsonString(jsonString, options); + } + + static equals(a: SparseVectorConfig | PlainMessage | undefined, b: SparseVectorConfig | PlainMessage | undefined): boolean { + return proto3.util.equals(SparseVectorConfig, a, b); + } +} + /** * @generated from message qdrant.GetCollectionInfoRequest */ @@ -900,6 +1034,56 @@ export class HnswConfigDiff extends Message { } } +/** + * @generated from message qdrant.SparseIndexConfig + */ +export class SparseIndexConfig extends Message { + /** + * + * Prefer a full scan search upto (excluding) this number of vectors. + * Note: this is number of vectors, not KiloBytes. + * + * @generated from field: optional uint64 full_scan_threshold = 1; + */ + fullScanThreshold?: bigint; + + /** + * + * Store inverted index on disk. If set to false, the index will be stored in RAM. + * + * @generated from field: optional bool on_disk = 2; + */ + onDisk?: boolean; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.SparseIndexConfig"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "full_scan_threshold", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, + { no: 2, name: "on_disk", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SparseIndexConfig { + return new SparseIndexConfig().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SparseIndexConfig { + return new SparseIndexConfig().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SparseIndexConfig { + return new SparseIndexConfig().fromJsonString(jsonString, options); + } + + static equals(a: SparseIndexConfig | PlainMessage | undefined, b: SparseIndexConfig | PlainMessage | undefined): boolean { + return proto3.util.equals(SparseIndexConfig, a, b); + } +} + /** * @generated from message qdrant.WalConfigDiff */ @@ -1458,6 +1642,20 @@ export class CreateCollection extends Message { */ quantizationConfig?: QuantizationConfig; + /** + * Sharding method + * + * @generated from field: optional qdrant.ShardingMethod sharding_method = 15; + */ + shardingMethod?: ShardingMethod; + + /** + * Configuration for sparse vectors + * + * @generated from field: optional qdrant.SparseVectorConfig sparse_vectors_config = 16; + */ + sparseVectorsConfig?: SparseVectorConfig; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -1478,6 +1676,8 @@ export class CreateCollection extends Message { { no: 12, name: "write_consistency_factor", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, { no: 13, name: "init_from_collection", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, { 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 }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CreateCollection { @@ -1550,6 +1750,13 @@ export class UpdateCollection extends Message { */ quantizationConfig?: QuantizationConfigDiff; + /** + * New sparse vector parameters + * + * @generated from field: optional qdrant.SparseVectorConfig sparse_vectors_config = 8; + */ + sparseVectorsConfig?: SparseVectorConfig; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -1565,6 +1772,7 @@ export class UpdateCollection extends Message { { no: 5, name: "hnsw_config", kind: "message", T: HnswConfigDiff, opt: true }, { no: 6, name: "vectors_config", kind: "message", T: VectorsConfigDiff, opt: true }, { no: 7, name: "quantization_config", kind: "message", T: QuantizationConfigDiff, opt: true }, + { no: 8, name: "sparse_vectors_config", kind: "message", T: SparseVectorConfig, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): UpdateCollection { @@ -1724,6 +1932,20 @@ export class CollectionParams extends Message { */ readFanOutFactor?: number; + /** + * Sharding method + * + * @generated from field: optional qdrant.ShardingMethod sharding_method = 9; + */ + shardingMethod?: ShardingMethod; + + /** + * Configuration for sparse vectors + * + * @generated from field: optional qdrant.SparseVectorConfig sparse_vectors_config = 10; + */ + sparseVectorsConfig?: SparseVectorConfig; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -1738,6 +1960,8 @@ export class CollectionParams extends Message { { 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 }, + { no: 9, name: "sharding_method", kind: "enum", T: proto3.getEnumType(ShardingMethod), opt: true }, + { no: 10, name: "sparse_vectors_config", kind: "message", T: SparseVectorConfig, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): CollectionParams { @@ -2073,11 +2297,11 @@ export class CollectionInfo extends Message { optimizerStatus?: OptimizerStatus; /** - * number of vectors in the collection + * Approximate number of vectors in the collection * - * @generated from field: uint64 vectors_count = 3; + * @generated from field: optional uint64 vectors_count = 3; */ - vectorsCount = protoInt64.zero; + vectorsCount?: bigint; /** * Number of independent segments @@ -2101,14 +2325,14 @@ export class CollectionInfo extends Message { payloadSchema: { [key: string]: PayloadSchemaInfo } = {}; /** - * number of points in the collection + * Approximate number of points in the collection * - * @generated from field: uint64 points_count = 9; + * @generated from field: optional uint64 points_count = 9; */ - pointsCount = protoInt64.zero; + pointsCount?: bigint; /** - * number of indexed vectors in the collection. + * Approximate number of indexed vectors in the collection. * * @generated from field: optional uint64 indexed_vectors_count = 10; */ @@ -2124,11 +2348,11 @@ export class CollectionInfo extends Message { static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "status", kind: "enum", T: proto3.getEnumType(CollectionStatus) }, { no: 2, name: "optimizer_status", kind: "message", T: OptimizerStatus }, - { no: 3, name: "vectors_count", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 3, name: "vectors_count", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, { no: 4, name: "segments_count", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 7, name: "config", kind: "message", T: CollectionConfig }, { no: 8, name: "payload_schema", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: PayloadSchemaInfo} }, - { no: 9, name: "points_count", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 9, name: "points_count", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, { no: 10, name: "indexed_vectors_count", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, ]); @@ -2587,6 +2811,60 @@ export class CollectionClusterInfoRequest extends Message { + /** + * @generated from oneof qdrant.ShardKey.key + */ + key: { + /** + * String key + * + * @generated from field: string keyword = 1; + */ + value: string; + case: "keyword"; + } | { + /** + * Number key + * + * @generated from field: uint64 number = 2; + */ + value: bigint; + case: "number"; + } | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.ShardKey"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "keyword", kind: "scalar", T: 9 /* ScalarType.STRING */, oneof: "key" }, + { no: 2, name: "number", kind: "scalar", T: 4 /* ScalarType.UINT64 */, oneof: "key" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ShardKey { + return new ShardKey().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ShardKey { + return new ShardKey().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ShardKey { + return new ShardKey().fromJsonString(jsonString, options); + } + + static equals(a: ShardKey | PlainMessage | undefined, b: ShardKey | PlainMessage | undefined): boolean { + return proto3.util.equals(ShardKey, a, b); + } +} + /** * @generated from message qdrant.LocalShardInfo */ @@ -2612,6 +2890,13 @@ export class LocalShardInfo extends Message { */ state = ReplicaState.Active; + /** + * User-defined shard key + * + * @generated from field: optional qdrant.ShardKey shard_key = 4; + */ + shardKey?: ShardKey; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -2623,6 +2908,7 @@ export class LocalShardInfo extends Message { { no: 1, name: "shard_id", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, { no: 2, name: "points_count", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 3, name: "state", kind: "enum", T: proto3.getEnumType(ReplicaState) }, + { no: 4, name: "shard_key", kind: "message", T: ShardKey, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): LocalShardInfo { @@ -2667,6 +2953,13 @@ export class RemoteShardInfo extends Message { */ state = ReplicaState.Active; + /** + * User-defined shard key + * + * @generated from field: optional qdrant.ShardKey shard_key = 4; + */ + shardKey?: ShardKey; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -2678,6 +2971,7 @@ export class RemoteShardInfo extends Message { { no: 1, name: "shard_id", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, { no: 2, name: "peer_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 3, name: "state", kind: "enum", T: proto3.getEnumType(ReplicaState) }, + { no: 4, name: "shard_key", kind: "message", T: ShardKey, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RemoteShardInfo { @@ -2848,6 +3142,11 @@ export class MoveShard extends Message { */ toPeerId = protoInt64.zero; + /** + * @generated from field: optional qdrant.ShardTransferMethod method = 4; + */ + method?: ShardTransferMethod; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -2859,6 +3158,7 @@ export class MoveShard extends Message { { no: 1, name: "shard_id", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, { no: 2, name: "from_peer_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 3, name: "to_peer_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 4, name: "method", kind: "enum", T: proto3.getEnumType(ShardTransferMethod), opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): MoveShard { @@ -2921,6 +3221,108 @@ export class Replica extends Message { } } +/** + * @generated from message qdrant.CreateShardKey + */ +export class CreateShardKey extends Message { + /** + * User-defined shard key + * + * @generated from field: qdrant.ShardKey shard_key = 1; + */ + shardKey?: ShardKey; + + /** + * Number of shards to create per shard key + * + * @generated from field: optional uint32 shards_number = 2; + */ + shardsNumber?: number; + + /** + * Number of replicas of each shard to create + * + * @generated from field: optional uint32 replication_factor = 3; + */ + replicationFactor?: number; + + /** + * List of peer ids, allowed to create shards. If empty - all peers are allowed + * + * @generated from field: repeated uint64 placement = 4; + */ + placement: bigint[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.CreateShardKey"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "shard_key", kind: "message", T: ShardKey }, + { no: 2, name: "shards_number", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, + { no: 3, name: "replication_factor", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, + { no: 4, name: "placement", kind: "scalar", T: 4 /* ScalarType.UINT64 */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateShardKey { + return new CreateShardKey().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateShardKey { + return new CreateShardKey().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateShardKey { + return new CreateShardKey().fromJsonString(jsonString, options); + } + + static equals(a: CreateShardKey | PlainMessage | undefined, b: CreateShardKey | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateShardKey, a, b); + } +} + +/** + * @generated from message qdrant.DeleteShardKey + */ +export class DeleteShardKey extends Message { + /** + * Shard key to delete + * + * @generated from field: qdrant.ShardKey shard_key = 1; + */ + shardKey?: ShardKey; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.DeleteShardKey"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "shard_key", kind: "message", T: ShardKey }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteShardKey { + return new DeleteShardKey().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteShardKey { + return new DeleteShardKey().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteShardKey { + return new DeleteShardKey().fromJsonString(jsonString, options); + } + + static equals(a: DeleteShardKey | PlainMessage | undefined, b: DeleteShardKey | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteShardKey, a, b); + } +} + /** * @generated from message qdrant.UpdateCollectionClusterSetupRequest */ @@ -2959,6 +3361,18 @@ export class UpdateCollectionClusterSetupRequest extends Message { + /** + * Name of the collection + * + * @generated from field: string collection_name = 1; + */ + collectionName = ""; + + /** + * Request to create shard key + * + * @generated from field: qdrant.CreateShardKey request = 2; + */ + request?: CreateShardKey; + + /** + * Wait timeout for operation commit in seconds, if not specified - default value will be supplied + * + * @generated from field: optional uint64 timeout = 3; + */ + timeout?: bigint; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.CreateShardKeyRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "collection_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "request", kind: "message", T: CreateShardKey }, + { no: 3, name: "timeout", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateShardKeyRequest { + return new CreateShardKeyRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateShardKeyRequest { + return new CreateShardKeyRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateShardKeyRequest { + return new CreateShardKeyRequest().fromJsonString(jsonString, options); + } + + static equals(a: CreateShardKeyRequest | PlainMessage | undefined, b: CreateShardKeyRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateShardKeyRequest, a, b); + } +} + +/** + * @generated from message qdrant.DeleteShardKeyRequest + */ +export class DeleteShardKeyRequest extends Message { + /** + * Name of the collection + * + * @generated from field: string collection_name = 1; + */ + collectionName = ""; + + /** + * Request to delete shard key + * + * @generated from field: qdrant.DeleteShardKey request = 2; + */ + request?: DeleteShardKey; + + /** + * Wait timeout for operation commit in seconds, if not specified - default value will be supplied + * + * @generated from field: optional uint64 timeout = 3; + */ + timeout?: bigint; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.DeleteShardKeyRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "collection_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "request", kind: "message", T: DeleteShardKey }, + { no: 3, name: "timeout", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteShardKeyRequest { + return new DeleteShardKeyRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteShardKeyRequest { + return new DeleteShardKeyRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteShardKeyRequest { + return new DeleteShardKeyRequest().fromJsonString(jsonString, options); + } + + static equals(a: DeleteShardKeyRequest | PlainMessage | undefined, b: DeleteShardKeyRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteShardKeyRequest, a, b); + } +} + +/** + * @generated from message qdrant.CreateShardKeyResponse + */ +export class CreateShardKeyResponse extends Message { + /** + * @generated from field: bool result = 1; + */ + result = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.CreateShardKeyResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "result", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateShardKeyResponse { + return new CreateShardKeyResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateShardKeyResponse { + return new CreateShardKeyResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateShardKeyResponse { + return new CreateShardKeyResponse().fromJsonString(jsonString, options); + } + + static equals(a: CreateShardKeyResponse | PlainMessage | undefined, b: CreateShardKeyResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateShardKeyResponse, a, b); + } +} + +/** + * @generated from message qdrant.DeleteShardKeyResponse + */ +export class DeleteShardKeyResponse extends Message { + /** + * @generated from field: bool result = 1; + */ + result = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.DeleteShardKeyResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "result", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteShardKeyResponse { + return new DeleteShardKeyResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteShardKeyResponse { + return new DeleteShardKeyResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteShardKeyResponse { + return new DeleteShardKeyResponse().fromJsonString(jsonString, options); + } + + static equals(a: DeleteShardKeyResponse | PlainMessage | undefined, b: DeleteShardKeyResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteShardKeyResponse, a, b); + } +} + diff --git a/packages/js-client-grpc/src/proto/collections_service_connect.ts b/packages/js-client-grpc/src/proto/collections_service_connect.ts index 4cf54e2..e26f58f 100644 --- a/packages/js-client-grpc/src/proto/collections_service_connect.ts +++ b/packages/js-client-grpc/src/proto/collections_service_connect.ts @@ -1,9 +1,9 @@ -// @generated by protoc-gen-connect-es v0.9.1 with parameter "target=ts" +// @generated by protoc-gen-connect-es v0.10.0 with parameter "target=ts" // @generated from file collections_service.proto (package qdrant, syntax proto3) /* eslint-disable */ // @ts-nocheck -import { ChangeAliases, CollectionClusterInfoRequest, CollectionClusterInfoResponse, CollectionOperationResponse, CreateCollection, DeleteCollection, GetCollectionInfoRequest, GetCollectionInfoResponse, ListAliasesRequest, ListAliasesResponse, ListCollectionAliasesRequest, ListCollectionsRequest, ListCollectionsResponse, UpdateCollection, UpdateCollectionClusterSetupRequest, UpdateCollectionClusterSetupResponse } from "./collections_pb.js"; +import { ChangeAliases, CollectionClusterInfoRequest, CollectionClusterInfoResponse, CollectionOperationResponse, CreateCollection, CreateShardKeyRequest, CreateShardKeyResponse, DeleteCollection, DeleteShardKeyRequest, DeleteShardKeyResponse, GetCollectionInfoRequest, GetCollectionInfoResponse, ListAliasesRequest, ListAliasesResponse, ListCollectionAliasesRequest, ListCollectionsRequest, ListCollectionsResponse, UpdateCollection, UpdateCollectionClusterSetupRequest, UpdateCollectionClusterSetupResponse } from "./collections_pb.js"; import { MethodKind } from "@bufbuild/protobuf"; /** @@ -132,6 +132,30 @@ export const Collections = { O: UpdateCollectionClusterSetupResponse, kind: MethodKind.Unary, }, + /** + * + * Create shard key + * + * @generated from rpc qdrant.Collections.CreateShardKey + */ + createShardKey: { + name: "CreateShardKey", + I: CreateShardKeyRequest, + O: CreateShardKeyResponse, + kind: MethodKind.Unary, + }, + /** + * + * Delete shard key + * + * @generated from rpc qdrant.Collections.DeleteShardKey + */ + deleteShardKey: { + name: "DeleteShardKey", + I: DeleteShardKeyRequest, + O: DeleteShardKeyResponse, + kind: MethodKind.Unary, + }, } } as const; diff --git a/packages/js-client-grpc/src/proto/points_pb.ts b/packages/js-client-grpc/src/proto/points_pb.ts index 5d5a957..a420e7c 100644 --- a/packages/js-client-grpc/src/proto/points_pb.ts +++ b/packages/js-client-grpc/src/proto/points_pb.ts @@ -5,8 +5,8 @@ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; +import { PayloadIndexParams, ShardKey } from "./collections_pb.js"; import { Value } from "./json_with_int_pb.js"; -import { PayloadIndexParams } from "./collections_pb.js"; /** * @generated from enum qdrant.WriteOrderingType @@ -322,6 +322,43 @@ export class PointId extends Message { } } +/** + * @generated from message qdrant.SparseIndices + */ +export class SparseIndices extends Message { + /** + * @generated from field: repeated uint32 data = 1; + */ + data: number[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.SparseIndices"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "data", kind: "scalar", T: 13 /* ScalarType.UINT32 */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SparseIndices { + return new SparseIndices().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SparseIndices { + return new SparseIndices().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SparseIndices { + return new SparseIndices().fromJsonString(jsonString, options); + } + + static equals(a: SparseIndices | PlainMessage | undefined, b: SparseIndices | PlainMessage | undefined): boolean { + return proto3.util.equals(SparseIndices, a, b); + } +} + /** * @generated from message qdrant.Vector */ @@ -331,6 +368,11 @@ export class Vector extends Message { */ data: number[] = []; + /** + * @generated from field: optional qdrant.SparseIndices indices = 2; + */ + indices?: SparseIndices; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -340,6 +382,7 @@ export class Vector extends Message { static readonly typeName = "qdrant.Vector"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "data", kind: "scalar", T: 2 /* ScalarType.FLOAT */, repeated: true }, + { no: 2, name: "indices", kind: "message", T: SparseIndices, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Vector { @@ -359,6 +402,49 @@ export class Vector extends Message { } } +/** + * --------------------------------------------- + * ----------------- ShardKeySelector ---------- + * --------------------------------------------- + * + * @generated from message qdrant.ShardKeySelector + */ +export class ShardKeySelector extends Message { + /** + * List of shard keys which should be used in the request + * + * @generated from field: repeated qdrant.ShardKey shard_keys = 1; + */ + shardKeys: ShardKey[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.ShardKeySelector"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "shard_keys", kind: "message", T: ShardKey, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ShardKeySelector { + return new ShardKeySelector().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ShardKeySelector { + return new ShardKeySelector().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ShardKeySelector { + return new ShardKeySelector().fromJsonString(jsonString, options); + } + + static equals(a: ShardKeySelector | PlainMessage | undefined, b: ShardKeySelector | PlainMessage | undefined): boolean { + return proto3.util.equals(ShardKeySelector, a, b); + } +} + /** * @generated from message qdrant.UpsertPoints */ @@ -389,6 +475,13 @@ export class UpsertPoints extends Message { */ ordering?: WriteOrdering; + /** + * Option for custom sharding to specify used shard keys + * + * @generated from field: optional qdrant.ShardKeySelector shard_key_selector = 5; + */ + shardKeySelector?: ShardKeySelector; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -401,6 +494,7 @@ export class UpsertPoints extends Message { { no: 2, name: "wait", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, { no: 3, name: "points", kind: "message", T: PointStruct, repeated: true }, { no: 4, name: "ordering", kind: "message", T: WriteOrdering, opt: true }, + { no: 5, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): UpsertPoints { @@ -452,6 +546,13 @@ export class DeletePoints extends Message { */ ordering?: WriteOrdering; + /** + * Option for custom sharding to specify used shard keys + * + * @generated from field: optional qdrant.ShardKeySelector shard_key_selector = 5; + */ + shardKeySelector?: ShardKeySelector; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -464,6 +565,7 @@ export class DeletePoints extends Message { { no: 2, name: "wait", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, { no: 3, name: "points", kind: "message", T: PointsSelector }, { no: 4, name: "ordering", kind: "message", T: WriteOrdering, opt: true }, + { no: 5, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DeletePoints { @@ -522,6 +624,13 @@ export class GetPoints extends Message { */ readConsistency?: ReadConsistency; + /** + * Specify in which shards to look for the points, if not specified - look in all shards + * + * @generated from field: optional qdrant.ShardKeySelector shard_key_selector = 7; + */ + shardKeySelector?: ShardKeySelector; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -535,6 +644,7 @@ export class GetPoints extends Message { { no: 4, name: "with_payload", kind: "message", T: WithPayloadSelector }, { no: 5, name: "with_vectors", kind: "message", T: WithVectorsSelector, opt: true }, { no: 6, name: "read_consistency", kind: "message", T: ReadConsistency, opt: true }, + { no: 7, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetPoints { @@ -586,6 +696,13 @@ export class UpdatePointVectors extends Message { */ ordering?: WriteOrdering; + /** + * Option for custom sharding to specify used shard keys + * + * @generated from field: optional qdrant.ShardKeySelector shard_key_selector = 5; + */ + shardKeySelector?: ShardKeySelector; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -598,6 +715,7 @@ export class UpdatePointVectors extends Message { { no: 2, name: "wait", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, { no: 3, name: "points", kind: "message", T: PointVectors, repeated: true }, { no: 4, name: "ordering", kind: "message", T: WriteOrdering, opt: true }, + { no: 5, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): UpdatePointVectors { @@ -703,6 +821,13 @@ export class DeletePointVectors extends Message { */ ordering?: WriteOrdering; + /** + * Option for custom sharding to specify used shard keys + * + * @generated from field: optional qdrant.ShardKeySelector shard_key_selector = 6; + */ + shardKeySelector?: ShardKeySelector; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -716,6 +841,7 @@ export class DeletePointVectors extends Message { { no: 3, name: "points_selector", kind: "message", T: PointsSelector }, { no: 4, name: "vectors", kind: "message", T: VectorsSelector }, { no: 5, name: "ordering", kind: "message", T: WriteOrdering, opt: true }, + { no: 6, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DeletePointVectors { @@ -774,6 +900,13 @@ export class SetPayloadPoints extends Message { */ ordering?: WriteOrdering; + /** + * Option for custom sharding to specify used shard keys + * + * @generated from field: optional qdrant.ShardKeySelector shard_key_selector = 7; + */ + shardKeySelector?: ShardKeySelector; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -787,6 +920,7 @@ export class SetPayloadPoints extends Message { { no: 3, name: "payload", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Value} }, { no: 5, name: "points_selector", kind: "message", T: PointsSelector, opt: true }, { no: 6, name: "ordering", kind: "message", T: WriteOrdering, opt: true }, + { no: 7, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SetPayloadPoints { @@ -845,6 +979,13 @@ export class DeletePayloadPoints extends Message { */ ordering?: WriteOrdering; + /** + * Option for custom sharding to specify used shard keys + * + * @generated from field: optional qdrant.ShardKeySelector shard_key_selector = 7; + */ + shardKeySelector?: ShardKeySelector; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -858,6 +999,7 @@ export class DeletePayloadPoints extends Message { { no: 3, name: "keys", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, { no: 5, name: "points_selector", kind: "message", T: PointsSelector, opt: true }, { no: 6, name: "ordering", kind: "message", T: WriteOrdering, opt: true }, + { no: 7, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): DeletePayloadPoints { @@ -909,6 +1051,13 @@ export class ClearPayloadPoints extends Message { */ ordering?: WriteOrdering; + /** + * Option for custom sharding to specify used shard keys + * + * @generated from field: optional qdrant.ShardKeySelector shard_key_selector = 5; + */ + shardKeySelector?: ShardKeySelector; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -921,6 +1070,7 @@ export class ClearPayloadPoints extends Message { { no: 2, name: "wait", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, { no: 3, name: "points", kind: "message", T: PointsSelector }, { no: 4, name: "ordering", kind: "message", T: WriteOrdering, opt: true }, + { no: 5, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ClearPayloadPoints { @@ -1614,6 +1764,25 @@ export class SearchPoints extends Message { */ readConsistency?: ReadConsistency; + /** + * If set, overrides global timeout setting for this request. Unit is seconds. + * + * @generated from field: optional uint64 timeout = 13; + */ + timeout?: bigint; + + /** + * Specify in which shards to look for the points, if not specified - look in all shards + * + * @generated from field: optional qdrant.ShardKeySelector shard_key_selector = 14; + */ + shardKeySelector?: ShardKeySelector; + + /** + * @generated from field: optional qdrant.SparseIndices sparse_indices = 15; + */ + sparseIndices?: SparseIndices; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -1633,6 +1802,9 @@ export class SearchPoints extends Message { { no: 10, name: "vector_name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, { no: 11, name: "with_vectors", kind: "message", T: WithVectorsSelector, opt: true }, { no: 12, name: "read_consistency", kind: "message", T: ReadConsistency, opt: true }, + { no: 13, name: "timeout", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, + { no: 14, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, + { no: 15, name: "sparse_indices", kind: "message", T: SparseIndices, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SearchPoints { @@ -1675,6 +1847,13 @@ export class SearchBatchPoints extends Message { */ readConsistency?: ReadConsistency; + /** + * If set, overrides global timeout setting for this request. Unit is seconds. + * + * @generated from field: optional uint64 timeout = 4; + */ + timeout?: bigint; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -1686,6 +1865,7 @@ export class SearchBatchPoints extends Message { { no: 1, name: "collection_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "search_points", kind: "message", T: SearchPoints, repeated: true }, { no: 3, name: "read_consistency", kind: "message", T: ReadConsistency, opt: true }, + { no: 4, name: "timeout", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SearchBatchPoints { @@ -1855,6 +2035,25 @@ export class SearchPointGroups extends Message { */ withLookup?: WithLookup; + /** + * If set, overrides global timeout setting for this request. Unit is seconds. + * + * @generated from field: optional uint64 timeout = 14; + */ + timeout?: bigint; + + /** + * Specify in which shards to look for the points, if not specified - look in all shards + * + * @generated from field: optional qdrant.ShardKeySelector shard_key_selector = 15; + */ + shardKeySelector?: ShardKeySelector; + + /** + * @generated from field: optional qdrant.SparseIndices sparse_indices = 16; + */ + sparseIndices?: SparseIndices; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -1876,6 +2075,9 @@ export class SearchPointGroups extends Message { { no: 11, name: "group_size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, { no: 12, name: "read_consistency", kind: "message", T: ReadConsistency, opt: true }, { no: 13, name: "with_lookup", kind: "message", T: WithLookup, opt: true }, + { no: 14, name: "timeout", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, + { no: 15, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, + { no: 16, name: "sparse_indices", kind: "message", T: SparseIndices, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SearchPointGroups { @@ -1946,6 +2148,13 @@ export class ScrollPoints extends Message { */ readConsistency?: ReadConsistency; + /** + * Specify in which shards to look for the points, if not specified - look in all shards + * + * @generated from field: optional qdrant.ShardKeySelector shard_key_selector = 9; + */ + shardKeySelector?: ShardKeySelector; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -1961,6 +2170,7 @@ export class ScrollPoints extends Message { { no: 6, name: "with_payload", kind: "message", T: WithPayloadSelector }, { no: 7, name: "with_vectors", kind: "message", T: WithVectorsSelector, opt: true }, { no: 8, name: "read_consistency", kind: "message", T: ReadConsistency, opt: true }, + { no: 9, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ScrollPoints { @@ -1996,6 +2206,13 @@ export class LookupLocation extends Message { */ vectorName?: string; + /** + * Specify in which shards to look for the points, if not specified - look in all shards + * + * @generated from field: optional qdrant.ShardKeySelector shard_key_selector = 3; + */ + shardKeySelector?: ShardKeySelector; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -2006,6 +2223,7 @@ export class LookupLocation extends Message { static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "collection_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "vector_name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 3, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): LookupLocation { @@ -2141,6 +2359,20 @@ export class RecommendPoints extends Message { */ negativeVectors: Vector[] = []; + /** + * If set, overrides global timeout setting for this request. Unit is seconds. + * + * @generated from field: optional uint64 timeout = 19; + */ + timeout?: bigint; + + /** + * Specify in which shards to look for the points, if not specified - look in all shards + * + * @generated from field: optional qdrant.ShardKeySelector shard_key_selector = 20; + */ + shardKeySelector?: ShardKeySelector; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -2165,6 +2397,8 @@ export class RecommendPoints extends Message { { no: 16, name: "strategy", kind: "enum", T: proto3.getEnumType(RecommendStrategy), opt: true }, { no: 17, name: "positive_vectors", kind: "message", T: Vector, repeated: true }, { no: 18, name: "negative_vectors", kind: "message", T: Vector, repeated: true }, + { no: 19, name: "timeout", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, + { no: 20, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RecommendPoints { @@ -2207,6 +2441,13 @@ export class RecommendBatchPoints extends Message { */ readConsistency?: ReadConsistency; + /** + * If set, overrides global timeout setting for this request. Unit is seconds. + * + * @generated from field: optional uint64 timeout = 4; + */ + timeout?: bigint; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -2218,6 +2459,7 @@ export class RecommendBatchPoints extends Message { { no: 1, name: "collection_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "recommend_points", kind: "message", T: RecommendPoints, repeated: true }, { no: 3, name: "read_consistency", kind: "message", T: ReadConsistency, opt: true }, + { no: 4, name: "timeout", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RecommendBatchPoints { @@ -2367,6 +2609,20 @@ export class RecommendPointGroups extends Message { */ negativeVectors: Vector[] = []; + /** + * If set, overrides global timeout setting for this request. Unit is seconds. + * + * @generated from field: optional uint64 timeout = 20; + */ + timeout?: bigint; + + /** + * Specify in which shards to look for the points, if not specified - look in all shards + * + * @generated from field: optional qdrant.ShardKeySelector shard_key_selector = 21; + */ + shardKeySelector?: ShardKeySelector; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -2393,6 +2649,8 @@ export class RecommendPointGroups extends Message { { no: 17, name: "strategy", kind: "enum", T: proto3.getEnumType(RecommendStrategy), opt: true }, { no: 18, name: "positive_vectors", kind: "message", T: Vector, repeated: true }, { no: 19, name: "negative_vectors", kind: "message", T: Vector, repeated: true }, + { no: 20, name: "timeout", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, + { no: 21, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RecommendPointGroups { @@ -2413,197 +2671,577 @@ export class RecommendPointGroups extends Message { } /** - * @generated from message qdrant.CountPoints + * @generated from message qdrant.TargetVector */ -export class CountPoints extends Message { - /** - * name of the collection - * - * @generated from field: string collection_name = 1; - */ - collectionName = ""; - - /** - * Filter conditions - return only those points that satisfy the specified conditions - * - * @generated from field: qdrant.Filter filter = 2; - */ - filter?: Filter; - +export class TargetVector extends Message { /** - * If `true` - return exact count, if `false` - return approximate count - * - * @generated from field: optional bool exact = 3; + * @generated from oneof qdrant.TargetVector.target */ - exact?: boolean; + target: { + /** + * @generated from field: qdrant.VectorExample single = 1; + */ + value: VectorExample; + case: "single"; + } | { case: undefined; value?: undefined } = { case: undefined }; - constructor(data?: PartialMessage) { + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "qdrant.CountPoints"; + static readonly typeName = "qdrant.TargetVector"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "collection_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "filter", kind: "message", T: Filter }, - { no: 3, name: "exact", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, + { no: 1, name: "single", kind: "message", T: VectorExample, oneof: "target" }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): CountPoints { - return new CountPoints().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): TargetVector { + return new TargetVector().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): CountPoints { - return new CountPoints().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): TargetVector { + return new TargetVector().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): CountPoints { - return new CountPoints().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): TargetVector { + return new TargetVector().fromJsonString(jsonString, options); } - static equals(a: CountPoints | PlainMessage | undefined, b: CountPoints | PlainMessage | undefined): boolean { - return proto3.util.equals(CountPoints, a, b); + static equals(a: TargetVector | PlainMessage | undefined, b: TargetVector | PlainMessage | undefined): boolean { + return proto3.util.equals(TargetVector, a, b); } } /** - * @generated from message qdrant.PointsUpdateOperation + * @generated from message qdrant.VectorExample */ -export class PointsUpdateOperation extends Message { +export class VectorExample extends Message { /** - * @generated from oneof qdrant.PointsUpdateOperation.operation + * @generated from oneof qdrant.VectorExample.example */ - operation: { - /** - * @generated from field: qdrant.PointsUpdateOperation.PointStructList upsert = 1; - */ - value: PointsUpdateOperation_PointStructList; - case: "upsert"; - } | { - /** - * @generated from field: qdrant.PointsSelector delete = 2; - */ - value: PointsSelector; - case: "delete"; - } | { - /** - * @generated from field: qdrant.PointsUpdateOperation.SetPayload set_payload = 3; - */ - value: PointsUpdateOperation_SetPayload; - case: "setPayload"; - } | { + example: { /** - * @generated from field: qdrant.PointsUpdateOperation.SetPayload overwrite_payload = 4; - */ - value: PointsUpdateOperation_SetPayload; - case: "overwritePayload"; - } | { - /** - * @generated from field: qdrant.PointsUpdateOperation.DeletePayload delete_payload = 5; - */ - value: PointsUpdateOperation_DeletePayload; - case: "deletePayload"; - } | { - /** - * @generated from field: qdrant.PointsSelector clear_payload = 6; - */ - value: PointsSelector; - case: "clearPayload"; - } | { - /** - * @generated from field: qdrant.PointsUpdateOperation.UpdateVectors update_vectors = 7; + * @generated from field: qdrant.PointId id = 1; */ - value: PointsUpdateOperation_UpdateVectors; - case: "updateVectors"; + value: PointId; + case: "id"; } | { /** - * @generated from field: qdrant.PointsUpdateOperation.DeleteVectors delete_vectors = 8; + * @generated from field: qdrant.Vector vector = 2; */ - value: PointsUpdateOperation_DeleteVectors; - case: "deleteVectors"; + value: Vector; + case: "vector"; } | { case: undefined; value?: undefined } = { case: undefined }; - constructor(data?: PartialMessage) { + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "qdrant.PointsUpdateOperation"; + static readonly typeName = "qdrant.VectorExample"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "upsert", kind: "message", T: PointsUpdateOperation_PointStructList, oneof: "operation" }, - { no: 2, name: "delete", kind: "message", T: PointsSelector, oneof: "operation" }, - { no: 3, name: "set_payload", kind: "message", T: PointsUpdateOperation_SetPayload, oneof: "operation" }, - { no: 4, name: "overwrite_payload", kind: "message", T: PointsUpdateOperation_SetPayload, oneof: "operation" }, - { no: 5, name: "delete_payload", kind: "message", T: PointsUpdateOperation_DeletePayload, oneof: "operation" }, - { no: 6, name: "clear_payload", kind: "message", T: PointsSelector, oneof: "operation" }, - { no: 7, name: "update_vectors", kind: "message", T: PointsUpdateOperation_UpdateVectors, oneof: "operation" }, - { no: 8, name: "delete_vectors", kind: "message", T: PointsUpdateOperation_DeleteVectors, oneof: "operation" }, + { no: 1, name: "id", kind: "message", T: PointId, oneof: "example" }, + { no: 2, name: "vector", kind: "message", T: Vector, oneof: "example" }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): PointsUpdateOperation { - return new PointsUpdateOperation().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): VectorExample { + return new VectorExample().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): PointsUpdateOperation { - return new PointsUpdateOperation().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): VectorExample { + return new VectorExample().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): PointsUpdateOperation { - return new PointsUpdateOperation().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): VectorExample { + return new VectorExample().fromJsonString(jsonString, options); } - static equals(a: PointsUpdateOperation | PlainMessage | undefined, b: PointsUpdateOperation | PlainMessage | undefined): boolean { - return proto3.util.equals(PointsUpdateOperation, a, b); + static equals(a: VectorExample | PlainMessage | undefined, b: VectorExample | PlainMessage | undefined): boolean { + return proto3.util.equals(VectorExample, a, b); } } /** - * @generated from message qdrant.PointsUpdateOperation.PointStructList + * @generated from message qdrant.ContextExamplePair */ -export class PointsUpdateOperation_PointStructList extends Message { +export class ContextExamplePair extends Message { /** - * @generated from field: repeated qdrant.PointStruct points = 1; + * @generated from field: qdrant.VectorExample positive = 1; */ - points: PointStruct[] = []; + positive?: VectorExample; - constructor(data?: PartialMessage) { + /** + * @generated from field: qdrant.VectorExample negative = 2; + */ + negative?: VectorExample; + + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "qdrant.PointsUpdateOperation.PointStructList"; + static readonly typeName = "qdrant.ContextExamplePair"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "points", kind: "message", T: PointStruct, repeated: true }, + { no: 1, name: "positive", kind: "message", T: VectorExample }, + { no: 2, name: "negative", kind: "message", T: VectorExample }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): PointsUpdateOperation_PointStructList { - return new PointsUpdateOperation_PointStructList().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): ContextExamplePair { + return new ContextExamplePair().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): PointsUpdateOperation_PointStructList { - return new PointsUpdateOperation_PointStructList().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): ContextExamplePair { + return new ContextExamplePair().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): PointsUpdateOperation_PointStructList { - return new PointsUpdateOperation_PointStructList().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): ContextExamplePair { + return new ContextExamplePair().fromJsonString(jsonString, options); } - static equals(a: PointsUpdateOperation_PointStructList | PlainMessage | undefined, b: PointsUpdateOperation_PointStructList | PlainMessage | undefined): boolean { - return proto3.util.equals(PointsUpdateOperation_PointStructList, a, b); + static equals(a: ContextExamplePair | PlainMessage | undefined, b: ContextExamplePair | PlainMessage | undefined): boolean { + return proto3.util.equals(ContextExamplePair, a, b); } } /** - * @generated from message qdrant.PointsUpdateOperation.SetPayload + * @generated from message qdrant.DiscoverPoints */ -export class PointsUpdateOperation_SetPayload extends Message { +export class DiscoverPoints extends Message { /** - * @generated from field: map payload = 1; - */ - payload: { [key: string]: Value } = {}; + * name of the collection + * + * @generated from field: string collection_name = 1; + */ + collectionName = ""; + + /** + * Use this as the primary search objective + * + * @generated from field: qdrant.TargetVector target = 2; + */ + target?: TargetVector; + + /** + * Search will be constrained by these pairs of examples + * + * @generated from field: repeated qdrant.ContextExamplePair context = 3; + */ + context: ContextExamplePair[] = []; + + /** + * Filter conditions - return only those points that satisfy the specified conditions + * + * @generated from field: qdrant.Filter filter = 4; + */ + filter?: Filter; + + /** + * Max number of result + * + * @generated from field: uint64 limit = 5; + */ + limit = protoInt64.zero; + + /** + * Options for specifying which payload to include or not + * + * @generated from field: qdrant.WithPayloadSelector with_payload = 6; + */ + withPayload?: WithPayloadSelector; + + /** + * Search config + * + * @generated from field: qdrant.SearchParams params = 7; + */ + params?: SearchParams; + + /** + * Offset of the result + * + * @generated from field: optional uint64 offset = 8; + */ + offset?: bigint; + + /** + * Define which vector to use for recommendation, if not specified - default vector + * + * @generated from field: optional string using = 9; + */ + using?: string; + + /** + * Options for specifying which vectors to include into response + * + * @generated from field: optional qdrant.WithVectorsSelector with_vectors = 10; + */ + withVectors?: WithVectorsSelector; + + /** + * Name of the collection to use for points lookup, if not specified - use current collection + * + * @generated from field: optional qdrant.LookupLocation lookup_from = 11; + */ + lookupFrom?: LookupLocation; + + /** + * Options for specifying read consistency guarantees + * + * @generated from field: optional qdrant.ReadConsistency read_consistency = 12; + */ + readConsistency?: ReadConsistency; + + /** + * If set, overrides global timeout setting for this request. Unit is seconds. + * + * @generated from field: optional uint64 timeout = 13; + */ + timeout?: bigint; + + /** + * Specify in which shards to look for the points, if not specified - look in all shards + * + * @generated from field: optional qdrant.ShardKeySelector shard_key_selector = 14; + */ + shardKeySelector?: ShardKeySelector; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.DiscoverPoints"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "collection_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "target", kind: "message", T: TargetVector }, + { no: 3, name: "context", kind: "message", T: ContextExamplePair, repeated: true }, + { no: 4, name: "filter", kind: "message", T: Filter }, + { no: 5, name: "limit", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 6, name: "with_payload", kind: "message", T: WithPayloadSelector }, + { no: 7, name: "params", kind: "message", T: SearchParams }, + { no: 8, name: "offset", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, + { no: 9, name: "using", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 10, name: "with_vectors", kind: "message", T: WithVectorsSelector, opt: true }, + { no: 11, name: "lookup_from", kind: "message", T: LookupLocation, opt: true }, + { no: 12, name: "read_consistency", kind: "message", T: ReadConsistency, opt: true }, + { no: 13, name: "timeout", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, + { no: 14, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DiscoverPoints { + return new DiscoverPoints().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DiscoverPoints { + return new DiscoverPoints().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DiscoverPoints { + return new DiscoverPoints().fromJsonString(jsonString, options); + } + + static equals(a: DiscoverPoints | PlainMessage | undefined, b: DiscoverPoints | PlainMessage | undefined): boolean { + return proto3.util.equals(DiscoverPoints, a, b); + } +} + +/** + * @generated from message qdrant.DiscoverBatchPoints + */ +export class DiscoverBatchPoints extends Message { + /** + * Name of the collection + * + * @generated from field: string collection_name = 1; + */ + collectionName = ""; + + /** + * @generated from field: repeated qdrant.DiscoverPoints discover_points = 2; + */ + discoverPoints: DiscoverPoints[] = []; + + /** + * Options for specifying read consistency guarantees + * + * @generated from field: optional qdrant.ReadConsistency read_consistency = 3; + */ + readConsistency?: ReadConsistency; + + /** + * If set, overrides global timeout setting for this request. Unit is seconds. + * + * @generated from field: optional uint64 timeout = 4; + */ + timeout?: bigint; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.DiscoverBatchPoints"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "collection_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "discover_points", kind: "message", T: DiscoverPoints, repeated: true }, + { no: 3, name: "read_consistency", kind: "message", T: ReadConsistency, opt: true }, + { no: 4, name: "timeout", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DiscoverBatchPoints { + return new DiscoverBatchPoints().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DiscoverBatchPoints { + return new DiscoverBatchPoints().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DiscoverBatchPoints { + return new DiscoverBatchPoints().fromJsonString(jsonString, options); + } + + static equals(a: DiscoverBatchPoints | PlainMessage | undefined, b: DiscoverBatchPoints | PlainMessage | undefined): boolean { + return proto3.util.equals(DiscoverBatchPoints, a, b); + } +} + +/** + * @generated from message qdrant.CountPoints + */ +export class CountPoints extends Message { + /** + * name of the collection + * + * @generated from field: string collection_name = 1; + */ + collectionName = ""; + + /** + * Filter conditions - return only those points that satisfy the specified conditions + * + * @generated from field: qdrant.Filter filter = 2; + */ + filter?: Filter; + + /** + * If `true` - return exact count, if `false` - return approximate count + * + * @generated from field: optional bool exact = 3; + */ + exact?: boolean; + + /** + * Options for specifying read consistency guarantees + * + * @generated from field: optional qdrant.ReadConsistency read_consistency = 4; + */ + readConsistency?: ReadConsistency; + + /** + * Specify in which shards to look for the points, if not specified - look in all shards + * + * @generated from field: optional qdrant.ShardKeySelector shard_key_selector = 5; + */ + shardKeySelector?: ShardKeySelector; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.CountPoints"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "collection_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "filter", kind: "message", T: Filter }, + { no: 3, name: "exact", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true }, + { no: 4, name: "read_consistency", kind: "message", T: ReadConsistency, opt: true }, + { no: 5, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CountPoints { + return new CountPoints().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CountPoints { + return new CountPoints().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CountPoints { + return new CountPoints().fromJsonString(jsonString, options); + } + + static equals(a: CountPoints | PlainMessage | undefined, b: CountPoints | PlainMessage | undefined): boolean { + return proto3.util.equals(CountPoints, a, b); + } +} + +/** + * @generated from message qdrant.PointsUpdateOperation + */ +export class PointsUpdateOperation extends Message { + /** + * @generated from oneof qdrant.PointsUpdateOperation.operation + */ + operation: { + /** + * @generated from field: qdrant.PointsUpdateOperation.PointStructList upsert = 1; + */ + value: PointsUpdateOperation_PointStructList; + case: "upsert"; + } | { + /** + * @generated from field: qdrant.PointsSelector delete_deprecated = 2 [deprecated = true]; + * @deprecated + */ + value: PointsSelector; + case: "deleteDeprecated"; + } | { + /** + * @generated from field: qdrant.PointsUpdateOperation.SetPayload set_payload = 3; + */ + value: PointsUpdateOperation_SetPayload; + case: "setPayload"; + } | { + /** + * @generated from field: qdrant.PointsUpdateOperation.SetPayload overwrite_payload = 4; + */ + value: PointsUpdateOperation_SetPayload; + case: "overwritePayload"; + } | { + /** + * @generated from field: qdrant.PointsUpdateOperation.DeletePayload delete_payload = 5; + */ + value: PointsUpdateOperation_DeletePayload; + case: "deletePayload"; + } | { + /** + * @generated from field: qdrant.PointsSelector clear_payload_deprecated = 6 [deprecated = true]; + * @deprecated + */ + value: PointsSelector; + case: "clearPayloadDeprecated"; + } | { + /** + * @generated from field: qdrant.PointsUpdateOperation.UpdateVectors update_vectors = 7; + */ + value: PointsUpdateOperation_UpdateVectors; + case: "updateVectors"; + } | { + /** + * @generated from field: qdrant.PointsUpdateOperation.DeleteVectors delete_vectors = 8; + */ + value: PointsUpdateOperation_DeleteVectors; + case: "deleteVectors"; + } | { + /** + * @generated from field: qdrant.PointsUpdateOperation.DeletePoints delete_points = 9; + */ + value: PointsUpdateOperation_DeletePoints; + case: "deletePoints"; + } | { + /** + * @generated from field: qdrant.PointsUpdateOperation.ClearPayload clear_payload = 10; + */ + value: PointsUpdateOperation_ClearPayload; + case: "clearPayload"; + } | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.PointsUpdateOperation"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "upsert", kind: "message", T: PointsUpdateOperation_PointStructList, oneof: "operation" }, + { no: 2, name: "delete_deprecated", kind: "message", T: PointsSelector, oneof: "operation" }, + { no: 3, name: "set_payload", kind: "message", T: PointsUpdateOperation_SetPayload, oneof: "operation" }, + { no: 4, name: "overwrite_payload", kind: "message", T: PointsUpdateOperation_SetPayload, oneof: "operation" }, + { no: 5, name: "delete_payload", kind: "message", T: PointsUpdateOperation_DeletePayload, oneof: "operation" }, + { no: 6, name: "clear_payload_deprecated", kind: "message", T: PointsSelector, oneof: "operation" }, + { no: 7, name: "update_vectors", kind: "message", T: PointsUpdateOperation_UpdateVectors, oneof: "operation" }, + { no: 8, name: "delete_vectors", kind: "message", T: PointsUpdateOperation_DeleteVectors, oneof: "operation" }, + { no: 9, name: "delete_points", kind: "message", T: PointsUpdateOperation_DeletePoints, oneof: "operation" }, + { no: 10, name: "clear_payload", kind: "message", T: PointsUpdateOperation_ClearPayload, oneof: "operation" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PointsUpdateOperation { + return new PointsUpdateOperation().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PointsUpdateOperation { + return new PointsUpdateOperation().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PointsUpdateOperation { + return new PointsUpdateOperation().fromJsonString(jsonString, options); + } + + static equals(a: PointsUpdateOperation | PlainMessage | undefined, b: PointsUpdateOperation | PlainMessage | undefined): boolean { + return proto3.util.equals(PointsUpdateOperation, a, b); + } +} + +/** + * @generated from message qdrant.PointsUpdateOperation.PointStructList + */ +export class PointsUpdateOperation_PointStructList extends Message { + /** + * @generated from field: repeated qdrant.PointStruct points = 1; + */ + points: PointStruct[] = []; + + /** + * Option for custom sharding to specify used shard keys + * + * @generated from field: optional qdrant.ShardKeySelector shard_key_selector = 2; + */ + shardKeySelector?: ShardKeySelector; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.PointsUpdateOperation.PointStructList"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "points", kind: "message", T: PointStruct, repeated: true }, + { no: 2, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PointsUpdateOperation_PointStructList { + return new PointsUpdateOperation_PointStructList().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PointsUpdateOperation_PointStructList { + return new PointsUpdateOperation_PointStructList().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PointsUpdateOperation_PointStructList { + return new PointsUpdateOperation_PointStructList().fromJsonString(jsonString, options); + } + + static equals(a: PointsUpdateOperation_PointStructList | PlainMessage | undefined, b: PointsUpdateOperation_PointStructList | PlainMessage | undefined): boolean { + return proto3.util.equals(PointsUpdateOperation_PointStructList, a, b); + } +} + +/** + * @generated from message qdrant.PointsUpdateOperation.SetPayload + */ +export class PointsUpdateOperation_SetPayload extends Message { + /** + * @generated from field: map payload = 1; + */ + payload: { [key: string]: Value } = {}; /** * Affected points @@ -2612,6 +3250,13 @@ export class PointsUpdateOperation_SetPayload extends Message) { super(); proto3.util.initPartial(data, this); @@ -2622,6 +3267,7 @@ export class PointsUpdateOperation_SetPayload extends Message [ { no: 1, name: "payload", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Value} }, { no: 2, name: "points_selector", kind: "message", T: PointsSelector, opt: true }, + { no: 3, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PointsUpdateOperation_SetPayload { @@ -2657,6 +3303,13 @@ export class PointsUpdateOperation_DeletePayload extends Message) { super(); proto3.util.initPartial(data, this); @@ -2667,6 +3320,7 @@ export class PointsUpdateOperation_DeletePayload extends Message [ { no: 1, name: "keys", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, { no: 2, name: "points_selector", kind: "message", T: PointsSelector, opt: true }, + { no: 3, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PointsUpdateOperation_DeletePayload { @@ -2697,6 +3351,13 @@ export class PointsUpdateOperation_UpdateVectors extends Message) { super(); proto3.util.initPartial(data, this); @@ -2706,6 +3367,7 @@ export class PointsUpdateOperation_UpdateVectors extends Message [ { no: 1, name: "points", kind: "message", T: PointVectors, repeated: true }, + { no: 2, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PointsUpdateOperation_UpdateVectors { @@ -2743,6 +3405,13 @@ export class PointsUpdateOperation_DeleteVectors extends Message) { super(); proto3.util.initPartial(data, this); @@ -2753,6 +3422,7 @@ export class PointsUpdateOperation_DeleteVectors extends Message [ { no: 1, name: "points_selector", kind: "message", T: PointsSelector }, { no: 2, name: "vectors", kind: "message", T: VectorsSelector }, + { no: 3, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PointsUpdateOperation_DeleteVectors { @@ -2772,6 +3442,100 @@ export class PointsUpdateOperation_DeleteVectors extends Message { + /** + * Affected points + * + * @generated from field: qdrant.PointsSelector points = 1; + */ + points?: PointsSelector; + + /** + * Option for custom sharding to specify used shard keys + * + * @generated from field: optional qdrant.ShardKeySelector shard_key_selector = 2; + */ + shardKeySelector?: ShardKeySelector; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.PointsUpdateOperation.DeletePoints"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "points", kind: "message", T: PointsSelector }, + { no: 2, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PointsUpdateOperation_DeletePoints { + return new PointsUpdateOperation_DeletePoints().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PointsUpdateOperation_DeletePoints { + return new PointsUpdateOperation_DeletePoints().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PointsUpdateOperation_DeletePoints { + return new PointsUpdateOperation_DeletePoints().fromJsonString(jsonString, options); + } + + static equals(a: PointsUpdateOperation_DeletePoints | PlainMessage | undefined, b: PointsUpdateOperation_DeletePoints | PlainMessage | undefined): boolean { + return proto3.util.equals(PointsUpdateOperation_DeletePoints, a, b); + } +} + +/** + * @generated from message qdrant.PointsUpdateOperation.ClearPayload + */ +export class PointsUpdateOperation_ClearPayload extends Message { + /** + * Affected points + * + * @generated from field: qdrant.PointsSelector points = 1; + */ + points?: PointsSelector; + + /** + * Option for custom sharding to specify used shard keys + * + * @generated from field: optional qdrant.ShardKeySelector shard_key_selector = 2; + */ + shardKeySelector?: ShardKeySelector; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.PointsUpdateOperation.ClearPayload"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "points", kind: "message", T: PointsSelector }, + { no: 2, name: "shard_key_selector", kind: "message", T: ShardKeySelector, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PointsUpdateOperation_ClearPayload { + return new PointsUpdateOperation_ClearPayload().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PointsUpdateOperation_ClearPayload { + return new PointsUpdateOperation_ClearPayload().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PointsUpdateOperation_ClearPayload { + return new PointsUpdateOperation_ClearPayload().fromJsonString(jsonString, options); + } + + static equals(a: PointsUpdateOperation_ClearPayload | PlainMessage | undefined, b: PointsUpdateOperation_ClearPayload | PlainMessage | undefined): boolean { + return proto3.util.equals(PointsUpdateOperation_ClearPayload, a, b); + } +} + /** * @generated from message qdrant.UpdateBatchPoints */ @@ -2885,9 +3649,9 @@ export class UpdateResult extends Message { /** * Number of operation * - * @generated from field: uint64 operation_id = 1; + * @generated from field: optional uint64 operation_id = 1; */ - operationId = protoInt64.zero; + operationId?: bigint; /** * Operation status @@ -2904,7 +3668,7 @@ export class UpdateResult extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "qdrant.UpdateResult"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "operation_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 1, name: "operation_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, { no: 2, name: "status", kind: "enum", T: proto3.getEnumType(UpdateStatus) }, ]); @@ -2964,6 +3728,13 @@ export class ScoredPoint extends Message { */ vectors?: Vectors; + /** + * Shard key + * + * @generated from field: optional qdrant.ShardKey shard_key = 7; + */ + shardKey?: ShardKey; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -2977,6 +3748,7 @@ export class ScoredPoint extends Message { { no: 3, name: "score", kind: "scalar", T: 2 /* ScalarType.FLOAT */ }, { no: 5, name: "version", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 6, name: "vectors", kind: "message", T: Vectors, opt: true }, + { no: 7, name: "shard_key", kind: "message", T: ShardKey, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ScoredPoint { @@ -3479,6 +4251,13 @@ export class RetrievedPoint extends Message { */ vectors?: Vectors; + /** + * Shard key + * + * @generated from field: optional qdrant.ShardKey shard_key = 5; + */ + shardKey?: ShardKey; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -3490,6 +4269,7 @@ export class RetrievedPoint extends Message { { no: 1, name: "id", kind: "message", T: PointId }, { no: 2, name: "payload", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Value} }, { no: 4, name: "vectors", kind: "message", T: Vectors, opt: true }, + { no: 5, name: "shard_key", kind: "message", T: ShardKey, opt: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RetrievedPoint { @@ -3644,6 +4424,96 @@ export class RecommendBatchResponse extends Message { } } +/** + * @generated from message qdrant.DiscoverResponse + */ +export class DiscoverResponse extends Message { + /** + * @generated from field: repeated qdrant.ScoredPoint result = 1; + */ + result: ScoredPoint[] = []; + + /** + * Time spent to process + * + * @generated from field: double time = 2; + */ + time = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.DiscoverResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "result", kind: "message", T: ScoredPoint, repeated: true }, + { no: 2, name: "time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DiscoverResponse { + return new DiscoverResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DiscoverResponse { + return new DiscoverResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DiscoverResponse { + return new DiscoverResponse().fromJsonString(jsonString, options); + } + + static equals(a: DiscoverResponse | PlainMessage | undefined, b: DiscoverResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(DiscoverResponse, a, b); + } +} + +/** + * @generated from message qdrant.DiscoverBatchResponse + */ +export class DiscoverBatchResponse extends Message { + /** + * @generated from field: repeated qdrant.BatchResult result = 1; + */ + result: BatchResult[] = []; + + /** + * Time spent to process + * + * @generated from field: double time = 2; + */ + time = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "qdrant.DiscoverBatchResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "result", kind: "message", T: BatchResult, repeated: true }, + { no: 2, name: "time", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DiscoverBatchResponse { + return new DiscoverBatchResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DiscoverBatchResponse { + return new DiscoverBatchResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DiscoverBatchResponse { + return new DiscoverBatchResponse().fromJsonString(jsonString, options); + } + + static equals(a: DiscoverBatchResponse | PlainMessage | undefined, b: DiscoverBatchResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(DiscoverBatchResponse, a, b); + } +} + /** * @generated from message qdrant.RecommendGroupsResponse */ diff --git a/packages/js-client-grpc/src/proto/points_service_connect.ts b/packages/js-client-grpc/src/proto/points_service_connect.ts index 439a676..093c9ef 100644 --- a/packages/js-client-grpc/src/proto/points_service_connect.ts +++ b/packages/js-client-grpc/src/proto/points_service_connect.ts @@ -1,9 +1,9 @@ -// @generated by protoc-gen-connect-es v0.9.1 with parameter "target=ts" +// @generated by protoc-gen-connect-es v0.10.0 with parameter "target=ts" // @generated from file points_service.proto (package qdrant, syntax proto3) /* eslint-disable */ // @ts-nocheck -import { ClearPayloadPoints, CountPoints, CountResponse, CreateFieldIndexCollection, DeleteFieldIndexCollection, DeletePayloadPoints, DeletePoints, DeletePointVectors, GetPoints, GetResponse, PointsOperationResponse, RecommendBatchPoints, RecommendBatchResponse, RecommendGroupsResponse, RecommendPointGroups, RecommendPoints, RecommendResponse, ScrollPoints, ScrollResponse, SearchBatchPoints, SearchBatchResponse, SearchGroupsResponse, SearchPointGroups, SearchPoints, SearchResponse, SetPayloadPoints, UpdateBatchPoints, UpdateBatchResponse, UpdatePointVectors, UpsertPoints } from "./points_pb.js"; +import { ClearPayloadPoints, CountPoints, CountResponse, CreateFieldIndexCollection, DeleteFieldIndexCollection, DeletePayloadPoints, DeletePoints, DeletePointVectors, DiscoverBatchPoints, DiscoverBatchResponse, DiscoverPoints, DiscoverResponse, GetPoints, GetResponse, PointsOperationResponse, RecommendBatchPoints, RecommendBatchResponse, RecommendGroupsResponse, RecommendPointGroups, RecommendPoints, RecommendResponse, ScrollPoints, ScrollResponse, SearchBatchPoints, SearchBatchResponse, SearchGroupsResponse, SearchPointGroups, SearchPoints, SearchResponse, SetPayloadPoints, UpdateBatchPoints, UpdateBatchResponse, UpdatePointVectors, UpsertPoints } from "./points_pb.js"; import { MethodKind } from "@bufbuild/protobuf"; /** @@ -228,6 +228,44 @@ export const Points = { O: RecommendGroupsResponse, kind: MethodKind.Unary, }, + /** + * + * Use context and a target to find the most similar points to the target, constrained by the context. + * + * When using only the context (without a target), a special search - called context search - is performed where + * pairs of points are used to generate a loss that guides the search towards the zone where + * most positive examples overlap. This means that the score minimizes the scenario of + * finding a point closer to a negative than to a positive part of a pair. + * + * Since the score of a context relates to loss, the maximum score a point can get is 0.0, + * and it becomes normal that many points can have a score of 0.0. + * + * When using target (with or without context), the score behaves a little different: The + * integer part of the score represents the rank with respect to the context, while the + * decimal part of the score relates to the distance to the target. The context part of the score for + * each pair is calculated +1 if the point is closer to a positive than to a negative part of a pair, + * and -1 otherwise. + * + * @generated from rpc qdrant.Points.Discover + */ + discover: { + name: "Discover", + I: DiscoverPoints, + O: DiscoverResponse, + kind: MethodKind.Unary, + }, + /** + * + * Batch request points based on { positive, negative } pairs of examples, and/or a target + * + * @generated from rpc qdrant.Points.DiscoverBatch + */ + discoverBatch: { + name: "DiscoverBatch", + I: DiscoverBatchPoints, + O: DiscoverBatchResponse, + kind: MethodKind.Unary, + }, /** * * Count points in collection with given filtering conditions diff --git a/packages/js-client-grpc/src/proto/qdrant_connect.ts b/packages/js-client-grpc/src/proto/qdrant_connect.ts index af55e5c..9c27af6 100644 --- a/packages/js-client-grpc/src/proto/qdrant_connect.ts +++ b/packages/js-client-grpc/src/proto/qdrant_connect.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-connect-es v0.9.1 with parameter "target=ts" +// @generated by protoc-gen-connect-es v0.10.0 with parameter "target=ts" // @generated from file qdrant.proto (package qdrant, syntax proto3) /* eslint-disable */ // @ts-nocheck diff --git a/packages/js-client-grpc/src/proto/snapshots_service_connect.ts b/packages/js-client-grpc/src/proto/snapshots_service_connect.ts index 633016f..217a24c 100644 --- a/packages/js-client-grpc/src/proto/snapshots_service_connect.ts +++ b/packages/js-client-grpc/src/proto/snapshots_service_connect.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-connect-es v0.9.1 with parameter "target=ts" +// @generated by protoc-gen-connect-es v0.10.0 with parameter "target=ts" // @generated from file snapshots_service.proto (package qdrant, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -38,7 +38,7 @@ export const Snapshots = { }, /** * - * Delete collection snapshots + * Delete collection snapshot * * @generated from rpc qdrant.Snapshots.Delete */ @@ -74,7 +74,7 @@ export const Snapshots = { }, /** * - * List full storage snapshots + * Delete full storage snapshot * * @generated from rpc qdrant.Snapshots.DeleteFull */ diff --git a/packages/js-client-rest/CHANGELOG.md b/packages/js-client-rest/CHANGELOG.md index 9ed22ef..ee5d3dd 100644 --- a/packages/js-client-rest/CHANGELOG.md +++ b/packages/js-client-rest/CHANGELOG.md @@ -1,5 +1,11 @@ # @qdrant/js-client-rest +## 1.7.0 + +### Minor Changes + +- Qdrant v1.7.0 API + ## 1.6.0 ### Minor Changes diff --git a/packages/js-client-rest/package.json b/packages/js-client-rest/package.json index 0c8b2a1..7a394e4 100644 --- a/packages/js-client-rest/package.json +++ b/packages/js-client-rest/package.json @@ -1,6 +1,6 @@ { "name": "@qdrant/js-client-rest", - "version": "1.6.0", + "version": "1.7.0", "engines": { "node": ">=18.0.0", "pnpm": ">=8" @@ -55,7 +55,7 @@ "dependencies": { "@sevinf/maybe": "^0.5.0", "@qdrant/openapi-typescript-fetch": "^1.2.1", - "undici": "^5.22.1" + "undici": "^5.26.2" }, "devDependencies": { "@rollup/plugin-commonjs": "^24.1.0", diff --git a/packages/js-client-rest/src/api-client.ts b/packages/js-client-rest/src/api-client.ts index a6ee676..ec2a153 100644 --- a/packages/js-client-rest/src/api-client.ts +++ b/packages/js-client-rest/src/api-client.ts @@ -6,6 +6,7 @@ import {createCollectionsApi} from './api/collections-api.js'; import {createPointsApi} from './api/points-api.js'; import {createServiceApi} from './api/service-api.js'; import {createSnapshotsApi} from './api/snapshots-api.js'; +import {createShardsApi} from './api/shards-api.js'; import {QdrantClientTimeoutError, QdrantClientUnexpectedResponseError} from './errors.js'; import {RestArgs} from './types.js'; @@ -20,6 +21,7 @@ export function createApis(baseUrl: string, args: RestArgs) { points: createPointsApi(client), service: createServiceApi(client), snapshots: createSnapshotsApi(client), + shards: createShardsApi(client), } as const; } diff --git a/packages/js-client-rest/src/api/points-api.ts b/packages/js-client-rest/src/api/points-api.ts index 038cd7d..70ff2e2 100644 --- a/packages/js-client-rest/src/api/points-api.ts +++ b/packages/js-client-rest/src/api/points-api.ts @@ -71,7 +71,7 @@ export function createPointsApi(client: Client) { recommendBatchPoints: client .path('/collections/{collection_name}/points/recommend/batch') .method('post') - .create({consistency: true}), + .create({consistency: true, timeout: true}), /** * Look for the points which are closer to stored positive examples and at the same time further to negative examples. @@ -79,7 +79,7 @@ export function createPointsApi(client: Client) { recommendPoints: client .path('/collections/{collection_name}/points/recommend') .method('post') - .create({consistency: true}), + .create({consistency: true, timeout: true}), /** * Search point groups @@ -87,7 +87,7 @@ export function createPointsApi(client: Client) { searchPointGroups: client .path('/collections/{collection_name}/points/search/groups') .method('post') - .create({consistency: true}), + .create({consistency: true, timeout: true}), /** * Scroll request - paginate over all points which matches given filtering condition @@ -103,7 +103,7 @@ export function createPointsApi(client: Client) { searchBatchPoints: client .path('/collections/{collection_name}/points/search/batch') .method('post') - .create({consistency: true}), + .create({consistency: true, timeout: true}), /** * Retrieve closest points based on vector similarity and given filtering conditions @@ -111,7 +111,7 @@ export function createPointsApi(client: Client) { searchPoints: client .path('/collections/{collection_name}/points/search') .method('post') - .create({consistency: true}), + .create({consistency: true, timeout: true}), /** * Set payload values for points @@ -135,7 +135,7 @@ export function createPointsApi(client: Client) { recommendPointGroups: client .path('/collections/{collection_name}/points/recommend/groups') .method('post') - .create({consistency: true}), + .create({consistency: true, timeout: true}), /** * Apply a series of update operations for points, vectors and payloads @@ -144,5 +144,21 @@ export function createPointsApi(client: Client) { .path('/collections/{collection_name}/points/batch') .method('post') .create({wait: true, ordering: true}), + + /** + * Discover points + */ + discoverPoints: client + .path('/collections/{collection_name}/points/discover') + .method('post') + .create({consistency: true, timeout: true}), + + /** + * Discover batch points + */ + discoverBatchPoints: client + .path('/collections/{collection_name}/points/discover/batch') + .method('post') + .create({consistency: true, timeout: true}), } as const; } diff --git a/packages/js-client-rest/src/api/shards-api.ts b/packages/js-client-rest/src/api/shards-api.ts new file mode 100644 index 0000000..010ec83 --- /dev/null +++ b/packages/js-client-rest/src/api/shards-api.ts @@ -0,0 +1,18 @@ +import {Client} from '../api-client.js'; + +export function createShardsApi(client: Client) { + return { + /** + * Create shard key + */ + createShardKey: client.path('/collections/{collection_name}/shards').method('put').create({timeout: true}), + + /** + * Delete shard key + */ + deleteShardKey: client + .path('/collections/{collection_name}/shards/delete') + .method('post') + .create({timeout: true}), + } as const; +} diff --git a/packages/js-client-rest/src/openapi/generated_schema.ts b/packages/js-client-rest/src/openapi/generated_schema.ts index d2aa2ff..46ee03d 100644 --- a/packages/js-client-rest/src/openapi/generated_schema.ts +++ b/packages/js-client-rest/src/openapi/generated_schema.ts @@ -10,6 +10,14 @@ type XOR = (T | U) extends object ? (Without & U) | (Without & type OneOf = T extends [infer Only] ? Only : T extends [infer A, infer B, ...infer Rest] ? OneOf<[XOR, ...Rest]> : never; export interface paths { + "/collections/{collection_name}/shards": { + /** Create shard key */ + put: operations["create_shard_key"]; + }; + "/collections/{collection_name}/shards/delete": { + /** Delete shard key */ + post: operations["delete_shard_key"]; + }; "/telemetry": { /** * Collect telemetry data @@ -367,6 +375,23 @@ export interface paths { */ post: operations["recommend_point_groups"]; }; + "/collections/{collection_name}/points/discover": { + /** + * Discover points + * @description Use context and a target to find the most similar points to the target, constrained by the context. + * When using only the context (without a target), a special search - called context search - is performed where pairs of points are used to generate a loss that guides the search towards the zone where most positive examples overlap. This means that the score minimizes the scenario of finding a point closer to a negative than to a positive part of a pair. + * Since the score of a context relates to loss, the maximum score a point can get is 0.0, and it becomes normal that many points can have a score of 0.0. + * When using target (with or without context), the score behaves a little different: The integer part of the score represents the rank with respect to the context, while the decimal part of the score relates to the distance to the target. The context part of the score for each pair is calculated +1 if the point is closer to a positive than to a negative part of a pair, and -1 otherwise. + */ + post: operations["discover_points"]; + }; + "/collections/{collection_name}/points/discover/batch": { + /** + * Discover batch points + * @description Look for points based on target and/or positive and negative example pairs, in batch. + */ + post: operations["discover_batch_points"]; + }; "/collections/{collection_name}/points/count": { /** * Count points @@ -404,19 +429,19 @@ export interface components { optimizer_status: components["schemas"]["OptimizersStatus"]; /** * Format: uint - * @description Number of vectors in collection All vectors in collection are available for querying Calculated as `points_count x vectors_per_point` Where `vectors_per_point` is a number of named vectors in schema + * @description Approximate number of vectors in collection. All vectors in collection are available for querying. Calculated as `points_count x vectors_per_point`. Where `vectors_per_point` is a number of named vectors in schema. */ - vectors_count: number; + vectors_count?: number | null; /** * Format: uint - * @description Number of indexed vectors in the collection. Indexed vectors in large segments are faster to query, as it is stored in vector index (HNSW) + * @description Approximate number of indexed vectors in the collection. Indexed vectors in large segments are faster to query, as it is stored in a specialized vector index. */ - indexed_vectors_count: number; + indexed_vectors_count?: number | null; /** * Format: uint - * @description Number of points (vectors + payloads) in collection Each point could be accessed by unique id + * @description Approximate number of points (vectors + payloads) in collection. Each point could be accessed by unique id. */ - points_count: number; + points_count?: number | null; /** * Format: uint * @description Number of segments in collection. Each segment has independent vector as payload indexes @@ -446,13 +471,15 @@ export interface components { quantization_config?: components["schemas"]["QuantizationConfig"] | (Record | null); }; CollectionParams: { - vectors: components["schemas"]["VectorsConfig"]; + vectors?: components["schemas"]["VectorsConfig"]; /** * Format: uint32 * @description Number of shards the collection has * @default 1 */ shard_number?: number; + /** @description Sharding method Default is Auto - points are distributed across all available shards Custom - points are distributed across shards according to shard key */ + sharding_method?: components["schemas"]["ShardingMethod"] | (Record | null); /** * Format: uint32 * @description Number of replicas for each shard @@ -475,6 +502,10 @@ export interface components { * @default false */ on_disk_payload?: boolean; + /** @description Configuration of the sparse vector storage */ + sparse_vectors?: ({ + [key: string]: components["schemas"]["SparseVectorParams"] | undefined; + }) | null; }; /** * @description Vector params separator for single and multiple vector modes Single mode: @@ -507,7 +538,7 @@ export interface components { * @description Type of internal tags, build from payload Distance function types used to compare vectors * @enum {string} */ - Distance: "Cosine" | "Euclid" | "Dot"; + Distance: "Cosine" | "Euclid" | "Dot" | "Manhattan"; HnswConfigDiff: { /** * Format: uint @@ -568,6 +599,25 @@ export interface components { BinaryQuantizationConfig: { always_ram?: boolean | null; }; + /** @enum {string} */ + ShardingMethod: "auto" | "custom"; + /** @description Params of single sparse vector data storage */ + SparseVectorParams: { + /** @description Custom params for index. If none - values from collection configuration are used. */ + index?: components["schemas"]["SparseIndexParams"] | (Record | null); + }; + /** @description Configuration for sparse inverted index. */ + SparseIndexParams: { + /** + * Format: uint + * @description We prefer a full scan search upto (excluding) this number of vectors. + * + * Note: this is number of vectors, not KiloBytes. + */ + full_scan_threshold?: number | null; + /** @description Store index on disk. If set to false, the index will be stored in RAM. Default: false */ + on_disk?: boolean | null; + }; /** @description Config of HNSW index */ HnswConfig: { /** @@ -704,12 +754,16 @@ export interface components { /** @enum {string} */ TokenizerType: "prefix" | "whitespace" | "word" | "multilingual"; PointRequest: { + /** @description Specify in which shards to look for the points, if not specified - look in all shards */ + shard_key?: components["schemas"]["ShardKeySelector"] | (Record | null); /** @description Look for points with ids */ ids: (components["schemas"]["ExtendedPointId"])[]; /** @description Select which payload to return with the response. Default: All */ with_payload?: components["schemas"]["WithPayloadInterface"] | (Record | null); with_vector?: components["schemas"]["WithVector"]; }; + ShardKeySelector: components["schemas"]["ShardKey"] | (components["schemas"]["ShardKey"])[]; + ShardKey: string | number; /** @description Type, used for specifying point ID in user interface */ ExtendedPointId: number | string; /** @description Options for specifying which payload to include or not */ @@ -733,16 +787,28 @@ export interface components { payload?: components["schemas"]["Payload"] | (Record | null); /** @description Vector of the point */ vector?: components["schemas"]["VectorStruct"] | (Record | null); + /** @description Shard Key */ + shard_key?: components["schemas"]["ShardKey"] | (Record | null); }; Payload: { [key: string]: unknown; }; /** @description Full vector data per point separator with single and multiple vector modes */ VectorStruct: (number)[] | ({ - [key: string]: (number)[] | undefined; + [key: string]: components["schemas"]["Vector"] | undefined; }); + Vector: (number)[] | components["schemas"]["SparseVector"]; + /** @description Sparse vector structure */ + SparseVector: { + /** @description indices must be unique */ + indices: (number)[]; + /** @description values and indices must be the same length */ + values: (number)[]; + }; /** @description Search request. Holds all conditions and parameters for the search of most similar points by vector similarity given the filtering restrictions. */ SearchRequest: { + /** @description Specify in which shards to look for the points, if not specified - look in all shards */ + shard_key?: components["schemas"]["ShardKeySelector"] | (Record | null); vector: components["schemas"]["NamedVectorStruct"]; /** @description Look only for points which satisfies this conditions */ filter?: components["schemas"]["Filter"] | (Record | null); @@ -755,10 +821,9 @@ export interface components { limit: number; /** * Format: uint - * @description Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues. - * @default 0 + * @description Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues. */ - offset?: number; + offset?: number | null; /** @description Select which payload to return with the response. Default: None */ with_payload?: components["schemas"]["WithPayloadInterface"] | (Record | null); /** @@ -781,7 +846,7 @@ export interface components { * * { "vector": { "vector": [1.0, 2.0, 3.0], "name": "image-embeddings" } } */ - NamedVectorStruct: (number)[] | components["schemas"]["NamedVector"]; + NamedVectorStruct: (number)[] | components["schemas"]["NamedVector"] | components["schemas"]["NamedSparseVector"]; /** @description Vector data with name */ NamedVector: { /** @description Name of vector data */ @@ -789,6 +854,12 @@ export interface components { /** @description Vector data */ vector: (number)[]; }; + /** @description Sparse vector data with name */ + NamedSparseVector: { + /** @description Name of vector data */ + name: string; + vector: components["schemas"]["SparseVector"]; + }; Filter: { /** @description At least one of those conditions should match */ should?: (components["schemas"]["Condition"])[] | null; @@ -1012,13 +1083,15 @@ export interface components { payload?: components["schemas"]["Payload"] | (Record | null); /** @description Vector of the point */ vector?: components["schemas"]["VectorStruct"] | (Record | null); + /** @description Shard Key */ + shard_key?: components["schemas"]["ShardKey"] | (Record | null); }; UpdateResult: { /** * Format: uint64 * @description Sequential number of the operation */ - operation_id: number; + operation_id?: number | null; status: components["schemas"]["UpdateStatus"]; }; /** @@ -1032,6 +1105,8 @@ export interface components { * Service should look for the points which are closer to positive examples and at the same time further to negative examples. The concrete way of how to compare negative and positive distances is up to the `strategy` chosen. */ RecommendRequest: { + /** @description Specify in which shards to look for the points, if not specified - look in all shards */ + shard_key?: components["schemas"]["ShardKeySelector"] | (Record | null); /** * @description Look for vectors closest to those * @default [] @@ -1055,10 +1130,9 @@ export interface components { limit: number; /** * Format: uint - * @description Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues. - * @default 0 + * @description Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues. */ - offset?: number; + offset?: number | null; /** @description Select which payload to return with the response. Default: None */ with_payload?: components["schemas"]["WithPayloadInterface"] | (Record | null); /** @@ -1082,7 +1156,7 @@ export interface components { */ lookup_from?: components["schemas"]["LookupLocation"] | (Record | null); }; - RecommendExample: components["schemas"]["ExtendedPointId"] | (number)[]; + RecommendExample: components["schemas"]["ExtendedPointId"] | (number)[] | components["schemas"]["SparseVector"]; /** * @description How to use positive and negative examples to find the results, default is `average_vector`: * @@ -1102,9 +1176,13 @@ export interface components { * @default null */ vector?: string | null; + /** @description Specify in which shards to look for the points, if not specified - look in all shards */ + shard_key?: components["schemas"]["ShardKeySelector"] | (Record | null); }; /** @description Scroll request - paginate over all points which matches given condition */ ScrollRequest: { + /** @description Specify in which shards to look for the points, if not specified - look in all shards */ + shard_key?: components["schemas"]["ShardKeySelector"] | (Record | null); /** @description Start ID to read points from. */ offset?: components["schemas"]["ExtendedPointId"] | (Record | null); /** @@ -1127,13 +1205,18 @@ export interface components { }; /** @description Operation for creating new collection and (optionally) specify index params */ CreateCollection: { - vectors: components["schemas"]["VectorsConfig"]; + vectors?: components["schemas"]["VectorsConfig"]; /** * Format: uint32 - * @description Number of shards in collection. Default is 1 for standalone, otherwise equal to the number of nodes Minimum is 1 + * @description For auto sharding: Number of shards in collection. - Default is 1 for standalone, otherwise equal to the number of nodes - Minimum is 1 For custom sharding: Number of shards in collection per shard group. - Default is 1, meaning that each shard key will be mapped to a single shard - Minimum is 1 * @default null */ shard_number?: number | null; + /** + * @description Sharding method Default is Auto - points are distributed across all available shards Custom - points are distributed across shards according to shard key + * @default null + */ + sharding_method?: components["schemas"]["ShardingMethod"] | (Record | null); /** * Format: uint32 * @description Number of shards replicas. Default is 1 Minimum is 1 @@ -1167,6 +1250,10 @@ export interface components { * @default null */ quantization_config?: components["schemas"]["QuantizationConfig"] | (Record | null); + /** @description Sparse vector data config. */ + sparse_vectors?: ({ + [key: string]: components["schemas"]["SparseVectorParams"] | undefined; + }) | null; }; WalConfigDiff: { /** @@ -1257,6 +1344,8 @@ export interface components { * @default null */ quantization_config?: components["schemas"]["QuantizationConfigDiff"] | (Record | null); + /** @description Map of sparse vector data parameters to update for each sparse vector. */ + sparse_vectors?: components["schemas"]["SparseVectorsConfig"] | (Record | null); }; /** * @description Vector update params for multiple vectors @@ -1299,6 +1388,9 @@ export interface components { */ on_disk_payload?: boolean | null; }; + SparseVectorsConfig: { + [key: string]: components["schemas"]["SparseVectorParams"] | undefined; + }; /** @description Operation for performing changes of collection aliases. Alias changes are atomic, meaning that no collection modifications can happen between alias operations. */ ChangeAliasesOperation: { actions: (components["schemas"]["AliasOperations"])[]; @@ -1338,38 +1430,45 @@ export interface components { PointsSelector: components["schemas"]["PointIdsList"] | components["schemas"]["FilterSelector"]; PointIdsList: { points: (components["schemas"]["ExtendedPointId"])[]; + shard_key?: components["schemas"]["ShardKeySelector"] | (Record | null); }; FilterSelector: { filter: components["schemas"]["Filter"]; + shard_key?: components["schemas"]["ShardKeySelector"] | (Record | null); }; PointInsertOperations: components["schemas"]["PointsBatch"] | components["schemas"]["PointsList"]; - BatchVectorStruct: ((number)[])[] | ({ - [key: string]: ((number)[])[] | undefined; - }); - PointStruct: { - id: components["schemas"]["ExtendedPointId"]; - vector: components["schemas"]["VectorStruct"]; - /** @description Payload values (optional) */ - payload?: components["schemas"]["Payload"] | (Record | null); + PointsBatch: { + batch: components["schemas"]["Batch"]; + shard_key?: components["schemas"]["ShardKeySelector"] | (Record | null); }; Batch: { ids: (components["schemas"]["ExtendedPointId"])[]; vectors: components["schemas"]["BatchVectorStruct"]; payloads?: ((components["schemas"]["Payload"] | (Record | null))[]) | null; }; - PointsBatch: { - batch: components["schemas"]["Batch"]; - }; + BatchVectorStruct: ((number)[])[] | ({ + [key: string]: (components["schemas"]["Vector"])[] | undefined; + }); PointsList: { points: (components["schemas"]["PointStruct"])[]; + shard_key?: components["schemas"]["ShardKeySelector"] | (Record | null); + }; + PointStruct: { + id: components["schemas"]["ExtendedPointId"]; + vector: components["schemas"]["VectorStruct"]; + /** @description Payload values (optional) */ + payload?: components["schemas"]["Payload"] | (Record | null); }; + /** @description This data structure is used in API interface and applied across multiple shards */ SetPayload: { payload: components["schemas"]["Payload"]; /** @description Assigns payload to each point in this list */ points?: (components["schemas"]["ExtendedPointId"])[] | null; /** @description Assigns payload to each point that satisfy this filter condition */ filter?: components["schemas"]["Filter"] | (Record | null); + shard_key?: components["schemas"]["ShardKeySelector"] | (Record | null); }; + /** @description This data structure is used in API interface and applied across multiple shards */ DeletePayload: { /** @description List of payload keys to remove from payload */ keys: (string)[]; @@ -1377,6 +1476,7 @@ export interface components { points?: (components["schemas"]["ExtendedPointId"])[] | null; /** @description Deletes values from points that satisfy this filter condition */ filter?: components["schemas"]["Filter"] | (Record | null); + shard_key?: components["schemas"]["ShardKeySelector"] | (Record | null); }; /** @description Information about current cluster status and structure */ ClusterStatus: OneOf<[{ @@ -1466,6 +1566,8 @@ export interface components { }; /** @description Count Request Counts the number of points which satisfy the given filter. If filter is not provided, the count of all points in the collection will be returned. */ CountRequest: { + /** @description Specify in which shards to look for the points, if not specified - look in all shards */ + shard_key?: components["schemas"]["ShardKeySelector"] | (Record | null); /** @description Look only for points which satisfies this conditions */ filter?: components["schemas"]["Filter"] | (Record | null); /** @@ -1506,6 +1608,8 @@ export interface components { * @description Local shard id */ shard_id: number; + /** @description User-defined sharding key */ + shard_key?: components["schemas"]["ShardKey"] | (Record | null); /** * Format: uint * @description Number of points in the shard @@ -1517,13 +1621,15 @@ export interface components { * @description State of the single shard within a replica set. * @enum {string} */ - ReplicaState: "Active" | "Dead" | "Partial" | "Initializing" | "Listener"; + ReplicaState: "Active" | "Dead" | "Partial" | "Initializing" | "Listener" | "PartialSnapshot"; RemoteShardInfo: { /** * Format: uint32 * @description Remote shard id */ shard_id: number; + /** @description User-defined sharding key */ + shard_key?: components["schemas"]["ShardKey"] | (Record | null); /** * Format: uint64 * @description Remote peer id @@ -1540,7 +1646,10 @@ export interface components { to: number; /** @description If `true` transfer is a synchronization of a replicas If `false` transfer is a moving of a shard from one peer to another */ sync: boolean; + method?: components["schemas"]["ShardTransferMethod"] | (Record | null); }; + /** @description Methods for transferring a shard from one node to another. */ + ShardTransferMethod: "stream_records" | "snapshot"; TelemetryData: { id: string; app: components["schemas"]["AppBuildTelemetry"]; @@ -1645,9 +1754,13 @@ export interface components { num_deleted_vectors: number; }; SegmentConfig: { - vector_data: { + /** @default {} */ + vector_data?: { [key: string]: components["schemas"]["VectorDataConfig"] | undefined; }; + sparse_vector_data?: { + [key: string]: components["schemas"]["SparseVectorDataConfig"] | undefined; + }; payload_storage_type: components["schemas"]["PayloadStorageType"]; }; /** @description Config of single vector data storage */ @@ -1675,6 +1788,23 @@ export interface components { type: "hnsw"; options: components["schemas"]["HnswConfig"]; }]>; + /** @description Config of single sparse vector data storage */ + SparseVectorDataConfig: { + index: components["schemas"]["SparseIndexConfig"]; + }; + /** @description Configuration for sparse inverted index. */ + SparseIndexConfig: { + /** + * Format: uint + * @description We prefer a full scan search upto (excluding) this number of vectors. + * + * Note: this is number of vectors, not KiloBytes. + */ + full_scan_threshold?: number | null; + index_type: components["schemas"]["SparseIndexType"]; + }; + /** @description Sparse index types */ + SparseIndexType: "MutableRam" | "ImmutableRam" | "Mmap"; /** @description Type of payload storage */ PayloadStorageType: OneOf<[{ /** @enum {string} */ @@ -1687,10 +1817,12 @@ export interface components { index_name?: string | null; unfiltered_plain: components["schemas"]["OperationDurationStatistics"]; unfiltered_hnsw: components["schemas"]["OperationDurationStatistics"]; + unfiltered_sparse: components["schemas"]["OperationDurationStatistics"]; filtered_plain: components["schemas"]["OperationDurationStatistics"]; filtered_small_cardinality: components["schemas"]["OperationDurationStatistics"]; filtered_large_cardinality: components["schemas"]["OperationDurationStatistics"]; filtered_exact: components["schemas"]["OperationDurationStatistics"]; + filtered_sparse: components["schemas"]["OperationDurationStatistics"]; unfiltered_exact: components["schemas"]["OperationDurationStatistics"]; }; OperationDurationStatistics: { @@ -1813,7 +1945,7 @@ export interface components { [key: string]: components["schemas"]["OperationDurationStatistics"] | undefined; }; }; - ClusterOperations: components["schemas"]["MoveShardOperation"] | components["schemas"]["ReplicateShardOperation"] | components["schemas"]["AbortTransferOperation"] | components["schemas"]["DropReplicaOperation"]; + ClusterOperations: components["schemas"]["MoveShardOperation"] | components["schemas"]["ReplicateShardOperation"] | components["schemas"]["AbortTransferOperation"] | components["schemas"]["DropReplicaOperation"] | components["schemas"]["CreateShardingKeyOperation"] | components["schemas"]["DropShardingKeyOperation"]; MoveShardOperation: { move_shard: components["schemas"]["MoveShard"]; }; @@ -1824,6 +1956,8 @@ export interface components { to_peer_id: number; /** Format: uint64 */ from_peer_id: number; + /** @description Method for transferring the shard from one node to another */ + method?: components["schemas"]["ShardTransferMethod"] | (Record | null); }; ReplicateShardOperation: { replicate_shard: components["schemas"]["MoveShard"]; @@ -1840,6 +1974,30 @@ export interface components { /** Format: uint64 */ peer_id: number; }; + CreateShardingKeyOperation: { + create_sharding_key: components["schemas"]["CreateShardingKey"]; + }; + CreateShardingKey: { + shard_key: components["schemas"]["ShardKey"]; + /** + * Format: uint32 + * @description How many shards to create for this key If not specified, will use the default value from config + */ + shards_number?: number | null; + /** + * Format: uint32 + * @description How many replicas to create for each shard If not specified, will use the default value from config + */ + replication_factor?: number | null; + /** @description Placement of shards for this key List of peer ids, that can be used to place shards for this key If not specified, will be randomly placed among all peers */ + placement?: (number)[] | null; + }; + DropShardingKeyOperation: { + drop_sharding_key: components["schemas"]["DropShardingKey"]; + }; + DropShardingKey: { + shard_key: components["schemas"]["ShardKey"]; + }; SearchRequestBatch: { searches: (components["schemas"]["SearchRequest"])[]; }; @@ -1913,6 +2071,7 @@ export interface components { UpdateVectors: { /** @description Points with named vectors */ points: (components["schemas"]["PointVectors"])[]; + shard_key?: components["schemas"]["ShardKeySelector"] | (Record | null); }; PointVectors: { id: components["schemas"]["ExtendedPointId"]; @@ -1925,6 +2084,7 @@ export interface components { filter?: components["schemas"]["Filter"] | (Record | null); /** @description Vector names */ vector: (string)[]; + shard_key?: components["schemas"]["ShardKeySelector"] | (Record | null); }; PointGroup: { /** @description Scored points that have the same value of the group_by key */ @@ -1936,6 +2096,8 @@ export interface components { /** @description Value of the group_by key, shared across all the hits in the group */ GroupId: string | number; SearchGroupsRequest: { + /** @description Specify in which shards to look for the points, if not specified - look in all shards */ + shard_key?: components["schemas"]["ShardKeySelector"] | (Record | null); vector: components["schemas"]["NamedVectorStruct"]; /** @description Look only for points which satisfies this conditions */ filter?: components["schemas"]["Filter"] | (Record | null); @@ -1984,6 +2146,8 @@ export interface components { with_vectors?: components["schemas"]["WithVector"] | (Record | null); }; RecommendGroupsRequest: { + /** @description Specify in which shards to look for the points, if not specified - look in all shards */ + shard_key?: components["schemas"]["ShardKeySelector"] | (Record | null); /** * @description Look for vectors closest to those * @default [] @@ -2077,6 +2241,62 @@ export interface components { priority?: components["schemas"]["SnapshotPriority"] | (Record | null); }; ShardSnapshotLocation: string; + /** @description Use context and a target to find the most similar points, constrained by the context. */ + DiscoverRequest: { + /** @description Specify in which shards to look for the points, if not specified - look in all shards */ + shard_key?: components["schemas"]["ShardKeySelector"] | (Record | null); + /** + * @description Look for vectors closest to this. + * + * When using the target (with or without context), the integer part of the score represents the rank with respect to the context, while the decimal part of the score relates to the distance to the target. + */ + target?: components["schemas"]["RecommendExample"] | (Record | null); + /** + * @description Pairs of { positive, negative } examples to constrain the search. + * + * When using only the context (without a target), a special search - called context search - is performed where pairs of points are used to generate a loss that guides the search towards the zone where most positive examples overlap. This means that the score minimizes the scenario of finding a point closer to a negative than to a positive part of a pair. + * + * Since the score of a context relates to loss, the maximum score a point can get is 0.0, and it becomes normal that many points can have a score of 0.0. + * + * For discovery search (when including a target), the context part of the score for each pair is calculated +1 if the point is closer to a positive than to a negative part of a pair, and -1 otherwise. + */ + context?: (components["schemas"]["ContextExamplePair"])[] | null; + /** @description Look only for points which satisfies this conditions */ + filter?: components["schemas"]["Filter"] | (Record | null); + /** @description Additional search params */ + params?: components["schemas"]["SearchParams"] | (Record | null); + /** + * Format: uint + * @description Max number of result to return + */ + limit: number; + /** + * Format: uint + * @description Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues. + */ + offset?: number | null; + /** @description Select which payload to return with the response. Default: None */ + with_payload?: components["schemas"]["WithPayloadInterface"] | (Record | null); + /** @description Whether to return the point vector with the result? */ + with_vector?: components["schemas"]["WithVector"] | (Record | null); + /** + * @description Define which vector to use for recommendation, if not specified - try to use default vector + * @default null + */ + using?: components["schemas"]["UsingVector"] | (Record | null); + /** + * @description The location used to lookup vectors. If not specified - use current collection. Note: the other collection should have the same vector size as the current collection + * @default null + */ + lookup_from?: components["schemas"]["LookupLocation"] | (Record | null); + }; + ContextExamplePair: { + positive: components["schemas"]["RecommendExample"]; + negative: components["schemas"]["RecommendExample"]; + }; + DiscoverRequestBatch: { + searches: (components["schemas"]["DiscoverRequest"])[]; + }; }; responses: never; parameters: never; @@ -2089,6 +2309,106 @@ export type external = Record; export interface operations { + /** Create shard key */ + create_shard_key: { + parameters: { + query?: { + /** + * @description Wait for operation commit timeout in seconds. + * If timeout is reached - request will return with service error. + */ + timeout?: number; + }; + path: { + /** @description Name of the collection to create shards for */ + collection_name: string; + }; + }; + /** @description Shard key configuration */ + requestBody?: { + content: { + "application/json": components["schemas"]["CreateShardingKey"]; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": { + /** + * Format: float + * @description Time spent to process this request + */ + time?: number; + status?: string; + result?: boolean; + }; + }; + }; + /** @description error */ + default: { + content: { + "application/json": components["schemas"]["ErrorResponse"]; + }; + }; + /** @description error */ + "4XX": { + content: { + "application/json": components["schemas"]["ErrorResponse"]; + }; + }; + }; + }; + /** Delete shard key */ + delete_shard_key: { + parameters: { + query?: { + /** + * @description Wait for operation commit timeout in seconds. + * If timeout is reached - request will return with service error. + */ + timeout?: number; + }; + path: { + /** @description Name of the collection to create shards for */ + collection_name: string; + }; + }; + /** @description Select shard key to delete */ + requestBody?: { + content: { + "application/json": components["schemas"]["DropShardingKey"]; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": { + /** + * Format: float + * @description Time spent to process this request + */ + time?: number; + status?: string; + result?: boolean; + }; + }; + }; + /** @description error */ + default: { + content: { + "application/json": components["schemas"]["ErrorResponse"]; + }; + }; + /** @description error */ + "4XX": { + content: { + "application/json": components["schemas"]["ErrorResponse"]; + }; + }; + }; + }; /** * Collect telemetry data * @description Collect telemetry data including app info, system info, collections info, cluster info, configs and statistics @@ -2110,8 +2430,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["TelemetryData"]; }; }; @@ -2167,8 +2486,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["LocksOption"]; }; }; @@ -2208,8 +2526,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["LocksOption"]; }; }; @@ -2291,8 +2608,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["ClusterStatus"]; }; }; @@ -2323,8 +2639,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: boolean; }; }; @@ -2368,8 +2683,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: boolean; }; }; @@ -2403,8 +2717,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["CollectionsResponse"]; }; }; @@ -2444,8 +2757,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["CollectionInfo"]; }; }; @@ -2498,8 +2810,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: boolean; }; }; @@ -2546,8 +2857,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: boolean; }; }; @@ -2600,8 +2910,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: boolean; }; }; @@ -2647,8 +2956,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: boolean; }; }; @@ -2700,8 +3008,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["UpdateResult"]; }; }; @@ -2749,8 +3056,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["UpdateResult"]; }; }; @@ -2790,8 +3096,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["CollectionClusterInfo"]; }; }; @@ -2841,8 +3146,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: boolean; }; }; @@ -2882,8 +3186,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["CollectionsAliasesResponse"]; }; }; @@ -2917,8 +3220,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["CollectionsAliasesResponse"]; }; }; @@ -2973,8 +3275,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: boolean; }; }; @@ -2988,8 +3289,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "accepted"; + status?: string; }; }; }; @@ -3038,8 +3338,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: boolean; }; }; @@ -3053,8 +3352,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "accepted"; + status?: string; }; }; }; @@ -3093,8 +3391,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: (components["schemas"]["SnapshotDescription"])[]; }; }; @@ -3138,8 +3435,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["SnapshotDescription"]; }; }; @@ -3153,8 +3449,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "accepted"; + status?: string; }; }; }; @@ -3233,8 +3528,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: boolean; }; }; @@ -3248,8 +3542,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "accepted"; + status?: string; }; }; }; @@ -3282,8 +3575,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: (components["schemas"]["SnapshotDescription"])[]; }; }; @@ -3323,8 +3615,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["SnapshotDescription"]; }; }; @@ -3338,8 +3629,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "accepted"; + status?: string; }; }; }; @@ -3414,8 +3704,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: boolean; }; }; @@ -3429,8 +3718,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "accepted"; + status?: string; }; }; }; @@ -3486,8 +3774,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: boolean; }; }; @@ -3501,8 +3788,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "accepted"; + status?: string; }; }; }; @@ -3553,8 +3839,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: boolean; }; }; @@ -3568,8 +3853,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "accepted"; + status?: string; }; }; }; @@ -3610,8 +3894,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: (components["schemas"]["SnapshotDescription"])[]; }; }; @@ -3657,8 +3940,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["SnapshotDescription"]; }; }; @@ -3672,8 +3954,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "accepted"; + status?: string; }; }; }; @@ -3756,8 +4037,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: boolean; }; }; @@ -3771,8 +4051,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "accepted"; + status?: string; }; }; }; @@ -3817,8 +4096,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["Record"]; }; }; @@ -3870,8 +4148,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["UpdateResult"]; }; }; @@ -3921,8 +4198,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: (components["schemas"]["Record"])[]; }; }; @@ -3974,8 +4250,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["UpdateResult"]; }; }; @@ -4027,8 +4302,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["UpdateResult"]; }; }; @@ -4080,8 +4354,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["UpdateResult"]; }; }; @@ -4133,8 +4406,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["UpdateResult"]; }; }; @@ -4186,8 +4458,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["UpdateResult"]; }; }; @@ -4239,8 +4510,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["UpdateResult"]; }; }; @@ -4292,8 +4562,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["UpdateResult"]; }; }; @@ -4345,8 +4614,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: (components["schemas"]["UpdateResult"])[]; }; }; @@ -4396,8 +4664,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["ScrollResult"]; }; }; @@ -4425,6 +4692,8 @@ export interface operations { query?: { /** @description Define read consistency guarantees for the operation */ consistency?: components["schemas"]["ReadConsistency"]; + /** @description If set, overrides global timeout for this request. Unit is seconds. */ + timeout?: number; }; path: { /** @description Name of the collection to search in */ @@ -4447,8 +4716,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: (components["schemas"]["ScoredPoint"])[]; }; }; @@ -4476,6 +4744,8 @@ export interface operations { query?: { /** @description Define read consistency guarantees for the operation */ consistency?: components["schemas"]["ReadConsistency"]; + /** @description If set, overrides global timeout for this request. Unit is seconds. */ + timeout?: number; }; path: { /** @description Name of the collection to search in */ @@ -4498,8 +4768,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: ((components["schemas"]["ScoredPoint"])[])[]; }; }; @@ -4527,6 +4796,8 @@ export interface operations { query?: { /** @description Define read consistency guarantees for the operation */ consistency?: components["schemas"]["ReadConsistency"]; + /** @description If set, overrides global timeout for this request. Unit is seconds. */ + timeout?: number; }; path: { /** @description Name of the collection to search in */ @@ -4549,8 +4820,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["GroupsResult"]; }; }; @@ -4578,6 +4848,8 @@ export interface operations { query?: { /** @description Define read consistency guarantees for the operation */ consistency?: components["schemas"]["ReadConsistency"]; + /** @description If set, overrides global timeout for this request. Unit is seconds. */ + timeout?: number; }; path: { /** @description Name of the collection to search in */ @@ -4600,8 +4872,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: (components["schemas"]["ScoredPoint"])[]; }; }; @@ -4629,6 +4900,8 @@ export interface operations { query?: { /** @description Define read consistency guarantees for the operation */ consistency?: components["schemas"]["ReadConsistency"]; + /** @description If set, overrides global timeout for this request. Unit is seconds. */ + timeout?: number; }; path: { /** @description Name of the collection to search in */ @@ -4651,8 +4924,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: ((components["schemas"]["ScoredPoint"])[])[]; }; }; @@ -4680,6 +4952,8 @@ export interface operations { query?: { /** @description Define read consistency guarantees for the operation */ consistency?: components["schemas"]["ReadConsistency"]; + /** @description If set, overrides global timeout for this request. Unit is seconds. */ + timeout?: number; }; path: { /** @description Name of the collection to search in */ @@ -4702,8 +4976,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["GroupsResult"]; }; }; @@ -4722,6 +4995,113 @@ export interface operations { }; }; }; + /** + * Discover points + * @description Use context and a target to find the most similar points to the target, constrained by the context. + * When using only the context (without a target), a special search - called context search - is performed where pairs of points are used to generate a loss that guides the search towards the zone where most positive examples overlap. This means that the score minimizes the scenario of finding a point closer to a negative than to a positive part of a pair. + * Since the score of a context relates to loss, the maximum score a point can get is 0.0, and it becomes normal that many points can have a score of 0.0. + * When using target (with or without context), the score behaves a little different: The integer part of the score represents the rank with respect to the context, while the decimal part of the score relates to the distance to the target. The context part of the score for each pair is calculated +1 if the point is closer to a positive than to a negative part of a pair, and -1 otherwise. + */ + discover_points: { + parameters: { + query?: { + /** @description Define read consistency guarantees for the operation */ + consistency?: components["schemas"]["ReadConsistency"]; + /** @description If set, overrides global timeout for this request. Unit is seconds. */ + timeout?: number; + }; + path: { + /** @description Name of the collection to search in */ + collection_name: string; + }; + }; + /** @description Request points based on {positive, negative} pairs of examples, and/or a target */ + requestBody?: { + content: { + "application/json": components["schemas"]["DiscoverRequest"]; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": { + /** + * Format: float + * @description Time spent to process this request + */ + time?: number; + status?: string; + result?: (components["schemas"]["ScoredPoint"])[]; + }; + }; + }; + /** @description error */ + default: { + content: { + "application/json": components["schemas"]["ErrorResponse"]; + }; + }; + /** @description error */ + "4XX": { + content: { + "application/json": components["schemas"]["ErrorResponse"]; + }; + }; + }; + }; + /** + * Discover batch points + * @description Look for points based on target and/or positive and negative example pairs, in batch. + */ + discover_batch_points: { + parameters: { + query?: { + /** @description Define read consistency guarantees for the operation */ + consistency?: components["schemas"]["ReadConsistency"]; + /** @description If set, overrides global timeout for this request. Unit is seconds. */ + timeout?: number; + }; + path: { + /** @description Name of the collection to search in */ + collection_name: string; + }; + }; + /** @description Batch request points based on { positive, negative } pairs of examples, and/or a target. */ + requestBody?: { + content: { + "application/json": components["schemas"]["DiscoverRequestBatch"]; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": { + /** + * Format: float + * @description Time spent to process this request + */ + time?: number; + status?: string; + result?: ((components["schemas"]["ScoredPoint"])[])[]; + }; + }; + }; + /** @description error */ + default: { + content: { + "application/json": components["schemas"]["ErrorResponse"]; + }; + }; + /** @description error */ + "4XX": { + content: { + "application/json": components["schemas"]["ErrorResponse"]; + }; + }; + }; + }; /** * Count points * @description Count points which matches given filtering condition @@ -4749,8 +5129,7 @@ export interface operations { * @description Time spent to process this request */ time?: number; - /** @enum {string} */ - status?: "ok"; + status?: string; result?: components["schemas"]["CountResult"]; }; }; diff --git a/packages/js-client-rest/src/qdrant-client.ts b/packages/js-client-rest/src/qdrant-client.ts index fac9e31..1af241e 100644 --- a/packages/js-client-rest/src/qdrant-client.ts +++ b/packages/js-client-rest/src/qdrant-client.ts @@ -122,6 +122,7 @@ export class QdrantClient { * 'majority' - query all replicas, but return values present in the majority of replicas * 'quorum' - query the majority of replicas, return values present in all of them * 'all' - query all replicas, and return values present in all replicas + * - timeout: If set, overrides global timeout setting for this request. Unit is seconds. * @returns List of search responses */ async searchBatch( @@ -129,11 +130,15 @@ export class QdrantClient { { searches, consistency, - }: Pick, 'searches'> & {consistency?: SchemaFor<'ReadConsistency'>}, + timeout, + }: Pick, 'searches'> & {consistency?: SchemaFor<'ReadConsistency'>} & { + timeout?: number; + }, ) { const response = await this._openApiClient.points.searchBatchPoints({ collection_name, consistency, + timeout, searches, }); return maybe(response.data.result).orThrow('Search batch returned empty'); @@ -144,6 +149,7 @@ export class QdrantClient { * * @param collection_name Collection to search in * @param {object} args - + * - shard_key: Specify in which shards to look for the points, if not specified - look in all shards * - vector: * Search for vectors closest to this. * Can be either a vector itself, or a named vector, or a tuple of vector name and vector itself @@ -180,6 +186,7 @@ export class QdrantClient { * - 'majority' - query all replicas, but return values present in the majority of replicas * - 'quorum' - query the majority of replicas, return values present in all of them * - 'all' - query all replicas, and return values present in all replicas + * - timeout: If set, overrides global timeout setting for this request. Unit is seconds. * @example * // Search with filter * client.search( @@ -203,6 +210,7 @@ export class QdrantClient { async search( collection_name: string, { + shard_key, vector, limit = 10, offset = 0, @@ -212,14 +220,17 @@ export class QdrantClient { with_vector = false, score_threshold, consistency, + timeout, }: Partial, 'limit'>> & Omit, 'limit'> & { consistency?: SchemaFor<'ReadConsistency'>; - }, + } & {timeout?: number}, ) { const response = await this._openApiClient.points.searchPoints({ collection_name, consistency, + timeout, + shard_key, vector, limit, offset, @@ -244,16 +255,42 @@ export class QdrantClient { * - 'majority' - query all replicas, but return values present in the majority of replicas * - 'quorum' - query the majority of replicas, return values present in all of them * - 'all' - query all replicas, and return values present in all replicas + * - timeout: If set, overrides global timeout setting for this request. Unit is seconds. * @returns List of recommend responses */ + async recommendBatch( + collection_name: string, + { + searches, + consistency, + timeout, + }: SchemaFor<'RecommendRequestBatch'> & {consistency?: SchemaFor<'ReadConsistency'>} & {timeout?: number}, + ) { + const response = await this._openApiClient.points.recommendBatchPoints({ + collection_name, + searches, + consistency, + timeout, + }); + return maybe(response.data.result).orElse([]); + } + + /** + * @alias recommendBatch + */ async recommend_batch( collection_name: string, - {searches, consistency}: SchemaFor<'RecommendRequestBatch'> & {consistency?: SchemaFor<'ReadConsistency'>}, + { + searches, + consistency, + timeout, + }: SchemaFor<'RecommendRequestBatch'> & {consistency?: SchemaFor<'ReadConsistency'>} & {timeout?: number}, ) { const response = await this._openApiClient.points.recommendBatchPoints({ collection_name, searches, consistency, + timeout, }); return maybe(response.data.result).orElse([]); } @@ -265,6 +302,7 @@ export class QdrantClient { * The concrete way of how to compare negative and positive distances is up to the `strategy` chosen. * @param collection_name Collection to search in * @param {object} args + * - shard_key: Specify in which shards to look for the points, if not specified - look in all shards * - positive: * List of stored point IDs, which should be used as reference for similarity search. * If there is only one ID provided - this request is equivalent to the regular search with vector of that point. @@ -317,11 +355,13 @@ export class QdrantClient { * - 'majority' - query all replicas, but return values present in the majority of replicas * - 'quorum' - query the majority of replicas, return values present in all of them * - 'all' - query all replicas, and return values present in all replicas + * - timeout: If set, overrides global timeout setting for this request. Unit is seconds. * @returns List of recommended points with similarity scores. */ async recommend( collection_name: string, { + shard_key, positive, negative, strategy, @@ -335,12 +375,16 @@ export class QdrantClient { using, lookup_from, consistency, + timeout, }: Omit, 'limit'> & - Partial, 'limit'>> & {consistency?: SchemaFor<'ReadConsistency'>}, + Partial, 'limit'>> & {consistency?: SchemaFor<'ReadConsistency'>} & { + timeout?: number; + }, ) { const response = await this._openApiClient.points.recommendPoints({ collection_name, limit, + shard_key, positive, negative, strategy, @@ -353,6 +397,7 @@ export class QdrantClient { using, lookup_from, consistency, + timeout, }); return maybe(response.data.result).orThrow('Recommend points API returned empty'); } @@ -361,6 +406,7 @@ export class QdrantClient { * Scroll over all (matching) points in the collection. * @param collection_name Name of the collection * @param {object} args + * - shard_key: Specify in which shards to look for the points, if not specified - look in all shards * - filter: If provided - only returns points matching filtering conditions * - limit: How many points to return * - offset: If provided - skip points with ids less than given `offset` @@ -390,6 +436,7 @@ export class QdrantClient { async scroll( collection_name: string, { + shard_key, filter, consistency, limit = 10, @@ -400,6 +447,7 @@ export class QdrantClient { ) { const response = await this._openApiClient.points.scrollPoints({ collection_name, + shard_key, limit, offset, filter, @@ -415,16 +463,18 @@ export class QdrantClient { * Count points in the collection matching the given filter. * @param collection_name * @param {object} args - * - count_filter: filtering conditions + * - shard_key: Specify in which shards to look for the points, if not specified - look in all shards + * - filter: filtering conditions * - exact: * If `True` - provide the exact count of points matching the filter. * If `False` - provide the approximate count of points matching the filter. Works faster. * Default: `true` * @returns Amount of points in the collection matching the filter. */ - async count(collection_name: string, {filter, exact = true}: SchemaFor<'CountRequest'> = {}) { + async count(collection_name: string, {shard_key, filter, exact = true}: SchemaFor<'CountRequest'> = {}) { const response = await this._openApiClient.points.countPoints({ collection_name, + shard_key, filter, exact, }); @@ -456,6 +506,7 @@ export class QdrantClient { * - 'strong' - Write operations go through the permanent leader, * consistent, but may be unavailable if leader is down * - points: Points with named vectors + * - shard_key: Specify in which shards to look for the points, if not specified - look in all shards * @returns Operation result */ async updateVectors( @@ -464,6 +515,7 @@ export class QdrantClient { wait = true, ordering, points, + shard_key, }: {wait?: boolean; ordering?: SchemaFor<'WriteOrdering'>} & SchemaFor<'UpdateVectors'>, ) { const response = await this._openApiClient.points.updateVectors({ @@ -471,6 +523,7 @@ export class QdrantClient { wait, ordering, points, + shard_key, }); return maybe(response.data.result).orThrow('Update vectors returned empty'); } @@ -492,6 +545,7 @@ export class QdrantClient { * - points: Deletes values from each point in this list * - filter: Deletes values from points that satisfy this filter condition * - vector: Vector names + * - shard_key: Specify in which shards to look for the points, if not specified - look in all shards * @returns Operation result */ async deleteVectors( @@ -502,6 +556,7 @@ export class QdrantClient { points, filter, vector, + shard_key, }: {wait?: boolean; ordering?: SchemaFor<'WriteOrdering'>} & SchemaFor<'DeleteVectors'>, ) { const response = await this._openApiClient.points.deleteVectors({ @@ -511,6 +566,7 @@ export class QdrantClient { points, filter, vector, + shard_key, }); return maybe(response.data.result).orThrow('Delete vectors returned empty'); } @@ -525,7 +581,9 @@ export class QdrantClient { * 'majority' - query all replicas, but return values present in the majority of replicas * 'quorum' - query the majority of replicas, return values present in all of them * 'all' - query all replicas, and return values present in all replicas - * - vector: + * - timeout: If set, overrides global timeout setting for this request. Unit is seconds. + * - shard_key: Specify in which shards to look for the points, if not specified - look in all shards + * - vector: query search vector * - filter: Look only for points which satisfies this conditions * - params: Additional search params * - with_payload: Select which payload to return with the response @@ -540,6 +598,8 @@ export class QdrantClient { collection_name: string, { consistency, + timeout, + shard_key, vector, filter, params, @@ -549,11 +609,13 @@ export class QdrantClient { group_by, group_size, limit, - }: {consistency?: SchemaFor<'ReadConsistency'>} & SchemaFor<'SearchGroupsRequest'>, + }: {consistency?: SchemaFor<'ReadConsistency'>} & {timeout?: number} & SchemaFor<'SearchGroupsRequest'>, ) { const response = await this._openApiClient.points.searchPointGroups({ collection_name, consistency, + timeout, + shard_key, vector, filter, params, @@ -577,6 +639,8 @@ export class QdrantClient { * 'majority' - query all replicas, but return values present in the majority of replicas * 'quorum' - query the majority of replicas, return values present in all of them * 'all' - query all replicas, and return values present in all replicas + * - timeout: If set, overrides global timeout setting for this request. Unit is seconds. + * - shard_key: Specify in which shards to look for the points, if not specified - look in all shards * - positive: Look for vectors closest to those * - negative: Try to avoid vectors like this * - strategy: How to use positive and negative examples to find the results @@ -596,6 +660,8 @@ export class QdrantClient { collection_name: string, { consistency, + timeout, + shard_key, positive, strategy, negative = [], @@ -609,11 +675,13 @@ export class QdrantClient { group_by, group_size, limit, - }: {consistency?: SchemaFor<'ReadConsistency'>} & SchemaFor<'RecommendGroupsRequest'>, + }: {consistency?: SchemaFor<'ReadConsistency'>} & {timeout?: number} & SchemaFor<'RecommendGroupsRequest'>, ) { const response = await this._openApiClient.points.recommendPointGroups({ collection_name, consistency, + timeout, + shard_key, positive, negative, strategy, @@ -669,6 +737,7 @@ export class QdrantClient { * Retrieve stored points by IDs * @param collection_name * @param {object} args + * - shard_key: Specify in which shards to look for the points, if not specified - look in all shards * - ids: list of IDs to lookup * - with_payload: * - Specify which stored payload should be attached to the result. @@ -694,6 +763,7 @@ export class QdrantClient { async retrieve( collection_name: string, { + shard_key, ids, with_payload = true, with_vector, @@ -702,6 +772,7 @@ export class QdrantClient { ) { const response = await this._openApiClient.points.getPoints({ collection_name, + shard_key, ids, with_payload, with_vector, @@ -773,6 +844,7 @@ export class QdrantClient { * - 'strong' - Write operations go through the permanent leader, * consistent, but may be unavailable if leader is down * - payload: Key-value pairs of payload to assign + * - shard_key: Specify in which shards to look for the points, if not specified - look in all shards * - points|filter: List of affected points, filter or points selector. * Example: * - `points: [ @@ -796,6 +868,7 @@ export class QdrantClient { payload, points, filter, + shard_key, ordering, wait = true, }: {wait?: boolean; ordering?: SchemaFor<'WriteOrdering'>} & SchemaFor<'SetPayload'>, @@ -805,6 +878,7 @@ export class QdrantClient { payload, points, filter, + shard_key, wait, ordering, }); @@ -879,6 +953,7 @@ export class QdrantClient { * - 'strong' - Write operations go through the permanent leader, * consistent, but may be unavailable if leader is down * - keys: List of payload keys to remove. + * - shard_key: Specify in which shards to look for the points, if not specified - look in all shards * - points|filter: List of affected points, filter or points selector. * Example: * - `points: [ @@ -903,6 +978,7 @@ export class QdrantClient { keys, points, filter, + shard_key, wait = true, }: {wait?: boolean; ordering?: SchemaFor<'WriteOrdering'>} & SchemaFor<'PointsSelector'> & SchemaFor<'DeletePayload'>, @@ -912,6 +988,7 @@ export class QdrantClient { keys, points, filter, + shard_key, wait, ordering, }); @@ -1059,6 +1136,7 @@ export class QdrantClient { * If dict is passed, service will create a vector storage for each key in the dict. * If single VectorParams is passed, service will create a single anonymous vector storage. * - shard_number: Number of shards in collection. Default is 1, minimum is 1. + * - sharding_method: Sharding method Default is Auto - points are distributed across all available shards Custom - points are distributed across shards according to shard key * - replication_factor: * Replication factor for collection. Default is 1, minimum is 1. * Defines how many copies of each shard will be created. @@ -1080,6 +1158,7 @@ export class QdrantClient { * - wal_config: Params for Write-Ahead-Log * - quantization_config: Params for quantization, if None - quantization will be disabled * - init_from: Use data stored in another collection to initialize this collection + * - sparse_vectors: Sparse vector data config * - timeout: * Wait for operation commit timeout in seconds. * If timeout is reached, request will return with service error. @@ -1096,8 +1175,10 @@ export class QdrantClient { quantization_config, replication_factor, shard_number, + sharding_method, wal_config, write_consistency_factor, + sparse_vectors, }: {timeout?: number} & SchemaFor<'CreateCollection'>, ) { const response = await this._openApiClient.collections.createCollection({ @@ -1111,8 +1192,10 @@ export class QdrantClient { quantization_config, replication_factor, shard_number, + sharding_method, wal_config, write_consistency_factor, + sparse_vectors, }); return maybe(response.data.result).orThrow('Create collection returned empty'); @@ -1128,6 +1211,7 @@ export class QdrantClient { * If dict is passed, service will create a vector storage for each key in the dict. * If single VectorParams is passed, service will create a single anonymous vector storage. * - shardNumber: Number of shards in collection. Default is 1, minimum is 1. + * - sharding_method: Sharding method Default is Auto - points are distributed across all available shards Custom - points are distributed across shards according to shard key * - replicationFactor: * Replication factor for collection. Default is 1, minimum is 1. * Defines how many copies of each shard will be created. @@ -1149,6 +1233,7 @@ export class QdrantClient { * - walConfig: Params for Write-Ahead-Log * - quantizationConfig: Params for quantization, if None - quantization will be disabled * - initFrom: Use data stored in another collection to initialize this collection + * - sparse_vectors: Sparse vector data config * - timeout: * Wait for operation commit timeout in seconds. * If timeout is reached, request will return with service error. @@ -1165,8 +1250,10 @@ export class QdrantClient { quantization_config, replication_factor, shard_number, + sharding_method, wal_config, write_consistency_factor, + sparse_vectors, }: {timeout?: number} & SchemaFor<'CreateCollection'>, ) { maybe( @@ -1189,8 +1276,10 @@ export class QdrantClient { quantization_config, replication_factor, shard_number, + sharding_method, wal_config, write_consistency_factor, + sparse_vectors, }); return maybe(response).orThrow('Create collection returned empty'); @@ -1473,4 +1562,151 @@ export class QdrantClient { }); return maybe(response.data.result).orThrow('Create shard snapshot returned empty'); } + + /** + * Create shard key + * @param collection_name Name of the collection + * @param {object} args - + * - shard_key: Specify in which shards to look for the points, if not specified - look in all shards + * - shards_number: How many shards to create for this key If not specified, will use the default value from config + * - replication_factor: How many replicas to create for each shard If not specified, will use the default value from config + * - placement: Placement of shards for this key List of peer ids, that can be used to place shards for this key If not specified, will be randomly placed among all peers + * - timeout: If set, overrides global timeout setting for this request. Unit is seconds. + * @returns Operation result + */ + async createShardKey( + collection_name: string, + { + shard_key, + shards_number, + replication_factor, + placement, + timeout, + }: {timeout?: number} & SchemaFor<'CreateShardingKey'>, + ) { + const response = await this._openApiClient.shards.createShardKey({ + collection_name, + shard_key, + shards_number, + replication_factor, + placement, + timeout, + }); + return maybe(response.data.result).orThrow('Create shard key returned empty'); + } + + /** + * Delete shard key + * @param collection_name Name of the collection + * @param {object} args - + * - shard_key: Specify in which shards to look for the points, if not specified - look in all shards + * - timeout: If set, overrides global timeout setting for this request. Unit is seconds. + * @returns Operation result + */ + async deleteShardKey( + collection_name: string, + {shard_key, timeout}: {timeout?: number} & SchemaFor<'DropShardingKey'>, + ) { + const response = await this._openApiClient.shards.deleteShardKey({ + collection_name, + shard_key, + timeout, + }); + return maybe(response.data.result).orThrow('Create shard key returned empty'); + } + + /** + * Discover points + * @description Use context and a target to find the most similar points to the target, constrained by the context. + * When using only the context (without a target), a special search - called context search - is performed where pairs of points are used to generate a loss that guides the search towards the zone where most positive examples overlap. This means that the score minimizes the scenario of finding a point closer to a negative than to a positive part of a pair. + * Since the score of a context relates to loss, the maximum score a point can get is 0.0, and it becomes normal that many points can have a score of 0.0. + * When using target (with or without context), the score behaves a little different: The integer part of the score represents the rank with respect to the context, while the decimal part of the score relates to the distance to the target. The context part of the score for each pair is calculated +1 if the point is closer to a positive than to a negative part of a pair, and -1 otherwise. + * @param collection_name Name of the collection + * @param {object} args - + * - consistency: Read consistency of the search. Defines how many replicas should be queried before returning the result. + * Values: + * number - number of replicas to query, values should present in all queried replicas + * 'majority' - query all replicas, but return values present in the majority of replicas + * 'quorum' - query the majority of replicas, return values present in all of them + * 'all' - query all replicas, and return values present in all replicas + * - timeout: If set, overrides global timeout setting for this request. Unit is seconds. + * - shard_key: Specify in which shards to look for the points, if not specified - look in all shards + * - target: Look for vectors closest to this. When using the target (with or without context), the integer part of the score represents the rank with respect to the context, while the decimal part of the score relates to the distance to the target. + * - context: Pairs of { positive, negative } examples to constrain the search. When using only the context (without a target), a special search - called context search - is performed where pairs of points are used to generate a loss that guides the search towards the zone where most positive examples overlap. This means that the score minimizes the scenario of finding a point closer to a negative than to a positive part of a pair. Since the score of a context relates to loss, the maximum score a point can get is 0.0, and it becomes normal that many points can have a score of 0.0. For discovery search (when including a target), the context part of the score for each pair is calculated +1 if the point is closer to a positive than to a negative part of a pair, and -1 otherwise. + * - filter: Look only for points which satisfies this conditions + * - params: Additional search params + * - limit: Max number of result to return + * - offset: Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues. + * - with_payload: Select which payload to return with the response + * - with_vector: Whether to return the point vector with the result? + * - using: Define which vector to use for recommendation, if not specified - try to use default vector + * - lookup_from The location used to lookup vectors. If not specified - use current collection. Note: the other collection should have the same vector size as the current collection + * @returns Operation result + */ + async discoverPoints( + collection_name: string, + { + consistency, + timeout, + shard_key, + target, + context, + params, + limit, + offset, + with_payload, + with_vector, + using, + lookup_from, + }: {consistency?: SchemaFor<'ReadConsistency'>} & {timeout?: number} & SchemaFor<'DiscoverRequest'>, + ) { + const response = await this._openApiClient.points.discoverPoints({ + collection_name, + consistency, + timeout, + shard_key, + target, + context, + params, + limit, + offset, + with_payload, + with_vector, + using, + lookup_from, + }); + return maybe(response.data.result).orThrow('Discover points returned empty'); + } + + /** + * Discover batch points + * @description Look for points based on target and/or positive and negative example pairs, in batch. + * @param collection_name Name of the collection + * @param {object} args - + * - consistency: Read consistency of the search. Defines how many replicas should be queried before returning the result. + * Values: + * number - number of replicas to query, values should present in all queried replicas + * 'majority' - query all replicas, but return values present in the majority of replicas + * 'quorum' - query the majority of replicas, return values present in all of them + * 'all' - query all replicas, and return values present in all replicas + * - timeout: If set, overrides global timeout setting for this request. Unit is seconds. + * - searches: List of searches + * @returns Operation result + */ + async discoverBatchPoints( + collection_name: string, + { + consistency, + timeout, + searches, + }: {consistency?: SchemaFor<'ReadConsistency'>} & {timeout?: number} & SchemaFor<'DiscoverRequestBatch'>, + ) { + const response = await this._openApiClient.points.discoverBatchPoints({ + collection_name, + consistency, + timeout, + searches, + }); + return maybe(response.data.result).orThrow('Discover batch points returned empty'); + } } diff --git a/packages/qdrant-js/CHANGELOG.md b/packages/qdrant-js/CHANGELOG.md index 033bb8b..4f4d429 100644 --- a/packages/qdrant-js/CHANGELOG.md +++ b/packages/qdrant-js/CHANGELOG.md @@ -1,5 +1,17 @@ # @qdrant/qdrant-js +## 1.7.0 + +### Minor Changes + +- Qdrant v1.7.0 API + +### Patch Changes + +- Updated dependencies []: + - @qdrant/js-client-grpc@1.7.0 + - @qdrant/js-client-rest@1.7.0 + ## 1.6.0 ### Minor Changes diff --git a/packages/qdrant-js/package.json b/packages/qdrant-js/package.json index ba4b6fd..71e445f 100644 --- a/packages/qdrant-js/package.json +++ b/packages/qdrant-js/package.json @@ -1,6 +1,6 @@ { "name": "@qdrant/qdrant-js", - "version": "1.6.0", + "version": "1.7.0", "engines": { "node": ">=18.0.0", "pnpm": ">=8" @@ -57,8 +57,8 @@ "clean": "rimraf ./dist" }, "dependencies": { - "@qdrant/js-client-rest": "workspace:1.6.0", - "@qdrant/js-client-grpc": "workspace:1.6.0" + "@qdrant/js-client-rest": "workspace:1.7.0", + "@qdrant/js-client-grpc": "workspace:1.7.0" }, "peerDependencies": { "typescript": ">=4.1" diff --git a/packages/qdrant-js/scripts/integration-tests.sh b/packages/qdrant-js/scripts/integration-tests.sh index 7676fcb..3f2660a 100755 --- a/packages/qdrant-js/scripts/integration-tests.sh +++ b/packages/qdrant-js/scripts/integration-tests.sh @@ -9,7 +9,7 @@ function stop_docker() docker stop qdrant_test } -QDRANT_LATEST="v1.6.0" +QDRANT_LATEST="v1.7.0" QDRANT_VERSION=${QDRANT_VERSION:-"$QDRANT_LATEST"} QDRANT_HOST='127.0.0.1:6333' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index da38a8a..32a3366 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -50,11 +50,11 @@ importers: packages/js-client-grpc: dependencies: '@bufbuild/connect': - specifier: ^0.9.1 - version: 0.9.1(@bufbuild/protobuf@1.2.1) + specifier: ^0.10.0 + version: 0.10.0(@bufbuild/protobuf@1.2.1) '@bufbuild/connect-node': - specifier: ^0.9.1 - version: 0.9.1(@bufbuild/protobuf@1.2.1) + specifier: ^0.10.0 + version: 0.10.0(@bufbuild/protobuf@1.2.1) '@bufbuild/protobuf': specifier: ^1.2.1 version: 1.2.1 @@ -63,8 +63,8 @@ importers: version: 5.0.4 devDependencies: '@bufbuild/protoc-gen-connect-es': - specifier: ^0.9.1 - version: 0.9.1(@bufbuild/connect@0.9.1)(@bufbuild/protoc-gen-es@1.2.1) + specifier: ^0.10.0 + version: 0.10.0(@bufbuild/connect@0.10.0)(@bufbuild/protoc-gen-es@1.2.1) '@bufbuild/protoc-gen-es': specifier: ^1.2.1 version: 1.2.1(@bufbuild/protobuf@1.2.1) @@ -93,8 +93,8 @@ importers: specifier: '>=4.1' version: 5.0.4 undici: - specifier: ^5.22.1 - version: 5.22.1 + specifier: ^5.26.2 + version: 5.26.2 devDependencies: '@rollup/plugin-commonjs': specifier: ^24.1.0 @@ -118,10 +118,10 @@ importers: packages/qdrant-js: dependencies: '@qdrant/js-client-grpc': - specifier: workspace:1.6.0 + specifier: workspace:1.7.0 version: link:../js-client-grpc '@qdrant/js-client-rest': - specifier: workspace:1.6.0 + specifier: workspace:1.7.0 version: link:../js-client-rest typescript: specifier: '>=4.1' @@ -150,41 +150,41 @@ packages: js-tokens: 4.0.0 dev: true - /@bufbuild/connect-node@0.9.1(@bufbuild/protobuf@1.2.1): - resolution: {integrity: sha512-kUMB6QQh8S19LsvweDg057WN3Gbg+zIqSHnRcXh9CBYSN7GWd9dgJPQSgalJFJngjFSW2qnnOmnUkxMyZiWBOw==} + /@bufbuild/connect-node@0.10.0(@bufbuild/protobuf@1.2.1): + resolution: {integrity: sha512-5n/dHbxjur6LA7aFZR9pcA9V3dErxxdfzK36UrHLfjCn+T9f8rMs60hYFabP5pja2gPSWmCewJbwgG5wT7sQpw==} engines: {node: '>=16.0.0'} peerDependencies: - '@bufbuild/protobuf': ^1.2.0 + '@bufbuild/protobuf': ^1.2.1 dependencies: - '@bufbuild/connect': 0.9.1(@bufbuild/protobuf@1.2.1) + '@bufbuild/connect': 0.10.0(@bufbuild/protobuf@1.2.1) '@bufbuild/protobuf': 1.2.1 headers-polyfill: 3.1.2 dev: false - /@bufbuild/connect@0.9.1(@bufbuild/protobuf@1.2.1): - resolution: {integrity: sha512-4O/PSMLWd3oQkwBuJBGBzFtPsnFC5dTRPGHFNFODna9wZJ6r45ccsOWsA4qXBL7gW2EKw93zRa0KVuge2dCOQQ==} + /@bufbuild/connect@0.10.0(@bufbuild/protobuf@1.2.1): + resolution: {integrity: sha512-psNHc7R0DDZ2Dl/HVPw1MF5hGMTEjnRROPSqs9YPCjy+ztCNF97wPOUH3S4Qud2nNw9Hn+vqZd+Y4v9G5J+d1A==} peerDependencies: - '@bufbuild/protobuf': ^1.2.0 + '@bufbuild/protobuf': ^1.2.1 dependencies: '@bufbuild/protobuf': 1.2.1 /@bufbuild/protobuf@1.2.1: resolution: {integrity: sha512-cwwGvLGqvoaOZmoP5+i4v/rbW+rHkguvTehuZyM2p/xpmaNSdT2h3B7kHw33aiffv35t1XrYHIkdJSEkSEMJuA==} - /@bufbuild/protoc-gen-connect-es@0.9.1(@bufbuild/connect@0.9.1)(@bufbuild/protoc-gen-es@1.2.1): - resolution: {integrity: sha512-Wtgtw4RpGAlEma7Z7hVUPra3BC/otWewFie1bgxejJr2BykqejzFN63iP4KF5fUUY38LBbtZE9IfnBfxQaNV/Q==} + /@bufbuild/protoc-gen-connect-es@0.10.0(@bufbuild/connect@0.10.0)(@bufbuild/protoc-gen-es@1.2.1): + resolution: {integrity: sha512-gtxe/W3pHz3qOreWn9THSwm3kxqsjmua2WahAY3Vws3GGbJx7p+U0AJ9TUXRoNuRmRyPF3TCQeUfQS0YiIKXKQ==} engines: {node: '>=16.0.0'} hasBin: true peerDependencies: - '@bufbuild/connect': 0.9.1 - '@bufbuild/protoc-gen-es': ^1.2.0 + '@bufbuild/connect': 0.10.0 + '@bufbuild/protoc-gen-es': ^1.2.1 peerDependenciesMeta: '@bufbuild/connect': optional: true '@bufbuild/protoc-gen-es': optional: true dependencies: - '@bufbuild/connect': 0.9.1(@bufbuild/protobuf@1.2.1) + '@bufbuild/connect': 0.10.0(@bufbuild/protobuf@1.2.1) '@bufbuild/protobuf': 1.2.1 '@bufbuild/protoc-gen-es': 1.2.1(@bufbuild/protobuf@1.2.1) '@bufbuild/protoplugin': 1.2.1 @@ -460,6 +460,10 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true + /@fastify/busboy@2.1.0: + resolution: {integrity: sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==} + engines: {node: '>=14'} + /@humanwhocodes/config-array@0.11.10: resolution: {integrity: sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==} engines: {node: '>=10.10.0'} @@ -1047,12 +1051,6 @@ packages: engines: {node: '>=6'} dev: true - /busboy@1.6.0: - resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} - engines: {node: '>=10.16.0'} - dependencies: - streamsearch: 1.1.0 - /cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} @@ -2086,7 +2084,7 @@ packages: fast-glob: 3.2.12 js-yaml: 4.1.0 supports-color: 9.3.1 - undici: 5.22.1 + undici: 5.26.2 yargs-parser: 21.1.1 dev: true @@ -2436,10 +2434,6 @@ packages: resolution: {integrity: sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg==} dev: true - /streamsearch@1.1.0: - resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} - engines: {node: '>=10.0.0'} - /string-argv@0.3.2: resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} engines: {node: '>=0.6.19'} @@ -2672,11 +2666,11 @@ packages: resolution: {integrity: sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==} dev: true - /undici@5.22.1: - resolution: {integrity: sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw==} + /undici@5.26.2: + resolution: {integrity: sha512-a4PDLQgLTPHVzOK+x3F79/M4GtyYPl+aX9AAK7aQxpwxDwCqkeZCScy7Gk5kWT3JtdFq1uhO3uZJdLtHI4dK9A==} engines: {node: '>=14.0'} dependencies: - busboy: 1.6.0 + '@fastify/busboy': 2.1.0 /uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}