MCPcopy Create free account
hub / github.com/PSPDFKit/nutrient-document-engine-mcp-server / EvaluationReporter

Class EvaluationReporter

evaluation/reporter.ts:13–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11 * Reporter class for formatting and displaying evaluation results
12 */
13export class EvaluationReporter {
14 /**
15 * Print comparison results
16 */
17 printComparison(results: FocusedEvaluationResults[]): void {
18 console.log('\n' + '='.repeat(80));
19 console.log('🏆 MODEL COMPARISON - TOOL USAGE EFFECTIVENESS');
20 console.log('='.repeat(80));
21
22 // Sort by overall score
23 const sorted = [...results].sort((a, b) => b.overallScore - a.overallScore);
24
25 console.log('\n📊 OVERALL RANKINGS:');
26 sorted.forEach((result, index) => {
27 const rank = index + 1;
28 const emoji = rank === 1 ? '🥇' : rank === 2 ? '🥈' : rank === 3 ? '🥉' : ' ';
29 console.log(
30 `${emoji} ${rank}. ${result.model.padEnd(20)} ${(result.overallScore * 100).toFixed(1)}%`
31 );
32 });
33
34 console.log('\n📋 DETAILED BREAKDOWN:');
35 console.log(
36 'Model'.padEnd(20) +
37 'Overall'.padEnd(10) +
38 'Tools'.padEnd(10) +
39 'Order'.padEnd(10) +
40 'Efficiency'
41 );
42 console.log('-'.repeat(60));
43
44 sorted.forEach(result => {
45 const overall = (result.overallScore * 100).toFixed(1) + '%';
46 const tools = (result.correctToolUsage * 100).toFixed(1) + '%';
47 const order = (result.correctOrderUsage * 100).toFixed(1) + '%';
48 const efficiency = (result.efficiencyScore * 100).toFixed(1) + '%';
49
50 console.log(
51 result.model.padEnd(20) +
52 overall.padEnd(10) +
53 tools.padEnd(10) +
54 order.padEnd(10) +
55 efficiency
56 );
57 });
58
59 // Find best and worst scenarios
60 console.log('\n🎯 KEY INSIGHTS:');
61
62 const allResults = results.flatMap(r => r.results);
63 const bestScenarios = allResults.filter(r => r.score === 1.0);
64 const worstScenarios = allResults.filter(r => r.score < 0.5);
65
66 if (bestScenarios.length > 0) {
67 const commonBest = this.findMostCommon(bestScenarios.map(r => r.scenarioId));
68 console.log(`✅ Best performing scenario: ${commonBest} (consistent across models)`);
69 }
70

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected