Home / Function/ test_multiple_dynamic_tools_with_static() — langchain Function Reference

test_multiple_dynamic_tools_with_static() — langchain Function Reference

Architecture documentation for the test_multiple_dynamic_tools_with_static() function in test_dynamic_tools.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  90ea16ac_46c4_67dc_c2b2_53b737c58d9f["test_multiple_dynamic_tools_with_static()"]
  ed3bf1bf_abaf_832a_a548_adfcdbed05b3["test_dynamic_tools.py"]
  90ea16ac_46c4_67dc_c2b2_53b737c58d9f -->|defined in| ed3bf1bf_abaf_832a_a548_adfcdbed05b3
  fe27ad32_78c6_de3f_c030_9c2e48e1cd22["invoke_agent()"]
  90ea16ac_46c4_67dc_c2b2_53b737c58d9f -->|calls| fe27ad32_78c6_de3f_c030_9c2e48e1cd22
  718649e7_ca41_a633_085d_48f52a118df2["get_tool_messages()"]
  90ea16ac_46c4_67dc_c2b2_53b737c58d9f -->|calls| 718649e7_ca41_a633_085d_48f52a118df2
  style 90ea16ac_46c4_67dc_c2b2_53b737c58d9f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_dynamic_tools.py lines 257–285

async def test_multiple_dynamic_tools_with_static(*, use_async: bool) -> None:
    """Test multiple dynamic tools and mixing with static tool calls."""
    model = FakeToolCallingModel(
        tool_calls=[
            [
                ToolCall(name="static_tool", args={"value": "static-call"}, id="1"),
                ToolCall(name="dynamic_tool", args={"value": "first"}, id="2"),
                ToolCall(name="another_dynamic_tool", args={"x": 5, "y": 3}, id="3"),
            ],
            [],
        ]
    )

    agent = create_agent(
        model=model,
        tools=[static_tool],
        middleware=[MultipleDynamicToolsMiddleware()],
        checkpointer=InMemorySaver(),
    )

    result = await invoke_agent(agent, "Use all tools", use_async=use_async)

    tool_messages = get_tool_messages(result)
    assert len(tool_messages) == 3

    tool_results = {m.name: m.content for m in tool_messages}
    assert "Static result: static-call" in tool_results["static_tool"]
    assert "Dynamic result: first" in tool_results["dynamic_tool"]
    assert "Sum: 8" in tool_results["another_dynamic_tool"]

Domain

Subdomains

Frequently Asked Questions

What does test_multiple_dynamic_tools_with_static() do?
test_multiple_dynamic_tools_with_static() 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_multiple_dynamic_tools_with_static() defined?
test_multiple_dynamic_tools_with_static() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_dynamic_tools.py at line 257.
What does test_multiple_dynamic_tools_with_static() call?
test_multiple_dynamic_tools_with_static() 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