middleware • AI Agent SDK
Runtime Tool Result Middleware Protocol.
middleware
AI Agent
Runtime Tool Result Middleware Protocol.
Defines the interface for normalizing tool results from plugin harnesses before they reach hooks and memory adapters.
Protocol-driven design following AGENTS.md:
- Lightweight protocols only (no implementations)
- Dataclasses for configuration
- Async-first with proper typing
Import
from praisonaiagents.runtime import middlewareClasses
MiddlewareContext
Context passed to middleware during tool result normalization.
NormalizedToolResultStandardized tool result format.
RuntimeToolResultMiddlewareProtocol for runtime-scoped tool result middleware.
PassThroughMiddlewareDefault middleware that passes results through without modification.