1/*--------------------------------------------------------------------------------------------- 2 * Copyright (c) Microsoft Corporation. All rights reserved. 3 * Licensed under the MIT License. See License.txt in the project root for license information. 4 *--------------------------------------------------------------------------------------------*/ 5 6const autoModelId = 'copilot/auto'; 7 8/** 9 * When the user has selected the "auto" model, replace the modelId with 10 * the actual model that served the request so that downstream telemetry 11 * reflects the resolved model rather than the opaque "copilot/auto" identifier. 12 */ 13export function resolveModelIdForTelemetry(modelId: string, resolvedModel: string | undefined): string { 14 return modelId === autoModelId ? (resolvedModel || autoModelId) : modelId; 15} 16 17