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