Skip to content

Commit

Permalink
V1.9.0 (#72)
Browse files Browse the repository at this point in the history
* v1.9.0

* qdrant docker image vecrsion up

* remove vectors_count from tests

* remove vectors_count from tests

---------

Co-authored-by: generall <[email protected]>
  • Loading branch information
IvanPleshkov and generall authored Apr 22, 2024
1 parent 2d78217 commit a2de790
Show file tree
Hide file tree
Showing 14 changed files with 182 additions and 24 deletions.
2 changes: 1 addition & 1 deletion examples/node-js-basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"author": "Qdrant Team",
"license": "Apache-2.0",
"dependencies": {
"@qdrant/qdrant-js": "^1.8.0"
"@qdrant/qdrant-js": "^1.9.0"
}
}
6 changes: 6 additions & 0 deletions packages/js-client-grpc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @qdrant/js-client-grpc

## 1.9.0

### Minor Changes

- Qdrant v1.9.0 API

## 1.8.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/js-client-grpc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qdrant/js-client-grpc",
"version": "1.8.0",
"version": "1.9.0",
"engines": {
"node": ">=18.0.0",
"pnpm": ">=8"
Expand Down
19 changes: 16 additions & 3 deletions packages/js-client-grpc/proto/collections.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ syntax = "proto3";
package qdrant;
option csharp_namespace = "Qdrant.Client.Grpc";

enum Datatype {
Default = 0;
Float32 = 1;
Uint8 = 2;
}

message VectorParams {
uint64 size = 1; // Size of the vectors
Distance distance = 2; // Distance function used for comparing vectors
optional HnswConfigDiff hnsw_config = 3; // Configuration of vector HNSW graph. If omitted - the collection configuration will be used
optional QuantizationConfig quantization_config = 4; // Configuration of vector quantization config. If omitted - the collection configuration will be used
optional bool on_disk = 5; // If true - serve vectors from disk. If set to false, the vectors will be loaded in RAM.
optional Datatype datatype = 6; // Data type of the vectors
}

message VectorParamsDiff {
Expand Down Expand Up @@ -93,6 +100,7 @@ enum CollectionStatus {
Green = 1; // All segments are ready
Yellow = 2; // Optimization in process
Red = 3; // Something went wrong
Grey = 4; // Optimization is pending
}

enum PayloadSchemaType {
Expand Down Expand Up @@ -448,9 +456,8 @@ 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
PartialSnapshot = 5; // Deprecated: snapshot shard transfer is in progress; Updates should not be sent to (and are ignored by) the shard
Recovery = 6; // Shard is undergoing recovered by an external node; Normally rejects updates, accepts updates if force is true
// TODO(1.9): deprecate PartialSnapshot state
}

message ShardKey {
Expand Down Expand Up @@ -496,6 +503,12 @@ message MoveShard {
optional ShardTransferMethod method = 4;
}

message AbortShardTransfer {
uint32 shard_id = 1; // Local shard id
uint64 from_peer_id = 2;
uint64 to_peer_id = 3;
}

message RestartTransfer {
uint32 shard_id = 1; // Local shard id
uint64 from_peer_id = 2;
Expand Down Expand Up @@ -530,7 +543,7 @@ message UpdateCollectionClusterSetupRequest {
oneof operation {
MoveShard move_shard = 2;
MoveShard replicate_shard = 3;
MoveShard abort_transfer = 4;
AbortShardTransfer abort_transfer = 4;
Replica drop_replica = 5;
CreateShardKey create_shard_key = 7;
DeleteShardKey delete_shard_key = 8;
Expand Down
101 changes: 97 additions & 4 deletions packages/js-client-grpc/src/proto/collections_pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,32 @@
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto3, protoInt64 } from "@bufbuild/protobuf";

/**
* @generated from enum qdrant.Datatype
*/
export enum Datatype {
/**
* @generated from enum value: Default = 0;
*/
Default = 0,

/**
* @generated from enum value: Float32 = 1;
*/
Float32 = 1,

/**
* @generated from enum value: Uint8 = 2;
*/
Uint8 = 2,
}
// Retrieve enum metadata with: proto3.getEnumType(Datatype)
proto3.util.setEnumType(Datatype, "qdrant.Datatype", [
{ no: 0, name: "Default" },
{ no: 1, name: "Float32" },
{ no: 2, name: "Uint8" },
]);

/**
* @generated from enum qdrant.Distance
*/
Expand Down Expand Up @@ -73,13 +99,21 @@ export enum CollectionStatus {
* @generated from enum value: Red = 3;
*/
Red = 3,

/**
* Optimization is pending
*
* @generated from enum value: Grey = 4;
*/
Grey = 4,
}
// Retrieve enum metadata with: proto3.getEnumType(CollectionStatus)
proto3.util.setEnumType(CollectionStatus, "qdrant.CollectionStatus", [
{ no: 0, name: "UnknownCollectionStatus" },
{ no: 1, name: "Green" },
{ no: 2, name: "Yellow" },
{ no: 3, name: "Red" },
{ no: 4, name: "Grey" },
]);

/**
Expand Down Expand Up @@ -298,7 +332,7 @@ export enum ReplicaState {
Listener = 4,

/**
* Snapshot shard transfer is in progress; Updates should not be sent to (and are ignored by) the shard
* Deprecated: snapshot shard transfer is in progress; Updates should not be sent to (and are ignored by) the shard
*
* @generated from enum value: PartialSnapshot = 5;
*/
Expand Down Expand Up @@ -393,6 +427,13 @@ export class VectorParams extends Message<VectorParams> {
*/
onDisk?: boolean;

/**
* Data type of the vectors
*
* @generated from field: optional qdrant.Datatype datatype = 6;
*/
datatype?: Datatype;

constructor(data?: PartialMessage<VectorParams>) {
super();
proto3.util.initPartial(data, this);
Expand All @@ -406,6 +447,7 @@ export class VectorParams extends Message<VectorParams> {
{ no: 3, name: "hnsw_config", kind: "message", T: HnswConfigDiff, opt: true },
{ no: 4, name: "quantization_config", kind: "message", T: QuantizationConfig, opt: true },
{ no: 5, name: "on_disk", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
{ no: 6, name: "datatype", kind: "enum", T: proto3.getEnumType(Datatype), opt: true },
]);

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): VectorParams {
Expand Down Expand Up @@ -3385,6 +3427,57 @@ export class MoveShard extends Message<MoveShard> {
}
}

/**
* @generated from message qdrant.AbortShardTransfer
*/
export class AbortShardTransfer extends Message<AbortShardTransfer> {
/**
* Local shard id
*
* @generated from field: uint32 shard_id = 1;
*/
shardId = 0;

/**
* @generated from field: uint64 from_peer_id = 2;
*/
fromPeerId = protoInt64.zero;

/**
* @generated from field: uint64 to_peer_id = 3;
*/
toPeerId = protoInt64.zero;

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

static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "qdrant.AbortShardTransfer";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ 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 */ },
]);

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

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

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

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

/**
* @generated from message qdrant.RestartTransfer
*/
Expand Down Expand Up @@ -3615,9 +3708,9 @@ export class UpdateCollectionClusterSetupRequest extends Message<UpdateCollectio
case: "replicateShard";
} | {
/**
* @generated from field: qdrant.MoveShard abort_transfer = 4;
* @generated from field: qdrant.AbortShardTransfer abort_transfer = 4;
*/
value: MoveShard;
value: AbortShardTransfer;
case: "abortTransfer";
} | {
/**
Expand Down Expand Up @@ -3663,7 +3756,7 @@ export class UpdateCollectionClusterSetupRequest extends Message<UpdateCollectio
{ no: 1, name: "collection_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 2, name: "move_shard", kind: "message", T: MoveShard, oneof: "operation" },
{ no: 3, name: "replicate_shard", kind: "message", T: MoveShard, oneof: "operation" },
{ no: 4, name: "abort_transfer", kind: "message", T: MoveShard, oneof: "operation" },
{ no: 4, name: "abort_transfer", kind: "message", T: AbortShardTransfer, oneof: "operation" },
{ no: 5, name: "drop_replica", kind: "message", T: Replica, oneof: "operation" },
{ no: 7, name: "create_shard_key", kind: "message", T: CreateShardKey, oneof: "operation" },
{ no: 8, name: "delete_shard_key", kind: "message", T: DeleteShardKey, oneof: "operation" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ describe('QdrantClient', () => {
test('retrieve all points', async () => {
const result = (await client.api('collections').get({collectionName})).result!;
expect(result.toJson(), 'check failed - 7 points expected').toMatchObject({
vectorsCount: '7',
pointsCount: '7',
});
});

Expand Down
6 changes: 6 additions & 0 deletions packages/js-client-rest/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @qdrant/js-client-rest

## 1.9.0

### Minor Changes

- Qdrant v1.9.0 API

## 1.8.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/js-client-rest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qdrant/js-client-rest",
"version": "1.8.2",
"version": "1.9.0",
"engines": {
"node": ">=18.0.0",
"pnpm": ">=8"
Expand Down
38 changes: 33 additions & 5 deletions packages/js-client-rest/src/openapi/generated_schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ export interface components {
optimizer_status: components["schemas"]["OptimizersStatus"];
/**
* Format: uint
* @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.
* @description DEPRECATED: 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 | null;
/**
Expand Down Expand Up @@ -471,7 +471,7 @@ export interface components {
* @description Current state of the collection. `Green` - all good. `Yellow` - optimization is running, `Red` - some operations failed and was not recovered
* @enum {string}
*/
CollectionStatus: "green" | "yellow" | "red";
CollectionStatus: "green" | "yellow" | "grey" | "red";
/** @description Current state of the collection */
OptimizersStatus: OneOf<["ok", {
error: string;
Expand Down Expand Up @@ -547,6 +547,7 @@ export interface components {
quantization_config?: components["schemas"]["QuantizationConfig"] | (Record<string, unknown> | null);
/** @description If true, vectors are served from disk, improving RAM usage at the cost of latency Default: false */
on_disk?: boolean | null;
datatype?: components["schemas"]["Datatype"] | (Record<string, unknown> | null);
};
/**
* @description Type of internal tags, build from payload Distance function types used to compare vectors
Expand Down Expand Up @@ -613,6 +614,11 @@ export interface components {
BinaryQuantizationConfig: {
always_ram?: boolean | null;
};
/**
* @description Defines which datatype should be used to represent vectors in the storage. Choosing different datatypes allows to optimize memory usage and performance vs accuracy. - For `float32` datatype - vectors are stored as single-precision floating point numbers, 4bytes. - For `uint8` datatype - vectors are stored as unsigned 8-bit integers, 1byte. It expects vector elements to be in range `[0, 255]`.
* @enum {string}
*/
Datatype: "float32" | "uint8";
/** @enum {string} */
ShardingMethod: "auto" | "custom";
/** @description Params of single sparse vector data storage */
Expand Down Expand Up @@ -871,7 +877,7 @@ export interface components {
* { "vector": { "vector": [1.0, 2.0, 3.0], "name": "image-embeddings" } }
*/
NamedVectorStruct: (number)[] | components["schemas"]["NamedVector"] | components["schemas"]["NamedSparseVector"];
/** @description Vector data with name */
/** @description Dense vector data with name */
NamedVector: {
/** @description Name of vector data */
name: string;
Expand Down Expand Up @@ -1734,7 +1740,7 @@ export interface components {
comment?: string | null;
};
/** @description Methods for transferring a shard from one node to another. */
ShardTransferMethod: "stream_records" | "snapshot";
ShardTransferMethod: "stream_records" | "snapshot" | "wal_delta";
TelemetryData: {
id: string;
app: components["schemas"]["AppBuildTelemetry"];
Expand All @@ -1747,6 +1753,7 @@ export interface components {
version: string;
features?: components["schemas"]["AppFeaturesTelemetry"] | (Record<string, unknown> | null);
system?: components["schemas"]["RunningEnvironmentTelemetry"] | (Record<string, unknown> | null);
jwt_rbac?: boolean | null;
/** Format: date-time */
startup: string;
};
Expand Down Expand Up @@ -1860,6 +1867,10 @@ export interface components {
index: components["schemas"]["Indexes"];
/** @description Vector specific quantization config that overrides collection config */
quantization_config?: components["schemas"]["QuantizationConfig"] | (Record<string, unknown> | null);
/** @description Vector specific configuration to enable multiple vectors per point */
multi_vec_config?: components["schemas"]["MultiVectorConfig"] | (Record<string, unknown> | null);
/** @description Vector specific configuration to set specific storage element type */
datatype?: components["schemas"]["VectorStorageDatatype"] | (Record<string, unknown> | null);
};
/** @description Storage types for vectors */
VectorStorageType: "Memory" | "Mmap" | "ChunkedMmap";
Expand All @@ -1873,6 +1884,15 @@ export interface components {
type: "hnsw";
options: components["schemas"]["HnswConfig"];
}]>;
MultiVectorConfig: {
MaxSim: components["schemas"]["MaxSimConfig"];
};
MaxSimConfig: Record<string, never>;
/**
* @description Storage types for vectors
* @enum {string}
*/
VectorStorageDatatype: "float32" | "uint8";
/** @description Config of single sparse vector data storage */
SparseVectorDataConfig: {
index: components["schemas"]["SparseIndexConfig"];
Expand Down Expand Up @@ -2062,7 +2082,15 @@ export interface components {
replicate_shard: components["schemas"]["MoveShard"];
};
AbortTransferOperation: {
abort_transfer: components["schemas"]["MoveShard"];
abort_transfer: components["schemas"]["AbortShardTransfer"];
};
AbortShardTransfer: {
/** Format: uint32 */
shard_id: number;
/** Format: uint64 */
to_peer_id: number;
/** Format: uint64 */
from_peer_id: number;
};
DropReplicaOperation: {
drop_replica: components["schemas"]["Replica"];
Expand Down
Loading

0 comments on commit a2de790

Please sign in to comment.