test_get_buffer_string_tool_calls_preferred_over_function_call() — langchain Function Reference
Architecture documentation for the test_get_buffer_string_tool_calls_preferred_over_function_call() function in test_utils.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 88c05171_6711_4dd7_46e8_efa06d01ef28["test_get_buffer_string_tool_calls_preferred_over_function_call()"] 03f6a5ae_d57a_eb66_626a_b9e082b763ea["test_utils.py"] 88c05171_6711_4dd7_46e8_efa06d01ef28 -->|defined in| 03f6a5ae_d57a_eb66_626a_b9e082b763ea style 88c05171_6711_4dd7_46e8_efa06d01ef28 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/messages/test_utils.py lines 1799–1819
def test_get_buffer_string_tool_calls_preferred_over_function_call() -> None:
"""Test that `tool_calls` takes precedence over legacy `function_call`."""
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)
assert "modern_tool" in result
assert "legacy_function" not in result
Domain
Subdomains
Source
Frequently Asked Questions
What does test_get_buffer_string_tool_calls_preferred_over_function_call() do?
test_get_buffer_string_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_tool_calls_preferred_over_function_call() defined?
test_get_buffer_string_tool_calls_preferred_over_function_call() is defined in libs/core/tests/unit_tests/messages/test_utils.py at line 1799.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free