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>
Constructors
Section titled “Constructors”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. |
Properties
Section titled “Properties”Definition
Section titled “Definition”public ModelTool Definition { get; init; }The name, the description, and the input schema the model sees.
Value: ModelTool
ExecuteAsync
Section titled “ExecuteAsync”public Func<ModelToolCall, CancellationToken, Task<ToolLoopResult>> ExecuteAsync { get; init; }Runs the call and answers what the model reads.
Value: Func<ModelToolCall, CancellationToken, Task<ToolLoopResult>>