| 884 | } |
| 885 | |
| 886 | function printSummary(summary: RunSummary): void { |
| 887 | console.log("\nLongMemEval summary"); |
| 888 | console.table( |
| 889 | summary.rows.map((row) => ({ |
| 890 | category: row.category, |
| 891 | correct: row.correct, |
| 892 | total: row.total, |
| 893 | accuracy: row.total === 0 ? "n/a" : `${(row.accuracy * 100).toFixed(2)}%`, |
| 894 | })), |
| 895 | ); |
| 896 | console.log(`Estimated total cost: $${summary.costs.totalEstimatedUsd.toFixed(6)}`); |
| 897 | console.log(`Actual OpenCode cost: $${summary.costs.totalActualUsd.toFixed(6)}`); |
| 898 | console.log(`Total tokens: ${summary.tokens.totalTokens}`); |
| 899 | } |
| 900 | |
| 901 | async function writeSummary(config: RunnerConfig, resultsMap: Map<string, QuestionResultRecord>, selectedCount: number): Promise<void> { |
| 902 | const orderedResults = Array.from(resultsMap.values()).sort((left, right) => left.dataset_index - right.dataset_index); |