Home / Function/ test_format_doc_missing_metadata() — langchain Function Reference

test_format_doc_missing_metadata() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/chains/test_combine_documents.py lines 139–159

async def test_format_doc_missing_metadata() -> None:
    """Test format doc on a document with missing metadata."""
    doc = Document(page_content="foo")
    prompt = PromptTemplate(
        input_variables=["page_content", "bar"],
        template="{page_content}, {bar}",
    )
    with pytest.raises(
        ValueError,
        match=re.escape(
            "Document prompt requires documents to have metadata variables: ['bar']."
        ),
    ):
        format_document(doc, prompt)
    with pytest.raises(
        ValueError,
        match=re.escape(
            "Document prompt requires documents to have metadata variables: ['bar']."
        ),
    ):
        await aformat_document(doc, prompt)

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free