Home / Function/ test_create_async_tool() — langchain Function Reference

test_create_async_tool() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/core/tests/unit_tests/test_tools.py lines 754–771

async def test_create_async_tool() -> None:
    """Test that async tools are allowed."""

    async def _test_func(x: str) -> str:
        return x

    test_tool = Tool(
        name="test_name",
        func=lambda x: x,
        description="test_description",
        coroutine=_test_func,
    )
    assert test_tool.is_single_input
    assert test_tool.invoke("foo") == "foo"
    assert test_tool.name == "test_name"
    assert test_tool.description == "test_description"
    assert test_tool.coroutine is not None
    assert await test_tool.arun("foo") == "foo"

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free