Home / Function/ test_get_buffer_string_xml_tool_calls_with_content() — langchain Function Reference

test_get_buffer_string_xml_tool_calls_with_content() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/core/tests/unit_tests/messages/test_utils.py lines 2024–2047

def test_get_buffer_string_xml_tool_calls_with_content() -> None:
    """Test XML format with `AIMessage` having both `content` and `tool_calls`."""
    messages = [
        AIMessage(
            content="Let me check that",
            tool_calls=[
                {
                    "name": "get_weather",
                    "args": {"city": "NYC"},
                    "id": "call_1",
                    "type": "tool_call",
                }
            ],
        ),
    ]
    result = get_buffer_string(messages, format="xml")
    # Nested structure with content and tool_call elements
    expected = (
        '<message type="ai">\n'
        "  <content>Let me check that</content>\n"
        '  <tool_call id="call_1" name="get_weather">{"city": "NYC"}</tool_call>\n'
        "</message>"
    )
    assert result == expected

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free