Home / Function/ test_decorator_with_tools_parameter() — langchain Function Reference

test_decorator_with_tools_parameter() — langchain Function Reference

Architecture documentation for the test_decorator_with_tools_parameter() function in test_wrap_model_call.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  7950322c_b362_51b7_ff90_ed321974b4e4["test_decorator_with_tools_parameter()"]
  5a3c6db0_0302_046a_d217_22fb3d4e632e["TestWrapModelCallDecorator"]
  7950322c_b362_51b7_ff90_ed321974b4e4 -->|defined in| 5a3c6db0_0302_046a_d217_22fb3d4e632e
  style 7950322c_b362_51b7_ff90_ed321974b4e4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call.py lines 1209–1226

    def test_decorator_with_tools_parameter(self) -> None:
        """Test decorator with tools parameter."""

        @tool
        def test_tool(query: str) -> str:
            """A test tool."""
            return f"Result: {query}"

        @wrap_model_call(tools=[test_tool])
        def middleware_with_tools(
            request: ModelRequest,
            handler: Callable[[ModelRequest], ModelResponse],
        ) -> ModelCallResult:
            return handler(request)

        assert isinstance(middleware_with_tools, AgentMiddleware)
        assert len(middleware_with_tools.tools) == 1
        assert middleware_with_tools.tools[0].name == "test_tool"

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free