Home / Function/ test_summary_buffer_memory_summary() — langchain Function Reference

test_summary_buffer_memory_summary() — langchain Function Reference

Architecture documentation for the test_summary_buffer_memory_summary() function in test_summary_buffer_memory.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  8120690c_89f5_5ec6_b66c_f3e52b57d712["test_summary_buffer_memory_summary()"]
  da36ce5c_a860_75d8_fce3_82c9466efd95["test_summary_buffer_memory.py"]
  8120690c_89f5_5ec6_b66c_f3e52b57d712 -->|defined in| da36ce5c_a860_75d8_fce3_82c9466efd95
  style 8120690c_89f5_5ec6_b66c_f3e52b57d712 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/chains/test_summary_buffer_memory.py lines 39–51

def test_summary_buffer_memory_summary() -> None:
    """Test ConversationSummaryBufferMemory when only buffer."""
    llm = FakeLLM(queries={0: "summary"}, sequential_responses=True)
    memory = ConversationSummaryBufferMemory(
        llm=llm,
        memory_key="baz",
        max_token_limit=5,
    )
    memory.save_context({"input": "bar"}, {"output": "foo"})
    memory.save_context({"input": "bar1"}, {"output": "foo1"})
    assert memory.buffer == "System: summary\nHuman: bar1\nAI: foo1"
    output = memory.load_memory_variables({})
    assert output == {"baz": "System: summary\nHuman: bar1\nAI: foo1"}

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free