@@ -20,6 +20,7 @@ import { ILLMMessageService } from '../common/sendLLMMessageService.js';
2020import { isWindows } from '../../../../base/common/platform.js' ;
2121import { IVoidSettingsService } from '../common/voidSettingsService.js' ;
2222import { FeatureName } from '../common/voidSettingsTypes.js' ;
23+ import { IConvertToLLMMessageService } from './convertToLLMMessageService.js' ;
2324// import { IContextGatheringService } from './contextGatheringService.js';
2425
2526
@@ -791,18 +792,21 @@ export class AutocompleteService extends Disposable implements IAutocompleteServ
791792 const featureName : FeatureName = 'Autocomplete'
792793 const modelSelection = this . _settingsService . state . modelSelectionOfFeature [ featureName ]
793794 const modelSelectionOptions = modelSelection ? this . _settingsService . state . optionsOfModelSelection [ featureName ] [ modelSelection . providerName ] ?. [ modelSelection . modelName ] : undefined
794-
795+ const aiInstructions = this . _settingsService . state . globalSettings . aiInstructions
795796
796797 // set parameters of `newAutocompletion` appropriately
797798 newAutocompletion . llmPromise = new Promise ( ( resolve , reject ) => {
798799
799800 const requestId = this . _llmMessageService . sendLLMMessage ( {
800801 messagesType : 'FIMMessage' ,
801- messages : {
802- prefix : llmPrefix ,
803- suffix : llmSuffix ,
804- stopTokens : stopTokens ,
805- } ,
802+ messages : this . _convertToLLMMessageService . prepareFIMMessage ( {
803+ messages : {
804+ prefix : llmPrefix ,
805+ suffix : llmSuffix ,
806+ stopTokens : stopTokens ,
807+ } ,
808+ aiInstructions
809+ } ) ,
806810 modelSelection,
807811 modelSelectionOptions,
808812 logging : { loggingName : 'Autocomplete' } ,
@@ -890,6 +894,7 @@ export class AutocompleteService extends Disposable implements IAutocompleteServ
890894 @IEditorService private readonly _editorService : IEditorService ,
891895 @IModelService private readonly _modelService : IModelService ,
892896 @IVoidSettingsService private readonly _settingsService : IVoidSettingsService ,
897+ @IConvertToLLMMessageService private readonly _convertToLLMMessageService : IConvertToLLMMessageService
893898 // @IContextGatheringService private readonly _contextGatheringService: IContextGatheringService,
894899 ) {
895900 super ( )
0 commit comments