mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-05 02:48:30 +02:00
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
36 lines
850 B
Python
36 lines
850 B
Python
from qdrant_client import QdrantClient, models # @hide
|
|
|
|
client = QdrantClient(url="http://localhost:6333") # @hide
|
|
|
|
client.upsert(
|
|
collection_name="documents",
|
|
points=[
|
|
models.PointStruct(
|
|
id=200,
|
|
vector={},
|
|
payload={"title": "Document A", "text": "This is document A"},
|
|
),
|
|
models.PointStruct(
|
|
id=201,
|
|
vector={},
|
|
payload={"title": "Document B", "text": "This is document B"},
|
|
),
|
|
],
|
|
)
|
|
|
|
client.upsert(
|
|
collection_name="chunks",
|
|
points=[
|
|
models.PointStruct(
|
|
id=0,
|
|
vector=[0.1, 0.2, 0.3, 0.4],
|
|
payload={"document_id": 200},
|
|
),
|
|
models.PointStruct(
|
|
id=1,
|
|
vector=[0.5, 0.6, 0.7, 0.8],
|
|
payload={"document_id": 201},
|
|
),
|
|
],
|
|
)
|