AsyncGraphMiddleware Class — langchain Architecture
Architecture documentation for the AsyncGraphMiddleware class in test_wrap_model_call_state_update.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 30edb891_e387_e1a7_6be2_783a90b815db["AsyncGraphMiddleware"] 949c7cf4_56fe_f3b4_cd89_9631a7e9cb1e["AgentMiddleware"] 30edb891_e387_e1a7_6be2_783a90b815db -->|extends| 949c7cf4_56fe_f3b4_cd89_9631a7e9cb1e 08361e76_a995_1e57_f200_e292474e2f00["test_wrap_model_call_state_update.py"] 30edb891_e387_e1a7_6be2_783a90b815db -->|defined in| 08361e76_a995_1e57_f200_e292474e2f00 ddd9e10e_17ae_4403_2d44_17d1e5e8c48d["awrap_model_call()"] 30edb891_e387_e1a7_6be2_783a90b815db -->|method| ddd9e10e_17ae_4403_2d44_17d1e5e8c48d
Relationship Graph
Source Code
libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call_state_update.py lines 901–911
class AsyncGraphMiddleware(AgentMiddleware):
async def awrap_model_call(
self,
request: ModelRequest,
handler: Callable[[ModelRequest], Awaitable[ModelResponse]],
) -> ExtendedModelResponse:
response = await handler(request)
return ExtendedModelResponse(
model_response=response,
command=Command(graph=Command.PARENT, update={"messages": []}),
)
Defined In
Extends
Source
Frequently Asked Questions
What is the AsyncGraphMiddleware class?
AsyncGraphMiddleware is a class in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call_state_update.py.
Where is AsyncGraphMiddleware defined?
AsyncGraphMiddleware is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call_state_update.py at line 901.
What does AsyncGraphMiddleware extend?
AsyncGraphMiddleware extends AgentMiddleware.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free