@@ -338,9 +338,45 @@ async function intermediateToFinalConfig(
338
338
if ( config . tabAutocompleteModels ) {
339
339
tabAutocompleteModels = (
340
340
await Promise . all (
341
- ( Array . isArray ( config . tabAutocompleteModel )
342
- ? config . tabAutocompleteModel
343
- : [ config . tabAutocompleteModel ]
341
+ ( Array . isArray ( config . tabAutocompleteModels )
342
+ ? config . tabAutocompleteModels
343
+ : [ config . tabAutocompleteModels ]
344
+ ) . map ( async ( desc ) => {
345
+ if ( isModelDescription ( desc ) ) {
346
+ const llm = await llmFromDescription (
347
+ desc ,
348
+ ide . readFile . bind ( ide ) ,
349
+ uniqueId ,
350
+ ideSettings ,
351
+ writeLog ,
352
+ config . completionOptions ,
353
+ config . systemMessage ,
354
+ ) ;
355
+
356
+ if ( llm ?. providerName === "free-trial" ) {
357
+ if ( ! allowFreeTrial ) {
358
+ // This shouldn't happen
359
+ throw new Error ( "Free trial cannot be used with control plane" ) ;
360
+ }
361
+ const ghAuthToken = await ide . getGitHubAuthToken ( ) ;
362
+ ( llm as FreeTrial ) . setupGhAuthToken ( ghAuthToken ) ;
363
+ }
364
+ return llm ;
365
+ } else {
366
+ return new CustomLLMClass ( desc ) ;
367
+ }
368
+ } ) ,
369
+ )
370
+ ) . filter ( ( x ) => x !== undefined ) as BaseLLM [ ] ;
371
+
372
+ // Command model
373
+ let commandModels : BaseLLM [ ] = [ ] ;
374
+ if ( config . commandModels ) {
375
+ commandModels = (
376
+ await Promise . all (
377
+ ( Array . isArray ( config . commandModels )
378
+ ? config . commandModels
379
+ : [ config . commandModels ]
344
380
) . map ( async ( desc ) => {
345
381
if ( isModelDescription ( desc ) ) {
346
382
const llm = await llmFromDescription (
@@ -440,6 +476,7 @@ async function intermediateToFinalConfig(
440
476
reranker : config . reranker as any ,
441
477
} ;
442
478
}
479
+ }
443
480
444
481
function finalToBrowserConfig (
445
482
final : ContinueConfig ,
0 commit comments