Home / Function/ test__merge_messages_mutation() — langchain Function Reference

test__merge_messages_mutation() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  321e7f73_b641_b0b8_223d_4ccb436f7fd4["test__merge_messages_mutation()"]
  18428dc5_a41b_90c6_88ad_615296ee3311["test_chat_models.py"]
  321e7f73_b641_b0b8_223d_4ccb436f7fd4 -->|defined in| 18428dc5_a41b_90c6_88ad_615296ee3311
  style 321e7f73_b641_b0b8_223d_4ccb436f7fd4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/anthropic/tests/unit_tests/test_chat_models.py lines 396–412

def test__merge_messages_mutation() -> None:
    original_messages = [
        HumanMessage([{"type": "text", "text": "bar"}]),  # type: ignore[misc]
        HumanMessage("next thing"),  # type: ignore[misc]
    ]
    messages = [
        HumanMessage([{"type": "text", "text": "bar"}]),  # type: ignore[misc]
        HumanMessage("next thing"),  # type: ignore[misc]
    ]
    expected = [
        HumanMessage(  # type: ignore[misc]
            [{"type": "text", "text": "bar"}, {"type": "text", "text": "next thing"}],
        ),
    ]
    actual = _merge_messages(messages)
    assert expected == actual
    assert messages == original_messages

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free