Skip to content

Commit

Permalink
Generate rest and grpc clients for 1.8 (#512)
Browse files Browse the repository at this point in the history
* update grpc client

* update rest client
  • Loading branch information
coszio authored Mar 1, 2024
1 parent 332777d commit 62c79e2
Show file tree
Hide file tree
Showing 13 changed files with 376 additions and 216 deletions.
299 changes: 176 additions & 123 deletions qdrant_client/grpc/collections_pb2.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions qdrant_client/grpc/collections_service_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions qdrant_client/grpc/collections_service_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ def __init__(self, channel):
request_serializer=collections__pb2.CollectionClusterInfoRequest.SerializeToString,
response_deserializer=collections__pb2.CollectionClusterInfoResponse.FromString,
)
self.CollectionExists = channel.unary_unary(
'/qdrant.Collections/CollectionExists',
request_serializer=collections__pb2.CollectionExistsRequest.SerializeToString,
response_deserializer=collections__pb2.CollectionExistsResponse.FromString,
)
self.UpdateCollectionClusterSetup = channel.unary_unary(
'/qdrant.Collections/UpdateCollectionClusterSetup',
request_serializer=collections__pb2.UpdateCollectionClusterSetupRequest.SerializeToString,
Expand Down Expand Up @@ -151,6 +156,14 @@ def CollectionClusterInfo(self, request, context):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def CollectionExists(self, request, context):
"""
Check the existence of a collection
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def UpdateCollectionClusterSetup(self, request, context):
"""
Update cluster setup for a collection
Expand Down Expand Up @@ -223,6 +236,11 @@ def add_CollectionsServicer_to_server(servicer, server):
request_deserializer=collections__pb2.CollectionClusterInfoRequest.FromString,
response_serializer=collections__pb2.CollectionClusterInfoResponse.SerializeToString,
),
'CollectionExists': grpc.unary_unary_rpc_method_handler(
servicer.CollectionExists,
request_deserializer=collections__pb2.CollectionExistsRequest.FromString,
response_serializer=collections__pb2.CollectionExistsResponse.SerializeToString,
),
'UpdateCollectionClusterSetup': grpc.unary_unary_rpc_method_handler(
servicer.UpdateCollectionClusterSetup,
request_deserializer=collections__pb2.UpdateCollectionClusterSetupRequest.FromString,
Expand Down Expand Up @@ -401,6 +419,23 @@ def CollectionClusterInfo(request,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def CollectionExists(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/qdrant.Collections/CollectionExists',
collections__pb2.CollectionExistsRequest.SerializeToString,
collections__pb2.CollectionExistsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def UpdateCollectionClusterSetup(request,
target,
Expand Down
5 changes: 3 additions & 2 deletions qdrant_client/grpc/points_pb2.py

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions qdrant_client/grpc/qdrant_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions qdrant_client/grpc/snapshots_service_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 47 additions & 20 deletions qdrant_client/http/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,7 @@ class IntegerIndexParams(BaseModel, extra="forbid"):
class IntegerIndexType(str, Enum):
INTEGER = "integer"


class IsEmptyCondition(BaseModel, extra="forbid"):
"""
Select points with empty payload for a specified field
Expand Down Expand Up @@ -1049,9 +1050,16 @@ class NestedCondition(BaseModel, extra="forbid"):
class OperationDurationStatistics(BaseModel):
count: int = Field(..., description="")
fail_count: Optional[int] = Field(default=None, description="")
avg_duration_micros: Optional[float] = Field(default=None, description="")
min_duration_micros: Optional[float] = Field(default=None, description="")
max_duration_micros: Optional[float] = Field(default=None, description="")
avg_duration_micros: Optional[float] = Field(
default=None, description="The average time taken by 128 latest operations, calculated as a weighted mean."
)
min_duration_micros: Optional[float] = Field(
default=None, description="The minimum duration of the operations across all the measurements."
)
max_duration_micros: Optional[float] = Field(
default=None, description="The maximum duration of the operations across all the measurements."
)
total_duration_micros: int = Field(..., description="The total duration of all operations in microseconds.")
last_responded: Optional[datetime] = Field(default=None, description="")


Expand Down Expand Up @@ -1514,6 +1522,7 @@ def __str__(self) -> str:
INITIALIZING = "Initializing"
LISTENER = "Listener"
PARTIALSNAPSHOT = "PartialSnapshot"
RECOVERY = "Recovery"


class ReplicateShardOperation(BaseModel, extra="forbid"):
Expand All @@ -1525,6 +1534,17 @@ class RequestsTelemetry(BaseModel):
grpc: "GrpcTelemetry" = Field(..., description="")


class RestartTransfer(BaseModel, extra="forbid"):
shard_id: int = Field(..., description="")
from_peer_id: int = Field(..., description="")
to_peer_id: int = Field(..., description="")
method: "ShardTransferMethod" = Field(..., description="")


class RestartTransferOperation(BaseModel, extra="forbid"):
restart_transfer: "RestartTransfer" = Field(..., description="")


class RunningEnvironmentTelemetry(BaseModel):
distribution: Optional[str] = Field(default=None, description="")
distribution_version: Optional[str] = Field(default=None, description="")
Expand Down Expand Up @@ -1747,6 +1767,9 @@ class SetPayload(BaseModel, extra="forbid"):
shard_key: Optional["ShardKeySelector"] = Field(
default=None, description="This data structure is used in API interface and applied across multiple shards"
)
key: Optional[str] = Field(
default=None, description="Assigns payload to each point that satisfy this path of property"
)


class SetPayloadOperation(BaseModel, extra="forbid"):
Expand All @@ -1763,13 +1786,16 @@ class ShardSnapshotRecover(BaseModel, extra="forbid"):

class ShardTransferInfo(BaseModel):
shard_id: int = Field(..., description="")
from_: int = Field(..., description="", alias="from")
to: int = Field(..., description="")
from_: int = Field(..., description="Source peer id", alias="from")
to: int = Field(..., description="Destination peer id")
sync: bool = Field(
...,
description="If `true` transfer is a synchronization of a replicas If `false` transfer is a moving of a shard from one peer to another",
)
method: Optional["ShardTransferMethod"] = Field(default=None, description="")
comment: Optional[str] = Field(
default=None, description="A human-readable report of the transfer progress. Available only on the source peer."
)


class ShardTransferMethodOneOf(str, Enum):
Expand Down Expand Up @@ -2208,8 +2234,8 @@ def __str__(self) -> str:
RenameAliasOperation,
]
AnyVariants = Union[
List[StrictInt],
List[StrictStr],
List[StrictInt],
]
ClusterOperations = Union[
MoveShardOperation,
Expand All @@ -2218,6 +2244,7 @@ def __str__(self) -> str:
DropReplicaOperation,
CreateShardingKeyOperation,
DropShardingKeyOperation,
RestartTransferOperation,
]
ClusterStatus = Union[
ClusterStatusOneOf,
Expand Down Expand Up @@ -2245,8 +2272,8 @@ def __str__(self) -> str:
StrictStr,
]
GroupId = Union[
StrictInt,
StrictStr,
StrictInt,
]
Indexes = Union[
IndexesOneOf,
Expand All @@ -2259,17 +2286,17 @@ def __str__(self) -> str:
MatchExcept,
]
NamedVectorStruct = Union[
NamedSparseVector,
NamedVector,
List[StrictFloat],
NamedVector,
NamedSparseVector,
]
OptimizersStatus = Union[
OptimizersStatusOneOf,
OptimizersStatusOneOf1,
]
OrderByInterface = Union[
OrderBy,
StrictStr,
OrderBy,
]
PayloadSchemaParams = Union[
TextIndexParams,
Expand Down Expand Up @@ -2307,12 +2334,12 @@ def __str__(self) -> str:
DatetimeRange,
]
ReadConsistency = Union[
ReadConsistencyType,
StrictInt,
ReadConsistencyType,
]
ShardKey = Union[
StrictInt,
StrictStr,
StrictInt,
]
ShardSnapshotLocation = Union[
StrictStr,
Expand Down Expand Up @@ -2350,13 +2377,13 @@ def __str__(self) -> str:
StrictStr,
]
ValueVariants = Union[
StrictBool,
StrictInt,
StrictStr,
StrictInt,
StrictBool,
]
Vector = Union[
SparseVector,
List[StrictFloat],
SparseVector,
]
VectorStorageType = Union[
VectorStorageTypeOneOf,
Expand All @@ -2368,12 +2395,12 @@ def __str__(self) -> str:
Dict[StrictStr, VectorParams],
]
WithLookupInterface = Union[
WithLookup,
StrictStr,
WithLookup,
]
WithVector = Union[
List[StrictStr],
StrictBool,
List[StrictStr],
]
BatchVectorStruct = Union[
List[List[StrictFloat]],
Expand All @@ -2385,8 +2412,8 @@ def __str__(self) -> str:
]
RecommendExample = Union[
ExtendedPointId,
SparseVector,
List[StrictFloat],
SparseVector,
]
ShardKeySelector = Union[
ShardKey,
Expand All @@ -2397,7 +2424,7 @@ def __str__(self) -> str:
Dict[StrictStr, Vector],
]
WithPayloadInterface = Union[
PayloadSelector,
List[StrictStr],
StrictBool,
List[StrictStr],
PayloadSelector,
]
Loading

0 comments on commit 62c79e2

Please sign in to comment.