pub struct SkillReviser { /* private fields */ }Expand description
Produces revisions for skills that misled a run.
Implementations§
Source§impl SkillReviser
impl SkillReviser
pub fn new(model: Arc<dyn Model>) -> Self
pub fn with_policy(self, policy: RevisePolicy) -> Self
pub fn with_max_total_revisions(self, n: u32) -> Self
pub fn with_max_revisions_per_day(self, n: u32) -> Self
Sourcepub fn with_today(self, day: impl Into<String>) -> Self
pub fn with_today(self, day: impl Into<String>) -> Self
Override “today” (YYYY-MM-DD). For tests, and for hosts that keep their
own clock (a scheduler replaying yesterday’s episodes should date the
revision when it happens, not when the episode did).
pub fn policy(&self) -> &RevisePolicy
Sourcepub fn check(&self, req: &RevisionRequest) -> Result<RevisionGate, ReviseError>
pub fn check(&self, req: &RevisionRequest) -> Result<RevisionGate, ReviseError>
The cap and eligibility decision, with no model call.
Sourcepub async fn revise(
&self,
req: &RevisionRequest,
) -> Result<Revision, ReviseError>
pub async fn revise( &self, req: &RevisionRequest, ) -> Result<Revision, ReviseError>
Check the caps, then (only if they allow) spend one model call to revise.
Never writes. Hand the returned SkillRevision to a reviewer, or call
SkillRevision::write_to.
Auto Trait Implementations§
impl !RefUnwindSafe for SkillReviser
impl !UnwindSafe for SkillReviser
impl Forget for SkillReviser
impl Freeze for SkillReviser
impl Send for SkillReviser
impl Sync for SkillReviser
impl Unpin for SkillReviser
impl UnsafeUnpin for SkillReviser
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