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

Function loadBenchmarkConfig

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

Source from the content-addressed store, hash-verified

216}
217
218async function loadBenchmarkConfig(target, options = {}) {
219 if (options.configPath) {
220 const config = readJson(path.resolve(options.configPath));
221 return {
222 config: normalizeConfig(await config, target),
223 configPath: path.resolve(options.configPath),
224 source: "file",
225 };
226 }
227
228 const defaultConfigPath = defaultBenchmarkConfigPath(target);
229 if (await pathExists(defaultConfigPath)) {
230 const config = await readJson(defaultConfigPath);
231 return {
232 config: normalizeConfig(config, target),
233 configPath: defaultConfigPath,
234 source: "file",
235 };
236 }
237
238 const generated = await createStarterBenchmarkConfig(target, options);
239 return {
240 config: generated,
241 configPath: null,
242 source: "generated",
243 };
244}
245
246async function runProcessCapture({
247 command,

Callers 1

runBenchmarkFunction · 0.85

Calls 5

readJsonFunction · 0.90
pathExistsFunction · 0.90
normalizeConfigFunction · 0.85

Tested by

no test coverage detected