Home / Function/ test_memory_tool() — langchain Function Reference

test_memory_tool() — langchain Function Reference

Architecture documentation for the test_memory_tool() function in test_chat_models.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  25792115_9b17_1adc_3d03_97d8ddafe487["test_memory_tool()"]
  f27640dd_3870_5548_d153_f9504ae1021f["test_chat_models.py"]
  25792115_9b17_1adc_3d03_97d8ddafe487 -->|defined in| f27640dd_3870_5548_d153_f9504ae1021f
  style 25792115_9b17_1adc_3d03_97d8ddafe487 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/anthropic/tests/integration_tests/test_chat_models.py lines 2033–2042

def test_memory_tool() -> None:
    llm = ChatAnthropic(
        model="claude-sonnet-4-5-20250929",  # type: ignore[call-arg]
        betas=["context-management-2025-06-27"],
    )
    llm_with_tools = llm.bind_tools([{"type": "memory_20250818", "name": "memory"}])
    response = llm_with_tools.invoke("What are my interests?")
    assert isinstance(response, AIMessage)
    assert response.tool_calls
    assert response.tool_calls[0]["name"] == "memory"

Domain

Subdomains

Frequently Asked Questions

What does test_memory_tool() do?
test_memory_tool() is a function in the langchain codebase, defined in libs/partners/anthropic/tests/integration_tests/test_chat_models.py.
Where is test_memory_tool() defined?
test_memory_tool() is defined in libs/partners/anthropic/tests/integration_tests/test_chat_models.py at line 2033.

Analyze Your Own Codebase

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

Try Supermodel Free