Table of Contents

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

toolCall Message.ToolCall

The of tool call the AI model chose to be invoked.

tools IEnumerable<object>

The collection of tools to be used for invocation.

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<ToolResult>

An asynchronous stream of results from the tool invocations.