Shortcuts

qdrant_client.conversions.conversion module

class GrpcToRest[source]

Bases: object

classmethod convert_alias_description(model: AliasDescription) AliasDescription[source]
classmethod convert_alias_operations(model: AliasOperations) Union[CreateAliasOperation, DeleteAliasOperation, RenameAliasOperation][source]
classmethod convert_binary_quantization_config(model: BinaryQuantization) BinaryQuantizationConfig[source]
classmethod convert_collection_config(model: CollectionConfig) CollectionConfig[source]
classmethod convert_collection_description(model: CollectionDescription) CollectionDescription[source]
classmethod convert_collection_info(model: CollectionInfo) CollectionInfo[source]
classmethod convert_collection_params(model: CollectionParams) CollectionParams[source]
classmethod convert_collection_params_diff(model: CollectionParamsDiff) CollectionParamsDiff[source]
classmethod convert_collection_status(model: <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d029b4580>) CollectionStatus[source]
classmethod convert_compression_ratio(model: <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d029b4970>) CompressionRatio[source]
classmethod convert_condition(model: Condition) Union[FieldCondition, IsEmptyCondition, IsNullCondition, HasIdCondition, NestedCondition, Filter][source]
classmethod convert_context_example_pair(model: ContextExamplePair) ContextExamplePair[source]
classmethod convert_count_result(model: CountResult) CountResult[source]
classmethod convert_create_alias(model: CreateAlias) CreateAlias[source]
classmethod convert_datetime_range(model: DatetimeRange) DatetimeRange[source]
classmethod convert_delete_alias(model: DeleteAlias) DeleteAlias[source]
classmethod convert_direction(model: <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d029c3220>) Direction[source]
classmethod convert_discover_points(model: DiscoverPoints) DiscoverRequest[source]
classmethod convert_distance(model: <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d02a3dd90>) Distance[source]
classmethod convert_field_condition(model: FieldCondition) FieldCondition[source]
classmethod convert_filter(model: Filter) Filter[source]
classmethod convert_geo_bounding_box(model: GeoBoundingBox) GeoBoundingBox[source]
classmethod convert_geo_point(model: GeoPoint) GeoPoint[source]
classmethod convert_geo_radius(model: GeoRadius) GeoRadius[source]
classmethod convert_group_id(model: GroupId) Union[str[str], int[int]][source]
classmethod convert_groups_result(model: GroupsResult) GroupsResult[source]
classmethod convert_has_id_condition(model: HasIdCondition) HasIdCondition[source]
classmethod convert_hnsw_config(model: HnswConfigDiff) HnswConfig[source]
classmethod convert_hnsw_config_diff(model: HnswConfigDiff) HnswConfigDiff[source]
classmethod convert_init_from(model: str) InitFrom[source]
classmethod convert_is_empty_condition(model: IsEmptyCondition) IsEmptyCondition[source]
classmethod convert_is_null_condition(model: IsNullCondition) IsNullCondition[source]
classmethod convert_lookup_location(model: LookupLocation) LookupLocation[source]
classmethod convert_match(model: Match) Union[MatchValue, MatchText, MatchAny, MatchExcept][source]
classmethod convert_named_vectors(model: NamedVectors) Dict[str, Union[List[float[float]], SparseVector]][source]
classmethod convert_nested_condition(model: NestedCondition) NestedCondition[source]
classmethod convert_optimizer_config(model: OptimizersConfigDiff) OptimizersConfig[source]
classmethod convert_optimizer_status(model: OptimizerStatus) Union[OptimizersStatusOneOf, OptimizersStatusOneOf1][source]
classmethod convert_optimizers_config_diff(model: OptimizersConfigDiff) OptimizersConfigDiff[source]
classmethod convert_order_by(model: OrderBy) OrderBy[source]
classmethod convert_payload(model: MessageMapContainer) Dict[str, Any][source]
classmethod convert_payload_schema(model: Dict[str, PayloadSchemaInfo]) Dict[str, PayloadIndexInfo][source]
classmethod convert_payload_schema_info(model: PayloadSchemaInfo) PayloadIndexInfo[source]
classmethod convert_payload_schema_params(model: PayloadIndexParams) Union[TextIndexParams, IntegerIndexParams][source]
classmethod convert_payload_schema_type(model: <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d029b4820>) PayloadSchemaType[source]
classmethod convert_point_group(model: PointGroup) PointGroup[source]
classmethod convert_point_id(model: PointId) Union[int[int], str[str]][source]
classmethod convert_point_struct(model: PointStruct) PointStruct[source]
classmethod convert_point_vectors(model: PointVectors) PointVectors[source]
classmethod convert_points_selector(model: PointsSelector, shard_key_selector: Optional[ShardKeySelector] = None) Union[PointIdsList, FilterSelector][source]
classmethod convert_points_update_operation(model: PointsUpdateOperation) Union[UpsertOperation, DeleteOperation, SetPayloadOperation, OverwritePayloadOperation, DeletePayloadOperation, ClearPayloadOperation, UpdateVectorsOperation, DeleteVectorsOperation][source]
classmethod convert_product_quantization_config(model: ProductQuantization) ProductQuantizationConfig[source]
classmethod convert_quantization_config(model: QuantizationConfig) Union[ScalarQuantization, ProductQuantization, BinaryQuantization][source]
classmethod convert_quantization_config_diff(model: QuantizationConfigDiff) Union[ScalarQuantization, ProductQuantization, BinaryQuantization, Disabled][source]
classmethod convert_quantization_search_params(model: QuantizationSearchParams) QuantizationSearchParams[source]
classmethod convert_range(model: Range) Range[source]
classmethod convert_read_consistency(model: ReadConsistency) Union[int[int], ReadConsistencyType][source]
classmethod convert_read_consistency_type(model: <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d02bc19a0>) ReadConsistencyType[source]
classmethod convert_recommend_points(model: RecommendPoints) RecommendRequest[source]
classmethod convert_recommend_strategy(model: <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d029c32b0>) RecommendStrategy[source]
classmethod convert_record(model: RetrievedPoint) Record[source]
classmethod convert_rename_alias(model: RenameAlias) RenameAlias[source]
classmethod convert_retrieved_point(model: RetrievedPoint) Record[source]
classmethod convert_scalar_quantization_config(model: ScalarQuantization) ScalarQuantizationConfig[source]
classmethod convert_scored_point(model: ScoredPoint) ScoredPoint[source]
classmethod convert_search_params(model: SearchParams) SearchParams[source]
classmethod convert_search_points(model: SearchPoints) SearchRequest[source]
classmethod convert_shard_key(model: ShardKey) Union[str[str], int[int]][source]
classmethod convert_shard_key_selector(model: ShardKeySelector) Union[str[str], int[int], List[Union[str[str], int[int]]]][source]
classmethod convert_sharding_method(model: <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d029b4a00>) ShardingMethod[source]
classmethod convert_snapshot_description(model: SnapshotDescription) SnapshotDescription[source]
classmethod convert_sparse_index_config(model: SparseIndexConfig) SparseIndexParams[source]
classmethod convert_sparse_vector_config(model: SparseVectorConfig) Dict[str, SparseVectorParams][source]
classmethod convert_sparse_vector_params(model: SparseVectorParams) SparseVectorParams[source]
classmethod convert_start_from(model: StartFrom) Union[int[int], float[float], datetime][source]
classmethod convert_target_vector(model: TargetVector) Union[int[int], str[str], List[float[float]], SparseVector][source]
classmethod convert_text_index_params(model: TextIndexParams) TextIndexParams[source]
classmethod convert_timestamp(model: Timestamp) datetime[source]
classmethod convert_tokenizer_type(model: <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d029b4a90>) TokenizerType[source]
classmethod convert_update_collection(model: UpdateCollection) UpdateCollection[source]
classmethod convert_update_result(model: UpdateResult) UpdateResult[source]
classmethod convert_update_status(model: <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d029c3340>) UpdateStatus[source]
classmethod convert_values_count(model: ValuesCount) ValuesCount[source]
classmethod convert_vector(model: Vector) Union[List[float], SparseVector][source]
classmethod convert_vector_example(model: VectorExample) Union[int[int], str[str], List[float[float]], SparseVector][source]
classmethod convert_vector_params(model: VectorParams) VectorParams[source]
classmethod convert_vector_params_diff(model: VectorParamsDiff) VectorParamsDiff[source]
classmethod convert_vectors(model: Vectors) Union[List[float[float]], Dict[str[str], Union[List[float[float]], SparseVector]]][source]
classmethod convert_vectors_config(model: VectorsConfig) Union[VectorParams, Dict[str[str], VectorParams]][source]
classmethod convert_vectors_config_diff(model: VectorsConfigDiff) Dict[str, VectorParamsDiff][source]
classmethod convert_vectors_selector(model: VectorsSelector) List[str][source]
classmethod convert_wal_config(model: WalConfigDiff) WalConfig[source]
classmethod convert_wal_config_diff(model: WalConfigDiff) WalConfigDiff[source]
classmethod convert_with_lookup(model: WithLookup) WithLookup[source]
classmethod convert_with_payload_interface(model: WithPayloadSelector) Union[bool[bool], List[str[str]], PayloadSelectorInclude, PayloadSelectorExclude][source]
classmethod convert_with_payload_selector(model: WithPayloadSelector) Union[bool[bool], List[str[str]], PayloadSelectorInclude, PayloadSelectorExclude][source]
classmethod convert_with_vectors_selector(model: WithVectorsSelector) Union[bool[bool], List[str[str]]][source]
classmethod convert_write_ordering(model: WriteOrdering) WriteOrdering[source]
class RestToGrpc[source]

