Home / Function/ is_async_callable() — langchain Function Reference

is_async_callable() — langchain Function Reference

Architecture documentation for the is_async_callable() function in utils.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  df20a75c_efa9_4c7b_086f_99fe51c97d54["is_async_callable()"]
  ca66092c_447c_d201_0d3c_cfa6ca2cc9d3["utils.py"]
  df20a75c_efa9_4c7b_086f_99fe51c97d54 -->|defined in| ca66092c_447c_d201_0d3c_cfa6ca2cc9d3
  style df20a75c_efa9_4c7b_086f_99fe51c97d54 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/runnables/utils.py lines 745–759

def is_async_callable(
    func: Any,
) -> TypeGuard[Callable[..., Awaitable]]:
    """Check if a function is async.

    Args:
        func: The function to check.

    Returns:
        `True` if the function is async, `False` otherwise.
    """
    return asyncio.iscoroutinefunction(func) or (
        hasattr(func, "__call__")  # noqa: B004
        and asyncio.iscoroutinefunction(func.__call__)
    )

Subdomains

Frequently Asked Questions

What does is_async_callable() do?
is_async_callable() is a function in the langchain codebase, defined in libs/core/langchain_core/runnables/utils.py.
Where is is_async_callable() defined?
is_async_callable() is defined in libs/core/langchain_core/runnables/utils.py at line 745.

Analyze Your Own Codebase

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

Try Supermodel Free