Home / Function/ test_get_buffer_string_xml_tool_calls_empty_content() — langchain Function Reference

test_get_buffer_string_xml_tool_calls_empty_content() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/core/tests/unit_tests/messages/test_utils.py lines 2050–2072

def test_get_buffer_string_xml_tool_calls_empty_content() -> None:
    """Test XML format with `AIMessage` having empty `content` and `tool_calls`."""
    messages = [
        AIMessage(
            content="",
            tool_calls=[
                {
                    "name": "search",
                    "args": {"query": "test"},
                    "id": "call_2",
                    "type": "tool_call",
                }
            ],
        ),
    ]
    result = get_buffer_string(messages, format="xml")
    # No content element when content is empty
    expected = (
        '<message type="ai">\n'
        '  <tool_call id="call_2" name="search">{"query": "test"}</tool_call>\n'
        "</message>"
    )
    assert result == expected

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free