Home / Function/ test_default_aadd_texts() — langchain Function Reference

test_default_aadd_texts() — langchain Function Reference

Architecture documentation for the test_default_aadd_texts() function in test_vectorstore.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  8acecd41_ab7e_b306_69c2_d22255b4a656["test_default_aadd_texts()"]
  547b9326_0fd1_ea2c_f15c_82026f35f74c["test_vectorstore.py"]
  8acecd41_ab7e_b306_69c2_d22255b4a656 -->|defined in| 547b9326_0fd1_ea2c_f15c_82026f35f74c
  style 8acecd41_ab7e_b306_69c2_d22255b4a656 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/vectorstores/test_vectorstore.py lines 211–236

async def test_default_aadd_texts(vs_class: type[VectorStore]) -> None:
    """Test delegation to the synchronous method."""
    store = vs_class()
    # Check that default implementation of aadd_texts works
    assert await store.aadd_texts(["hello", "world"], ids=["3", "4"]) == ["3", "4"]

    assert await store.aget_by_ids(["3", "4"]) == [
        Document(id="3", page_content="hello"),
        Document(id="4", page_content="world"),
    ]

    # Add texts without ids
    ids_ = await store.aadd_texts(["foo", "bar"])
    assert len(ids_) == 2
    assert await store.aget_by_ids(ids_) == [
        Document(id=ids_[0], page_content="foo"),
        Document(id=ids_[1], page_content="bar"),
    ]

    # Add texts with metadatas
    ids_2 = await store.aadd_texts(["foo", "bar"], metadatas=[{"foo": "bar"}] * 2)
    assert len(ids_2) == 2
    assert await store.aget_by_ids(ids_2) == [
        Document(id=ids_2[0], page_content="foo", metadata={"foo": "bar"}),
        Document(id=ids_2[1], page_content="bar", metadata={"foo": "bar"}),
    ]

Domain

Subdomains

Frequently Asked Questions

What does test_default_aadd_texts() do?
test_default_aadd_texts() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/vectorstores/test_vectorstore.py.
Where is test_default_aadd_texts() defined?
test_default_aadd_texts() is defined in libs/core/tests/unit_tests/vectorstores/test_vectorstore.py at line 211.

Analyze Your Own Codebase

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

Try Supermodel Free