Home / Function/ test_qdrant_add_documents_extends_existing_collection() — langchain Function Reference

test_qdrant_add_documents_extends_existing_collection() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  b2afe049_603c_9674_6249_09c21168a6b6["test_qdrant_add_documents_extends_existing_collection()"]
  9c6f5a1c_a52c_4c96_0ca9_eedd81e9cd50["test_add_texts.py"]
  b2afe049_603c_9674_6249_09c21168a6b6 -->|defined in| 9c6f5a1c_a52c_4c96_0ca9_eedd81e9cd50
  style b2afe049_603c_9674_6249_09c21168a6b6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/qdrant/tests/integration_tests/test_add_texts.py lines 17–38

def test_qdrant_add_documents_extends_existing_collection(
    batch_size: int, vector_name: str | None
) -> None:
    """Test end to end construction and search."""
    texts = ["foo", "bar", "baz"]
    docsearch: Qdrant = Qdrant.from_texts(
        texts,
        ConsistentFakeEmbeddings(),
        location=":memory:",
        batch_size=batch_size,
        vector_name=vector_name,
    )

    new_texts = ["foobar", "foobaz"]
    docsearch.add_documents(
        [Document(page_content=content) for content in new_texts], batch_size=batch_size
    )
    output = docsearch.similarity_search("foobar", k=1)
    # ConsistentFakeEmbeddings return the same query embedding as the first document
    # embedding computed in `embedding.embed_documents`. Thus, "foo" embedding is the
    # same as "foobar" embedding
    assert_documents_equals(output, [Document(page_content="foobar")])

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free