Builds an executor that drafts, reviews and refines until a goal is met.
Draft and review executors, plus the refine and satisfied predicates.
An executor that iterates up to maxIterations times.
maxIterations
export default createGoalExecutor({ draft: "core/turn-1", review: "core/critic-1", satisfied: (review) => extractContentText(review).includes("APPROVED"), refine: (request, answer, review) => appendUserMessage(request, extractContentText(review)),}); Copy
export default createGoalExecutor({ draft: "core/turn-1", review: "core/critic-1", satisfied: (review) => extractContentText(review).includes("APPROVED"), refine: (request, answer, review) => appendUserMessage(request, extractContentText(review)),});
Builds an executor that drafts, reviews and refines until a goal is met.