Home / Function/ test_get_buffer_string_xml_structured_content() — langchain Function Reference

test_get_buffer_string_xml_structured_content() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  c3e4d174_c71c_bcbc_0bd3_48c90b6bac79["test_get_buffer_string_xml_structured_content()"]
  ea3f8d89_f44b_6738_3cb9_a740a73cfca4["test_utils.py"]
  c3e4d174_c71c_bcbc_0bd3_48c90b6bac79 -->|defined in| ea3f8d89_f44b_6738_3cb9_a740a73cfca4
  style c3e4d174_c71c_bcbc_0bd3_48c90b6bac79 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/messages/test_utils.py lines 2122–2134

def test_get_buffer_string_xml_structured_content() -> None:
    """Test XML format with structured content (list content blocks)."""
    messages = [
        HumanMessage(content=[{"type": "text", "text": "Hello, world!"}]),
        AIMessage(content=[{"type": "text", "text": "Hi there!"}]),
    ]
    result = get_buffer_string(messages, format="xml")
    # message.text property should extract text from structured content
    expected = (
        '<message type="human">Hello, world!</message>\n'
        '<message type="ai">Hi there!</message>'
    )
    assert result == expected

Subdomains

Frequently Asked Questions

What does test_get_buffer_string_xml_structured_content() do?
test_get_buffer_string_xml_structured_content() 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_structured_content() defined?
test_get_buffer_string_xml_structured_content() is defined in libs/core/tests/unit_tests/messages/test_utils.py at line 2122.

Analyze Your Own Codebase

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

Try Supermodel Free