Add isModelProxyAvailable (#271872)

* Add isModelProxyAvailable

* tests
This commit is contained in:
Rob Lourens
2025-10-16 21:11:11 -07:00
committed by GitHub
parent 820f258920
commit ec8586ef25
4 changed files with 46 additions and 16 deletions

View File

@@ -27,14 +27,17 @@ import { ExtensionDescriptionRegistry } from '../../services/extensions/common/e
import { UIKind } from '../../services/extensions/common/extensionHostProtocol.js';
import { checkProposedApiEnabled, isProposedApiEnabled } from '../../services/extensions/common/extensions.js';
import { ProxyIdentifier } from '../../services/extensions/common/proxyIdentifier.js';
import { ExcludeSettingOptions, TextSearchCompleteMessageType, TextSearchContext2, TextSearchMatch2, AISearchKeyword } from '../../services/search/common/searchExtTypes.js';
import { AISearchKeyword, ExcludeSettingOptions, TextSearchCompleteMessageType, TextSearchContext2, TextSearchMatch2 } from '../../services/search/common/searchExtTypes.js';
import { CandidatePortSource, ExtHostContext, ExtHostLogLevelServiceShape, MainContext } from './extHost.protocol.js';
import { ExtHostRelatedInformation } from './extHostAiRelatedInformation.js';
import { ExtHostAiSettingsSearch } from './extHostAiSettingsSearch.js';
import { ExtHostApiCommands } from './extHostApiCommands.js';
import { IExtHostApiDeprecationService } from './extHostApiDeprecationService.js';
import { IExtHostAuthentication } from './extHostAuthentication.js';
import { ExtHostBulkEdits } from './extHostBulkEdits.js';
import { ExtHostChatAgents2 } from './extHostChatAgents2.js';
import { ExtHostChatOutputRenderer } from './extHostChatOutputRenderer.js';
import { ExtHostChatSessions } from './extHostChatSessions.js';
import { ExtHostChatStatus } from './extHostChatStatus.js';
import { ExtHostClipboard } from './extHostClipboard.js';
import { ExtHostEditorInsets } from './extHostCodeInsets.js';
@@ -111,9 +114,6 @@ import { ExtHostWebviewPanels } from './extHostWebviewPanels.js';
import { ExtHostWebviewViews } from './extHostWebviewView.js';
import { IExtHostWindow } from './extHostWindow.js';
import { IExtHostWorkspace } from './extHostWorkspace.js';
import { ExtHostAiSettingsSearch } from './extHostAiSettingsSearch.js';
import { ExtHostChatSessions } from './extHostChatSessions.js';
import { ExtHostChatOutputRenderer } from './extHostChatOutputRenderer.js';
export interface IExtensionRegistries {
mine: ExtensionDescriptionRegistry;
@@ -1552,6 +1552,14 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
registerLanguageModelChatProvider: (vendor, provider) => {
return extHostLanguageModels.registerLanguageModelChatProvider(extension, vendor, provider);
},
get isModelProxyAvailable() {
checkProposedApiEnabled(extension, 'languageModelProxy');
return extHostLanguageModels.isModelProxyAvailable;
},
onDidChangeModelProxyAvailability: (listener, thisArgs?, disposables?) => {
checkProposedApiEnabled(extension, 'languageModelProxy');
return extHostLanguageModels.onDidChangeModelProxyAvailability(listener, thisArgs, disposables);
},
getModelProxy: () => {
checkProposedApiEnabled(extension, 'languageModelProxy');
return extHostLanguageModels.getModelProxy(extension);