LoggingMiddleware Class — langchain Architecture
Architecture documentation for the LoggingMiddleware class in test_wrap_model_call.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 191cb17e_2dab_f07e_4074_45b22139b291["LoggingMiddleware"] 949c7cf4_56fe_f3b4_cd89_9631a7e9cb1e["AgentMiddleware"] 191cb17e_2dab_f07e_4074_45b22139b291 -->|extends| 949c7cf4_56fe_f3b4_cd89_9631a7e9cb1e 573473e5_eb93_a7d7_84ba_c975071c09af["test_wrap_model_call.py"] 191cb17e_2dab_f07e_4074_45b22139b291 -->|defined in| 573473e5_eb93_a7d7_84ba_c975071c09af 5895ad6e_c31b_1220_01db_fecc9a2ee385["wrap_model_call()"] 191cb17e_2dab_f07e_4074_45b22139b291 -->|method| 5895ad6e_c31b_1220_01db_fecc9a2ee385 8b14d6df_29e1_d984_6a2a_6e2bb0e2e4b2["awrap_model_call()"] 191cb17e_2dab_f07e_4074_45b22139b291 -->|method| 8b14d6df_29e1_d984_6a2a_6e2bb0e2e4b2
Relationship Graph
Source Code
libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call.py lines 62–71
class LoggingMiddleware(AgentMiddleware):
def wrap_model_call(
self,
request: ModelRequest,
handler: Callable[[ModelRequest], ModelResponse],
) -> ModelCallResult:
call_log.append("before")
result = handler(request)
call_log.append("after")
return result
Extends
Source
Frequently Asked Questions
What is the LoggingMiddleware class?
LoggingMiddleware is a class in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call.py.
Where is LoggingMiddleware defined?
LoggingMiddleware is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call.py at line 62.
What does LoggingMiddleware extend?
LoggingMiddleware extends AgentMiddleware.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free