Skip to content

Commit fc17543

Browse files
committed
refactor: pass root prompt to executor#initializeEval
This allows eval IDs to be based on prompt names/IDs. This is useful for e.g. supporting pre-scrape executors and mapping based on eval IDs to pre-sampled outputs.
1 parent d829c1e commit fc17543

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

runner/orchestration/executors/executor.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ export type EvalID = string & {__evalID: true};
2323
export type WorkerQueueType = PQueue;
2424

2525
export const executorSchema = z.object({
26-
initializeEval: z.function(z.tuple([]), z.promise(z.custom<EvalID>())),
26+
initializeEval: z.function(
27+
z.tuple([z.custom<RootPromptDefinition>()]),
28+
z.promise(z.custom<EvalID>()),
29+
),
2730
generateInitialFiles: z.function(
2831
z.tuple([
2932
z.custom<EvalID>().describe('ID of the eval'),

runner/orchestration/generate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export async function generateCodeAndAssess(options: AssessmentConfig): Promise<
158158
allTasks.push(
159159
appConcurrencyQueue.add(async () => {
160160
const evaluate = async () => {
161-
const evalID = await env.executor.initializeEval();
161+
const evalID = await env.executor.initializeEval(rootPromptDef);
162162
let results: AssessmentResult[] | undefined;
163163

164164
try {

0 commit comments

Comments
 (0)