ConfidenceThresholdInjector class

Validates that the model's output confidence stays above a threshold.

This injector runs inference on model during inject and checks the confidence field in the resulting AIOutput. If confidence is below threshold, it throws an AIInferenceError.

Implemented types

Constructors

ConfidenceThresholdInjector({required AIModelAdapter model, double threshold = 0.5})
Creates a ConfidenceThresholdInjector.

Properties

description String
Detailed description of what this injector simulates.
no setteroverride
failed bool
Returns true if validation failed during inject.
no setter
hashCode int
The hash code for this object.
no setterinherited
lastConfidence double
The confidence score of the last run inference.
no setter
model AIModelAdapter
The model adapter to stress.
final
name String
Short human-readable name shown in reports and logs.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
threshold double
The minimum acceptable confidence score (between 0.0 and 1.0).
final
type FaultType
The FaultType category this injector belongs to.
no setteroverride

Methods

inject() Future<void>
Runs probe inference, checks confidence, and throws if below threshold.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() Future<void>
Resets the validator and model state.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited