pub struct SafetyScorer { /* private fields */ }Expand description
Scores agent execution for guardrail safety.
Checks for GuardrailDenied events in the event collector.
Score is 0.0 if any denial occurred, 1.0 otherwise.
Warnings pass (only denials fail).
Important: The collector accumulates events across cases. When using
EvalRunner::run with multiple cases, attach the same collector via
EvalRunner::with_event_collector so per-case events are isolated.
When calling EvalRunner::score_result manually, call clear_events
yourself between cases.
Implementations§
Source§impl SafetyScorer
impl SafetyScorer
Sourcepub fn new(collector: EventCollector) -> Self
pub fn new(collector: EventCollector) -> Self
Create a safety scorer that reads from the given event collector.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SafetyScorer
impl RefUnwindSafe for SafetyScorer
impl Send for SafetyScorer
impl Sync for SafetyScorer
impl Unpin for SafetyScorer
impl UnsafeUnpin for SafetyScorer
impl UnwindSafe for SafetyScorer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more