Neutrome SDK reference
    Preparing search index...

    Function createGoalExecutor

    • Builds an executor that drafts, reviews and refines until a goal is met.

      Parameters

      • options: GoalExecutorOptions

        Draft and review executors, plus the refine and satisfied predicates.

      Returns Executor

      An executor that iterates up to maxIterations times.

      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)),
      });