execute • AI Agent SDK
execute: Execute the middleware chain with a final handler.
execute
Method
</div>
This is a method of the MiddlewareChain class in the middleware module.
Execute the middleware chain with a final handler.
Signature
def execute(request: Any, final_handler: Callable[[Any], Any]) -> AnyParameters
ParamField
AnyThe request object to pass through
ParamField
CallableThe actual operation to perform
Returns
ResponseField
AnyThe result from the chain
Uses
final_handlerbuild_chainmiddlewarechain
Used By
CodeAgent.execute_codeCodeAgent.aexecuteMiddlewareManager.execute_model_callMiddlewareManager.execute_tool_callfire_hook
Source
View on GitHubpraisonaiagents/hooks/middleware.py at line 119