Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/src/platform/endpoint/node/proxyAgenticEndpoint.ts
13400 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
import { RequestMetadata, RequestType } from '@vscode/copilot-api';
7
import { TokenizerType } from '../../../util/common/tokenizer';
8
import { IInstantiationService } from '../../../util/vs/platform/instantiation/common/instantiation';
9
import { IAuthenticationService } from '../../authentication/common/authentication';
10
import { IChatMLFetcher } from '../../chat/common/chatMLFetcher';
11
import { IConfigurationService } from '../../configuration/common/configurationService';
12
import { ILogService } from '../../log/common/logService';
13
import { IFetcherService } from '../../networking/common/fetcherService';
14
import { IChatWebSocketManager } from '../../networking/node/chatWebSocketManager';
15
import { IExperimentationService } from '../../telemetry/common/nullExperimentationService';
16
import { ITelemetryService } from '../../telemetry/common/telemetry';
17
import { ITokenizerProvider } from '../../tokenizer/node/tokenizer';
18
import { ICAPIClientService } from '../common/capiClient';
19
import { IDomainService } from '../common/domainService';
20
import { IChatModelInformation } from '../common/endpointProvider';
21
import { ChatEndpoint } from './chatEndpoint';
22
23
export class ProxyAgenticEndpoint extends ChatEndpoint {
24
25
constructor(
26
modelName: string,
27
@IDomainService domainService: IDomainService,
28
@ICAPIClientService capiClientService: ICAPIClientService,
29
@IFetcherService fetcherService: IFetcherService,
30
@ITelemetryService telemetryService: ITelemetryService,
31
@IAuthenticationService authService: IAuthenticationService,
32
@IChatMLFetcher chatMLFetcher: IChatMLFetcher,
33
@ITokenizerProvider tokenizerProvider: ITokenizerProvider,
34
@IInstantiationService instantiationService: IInstantiationService,
35
@IConfigurationService configurationService: IConfigurationService,
36
@IExperimentationService experimentationService: IExperimentationService,
37
@IChatWebSocketManager chatWebSocketService: IChatWebSocketManager,
38
@ILogService logService: ILogService,
39
) {
40
const model = modelName;
41
const modelInfo: IChatModelInformation = {
42
id: model,
43
name: model,
44
vendor: model,
45
version: 'unknown',
46
model_picker_enabled: false,
47
is_chat_default: false,
48
is_chat_fallback: false,
49
capabilities: {
50
type: 'chat',
51
family: model,
52
tokenizer: TokenizerType.O200K,
53
supports: { streaming: true, parallel_tool_calls: true, tool_calls: true, vision: false },
54
limits: {
55
max_prompt_tokens: 260000,
56
max_output_tokens: 16000,
57
}
58
}
59
};
60
super(
61
modelInfo,
62
domainService,
63
chatMLFetcher,
64
tokenizerProvider,
65
instantiationService,
66
configurationService,
67
experimentationService,
68
chatWebSocketService,
69
logService
70
);
71
}
72
73
override get urlOrRequestMetadata(): RequestMetadata {
74
return { type: RequestType.ProxyChatCompletions };
75
}
76
}
77
78