Home / Function/ test_named_tool_decorator_return_direct() — langchain Function Reference

test_named_tool_decorator_return_direct() — langchain Function Reference

Architecture documentation for the test_named_tool_decorator_return_direct() function in test_tools.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  26ea1481_5bb6_5eb4_0c5e_2e4f7f57478b["test_named_tool_decorator_return_direct()"]
  8e7836ae_e72c_f670_72a5_4ca6d46e3555["test_tools.py"]
  26ea1481_5bb6_5eb4_0c5e_2e4f7f57478b -->|defined in| 8e7836ae_e72c_f670_72a5_4ca6d46e3555
  style 26ea1481_5bb6_5eb4_0c5e_2e4f7f57478b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/test_tools.py lines 658–669

def test_named_tool_decorator_return_direct() -> None:
    """Test functionality when arguments and return direct are provided as input."""

    @tool("search", return_direct=True)
    def search_api(query: str, *args: Any) -> str:
        """Search the API for the query."""
        return "API result"

    assert isinstance(search_api, BaseTool)
    assert search_api.name == "search"
    assert search_api.return_direct
    assert search_api.run({"query": "foo"}) == "API result"

Domain

Subdomains

Frequently Asked Questions

What does test_named_tool_decorator_return_direct() do?
test_named_tool_decorator_return_direct() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/test_tools.py.
Where is test_named_tool_decorator_return_direct() defined?
test_named_tool_decorator_return_direct() is defined in libs/core/tests/unit_tests/test_tools.py at line 658.

Analyze Your Own Codebase

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

Try Supermodel Free