qdrant-clients-sdk
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseQdrant Clients SDK
Qdrant 客户端SDK
Qdrant has the following officially supported client SDKs:
- Python — qdrant-client · Installation:
pip install qdrant-client[fastembed] - JavaScript / TypeScript — qdrant-js · Installation:
npm install @qdrant/js-client-rest - Rust — rust-client · Installation:
cargo add qdrant-client - Go — go-client · Installation:
go get github.com/qdrant/go-client - .NET — qdrant-dotnet · Installation:
dotnet add package Qdrant.Client - Java — java-client · Available on Maven Central: https://central.sonatype.com/artifact/io.qdrant/client
Qdrant官方支持以下客户端SDK:
- Python — qdrant-client · 安装命令:
pip install qdrant-client[fastembed] - JavaScript / TypeScript — qdrant-js · 安装命令:
npm install @qdrant/js-client-rest - Rust — rust-client · 安装命令:
cargo add qdrant-client - Go — go-client · 安装命令:
go get github.com/qdrant/go-client - .NET — qdrant-dotnet · 安装命令:
dotnet add package Qdrant.Client - Java — java-client · 已发布至Maven中央仓库:https://central.sonatype.com/artifact/io.qdrant/client
API Reference
API 参考
All interaction with Qdrant can happen through the REST API or gRPC API. We recommend using the REST API if you are using Qdrant for the first time or working on a prototype.
- REST API - OpenAPI Reference - GitHub
- gRPC API - gRPC protobuf definitions
所有与Qdrant的交互都可以通过REST API或gRPC API完成。如果你是首次使用Qdrant或者正在开发原型,我们推荐使用REST API。
- REST API - OpenAPI 参考 - GitHub
- gRPC API - gRPC protobuf 定义
Code examples
代码示例
To obtain code examples for a specific client and use case, you can send a search request to the library of curated code snippets for the Qdrant client.
bash
curl -X GET "https://snippets.qdrant.tech/search?language=python&query=how+to+upload+points"Available languages: , , , , ,
pythontypescriptrustjavagocsharpResponse example:
markdown
undefined要获取特定客户端和使用场景的代码示例,你可以向Qdrant客户端精选代码片段库发送搜索请求。
bash
curl -X GET "https://snippets.qdrant.tech/search?language=python&query=how+to+upload+points"支持的语言:, , , , ,
pythontypescriptrustjavagocsharp响应示例:
markdown
undefinedSnippet 1
片段 1
qdrant-client (vlatest) — https://search.qdrant.tech/md/documentation/manage-data/points/
Uploads multiple vector-embedded points to a Qdrant collection using the Python qdrant_client (PointStruct) with id, payload (e.g., color), and a 3D-like vector for similarity search. It supports parallel uploads (parallel=4) and a retry policy (max_retries=3) for robust indexing. The operation is idempotent: re-uploading with the same id overwrites existing points; if ids aren’t provided, Qdrant auto-generates UUIDs.
client.upload_points(
collection_name="{collection_name}",
points=[
models.PointStruct(
id=1,
payload={
"color": "red",
},
vector=[0.9, 0.1, 0.1],
),
models.PointStruct(
id=2,
payload={
"color": "green",
},
vector=[0.1, 0.9, 0.1],
),
],
parallel=4,
max_retries=3,
)
Default response format is markdown, if snippet output is required in JSON format, you can add `&format=json` to the query string.qdrant-client (最新版本) — https://search.qdrant.tech/md/documentation/manage-data/points/
使用Python qdrant_client (PointStruct) 向Qdrant集合上传多个带向量嵌入的点,包含id、payload(例如颜色)以及用于相似性搜索的类3D向量。它支持并行上传(parallel=4)和重试策略(max_retries=3),保障索引稳定性。该操作是幂等的:使用相同id重新上传会覆盖现有点;如果未提供id,Qdrant会自动生成UUID。
client.upload_points(
collection_name="{collection_name}",
points=[
models.PointStruct(
id=1,
payload={
"color": "red",
},
vector=[0.9, 0.1, 0.1],
),
models.PointStruct(
id=2,
payload={
"color": "green",
},
vector=[0.1, 0.9, 0.1],
),
],
parallel=4,
max_retries=3,
)
默认响应格式为markdown,如果你需要JSON格式的片段输出,可以在查询字符串中添加`&format=json`参数。