test_create_documents_with_metadata() — langchain Function Reference
Architecture documentation for the test_create_documents_with_metadata() function in test_text_splitters.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD b6be7e36_9d62_bc4e_360f_beda32fd7bb3["test_create_documents_with_metadata()"] 6d6b8ad4_1cfe_fbb0_e58e_76a50487c135["test_text_splitters.py"] b6be7e36_9d62_bc4e_360f_beda32fd7bb3 -->|defined in| 6d6b8ad4_1cfe_fbb0_e58e_76a50487c135 style b6be7e36_9d62_bc4e_360f_beda32fd7bb3 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/text-splitters/tests/unit_tests/test_text_splitters.py lines 304–314
def test_create_documents_with_metadata() -> None:
"""Test create documents with metadata method."""
texts = ["foo bar", "baz"]
splitter = CharacterTextSplitter(separator=" ", chunk_size=3, chunk_overlap=0)
docs = splitter.create_documents(texts, [{"source": "1"}, {"source": "2"}])
expected_docs = [
Document(page_content="foo", metadata={"source": "1"}),
Document(page_content="bar", metadata={"source": "1"}),
Document(page_content="baz", metadata={"source": "2"}),
]
assert docs == expected_docs
Domain
Subdomains
Source
Frequently Asked Questions
What does test_create_documents_with_metadata() do?
test_create_documents_with_metadata() is a function in the langchain codebase, defined in libs/text-splitters/tests/unit_tests/test_text_splitters.py.
Where is test_create_documents_with_metadata() defined?
test_create_documents_with_metadata() is defined in libs/text-splitters/tests/unit_tests/test_text_splitters.py at line 304.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free