test_init_tool_calls() — langchain Function Reference
Architecture documentation for the test_init_tool_calls() function in test_ai.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 02c2a5ee_1a8f_7dc3_6f49_c619020d93bf["test_init_tool_calls()"] f148f3ce_73bd_627d_a979_33d23ebac843["test_ai.py"] 02c2a5ee_1a8f_7dc3_6f49_c619020d93bf -->|defined in| f148f3ce_73bd_627d_a979_33d23ebac843 style 02c2a5ee_1a8f_7dc3_6f49_c619020d93bf fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/messages/test_ai.py lines 204–211
def test_init_tool_calls() -> None:
# Test we add "type" key on init
msg = AIMessage("", tool_calls=[{"name": "foo", "args": {"a": "b"}, "id": "abc"}])
assert len(msg.tool_calls) == 1
assert msg.tool_calls[0]["type"] == "tool_call"
# Test we can assign without adding type key
msg.tool_calls = [{"name": "bar", "args": {"c": "d"}, "id": "def"}]
Domain
Subdomains
Source
Frequently Asked Questions
What does test_init_tool_calls() do?
test_init_tool_calls() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/messages/test_ai.py.
Where is test_init_tool_calls() defined?
test_init_tool_calls() is defined in libs/core/tests/unit_tests/messages/test_ai.py at line 204.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free