Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/src/extension/chat/vscode-node/chatQuota.contribution.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
import { commands, env, Uri } from 'vscode';
6
import { IChatQuotaService } from '../../../platform/chat/common/chatQuotaService';
7
import { Disposable } from '../../../util/vs/base/common/lifecycle';
8
import { IExtensionContribution } from '../../common/contributions';
9
10
export class ChatQuotaContribution extends Disposable implements IExtensionContribution {
11
public readonly id = 'chat.quota';
12
13
constructor(@IChatQuotaService chatQuotaService: IChatQuotaService) {
14
super();
15
this._register(commands.registerCommand('chat.enableAdditionalUsage', () => {
16
// Clear quota before opening the page to ensure that if the user enabled additional usage,
17
// the next request they send won't try to downgrade them to the base model.
18
chatQuotaService.clearQuota();
19
env.openExternal(Uri.parse('https://aka.ms/github-copilot-manage-overage'));
20
}));
21
}
22
}
23
24