Home / Function/ test_aindexing_same_content() — langchain Function Reference

test_aindexing_same_content() — langchain Function Reference

Architecture documentation for the test_aindexing_same_content() function in test_indexing.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  244a1ae9_ca6c_5c52_9719_484c33999cd9["test_aindexing_same_content()"]
  9bc4e8b6_769a_ae11_3fc1_309cb678c248["test_indexing.py"]
  244a1ae9_ca6c_5c52_9719_484c33999cd9 -->|defined in| 9bc4e8b6_769a_ae11_3fc1_309cb678c248
  style 244a1ae9_ca6c_5c52_9719_484c33999cd9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/indexes/test_indexing.py lines 213–245

async def test_aindexing_same_content(
    arecord_manager: SQLRecordManager,
    vector_store: InMemoryVectorStore,
) -> None:
    """Indexing some content to confirm it gets added only once."""
    loader = ToyLoader(
        documents=[
            Document(
                page_content="This is a test document.",
            ),
            Document(
                page_content="This is another document.",
            ),
        ],
    )

    assert await aindex(loader, arecord_manager, vector_store) == {
        "num_added": 2,
        "num_deleted": 0,
        "num_skipped": 0,
        "num_updated": 0,
    }

    assert len(list(vector_store.store)) == 2

    for _ in range(2):
        # Run the indexing again
        assert await aindex(loader, arecord_manager, vector_store) == {
            "num_added": 0,
            "num_deleted": 0,
            "num_skipped": 2,
            "num_updated": 0,
        }

Domain

Subdomains

Frequently Asked Questions

What does test_aindexing_same_content() do?
test_aindexing_same_content() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/indexes/test_indexing.py.
Where is test_aindexing_same_content() defined?
test_aindexing_same_content() is defined in libs/langchain/tests/unit_tests/indexes/test_indexing.py at line 213.

Analyze Your Own Codebase

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

Try Supermodel Free