This commit is contained in:
Andrey Vasnetsov
2021-02-09 02:32:14 +01:00
commit 8a9e14d91f
110 changed files with 5492 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
venv
__pycache__

2
README.md Normal file
View File

@@ -0,0 +1,2 @@
# Python Qdrant client library

346
poetry.lock generated Normal file
View File

@@ -0,0 +1,346 @@
[[package]]
name = "atomicwrites"
version = "1.4.0"
description = "Atomic file writes."
category = "dev"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
[[package]]
name = "attrs"
version = "20.3.0"
description = "Classes Without Boilerplate"
category = "dev"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
[package.extras]
dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "furo", "sphinx", "pre-commit"]
docs = ["furo", "sphinx", "zope.interface"]
tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"]
tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six"]
[[package]]
name = "certifi"
version = "2020.12.5"
description = "Python package for providing Mozilla's CA Bundle."
category = "main"
optional = false
python-versions = "*"
[[package]]
name = "colorama"
version = "0.4.4"
description = "Cross-platform colored terminal text."
category = "dev"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
[[package]]
name = "h11"
version = "0.12.0"
description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1"
category = "main"
optional = false
python-versions = ">=3.6"
[[package]]
name = "httpcore"
version = "0.12.3"
description = "A minimal low-level HTTP client."
category = "main"
optional = false
python-versions = ">=3.6"
[package.dependencies]
h11 = "<1.0.0"
sniffio = ">=1.0.0,<2.0.0"
[package.extras]
http2 = ["h2 (>=3,<5)"]
[[package]]
name = "httpx"
version = "0.16.1"
description = "The next generation HTTP client."
category = "main"
optional = false
python-versions = ">=3.6"
[package.dependencies]
certifi = "*"
httpcore = ">=0.12.0,<0.13.0"
rfc3986 = {version = ">=1.3,<2", extras = ["idna2008"]}
sniffio = "*"
[package.extras]
brotli = ["brotlipy (>=0.7.0,<0.8.0)"]
http2 = ["h2 (>=3.0.0,<4.0.0)"]
[[package]]
name = "idna"
version = "3.1"
description = "Internationalized Domain Names in Applications (IDNA)"
category = "main"
optional = false
python-versions = ">=3.4"
[[package]]
name = "more-itertools"
version = "8.7.0"
description = "More routines for operating on iterables, beyond itertools"
category = "dev"
optional = false
python-versions = ">=3.5"
[[package]]
name = "numpy"
version = "1.20.1"
description = "NumPy is the fundamental package for array computing with Python."
category = "main"
optional = false
python-versions = ">=3.7"
[[package]]
name = "packaging"
version = "20.9"
description = "Core utilities for Python packages"
category = "dev"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
[package.dependencies]
pyparsing = ">=2.0.2"
[[package]]
name = "pluggy"
version = "0.13.1"
description = "plugin and hook calling mechanisms for python"
category = "dev"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
[package.extras]
dev = ["pre-commit", "tox"]
[[package]]
name = "py"
version = "1.10.0"
description = "library with cross-python path, ini-parsing, io, code, log facilities"
category = "dev"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
[[package]]
name = "pydantic"
version = "1.7.3"
description = "Data validation and settings management using python 3.6 type hinting"
category = "main"
optional = false
python-versions = ">=3.6"
[package.extras]
dotenv = ["python-dotenv (>=0.10.4)"]
email = ["email-validator (>=1.0.3)"]
typing_extensions = ["typing-extensions (>=3.7.2)"]
[[package]]
name = "pyparsing"
version = "2.4.7"
description = "Python parsing module"
category = "dev"
optional = false
python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*"
[[package]]
name = "pytest"
version = "5.4.3"
description = "pytest: simple powerful testing with Python"
category = "dev"
optional = false
python-versions = ">=3.5"
[package.dependencies]
atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""}
attrs = ">=17.4.0"
colorama = {version = "*", markers = "sys_platform == \"win32\""}
more-itertools = ">=4.0.0"
packaging = "*"
pluggy = ">=0.12,<1.0"
py = ">=1.5.0"
wcwidth = "*"
[package.extras]
checkqa-mypy = ["mypy (==v0.761)"]
testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"]
[[package]]
name = "rfc3986"
version = "1.4.0"
description = "Validating URI References per RFC 3986"
category = "main"
optional = false
python-versions = "*"
[package.dependencies]
idna = {version = "*", optional = true, markers = "extra == \"idna2008\""}
[package.extras]
idna2008 = ["idna"]
[[package]]
name = "sniffio"
version = "1.2.0"
description = "Sniff out which async library your code is running under"
category = "main"
optional = false
python-versions = ">=3.5"
[[package]]
name = "tqdm"
version = "4.56.0"
description = "Fast, Extensible Progress Meter"
category = "main"
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7"
[package.extras]
dev = ["py-make (>=0.1.0)", "twine", "wheel"]
telegram = ["requests"]
[[package]]
name = "wcwidth"
version = "0.2.5"
description = "Measures the displayed width of unicode strings in a terminal"
category = "dev"
optional = false
python-versions = "*"
[metadata]
lock-version = "1.1"
python-versions = "^3.9"
content-hash = "b78998de8d2e4bcdd90de90bd19d9ea534c23d4c0590b149cf743ca7710ed294"
[metadata.files]
atomicwrites = [
{file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"},
{file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"},
]
attrs = [
{file = "attrs-20.3.0-py2.py3-none-any.whl", hash = "sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6"},
{file = "attrs-20.3.0.tar.gz", hash = "sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700"},
]
certifi = [
{file = "certifi-2020.12.5-py2.py3-none-any.whl", hash = "sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830"},
{file = "certifi-2020.12.5.tar.gz", hash = "sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c"},
]
colorama = [
{file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"},
{file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"},
]
h11 = [
{file = "h11-0.12.0-py3-none-any.whl", hash = "sha256:36a3cb8c0a032f56e2da7084577878a035d3b61d104230d4bd49c0c6b555a9c6"},
{file = "h11-0.12.0.tar.gz", hash = "sha256:47222cb6067e4a307d535814917cd98fd0a57b6788ce715755fa2b6c28b56042"},
]
httpcore = [
{file = "httpcore-0.12.3-py3-none-any.whl", hash = "sha256:93e822cd16c32016b414b789aeff4e855d0ccbfc51df563ee34d4dbadbb3bcdc"},
{file = "httpcore-0.12.3.tar.gz", hash = "sha256:37ae835fb370049b2030c3290e12ed298bf1473c41bb72ca4aa78681eba9b7c9"},
]
httpx = [
{file = "httpx-0.16.1-py3-none-any.whl", hash = "sha256:9cffb8ba31fac6536f2c8cde30df859013f59e4bcc5b8d43901cb3654a8e0a5b"},
{file = "httpx-0.16.1.tar.gz", hash = "sha256:126424c279c842738805974687e0518a94c7ae8d140cd65b9c4f77ac46ffa537"},
]
idna = [
{file = "idna-3.1-py3-none-any.whl", hash = "sha256:5205d03e7bcbb919cc9c19885f9920d622ca52448306f2377daede5cf3faac16"},
{file = "idna-3.1.tar.gz", hash = "sha256:c5b02147e01ea9920e6b0a3f1f7bb833612d507592c837a6c49552768f4054e1"},
]
more-itertools = [
{file = "more-itertools-8.7.0.tar.gz", hash = "sha256:c5d6da9ca3ff65220c3bfd2a8db06d698f05d4d2b9be57e1deb2be5a45019713"},
{file = "more_itertools-8.7.0-py3-none-any.whl", hash = "sha256:5652a9ac72209ed7df8d9c15daf4e1aa0e3d2ccd3c87f8265a0673cd9cbc9ced"},
]
numpy = [
{file = "numpy-1.20.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:ae61f02b84a0211abb56462a3b6cd1e7ec39d466d3160eb4e1da8bf6717cdbeb"},
{file = "numpy-1.20.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:65410c7f4398a0047eea5cca9b74009ea61178efd78d1be9847fac1d6716ec1e"},
{file = "numpy-1.20.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:2d7e27442599104ee08f4faed56bb87c55f8b10a5494ac2ead5c98a4b289e61f"},
{file = "numpy-1.20.1-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:4ed8e96dc146e12c1c5cdd6fb9fd0757f2ba66048bf94c5126b7efebd12d0090"},
{file = "numpy-1.20.1-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:ecb5b74c702358cdc21268ff4c37f7466357871f53a30e6f84c686952bef16a9"},
{file = "numpy-1.20.1-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:b9410c0b6fed4a22554f072a86c361e417f0258838957b78bd063bde2c7f841f"},
{file = "numpy-1.20.1-cp37-cp37m-win32.whl", hash = "sha256:3d3087e24e354c18fb35c454026af3ed8997cfd4997765266897c68d724e4845"},
{file = "numpy-1.20.1-cp37-cp37m-win_amd64.whl", hash = "sha256:89f937b13b8dd17b0099c7c2e22066883c86ca1575a975f754babc8fbf8d69a9"},
{file = "numpy-1.20.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:a1d7995d1023335e67fb070b2fae6f5968f5be3802b15ad6d79d81ecaa014fe0"},
{file = "numpy-1.20.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:60759ab15c94dd0e1ed88241fd4fa3312db4e91d2c8f5a2d4cf3863fad83d65b"},
{file = "numpy-1.20.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:125a0e10ddd99a874fd357bfa1b636cd58deb78ba4a30b5ddb09f645c3512e04"},
{file = "numpy-1.20.1-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:c26287dfc888cf1e65181f39ea75e11f42ffc4f4529e5bd19add57ad458996e2"},
{file = "numpy-1.20.1-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:7199109fa46277be503393be9250b983f325880766f847885607d9b13848f257"},
{file = "numpy-1.20.1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:72251e43ac426ff98ea802a931922c79b8d7596480300eb9f1b1e45e0543571e"},
{file = "numpy-1.20.1-cp38-cp38-win32.whl", hash = "sha256:c91ec9569facd4757ade0888371eced2ecf49e7982ce5634cc2cf4e7331a4b14"},
{file = "numpy-1.20.1-cp38-cp38-win_amd64.whl", hash = "sha256:13adf545732bb23a796914fe5f891a12bd74cf3d2986eed7b7eba2941eea1590"},
{file = "numpy-1.20.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:104f5e90b143dbf298361a99ac1af4cf59131218a045ebf4ee5990b83cff5fab"},
{file = "numpy-1.20.1-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:89e5336f2bec0c726ac7e7cdae181b325a9c0ee24e604704ed830d241c5e47ff"},
{file = "numpy-1.20.1-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:032be656d89bbf786d743fee11d01ef318b0781281241997558fa7950028dd29"},
{file = "numpy-1.20.1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:66b467adfcf628f66ea4ac6430ded0614f5cc06ba530d09571ea404789064adc"},
{file = "numpy-1.20.1-cp39-cp39-win32.whl", hash = "sha256:12e4ba5c6420917571f1a5becc9338abbde71dd811ce40b37ba62dec7b39af6d"},
{file = "numpy-1.20.1-cp39-cp39-win_amd64.whl", hash = "sha256:9c94cab5054bad82a70b2e77741271790304651d584e2cdfe2041488e753863b"},
{file = "numpy-1.20.1-pp37-pypy37_pp73-manylinux2010_x86_64.whl", hash = "sha256:9eb551d122fadca7774b97db8a112b77231dcccda8e91a5bc99e79890797175e"},
{file = "numpy-1.20.1.zip", hash = "sha256:3bc63486a870294683980d76ec1e3efc786295ae00128f9ea38e2c6e74d5a60a"},
]
packaging = [
{file = "packaging-20.9-py2.py3-none-any.whl", hash = "sha256:67714da7f7bc052e064859c05c595155bd1ee9f69f76557e21f051443c20947a"},
{file = "packaging-20.9.tar.gz", hash = "sha256:5b327ac1320dc863dca72f4514ecc086f31186744b84a230374cc1fd776feae5"},
]
pluggy = [
{file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"},
{file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"},
]
py = [
{file = "py-1.10.0-py2.py3-none-any.whl", hash = "sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a"},
{file = "py-1.10.0.tar.gz", hash = "sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3"},
]
pydantic = [
{file = "pydantic-1.7.3-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:c59ea046aea25be14dc22d69c97bee629e6d48d2b2ecb724d7fe8806bf5f61cd"},
{file = "pydantic-1.7.3-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:a4143c8d0c456a093387b96e0f5ee941a950992904d88bc816b4f0e72c9a0009"},
{file = "pydantic-1.7.3-cp36-cp36m-manylinux2014_i686.whl", hash = "sha256:d8df4b9090b595511906fa48deda47af04e7d092318bfb291f4d45dfb6bb2127"},
{file = "pydantic-1.7.3-cp36-cp36m-manylinux2014_x86_64.whl", hash = "sha256:514b473d264671a5c672dfb28bdfe1bf1afd390f6b206aa2ec9fed7fc592c48e"},
{file = "pydantic-1.7.3-cp36-cp36m-win_amd64.whl", hash = "sha256:dba5c1f0a3aeea5083e75db9660935da90216f8a81b6d68e67f54e135ed5eb23"},
{file = "pydantic-1.7.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:59e45f3b694b05a69032a0d603c32d453a23f0de80844fb14d55ab0c6c78ff2f"},
{file = "pydantic-1.7.3-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:5b24e8a572e4b4c18f614004dda8c9f2c07328cb5b6e314d6e1bbd536cb1a6c1"},
{file = "pydantic-1.7.3-cp37-cp37m-manylinux2014_i686.whl", hash = "sha256:b2b054d095b6431cdda2f852a6d2f0fdec77686b305c57961b4c5dd6d863bf3c"},
{file = "pydantic-1.7.3-cp37-cp37m-manylinux2014_x86_64.whl", hash = "sha256:025bf13ce27990acc059d0c5be46f416fc9b293f45363b3d19855165fee1874f"},
{file = "pydantic-1.7.3-cp37-cp37m-win_amd64.whl", hash = "sha256:6e3874aa7e8babd37b40c4504e3a94cc2023696ced5a0500949f3347664ff8e2"},
{file = "pydantic-1.7.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:e682f6442ebe4e50cb5e1cfde7dda6766fb586631c3e5569f6aa1951fd1a76ef"},
{file = "pydantic-1.7.3-cp38-cp38-manylinux1_i686.whl", hash = "sha256:185e18134bec5ef43351149fe34fda4758e53d05bb8ea4d5928f0720997b79ef"},
{file = "pydantic-1.7.3-cp38-cp38-manylinux2014_i686.whl", hash = "sha256:f5b06f5099e163295b8ff5b1b71132ecf5866cc6e7f586d78d7d3fd6e8084608"},
{file = "pydantic-1.7.3-cp38-cp38-manylinux2014_x86_64.whl", hash = "sha256:24ca47365be2a5a3cc3f4a26dcc755bcdc9f0036f55dcedbd55663662ba145ec"},
{file = "pydantic-1.7.3-cp38-cp38-win_amd64.whl", hash = "sha256:d1fe3f0df8ac0f3a9792666c69a7cd70530f329036426d06b4f899c025aca74e"},
{file = "pydantic-1.7.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f6864844b039805add62ebe8a8c676286340ba0c6d043ae5dea24114b82a319e"},
{file = "pydantic-1.7.3-cp39-cp39-manylinux1_i686.whl", hash = "sha256:ecb54491f98544c12c66ff3d15e701612fc388161fd455242447083350904730"},
{file = "pydantic-1.7.3-cp39-cp39-manylinux2014_i686.whl", hash = "sha256:ffd180ebd5dd2a9ac0da4e8b995c9c99e7c74c31f985ba090ee01d681b1c4b95"},
{file = "pydantic-1.7.3-cp39-cp39-manylinux2014_x86_64.whl", hash = "sha256:8d72e814c7821125b16f1553124d12faba88e85405b0864328899aceaad7282b"},
{file = "pydantic-1.7.3-cp39-cp39-win_amd64.whl", hash = "sha256:475f2fa134cf272d6631072554f845d0630907fce053926ff634cc6bc45bf1af"},
{file = "pydantic-1.7.3-py3-none-any.whl", hash = "sha256:38be427ea01a78206bcaf9a56f835784afcba9e5b88fbdce33bbbfbcd7841229"},
{file = "pydantic-1.7.3.tar.gz", hash = "sha256:213125b7e9e64713d16d988d10997dabc6a1f73f3991e1ff8e35ebb1409c7dc9"},
]
pyparsing = [
{file = "pyparsing-2.4.7-py2.py3-none-any.whl", hash = "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b"},
{file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"},
]
pytest = [
{file = "pytest-5.4.3-py3-none-any.whl", hash = "sha256:5c0db86b698e8f170ba4582a492248919255fcd4c79b1ee64ace34301fb589a1"},
{file = "pytest-5.4.3.tar.gz", hash = "sha256:7979331bfcba207414f5e1263b5a0f8f521d0f457318836a7355531ed1a4c7d8"},
]
rfc3986 = [
{file = "rfc3986-1.4.0-py2.py3-none-any.whl", hash = "sha256:af9147e9aceda37c91a05f4deb128d4b4b49d6b199775fd2d2927768abdc8f50"},
{file = "rfc3986-1.4.0.tar.gz", hash = "sha256:112398da31a3344dc25dbf477d8df6cb34f9278a94fee2625d89e4514be8bb9d"},
]
sniffio = [
{file = "sniffio-1.2.0-py3-none-any.whl", hash = "sha256:471b71698eac1c2112a40ce2752bb2f4a4814c22a54a3eed3676bc0f5ca9f663"},
{file = "sniffio-1.2.0.tar.gz", hash = "sha256:c4666eecec1d3f50960c6bdf61ab7bc350648da6c126e3cf6898d8cd4ddcd3de"},
]
tqdm = [
{file = "tqdm-4.56.0-py2.py3-none-any.whl", hash = "sha256:4621f6823bab46a9cc33d48105753ccbea671b68bab2c50a9f0be23d4065cb5a"},
{file = "tqdm-4.56.0.tar.gz", hash = "sha256:fe3d08dd00a526850568d542ff9de9bbc2a09a791da3c334f3213d8d0bbbca65"},
]
wcwidth = [
{file = "wcwidth-0.2.5-py2.py3-none-any.whl", hash = "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784"},
{file = "wcwidth-0.2.5.tar.gz", hash = "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"},
]

19
pyproject.toml Normal file
View File

@@ -0,0 +1,19 @@
[tool.poetry]
name = "qdrant_client"
version = "0.1.0"
description = ""
authors = ["Andrey Vasnetsov <andrey@vasnetsov.com>"]
[tool.poetry.dependencies]
python = "^3.9"
httpx = "^0.16.1"
numpy = "^1.20.1"
pydantic = "^1.7.3"
tqdm = "^4.56.0"
[tool.poetry.dev-dependencies]
pytest = "^5.2"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

View File

@@ -0,0 +1 @@
__version__ = '0.1.0'

View File

@@ -0,0 +1,232 @@
import math
from itertools import count, islice
from typing import Optional, Iterable, Dict, List, Union
import numpy as np
from tqdm import tqdm
from qdrant_openapi_client import SyncApis, ApiClient
from qdrant_openapi_client.models.models import PointOpsAnyOf, PointInsertOpsAnyOfBatch, PayloadInterface, \
PayloadInterfaceAnyOf, PayloadInterfaceAnyOf1, PayloadInterfaceAnyOf2, PayloadInterfaceAnyOf3, GeoPoint, \
StorageOpsAnyOf1, StorageOpsAnyOf, StorageOpsAnyOfCreateCollection, Distance, Indexes, PointInsertOpsAnyOf, \
PointRequest, SearchRequest, Filter, SearchParams
def iter_batch(iterable, size) -> Iterable:
"""
>>> list(iter_batch([1,2,3,4,5], 3))
[[1, 2, 3], [4, 5]]
"""
source_iter = iter(iterable)
while source_iter:
b = list(islice(source_iter, size))
if len(b) == 0:
break
yield b
class QdrantClient:
def __init__(self, host="localhost", port=6333):
self.api_client = ApiClient(
host=f"http://{host}:{port}"
)
self.openapi_client = SyncApis(self.api_client)
@classmethod
def _json_to_payload(cls, json_data, prefix="") -> Dict[str, PayloadInterface]:
"""
Function converts json data into flatten typed representation, which Qdrant is able to store
>>> QdrantClient._json_to_payload({"idx": 123})['idx'].dict()
{'type': 'integer', 'value': 123}
>>> QdrantClient._json_to_payload({"idx": 123, "data": {"hi": "there"}})['data__hi'].dict()
{'type': 'keyword', 'value': 'there'}
:param json_data: Any json data
:return: Flatten Qdrant payload. Raises exception if data is not compatible
"""
res = {}
for key, val in json_data.items():
if isinstance(val, str):
res[prefix + key] = PayloadInterfaceAnyOf(value=val, type="keyword")
if isinstance(val, int):
res[prefix + key] = PayloadInterfaceAnyOf1(value=val, type="integer")
if isinstance(val, float):
res[prefix + key] = PayloadInterfaceAnyOf2(value=val, type="float")
if isinstance(val, dict):
if 'lon' in val and 'lat' in val:
res[prefix + key] = PayloadInterfaceAnyOf3(
value=GeoPoint(lat=val['lat'], lon=val['lon']),
type="geo"
)
else:
res = {
**res,
**cls._json_to_payload(val, prefix=f"{key}__")
}
return res
@classmethod
def _payload_to_json(cls, payload: Dict[str, PayloadInterface]) -> dict:
"""
Function converts Qdrant payload into convenient json
:param payload: Payload from Qdrant
:return: Json data
"""
res = {}
for key, value_interface in payload.items():
value = value_interface.dict()['value']
if len(value) == 1:
value = value[0]
res[key] = value
return res
@property
def http(self):
return self.openapi_client
@classmethod
def _iterate_batches(cls,
vectors: np.ndarray,
payload: Optional[Iterable[dict]],
ids: Optional[Iterable[int]],
batch_size: int) -> Iterable:
num_vectors, _dim = vectors.shape
if ids is None:
ids = range(num_vectors)
ids_batches = iter_batch(ids, batch_size)
if payload is None:
payload_batches = (None for _ in count())
else:
payload = map(cls._json_to_payload, payload)
payload_batches = iter_batch(payload, batch_size)
num_batches = int(math.ceil(num_vectors / batch_size))
vector_batches = (vectors[i * batch_size:(i + 1) * batch_size].tolist() for i in range(num_batches))
yield from zip(ids_batches, vector_batches, payload_batches)
def get_payload(self, collection_name: str, ids: List[int]) -> Dict[int, dict]:
"""
Retrieve points payload by ids
:param collection_name:
:param ids: List of ids to retrieve
:return:
"""
result = {}
response = self.http.points_api.get_points(name=collection_name, point_request=PointRequest(ids=ids))
for record in response.result:
payload_json = self._payload_to_json(record.payload)
result[record.id] = payload_json
return result
def search(self,
collection_name: str,
query_vector: Union[np.ndarray, List[float]],
query_filter: Optional[Filter] = None,
search_params: Optional[SearchParams] = None,
top: int = 10,
append_payload=True):
"""
Search for closest vectors in collection taking into account filtering conditions
:param collection_name: Collection to search in
:param query_vector: Search for vectors closest to this
:param query_filter: Exclude vectors which doesn't fit this conditions
:param search_params: Additional search params
:param top: How many results return
:param append_payload: Also return found vectors payload
:return: Vector ids with score ( + payload if append_payload == True )
"""
if isinstance(query_vector, np.ndarray):
query_vector = query_vector.tolist()
search_result = self.http.points_api.search_points(
name=collection_name,
search_request=SearchRequest(
vector=query_vector,
query_filter=query_filter,
top=top,
params=search_params
)
)
if append_payload:
found_ids = [hit.id for hit in search_result.result]
payloads = self.get_payload(collection_name=collection_name, ids=found_ids)
return [
(hit, payloads.get(hit.id)) for hit in search_result.result
]
else:
return search_result.result
def recreate_collection(
self,
collection_name: str,
vector_size: int,
distance: Distance = None,
index_params: Optional[Indexes] = None):
"""
Delete and create empty collection
:param collection_name: Name of the collection to recreate
:param vector_size: Vector size of the collection
:param distance: Which metric to use, default: Dot
:param index_params: Params for collection index
:return:
"""
if distance is None:
distance = Distance.DOT
self.http.collections_api.update_collections(
storage_ops=StorageOpsAnyOf1(
delete_collection=collection_name
)
)
self.http.collections_api.update_collections(
storage_ops=StorageOpsAnyOf(
create_collection=StorageOpsAnyOfCreateCollection(
name=collection_name,
distance=distance,
vector_size=vector_size,
index=index_params
)
)
)
def upload_collection(self,
collection_name,
vectors: np.ndarray,
payload: Optional[Iterable[dict]],
ids: Optional[Iterable[int]],
batch_size: int = 64):
"""
Upload vectors and payload to the collection
:param collection_name: Name of the collection to upload to
:param vectors: np.ndarray of vectors to upload. Might be mmaped
:param payload: Iterable of vectors payload, Optional
:param ids: Iterable of custom vectors ids, Optional
:param batch_size: How much vectors upload per-request
:return:
"""
for ids_batch, vectors_batch, payload_batch in tqdm(self._iterate_batches(vectors, payload, ids, batch_size)):
self.openapi_client.points_api.update_points(
name=collection_name,
collection_update_operations=PointOpsAnyOf(
upsert_points=PointInsertOpsAnyOf(
batch=PointInsertOpsAnyOfBatch(
ids=ids_batch,
payloads=payload_batch,
vectors=vectors_batch
)
)
)
)

View File

@@ -0,0 +1,12 @@
import inspect
from pydantic import BaseModel
from qdrant_openapi_client.api_client import ApiClient, AsyncApis, SyncApis # noqa F401
from qdrant_openapi_client.models import models
for model in inspect.getmembers(models, inspect.isclass):
if model[1].__module__ == "qdrant_openapi_client.models.models":
model_class = model[1]
if issubclass(model_class, BaseModel):
model_class.update_forward_refs()

View File

View File

@@ -0,0 +1,235 @@
# flake8: noqa E501
from asyncio import get_event_loop
from enum import Enum
from pathlib import PurePath
from types import GeneratorType
from typing import TYPE_CHECKING, Any, Awaitable, Callable, Dict, List, Set, Tuple, Union
from pydantic.json import ENCODERS_BY_TYPE
from pydantic.main import BaseModel
from qdrant_openapi_client.models import models as m
SetIntStr = Set[Union[int, str]]
DictIntStrAny = Dict[Union[int, str], Any]
def generate_encoders_by_class_tuples(type_encoder_map: Dict[Any, Callable]) -> Dict[Callable, Tuple]:
encoders_by_classes: Dict[Callable, List] = {}
for type_, encoder in type_encoder_map.items():
encoders_by_classes.setdefault(encoder, []).append(type_)
encoders_by_class_tuples: Dict[Callable, Tuple] = {}
for encoder, classes in encoders_by_classes.items():
encoders_by_class_tuples[encoder] = tuple(classes)
return encoders_by_class_tuples
encoders_by_class_tuples = generate_encoders_by_class_tuples(ENCODERS_BY_TYPE)
def jsonable_encoder(
obj: Any,
include: Union[SetIntStr, DictIntStrAny] = None,
exclude=None,
by_alias: bool = True,
skip_defaults: bool = None,
exclude_unset: bool = False,
include_none: bool = True,
custom_encoder=None,
sqlalchemy_safe: bool = True,
) -> Any:
if exclude is None:
exclude = set()
if custom_encoder is None:
custom_encoder = {}
if include is not None and not isinstance(include, set):
include = set(include)
if exclude is not None and not isinstance(exclude, set):
exclude = set(exclude)
if isinstance(obj, BaseModel):
encoder = getattr(obj.Config, "json_encoders", {})
if custom_encoder:
encoder.update(custom_encoder)
obj_dict = obj.dict(
include=include,
exclude=exclude,
by_alias=by_alias,
exclude_unset=bool(exclude_unset or skip_defaults),
)
return jsonable_encoder(
obj_dict,
include_none=include_none,
custom_encoder=encoder,
sqlalchemy_safe=sqlalchemy_safe,
)
if isinstance(obj, Enum):
return obj.value
if isinstance(obj, PurePath):
return str(obj)
if isinstance(obj, (str, int, float, type(None))):
return obj
if isinstance(obj, dict):
encoded_dict = {}
for key, value in obj.items():
if (
(not sqlalchemy_safe or (not isinstance(key, str)) or (not key.startswith("_sa")))
and (value is not None or include_none)
and ((include and key in include) or key not in exclude)
):
encoded_key = jsonable_encoder(
key,
by_alias=by_alias,
exclude_unset=exclude_unset,
include_none=include_none,
custom_encoder=custom_encoder,
sqlalchemy_safe=sqlalchemy_safe,
)
encoded_value = jsonable_encoder(
value,
by_alias=by_alias,
exclude_unset=exclude_unset,
include_none=include_none,
custom_encoder=custom_encoder,
sqlalchemy_safe=sqlalchemy_safe,
)
encoded_dict[encoded_key] = encoded_value
return encoded_dict
if isinstance(obj, (list, set, frozenset, GeneratorType, tuple)):
encoded_list = []
for item in obj:
encoded_list.append(
jsonable_encoder(
item,
include=include,
exclude=exclude,
by_alias=by_alias,
exclude_unset=exclude_unset,
include_none=include_none,
custom_encoder=custom_encoder,
sqlalchemy_safe=sqlalchemy_safe,
)
)
return encoded_list
if custom_encoder:
if type(obj) in custom_encoder:
return custom_encoder[type(obj)](obj)
else:
for encoder_type, encoder in custom_encoder.items():
if isinstance(obj, encoder_type):
return encoder(obj)
if type(obj) in ENCODERS_BY_TYPE:
return ENCODERS_BY_TYPE[type(obj)](obj)
for encoder, classes_tuple in encoders_by_class_tuples.items():
if isinstance(obj, classes_tuple):
return encoder(obj)
errors: List[Exception] = []
try:
data = dict(obj)
except Exception as e:
errors.append(e)
try:
data = vars(obj)
except Exception as e:
errors.append(e)
raise ValueError(errors)
return jsonable_encoder(
data,
by_alias=by_alias,
exclude_unset=exclude_unset,
include_none=include_none,
custom_encoder=custom_encoder,
sqlalchemy_safe=sqlalchemy_safe,
)
if TYPE_CHECKING:
from qdrant_openapi_client.api_client import ApiClient
class _CollectionsApi:
def __init__(self, api_client: "ApiClient"):
self.api_client = api_client
def _build_for_get_collection(
self,
name: str,
) -> Awaitable[m.InlineResponse2002]:
path_params = {
"name": str(name),
}
return self.api_client.request(
type_=m.InlineResponse2002,
method="GET",
url="/collections/{name}",
path_params=path_params,
)
def _build_for_get_collections(
self,
) -> Awaitable[m.InlineResponse200]:
return self.api_client.request(
type_=m.InlineResponse200,
method="GET",
url="/collections",
)
def _build_for_update_collections(
self,
storage_ops: m.StorageOps = None,
) -> Awaitable[m.InlineResponse2001]:
body = jsonable_encoder(storage_ops)
return self.api_client.request(type_=m.InlineResponse2001, method="POST", url="/collections", json=body)
class AsyncCollectionsApi(_CollectionsApi):
async def get_collection(
self,
name: str,
) -> m.InlineResponse2002:
return await self._build_for_get_collection(
name=name,
)
async def get_collections(
self,
) -> m.InlineResponse200:
return await self._build_for_get_collections()
async def update_collections(
self,
storage_ops: m.StorageOps = None,
) -> m.InlineResponse2001:
return await self._build_for_update_collections(
storage_ops=storage_ops,
)
class SyncCollectionsApi(_CollectionsApi):
def get_collection(
self,
name: str,
) -> m.InlineResponse2002:
coroutine = self._build_for_get_collection(
name=name,
)
return get_event_loop().run_until_complete(coroutine)
def get_collections(
self,
) -> m.InlineResponse200:
coroutine = self._build_for_get_collections()
return get_event_loop().run_until_complete(coroutine)
def update_collections(
self,
storage_ops: m.StorageOps = None,
) -> m.InlineResponse2001:
coroutine = self._build_for_update_collections(
storage_ops=storage_ops,
)
return get_event_loop().run_until_complete(coroutine)

View File

@@ -0,0 +1,352 @@
# flake8: noqa E501
from asyncio import get_event_loop
from enum import Enum
from pathlib import PurePath
from types import GeneratorType
from typing import TYPE_CHECKING, Any, Awaitable, Callable, Dict, List, Set, Tuple, Union
from pydantic.json import ENCODERS_BY_TYPE
from pydantic.main import BaseModel
from qdrant_openapi_client.models import models as m
SetIntStr = Set[Union[int, str]]
DictIntStrAny = Dict[Union[int, str], Any]
def generate_encoders_by_class_tuples(type_encoder_map: Dict[Any, Callable]) -> Dict[Callable, Tuple]:
encoders_by_classes: Dict[Callable, List] = {}
for type_, encoder in type_encoder_map.items():
encoders_by_classes.setdefault(encoder, []).append(type_)
encoders_by_class_tuples: Dict[Callable, Tuple] = {}
for encoder, classes in encoders_by_classes.items():
encoders_by_class_tuples[encoder] = tuple(classes)
return encoders_by_class_tuples
encoders_by_class_tuples = generate_encoders_by_class_tuples(ENCODERS_BY_TYPE)
def jsonable_encoder(
obj: Any,
include: Union[SetIntStr, DictIntStrAny] = None,
exclude=None,
by_alias: bool = True,
skip_defaults: bool = None,
exclude_unset: bool = False,
include_none: bool = True,
custom_encoder=None,
sqlalchemy_safe: bool = True,
) -> Any:
if exclude is None:
exclude = set()
if custom_encoder is None:
custom_encoder = {}
if include is not None and not isinstance(include, set):
include = set(include)
if exclude is not None and not isinstance(exclude, set):
exclude = set(exclude)
if isinstance(obj, BaseModel):
encoder = getattr(obj.Config, "json_encoders", {})
if custom_encoder:
encoder.update(custom_encoder)
obj_dict = obj.dict(
include=include,
exclude=exclude,
by_alias=by_alias,
exclude_unset=bool(exclude_unset or skip_defaults),
)
return jsonable_encoder(
obj_dict,
include_none=include_none,
custom_encoder=encoder,
sqlalchemy_safe=sqlalchemy_safe,
)
if isinstance(obj, Enum):
return obj.value
if isinstance(obj, PurePath):
return str(obj)
if isinstance(obj, (str, int, float, type(None))):
return obj
if isinstance(obj, dict):
encoded_dict = {}
for key, value in obj.items():
if (
(not sqlalchemy_safe or (not isinstance(key, str)) or (not key.startswith("_sa")))
and (value is not None or include_none)
and ((include and key in include) or key not in exclude)
):
encoded_key = jsonable_encoder(
key,
by_alias=by_alias,
exclude_unset=exclude_unset,
include_none=include_none,
custom_encoder=custom_encoder,
sqlalchemy_safe=sqlalchemy_safe,
)
encoded_value = jsonable_encoder(
value,
by_alias=by_alias,
exclude_unset=exclude_unset,
include_none=include_none,
custom_encoder=custom_encoder,
sqlalchemy_safe=sqlalchemy_safe,
)
encoded_dict[encoded_key] = encoded_value
return encoded_dict
if isinstance(obj, (list, set, frozenset, GeneratorType, tuple)):
encoded_list = []
for item in obj:
encoded_list.append(
jsonable_encoder(
item,
include=include,
exclude=exclude,
by_alias=by_alias,
exclude_unset=exclude_unset,
include_none=include_none,
custom_encoder=custom_encoder,
sqlalchemy_safe=sqlalchemy_safe,
)
)
return encoded_list
if custom_encoder:
if type(obj) in custom_encoder:
return custom_encoder[type(obj)](obj)
else:
for encoder_type, encoder in custom_encoder.items():
if isinstance(obj, encoder_type):
return encoder(obj)
if type(obj) in ENCODERS_BY_TYPE:
return ENCODERS_BY_TYPE[type(obj)](obj)
for encoder, classes_tuple in encoders_by_class_tuples.items():
if isinstance(obj, classes_tuple):
return encoder(obj)
errors: List[Exception] = []
try:
data = dict(obj)
except Exception as e:
errors.append(e)
try:
data = vars(obj)
except Exception as e:
errors.append(e)
raise ValueError(errors)
return jsonable_encoder(
data,
by_alias=by_alias,
exclude_unset=exclude_unset,
include_none=include_none,
custom_encoder=custom_encoder,
sqlalchemy_safe=sqlalchemy_safe,
)
if TYPE_CHECKING:
from qdrant_openapi_client.api_client import ApiClient
class _PointsApi:
def __init__(self, api_client: "ApiClient"):
self.api_client = api_client
def _build_for_get_point(
self,
name: str,
id: int,
) -> Awaitable[m.InlineResponse2004]:
path_params = {
"name": str(name),
"id": str(id),
}
return self.api_client.request(
type_=m.InlineResponse2004,
method="GET",
url="/collections/{name}/points/{id}",
path_params=path_params,
)
def _build_for_get_points(
self,
name: str,
point_request: m.PointRequest = None,
) -> Awaitable[m.InlineResponse2005]:
path_params = {
"name": str(name),
}
body = jsonable_encoder(point_request)
return self.api_client.request(
type_=m.InlineResponse2005,
method="POST",
url="/collections/{name}/points",
path_params=path_params,
json=body,
)
def _build_for_recommend_points(
self,
name: str,
recommend_request: m.RecommendRequest = None,
) -> Awaitable[m.InlineResponse2006]:
path_params = {
"name": str(name),
}
body = jsonable_encoder(recommend_request)
return self.api_client.request(
type_=m.InlineResponse2006,
method="POST",
url="/collections/{name}/points/recommend",
path_params=path_params,
json=body,
)
def _build_for_search_points(
self,
name: str,
search_request: m.SearchRequest = None,
) -> Awaitable[m.InlineResponse2006]:
path_params = {
"name": str(name),
}
body = jsonable_encoder(search_request)
return self.api_client.request(
type_=m.InlineResponse2006,
method="POST",
url="/collections/{name}/points/search",
path_params=path_params,
json=body,
)
def _build_for_update_points(
self,
name: str,
collection_update_operations: m.CollectionUpdateOperations = None,
) -> Awaitable[m.InlineResponse2003]:
path_params = {
"name": str(name),
}
body = jsonable_encoder(collection_update_operations)
return self.api_client.request(
type_=m.InlineResponse2003, method="POST", url="/collections/{name}", path_params=path_params, json=body
)
class AsyncPointsApi(_PointsApi):
async def get_point(
self,
name: str,
id: int,
) -> m.InlineResponse2004:
return await self._build_for_get_point(
name=name,
id=id,
)
async def get_points(
self,
name: str,
point_request: m.PointRequest = None,
) -> m.InlineResponse2005:
return await self._build_for_get_points(
name=name,
point_request=point_request,
)
async def recommend_points(
self,
name: str,
recommend_request: m.RecommendRequest = None,
) -> m.InlineResponse2006:
return await self._build_for_recommend_points(
name=name,
recommend_request=recommend_request,
)
async def search_points(
self,
name: str,
search_request: m.SearchRequest = None,
) -> m.InlineResponse2006:
return await self._build_for_search_points(
name=name,
search_request=search_request,
)
async def update_points(
self,
name: str,
collection_update_operations: m.CollectionUpdateOperations = None,
) -> m.InlineResponse2003:
return await self._build_for_update_points(
name=name,
collection_update_operations=collection_update_operations,
)
class SyncPointsApi(_PointsApi):
def get_point(
self,
name: str,
id: int,
) -> m.InlineResponse2004:
coroutine = self._build_for_get_point(
name=name,
id=id,
)
return get_event_loop().run_until_complete(coroutine)
def get_points(
self,
name: str,
point_request: m.PointRequest = None,
) -> m.InlineResponse2005:
coroutine = self._build_for_get_points(
name=name,
point_request=point_request,
)
return get_event_loop().run_until_complete(coroutine)
def recommend_points(
self,
name: str,
recommend_request: m.RecommendRequest = None,
) -> m.InlineResponse2006:
coroutine = self._build_for_recommend_points(
name=name,
recommend_request=recommend_request,
)
return get_event_loop().run_until_complete(coroutine)
def search_points(
self,
name: str,
search_request: m.SearchRequest = None,
) -> m.InlineResponse2006:
coroutine = self._build_for_search_points(
name=name,
search_request=search_request,
)
return get_event_loop().run_until_complete(coroutine)
def update_points(
self,
name: str,
collection_update_operations: m.CollectionUpdateOperations = None,
) -> m.InlineResponse2003:
coroutine = self._build_for_update_points(
name=name,
collection_update_operations=collection_update_operations,
)
return get_event_loop().run_until_complete(coroutine)

View File

@@ -0,0 +1,119 @@
from asyncio import get_event_loop
from functools import lru_cache
from typing import Any, Awaitable, Callable, Dict, Generic, Type, TypeVar, overload
from httpx import AsyncClient, Request, Response
from pydantic import ValidationError
from qdrant_openapi_client.api.collections_api import AsyncCollectionsApi, SyncCollectionsApi
from qdrant_openapi_client.api.points_api import AsyncPointsApi, SyncPointsApi
from qdrant_openapi_client.exceptions import ResponseHandlingException, UnexpectedResponse
ClientT = TypeVar("ClientT", bound="ApiClient")
class AsyncApis(Generic[ClientT]):
def __init__(self, client: ClientT):
self.client = client
self.collections_api = AsyncCollectionsApi(self.client)
self.points_api = AsyncPointsApi(self.client)
class SyncApis(Generic[ClientT]):
def __init__(self, client: ClientT):
self.client = client
self.collections_api = SyncCollectionsApi(self.client)
self.points_api = SyncPointsApi(self.client)
T = TypeVar("T")
Send = Callable[[Request], Awaitable[Response]]
MiddlewareT = Callable[[Request, Send], Awaitable[Response]]
class ApiClient:
def __init__(self, host: str = None, **kwargs: Any) -> None:
self.host = host
self.middleware: MiddlewareT = BaseMiddleware()
self._async_client = AsyncClient(**kwargs)
@overload
async def request(
self, *, type_: Type[T], method: str, url: str, path_params: Dict[str, Any] = None, **kwargs: Any
) -> T:
...
@overload # noqa F811
async def request(
self, *, type_: None, method: str, url: str, path_params: Dict[str, Any] = None, **kwargs: Any
) -> None:
...
async def request( # noqa F811
self, *, type_: Any, method: str, url: str, path_params: Dict[str, Any] = None, **kwargs: Any
) -> Any:
if path_params is None:
path_params = {}
url = (self.host or "") + url.format(**path_params)
request = Request(method, url, **kwargs)
return await self.send(request, type_)
@overload
def request_sync(self, *, type_: Type[T], **kwargs: Any) -> T:
...
@overload # noqa F811
def request_sync(self, *, type_: None, **kwargs: Any) -> None:
...
def request_sync(self, *, type_: Any, **kwargs: Any) -> Any: # noqa F811
"""
This method is not used by the generated apis, but is included for convenience
"""
return get_event_loop().run_until_complete(self.request(type_=type_, **kwargs))
async def send(self, request: Request, type_: Type[T]) -> T:
response = await self.middleware(request, self.send_inner)
if response.status_code in [200, 201]:
try:
return parse_as_type(response.json(), type_)
except ValidationError as e:
raise ResponseHandlingException(e)
raise UnexpectedResponse.for_response(response)
async def send_inner(self, request: Request) -> Response:
try:
response = await self._async_client.send(request)
except Exception as e:
raise ResponseHandlingException(e)
return response
def add_middleware(self, middleware: MiddlewareT) -> None:
current_middleware = self.middleware
async def new_middleware(request: Request, call_next: Send) -> Response:
async def inner_send(request: Request) -> Response:
return await current_middleware(request, call_next)
return await middleware(request, inner_send)
self.middleware = new_middleware
class BaseMiddleware:
async def __call__(self, request: Request, call_next: Send) -> Response:
return await call_next(request)
@lru_cache(maxsize=None)
def _get_parsing_type(type_: Any, source: str) -> Any:
from pydantic.main import create_model
type_name = getattr(type_, "__name__", str(type_))
return create_model(f"ParsingModel[{type_name}] (for {source})", obj=(type_, ...))
def parse_as_type(obj: Any, type_: Type[T]) -> T:
model_type = _get_parsing_type(type_, source=parse_as_type.__name__)
return model_type(obj=obj).obj

View File

@@ -0,0 +1,17 @@
# flake8: noqa
# Import all APIs into this package.
# If you have many APIs here with many many models used in each API this may
# raise a `RecursionError`.
# In order to avoid this, import only the API that you directly need like:
#
# from .api.collections_api import CollectionsApi
#
# or import this package, but before doing it, use:
#
# import sys
# sys.setrecursionlimit(n)
# Import APIs into API package:
from qdrant_openapi_client.api.collections_api import CollectionsApi
from qdrant_openapi_client.api.points_api import PointsApi

View File

@@ -0,0 +1,5 @@
from typing import Union
# This is a dirty hack - proper way it to upgrade OpenAPI generator for at least 5.0
# But this upgrade will also require updating of all templates. Maybe some other day
AnyOfstringinteger = Union[str, int]

View File

@@ -0,0 +1,13 @@
# AliasOperations
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**create_alias** | [**AliasOperationsAnyOfCreateAlias**](AliasOperationsAnyOfCreateAlias.md) | | [optional]
**delete_alias** | [**AliasOperationsAnyOf1DeleteAlias**](AliasOperationsAnyOf1DeleteAlias.md) | | [optional]
**rename_alias** | [**AliasOperationsAnyOf2RenameAlias**](AliasOperationsAnyOf2RenameAlias.md) | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# AliasOperationsAnyOf
Create alternative name for a collection. Collection will be available under both names for search, retrieve,
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**create_alias** | [**AliasOperationsAnyOfCreateAlias**](AliasOperationsAnyOfCreateAlias.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# AliasOperationsAnyOf1
Delete alias if exists
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**delete_alias** | [**AliasOperationsAnyOf1DeleteAlias**](AliasOperationsAnyOf1DeleteAlias.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# AliasOperationsAnyOf1DeleteAlias
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**alias_name** | **str** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# AliasOperationsAnyOf2
Change alias to a new one
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**rename_alias** | [**AliasOperationsAnyOf2RenameAlias**](AliasOperationsAnyOf2RenameAlias.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# AliasOperationsAnyOf2RenameAlias
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**new_alias_name** | **str** | |
**old_alias_name** | **str** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# AliasOperationsAnyOfCreateAlias
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**alias_name** | **str** | |
**collection_name** | **str** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# CollectionDescription
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,15 @@
# CollectionInfo
Current statistics and configuration of the collection.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**config** | [**SegmentConfig**](SegmentConfig.md) | |
**disk_data_size** | **int** | Disk space, used by collection |
**ram_data_size** | **int** | RAM used by collection |
**segments_count** | **int** | Number of segments in collection |
**vectors_count** | **int** | Number of vectors in collection |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,15 @@
# CollectionUpdateOperations
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**upsert_points** | [**PointInsertOps**](PointInsertOps.md) | | [optional]
**delete_points** | [**PointOpsAnyOf1DeletePoints**](PointOpsAnyOf1DeletePoints.md) | | [optional]
**set_payload** | [**PayloadOpsAnyOfSetPayload**](PayloadOpsAnyOfSetPayload.md) | | [optional]
**delete_payload** | [**PayloadOpsAnyOf1DeletePayload**](PayloadOpsAnyOf1DeletePayload.md) | | [optional]
**clear_payload** | [**PayloadOpsAnyOf2ClearPayload**](PayloadOpsAnyOf2ClearPayload.md) | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,198 @@
# qdrant_openapi_client.CollectionsApi
All URIs are relative to *http://localhost:6333*
Method | HTTP request | Description
------------- | ------------- | -------------
[**get_collection**](CollectionsApi.md#get_collection) | **GET** /collections/{name} | Get information about existing collection
[**get_collections**](CollectionsApi.md#get_collections) | **GET** /collections | Get list of existing collections
[**update_collections**](CollectionsApi.md#update_collections) | **POST** /collections | Perform update operation on collections
# **get_collection**
> InlineResponse2002 get_collection(name)
Get information about existing collection
### Example
```python
import time
import qdrant_openapi_client
from qdrant_openapi_client.api import collections_api
from qdrant_openapi_client.model.error_response import ErrorResponse
from qdrant_openapi_client.model.inline_response2002 import InlineResponse2002
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:6333
# See configuration.py for a list of all supported configuration parameters.
configuration = qdrant_openapi_client.Configuration(
host = "http://localhost:6333"
)
# Enter a context with an instance of the API client
with qdrant_openapi_client.ApiClient() as api_client:
# Create an instance of the API class
api_instance = collections_api.CollectionsApi(api_client)
name = "name_example" # str | Name of the collection to retrieve
# example passing only required values which don't have defaults set
try:
# Get information about existing collection
api_response = api_instance.get_collection(name)
pprint(api_response)
except qdrant_openapi_client.ApiException as e:
print("Exception when calling CollectionsApi->get_collection: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name** | **str**| Name of the collection to retrieve |
### Return type
[**InlineResponse2002**](InlineResponse2002.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | successful operation | - |
**0** | error | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_collections**
> InlineResponse200 get_collections()
Get list of existing collections
### Example
```python
import time
import qdrant_openapi_client
from qdrant_openapi_client.api import collections_api
from qdrant_openapi_client.model.inline_response200 import InlineResponse200
from qdrant_openapi_client.model.error_response import ErrorResponse
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:6333
# See configuration.py for a list of all supported configuration parameters.
configuration = qdrant_openapi_client.Configuration(
host = "http://localhost:6333"
)
# Enter a context with an instance of the API client
with qdrant_openapi_client.ApiClient() as api_client:
# Create an instance of the API class
api_instance = collections_api.CollectionsApi(api_client)
# example, this endpoint has no required or optional parameters
try:
# Get list of existing collections
api_response = api_instance.get_collections()
pprint(api_response)
except qdrant_openapi_client.ApiException as e:
print("Exception when calling CollectionsApi->get_collections: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**InlineResponse200**](InlineResponse200.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | successful operation | - |
**0** | error | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **update_collections**
> InlineResponse2001 update_collections()
Perform update operation on collections
### Example
```python
import time
import qdrant_openapi_client
from qdrant_openapi_client.api import collections_api
from qdrant_openapi_client.model.inline_response2001 import InlineResponse2001
from qdrant_openapi_client.model.storage_ops import StorageOps
from qdrant_openapi_client.model.error_response import ErrorResponse
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:6333
# See configuration.py for a list of all supported configuration parameters.
configuration = qdrant_openapi_client.Configuration(
host = "http://localhost:6333"
)
# Enter a context with an instance of the API client
with qdrant_openapi_client.ApiClient() as api_client:
# Create an instance of the API class
api_instance = collections_api.CollectionsApi(api_client)
storage_ops = StorageOps() # StorageOps | Operation to perform on collections (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
# Perform update operation on collections
api_response = api_instance.update_collections(storage_ops=storage_ops)
pprint(api_response)
except qdrant_openapi_client.ApiException as e:
print("Exception when calling CollectionsApi->update_collections: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**storage_ops** | [**StorageOps**](StorageOps.md)| Operation to perform on collections | [optional]
### Return type
[**InlineResponse2001**](InlineResponse2001.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | successful operation | - |
**0** | error | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# CollectionsResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**collections** | [**[CollectionDescription]**](CollectionDescription.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,16 @@
# Condition
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**filter** | [**Filter**](Filter.md) | | [optional]
**match** | [**Match**](Match.md) | | [optional]
**range** | [**Range**](Range.md) | | [optional]
**geo_bounding_box** | [**GeoBoundingBox**](GeoBoundingBox.md) | | [optional]
**geo_radius** | [**GeoRadius**](GeoRadius.md) | | [optional]
**has_id** | **[int]** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# ConditionAnyOf
Nested filter
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**filter** | [**Filter**](Filter.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# ConditionAnyOf1
Check if point has field with a given value
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**match** | [**Match**](Match.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# ConditionAnyOf2
Check if points value lies in a given range
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**range** | [**Range**](Range.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# ConditionAnyOf3
Check if points geo location lies in a given area
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**geo_bounding_box** | [**GeoBoundingBox**](GeoBoundingBox.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# ConditionAnyOf4
Check if geo point is within a given radius
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**geo_radius** | [**GeoRadius**](GeoRadius.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# ConditionAnyOf5
Check if points id is in a given set
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**has_id** | **[int]** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# Distance
Type of internal tags, build from payload Distance function types used to compare vectors
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | **str** | Type of internal tags, build from payload Distance function types used to compare vectors | must be one of ["Cosine", "Euclid", "Dot", ]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# ErrorResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**time** | **float** | Time spent to process this request | [optional]
**status** | [**ErrorResponseStatus**](ErrorResponseStatus.md) | | [optional]
**result** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# ErrorResponseStatus
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**error** | **str** | Description of the occurred error. | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# Filter
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**must** | [**[Condition], none_type**](Condition.md) | All conditions must match | [optional]
**must_not** | [**[Condition], none_type**](Condition.md) | All conditions must NOT match | [optional]
**should** | [**[Condition], none_type**](Condition.md) | At least one of thous conditions should match | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# GeoBoundingBox
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**bottom_right** | [**GeoPoint**](GeoPoint.md) | |
**key** | **str** | Name of the field to match with |
**top_left** | [**GeoPoint**](GeoPoint.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# GeoPoint
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**lat** | **float** | |
**lon** | **float** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# GeoRadius
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**center** | [**GeoPoint**](GeoPoint.md) | |
**key** | **str** | Name of the field to match with |
**radius** | **float** | Radius of the area in meters |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# Indexes
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**options** | [**IndexesAnyOf1Options**](IndexesAnyOf1Options.md) | | [optional]
**type** | **str** | | [optional] if omitted the server will use the default value of "hnsw"
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# IndexesAnyOf
Do not use any index, scan whole vector collection during search. Guarantee 100% precision, but may be time consuming on large collections.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**options** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | |
**type** | **str** | | defaults to "plain"
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# IndexesAnyOf1
Use filterable HNSW index for approximate search. Is very fast even on a very huge collections, but require additional space to store index and additional time to build it.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**options** | [**IndexesAnyOf1Options**](IndexesAnyOf1Options.md) | |
**type** | **str** | | defaults to "hnsw"
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# IndexesAnyOf1Options
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ef_construct** | **int** | Number of neighbours to consider during the index building. Larger the value - more accurate the search, more time required to build index. |
**m** | **int** | Number of edges per node in the index graph. Larger the value - more accurate the search, more space required. |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# InlineResponse200
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**time** | **float** | Time spent to process this request | [optional]
**status** | **str** | | [optional] if omitted the server will use the default value of "ok"
**result** | [**CollectionsResponse**](CollectionsResponse.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# InlineResponse2001
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**time** | **float** | Time spent to process this request | [optional]
**status** | **str** | | [optional] if omitted the server will use the default value of "ok"
**result** | **bool** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# InlineResponse2002
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**time** | **float** | Time spent to process this request | [optional]
**status** | **str** | | [optional] if omitted the server will use the default value of "ok"
**result** | [**CollectionInfo**](CollectionInfo.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# InlineResponse2003
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**time** | **float** | Time spent to process this request | [optional]
**status** | **str** | | [optional] if omitted the server will use the default value of "ok"
**result** | [**UpdateResult**](UpdateResult.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# InlineResponse2004
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**time** | **float** | Time spent to process this request | [optional]
**status** | **str** | | [optional] if omitted the server will use the default value of "ok"
**result** | [**Record**](Record.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# InlineResponse2005
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**time** | **float** | Time spent to process this request | [optional]
**status** | **str** | | [optional] if omitted the server will use the default value of "ok"
**result** | [**[Record]**](Record.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# InlineResponse2006
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**time** | **float** | Time spent to process this request | [optional]
**status** | **str** | | [optional] if omitted the server will use the default value of "ok"
**result** | [**[ScoredPoint]**](ScoredPoint.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# Match
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**key** | **str** | Name of the field to match with |
**integer** | **int, none_type** | Integer value to match | [optional]
**keyword** | **str, none_type** | Keyword value to match | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# PayloadInterface
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **str** | | [optional] if omitted the server will use the default value of "geo"
**value** | [**PayloadVariantForGeoPoint**](PayloadVariantForGeoPoint.md) | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# PayloadInterfaceAnyOf
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | [**PayloadVariantForString**](PayloadVariantForString.md) | |
**type** | **str** | | defaults to "keyword"
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# PayloadInterfaceAnyOf1
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | [**PayloadVariantForInt64**](PayloadVariantForInt64.md) | |
**type** | **str** | | defaults to "integer"
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# PayloadInterfaceAnyOf2
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | [**PayloadVariantForDouble**](PayloadVariantForDouble.md) | |
**type** | **str** | | defaults to "float"
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# PayloadInterfaceAnyOf3
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | [**PayloadVariantForGeoPoint**](PayloadVariantForGeoPoint.md) | |
**type** | **str** | | defaults to "geo"
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,14 @@
# PayloadOps
Define operations description for point payloads manipulation
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**set_payload** | [**PayloadOpsAnyOfSetPayload**](PayloadOpsAnyOfSetPayload.md) | | [optional]
**delete_payload** | [**PayloadOpsAnyOf1DeletePayload**](PayloadOpsAnyOf1DeletePayload.md) | | [optional]
**clear_payload** | [**PayloadOpsAnyOf2ClearPayload**](PayloadOpsAnyOf2ClearPayload.md) | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# PayloadOpsAnyOf
Set payload value, overrides if it is already exists
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**set_payload** | [**PayloadOpsAnyOfSetPayload**](PayloadOpsAnyOfSetPayload.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# PayloadOpsAnyOf1
Deletes specified payload values if they are assigned
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**delete_payload** | [**PayloadOpsAnyOf1DeletePayload**](PayloadOpsAnyOf1DeletePayload.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# PayloadOpsAnyOf1DeletePayload
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**keys** | **[str]** | |
**points** | **[int]** | Deletes values from each point in this list |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# PayloadOpsAnyOf2
Drops all Payload values associated with given points.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**clear_payload** | [**PayloadOpsAnyOf2ClearPayload**](PayloadOpsAnyOf2ClearPayload.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# PayloadOpsAnyOf2ClearPayload
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**points** | **[int]** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# PayloadOpsAnyOfSetPayload
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**payload** | [**{str: (PayloadInterface,)}**](PayloadInterface.md) | |
**points** | **[int]** | Assigns payload to each point in this list |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# PayloadType
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **str** | | [optional] if omitted the server will use the default value of "geo"
**value** | [**[GeoPoint]**](GeoPoint.md) | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# PayloadTypeAnyOf
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | **[str]** | |
**type** | **str** | | defaults to "keyword"
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# PayloadTypeAnyOf1
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | **[int]** | |
**type** | **str** | | defaults to "integer"
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# PayloadTypeAnyOf2
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | **[float]** | |
**type** | **str** | | defaults to "float"
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# PayloadTypeAnyOf3
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | [**[GeoPoint]**](GeoPoint.md) | |
**type** | **str** | | defaults to "geo"
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# PayloadVariantForDouble
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# PayloadVariantForGeoPoint
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**lat** | **float** | | [optional]
**lon** | **float** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# PayloadVariantForInt64
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# PayloadVariantForString
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# PointInsertOps
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**batch** | [**PointInsertOpsAnyOfBatch**](PointInsertOpsAnyOfBatch.md) | | [optional]
**points** | [**[PointStruct]**](PointStruct.md) | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# PointInsertOpsAnyOf
Inset points from a batch.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**batch** | [**PointInsertOpsAnyOfBatch**](PointInsertOpsAnyOfBatch.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# PointInsertOpsAnyOf1
Insert points from a list
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**points** | [**[PointStruct]**](PointStruct.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# PointInsertOpsAnyOfBatch
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ids** | **[int]** | |
**vectors** | **[[float]]** | |
**payloads** | [**[{str: (PayloadInterface,)}, none_type], none_type**](PayloadInterface.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# PointOps
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**upsert_points** | [**PointInsertOps**](PointInsertOps.md) | | [optional]
**delete_points** | [**PointOpsAnyOf1DeletePoints**](PointOpsAnyOf1DeletePoints.md) | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# PointOpsAnyOf
Insert or update points
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**upsert_points** | [**PointInsertOps**](PointInsertOps.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# PointOpsAnyOf1
Delete point if exists
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**delete_points** | [**PointOpsAnyOf1DeletePoints**](PointOpsAnyOf1DeletePoints.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# PointOpsAnyOf1DeletePoints
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ids** | **[int]** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# PointRequest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ids** | **[int]** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# PointStruct
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | Point id |
**vector** | **[float]** | Vector |
**payload** | [**{str: (PayloadInterface,)}, none_type**](PayloadInterface.md) | Payload values (optional) | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,399 @@
# qdrant_openapi_client.PointsApi
All URIs are relative to *http://localhost:6333*
Method | HTTP request | Description
------------- | ------------- | -------------
[**get_point**](PointsApi.md#get_point) | **GET** /collections/{name}/points/{id} | Retrieve point by id
[**get_points**](PointsApi.md#get_points) | **POST** /collections/{name}/points | Retrieve points by ids
[**recommend_points**](PointsApi.md#recommend_points) | **POST** /collections/{name}/points/recommend | Recommend points
[**search_points**](PointsApi.md#search_points) | **POST** /collections/{name}/points/search | Search points
[**update_points**](PointsApi.md#update_points) | **POST** /collections/{name} | Update points in collection
# **get_point**
> InlineResponse2004 get_point(name, id)
Retrieve point by id
### Example
```python
import time
import qdrant_openapi_client
from qdrant_openapi_client.api import points_api
from qdrant_openapi_client.model.inline_response2004 import InlineResponse2004
from qdrant_openapi_client.model.error_response import ErrorResponse
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:6333
# See configuration.py for a list of all supported configuration parameters.
configuration = qdrant_openapi_client.Configuration(
host = "http://localhost:6333"
)
# Enter a context with an instance of the API client
with qdrant_openapi_client.ApiClient() as api_client:
# Create an instance of the API class
api_instance = points_api.PointsApi(api_client)
name = "name_example" # str | Name of the collection to retrieve from
id = 1 # int | Id of the point
# example passing only required values which don't have defaults set
try:
# Retrieve point by id
api_response = api_instance.get_point(name, id)
pprint(api_response)
except qdrant_openapi_client.ApiException as e:
print("Exception when calling PointsApi->get_point: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name** | **str**| Name of the collection to retrieve from |
**id** | **int**| Id of the point |
### Return type
[**InlineResponse2004**](InlineResponse2004.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | successful operation | - |
**0** | error | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_points**
> InlineResponse2005 get_points(name)
Retrieve points by ids
### Example
```python
import time
import qdrant_openapi_client
from qdrant_openapi_client.api import points_api
from qdrant_openapi_client.model.point_request import PointRequest
from qdrant_openapi_client.model.inline_response2005 import InlineResponse2005
from qdrant_openapi_client.model.error_response import ErrorResponse
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:6333
# See configuration.py for a list of all supported configuration parameters.
configuration = qdrant_openapi_client.Configuration(
host = "http://localhost:6333"
)
# Enter a context with an instance of the API client
with qdrant_openapi_client.ApiClient() as api_client:
# Create an instance of the API class
api_instance = points_api.PointsApi(api_client)
name = "name_example" # str | Name of the collection to retrieve from
point_request = PointRequest(
ids=[
0,
],
) # PointRequest | List of points to retrieve (optional)
# example passing only required values which don't have defaults set
try:
# Retrieve points by ids
api_response = api_instance.get_points(name)
pprint(api_response)
except qdrant_openapi_client.ApiException as e:
print("Exception when calling PointsApi->get_points: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
# Retrieve points by ids
api_response = api_instance.get_points(name, point_request=point_request)
pprint(api_response)
except qdrant_openapi_client.ApiException as e:
print("Exception when calling PointsApi->get_points: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name** | **str**| Name of the collection to retrieve from |
**point_request** | [**PointRequest**](PointRequest.md)| List of points to retrieve | [optional]
### Return type
[**InlineResponse2005**](InlineResponse2005.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | successful operation | - |
**0** | error | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **recommend_points**
> InlineResponse2006 recommend_points(name)
Recommend points
### Example
```python
import time
import qdrant_openapi_client
from qdrant_openapi_client.api import points_api
from qdrant_openapi_client.model.recommend_request import RecommendRequest
from qdrant_openapi_client.model.inline_response2006 import InlineResponse2006
from qdrant_openapi_client.model.error_response import ErrorResponse
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:6333
# See configuration.py for a list of all supported configuration parameters.
configuration = qdrant_openapi_client.Configuration(
host = "http://localhost:6333"
)
# Enter a context with an instance of the API client
with qdrant_openapi_client.ApiClient() as api_client:
# Create an instance of the API class
api_instance = points_api.PointsApi(api_client)
name = "name_example" # str | Name of the collection to search in
recommend_request = RecommendRequest(
filter=,
negative=[
0,
],
params=,
positive=[
0,
],
top=0,
) # RecommendRequest | Request points based on positive and negative examples. (optional)
# example passing only required values which don't have defaults set
try:
# Recommend points
api_response = api_instance.recommend_points(name)
pprint(api_response)
except qdrant_openapi_client.ApiException as e:
print("Exception when calling PointsApi->recommend_points: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
# Recommend points
api_response = api_instance.recommend_points(name, recommend_request=recommend_request)
pprint(api_response)
except qdrant_openapi_client.ApiException as e:
print("Exception when calling PointsApi->recommend_points: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name** | **str**| Name of the collection to search in |
**recommend_request** | [**RecommendRequest**](RecommendRequest.md)| Request points based on positive and negative examples. | [optional]
### Return type
[**InlineResponse2006**](InlineResponse2006.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | successful operation | - |
**0** | error | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **search_points**
> InlineResponse2006 search_points(name)
Search points
### Example
```python
import time
import qdrant_openapi_client
from qdrant_openapi_client.api import points_api
from qdrant_openapi_client.model.inline_response2006 import InlineResponse2006
from qdrant_openapi_client.model.search_request import SearchRequest
from qdrant_openapi_client.model.error_response import ErrorResponse
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:6333
# See configuration.py for a list of all supported configuration parameters.
configuration = qdrant_openapi_client.Configuration(
host = "http://localhost:6333"
)
# Enter a context with an instance of the API client
with qdrant_openapi_client.ApiClient() as api_client:
# Create an instance of the API class
api_instance = points_api.PointsApi(api_client)
name = "name_example" # str | Name of the collection to search in
search_request = SearchRequest(
filter=,
params=,
top=0,
vector=[
3.14,
],
) # SearchRequest | Search request with optional filtering (optional)
# example passing only required values which don't have defaults set
try:
# Search points
api_response = api_instance.search_points(name)
pprint(api_response)
except qdrant_openapi_client.ApiException as e:
print("Exception when calling PointsApi->search_points: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
# Search points
api_response = api_instance.search_points(name, search_request=search_request)
pprint(api_response)
except qdrant_openapi_client.ApiException as e:
print("Exception when calling PointsApi->search_points: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name** | **str**| Name of the collection to search in |
**search_request** | [**SearchRequest**](SearchRequest.md)| Search request with optional filtering | [optional]
### Return type
[**InlineResponse2006**](InlineResponse2006.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | successful operation | - |
**0** | error | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **update_points**
> InlineResponse2003 update_points(name)
Update points in collection
### Example
```python
import time
import qdrant_openapi_client
from qdrant_openapi_client.api import points_api
from qdrant_openapi_client.model.inline_response2003 import InlineResponse2003
from qdrant_openapi_client.model.error_response import ErrorResponse
from qdrant_openapi_client.model.collection_update_operations import CollectionUpdateOperations
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:6333
# See configuration.py for a list of all supported configuration parameters.
configuration = qdrant_openapi_client.Configuration(
host = "http://localhost:6333"
)
# Enter a context with an instance of the API client
with qdrant_openapi_client.ApiClient() as api_client:
# Create an instance of the API class
api_instance = points_api.PointsApi(api_client)
name = "name_example" # str | Name of the collection to search in
collection_update_operations = CollectionUpdateOperations() # CollectionUpdateOperations | Points update operations (optional)
# example passing only required values which don't have defaults set
try:
# Update points in collection
api_response = api_instance.update_points(name)
pprint(api_response)
except qdrant_openapi_client.ApiException as e:
print("Exception when calling PointsApi->update_points: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
# Update points in collection
api_response = api_instance.update_points(name, collection_update_operations=collection_update_operations)
pprint(api_response)
except qdrant_openapi_client.ApiException as e:
print("Exception when calling PointsApi->update_points: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name** | **str**| Name of the collection to search in |
**collection_update_operations** | [**CollectionUpdateOperations**](CollectionUpdateOperations.md)| Points update operations | [optional]
### Return type
[**InlineResponse2003**](InlineResponse2003.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | successful operation | - |
**0** | error | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@@ -0,0 +1,14 @@
# Range
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**key** | **str** | Name of the field to match with |
**gt** | **float, none_type** | point.key &gt; range.gt | [optional]
**gte** | **float, none_type** | point.key &gt;&#x3D; range.gte | [optional]
**lt** | **float, none_type** | point.key &lt; range.lt | [optional]
**lte** | **float, none_type** | point.key &lt;&#x3D; range.lte | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,15 @@
# RecommendRequest
Search request
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**negative** | **[int]** | Try to avoid vectors like this |
**positive** | **[int]** | Look for vectors closest to those |
**top** | **int** | Max number of result to return |
**filter** | **object** | Look only for points which satisfies this conditions | [optional]
**params** | **object** | Additional search params | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,13 @@
# Record
Point data
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | Id of the point |
**payload** | [**{str: (PayloadType,)}, none_type**](PayloadType.md) | Payload - values assigned to the point | [optional]
**vector** | **[float], none_type** | Vector of the point | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# ScoredPoint
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | Point id |
**score** | **float** | Points vector distance to the query vector |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# SearchParams
Additional parameters of the search
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**hnsw** | [**SearchParamsAnyOfHnsw**](SearchParamsAnyOfHnsw.md) | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# SearchParamsAnyOf
Params relevant to HNSW index
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**hnsw** | [**SearchParamsAnyOfHnsw**](SearchParamsAnyOfHnsw.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# SearchParamsAnyOfHnsw
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ef** | **int** | Size of the beam in a beam-search. Larger the value - more accurate the result, more time required for search. |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,14 @@
# SearchRequest
Search request
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**top** | **int** | Max number of result to return |
**vector** | **[float]** | Look for vectors closest to this |
**filter** | **object** | Look only for points which satisfies this conditions | [optional]
**params** | **object** | Additional search params | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,13 @@
# SegmentConfig
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**distance** | [**Distance**](Distance.md) | |
**index** | [**Indexes**](Indexes.md) | |
**storage_type** | [**StorageType**](StorageType.md) | |
**vector_size** | **int** | Size of a vectors used |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,13 @@
# StorageOps
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**create_collection** | [**StorageOpsAnyOfCreateCollection**](StorageOpsAnyOfCreateCollection.md) | | [optional]
**delete_collection** | **str** | | [optional]
**change_aliases** | [**StorageOpsAnyOf2ChangeAliases**](StorageOpsAnyOf2ChangeAliases.md) | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# StorageOpsAnyOf
Create new collection and (optionally) specify index params
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**create_collection** | [**StorageOpsAnyOfCreateCollection**](StorageOpsAnyOfCreateCollection.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# StorageOpsAnyOf1
Delete collection with given name
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**delete_collection** | **str** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# StorageOpsAnyOf2
Perform changes of collection aliases Alias changes are atomic, meaning that no collection modifications can happen between alias operations
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**change_aliases** | [**StorageOpsAnyOf2ChangeAliases**](StorageOpsAnyOf2ChangeAliases.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# StorageOpsAnyOf2ChangeAliases
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**actions** | [**[AliasOperations]**](AliasOperations.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,13 @@
# StorageOpsAnyOfCreateCollection
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**distance** | [**Distance**](Distance.md) | |
**name** | **str** | |
**vector_size** | **int** | |
**index** | **object** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# StorageType
Type of vector storage
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **str** | | [optional] if omitted the server will use the default value of "mmap"
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# StorageTypeAnyOf
Store vectors in memory and use persistence storage only if vectors are changed
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **str** | | defaults to "in_memory"
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Some files were not shown because too many files have changed in this diff Show More