Property Filters
Filters
Gets or sets the filter pipeline that intercepts prompt, completion, and tool invocation stages.
public FilterPipeline Filters { get; set; }
Property Value
Examples
Adding filters directly on an agent:
using LMKit.Agents;
using LMKit.TextGeneration.Filters;
var agent = new Agent(model);
agent.Filters = new FilterPipeline();
agent.Filters.AddPromptFilter(async (ctx, next) =>
{
Console.WriteLine($"Prompt: {ctx.Prompt}");
await next(ctx);
});
Remarks
When set, the pipeline is applied to the underlying MultiTurnConversation when the agent executes. Filters are complementary to events.