test_get_buffer_string_xml_tool_calls_preferred_over_function_call() — langchain Function Reference
Architecture documentation for the test_get_buffer_string_xml_tool_calls_preferred_over_function_call() function in test_utils.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 0f846896_55e2_9cfb_df14_5ec32ed61c49["test_get_buffer_string_xml_tool_calls_preferred_over_function_call()"] 03f6a5ae_d57a_eb66_626a_b9e082b763ea["test_utils.py"] 0f846896_55e2_9cfb_df14_5ec32ed61c49 -->|defined in| 03f6a5ae_d57a_eb66_626a_b9e082b763ea style 0f846896_55e2_9cfb_df14_5ec32ed61c49 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/messages/test_utils.py lines 2147–2170
def test_get_buffer_string_xml_tool_calls_preferred_over_function_call() -> None:
"""Test that `tool_calls` takes precedence over legacy `function_call` in XML."""
messages = [
AIMessage(
content="Calling tools",
tool_calls=[
{
"name": "modern_tool",
"args": {"key": "value"},
"id": "call_3",
"type": "tool_call",
}
],
additional_kwargs={
"function_call": {"name": "legacy_function", "arguments": "{}"}
},
),
]
result = get_buffer_string(messages, format="xml")
assert "modern_tool" in result
assert "legacy_function" not in result
# Should use tool_call element, not function_call
assert "<tool_call" in result
assert "<function_call" not in result
Domain
Subdomains
Source
Frequently Asked Questions
What does test_get_buffer_string_xml_tool_calls_preferred_over_function_call() do?
test_get_buffer_string_xml_tool_calls_preferred_over_function_call() 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_preferred_over_function_call() defined?
test_get_buffer_string_xml_tool_calls_preferred_over_function_call() is defined in libs/core/tests/unit_tests/messages/test_utils.py at line 2147.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free