Home / Function/ test_get_buffer_string_xml_function_call_legacy() — langchain Function Reference

test_get_buffer_string_xml_function_call_legacy() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/core/tests/unit_tests/messages/test_utils.py lines 2100–2119

def test_get_buffer_string_xml_function_call_legacy() -> None:
    """Test XML format with legacy `function_call` in `additional_kwargs`."""
    messages = [
        AIMessage(
            content="Calling function",
            additional_kwargs={
                "function_call": {"name": "test_fn", "arguments": '{"x": 1}'}
            },
        ),
    ]
    result = get_buffer_string(messages, format="xml")
    # Nested structure with function_call element
    # Note: arguments is a string, so quotes inside are escaped
    expected = (
        '<message type="ai">\n'
        "  <content>Calling function</content>\n"
        '  <function_call name="test_fn">{"x": 1}</function_call>\n'
        "</message>"
    )
    assert result == expected

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free