Home / Function/ test_sequential_internal_chain_use_memory() — langchain Function Reference

test_sequential_internal_chain_use_memory() — langchain Function Reference

Architecture documentation for the test_sequential_internal_chain_use_memory() function in test_sequential.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  053655a9_127f_e15e_6fb1_b2165632efe4["test_sequential_internal_chain_use_memory()"]
  0021bb47_51ab_bafd_26b4_c2849000554a["test_sequential.py"]
  053655a9_127f_e15e_6fb1_b2165632efe4 -->|defined in| 0021bb47_51ab_bafd_26b4_c2849000554a
  style 053655a9_127f_e15e_6fb1_b2165632efe4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/chains/test_sequential.py lines 113–127

def test_sequential_internal_chain_use_memory() -> None:
    """Test sequential usage with memory for one of the internal chains."""
    memory = ConversationBufferMemory(memory_key="bla")
    memory.save_context({"input": "yo"}, {"output": "ya"})
    chain_1 = FakeChain(
        input_variables=["foo", "bla"],
        output_variables=["bar"],
        memory=memory,
    )
    chain_2 = FakeChain(input_variables=["bar"], output_variables=["baz"])
    chain = SequentialChain(chains=[chain_1, chain_2], input_variables=["foo"])  # type: ignore[call-arg]
    output = chain({"foo": "123"})
    print("HEYYY OUTPUT", output)  # noqa: T201
    expected_output = {"foo": "123", "baz": "123 Human: yo\nAI: yafoofoo"}
    assert output == expected_output

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free