DelegateToolMiddleware

Models & Types · AiDotNet.Agentic.Pipeline

An IToolMiddleware backed by a delegate — the quick way to add a one-off tool filter (logging, argument fix-up, a guard) without declaring a class.

Implements: IToolMiddleware

For Beginners

The do-it-yourself tool filter: give it a function that receives the call and the “run the tool” handle, and it becomes a reusable wrapper.

Constructors

Constructor Summary
DelegateToolMiddleware(Func<ToolInvocationContext, ToolPipelineDelegate, CancellationToken, Task<ToolInvocationResult>> handler) Initializes a new delegate tool middleware.

Methods

Method Summary
Task<ToolInvocationResult> InvokeAsync(ToolInvocationContext context, ToolPipelineDelegate next, CancellationToken cancellationToken)