Home / Function/ test_create_documents() — langchain Function Reference

test_create_documents() — langchain Function Reference

Architecture documentation for the test_create_documents() function in test_text_splitters.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  d40be54b_4795_a949_e77f_514283532dcd["test_create_documents()"]
  6d6b8ad4_1cfe_fbb0_e58e_76a50487c135["test_text_splitters.py"]
  d40be54b_4795_a949_e77f_514283532dcd -->|defined in| 6d6b8ad4_1cfe_fbb0_e58e_76a50487c135
  style d40be54b_4795_a949_e77f_514283532dcd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/text-splitters/tests/unit_tests/test_text_splitters.py lines 291–301

def test_create_documents() -> None:
    """Test create documents method."""
    texts = ["foo bar", "baz"]
    splitter = CharacterTextSplitter(separator=" ", chunk_size=3, chunk_overlap=0)
    docs = splitter.create_documents(texts)
    expected_docs = [
        Document(page_content="foo"),
        Document(page_content="bar"),
        Document(page_content="baz"),
    ]
    assert docs == expected_docs

Domain

Subdomains

Frequently Asked Questions

What does test_create_documents() do?
test_create_documents() is a function in the langchain codebase, defined in libs/text-splitters/tests/unit_tests/test_text_splitters.py.
Where is test_create_documents() defined?
test_create_documents() is defined in libs/text-splitters/tests/unit_tests/test_text_splitters.py at line 291.

Analyze Your Own Codebase

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

Try Supermodel Free