Home / Class/ _CallableWithStateAndRuntime Class — langchain Architecture

_CallableWithStateAndRuntime Class — langchain Architecture

Architecture documentation for the _CallableWithStateAndRuntime class in types.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  b3153671_b3e7_4b36_b115_e67d121d8349["_CallableWithStateAndRuntime"]
  fb1284e2_76fc_661f_c16d_e084e8c2b175["types.py"]
  b3153671_b3e7_4b36_b115_e67d121d8349 -->|defined in| fb1284e2_76fc_661f_c16d_e084e8c2b175
  dc3c3ad1_747a_e886_6b41_eb526fdbad78["__call__()"]
  b3153671_b3e7_4b36_b115_e67d121d8349 -->|method| dc3c3ad1_747a_e886_6b41_eb526fdbad78

Relationship Graph

Source Code

libs/langchain_v1/langchain/agents/middleware/types.py lines 801–808

class _CallableWithStateAndRuntime(Protocol[StateT_contra, ContextT]):
    """Callable with `AgentState` and `Runtime` as arguments."""

    def __call__(
        self, state: StateT_contra, runtime: Runtime[ContextT]
    ) -> dict[str, Any] | Command[Any] | None | Awaitable[dict[str, Any] | Command[Any] | None]:
        """Perform some logic with the state and runtime."""
        ...

Frequently Asked Questions

What is the _CallableWithStateAndRuntime class?
_CallableWithStateAndRuntime is a class in the langchain codebase, defined in libs/langchain_v1/langchain/agents/middleware/types.py.
Where is _CallableWithStateAndRuntime defined?
_CallableWithStateAndRuntime is defined in libs/langchain_v1/langchain/agents/middleware/types.py at line 801.

Analyze Your Own Codebase

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

Try Supermodel Free