test_get_buffer_string_xml_text_plain_truncation() — langchain Function Reference
Architecture documentation for the test_get_buffer_string_xml_text_plain_truncation() function in test_utils.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD e20eedaa_4772_d6f5_c8a2_d3c3d10e50e1["test_get_buffer_string_xml_text_plain_truncation()"] ea3f8d89_f44b_6738_3cb9_a740a73cfca4["test_utils.py"] e20eedaa_4772_d6f5_c8a2_d3c3d10e50e1 -->|defined in| ea3f8d89_f44b_6738_3cb9_a740a73cfca4 style e20eedaa_4772_d6f5_c8a2_d3c3d10e50e1 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/messages/test_utils.py lines 2579–2592
def test_get_buffer_string_xml_text_plain_truncation() -> None:
"""Test that text-plain content is truncated to 500 chars."""
long_text = "x" * 600
messages: list[BaseMessage] = [
HumanMessage(
content=[
{"type": "text-plain", "text": long_text, "mime_type": "text/plain"},
]
),
]
result = get_buffer_string(messages, format="xml")
# Should be truncated to 500 chars + "..."
assert "x" * 500 + "..." in result
assert "x" * 501 not in result
Domain
Subdomains
Source
Frequently Asked Questions
What does test_get_buffer_string_xml_text_plain_truncation() do?
test_get_buffer_string_xml_text_plain_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_text_plain_truncation() defined?
test_get_buffer_string_xml_text_plain_truncation() is defined in libs/core/tests/unit_tests/messages/test_utils.py at line 2579.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free