Method OnPromptAsync
- Namespace
- LMKit.TextGeneration.Filters
- Assembly
- LM-Kit.NET.dll
OnPromptAsync(PromptFilterContext, Func<PromptFilterContext, Task>)
Called when a prompt is about to be submitted for inference.
public Task OnPromptAsync(PromptFilterContext context, Func<PromptFilterContext, Task> next)
Parameters
contextPromptFilterContextThe filter context. Modify Prompt to rewrite the prompt, or set Result to short-circuit inference.
nextFunc<PromptFilterContext, Task>The next filter in the pipeline, or the inference call itself if this is the last filter. Call
await next(context)to continue the pipeline.
Returns
- Task
A task representing the asynchronous operation.