Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web-codegen-scorer",
"version": "0.0.21",
"version": "0.0.23",
"scripts": {
"build-runner": "tsc",
"release-build": "tsx ./scripts/release-build.ts",
Expand Down
3 changes: 2 additions & 1 deletion report-app/src/app/shared/provider-label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const exactMatches: Record<string, string> = {
height: 24px;
}

:host-context(.dark-mode) :host(.genkit) .logo {
:host-context(.dark-mode) :host(.genkit) .logo,
:host-context(.dark-mode) :host(.next) .logo {
filter: invert(1);
}
`,
Expand Down
14 changes: 9 additions & 5 deletions runner/orchestration/generate-summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,17 @@ export async function prepareSummary(
console.log(`✨ Generating AI summary for evaluation run..`);
try {
const result = await summarizeReportWithAI(genkit, abortSignal, assessments);
inputTokens += result.usage.inputTokens;
outputTokens += result.usage.outputTokens;
totalTokens += result.usage.totalTokens;
aiSummary = result.responseHtml;
console.log(`✅ Generated AI summary.`);

if (result !== null) {
inputTokens += result.usage.inputTokens;
outputTokens += result.usage.outputTokens;
totalTokens += result.usage.totalTokens;
aiSummary = result.responseHtml;
console.log(`✅ Generated AI summary.`);
}
} catch (e) {
console.log(`${redX()} Failed to generate AI summary, skipping summary.`);

if ((e as Partial<Error>).stack) {
console.error((e as Error).stack);
}
Expand Down
15 changes: 8 additions & 7 deletions runner/reporting/report-ai-summary.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import {GenkitRunner} from '../codegen/genkit/genkit-runner.js';
import {
AssessmentResult,
ReportContextFilter,
RatingContextFilter,
AiChatContextFilters,
} from '../shared-interfaces.js';
import {AssessmentResult, ReportContextFilter, RatingContextFilter} from '../shared-interfaces.js';
import {chatWithReportAI} from './report-ai-chat.js';

export async function summarizeReportWithAI(
llm: GenkitRunner,
abortSignal: AbortSignal,
assessments: AssessmentResult[],
) {
const model = 'gemini-2.5-flash-lite';

if (!llm.getSupportedModels().includes(model)) {
return null;
}

return chatWithReportAI(
llm,
`Strictly follow the instructions here.
Expand All @@ -31,7 +32,7 @@ Categorize the failures and provide a brief summary of the report. Keep it short
assessments,
[],
// For AI summaries we use lite model as it's faster and cheaper (+ reduces rate limiting)
'gemini-2.5-flash-lite',
model,
{
reportContextFilter: ReportContextFilter.NonPerfectReports,
ratingContextFilter: RatingContextFilter.NonPerfectRatings,
Expand Down
Loading