IterationRecord
NexusLabs.Needlr.AgentFramework¶
NexusLabs.Needlr.AgentFramework.Iterative¶
IterationRecord Class¶
Captures what happened during a single iteration of an IIterativeAgentLoop, including tool calls made, any text response produced, token usage, and wall-clock duration.
public sealed record IterationRecord : System.IEquatable<NexusLabs.Needlr.AgentFramework.Iterative.IterationRecord>
Inheritance System.Object 🡒 IterationRecord
Implements System.IEquatable<IterationRecord>
Constructors¶
IterationRecord(int, IReadOnlyList<ToolCallResult>, string, TokenUsage, TimeSpan, int) Constructor¶
Captures what happened during a single iteration of an IIterativeAgentLoop, including tool calls made, any text response produced, token usage, and wall-clock duration.
public IterationRecord(int Iteration, System.Collections.Generic.IReadOnlyList<NexusLabs.Needlr.AgentFramework.Iterative.ToolCallResult> ToolCalls, string? ResponseText, NexusLabs.Needlr.AgentFramework.Diagnostics.TokenUsage Tokens, System.TimeSpan Duration, int LlmCallCount);
Parameters¶
Iteration System.Int32
Zero-based iteration index.
ToolCalls System.Collections.Generic.IReadOnlyList<ToolCallResult>
All tool calls executed during this iteration, in execution order. Empty if the model produced a text response without requesting tools.
ResponseText System.String
The text content the model produced during this iteration, or null if the model only made tool calls. In OneRoundTrip and MultiRound modes, this is the final text response after tool results were sent back.
Tokens TokenUsage
Aggregate token usage across all LLM calls in this iteration.
Duration System.TimeSpan
Wall-clock time for the entire iteration (LLM calls + tool execution).
LlmCallCount System.Int32
Number of LLM calls made during this iteration. Always 1 for SingleCall, at most 2 for OneRoundTrip.
Properties¶
IterationRecord.Duration Property¶
Wall-clock time for the entire iteration (LLM calls + tool execution).
Property Value¶
IterationRecord.Iteration Property¶
Zero-based iteration index.
Property Value¶
IterationRecord.LlmCallCount Property¶
Number of LLM calls made during this iteration. Always 1 for SingleCall, at most 2 for OneRoundTrip.
Property Value¶
IterationRecord.ResponseText Property¶
The text content the model produced during this iteration, or null if the model only made tool calls. In OneRoundTrip and MultiRound modes, this is the final text response after tool results were sent back.
Property Value¶
IterationRecord.Tokens Property¶
Aggregate token usage across all LLM calls in this iteration.
Property Value¶
IterationRecord.ToolCalls Property¶
All tool calls executed during this iteration, in execution order. Empty if the model produced a text response without requesting tools.
public System.Collections.Generic.IReadOnlyList<NexusLabs.Needlr.AgentFramework.Iterative.ToolCallResult> ToolCalls { get; init; }