Home / Function/ test_wrap_tool_call_basic_passthrough() — langchain Function Reference

test_wrap_tool_call_basic_passthrough() — langchain Function Reference

Architecture documentation for the test_wrap_tool_call_basic_passthrough() function in test_wrap_tool_call.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  0fb2e6b5_ef82_3636_f13d_d85335ac47f9["test_wrap_tool_call_basic_passthrough()"]
  e783c6bd_e3d7_7d3b_e64d_d062c5c12013["test_wrap_tool_call.py"]
  0fb2e6b5_ef82_3636_f13d_d85335ac47f9 -->|defined in| e783c6bd_e3d7_7d3b_e64d_d062c5c12013
  style 0fb2e6b5_ef82_3636_f13d_d85335ac47f9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_tool_call.py lines 40–74

def test_wrap_tool_call_basic_passthrough() -> None:
    """Test basic passthrough with wrap_tool_call decorator."""
    call_log = []

    @wrap_tool_call
    def passthrough(
        request: ToolCallRequest, handler: Callable[[ToolCallRequest], ToolMessage | Command[Any]]
    ) -> ToolMessage | Command[Any]:
        call_log.append("called")
        return handler(request)

    model = FakeToolCallingModel(
        tool_calls=[
            [ToolCall(name="search", args={"query": "test"}, id="1")],
            [],
        ]
    )

    agent = create_agent(
        model=model,
        tools=[search],
        middleware=[passthrough],
        checkpointer=InMemorySaver(),
    )

    result = agent.invoke(
        {"messages": [HumanMessage("Search for test")]},
        {"configurable": {"thread_id": "test"}},
    )

    assert len(call_log) == 1
    assert call_log[0] == "called"
    tool_messages = [m for m in result["messages"] if isinstance(m, ToolMessage)]
    assert len(tool_messages) == 1
    assert "Results for: test" in tool_messages[0].content

Domain

Subdomains

Frequently Asked Questions

What does test_wrap_tool_call_basic_passthrough() do?
test_wrap_tool_call_basic_passthrough() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_tool_call.py.
Where is test_wrap_tool_call_basic_passthrough() defined?
test_wrap_tool_call_basic_passthrough() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_tool_call.py at line 40.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free