Home / Function/ test_get_buffer_string_xml_multiple_tool_calls() — langchain Function Reference

test_get_buffer_string_xml_multiple_tool_calls() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/core/tests/unit_tests/messages/test_utils.py lines 2173–2203

def test_get_buffer_string_xml_multiple_tool_calls() -> None:
    """Test XML format with `AIMessage` having multiple `tool_calls`."""
    messages = [
        AIMessage(
            content="I'll help with that",
            tool_calls=[
                {
                    "name": "get_weather",
                    "args": {"city": "NYC"},
                    "id": "call_1",
                    "type": "tool_call",
                },
                {
                    "name": "get_time",
                    "args": {"timezone": "EST"},
                    "id": "call_2",
                    "type": "tool_call",
                },
            ],
        ),
    ]
    result = get_buffer_string(messages, format="xml")
    # Should have nested structure with multiple tool_call elements
    expected = (
        '<message type="ai">\n'
        "  <content>I'll help with that</content>\n"
        '  <tool_call id="call_1" name="get_weather">{"city": "NYC"}</tool_call>\n'
        '  <tool_call id="call_2" name="get_time">{"timezone": "EST"}</tool_call>\n'
        "</message>"
    )
    assert result == expected

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free