forked from angular/web-codegen-scorer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreport-ai-summary.ts
More file actions
31 lines (27 loc) · 1.2 KB
/
report-ai-summary.ts
File metadata and controls
31 lines (27 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import {GenkitRunner} from '../codegen/genkit/genkit-runner.js';
import {AssessmentResult} from '../shared-interfaces.js';
import {chatWithReportAI} from './report-ai-chat.js';
export async function summarizeReportWithAI(
llm: GenkitRunner,
abortSignal: AbortSignal,
assessments: AssessmentResult[],
) {
return chatWithReportAI(
llm,
`Strictly follow the instructions here.
- You will receive a report of an evaluation tool that describes LLM-generated code quality. Summarize/categorize the report.
- Quote exact build failures, or assessment checks when possible.
- Try to keep the summary short. e.g. cut off app names to reduce output length.
- Do not add an overview of scores unless necessary to illustrate common failures or low-hanging fruit.
**Your primary goals (two)**:
- Make it easy to understand what common failures are,
- Make it easy to identify low-hanging fruit that we can fix to improve code generation for LLMs.
--
Categorize the failures and provide a brief summary of the report. Keep it short but insightful!`,
abortSignal,
assessments,
[],
// For AI summaries we use lite model as it's faster and cheaper (+ reduces rate limiting)
'gemini-2.5-flash-lite',
);
}