Home / Function/ test_get_buffer_string_xml_server_tool_result_output_truncation() — langchain Function Reference

test_get_buffer_string_xml_server_tool_result_output_truncation() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  b421c42f_e354_7331_2a20_004d46c35213["test_get_buffer_string_xml_server_tool_result_output_truncation()"]
  03f6a5ae_d57a_eb66_626a_b9e082b763ea["test_utils.py"]
  b421c42f_e354_7331_2a20_004d46c35213 -->|defined in| 03f6a5ae_d57a_eb66_626a_b9e082b763ea
  style b421c42f_e354_7331_2a20_004d46c35213 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/messages/test_utils.py lines 2616–2634

def test_get_buffer_string_xml_server_tool_result_output_truncation() -> None:
    """Test that server_tool_result output is truncated to 500 chars."""
    long_output = "z" * 600
    messages: list[BaseMessage] = [
        HumanMessage(
            content=[
                {
                    "type": "server_tool_result",
                    "tool_call_id": "call_1",
                    "status": "success",
                    "output": {"result": long_output},
                },
            ]
        ),
    ]
    result = get_buffer_string(messages, format="xml")
    assert "..." in result
    # The full 600-char value should not appear
    assert long_output not in result

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free