Home / Function/ test_get_buffer_string_xml_openai_image_url_block() — langchain Function Reference

test_get_buffer_string_xml_openai_image_url_block() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/core/tests/unit_tests/messages/test_utils.py lines 2337–2352

def test_get_buffer_string_xml_openai_image_url_block() -> None:
    """Test XML format with OpenAI-style `image_url` block."""
    messages: list[BaseMessage] = [
        HumanMessage(
            content=[
                {"type": "text", "text": "Analyze this:"},
                {
                    "type": "image_url",
                    "image_url": {"url": "https://example.com/photo.jpg"},
                },
            ]
        ),
    ]
    result = get_buffer_string(messages, format="xml")
    assert "Analyze this:" in result
    assert '<image url="https://example.com/photo.jpg" />' in result

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free