Header menu logo Nao

TurnRecorder Type

An `IEventConsumer` that accumulates the progress signals of a single turn into a structured `TurnRecord`. Subscribe it to the `IEventBus` for the duration of one turn (matched by `scope.ActionId = turnId`), then call `Snapshot`. The orchestrator publishes `ToolInvoked`/`ToolCompleted` (and `SubAgentInvoked`/`SubAgentCompleted`) pairs sequentially, so we match each result to the earliest still-unmatched invocation of the same name (FIFO).

Constructors

Constructor Description

TurnRecorder(turnId, sessionId, userId, workspaceKey, agentName, agentVersion, input, resolveTool)

Full Usage: TurnRecorder(turnId, sessionId, userId, workspaceKey, agentName, agentVersion, input, resolveTool)

Parameters:
    turnId : string
    sessionId : string
    userId : string
    workspaceKey : string
    agentName : string
    agentVersion : string option
    input : string
    resolveTool : string -> (string option * ToolProvenance option) option

Returns: TurnRecorder
turnId : string
sessionId : string
userId : string
workspaceKey : string
agentName : string
agentVersion : string option
input : string
resolveTool : string -> (string option * ToolProvenance option) option
Returns: TurnRecorder

Instance members

Instance member Description

this.Snapshot

Full Usage: this.Snapshot

Returns: TurnRecord

The accumulated record so far. Safe to call after the turn completes.

Returns: TurnRecord

this.Steps

Full Usage: this.Steps

Returns: TurnStep list

The ordered process steps — the orchestrator's reasoning per round plus each tool/sub-agent call — as they happened. Lets a frontend show the whole process, not just the final answer. The final round's reasoning (which IS the answer) is omitted since the answer is shown separately.

Returns: TurnStep list

this.TurnId

Full Usage: this.TurnId

Returns: string
Returns: string

Type something to start searching.