From a2375eb5373498a3f4685617d0353cc48193402f Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Mon, 13 Oct 2025 10:57:37 -0700 Subject: [PATCH] Refactor: Use shared prompt from README config --- scripts/run-benchmark.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/run-benchmark.js b/scripts/run-benchmark.js index a2f919d..d9aa9a3 100644 --- a/scripts/run-benchmark.js +++ b/scripts/run-benchmark.js @@ -32,6 +32,7 @@ const main = async () => { const readme = await fs.readFile(README_PATH, 'utf-8'); const models = readme.match(/\n([\s\S]+?)\n/)[1].trim().split('\n'); const percentage = parseInt(readme.match(/RUN_PERCENTAGE:\s*(\d+)/)?.[1] ?? '100', 10); + const sharedPrompt = readme.match(/SHARED_PROMPT:\s*"([\s\S]+?)"/)?.[1] ?? ''; const allTestDirs = (await fs.readdir(TESTS_DIR, { withFileTypes: true })) .filter(d => d.isDirectory()).map(d => d.name).sort(); @@ -45,10 +46,9 @@ const main = async () => { for (const model of models) { genData[model] = {}; for (const dir of testsToRun) { - const testModule = await import(pathToFileURL(path.join(TESTS_DIR, dir, 'test.js'))); - const { prompt, functionName } = testModule.default; + const { prompt, functionName } = (await import(pathToFileURL(path.join(TESTS_DIR, dir, 'test.js')))).default; console.log(`Generating ${dir} for ${model}...`); - const result = await getLlmCode(prompt, model, functionName); + const result = await getLlmCode(`${sharedPrompt}\n\n${prompt.trim()}`, model, functionName); genData[model][dir] = result?.duration ?? null; if (!result) continue;