Home / Function/ test_qdrant_aadd_texts_stores_ids() — langchain Function Reference

test_qdrant_aadd_texts_stores_ids() — langchain Function Reference

Architecture documentation for the test_qdrant_aadd_texts_stores_ids() function in test_add_texts.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  81fc9be4_52c1_c7f4_47cb_44f1a82ffdfc["test_qdrant_aadd_texts_stores_ids()"]
  fa987b47_f67d_62d0_09e8_08022f943abe["test_add_texts.py"]
  81fc9be4_52c1_c7f4_47cb_44f1a82ffdfc -->|defined in| fa987b47_f67d_62d0_09e8_08022f943abe
  style 81fc9be4_52c1_c7f4_47cb_44f1a82ffdfc fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/qdrant/tests/integration_tests/async_api/test_add_texts.py lines 63–92

async def test_qdrant_aadd_texts_stores_ids(
    batch_size: int, qdrant_location: str
) -> None:
    """Test end to end Qdrant.aadd_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(location=qdrant_location, api_key=API_KEY)
    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 = await vec_store.aadd_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

Frequently Asked Questions

What does test_qdrant_aadd_texts_stores_ids() do?
test_qdrant_aadd_texts_stores_ids() is a function in the langchain codebase, defined in libs/partners/qdrant/tests/integration_tests/async_api/test_add_texts.py.
Where is test_qdrant_aadd_texts_stores_ids() defined?
test_qdrant_aadd_texts_stores_ids() is defined in libs/partners/qdrant/tests/integration_tests/async_api/test_add_texts.py at line 63.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free