Home / Function/ test__format_messages_with_multiple_system() — langchain Function Reference

test__format_messages_with_multiple_system() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/partners/anthropic/tests/unit_tests/test_chat_models.py lines 1195–1214

def test__format_messages_with_multiple_system() -> None:
    messages = [
        HumanMessage("baz"),
        SystemMessage("bar"),
        SystemMessage("baz"),
        SystemMessage(
            [
                {"type": "text", "text": "foo", "cache_control": {"type": "ephemeral"}},
            ],
        ),
    ]
    expected_system = [
        {"type": "text", "text": "bar"},
        {"type": "text", "text": "baz"},
        {"type": "text", "text": "foo", "cache_control": {"type": "ephemeral"}},
    ]
    expected_messages = [{"role": "user", "content": "baz"}]
    actual_system, actual_messages = _format_messages(messages)
    assert expected_system == actual_system
    assert expected_messages == actual_messages

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free