onTrialEnd method

  1. @override
Future<void> onTrialEnd({
  1. required Trial trial,
  2. required Transcript transcript,
  3. required Outcome outcome,
  4. required List<Score> scores,
})
override

Called when trial finishes with the final transcript, outcome, and scores. Implementations should attach all scores here.

Implementation

@override
Future<void> onTrialEnd({
  required Trial trial,
  required Transcript transcript,
  required Outcome outcome,
  required List<Score> scores,
}) async {
  _write({
    'kind': 'trial_end',
    'trial': trial.toJson(),
    'transcript': transcript.toJson(),
    'outcome': outcome.toJson(),
    'scores': scores.map((s) => s.toJson()).toList(),
  });
}