Files
qdrant/lib/edge/python/examples/qdrant-edge.py
Roman Titov 7977dbf9e7 Python bindings for Qdrant on Edge (#7312)
* Qdrant Edge Python binding 🐍⛓️💥

* fixup! Qdrant Edge Python binding 🐍⛓️💥

Fix example + cleanup

* review: move QueryEnum + mark search as deprecated

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-11-14 12:27:28 +01:00

37 lines
933 B
Python

from qdrant_edge import *
config = SegmentConfig(
vector_data = {
"": VectorDataConfig(
size = 4,
distance = Distance.COSINE,
storage_type = VectorStorageType.CHUNKED_MMAP,
index = Indexes.PLAIN,
quantization_config = None,
multivector_config = None,
datatype = None,
),
},
sparse_vector_data = {},
payload_storage_type = PayloadStorageType.IN_RAM_MMAP,
)
shard = Shard(".", config)
shard.update(UpdateOperation.upsert_points([
Point(PointId.num(1), Vector.single([6.0, 9.0, 4.0, 2.0]), None),
]))
points = shard.search(SearchRequest(
query = Query.nearest(QueryVector.dense([1.0, 1.0, 1.0, 1.0]), None),
filter = None,
params = None,
limit = 10,
offset = 0,
with_vector = WithVector(True),
with_payload = WithPayload(True),
score_threshold = None,
))
print(points[0].vector)