MCPcopy Create free account
hub / github.com/openai/plugins / initializeBenchmark

Function initializeBenchmark

plugins/plugin-eval/src/core/benchmark.js:453–488  ·  view source on GitHub ↗
(targetPath, options = {})

Source from the content-addressed store, hash-verified

451}
452
453export async function initializeBenchmark(targetPath, options = {}) {
454 const target = await resolveTarget(targetPath);
455 const config = await createStarterBenchmarkConfig(target, options);
456 const outputPath = path.resolve(options.outputPath || defaultBenchmarkConfigPath(target));
457 await writeJson(outputPath, config);
458
459 const payload = {
460 kind: "benchmark-template-init",
461 createdAt: new Date().toISOString(),
462 target: {
463 ...target,
464 relativePath: relativePath(process.cwd(), target.path),
465 },
466 configPath: outputPath,
467 scenarioCount: config.scenarios.length,
468 notes: config.notes,
469 setupQuestions: config.setupQuestions || [],
470 nextSteps: [
471 `Edit ${formatCommandPath(outputPath)} so workspace.sourcePath, scenarios, and verifiers match your real workflow.`,
472 `Run the benchmark with: plugin-eval benchmark ${formatCommandPath(target.path)} --config ${formatCommandPath(outputPath)}`,
473 "The benchmark result will be written under .plugin-eval/runs/<timestamp>/benchmark-run.json.",
474 ],
475 workflowGuide: await buildWorkflowGuide(target.path, {
476 goal: "benchmark",
477 }),
478 artifact: createArtifact({
479 id: "benchmark-template",
480 type: "benchmark-template",
481 label: "Benchmark template",
482 description: "Starter benchmark config for Codex CLI execution.",
483 path: outputPath,
484 }),
485 };
486 payload.nextAction = createBenchmarkTemplateNextAction(payload);
487 return payload;
488}
489
490export async function runBenchmark(targetPath, options = {}) {
491 const target = await resolveTarget(targetPath);

Callers 2

runCliFunction · 0.90

Calls 9

resolveTargetFunction · 0.90
writeJsonFunction · 0.90
relativePathFunction · 0.90
formatCommandPathFunction · 0.90
buildWorkflowGuideFunction · 0.90
createArtifactFunction · 0.90

Tested by

no test coverage detected