Interface IToolInvoker
- Namespace
- OllamaSharp.Tools
- Assembly
- OllamaSharp.dll
Defines an interface for invoking tools asynchronously.
public interface IToolInvoker
Methods
InvokeAsync(ToolCall, IEnumerable<object>, CancellationToken)
Invokes a collection of tools by AI model tool calls asynchronously.
Task<ToolResult> InvokeAsync(Message.ToolCall toolCall, IEnumerable<object> tools, CancellationToken cancellationToken)
Parameters
toolCallMessage.ToolCallThe of tool call the AI model chose to be invoked.
toolsIEnumerable<object>The collection of tools to be used for invocation.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<ToolResult>
An asynchronous stream of results from the tool invocations.