Bases: object

classmethod convert_alias_description(model: AliasDescription) AliasDescription[source]
classmethod convert_alias_operations(model: Union[CreateAliasOperation, DeleteAliasOperation, RenameAliasOperation]) AliasOperations[source]
classmethod convert_batch_vector_struct(model: Union[List[List[float[float]]], Dict[str[str], List[Union[List[float[float]], SparseVector]]]], num_records: int) List[Vectors][source]
classmethod convert_binary_quantization_config(model: BinaryQuantizationConfig) BinaryQuantization[source]
classmethod convert_collection_config(model: CollectionConfig) CollectionConfig[source]
classmethod convert_collection_description(model: CollectionDescription) CollectionDescription[source]
classmethod convert_collection_info(model: CollectionInfo) CollectionInfo[source]
classmethod convert_collection_params(model: CollectionParams) CollectionParams[source]
classmethod convert_collection_params_diff(model: CollectionParamsDiff) CollectionParamsDiff[source]
classmethod convert_collection_status(model: CollectionStatus) <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d029b4580>[source]
classmethod convert_compression_ratio(model: CompressionRatio) <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d029b4970>[source]
classmethod convert_condition(model: Union[FieldCondition, IsEmptyCondition, IsNullCondition, HasIdCondition, NestedCondition, Filter]) Condition[source]
classmethod convert_context_example_pair(model: ContextExamplePair) ContextExamplePair[source]
classmethod convert_count_result(model: CountResult) CountResult[source]
classmethod convert_create_alias(model: CreateAlias) CreateAlias[source]
classmethod convert_datetime(model: datetime) Timestamp[source]
classmethod convert_datetime_range(model: DatetimeRange) DatetimeRange[source]
classmethod convert_delete_alias(model: DeleteAlias) DeleteAlias[source]
classmethod convert_direction(model: Direction) <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d029c3220>[source]
classmethod convert_discover_points(model: DiscoverRequest, collection_name: str) DiscoverPoints[source]
classmethod convert_discover_request(model: DiscoverRequest, collection_name: str) DiscoverPoints[source]
classmethod convert_distance(model: Distance) <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d02a3dd90>[source]
classmethod convert_extended_point_id(model: Union[int[int], str[str]]) PointId[source]
classmethod convert_field_condition(model: FieldCondition) FieldCondition[source]
classmethod convert_filter(model: Filter) Filter[source]
classmethod convert_geo_bounding_box(model: GeoBoundingBox) GeoBoundingBox[source]
classmethod convert_geo_point(model: GeoPoint) GeoPoint[source]
classmethod convert_geo_radius(model: GeoRadius) GeoRadius[source]
classmethod convert_group_id(model: Union[str[str], int[int]]) GroupId[source]
classmethod convert_groups_result(model: GroupsResult) GroupsResult[source]
classmethod convert_has_id_condition(model: HasIdCondition) HasIdCondition[source]
classmethod convert_hnsw_config(model: HnswConfig) HnswConfigDiff[source]
classmethod convert_hnsw_config_diff(model: HnswConfigDiff) HnswConfigDiff[source]
classmethod convert_init_from(model: InitFrom) str[source]
classmethod convert_is_empty_condition(model: IsEmptyCondition) IsEmptyCondition[source]
classmethod convert_is_null_condition(model: IsNullCondition) IsNullCondition[source]
classmethod convert_lookup_location(model: LookupLocation) LookupLocation[source]
classmethod convert_match(model: Union[MatchValue, MatchText, MatchAny, MatchExcept]) Match[source]
classmethod convert_named_vector_struct(model: Union[List[float[float]], NamedVector, NamedSparseVector]) Tuple[List[float], Optional[SparseIndices], Optional[str]][source]
classmethod convert_nested_condition(model: NestedCondition) NestedCondition[source]
classmethod convert_optimizer_status(model: Union[OptimizersStatusOneOf, OptimizersStatusOneOf1]) OptimizerStatus[source]
classmethod convert_optimizers_config(model: OptimizersConfig) OptimizersConfigDiff[source]
classmethod convert_optimizers_config_diff(model: OptimizersConfigDiff) OptimizersConfigDiff[source]
classmethod convert_order_by(model: OrderBy) OrderBy[source]
classmethod convert_order_by_interface(model: Union[str[str], OrderBy]) OrderBy[source]
classmethod convert_payload(model: Dict[str, Any]) Dict[str, Value][source]
classmethod convert_payload_index_info(model: PayloadIndexInfo) PayloadSchemaInfo[source]
classmethod convert_payload_schema(model: Dict[str, PayloadIndexInfo]) Dict[str, PayloadSchemaInfo][source]
classmethod convert_payload_schema_params(model: Union[TextIndexParams, IntegerIndexParams]) PayloadIndexParams[source]
classmethod convert_payload_schema_type(model: PayloadSchemaType) <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d029b4820>[source]
classmethod convert_payload_selector(model: Union[PayloadSelectorInclude, PayloadSelectorExclude]) WithPayloadSelector[source]
classmethod convert_point_group(model: PointGroup) PointGroup[source]
classmethod convert_point_insert_operation(model: Union[PointsBatch, PointsList]) List[PointStruct][source]
classmethod convert_point_struct(model: PointStruct) PointStruct[source]
classmethod convert_point_vectors(model: PointVectors) PointVectors[source]
classmethod convert_points_selector(model: Union[PointIdsList, FilterSelector]) PointsSelector[source]
classmethod convert_points_update_operation(model: Union[UpsertOperation, DeleteOperation, SetPayloadOperation, OverwritePayloadOperation, DeletePayloadOperation, ClearPayloadOperation, UpdateVectorsOperation, DeleteVectorsOperation]) PointsUpdateOperation[source]
classmethod convert_product_quantization_config(model: ProductQuantizationConfig) ProductQuantization[source]
classmethod convert_quantization_config(model: Union[ScalarQuantization, ProductQuantization, BinaryQuantization]) QuantizationConfig[source]
classmethod convert_quantization_config_diff(model: Union[ScalarQuantization, ProductQuantization, BinaryQuantization, Disabled]) QuantizationConfigDiff[source]
classmethod convert_quantization_search_params(model: QuantizationSearchParams) QuantizationSearchParams[source]
classmethod convert_range(model: Range) Range[source]
classmethod convert_read_consistency(model: Union[int[int], ReadConsistencyType]) ReadConsistency[source]
classmethod convert_read_consistency_type(model: ReadConsistencyType) <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d02bc19a0>[source]
classmethod convert_recommend_example(model: Union[int[int], str[str], List[float[float]], SparseVector]) VectorExample[source]
classmethod convert_recommend_examples_to_ids(examples: Sequence[Union[int[int], str[str], List[float[float]], SparseVector]]) List[PointId][source]
classmethod convert_recommend_examples_to_vectors(examples: Sequence[Union[int[int], str[str], List[float[float]], SparseVector]]) List[Vector][source]
classmethod convert_recommend_points(model: RecommendRequest, collection_name: str) RecommendPoints[source]
classmethod convert_recommend_request(model: RecommendRequest, collection_name: str) RecommendPoints[source]
classmethod convert_recommend_strategy(model: RecommendStrategy) <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d029c32b0>[source]
classmethod convert_record(model: Record) RetrievedPoint[source]
classmethod convert_rename_alias(model: RenameAlias) RenameAlias[source]
classmethod convert_retrieved_point(model: Record) RetrievedPoint[source]
classmethod convert_scalar_quantization_config(model: ScalarQuantizationConfig) ScalarQuantization[source]
classmethod convert_scored_point(model: ScoredPoint) ScoredPoint[source]
classmethod convert_search_params(model: SearchParams) SearchParams[source]
classmethod convert_search_points(model: SearchRequest, collection_name: str) SearchPoints[source]
classmethod convert_search_request(model: SearchRequest, collection_name: str) SearchPoints[source]
classmethod convert_shard_key(model: Union[str[str], int[int]]) ShardKey[source]
classmethod convert_shard_key_selector(model: Union[str[str], int[int], List[Union[str[str], int[int]]]]) ShardKeySelector[source]
classmethod convert_sharding_method(model: ShardingMethod) <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d029b4a00>[source]
classmethod convert_snapshot_description(model: SnapshotDescription) SnapshotDescription[source]
classmethod convert_sparse_index_config(model: SparseIndexConfig) SparseIndexConfig[source]
classmethod convert_sparse_vector(model: SparseVector) Vector[source]
classmethod convert_sparse_vector_config(model: Mapping[str, SparseVectorParams]) SparseVectorConfig[source]
classmethod convert_sparse_vector_params(model: SparseVectorParams) SparseVectorParams[source]
classmethod convert_start_from(model: Union[int[int], float[float], datetime]) StartFrom[source]
classmethod convert_target_vector(model: Union[int[int], str[str], List[float[float]], SparseVector]) TargetVector[source]
classmethod convert_text_index_params(model: TextIndexParams) TextIndexParams[source]
classmethod convert_tokenizer_type(model: TokenizerType) <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d029b4a90>[source]
classmethod convert_update_collection(model: UpdateCollection, collection_name: str) UpdateCollection[source]
classmethod convert_update_operation(model: Union[UpsertOperation, DeleteOperation, SetPayloadOperation, OverwritePayloadOperation, DeletePayloadOperation, ClearPayloadOperation, UpdateVectorsOperation, DeleteVectorsOperation]) PointsUpdateOperation[source]
classmethod convert_update_result(model: UpdateResult) UpdateResult[source]
classmethod convert_update_stats(model: UpdateStatus) <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d029c3340>[source]
classmethod convert_values_count(model: ValuesCount) ValuesCount[source]
classmethod convert_vector_example(model: Union[int[int], str[str], List[float[float]], SparseVector]) VectorExample[source]
classmethod convert_vector_params(model: VectorParams) VectorParams[source]
classmethod convert_vector_params_diff(model: VectorParamsDiff) VectorParamsDiff[source]
classmethod convert_vector_struct(model: Union[List[float[float]], Dict[str[str], Union[List[float[float]], SparseVector]]]) Vectors[source]
classmethod convert_vectors_config(model: Union[VectorParams, Dict[str[str], VectorParams]]) VectorsConfig[source]
classmethod convert_vectors_config_diff(model: Dict[str, VectorParamsDiff]) VectorsConfigDiff[source]
classmethod convert_wal_config(model: WalConfig) WalConfigDiff[source]
classmethod convert_wal_config_diff(model: WalConfigDiff) WalConfigDiff[source]
classmethod convert_with_lookup(model: WithLookup) WithLookup[source]
classmethod convert_with_payload_interface(model: Union[bool[bool], List[str[str]], PayloadSelectorInclude, PayloadSelectorExclude]) WithPayloadSelector[source]
classmethod convert_with_payload_selector(model: Union[PayloadSelectorInclude, PayloadSelectorExclude]) WithPayloadSelector[source]
classmethod convert_with_vectors(model: Union[bool[bool], List[str[str]]]) WithVectorsSelector[source]
classmethod convert_write_ordering(model: WriteOrdering) WriteOrdering[source]
grpc_field_type_to_payload_schema(model: <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d029c3190>) <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d029b4820>[source]
grpc_payload_schema_to_field_type(model: <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d029b4820>) <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x7f2d029c3190>[source]
grpc_to_payload(grpc_: Dict[str, Value]) Dict[str, Any][source]
has_field(message: Any, field: str) bool[source]

Same as protobuf HasField, but also works for primitive values (https://stackoverflow.com/questions/51918871/check-if-a-field-has-been-set-in-protocol-buffer-3)

Parameters
  • message (Any) – protobuf message

  • field (str) – name of the field

json_to_value(payload: Any) Value[source]
payload_to_grpc(payload: Dict[str, Any]) Dict[str, Value][source]
value_to_json(value: Value) Any[source]

Qdrant

Learn more about Qdrant vector search project and ecosystem

Discover Qdrant

Similarity Learning

Explore practical problem solving with Similarity Learning

Learn Similarity Learning

Community

Find people dealing with similar problems and get answers to your questions

Join Community