feat: add sveltekit pages, generate reports
This commit is contained in:
@@ -16,11 +16,9 @@ export interface BuildReportOpts {
|
||||
model: string;
|
||||
mcpUrl: string;
|
||||
rows: PerTaskRow[];
|
||||
meta?: Record<string, unknown>;
|
||||
prompts?: Partial<Record<ScenarioName, string>>;
|
||||
}
|
||||
|
||||
export function buildReport({ model, mcpUrl, rows, meta = {}, prompts = {} }: BuildReportOpts): ModelReport {
|
||||
export function buildReport({ model, mcpUrl, rows }: BuildReportOpts): ModelReport {
|
||||
const scenarios = SCENARIO_NAMES;
|
||||
const byScenario: Record<string, { total: number; correct: number; reviewed: number; duckUsed: number; toolCalls: number; promptTokens: number[]; genTokens: number[]; duckTokens: number[]; rows: PerTaskRow[] }> = {};
|
||||
for (const s of scenarios) byScenario[s] = { total: 0, correct: 0, reviewed: 0, duckUsed: 0, toolCalls: 0, promptTokens: [], genTokens: [], duckTokens: [], rows: [] };
|
||||
@@ -60,11 +58,8 @@ export function buildReport({ model, mcpUrl, rows, meta = {}, prompts = {} }: Bu
|
||||
}
|
||||
|
||||
return {
|
||||
generatedAt: new Date().toISOString(),
|
||||
model,
|
||||
mcpUrl,
|
||||
scenarios: summaries,
|
||||
prompts: prompts as Record<ScenarioName, string>,
|
||||
perTask: rows.map((r) => ({
|
||||
id: r.id,
|
||||
scenario: r.scenario,
|
||||
@@ -78,7 +73,6 @@ export function buildReport({ model, mcpUrl, rows, meta = {}, prompts = {} }: Bu
|
||||
expected: r.expected,
|
||||
question: r.question,
|
||||
})),
|
||||
meta,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user