_CallableReturningToolResponse Class — langchain Architecture
Architecture documentation for the _CallableReturningToolResponse class in types.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 870db102_f216_5003_5791_f7e62311dfae["_CallableReturningToolResponse"] fb1284e2_76fc_661f_c16d_e084e8c2b175["types.py"] 870db102_f216_5003_5791_f7e62311dfae -->|defined in| fb1284e2_76fc_661f_c16d_e084e8c2b175 95ff8012_21c6_5048_410b_7cbd682624ff["__call__()"] 870db102_f216_5003_5791_f7e62311dfae -->|method| 95ff8012_21c6_5048_410b_7cbd682624ff
Relationship Graph
Source Code
libs/langchain_v1/langchain/agents/middleware/types.py lines 837–850
class _CallableReturningToolResponse(Protocol):
"""Callable for tool call interception with handler callback.
Receives handler callback to execute tool and returns final `ToolMessage` or
`Command`.
"""
def __call__(
self,
request: ToolCallRequest,
handler: Callable[[ToolCallRequest], ToolMessage | Command[Any]],
) -> ToolMessage | Command[Any]:
"""Intercept tool execution via handler callback."""
...
Source
Frequently Asked Questions
What is the _CallableReturningToolResponse class?
_CallableReturningToolResponse is a class in the langchain codebase, defined in libs/langchain_v1/langchain/agents/middleware/types.py.
Where is _CallableReturningToolResponse defined?
_CallableReturningToolResponse is defined in libs/langchain_v1/langchain/agents/middleware/types.py at line 837.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free