@@ -6,7 +6,11 @@ import PQueue from 'p-queue';
6
6
import { basename , join } from 'path' ;
7
7
import { existsSync , readdirSync } from 'fs' ;
8
8
import { LlmGenerateFilesContext , LlmRunner } from '../codegen/llm-runner.js' ;
9
- import { LLM_OUTPUT_DIR , REPORT_VERSION } from '../configuration/constants.js' ;
9
+ import {
10
+ DEFAULT_AUTORATER_MODEL_NAME ,
11
+ LLM_OUTPUT_DIR ,
12
+ REPORT_VERSION ,
13
+ } from '../configuration/constants.js' ;
10
14
import { Environment } from '../configuration/environment.js' ;
11
15
import { rateGeneratedCode } from '../ratings/rate-code.js' ;
12
16
import { summarizeReportWithAI } from '../reporting/ai-summarize.js' ;
@@ -77,6 +81,7 @@ export async function generateCodeAndAssess(options: {
77
81
enableUserJourneyTesting ?: boolean ;
78
82
enableAutoCsp ?: boolean ;
79
83
logging ?: 'text-only' | 'dynamic' ;
84
+ autoraterModel ?: string ;
80
85
} ) : Promise < RunInfo > {
81
86
const env = await getEnvironmentByPath ( options . environmentConfigPath ) ;
82
87
const promptsToProcess = getCandidateExecutablePrompts (
@@ -163,7 +168,8 @@ export async function generateCodeAndAssess(options: {
163
168
! ! options . enableUserJourneyTesting ,
164
169
! ! options . enableAutoCsp ,
165
170
workerConcurrencyQueue ,
166
- progress
171
+ progress ,
172
+ options . autoraterModel || DEFAULT_AUTORATER_MODEL_NAME
167
173
) ,
168
174
// 10min max per app evaluation. We just want to make sure it never gets stuck.
169
175
10
@@ -291,7 +297,8 @@ async function startEvaluationTask(
291
297
enableUserJourneyTesting : boolean ,
292
298
enableAutoCsp : boolean ,
293
299
workerConcurrencyQueue : PQueue ,
294
- progress : ProgressLogger
300
+ progress : ProgressLogger ,
301
+ autoraterModel : string
295
302
) : Promise < AssessmentResult [ ] > {
296
303
// Set up the project structure once for the root project.
297
304
const { directory, cleanup } = await setupProjectStructure (
@@ -444,7 +451,8 @@ async function startEvaluationTask(
444
451
attempt . repairAttempts ,
445
452
attempt . axeRepairAttempts ,
446
453
abortSignal ,
447
- progress
454
+ progress ,
455
+ autoraterModel
448
456
) ;
449
457
450
458
results . push ( {
0 commit comments