BaseMiddleware autogen.beta.middleware.base.BaseMiddleware # BaseMiddleware(event, context) Source code in autogen/beta/middleware/base.py 57 58 59 60 61 62 63def __init__( self, event: "BaseEvent", context: "Context", ) -> None: self.initial_event = event self.context = context initial_event instance-attribute # initial_event = event context instance-attribute # context = context on_turn async # on_turn(call_next, event, context) Source code in autogen/beta/middleware/base.py 65 66 67 68 69 70 71async def on_turn( self, call_next: AgentTurn, event: "BaseEvent", context: "Context", ) -> "ModelResponse": return await call_next(event, context) on_tool_execution async # on_tool_execution(call_next, event, context) Source code in autogen/beta/middleware/base.py 73 74 75 76 77 78 79async def on_tool_execution( self, call_next: ToolExecution, event: "ToolCallEvent", context: "Context", ) -> ToolResultType: return await call_next(event, context) on_llm_call async # on_llm_call(call_next, events, context) Source code in autogen/beta/middleware/base.py 81 82 83 84 85 86 87async def on_llm_call( self, call_next: LLMCall, events: "Sequence[BaseEvent]", context: "Context", ) -> "ModelResponse": return await call_next(events, context) on_human_input async # on_human_input(call_next, event, context) Source code in autogen/beta/middleware/base.py 89 90 91 92 93 94 95async def on_human_input( self, call_next: HumanInputHook, event: "HumanInputRequest", context: "Context", ) -> "HumanMessage": return await call_next(event, context)