test_get_buffer_string_xml_custom_prefixes() — langchain Function Reference
Architecture documentation for the test_get_buffer_string_xml_custom_prefixes() function in test_utils.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 0d228b2c_9680_d01b_9dbc_ce31dbe5d027["test_get_buffer_string_xml_custom_prefixes()"] ea3f8d89_f44b_6738_3cb9_a740a73cfca4["test_utils.py"] 0d228b2c_9680_d01b_9dbc_ce31dbe5d027 -->|defined in| ea3f8d89_f44b_6738_3cb9_a740a73cfca4 style 0d228b2c_9680_d01b_9dbc_ce31dbe5d027 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/messages/test_utils.py lines 1914–1927
def test_get_buffer_string_xml_custom_prefixes() -> None:
"""Test XML format with custom human and ai prefixes."""
messages = [
HumanMessage(content="Hello"),
AIMessage(content="Hi there"),
]
result = get_buffer_string(
messages, human_prefix="User", ai_prefix="Assistant", format="xml"
)
expected = (
'<message type="user">Hello</message>\n'
'<message type="assistant">Hi there</message>'
)
assert result == expected
Domain
Subdomains
Source
Frequently Asked Questions
What does test_get_buffer_string_xml_custom_prefixes() do?
test_get_buffer_string_xml_custom_prefixes() 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_custom_prefixes() defined?
test_get_buffer_string_xml_custom_prefixes() is defined in libs/core/tests/unit_tests/messages/test_utils.py at line 1914.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free