pub struct SkillDistiller { /* private fields */ }Expand description
Decides whether a finished run is worth a skill, and drafts it.
Implementations§
Source§impl SkillDistiller
impl SkillDistiller
pub fn new(model: Arc<dyn Model>) -> Self
pub fn with_policy(self, policy: DistillPolicy) -> Self
pub fn with_min_tool_calls(self, n: usize) -> Self
pub fn with_similarity_threshold(self, t: f32) -> Self
pub fn policy(&self) -> &DistillPolicy
Sourcepub fn gate(&self, ep: &Episode, existing: &[ExistingSkill]) -> GateDecision
pub fn gate(&self, ep: &Episode, existing: &[ExistingSkill]) -> GateDecision
The whole trigger decision, with no model call and no I/O.
Checks run cheapest-first and return the first failure, so the reason a host logs is the most fundamental one rather than an incidental later check.
Sourcepub async fn distill(
&self,
ep: &Episode,
existing: &[ExistingSkill],
) -> Result<Distillation, DistillError>
pub async fn distill( &self, ep: &Episode, existing: &[ExistingSkill], ) -> Result<Distillation, DistillError>
Gate, then (only if it passes) spend one model call to draft a skill.
Never writes to disk. existing is the duplicate-suppression corpus —
use existing_skills_in to build it from a skills root, or pass the
caller’s own per-tenant view.
Sourcepub async fn distill_and_write(
&self,
ep: &Episode,
skills_root: &Path,
) -> Result<Option<PathBuf>, DistillError>
pub async fn distill_and_write( &self, ep: &Episode, skills_root: &Path, ) -> Result<Option<PathBuf>, DistillError>
Convenience for hosts that need neither per-tenant scoping nor a human
gate: scan skills_root for duplicates, distil, and write on success.
Returns the written path, or None when the gate declined.
Auto Trait Implementations§
impl !RefUnwindSafe for SkillDistiller
impl !UnwindSafe for SkillDistiller
impl Forget for SkillDistiller
impl Freeze for SkillDistiller
impl Send for SkillDistiller
impl Sync for SkillDistiller
impl Unpin for SkillDistiller
impl UnsafeUnpin for SkillDistiller
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