RepeatUntilAcceptable

data class RepeatUntilAcceptable(val maxIterations: Int = 3, val scoreThreshold: <Error class: unknown class> = 0.9)

Primitive for building repeat until acceptable workflows. See https://www.anthropic.com/engineering/building-effective-agents This is the Evaluator Optimizer pattern

Constructors

Link copied to clipboard
constructor(maxIterations: Int = 3, scoreThreshold: <Error class: unknown class> = 0.9)

Properties

Link copied to clipboard
Link copied to clipboard
val scoreThreshold: <Error class: unknown class> = 0.9

Functions

Link copied to clipboard
inline fun <RESULT : Any, FEEDBACK : Feedback> build(noinline task: (TransformationActionContext<AttemptHistory<RESULT, FEEDBACK>, RESULT>) -> RESULT, noinline evaluator: (TransformationActionContext<AttemptHistory<RESULT, FEEDBACK>, FEEDBACK>) -> FEEDBACK, noinline acceptanceCriteria: (FEEDBACK) -> Boolean = { it.score >= scoreThreshold }): AgentScopeBuilder<RESULT>