MCPcopy Index your code
hub / github.com/TanStack/ai / printTable

Function printTable

packages/ai-code-mode/models-eval/run-eval.ts:687–729  ·  view source on GitHub ↗
(rows: Array<EvalRow>)

Source from the content-addressed store, hash-verified

685}
686
687function printTable(rows: Array<EvalRow>) {
688 console.log('\n=== Results ===\n')
689 const nameW = 22
690 const modelW = 38
691 const starsW = 5
692 const accW = 4
693 const compW = 4
694 const tsW = 3
695 const cmW = 3
696 const msW = 8
697
698 const header = `${'Model'.padEnd(nameW)} ${'Id'.padEnd(modelW)} ${'★'.padStart(starsW)} ${'ms'.padStart(msW)} ${'Acc'.padStart(accW)} ${'Cmp'.padStart(compW)} ${'TS'.padStart(tsW)} ${'CME'.padStart(cmW)} ${'Spd'.padStart(3)} ${'Tok'.padStart(3)} ${'Stb'.padStart(3)} Error / summary`
699 console.log(header)
700 console.log('-'.repeat(header.length + 10))
701
702 for (const r of rows) {
703 const acc = r.judge?.accuracy !== undefined ? String(r.judge.accuracy) : '-'
704 const comp =
705 r.judge?.comprehensiveness !== undefined
706 ? String(r.judge.comprehensiveness)
707 : '-'
708 const tsq =
709 r.judge?.typescriptQuality !== undefined
710 ? String(r.judge.typescriptQuality)
711 : '-'
712 const cme =
713 r.judge?.codeModeEfficiency !== undefined
714 ? String(r.judge.codeModeEfficiency)
715 : '-'
716 const stars = r.stars
717 ? `${'★'.repeat(r.stars)}${'☆'.repeat(3 - r.stars)}`
718 : '-'
719 const err = r.error || ''
720 const summary = r.judge?.summary
721 ? r.judge.summary.replace(/\s+/g, ' ').slice(0, 120)
722 : ''
723 const tail = err || summary
724 console.log(
725 `${r.name.slice(0, nameW - 1).padEnd(nameW)} ${r.model.slice(0, modelW - 1).padEnd(modelW)} ${stars.padStart(starsW)} ${String(r.durationMs).padStart(msW)} ${acc.padStart(accW)} ${comp.padStart(compW)} ${tsq.padStart(tsW)} ${cme.padStart(cmW)} ${String(r.speedTier).padStart(3)} ${String(r.tokenEfficiencyTier).padStart(3)} ${String(r.stabilityTier).padStart(3)} ${tail}`,
726 )
727 }
728 console.log('')
729}
730
731async function main() {
732 const {

Callers 2

judgeLatestSessionFunction · 0.85
mainFunction · 0.85

Calls 2

logMethod · 0.80
replaceMethod · 0.65

Tested by

no test coverage detected