Interface FlowRecord

All Known Implementing Classes:
ActivityRecord, EvaluationRecord, GuardrailDecisionRecord, InteractionRecord

public sealed interface FlowRecord permits InteractionRecord, ActivityRecord, GuardrailDecisionRecord, EvaluationRecord
A record of a flow, as LedgerClient.getFlowRecords(String) returns it. A later SDK version can add kinds of records.

Not for user extension.

  • Method Summary

    Modifier and Type
    Method
    Description
    When the record was recorded.
    static String
    transcript(List<? extends FlowRecord> records)
    The records rendered as a readable transcript, for example for an LLM judge.
  • Method Details

    • timestamp

      Instant timestamp()
      When the record was recorded.
    • transcript

      static String transcript(List<? extends FlowRecord> records)
      The records rendered as a readable transcript, for example for an LLM judge. The transcript has one block for each record, in the order of the list:
      • An InteractionRecord starts with a line that names the agent component id. When the interaction has a TaskContext, the line also names the instance id, the task name, the task id and the iteration number. Activity lines name the same instance id and task id. The lines of InteractionRecord.transcript() follow, with one difference: the System: line is written the first time a system message appears for an agent component id, and again only when it differs from the last one written for that agent component id.
      • An ActivityRecord is one line for each event. Each line names the agent component id and the instance id. A typed event writes its fields, and ActivityRecord.Event.Other writes its kind.
      • A GuardrailDecisionRecord is one line with the guardrail name, the agent component id, the boundary, the tool name when there is one, the decision and the explanation. When the list holds the interaction that the decision was made in, and that interaction has a TaskContext, the line also names the instance id. In a flow, the runtime records a decision while its interaction runs and the interaction when it ends, so the line comes before the block of its interaction. The line says report only when the decision did not stop the interaction because the guardrail only reports. For a GuardrailDecisionRecord.Decision.FAIL of a guardrail that does not only report, the line gives the fail mode.
      • An EvaluationRecord is left out, so a judge does not read the verdicts of other evaluators.

      An empty list gives an empty string.

      Parameters:
      records - the records to render, such as the records of every page of a flow
      Returns:
      the transcript of the records