Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/src/extension/conversation/vscode-node/resolveModelId.ts
13399 views
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
6
const 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
*/
13
export function resolveModelIdForTelemetry(modelId: string, resolvedModel: string | undefined): string {
14
return modelId === autoModelId ? (resolvedModel || autoModelId) : modelId;
15
}
16
17