Interface: LessonDistillationBuilder
Defined in: builders/lesson-distillation-builder.ts:10
Fluent configurator for contrastive lesson distillation ($d in .distillWith(model, $d => ...)).
Captures loop recovery triggers, beforeStop gate recovery thresholds, and distillation guidelines used when extracting empirical lessons from failure-to-pass trajectories.
Methods
build()
build(): LessonDistillationConfig;Defined in: builders/lesson-distillation-builder.ts:51
Compiles and returns the frozen LessonDistillationConfig.
Finalizes the distiller model, recovery triggers, and guidelines into a passive AST record.
Returns
Deeply frozen distillation configuration.
guidelines()
guidelines(source): LessonDistillationBuilder;Defined in: builders/lesson-distillation-builder.ts:42
Binds distillation guidelines text or external SourceASTNode<string>.
Injected into the distiller model's prompt when extracting candidate lessons.
Parameters
| Parameter | Type | Description |
|---|---|---|
source | MaybeSource<string> | Inline guidelines string or source AST node. |
Returns
LessonDistillationBuilder
New immutable distillation builder.
onGateRecovery()
onGateRecovery(opts?): LessonDistillationBuilder;Defined in: builders/lesson-distillation-builder.ts:31
Enables contrastive distillation on in-session beforeStop gate recoveries.
Triggers distillation when an agent fails at least minFailedChecks before subsequently passing beforeStop.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts? | { minFailedChecks?: number; } | Minimum failed check threshold options. |
opts.minFailedChecks? | number | - |
Returns
LessonDistillationBuilder
New immutable distillation builder.
onLoopRecovery()
onLoopRecovery(enabled?): LessonDistillationBuilder;Defined in: builders/lesson-distillation-builder.ts:20
Enables or disables contrastive distillation on outer P.loop recovery iterations.
Pairs the most recent rejected .act() trajectory with the subsequent accepted iteration trajectory.
Parameters
| Parameter | Type | Description |
|---|---|---|
enabled? | boolean | Whether outer loop recovery distillation is active. |
Returns
LessonDistillationBuilder
New immutable distillation builder.