test_llm_chain_extractor_async() — langchain Function Reference
Architecture documentation for the test_llm_chain_extractor_async() function in test_chain_extract.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 6147e960_d706_a875_36de_572048e7ee96["test_llm_chain_extractor_async()"] c49efd50_ed8a_1b2b_a881_4d0166e93a94["test_chain_extract.py"] 6147e960_d706_a875_36de_572048e7ee96 -->|defined in| c49efd50_ed8a_1b2b_a881_4d0166e93a94 style 6147e960_d706_a875_36de_572048e7ee96 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/tests/unit_tests/retrievers/document_compressors/test_chain_extract.py lines 49–88
async def test_llm_chain_extractor_async() -> None:
documents = [
Document(
page_content=(
"The sky is blue. Candlepin bowling is popular in New England."
),
metadata={"a": 1},
),
Document(
page_content=(
"Mercury is the closest planet to the Sun. "
"Candlepin bowling balls are smaller."
),
metadata={"b": 2},
),
Document(page_content="The moon is round.", metadata={"c": 3}),
]
llm = FakeListChatModel(
responses=[
"Candlepin bowling is popular in New England.",
"Candlepin bowling balls are smaller.",
"NO_OUTPUT",
],
)
doc_compressor = LLMChainExtractor.from_llm(llm)
output = await doc_compressor.acompress_documents(
documents,
"Tell me about Candlepin bowling.",
)
expected = [
Document(
page_content="Candlepin bowling is popular in New England.",
metadata={"a": 1},
),
Document(
page_content="Candlepin bowling balls are smaller.",
metadata={"b": 2},
),
]
assert output == expected
Domain
Subdomains
Source
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_extract.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_extract.py at line 49.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free