execute • AI Agent SDK
execute: Execute the async middleware chain.
execute
Async
Method
</div>
This is a method of the AsyncMiddlewareChain class in the middleware module.
Execute the async middleware chain.
Signature
async def execute(request: Any, final_handler: Callable) -> AnyParameters
ParamField
AnyThe request object to pass through
ParamField
CallableThe actual async 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 163