Method OnToolInvocationAsync
- Namespace
- LMKit.TextGeneration.Filters
- Assembly
- LM-Kit.NET.dll
OnToolInvocationAsync(ToolInvocationFilterContext, Func<ToolInvocationFilterContext, Task>)
Called when a tool is about to be invoked during the automatic tool-calling loop.
Task OnToolInvocationAsync(ToolInvocationFilterContext context, Func<ToolInvocationFilterContext, Task> next)
Parameters
contextToolInvocationFilterContextThe filter context. Modify Cancel to skip execution, Result to override the result, or Terminate to stop the tool-calling loop.
nextFunc<ToolInvocationFilterContext, Task>The next filter in the pipeline, or the actual tool invocation if this is the last filter. Call
await next(context)to continue the pipeline.
Returns
- Task
A task representing the asynchronous operation.