Home / Function/ test_embed_documents_batch() — langchain Function Reference

test_embed_documents_batch() — langchain Function Reference

Architecture documentation for the test_embed_documents_batch() function in test_caching.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  ff69f32b_472e_9872_ff62_67f040754ef8["test_embed_documents_batch()"]
  6b1a1e58_d1bc_2756_cc7d_9c01f64a73a2["test_caching.py"]
  ff69f32b_472e_9872_ff62_67f040754ef8 -->|defined in| 6b1a1e58_d1bc_2756_cc7d_9c01f64a73a2
  612e991b_9f93_9ffa_30df_6f17578ea52c["embed_documents()"]
  ff69f32b_472e_9872_ff62_67f040754ef8 -->|calls| 612e991b_9f93_9ffa_30df_6f17578ea52c
  style ff69f32b_472e_9872_ff62_67f040754ef8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/embeddings/test_caching.py lines 84–93

def test_embed_documents_batch(cache_embeddings_batch: CacheBackedEmbeddings) -> None:
    # "RAISE_EXCEPTION" forces a failure in batch 2
    texts = ["1", "22", "a", "333", "RAISE_EXCEPTION"]
    with contextlib.suppress(ValueError):
        cache_embeddings_batch.embed_documents(texts)
    keys = list(cache_embeddings_batch.document_embedding_store.yield_keys())
    # only the first batch of three embeddings should exist
    assert len(keys) == 3
    # UUID is expected to be the same for the same text
    assert keys[0] == "test_namespace812b86c1-8ebf-5483-95c6-c95cf2b52d12"

Domain

Subdomains

Frequently Asked Questions

What does test_embed_documents_batch() do?
test_embed_documents_batch() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/embeddings/test_caching.py.
Where is test_embed_documents_batch() defined?
test_embed_documents_batch() is defined in libs/langchain/tests/unit_tests/embeddings/test_caching.py at line 84.
What does test_embed_documents_batch() call?
test_embed_documents_batch() calls 1 function(s): embed_documents.

Analyze Your Own Codebase

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

Try Supermodel Free