import { LoopUntilScored } from "~/components/LoopUntilScored";
import { stakesToThreshold } from "~/components/extract-prompt";
export default smithers((ctx) => {
const draft = ctx.outputMaybe(outputs.draft, { nodeId: "extract:draft" });
return (
<Workflow name="extract">
<LoopUntilScored
idPrefix="extract"
currentScore={draft?.score ?? null}
threshold={stakesToThreshold("high")}
maxIterations={10}
>
<Task id="extract:draft" output={outputs.draft} agent={agent}>
{/* prompt instructs the agent to self-score in its output */}
</Task>
</LoopUntilScored>
</Workflow>
);
});