import type { LanguageModelChat } from 'vscode'; import { Event } from '../../../util/vs/base/common/event'; import { Disposable } from '../../../util/vs/base/common/lifecycle'; import { IInstantiationService } from '../../../util/vs/platform/instantiation/common/instantiation'; import { IAuthenticationService } from '../../authentication/common/authentication'; import { IConfigurationService } from '../../configuration/common/configurationService'; import { IEnvService } from '../../env/common/envService'; import { IOctoKitService } from '../../github/common/githubService'; import { ILogService } from '../../log/common/logService'; import { IRequestLogger } from '../../requestLogger/common/requestLogger'; import { IExperimentationService } from '../../telemetry/common/nullExperimentationService'; import { IChatModelInformation, ICompletionModelInformation, IEmbeddingModelInformation } from '../common/endpointProvider'; export interface IModelMetadataFetcher { /** * Fires whenever we refresh the models from the server. * Does not always indicate there is a change, just that the data is fresh */ onDidModelsRefresh: Event; /** * Gets all the completion models known by the model fetcher endpoint */ getAllCompletionModels(forceRefresh: boolean): Promise; /** * Gets all the chat models known by the model fetcher endpoint */ getAllChatModels(): Promise; /** * Retrieves the API-marked default Copilot utility model — the model * the CAPI `/models` response flags with `is_chat_fallback === true`. * Used to back the `copilot-utility` internal endpoint family. */ getCopilotUtilityModel(): Promise; /** * Retrieves a chat model by its CAPI family identifier (e.g. * `gpt-4o-mini`, `claude-sonnet-4`). The family must match * `IChatModelCapabilities.family` of a model returned from the * `/models` endpoint. * @param family The CAPI family identifier of the model to fetch */ getChatModelFromCapiFamily(family: string): Promise; /** * Retrieves a chat model by its id * @param id The id of the chat model you want to get * @returns The chat model information if found, otherwise undefined */ getChatModelFromApiModel(model: LanguageModelChat): Promise; /** * Retrieves an embeddings model by its family name * @param family The family of the model to fetch */ getEmbeddingsModel(family: 'text-embedding-3-small'): Promise; } /** * Responsible for interacting with the CAPI Model API * This is solely owned by the EndpointProvider (and TestEndpointProvider) which uses this service to power server side rollout of models * All model acquisition should be done through the EndpointProvider */ export declare class ModelMetadataFetcher extends Disposable implements IModelMetadataFetcher { protected readonly _isModelLab: boolean; private readonly _octoKitService; private readonly _requestLogger; private readonly _configService; private readonly _expService; private readonly _envService; private readonly _authService; private readonly _logService; private readonly _instantiationService; private static readonly ALL_MODEL_KEY; private _familyMap; private _completionsFamilyMap; private _copilotUtilityModel; private _lastFetchTime; private readonly _taskSingler; private _lastFetchError; private readonly _onDidModelRefresh; onDidModelsRefresh: Event; constructor(_isModelLab: boolean, _octoKitService: IOctoKitService, _requestLogger: IRequestLogger, _configService: IConfigurationService, _expService: IExperimentationService, _envService: IEnvService, _authService: IAuthenticationService, _logService: ILogService, _instantiationService: IInstantiationService); getAllCompletionModels(forceRefresh: boolean): Promise; getAllChatModels(): Promise; /** * Hydrates a model API response from the `/models` endpoint with proper exp overrides and error handling * @param resolvedModel The resolved model to hydrate * @returns The resolved model with proper exp overrides and token counts */ private _hydrateResolvedModel; getCopilotUtilityModel(): Promise; getChatModelFromCapiFamily(family: string): Promise; getChatModelFromApiModel(apiModel: LanguageModelChat): Promise; getEmbeddingsModel(family: 'text-embedding-3-small'): Promise; private _shouldRefreshModels; private _fetchModels; private _getMaxPromptTokensOverride; private _getErrorMessage; private _getShowInModelPickerOverride; } //# sourceMappingURL=modelMetadataFetcher.d.ts.map