Home / Function/ test_generation_chunk() — langchain Function Reference

test_generation_chunk() — langchain Function Reference

Architecture documentation for the test_generation_chunk() function in test_outputs.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  73c8929b_e5bc_6689_135a_d6f3799fcf3e["test_generation_chunk()"]
  1f0b4d17_0393_5e38_3b50_0e4927e08029["test_outputs.py"]
  73c8929b_e5bc_6689_135a_d6f3799fcf3e -->|defined in| 1f0b4d17_0393_5e38_3b50_0e4927e08029
  style 73c8929b_e5bc_6689_135a_d6f3799fcf3e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/test_outputs.py lines 5–26

def test_generation_chunk() -> None:
    assert GenerationChunk(text="Hello, ") + GenerationChunk(
        text="world!"
    ) == GenerationChunk(text="Hello, world!"), (
        "GenerationChunk + GenerationChunk should be a GenerationChunk"
    )

    assert GenerationChunk(text="Hello, ") + GenerationChunk(
        text="world!", generation_info={"foo": "bar"}
    ) == GenerationChunk(text="Hello, world!", generation_info={"foo": "bar"}), (
        "GenerationChunk + GenerationChunk should be a GenerationChunk "
        "with merged generation_info"
    )

    assert GenerationChunk(text="Hello, ") + GenerationChunk(
        text="world!", generation_info={"foo": "bar"}
    ) + GenerationChunk(text="!", generation_info={"baz": "foo"}) == GenerationChunk(
        text="Hello, world!!", generation_info={"foo": "bar", "baz": "foo"}
    ), (
        "GenerationChunk + GenerationChunk should be a GenerationChunk "
        "with merged generation_info"
    )

Subdomains

Frequently Asked Questions

What does test_generation_chunk() do?
test_generation_chunk() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/test_outputs.py.
Where is test_generation_chunk() defined?
test_generation_chunk() is defined in libs/core/tests/unit_tests/test_outputs.py at line 5.

Analyze Your Own Codebase

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

Try Supermodel Free