Skip to content

ToolLoopTool

Namespace: E2E

public sealed record ToolLoopTool : IEquatable<ToolLoopTool>

One tool of a loop’s vocabulary: what the model is told, and what runs when it calls it. Upstream’s tools are AI SDK tools, which the port has no counterpart of, so this is the .NET shape of one entry of its ToolSet. A tool that throws is read by the model as a failed call, except a hard stop of the step, which ends the loop.

Inheritance: object

Implements: IEquatable<ToolLoopTool>

View source

ToolLoopTool(ModelTool, Func<ModelToolCall, CancellationToken, Task<ToolLoopResult>>)

Section titled “ToolLoopTool(ModelTool, Func<ModelToolCall, CancellationToken, Task<ToolLoopResult>>)”
public ToolLoopTool(ModelTool Definition, Func<ModelToolCall, CancellationToken, Task<ToolLoopResult>> ExecuteAsync)

One tool of a loop’s vocabulary: what the model is told, and what runs when it calls it. Upstream’s tools are AI SDK tools, which the port has no counterpart of, so this is the .NET shape of one entry of its ToolSet. A tool that throws is read by the model as a failed call, except a hard stop of the step, which ends the loop.

Parameters

Name Type Description
Definition ModelTool The name, the description, and the input schema the model sees.
ExecuteAsync Func<ModelToolCall, CancellationToken, Task<ToolLoopResult>> Runs the call and answers what the model reads.

View source

public ModelTool Definition { get; init; }

The name, the description, and the input schema the model sees.

Value: ModelTool

View source

public Func<ModelToolCall, CancellationToken, Task<ToolLoopResult>> ExecuteAsync { get; init; }

Runs the call and answers what the model reads.

Value: Func<ModelToolCall, CancellationToken, Task<ToolLoopResult>>

View source