Home / Function/ test__collapse_docs_one_doc() — langchain Function Reference

test__collapse_docs_one_doc() — langchain Function Reference

Architecture documentation for the test__collapse_docs_one_doc() function in test_combine_documents.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  764ac0b8_f9f2_f76f_7b64_84caf4bc4374["test__collapse_docs_one_doc()"]
  fdcbc2e2_7fde_290c_7006_d84e63536c57["test_combine_documents.py"]
  764ac0b8_f9f2_f76f_7b64_84caf4bc4374 -->|defined in| fdcbc2e2_7fde_290c_7006_d84e63536c57
  style 764ac0b8_f9f2_f76f_7b64_84caf4bc4374 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/chains/test_combine_documents.py lines 92–102

def test__collapse_docs_one_doc() -> None:
    """Test collapse documents functionality when only one document present."""
    # Test with no metadata.
    docs = [Document(page_content="foo")]
    output = collapse_docs(docs, _fake_combine_docs_func)
    assert output == docs[0]

    # Test with metadata.
    docs = [Document(page_content="foo", metadata={"source": "a"})]
    output = collapse_docs(docs, _fake_combine_docs_func)
    assert output == docs[0]

Domain

Subdomains

Frequently Asked Questions

What does test__collapse_docs_one_doc() do?
test__collapse_docs_one_doc() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/chains/test_combine_documents.py.
Where is test__collapse_docs_one_doc() defined?
test__collapse_docs_one_doc() is defined in libs/langchain/tests/unit_tests/chains/test_combine_documents.py at line 92.

Analyze Your Own Codebase

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

Try Supermodel Free