test_tool_message_content() — langchain Function Reference
Architecture documentation for the test_tool_message_content() function in test_messages.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 333daec6_8b13_57d2_3348_aded56355c17["test_tool_message_content()"] 3f9e7dd9_29c9_13fc_d3d8_a14d452f0d26["test_messages.py"] 333daec6_8b13_57d2_3348_aded56355c17 -->|defined in| 3f9e7dd9_29c9_13fc_d3d8_a14d452f0d26 style 333daec6_8b13_57d2_3348_aded56355c17 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/test_messages.py lines 1031–1043
def test_tool_message_content() -> None:
ToolMessage("foo", tool_call_id="1")
ToolMessage(["foo"], tool_call_id="1")
ToolMessage([{"foo": "bar"}], tool_call_id="1")
# Ignoring since we're testing that tuples get converted to lists in `coerce_args`
assert ToolMessage(("a", "b", "c"), tool_call_id="1").content == ["a", "b", "c"] # type: ignore[call-overload]
assert ToolMessage(5, tool_call_id="1").content == "5" # type: ignore[call-overload]
assert ToolMessage(5.1, tool_call_id="1").content == "5.1" # type: ignore[call-overload]
assert ToolMessage({"foo": "bar"}, tool_call_id="1").content == "{'foo': 'bar'}" # type: ignore[call-overload]
assert (
ToolMessage(Document("foo"), tool_call_id="1").content == "page_content='foo'" # type: ignore[call-overload]
)
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does test_tool_message_content() do?
test_tool_message_content() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/test_messages.py.
Where is test_tool_message_content() defined?
test_tool_message_content() is defined in libs/core/tests/unit_tests/test_messages.py at line 1031.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free