Home / Function/ test_get_buffer_string_xml_basic() — langchain Function Reference

test_get_buffer_string_xml_basic() — langchain Function Reference

Architecture documentation for the test_get_buffer_string_xml_basic() function in test_utils.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  e5d1b8a0_ebf9_e1f0_4438_887b1676f02d["test_get_buffer_string_xml_basic()"]
  03f6a5ae_d57a_eb66_626a_b9e082b763ea["test_utils.py"]
  e5d1b8a0_ebf9_e1f0_4438_887b1676f02d -->|defined in| 03f6a5ae_d57a_eb66_626a_b9e082b763ea
  style e5d1b8a0_ebf9_e1f0_4438_887b1676f02d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/messages/test_utils.py lines 1894–1911

def test_get_buffer_string_xml_basic() -> None:
    """Test XML format output with all message types."""
    messages = [
        SystemMessage(content="System message"),
        HumanMessage(content="Human message"),
        AIMessage(content="AI message"),
        FunctionMessage(content="Function result", name="test_fn"),
        ToolMessage(content="Tool result", tool_call_id="123"),
    ]
    result = get_buffer_string(messages, format="xml")
    expected = (
        '<message type="system">System message</message>\n'
        '<message type="human">Human message</message>\n'
        '<message type="ai">AI message</message>\n'
        '<message type="function">Function result</message>\n'
        '<message type="tool">Tool result</message>'
    )
    assert result == expected

Domain

Subdomains

Frequently Asked Questions

What does test_get_buffer_string_xml_basic() do?
test_get_buffer_string_xml_basic() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/messages/test_utils.py.
Where is test_get_buffer_string_xml_basic() defined?
test_get_buffer_string_xml_basic() is defined in libs/core/tests/unit_tests/messages/test_utils.py at line 1894.

Analyze Your Own Codebase

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

Try Supermodel Free