Class DefaultToolInvoker
- Namespace
- OllamaSharp.Tools
- Assembly
- OllamaSharp.dll
The default tool invoker that supports sync and async tools
public class DefaultToolInvoker : IToolInvoker
- Inheritance
-
DefaultToolInvoker
- Implements
- Inherited Members
Methods
InvokeAsync(ToolCall, IEnumerable<object>, CancellationToken)
Invokes a collection of tools by AI model tool calls asynchronously.
public 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.