@@ -17,11 +17,7 @@ import { DatabaseItem } from "../databases/local-databases";
1717import { Mode } from "./shared/mode" ;
1818import { CancellationTokenSource } from "vscode" ;
1919import { ModelingStore } from "./modeling-store" ;
20-
21- // Limit the number of candidates we send to the model in each request
22- // to avoid long requests.
23- // Note that the model may return fewer than this number of candidates.
24- const candidateBatchSize = 20 ;
20+ import { ModelConfigListener } from "../config" ;
2521
2622/**
2723 * The auto-modeler holds state around auto-modeling jobs and allows
@@ -36,6 +32,7 @@ export class AutoModeler {
3632 private readonly app : App ,
3733 private readonly cliServer : CodeQLCliServer ,
3834 private readonly queryRunner : QueryRunner ,
35+ private readonly modelConfig : ModelConfigListener ,
3936 private readonly modelingStore : ModelingStore ,
4037 private readonly queryStorageDir : string ,
4138 private readonly databaseItem : DatabaseItem ,
@@ -109,6 +106,9 @@ export class AutoModeler {
109106 cancellationTokenSource : CancellationTokenSource ,
110107 ) : Promise < void > {
111108 void extLogger . log ( `Modeling package ${ packageName } ` ) ;
109+
110+ const candidateBatchSize = this . modelConfig . llmGenerationBatchSize ;
111+
112112 await withProgress ( async ( progress ) => {
113113 // Fetch the candidates to send to the model
114114 const allCandidateMethods = getCandidates ( mode , methods , modeledMethods ) ;
0 commit comments