Classes
CLASS SamplingLoopStartPayload
Payload for sampling_loop_start — when sampling strategy begins.
Attributes:
strategy_name: Class name of the sampling strategy (e.g."RejectionSamplingStrategy").action: TheComponentbeing sampled.context: TheContextat the start of sampling.requirements: List ofRequirementinstances to validate against.loop_budget: Maximum number of sampling iterations allowed (writable).
CLASS SamplingIterationPayload
Payload for sampling_iteration — after each sampling attempt.
Attributes:
iteration: 1-based iteration number within the sampling loop.action: TheComponentused for this attempt.result: TheModelOutputThunkproduced by this attempt.validation_results: List of(Requirement, ValidationResult)tuples.all_validations_passed:Truewhen every requirement invalidation_resultspassed for this iteration (i.e., the sampling attempt succeeded).valid_count: Number of requirements that passed.total_count: Total number of requirements evaluated.
CLASS SamplingRepairPayload
Payload for sampling_repair — when repair is invoked after validation failure.
Attributes:
repair_type: Kind of repair (strategy-dependent, e.g."rejection","template").failed_action: TheComponentthat failed validation.failed_result: TheModelOutputThunkthat failed validation.failed_validations: List of(Requirement, ValidationResult)tuples that failed.repair_action: The repairedComponentto use for the next attempt.repair_context: TheContextto use for the next attempt.repair_iteration: 1-based iteration at which the repair was triggered.
CLASS SamplingLoopEndPayload
Payload for sampling_loop_end — when sampling completes.
Attributes:
success:Trueif at least one attempt passed all requirements.iterations_used: Total number of iterations the loop executed.final_result: The selectedModelOutputThunk(best success or best failure).final_action: TheComponentthat producedfinal_result.final_context: TheContextassociated withfinal_result.failure_reason: Human-readable reason whensuccessisFalse.all_results: List ofModelOutputThunkfrom every iteration.all_validations: Nested list —all_validations[i]is the list of(Requirement, ValidationResult)tuples for iteration i.