normalize • AI Agent SDK

normalize: Normalize a tool result into standard format.

normalize

Method

</div>

This is a method of the RuntimeToolResultMiddleware class in the middleware module.

Normalize a tool result into standard format.

Signature

python
def normalize(result: Any, tool_name: str, ctx: MiddlewareContext) -> NormalizedToolResult

Parameters

ParamField Any

Raw tool result from the plugin harness

ParamField str

Name of the tool that was executed

ParamField MiddlewareContext

Execution context with metadata

Returns

ResponseField NormalizedToolResult

NormalizedToolResult with standardized format

Source

View on GitHub

praisonaiagents/runtime/middleware.py at line 91