< Summary

Information
Class: NexusLabs.Needlr.AgentFramework.Iterative.IterationRecord
Assembly: NexusLabs.Needlr.AgentFramework
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework/Iterative/IterationRecord.cs
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 41
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_Iteration()100%11100%
get_ToolCalls()100%11100%
get_FinalResponse()100%11100%
get_Tokens()100%11100%
get_Duration()100%11100%
get_LlmCallCount()100%11100%
get_ToolCallCount()100%11100%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework/Iterative/IterationRecord.cs

#LineLine coverage
 1using Microsoft.Extensions.AI;
 2
 3using NexusLabs.Needlr.AgentFramework.Diagnostics;
 4
 5namespace NexusLabs.Needlr.AgentFramework.Iterative;
 6
 7/// <summary>
 8/// Captures what happened during a single iteration of an <see cref="IIterativeAgentLoop"/>,
 9/// including tool calls made, any text response produced, token usage, and wall-clock duration.
 10/// </summary>
 11/// <param name="Iteration">Zero-based iteration index.</param>
 12/// <param name="ToolCalls">
 13/// All tool calls executed during this iteration, in execution order.
 14/// Empty if the model produced a text response without requesting tools.
 15/// </param>
 16/// <param name="FinalResponse">
 17/// The final <see cref="ChatResponse"/> produced by the model during this iteration
 18/// (preserving full message content, role, usage, and metadata), or
 19/// <see langword="null"/> if the model only made tool calls without a terminating
 20/// text response. In <see cref="ToolResultMode.OneRoundTrip"/> and
 21/// <see cref="ToolResultMode.MultiRound"/> modes, this is the response emitted after
 22/// tool results were sent back. Call <c>.Text</c> for a flat text view when evaluating.
 23/// </param>
 24/// <param name="Tokens">Aggregate token usage across all LLM calls in this iteration.</param>
 25/// <param name="Duration">Wall-clock time for the entire iteration (LLM calls + tool execution).</param>
 26/// <param name="LlmCallCount">
 27/// Number of LLM calls made during this iteration. Always 1 for
 28/// <see cref="ToolResultMode.SingleCall"/>, at most 2 for
 29/// <see cref="ToolResultMode.OneRoundTrip"/>.
 30/// </param>
 31/// <param name="ToolCallCount">
 32/// Number of tool calls executed during this iteration.
 33/// </param>
 26234public sealed record IterationRecord(
 1435    int Iteration,
 4536    IReadOnlyList<ToolCallResult> ToolCalls,
 5937    ChatResponse? FinalResponse,
 4238    TokenUsage Tokens,
 139    TimeSpan Duration,
 740    int LlmCallCount,
 26641    int ToolCallCount);