Home / Function/ test_llm_chain_extractor_async() — langchain Function Reference

test_llm_chain_extractor_async() — langchain Function Reference

Architecture documentation for the test_llm_chain_extractor_async() function in test_chain_filter.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  6b43386c_20e7_fab4_eadf_1cc670c0d201["test_llm_chain_extractor_async()"]
  83f12139_5c72_cab6_bde9_b4e064061aeb["test_chain_filter.py"]
  6b43386c_20e7_fab4_eadf_1cc670c0d201 -->|defined in| 83f12139_5c72_cab6_bde9_b4e064061aeb
  style 6b43386c_20e7_fab4_eadf_1cc670c0d201 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/retrievers/document_compressors/test_chain_filter.py lines 29–48

async def test_llm_chain_extractor_async() -> None:
    documents = [
        Document(
            page_content="Candlepin bowling is popular in New England.",
            metadata={"a": 1},
        ),
        Document(
            page_content="Candlepin bowling balls are smaller.",
            metadata={"b": 2},
        ),
        Document(page_content="The moon is round.", metadata={"c": 3}),
    ]
    llm = FakeListChatModel(responses=["YES", "YES", "NO"])
    doc_compressor = LLMChainFilter.from_llm(llm)
    output = await doc_compressor.acompress_documents(
        documents,
        "Tell me about Candlepin bowling.",
    )
    expected = documents[:2]
    assert output == expected

Domain

Subdomains

Frequently Asked Questions

What does test_llm_chain_extractor_async() do?
test_llm_chain_extractor_async() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/retrievers/document_compressors/test_chain_filter.py.
Where is test_llm_chain_extractor_async() defined?
test_llm_chain_extractor_async() is defined in libs/langchain/tests/unit_tests/retrievers/document_compressors/test_chain_filter.py at line 29.

Analyze Your Own Codebase

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

Try Supermodel Free