Contents

SubjectInferenceError

A value that describes a failure to produce a subject for a sample.

Declaration

enum SubjectInferenceError

Overview

The evaluation runner records these values in the "SubjectInferenceError" column of detailed. The evaluation runner omits this column entirely on a clean run where the run produces every subject successfully, so check for the column’s presence before reading it.

let result = try await evaluation.run()
if result.detailed.containsColumn("SubjectInferenceError") {
    let column = result.detailed["SubjectInferenceError", SubjectInferenceError.self]
    for (index, failure) in column.enumerated() {
        if let failure {
            print("Sample \(index) failed: \(failure.localizedDescription)")
        }
    }
}

Rows with a SubjectInferenceError value also have a nil Response, so failed samples are identifiable structurally. This is useful for filtering and re-running them. This error is distinct from EvaluatorError, which covers failures that occur after subject production succeeds.

Topics

Enumeration Cases

See Also

Errors