Skip to content
Tracon

ToolLoopSettings

Namespace Tracon · Assembly Tracon.Abstractions.dll

Tool-call loop settings for a ModelBinding.

public sealed record ToolLoopSettings : IEquatable<ToolLoopSettings>
Inheritance
object ← ToolLoopSettings
Implements
IEquatable<ToolLoopSettings>
Inherited Members
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

The loop is the one the model pipeline builds around the provider client; it runs the tools the model asks for and sends their results back. Every member keeps the loop’s own default when it is left unset, so a binding without ModelBinding.ToolLoop behaves exactly as it did before the settings existed.

A fallback link runs the same agent’s tools, so it takes the primary binding’s loop settings as one object. The tools’ thread-safety and the limits of the agent do not change with the model.

public ToolLoopSettings()

Gets whether independent tool calls within one turn may run at the same time.

public bool AllowConcurrentToolCalls { get; init; }

bool

false by default: with no change, tool calls within a turn run one after another exactly as they do today. A tool body that is not written to be thread-safe (a non-thread-safe field it shares across calls, for example) is only safe to run concurrently with itself once this is turned on for its agent. It is not the same as ModelBinding.AllowMultipleToolCalls: that one lets the model ask for several calls in one turn, this one decides whether Tracon runs them at the same time.

Gets how many tool-call iterations in a row may fail before the loop rethrows the error; the loop’s default (3) is used when it is null.

public int? MaximumConsecutiveErrors { get; init; }

int?

0 rethrows the first failure. A negative value is rejected while the agent is built, with TraconCompilationException.

Gets whether the loop ends when the model asks for a tool the agent does not have; the loop’s default (false) is used when it is null.

public bool? TerminateOnUnknownCalls { get; init; }

bool?

With the default, the model gets an error result for the unknown call and the loop goes on. Set it to true to hand the unknown call back to the caller instead.

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(ToolLoopSettings? other)

other ToolLoopSettings?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(ToolLoopSettings?, ToolLoopSettings?)

Section titled “ operator ==(ToolLoopSettings?, ToolLoopSettings?)”
public static bool operator ==(ToolLoopSettings? left, ToolLoopSettings? right)

left ToolLoopSettings?

right ToolLoopSettings?

bool

operator !=(ToolLoopSettings?, ToolLoopSettings?)

Section titled “ operator !=(ToolLoopSettings?, ToolLoopSettings?)”
public static bool operator !=(ToolLoopSettings? left, ToolLoopSettings? right)

left ToolLoopSettings?

right ToolLoopSettings?

bool