BaseMiddleware autogen.beta.middleware.base.BaseMiddleware # BaseMiddleware(event, context) Source code in autogen/beta/middleware/base.py 55 56 57 58 59 60 61def __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 63 64 65 66 67 68 69async 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 71 72 73 74 75 76 77async 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 79 80 81 82 83 84 85async 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 87 88 89 90 91 92 93async def on_human_input( self, call_next: HumanInputHook, event: "HumanInputRequest", context: "Context", ) -> "HumanMessage": return await call_next(event, context)