( models: SmokeModel[], prompts: SmokePrompt[], onlyKeys: Set<string> | null, )
| 309 | } |
| 310 | |
| 311 | async function runMatrix( |
| 312 | models: SmokeModel[], |
| 313 | prompts: SmokePrompt[], |
| 314 | onlyKeys: Set<string> | null, |
| 315 | ): Promise<RunResult[]> { |
| 316 | const results: RunResult[] = []; |
| 317 | for (const m of models) { |
| 318 | const envName = ENV_KEY[m.provider]; |
| 319 | if (!envName) { |
| 320 | throw new Error( |
| 321 | `Unsupported provider in smoke config: ${m.provider}. Add it to ENV_KEY or fix scripts/smoke-models.toml.`, |
| 322 | ); |
| 323 | } |
| 324 | |
| 325 | const apiKey = process.env[envName]; |
| 326 | if (!apiKey) { |
| 327 | console.log( |
| 328 | `${COLOR.dim}— ${m.provider}/${m.modelId} (no $${envName}; skipped)${COLOR.reset}`, |
| 329 | ); |
| 330 | continue; |
| 331 | } |
| 332 | for (const p of prompts) { |
| 333 | if (onlyKeys && !onlyKeys.has(`${m.provider}/${m.modelId}|${p.name}`)) continue; |
| 334 | const r = await runOne(m, p, apiKey); |
| 335 | printResult(r); |
| 336 | results.push(r); |
| 337 | } |
| 338 | } |
| 339 | return results; |
| 340 | } |
| 341 | |
| 342 | function printSummary(results: RunResult[]): void { |
| 343 | const passed = results.filter((r) => r.ok).length; |
no test coverage detected