test_dynamic_tool_basic() — langchain Function Reference
Architecture documentation for the test_dynamic_tool_basic() function in test_dynamic_tools.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD b2b31e69_e247_6b8c_f83d_051f9b3fc0d8["test_dynamic_tool_basic()"] ed3bf1bf_abaf_832a_a548_adfcdbed05b3["test_dynamic_tools.py"] b2b31e69_e247_6b8c_f83d_051f9b3fc0d8 -->|defined in| ed3bf1bf_abaf_832a_a548_adfcdbed05b3 fe27ad32_78c6_de3f_c030_9c2e48e1cd22["invoke_agent()"] b2b31e69_e247_6b8c_f83d_051f9b3fc0d8 -->|calls| fe27ad32_78c6_de3f_c030_9c2e48e1cd22 718649e7_ca41_a633_085d_48f52a118df2["get_tool_messages()"] b2b31e69_e247_6b8c_f83d_051f9b3fc0d8 -->|calls| 718649e7_ca41_a633_085d_48f52a118df2 style b2b31e69_e247_6b8c_f83d_051f9b3fc0d8 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_dynamic_tools.py lines 232–253
async def test_dynamic_tool_basic(*, use_async: bool, tools: list[Any] | None) -> None:
"""Test dynamic tool registration with various static tool configurations."""
model = FakeToolCallingModel(
tool_calls=[
[ToolCall(name="dynamic_tool", args={"value": "test"}, id="1")],
[],
]
)
agent = create_agent(
model=model,
tools=tools, # type: ignore[arg-type]
middleware=[DynamicToolMiddleware()],
checkpointer=InMemorySaver(),
)
result = await invoke_agent(agent, "Use the dynamic tool", use_async=use_async)
tool_messages = get_tool_messages(result)
assert len(tool_messages) == 1
assert tool_messages[0].name == "dynamic_tool"
assert "Dynamic result: test" in tool_messages[0].content
Domain
Subdomains
Source
Frequently Asked Questions
What does test_dynamic_tool_basic() do?
test_dynamic_tool_basic() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_dynamic_tools.py.
Where is test_dynamic_tool_basic() defined?
test_dynamic_tool_basic() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_dynamic_tools.py at line 232.
What does test_dynamic_tool_basic() call?
test_dynamic_tool_basic() calls 2 function(s): get_tool_messages, invoke_agent.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free