test_qdrant_add_texts_stores_ids() — langchain Function Reference
Architecture documentation for the test_qdrant_add_texts_stores_ids() function in test_add_texts.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 8e75dcf2_f139_0400_4b54_3f9986ad42d9["test_qdrant_add_texts_stores_ids()"] 9c6f5a1c_a52c_4c96_0ca9_eedd81e9cd50["test_add_texts.py"] 8e75dcf2_f139_0400_4b54_3f9986ad42d9 -->|defined in| 9c6f5a1c_a52c_4c96_0ca9_eedd81e9cd50 style 8e75dcf2_f139_0400_4b54_3f9986ad42d9 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/qdrant/tests/integration_tests/test_add_texts.py lines 82–107
def test_qdrant_add_texts_stores_ids(batch_size: int) -> None:
"""Test end to end Qdrant.add_texts stores provided ids."""
from qdrant_client import QdrantClient
from qdrant_client.http import models as rest
ids = [
"fa38d572-4c31-4579-aedc-1960d79df6df",
"cdc1aa36-d6ab-4fb2-8a94-56674fd27484",
]
client = QdrantClient(":memory:")
collection_name = uuid.uuid4().hex
client.recreate_collection(
collection_name,
vectors_config=rest.VectorParams(size=10, distance=rest.Distance.COSINE),
)
vec_store = Qdrant(client, collection_name, ConsistentFakeEmbeddings())
returned_ids = vec_store.add_texts(["abc", "def"], ids=ids, batch_size=batch_size)
assert all(
first == second for first, second in zip(ids, returned_ids, strict=False)
)
assert client.count(collection_name).count == 2
stored_ids = [point.id for point in client.scroll(collection_name)[0]]
assert set(ids) == set(stored_ids)
Domain
Subdomains
Source
Frequently Asked Questions
What does test_qdrant_add_texts_stores_ids() do?
test_qdrant_add_texts_stores_ids() is a function in the langchain codebase, defined in libs/partners/qdrant/tests/integration_tests/test_add_texts.py.
Where is test_qdrant_add_texts_stores_ids() defined?
test_qdrant_add_texts_stores_ids() is defined in libs/partners/qdrant/tests/integration_tests/test_add_texts.py at line 82.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free