Path: blob/main/extensions/copilot/src/platform/endpoint/node/proxyModelHelper.ts
13400 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { ExperimentBasedConfig, IConfigurationService } from '../../configuration/common/configurationService';6import { IProxyModelsService } from '../../proxyModels/common/proxyModelsService';7import { IExperimentationService } from '../../telemetry/common/nullExperimentationService';89/**10* Determines which model to use for instant apply endpoints.11* Uses the proxy models service when available, falling back to the config-based model name.12*/13export function getInstantApplyModel(14configurationService: IConfigurationService,15experimentationService: IExperimentationService,16proxyModelsService: IProxyModelsService,17modelNameConfig: ExperimentBasedConfig<string>,18): string {19const instantApplyModels = proxyModelsService.instantApplyModels;2021return (instantApplyModels && instantApplyModels.length > 0)22? instantApplyModels[0].name23: configurationService.getExperimentBasedConfig(modelNameConfig, experimentationService);24}252627