Skip to content

Commit 123f7f9

Browse files
committed
refactor: add logging for AI summary generation
Summary generation can take quite a while, especially with many eval apps. We should print a message to avoid confusion around the process looking stuck.
1 parent 5d8779a commit 123f7f9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

runner/orchestration/generate-summary.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,16 @@ export async function prepareSummary(
4141

4242
let aiSummary: string | undefined = undefined;
4343
if (!opts.skipAiSummary) {
44+
console.log(`✨ Generating AI summary for evaluation run..`);
4445
try {
4546
const result = await summarizeReportWithAI(genkit, abortSignal, assessments);
4647
inputTokens += result.usage.inputTokens;
4748
outputTokens += result.usage.outputTokens;
4849
totalTokens += result.usage.totalTokens;
4950
aiSummary = result.responseHtml;
51+
console.log(`✅ Generated AI summary.`);
5052
} catch (e) {
51-
console.error(`${redX()} Failed to generate AI summary for report: ${e}`);
53+
console.log(`${redX()} Failed to generate AI summary, skipping summary.`);
5254
if ((e as Partial<Error>).stack) {
5355
console.error((e as Error).stack);
5456
}

0 commit comments

Comments
 (0)