mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-29 19:59:19 +01:00
chore: deprecate embeddingsOnly search (#283217)
This commit is contained in:
@@ -20,7 +20,7 @@ import { IAiSettingsSearchService } from '../../../services/aiSettingsSearch/com
|
||||
import { IWorkbenchExtensionEnablementService } from '../../../services/extensionManagement/common/extensionManagement.js';
|
||||
import { IGroupFilter, ISearchResult, ISetting, ISettingMatch, ISettingMatcher, ISettingsEditorModel, ISettingsGroup, SettingKeyMatchTypes, SettingMatchType } from '../../../services/preferences/common/preferences.js';
|
||||
import { nullRange } from '../../../services/preferences/common/preferencesModels.js';
|
||||
import { EMBEDDINGS_ONLY_SEARCH_PROVIDER_NAME, EMBEDDINGS_SEARCH_PROVIDER_NAME, IAiSearchProvider, IPreferencesSearchService, IRemoteSearchProvider, ISearchProvider, IWorkbenchSettingsConfiguration, LLM_RANKED_SEARCH_PROVIDER_NAME, STRING_MATCH_SEARCH_PROVIDER_NAME, TF_IDF_SEARCH_PROVIDER_NAME } from '../common/preferences.js';
|
||||
import { EMBEDDINGS_SEARCH_PROVIDER_NAME, IAiSearchProvider, IPreferencesSearchService, IRemoteSearchProvider, ISearchProvider, IWorkbenchSettingsConfiguration, LLM_RANKED_SEARCH_PROVIDER_NAME, STRING_MATCH_SEARCH_PROVIDER_NAME, TF_IDF_SEARCH_PROVIDER_NAME } from '../common/preferences.js';
|
||||
|
||||
export interface IEndpointDetails {
|
||||
urlBase?: string;
|
||||
@@ -409,8 +409,7 @@ class EmbeddingsSearchProvider implements IRemoteSearchProvider {
|
||||
private _filter: string = '';
|
||||
|
||||
constructor(
|
||||
private readonly _aiSettingsSearchService: IAiSettingsSearchService,
|
||||
private readonly _excludeSelectionStep: boolean
|
||||
private readonly _aiSettingsSearchService: IAiSettingsSearchService
|
||||
) {
|
||||
this._recordProvider = new SettingsRecordProvider();
|
||||
}
|
||||
@@ -425,7 +424,7 @@ class EmbeddingsSearchProvider implements IRemoteSearchProvider {
|
||||
}
|
||||
|
||||
this._recordProvider.updateModel(preferencesModel);
|
||||
this._aiSettingsSearchService.startSearch(this._filter, this._excludeSelectionStep, token);
|
||||
this._aiSettingsSearchService.startSearch(this._filter, token);
|
||||
|
||||
return {
|
||||
filterMatches: await this.getEmbeddingsItems(token),
|
||||
@@ -441,7 +440,7 @@ class EmbeddingsSearchProvider implements IRemoteSearchProvider {
|
||||
return [];
|
||||
}
|
||||
|
||||
const providerName = this._excludeSelectionStep ? EMBEDDINGS_ONLY_SEARCH_PROVIDER_NAME : EMBEDDINGS_SEARCH_PROVIDER_NAME;
|
||||
const providerName = EMBEDDINGS_SEARCH_PROVIDER_NAME;
|
||||
for (const settingKey of settings) {
|
||||
if (filterMatches.length === EmbeddingsSearchProvider.EMBEDDINGS_SETTINGS_SEARCH_MAX_PICKS) {
|
||||
break;
|
||||
@@ -589,7 +588,7 @@ class AiSearchProvider implements IAiSearchProvider {
|
||||
constructor(
|
||||
@IAiSettingsSearchService private readonly aiSettingsSearchService: IAiSettingsSearchService
|
||||
) {
|
||||
this._embeddingsSearchProvider = new EmbeddingsSearchProvider(this.aiSettingsSearchService, false);
|
||||
this._embeddingsSearchProvider = new EmbeddingsSearchProvider(this.aiSettingsSearchService);
|
||||
this._recordProvider = new SettingsRecordProvider();
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,6 @@ export const EXTENSION_FETCH_TIMEOUT_MS = 1000;
|
||||
export const STRING_MATCH_SEARCH_PROVIDER_NAME = 'local';
|
||||
export const TF_IDF_SEARCH_PROVIDER_NAME = 'tfIdf';
|
||||
export const FILTER_MODEL_SEARCH_PROVIDER_NAME = 'filterModel';
|
||||
export const EMBEDDINGS_ONLY_SEARCH_PROVIDER_NAME = 'embeddingsOnly';
|
||||
export const EMBEDDINGS_SEARCH_PROVIDER_NAME = 'embeddingsFull';
|
||||
export const LLM_RANKED_SEARCH_PROVIDER_NAME = 'llmRanked';
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ export interface IAiSettingsSearchService {
|
||||
|
||||
// Called from the Settings editor
|
||||
isEnabled(): boolean;
|
||||
startSearch(query: string, embeddingsOnly: boolean, token: CancellationToken): void;
|
||||
startSearch(query: string, token: CancellationToken): void;
|
||||
getEmbeddingsResults(query: string, token: CancellationToken): Promise<string[] | null>;
|
||||
getLLMRankedResults(query: string, token: CancellationToken): Promise<string[] | null>;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ export class AiSettingsSearchService extends Disposable implements IAiSettingsSe
|
||||
};
|
||||
}
|
||||
|
||||
startSearch(query: string, embeddingsOnly: boolean, token: CancellationToken): void {
|
||||
startSearch(query: string, token: CancellationToken): void {
|
||||
if (!this.isEnabled()) {
|
||||
throw new Error('No settings search providers registered');
|
||||
}
|
||||
@@ -46,7 +46,7 @@ export class AiSettingsSearchService extends Disposable implements IAiSettingsSe
|
||||
this._embeddingsResultsPromises.delete(query);
|
||||
this._llmRankedResultsPromises.delete(query);
|
||||
|
||||
this._providers.forEach(provider => provider.searchSettings(query, { limit: AiSettingsSearchService.MAX_PICKS, embeddingsOnly }, token));
|
||||
this._providers.forEach(provider => provider.searchSettings(query, { limit: AiSettingsSearchService.MAX_PICKS, embeddingsOnly: false }, token));
|
||||
}
|
||||
|
||||
async getEmbeddingsResults(query: string, token: CancellationToken): Promise<string[] | null> {
|
||||
|
||||
Reference in New Issue
Block a user