Home / Function/ test_get_buffer_string_xml_mixed_content_blocks() — langchain Function Reference

test_get_buffer_string_xml_mixed_content_blocks() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/core/tests/unit_tests/messages/test_utils.py lines 2526–2547

def test_get_buffer_string_xml_mixed_content_blocks() -> None:
    """Test XML format with multiple different content block types."""
    messages: list[BaseMessage] = [
        HumanMessage(
            content=[
                {"type": "text", "text": "Look at this image and document:"},
                {"type": "image", "url": "https://example.com/img.png"},
                {
                    "type": "text-plain",
                    "text": "Doc content",
                    "mime_type": "text/plain",
                },
                # This should be skipped (base64)
                {"type": "image", "base64": "abc123", "mime_type": "image/png"},
            ]
        ),
    ]
    result = get_buffer_string(messages, format="xml")
    assert "Look at this image and document:" in result
    assert '<image url="https://example.com/img.png" />' in result
    assert "Doc content" in result
    assert "abc123" not in result

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free